diff options
Diffstat (limited to 'arch/mips/txx9/rbtx4927/setup.c')
-rw-r--r-- | arch/mips/txx9/rbtx4927/setup.c | 78 |
1 files changed, 36 insertions, 42 deletions
diff --git a/arch/mips/txx9/rbtx4927/setup.c b/arch/mips/txx9/rbtx4927/setup.c index 86b870abc319..c3566c39c26c 100644 --- a/arch/mips/txx9/rbtx4927/setup.c +++ b/arch/mips/txx9/rbtx4927/setup.c | |||
@@ -49,7 +49,6 @@ | |||
49 | #include <linux/interrupt.h> | 49 | #include <linux/interrupt.h> |
50 | #include <linux/pm.h> | 50 | #include <linux/pm.h> |
51 | #include <linux/platform_device.h> | 51 | #include <linux/platform_device.h> |
52 | #include <linux/clk.h> | ||
53 | #include <linux/delay.h> | 52 | #include <linux/delay.h> |
54 | 53 | ||
55 | #include <asm/bootinfo.h> | 54 | #include <asm/bootinfo.h> |
@@ -76,8 +75,6 @@ char *prom_getcmdline(void); | |||
76 | 75 | ||
77 | static int tx4927_ccfg_toeon = 1; | 76 | static int tx4927_ccfg_toeon = 1; |
78 | 77 | ||
79 | char *toshiba_name = ""; | ||
80 | |||
81 | #ifdef CONFIG_PCI | 78 | #ifdef CONFIG_PCI |
82 | static void __init tx4927_pci_setup(void) | 79 | static void __init tx4927_pci_setup(void) |
83 | { | 80 | { |
@@ -171,15 +168,15 @@ static void __init tx4937_pci_setup(void) | |||
171 | } | 168 | } |
172 | } | 169 | } |
173 | 170 | ||
174 | static int __init rbtx4927_arch_init(void) | 171 | static void __init rbtx4927_arch_init(void) |
175 | { | 172 | { |
176 | if (mips_machtype == MACH_TOSHIBA_RBTX4937) | 173 | if (mips_machtype == MACH_TOSHIBA_RBTX4937) |
177 | tx4937_pci_setup(); | 174 | tx4937_pci_setup(); |
178 | else | 175 | else |
179 | tx4927_pci_setup(); | 176 | tx4927_pci_setup(); |
180 | return 0; | ||
181 | } | 177 | } |
182 | arch_initcall(rbtx4927_arch_init); | 178 | #else |
179 | #define rbtx4927_arch_init NULL | ||
183 | #endif /* CONFIG_PCI */ | 180 | #endif /* CONFIG_PCI */ |
184 | 181 | ||
185 | static void __noreturn wait_forever(void) | 182 | static void __noreturn wait_forever(void) |
@@ -223,14 +220,12 @@ void toshiba_rbtx4927_power_off(void) | |||
223 | /* no return */ | 220 | /* no return */ |
224 | } | 221 | } |
225 | 222 | ||
226 | void __init plat_mem_setup(void) | 223 | static void __init rbtx4927_mem_setup(void) |
227 | { | 224 | { |
228 | int i; | 225 | int i; |
229 | u32 cp0_config; | 226 | u32 cp0_config; |
230 | char *argptr; | 227 | char *argptr; |
231 | 228 | ||
232 | printk("CPU is %s\n", toshiba_name); | ||
233 | |||
234 | /* f/w leaves this on at startup */ | 229 | /* f/w leaves this on at startup */ |
235 | clear_c0_status(ST0_ERL); | 230 | clear_c0_status(ST0_ERL); |
236 | 231 | ||
@@ -323,7 +318,7 @@ void __init plat_mem_setup(void) | |||
323 | req.iotype = UPIO_MEM; | 318 | req.iotype = UPIO_MEM; |
324 | req.membase = (char *)(0xff1ff300 + i * 0x100); | 319 | req.membase = (char *)(0xff1ff300 + i * 0x100); |
325 | req.mapbase = 0xff1ff300 + i * 0x100; | 320 | req.mapbase = 0xff1ff300 + i * 0x100; |
326 | req.irq = TX4927_IRQ_PIC_BEG + 8 + i; | 321 | req.irq = TXX9_IRQ_BASE + TX4927_IR_SIO(i); |
327 | req.flags |= UPF_BUGGY_UART /*HAVE_CTS_LINE*/; | 322 | req.flags |= UPF_BUGGY_UART /*HAVE_CTS_LINE*/; |
328 | req.uartclk = 50000000; | 323 | req.uartclk = 50000000; |
329 | early_serial_txx9_setup(&req); | 324 | early_serial_txx9_setup(&req); |
@@ -352,7 +347,7 @@ void __init plat_mem_setup(void) | |||
352 | #endif | 347 | #endif |
353 | } | 348 | } |
354 | 349 | ||
355 | void __init plat_time_init(void) | 350 | static void __init rbtx4927_time_init(void) |
356 | { | 351 | { |
357 | mips_hpt_frequency = txx9_cpu_clock / 2; | 352 | mips_hpt_frequency = txx9_cpu_clock / 2; |
358 | if (____raw_readq(&tx4927_ccfgptr->ccfg) & TX4927_CCFG_TINTDIS) | 353 | if (____raw_readq(&tx4927_ccfgptr->ccfg) & TX4927_CCFG_TINTDIS) |
@@ -372,7 +367,6 @@ static int __init toshiba_rbtx4927_rtc_init(void) | |||
372 | platform_device_register_simple("rtc-ds1742", -1, &res, 1); | 367 | platform_device_register_simple("rtc-ds1742", -1, &res, 1); |
373 | return IS_ERR(dev) ? PTR_ERR(dev) : 0; | 368 | return IS_ERR(dev) ? PTR_ERR(dev) : 0; |
374 | } | 369 | } |
375 | device_initcall(toshiba_rbtx4927_rtc_init); | ||
376 | 370 | ||
377 | static int __init rbtx4927_ne_init(void) | 371 | static int __init rbtx4927_ne_init(void) |
378 | { | 372 | { |
@@ -391,7 +385,6 @@ static int __init rbtx4927_ne_init(void) | |||
391 | res, ARRAY_SIZE(res)); | 385 | res, ARRAY_SIZE(res)); |
392 | return IS_ERR(dev) ? PTR_ERR(dev) : 0; | 386 | return IS_ERR(dev) ? PTR_ERR(dev) : 0; |
393 | } | 387 | } |
394 | device_initcall(rbtx4927_ne_init); | ||
395 | 388 | ||
396 | /* Watchdog support */ | 389 | /* Watchdog support */ |
397 | 390 | ||
@@ -411,36 +404,37 @@ static int __init rbtx4927_wdt_init(void) | |||
411 | { | 404 | { |
412 | return txx9_wdt_init(TX4927_TMR_REG(2) & 0xfffffffffULL); | 405 | return txx9_wdt_init(TX4927_TMR_REG(2) & 0xfffffffffULL); |
413 | } | 406 | } |
414 | device_initcall(rbtx4927_wdt_init); | ||
415 | |||
416 | /* Minimum CLK support */ | ||
417 | |||
418 | struct clk *clk_get(struct device *dev, const char *id) | ||
419 | { | ||
420 | if (!strcmp(id, "imbus_clk")) | ||
421 | return (struct clk *)50000000; | ||
422 | return ERR_PTR(-ENOENT); | ||
423 | } | ||
424 | EXPORT_SYMBOL(clk_get); | ||
425 | |||
426 | int clk_enable(struct clk *clk) | ||
427 | { | ||
428 | return 0; | ||
429 | } | ||
430 | EXPORT_SYMBOL(clk_enable); | ||
431 | 407 | ||
432 | void clk_disable(struct clk *clk) | 408 | static void __init rbtx4927_device_init(void) |
433 | { | 409 | { |
410 | toshiba_rbtx4927_rtc_init(); | ||
411 | rbtx4927_ne_init(); | ||
412 | rbtx4927_wdt_init(); | ||
434 | } | 413 | } |
435 | EXPORT_SYMBOL(clk_disable); | ||
436 | 414 | ||
437 | unsigned long clk_get_rate(struct clk *clk) | 415 | struct txx9_board_vec rbtx4927_vec __initdata = { |
438 | { | 416 | .type = MACH_TOSHIBA_RBTX4927, |
439 | return (unsigned long)clk; | 417 | .system = "Toshiba RBTX4927", |
440 | } | 418 | .prom_init = rbtx4927_prom_init, |
441 | EXPORT_SYMBOL(clk_get_rate); | 419 | .mem_setup = rbtx4927_mem_setup, |
442 | 420 | .irq_setup = rbtx4927_irq_setup, | |
443 | void clk_put(struct clk *clk) | 421 | .time_init = rbtx4927_time_init, |
444 | { | 422 | .device_init = rbtx4927_device_init, |
445 | } | 423 | .arch_init = rbtx4927_arch_init, |
446 | EXPORT_SYMBOL(clk_put); | 424 | #ifdef CONFIG_PCI |
425 | .pci_map_irq = rbtx4927_pci_map_irq, | ||
426 | #endif | ||
427 | }; | ||
428 | struct txx9_board_vec rbtx4937_vec __initdata = { | ||
429 | .type = MACH_TOSHIBA_RBTX4937, | ||
430 | .system = "Toshiba RBTX4937", | ||
431 | .prom_init = rbtx4927_prom_init, | ||
432 | .mem_setup = rbtx4927_mem_setup, | ||
433 | .irq_setup = rbtx4927_irq_setup, | ||
434 | .time_init = rbtx4927_time_init, | ||
435 | .device_init = rbtx4927_device_init, | ||
436 | .arch_init = rbtx4927_arch_init, | ||
437 | #ifdef CONFIG_PCI | ||
438 | .pci_map_irq = rbtx4927_pci_map_irq, | ||
439 | #endif | ||
440 | }; | ||