viresh kumar | bc4e814 | 2010-04-01 12:30:58 +0100 | [diff] [blame] | 1 | /* |
| 2 | * arch/arm/mach-spear3xx/spear310.c |
| 3 | * |
| 4 | * SPEAr310 machine source file |
| 5 | * |
| 6 | * Copyright (C) 2009 ST Microelectronics |
| 7 | * Viresh Kumar<viresh.kumar@st.com> |
| 8 | * |
| 9 | * This file is licensed under the terms of the GNU General Public |
| 10 | * License version 2. This program is licensed "as is" without any |
| 11 | * warranty of any kind, whether express or implied. |
| 12 | */ |
| 13 | |
| 14 | #include <linux/ptrace.h> |
| 15 | #include <asm/irq.h> |
viresh kumar | 410782b | 2011-03-07 05:57:01 +0100 | [diff] [blame] | 16 | #include <plat/shirq.h> |
viresh kumar | bc4e814 | 2010-04-01 12:30:58 +0100 | [diff] [blame] | 17 | #include <mach/generic.h> |
viresh kumar | 02aa06b | 2011-03-07 05:57:02 +0100 | [diff] [blame] | 18 | #include <mach/hardware.h> |
viresh kumar | bc4e814 | 2010-04-01 12:30:58 +0100 | [diff] [blame] | 19 | |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 20 | /* pad multiplexing support */ |
| 21 | /* muxing registers */ |
| 22 | #define PAD_MUX_CONFIG_REG 0x08 |
| 23 | |
| 24 | /* devices */ |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 25 | static struct pmx_dev_mode pmx_emi_cs_0_1_4_5_modes[] = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 26 | { |
| 27 | .ids = 0x00, |
| 28 | .mask = PMX_TIMER_3_4_MASK, |
| 29 | }, |
| 30 | }; |
| 31 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 32 | struct pmx_dev spear310_pmx_emi_cs_0_1_4_5 = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 33 | .name = "emi_cs_0_1_4_5", |
| 34 | .modes = pmx_emi_cs_0_1_4_5_modes, |
| 35 | .mode_count = ARRAY_SIZE(pmx_emi_cs_0_1_4_5_modes), |
| 36 | .enb_on_reset = 1, |
| 37 | }; |
| 38 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 39 | static struct pmx_dev_mode pmx_emi_cs_2_3_modes[] = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 40 | { |
| 41 | .ids = 0x00, |
| 42 | .mask = PMX_TIMER_1_2_MASK, |
| 43 | }, |
| 44 | }; |
| 45 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 46 | struct pmx_dev spear310_pmx_emi_cs_2_3 = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 47 | .name = "emi_cs_2_3", |
| 48 | .modes = pmx_emi_cs_2_3_modes, |
| 49 | .mode_count = ARRAY_SIZE(pmx_emi_cs_2_3_modes), |
| 50 | .enb_on_reset = 1, |
| 51 | }; |
| 52 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 53 | static struct pmx_dev_mode pmx_uart1_modes[] = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 54 | { |
| 55 | .ids = 0x00, |
| 56 | .mask = PMX_FIRDA_MASK, |
| 57 | }, |
| 58 | }; |
| 59 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 60 | struct pmx_dev spear310_pmx_uart1 = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 61 | .name = "uart1", |
| 62 | .modes = pmx_uart1_modes, |
| 63 | .mode_count = ARRAY_SIZE(pmx_uart1_modes), |
| 64 | .enb_on_reset = 1, |
| 65 | }; |
| 66 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 67 | static struct pmx_dev_mode pmx_uart2_modes[] = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 68 | { |
| 69 | .ids = 0x00, |
| 70 | .mask = PMX_TIMER_1_2_MASK, |
| 71 | }, |
| 72 | }; |
| 73 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 74 | struct pmx_dev spear310_pmx_uart2 = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 75 | .name = "uart2", |
| 76 | .modes = pmx_uart2_modes, |
| 77 | .mode_count = ARRAY_SIZE(pmx_uart2_modes), |
| 78 | .enb_on_reset = 1, |
| 79 | }; |
| 80 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 81 | static struct pmx_dev_mode pmx_uart3_4_5_modes[] = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 82 | { |
| 83 | .ids = 0x00, |
| 84 | .mask = PMX_UART0_MODEM_MASK, |
| 85 | }, |
| 86 | }; |
| 87 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 88 | struct pmx_dev spear310_pmx_uart3_4_5 = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 89 | .name = "uart3_4_5", |
| 90 | .modes = pmx_uart3_4_5_modes, |
| 91 | .mode_count = ARRAY_SIZE(pmx_uart3_4_5_modes), |
| 92 | .enb_on_reset = 1, |
| 93 | }; |
| 94 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 95 | static struct pmx_dev_mode pmx_fsmc_modes[] = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 96 | { |
| 97 | .ids = 0x00, |
| 98 | .mask = PMX_SSP_CS_MASK, |
| 99 | }, |
| 100 | }; |
| 101 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 102 | struct pmx_dev spear310_pmx_fsmc = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 103 | .name = "fsmc", |
| 104 | .modes = pmx_fsmc_modes, |
| 105 | .mode_count = ARRAY_SIZE(pmx_fsmc_modes), |
| 106 | .enb_on_reset = 1, |
| 107 | }; |
| 108 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 109 | static struct pmx_dev_mode pmx_rs485_0_1_modes[] = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 110 | { |
| 111 | .ids = 0x00, |
| 112 | .mask = PMX_MII_MASK, |
| 113 | }, |
| 114 | }; |
| 115 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 116 | struct pmx_dev spear310_pmx_rs485_0_1 = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 117 | .name = "rs485_0_1", |
| 118 | .modes = pmx_rs485_0_1_modes, |
| 119 | .mode_count = ARRAY_SIZE(pmx_rs485_0_1_modes), |
| 120 | .enb_on_reset = 1, |
| 121 | }; |
| 122 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 123 | static struct pmx_dev_mode pmx_tdm0_modes[] = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 124 | { |
| 125 | .ids = 0x00, |
| 126 | .mask = PMX_MII_MASK, |
| 127 | }, |
| 128 | }; |
| 129 | |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 130 | struct pmx_dev spear310_pmx_tdm0 = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 131 | .name = "tdm0", |
| 132 | .modes = pmx_tdm0_modes, |
| 133 | .mode_count = ARRAY_SIZE(pmx_tdm0_modes), |
| 134 | .enb_on_reset = 1, |
| 135 | }; |
| 136 | |
| 137 | /* pmx driver structure */ |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 138 | static struct pmx_driver pmx_driver = { |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 139 | .mux_reg = {.offset = PAD_MUX_CONFIG_REG, .mask = 0x00007fff}, |
| 140 | }; |
| 141 | |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 142 | /* spear3xx shared irq */ |
Ryan Mallon | f6558bf | 2011-05-20 08:34:20 +0100 | [diff] [blame] | 143 | static struct shirq_dev_config shirq_ras1_config[] = { |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 144 | { |
Ryan Mallon | 61e72bc | 2011-05-20 08:34:21 +0100 | [diff] [blame] | 145 | .virq = SPEAR310_VIRQ_SMII0, |
| 146 | .status_mask = SPEAR310_SMII0_IRQ_MASK, |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 147 | }, { |
Ryan Mallon | 61e72bc | 2011-05-20 08:34:21 +0100 | [diff] [blame] | 148 | .virq = SPEAR310_VIRQ_SMII1, |
| 149 | .status_mask = SPEAR310_SMII1_IRQ_MASK, |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 150 | }, { |
Ryan Mallon | 61e72bc | 2011-05-20 08:34:21 +0100 | [diff] [blame] | 151 | .virq = SPEAR310_VIRQ_SMII2, |
| 152 | .status_mask = SPEAR310_SMII2_IRQ_MASK, |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 153 | }, { |
Ryan Mallon | 61e72bc | 2011-05-20 08:34:21 +0100 | [diff] [blame] | 154 | .virq = SPEAR310_VIRQ_SMII3, |
| 155 | .status_mask = SPEAR310_SMII3_IRQ_MASK, |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 156 | }, { |
Ryan Mallon | 61e72bc | 2011-05-20 08:34:21 +0100 | [diff] [blame] | 157 | .virq = SPEAR310_VIRQ_WAKEUP_SMII0, |
| 158 | .status_mask = SPEAR310_WAKEUP_SMII0_IRQ_MASK, |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 159 | }, { |
Ryan Mallon | 61e72bc | 2011-05-20 08:34:21 +0100 | [diff] [blame] | 160 | .virq = SPEAR310_VIRQ_WAKEUP_SMII1, |
| 161 | .status_mask = SPEAR310_WAKEUP_SMII1_IRQ_MASK, |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 162 | }, { |
Ryan Mallon | 61e72bc | 2011-05-20 08:34:21 +0100 | [diff] [blame] | 163 | .virq = SPEAR310_VIRQ_WAKEUP_SMII2, |
| 164 | .status_mask = SPEAR310_WAKEUP_SMII2_IRQ_MASK, |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 165 | }, { |
Ryan Mallon | 61e72bc | 2011-05-20 08:34:21 +0100 | [diff] [blame] | 166 | .virq = SPEAR310_VIRQ_WAKEUP_SMII3, |
| 167 | .status_mask = SPEAR310_WAKEUP_SMII3_IRQ_MASK, |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 168 | }, |
| 169 | }; |
| 170 | |
Ryan Mallon | f6558bf | 2011-05-20 08:34:20 +0100 | [diff] [blame] | 171 | static struct spear_shirq shirq_ras1 = { |
Ryan Mallon | 61e72bc | 2011-05-20 08:34:21 +0100 | [diff] [blame] | 172 | .irq = SPEAR3XX_IRQ_GEN_RAS_1, |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 173 | .dev_config = shirq_ras1_config, |
| 174 | .dev_count = ARRAY_SIZE(shirq_ras1_config), |
| 175 | .regs = { |
| 176 | .enb_reg = -1, |
Ryan Mallon | 61e72bc | 2011-05-20 08:34:21 +0100 | [diff] [blame] | 177 | .status_reg = SPEAR310_INT_STS_MASK_REG, |
| 178 | .status_reg_mask = SPEAR310_SHIRQ_RAS1_MASK, |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 179 | .clear_reg = -1, |
| 180 | }, |
| 181 | }; |
| 182 | |
Ryan Mallon | f6558bf | 2011-05-20 08:34:20 +0100 | [diff] [blame] | 183 | static struct shirq_dev_config shirq_ras2_config[] = { |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 184 | { |
Ryan Mallon | 61e72bc | 2011-05-20 08:34:21 +0100 | [diff] [blame] | 185 | .virq = SPEAR310_VIRQ_UART1, |
| 186 | .status_mask = SPEAR310_UART1_IRQ_MASK, |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 187 | }, { |
Ryan Mallon | 61e72bc | 2011-05-20 08:34:21 +0100 | [diff] [blame] | 188 | .virq = SPEAR310_VIRQ_UART2, |
| 189 | .status_mask = SPEAR310_UART2_IRQ_MASK, |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 190 | }, { |
Ryan Mallon | 61e72bc | 2011-05-20 08:34:21 +0100 | [diff] [blame] | 191 | .virq = SPEAR310_VIRQ_UART3, |
| 192 | .status_mask = SPEAR310_UART3_IRQ_MASK, |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 193 | }, { |
Ryan Mallon | 61e72bc | 2011-05-20 08:34:21 +0100 | [diff] [blame] | 194 | .virq = SPEAR310_VIRQ_UART4, |
| 195 | .status_mask = SPEAR310_UART4_IRQ_MASK, |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 196 | }, { |
Ryan Mallon | 61e72bc | 2011-05-20 08:34:21 +0100 | [diff] [blame] | 197 | .virq = SPEAR310_VIRQ_UART5, |
| 198 | .status_mask = SPEAR310_UART5_IRQ_MASK, |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 199 | }, |
| 200 | }; |
| 201 | |
Ryan Mallon | f6558bf | 2011-05-20 08:34:20 +0100 | [diff] [blame] | 202 | static struct spear_shirq shirq_ras2 = { |
Ryan Mallon | 61e72bc | 2011-05-20 08:34:21 +0100 | [diff] [blame] | 203 | .irq = SPEAR3XX_IRQ_GEN_RAS_2, |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 204 | .dev_config = shirq_ras2_config, |
| 205 | .dev_count = ARRAY_SIZE(shirq_ras2_config), |
| 206 | .regs = { |
| 207 | .enb_reg = -1, |
Ryan Mallon | 61e72bc | 2011-05-20 08:34:21 +0100 | [diff] [blame] | 208 | .status_reg = SPEAR310_INT_STS_MASK_REG, |
| 209 | .status_reg_mask = SPEAR310_SHIRQ_RAS2_MASK, |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 210 | .clear_reg = -1, |
| 211 | }, |
| 212 | }; |
| 213 | |
Ryan Mallon | f6558bf | 2011-05-20 08:34:20 +0100 | [diff] [blame] | 214 | static struct shirq_dev_config shirq_ras3_config[] = { |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 215 | { |
Ryan Mallon | 61e72bc | 2011-05-20 08:34:21 +0100 | [diff] [blame] | 216 | .virq = SPEAR310_VIRQ_EMI, |
| 217 | .status_mask = SPEAR310_EMI_IRQ_MASK, |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 218 | }, |
| 219 | }; |
| 220 | |
Ryan Mallon | f6558bf | 2011-05-20 08:34:20 +0100 | [diff] [blame] | 221 | static struct spear_shirq shirq_ras3 = { |
Ryan Mallon | 61e72bc | 2011-05-20 08:34:21 +0100 | [diff] [blame] | 222 | .irq = SPEAR3XX_IRQ_GEN_RAS_3, |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 223 | .dev_config = shirq_ras3_config, |
| 224 | .dev_count = ARRAY_SIZE(shirq_ras3_config), |
| 225 | .regs = { |
| 226 | .enb_reg = -1, |
Ryan Mallon | 61e72bc | 2011-05-20 08:34:21 +0100 | [diff] [blame] | 227 | .status_reg = SPEAR310_INT_STS_MASK_REG, |
| 228 | .status_reg_mask = SPEAR310_SHIRQ_RAS3_MASK, |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 229 | .clear_reg = -1, |
| 230 | }, |
| 231 | }; |
| 232 | |
Ryan Mallon | f6558bf | 2011-05-20 08:34:20 +0100 | [diff] [blame] | 233 | static struct shirq_dev_config shirq_intrcomm_ras_config[] = { |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 234 | { |
Ryan Mallon | 61e72bc | 2011-05-20 08:34:21 +0100 | [diff] [blame] | 235 | .virq = SPEAR310_VIRQ_TDM_HDLC, |
| 236 | .status_mask = SPEAR310_TDM_HDLC_IRQ_MASK, |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 237 | }, { |
Ryan Mallon | 61e72bc | 2011-05-20 08:34:21 +0100 | [diff] [blame] | 238 | .virq = SPEAR310_VIRQ_RS485_0, |
| 239 | .status_mask = SPEAR310_RS485_0_IRQ_MASK, |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 240 | }, { |
Ryan Mallon | 61e72bc | 2011-05-20 08:34:21 +0100 | [diff] [blame] | 241 | .virq = SPEAR310_VIRQ_RS485_1, |
| 242 | .status_mask = SPEAR310_RS485_1_IRQ_MASK, |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 243 | }, |
| 244 | }; |
| 245 | |
Ryan Mallon | f6558bf | 2011-05-20 08:34:20 +0100 | [diff] [blame] | 246 | static struct spear_shirq shirq_intrcomm_ras = { |
Ryan Mallon | 61e72bc | 2011-05-20 08:34:21 +0100 | [diff] [blame] | 247 | .irq = SPEAR3XX_IRQ_INTRCOMM_RAS_ARM, |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 248 | .dev_config = shirq_intrcomm_ras_config, |
| 249 | .dev_count = ARRAY_SIZE(shirq_intrcomm_ras_config), |
| 250 | .regs = { |
| 251 | .enb_reg = -1, |
Ryan Mallon | 61e72bc | 2011-05-20 08:34:21 +0100 | [diff] [blame] | 252 | .status_reg = SPEAR310_INT_STS_MASK_REG, |
| 253 | .status_reg_mask = SPEAR310_SHIRQ_INTRCOMM_RAS_MASK, |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 254 | .clear_reg = -1, |
| 255 | }, |
| 256 | }; |
| 257 | |
viresh kumar | c2c0783 | 2011-03-07 05:57:05 +0100 | [diff] [blame] | 258 | /* Add spear310 specific devices here */ |
| 259 | |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 260 | /* spear310 routines */ |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 261 | void __init spear310_init(struct pmx_mode *pmx_mode, struct pmx_dev **pmx_devs, |
| 262 | u8 pmx_dev_count) |
viresh kumar | bc4e814 | 2010-04-01 12:30:58 +0100 | [diff] [blame] | 263 | { |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 264 | void __iomem *base; |
| 265 | int ret = 0; |
| 266 | |
viresh kumar | bc4e814 | 2010-04-01 12:30:58 +0100 | [diff] [blame] | 267 | /* call spear3xx family common init function */ |
| 268 | spear3xx_init(); |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 269 | |
Uwe Kleine-König | b595076 | 2010-11-01 15:38:34 -0400 | [diff] [blame] | 270 | /* shared irq registration */ |
viresh kumar | 5382116 | 2011-03-07 05:57:06 +0100 | [diff] [blame] | 271 | base = ioremap(SPEAR310_SOC_CONFIG_BASE, SZ_4K); |
viresh kumar | 4c18e77 | 2010-05-03 09:24:30 +0100 | [diff] [blame] | 272 | if (base) { |
| 273 | /* shirq 1 */ |
| 274 | shirq_ras1.regs.base = base; |
| 275 | ret = spear_shirq_register(&shirq_ras1); |
| 276 | if (ret) |
| 277 | printk(KERN_ERR "Error registering Shared IRQ 1\n"); |
| 278 | |
| 279 | /* shirq 2 */ |
| 280 | shirq_ras2.regs.base = base; |
| 281 | ret = spear_shirq_register(&shirq_ras2); |
| 282 | if (ret) |
| 283 | printk(KERN_ERR "Error registering Shared IRQ 2\n"); |
| 284 | |
| 285 | /* shirq 3 */ |
| 286 | shirq_ras3.regs.base = base; |
| 287 | ret = spear_shirq_register(&shirq_ras3); |
| 288 | if (ret) |
| 289 | printk(KERN_ERR "Error registering Shared IRQ 3\n"); |
| 290 | |
| 291 | /* shirq 4 */ |
| 292 | shirq_intrcomm_ras.regs.base = base; |
| 293 | ret = spear_shirq_register(&shirq_intrcomm_ras); |
| 294 | if (ret) |
| 295 | printk(KERN_ERR "Error registering Shared IRQ 4\n"); |
| 296 | } |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 297 | |
viresh kumar | 53688c5 | 2011-02-16 07:40:30 +0100 | [diff] [blame] | 298 | /* pmx initialization */ |
| 299 | pmx_driver.base = base; |
Ryan Mallon | 6618c3a | 2011-05-20 08:34:22 +0100 | [diff] [blame] | 300 | pmx_driver.mode = pmx_mode; |
| 301 | pmx_driver.devs = pmx_devs; |
| 302 | pmx_driver.devs_count = pmx_dev_count; |
| 303 | |
viresh kumar | 53688c5 | 2011-02-16 07:40:30 +0100 | [diff] [blame] | 304 | ret = pmx_register(&pmx_driver); |
| 305 | if (ret) |
Masanari Iida | 15b9cf6d | 2012-02-14 23:35:42 +0900 | [diff] [blame] | 306 | printk(KERN_ERR "padmux: registration failed. err no: %d\n", |
viresh kumar | 53688c5 | 2011-02-16 07:40:30 +0100 | [diff] [blame] | 307 | ret); |
viresh kumar | 70f4c0b | 2010-04-01 12:31:29 +0100 | [diff] [blame] | 308 | } |