aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/txx9/rbtx4938/setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/txx9/rbtx4938/setup.c')
-rw-r--r--arch/mips/txx9/rbtx4938/setup.c64
1 files changed, 23 insertions, 41 deletions
diff --git a/arch/mips/txx9/rbtx4938/setup.c b/arch/mips/txx9/rbtx4938/setup.c
index 144d2cada820..8306ba333dda 100644
--- a/arch/mips/txx9/rbtx4938/setup.c
+++ b/arch/mips/txx9/rbtx4938/setup.c
@@ -17,7 +17,6 @@
17#include <linux/console.h> 17#include <linux/console.h>
18#include <linux/pm.h> 18#include <linux/pm.h>
19#include <linux/platform_device.h> 19#include <linux/platform_device.h>
20#include <linux/clk.h>
21#include <linux/gpio.h> 20#include <linux/gpio.h>
22 21
23#include <asm/reboot.h> 22#include <asm/reboot.h>
@@ -147,9 +146,9 @@ static void __init rbtx4938_pci_setup(void)
147#define SEEPROM3_CS 1 /* IOC */ 146#define SEEPROM3_CS 1 /* IOC */
148#define SRTC_CS 2 /* IOC */ 147#define SRTC_CS 2 /* IOC */
149 148
150#ifdef CONFIG_PCI
151static int __init rbtx4938_ethaddr_init(void) 149static int __init rbtx4938_ethaddr_init(void)
152{ 150{
151#ifdef CONFIG_PCI
153 unsigned char dat[17]; 152 unsigned char dat[17];
154 unsigned char sum; 153 unsigned char sum;
155 int i; 154 int i;
@@ -179,10 +178,9 @@ static int __init rbtx4938_ethaddr_init(void)
179 platform_device_add(pdev)) 178 platform_device_add(pdev))
180 platform_device_put(pdev); 179 platform_device_put(pdev);
181 } 180 }
181#endif /* CONFIG_PCI */
182 return 0; 182 return 0;
183} 183}
184device_initcall(rbtx4938_ethaddr_init);
185#endif /* CONFIG_PCI */
186 184
187static void __init rbtx4938_spi_setup(void) 185static void __init rbtx4938_spi_setup(void)
188{ 186{
@@ -366,7 +364,7 @@ void __init tx4938_board_setup(void)
366#endif 364#endif
367} 365}
368 366
369void __init plat_time_init(void) 367static void __init rbtx4938_time_init(void)
370{ 368{
371 mips_hpt_frequency = txx9_cpu_clock / 2; 369 mips_hpt_frequency = txx9_cpu_clock / 2;
372 if (____raw_readq(&tx4938_ccfgptr->ccfg) & TX4938_CCFG_TINTDIS) 370 if (____raw_readq(&tx4938_ccfgptr->ccfg) & TX4938_CCFG_TINTDIS)
@@ -375,7 +373,7 @@ void __init plat_time_init(void)
375 txx9_gbus_clock / 2); 373 txx9_gbus_clock / 2);
376} 374}
377 375
378void __init plat_mem_setup(void) 376static void __init rbtx4938_mem_setup(void)
379{ 377{
380 unsigned long long pcfg; 378 unsigned long long pcfg;
381 char *argptr; 379 char *argptr;
@@ -496,7 +494,6 @@ static int __init rbtx4938_ne_init(void)
496 res, ARRAY_SIZE(res)); 494 res, ARRAY_SIZE(res));
497 return IS_ERR(dev) ? PTR_ERR(dev) : 0; 495 return IS_ERR(dev) ? PTR_ERR(dev) : 0;
498} 496}
499device_initcall(rbtx4938_ne_init);
500 497
501/* GPIO support */ 498/* GPIO support */
502 499
@@ -587,14 +584,13 @@ static int __init rbtx4938_spi_init(void)
587 return 0; 584 return 0;
588} 585}
589 586
590static int __init rbtx4938_arch_init(void) 587static void __init rbtx4938_arch_init(void)
591{ 588{
592 txx9_gpio_init(TX4938_PIO_REG & 0xfffffffffULL, 0, 16); 589 txx9_gpio_init(TX4938_PIO_REG & 0xfffffffffULL, 0, 16);
593 gpiochip_add(&rbtx4938_spi_gpio_chip); 590 gpiochip_add(&rbtx4938_spi_gpio_chip);
594 rbtx4938_pci_setup(); 591 rbtx4938_pci_setup();
595 return rbtx4938_spi_init(); 592 rbtx4938_spi_init();
596} 593}
597arch_initcall(rbtx4938_arch_init);
598 594
599/* Watchdog support */ 595/* Watchdog support */
600 596
@@ -614,38 +610,24 @@ static int __init rbtx4938_wdt_init(void)
614{ 610{
615 return txx9_wdt_init(TX4938_TMR_REG(2) & 0xfffffffffULL); 611 return txx9_wdt_init(TX4938_TMR_REG(2) & 0xfffffffffULL);
616} 612}
617device_initcall(rbtx4938_wdt_init);
618
619/* Minimum CLK support */
620
621struct clk *clk_get(struct device *dev, const char *id)
622{
623 if (!strcmp(id, "spi-baseclk"))
624 return (struct clk *)(txx9_gbus_clock / 2 / 4);
625 if (!strcmp(id, "imbus_clk"))
626 return (struct clk *)(txx9_gbus_clock / 2);
627 return ERR_PTR(-ENOENT);
628}
629EXPORT_SYMBOL(clk_get);
630
631int clk_enable(struct clk *clk)
632{
633 return 0;
634}
635EXPORT_SYMBOL(clk_enable);
636
637void clk_disable(struct clk *clk)
638{
639}
640EXPORT_SYMBOL(clk_disable);
641 613
642unsigned long clk_get_rate(struct clk *clk) 614static void __init rbtx4938_device_init(void)
643{ 615{
644 return (unsigned long)clk; 616 rbtx4938_ethaddr_init();
617 rbtx4938_ne_init();
618 rbtx4938_wdt_init();
645} 619}
646EXPORT_SYMBOL(clk_get_rate);
647 620
648void clk_put(struct clk *clk) 621struct txx9_board_vec rbtx4938_vec __initdata = {
649{ 622 .type = MACH_TOSHIBA_RBTX4938,
650} 623 .system = "Toshiba RBTX4938",
651EXPORT_SYMBOL(clk_put); 624 .prom_init = rbtx4938_prom_init,
625 .mem_setup = rbtx4938_mem_setup,
626 .irq_setup = rbtx4938_irq_setup,
627 .time_init = rbtx4938_time_init,
628 .device_init = rbtx4938_device_init,
629 .arch_init = rbtx4938_arch_init,
630#ifdef CONFIG_PCI
631 .pci_map_irq = rbtx4938_pci_map_irq,
632#endif
633};