diff options
Diffstat (limited to 'arch/mips/alchemy/devboards/db1000.c')
-rw-r--r-- | arch/mips/alchemy/devboards/db1000.c | 47 |
1 files changed, 12 insertions, 35 deletions
diff --git a/arch/mips/alchemy/devboards/db1000.c b/arch/mips/alchemy/devboards/db1000.c index 5483906e0f86..92dd929d4057 100644 --- a/arch/mips/alchemy/devboards/db1000.c +++ b/arch/mips/alchemy/devboards/db1000.c @@ -41,42 +41,27 @@ #define F_SWAPPED (bcsr_read(BCSR_STATUS) & BCSR_STATUS_DB1000_SWAPBOOT) -struct pci_dev; +const char *get_system_type(void); -static const char *board_type_str(void) +int __init db1000_board_setup(void) { + /* initialize board register space */ + bcsr_init(DB1000_BCSR_PHYS_ADDR, + DB1000_BCSR_PHYS_ADDR + DB1000_BCSR_HEXLED_OFS); + switch (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI))) { case BCSR_WHOAMI_DB1000: - return "DB1000"; case BCSR_WHOAMI_DB1500: - return "DB1500"; case BCSR_WHOAMI_DB1100: - return "DB1100"; case BCSR_WHOAMI_PB1500: case BCSR_WHOAMI_PB1500R2: - return "PB1500"; case BCSR_WHOAMI_PB1100: - return "PB1100"; - default: - return "(unknown)"; + pr_info("AMD Alchemy %s Board\n", get_system_type()); + return 0; } + return -ENODEV; } -const char *get_system_type(void) -{ - return board_type_str(); -} - -void __init board_setup(void) -{ - /* initialize board register space */ - bcsr_init(DB1000_BCSR_PHYS_ADDR, - DB1000_BCSR_PHYS_ADDR + DB1000_BCSR_HEXLED_OFS); - - printk(KERN_INFO "AMD Alchemy %s Board\n", board_type_str()); -} - - static int db1500_map_pci_irq(const struct pci_dev *d, u8 slot, u8 pin) { if ((slot < 12) || (slot > 13) || pin == 0) @@ -114,17 +99,10 @@ static struct platform_device db1500_pci_host_dev = { .resource = alchemy_pci_host_res, }; -static int __init db1500_pci_init(void) +int __init db1500_pci_setup(void) { - int id = BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI)); - if ((id == BCSR_WHOAMI_DB1500) || (id == BCSR_WHOAMI_PB1500) || - (id == BCSR_WHOAMI_PB1500R2)) - return platform_device_register(&db1500_pci_host_dev); - return 0; + return platform_device_register(&db1500_pci_host_dev); } -/* must be arch_initcall; MIPS PCI scans busses in a subsys_initcall */ -arch_initcall(db1500_pci_init); - static struct resource au1100_lcd_resources[] = { [0] = { @@ -513,7 +491,7 @@ static struct platform_device *db1100_devs[] = { &db1000_irda_dev, }; -static int __init db1000_dev_init(void) +int __init db1000_dev_setup(void) { int board = BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI)); int c0, c1, d0, d1, s0, s1, flashsize = 32, twosocks = 1; @@ -623,4 +601,3 @@ static int __init db1000_dev_init(void) db1x_register_norflash(flashsize << 20, 4 /* 32bit */, F_SWAPPED); return 0; } -device_initcall(db1000_dev_init); |