diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/mips/cavium-octeon/octeon-irq.c | 2 | ||||
-rw-r--r-- | arch/mips/cavium-octeon/octeon-platform.c | 84 | ||||
-rw-r--r-- | arch/mips/include/asm/octeon/octeon.h | 5 |
3 files changed, 0 insertions, 91 deletions
diff --git a/arch/mips/cavium-octeon/octeon-irq.c b/arch/mips/cavium-octeon/octeon-irq.c index 52610ce50dfc..2a661ad35cf7 100644 --- a/arch/mips/cavium-octeon/octeon-irq.c +++ b/arch/mips/cavium-octeon/octeon-irq.c | |||
@@ -1192,13 +1192,11 @@ static void __init octeon_irq_init_ciu(void) | |||
1192 | for (i = 0; i < 4; i++) | 1192 | for (i = 0; i < 4; i++) |
1193 | octeon_irq_set_ciu_mapping(i + OCTEON_IRQ_PCI_MSI0, 0, i + 40, chip, handle_level_irq); | 1193 | octeon_irq_set_ciu_mapping(i + OCTEON_IRQ_PCI_MSI0, 0, i + 40, chip, handle_level_irq); |
1194 | 1194 | ||
1195 | octeon_irq_set_ciu_mapping(OCTEON_IRQ_TWSI, 0, 45, chip, handle_level_irq); | ||
1196 | octeon_irq_set_ciu_mapping(OCTEON_IRQ_RML, 0, 46, chip, handle_level_irq); | 1195 | octeon_irq_set_ciu_mapping(OCTEON_IRQ_RML, 0, 46, chip, handle_level_irq); |
1197 | for (i = 0; i < 4; i++) | 1196 | for (i = 0; i < 4; i++) |
1198 | octeon_irq_set_ciu_mapping(i + OCTEON_IRQ_TIMER0, 0, i + 52, chip, handle_edge_irq); | 1197 | octeon_irq_set_ciu_mapping(i + OCTEON_IRQ_TIMER0, 0, i + 52, chip, handle_edge_irq); |
1199 | 1198 | ||
1200 | octeon_irq_set_ciu_mapping(OCTEON_IRQ_USB0, 0, 56, chip, handle_level_irq); | 1199 | octeon_irq_set_ciu_mapping(OCTEON_IRQ_USB0, 0, 56, chip, handle_level_irq); |
1201 | octeon_irq_set_ciu_mapping(OCTEON_IRQ_TWSI2, 0, 59, chip, handle_level_irq); | ||
1202 | octeon_irq_set_ciu_mapping(OCTEON_IRQ_MII0, 0, 62, chip, handle_level_irq); | 1200 | octeon_irq_set_ciu_mapping(OCTEON_IRQ_MII0, 0, 62, chip, handle_level_irq); |
1203 | octeon_irq_set_ciu_mapping(OCTEON_IRQ_BOOTDMA, 0, 63, chip, handle_level_irq); | 1201 | octeon_irq_set_ciu_mapping(OCTEON_IRQ_BOOTDMA, 0, 63, chip, handle_level_irq); |
1204 | 1202 | ||
diff --git a/arch/mips/cavium-octeon/octeon-platform.c b/arch/mips/cavium-octeon/octeon-platform.c index 2754bc225903..f62a40f424ca 100644 --- a/arch/mips/cavium-octeon/octeon-platform.c +++ b/arch/mips/cavium-octeon/octeon-platform.c | |||
@@ -168,90 +168,6 @@ out: | |||
168 | } | 168 | } |
169 | device_initcall(octeon_rng_device_init); | 169 | device_initcall(octeon_rng_device_init); |
170 | 170 | ||
171 | static struct i2c_board_info __initdata octeon_i2c_devices[] = { | ||
172 | { | ||
173 | I2C_BOARD_INFO("ds1337", 0x68), | ||
174 | }, | ||
175 | }; | ||
176 | |||
177 | static int __init octeon_i2c_devices_init(void) | ||
178 | { | ||
179 | return i2c_register_board_info(0, octeon_i2c_devices, | ||
180 | ARRAY_SIZE(octeon_i2c_devices)); | ||
181 | } | ||
182 | arch_initcall(octeon_i2c_devices_init); | ||
183 | |||
184 | #define OCTEON_I2C_IO_BASE 0x1180000001000ull | ||
185 | #define OCTEON_I2C_IO_UNIT_OFFSET 0x200 | ||
186 | |||
187 | static struct octeon_i2c_data octeon_i2c_data[2]; | ||
188 | |||
189 | static int __init octeon_i2c_device_init(void) | ||
190 | { | ||
191 | struct platform_device *pd; | ||
192 | int ret = 0; | ||
193 | int port, num_ports; | ||
194 | |||
195 | struct resource i2c_resources[] = { | ||
196 | { | ||
197 | .flags = IORESOURCE_MEM, | ||
198 | }, { | ||
199 | .flags = IORESOURCE_IRQ, | ||
200 | } | ||
201 | }; | ||
202 | |||
203 | if (OCTEON_IS_MODEL(OCTEON_CN56XX) || OCTEON_IS_MODEL(OCTEON_CN52XX)) | ||
204 | num_ports = 2; | ||
205 | else | ||
206 | num_ports = 1; | ||
207 | |||
208 | for (port = 0; port < num_ports; port++) { | ||
209 | octeon_i2c_data[port].sys_freq = octeon_get_io_clock_rate(); | ||
210 | /*FIXME: should be examined. At the moment is set for 100Khz */ | ||
211 | octeon_i2c_data[port].i2c_freq = 100000; | ||
212 | |||
213 | pd = platform_device_alloc("i2c-octeon", port); | ||
214 | if (!pd) { | ||
215 | ret = -ENOMEM; | ||
216 | goto out; | ||
217 | } | ||
218 | |||
219 | pd->dev.platform_data = octeon_i2c_data + port; | ||
220 | |||
221 | i2c_resources[0].start = | ||
222 | OCTEON_I2C_IO_BASE + (port * OCTEON_I2C_IO_UNIT_OFFSET); | ||
223 | i2c_resources[0].end = i2c_resources[0].start + 0x1f; | ||
224 | switch (port) { | ||
225 | case 0: | ||
226 | i2c_resources[1].start = OCTEON_IRQ_TWSI; | ||
227 | i2c_resources[1].end = OCTEON_IRQ_TWSI; | ||
228 | break; | ||
229 | case 1: | ||
230 | i2c_resources[1].start = OCTEON_IRQ_TWSI2; | ||
231 | i2c_resources[1].end = OCTEON_IRQ_TWSI2; | ||
232 | break; | ||
233 | default: | ||
234 | BUG(); | ||
235 | } | ||
236 | |||
237 | ret = platform_device_add_resources(pd, | ||
238 | i2c_resources, | ||
239 | ARRAY_SIZE(i2c_resources)); | ||
240 | if (ret) | ||
241 | goto fail; | ||
242 | |||
243 | ret = platform_device_add(pd); | ||
244 | if (ret) | ||
245 | goto fail; | ||
246 | } | ||
247 | return ret; | ||
248 | fail: | ||
249 | platform_device_put(pd); | ||
250 | out: | ||
251 | return ret; | ||
252 | } | ||
253 | device_initcall(octeon_i2c_device_init); | ||
254 | |||
255 | /* Octeon SMI/MDIO interface. */ | 171 | /* Octeon SMI/MDIO interface. */ |
256 | static int __init octeon_mdiobus_device_init(void) | 172 | static int __init octeon_mdiobus_device_init(void) |
257 | { | 173 | { |
diff --git a/arch/mips/include/asm/octeon/octeon.h b/arch/mips/include/asm/octeon/octeon.h index f72f768cd3a4..1e2486e23573 100644 --- a/arch/mips/include/asm/octeon/octeon.h +++ b/arch/mips/include/asm/octeon/octeon.h | |||
@@ -215,11 +215,6 @@ struct octeon_cf_data { | |||
215 | int dma_engine; /* -1 for no DMA */ | 215 | int dma_engine; /* -1 for no DMA */ |
216 | }; | 216 | }; |
217 | 217 | ||
218 | struct octeon_i2c_data { | ||
219 | unsigned int sys_freq; | ||
220 | unsigned int i2c_freq; | ||
221 | }; | ||
222 | |||
223 | extern void octeon_write_lcd(const char *s); | 218 | extern void octeon_write_lcd(const char *s); |
224 | extern void octeon_check_cpu_bist(void); | 219 | extern void octeon_check_cpu_bist(void); |
225 | extern int octeon_get_boot_debug_flag(void); | 220 | extern int octeon_get_boot_debug_flag(void); |