aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/alchemy
diff options
context:
space:
mode:
authorManuel Lauss <manuel.lauss@gmail.com>2014-02-20 08:59:24 -0500
committerRalf Baechle <ralf@linux-mips.org>2014-03-26 18:09:21 -0400
commit970e268d6ed1f1799829cc0c87ea271a9e127e79 (patch)
treee58e6ebbb7061a9f578d35cf254dc35054c90990 /arch/mips/alchemy
parent88e9a93c9d53ddcf633aa07f14245da7f30408c2 (diff)
MIPS: Alchemy: Unify Devboard support.
This patch merges support for all DB1xxx and PB1xxx boards into a single image, along with a new single defconfig for them. Run-tested on DB1300 and DB1500. Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com> Cc: Linux-MIPS <linux-mips@linux-mips.org> Patchwork: https://patchwork.linux-mips.org/patch/6577/ Patchwork: https://patchwork.linux-mips.org/patch/6659/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/alchemy')
-rw-r--r--arch/mips/alchemy/Kconfig19
-rw-r--r--arch/mips/alchemy/Platform16
-rw-r--r--arch/mips/alchemy/devboards/Makefile4
-rw-r--r--arch/mips/alchemy/devboards/db1000.c47
-rw-r--r--arch/mips/alchemy/devboards/db1200.c9
-rw-r--r--arch/mips/alchemy/devboards/db1300.c6
-rw-r--r--arch/mips/alchemy/devboards/db1550.c10
-rw-r--r--arch/mips/alchemy/devboards/db1xxx.c (renamed from arch/mips/alchemy/devboards/db1235.c)41
8 files changed, 82 insertions, 70 deletions
diff --git a/arch/mips/alchemy/Kconfig b/arch/mips/alchemy/Kconfig
index 41386723f9fa..b9628983d620 100644
--- a/arch/mips/alchemy/Kconfig
+++ b/arch/mips/alchemy/Kconfig
@@ -16,7 +16,7 @@ config ALCHEMY_GPIO_INDIRECT
16choice 16choice
17 prompt "Machine type" 17 prompt "Machine type"
18 depends on MIPS_ALCHEMY 18 depends on MIPS_ALCHEMY
19 default MIPS_DB1000 19 default MIPS_DB1XXX
20 20
21config MIPS_MTX1 21config MIPS_MTX1
22 bool "4G Systems MTX-1 board" 22 bool "4G Systems MTX-1 board"
@@ -25,20 +25,17 @@ config MIPS_MTX1
25 select SYS_SUPPORTS_LITTLE_ENDIAN 25 select SYS_SUPPORTS_LITTLE_ENDIAN
26 select SYS_HAS_EARLY_PRINTK 26 select SYS_HAS_EARLY_PRINTK
27 27
28config MIPS_DB1000 28config MIPS_DB1XXX
29 bool "Alchemy DB1000/DB1500/DB1100 PB1500/1100 boards" 29 bool "Alchemy DB1XXX / PB1XXX boards"
30 select ALCHEMY_GPIOINT_AU1000
31 select HW_HAS_PCI
32 select SYS_SUPPORTS_BIG_ENDIAN
33 select SYS_SUPPORTS_LITTLE_ENDIAN
34 select SYS_HAS_EARLY_PRINTK
35
36config MIPS_DB1235
37 bool "Alchemy DB1200/PB1200/DB1300/DB1550/PB1550 boards"
38 select ARCH_REQUIRE_GPIOLIB 30 select ARCH_REQUIRE_GPIOLIB
39 select HW_HAS_PCI 31 select HW_HAS_PCI
40 select SYS_SUPPORTS_LITTLE_ENDIAN 32 select SYS_SUPPORTS_LITTLE_ENDIAN
41 select SYS_HAS_EARLY_PRINTK 33 select SYS_HAS_EARLY_PRINTK
34 help
35 Select this option if you have one of the following Alchemy
36 development boards: DB1000 DB1500 DB1100 DB1550 DB1200 DB1300
37 PB1500 PB1100 PB1550 PB1200
38 Board type is autodetected during boot.
42 39
43config MIPS_XXS1500 40config MIPS_XXS1500
44 bool "MyCable XXS1500 board" 41 bool "MyCable XXS1500 board"
diff --git a/arch/mips/alchemy/Platform b/arch/mips/alchemy/Platform
index b3afcdd8d77a..33c9da3b077b 100644
--- a/arch/mips/alchemy/Platform
+++ b/arch/mips/alchemy/Platform
@@ -5,18 +5,12 @@ platform-$(CONFIG_MIPS_ALCHEMY) += alchemy/common/
5 5
6 6
7# 7#
8# AMD Alchemy Db1000/Db1500/Pb1500/Db1100/Pb1100 eval boards 8# AMD Alchemy Db1000/Db1500/Pb1500/Db1100/Pb1100
9# Db1550/Pb1550/Db1200/Pb1200/Db1300
9# 10#
10platform-$(CONFIG_MIPS_DB1000) += alchemy/devboards/ 11platform-$(CONFIG_MIPS_DB1XXX) += alchemy/devboards/
11cflags-$(CONFIG_MIPS_DB1000) += -I$(srctree)/arch/mips/include/asm/mach-db1x00 12cflags-$(CONFIG_MIPS_DB1XXX) += -I$(srctree)/arch/mips/include/asm/mach-db1x00
12load-$(CONFIG_MIPS_DB1000) += 0xffffffff80100000 13load-$(CONFIG_MIPS_DB1XXX) += 0xffffffff80100000
13
14#
15# AMD Alchemy Db1200/Pb1200/Db1550/Pb1550/Db1300 eval boards
16#
17platform-$(CONFIG_MIPS_DB1235) += alchemy/devboards/
18cflags-$(CONFIG_MIPS_DB1235) += -I$(srctree)/arch/mips/include/asm/mach-db1x00
19load-$(CONFIG_MIPS_DB1235) += 0xffffffff80100000
20 14
21# 15#
22# 4G-Systems MTX-1 "MeshCube" wireless router 16# 4G-Systems MTX-1 "MeshCube" wireless router
diff --git a/arch/mips/alchemy/devboards/Makefile b/arch/mips/alchemy/devboards/Makefile
index 15bf7306648b..9da3659a9d1c 100644
--- a/arch/mips/alchemy/devboards/Makefile
+++ b/arch/mips/alchemy/devboards/Makefile
@@ -2,7 +2,5 @@
2# Alchemy Develboards 2# Alchemy Develboards
3# 3#
4 4
5obj-y += bcsr.o platform.o 5obj-y += bcsr.o platform.o db1000.o db1200.o db1300.o db1550.o db1xxx.o
6obj-$(CONFIG_PM) += pm.o 6obj-$(CONFIG_PM) += pm.o
7obj-$(CONFIG_MIPS_DB1000) += db1000.o
8obj-$(CONFIG_MIPS_DB1235) += db1235.o db1200.o db1300.o db1550.o
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 @@
41 41
42#define F_SWAPPED (bcsr_read(BCSR_STATUS) & BCSR_STATUS_DB1000_SWAPBOOT) 42#define F_SWAPPED (bcsr_read(BCSR_STATUS) & BCSR_STATUS_DB1000_SWAPBOOT)
43 43
44struct pci_dev; 44const char *get_system_type(void);
45 45
46static const char *board_type_str(void) 46int __init db1000_board_setup(void)
47{ 47{
48 /* initialize board register space */
49 bcsr_init(DB1000_BCSR_PHYS_ADDR,
50 DB1000_BCSR_PHYS_ADDR + DB1000_BCSR_HEXLED_OFS);
51
48 switch (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI))) { 52 switch (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI))) {
49 case BCSR_WHOAMI_DB1000: 53 case BCSR_WHOAMI_DB1000:
50 return "DB1000";
51 case BCSR_WHOAMI_DB1500: 54 case BCSR_WHOAMI_DB1500:
52 return "DB1500";
53 case BCSR_WHOAMI_DB1100: 55 case BCSR_WHOAMI_DB1100:
54 return "DB1100";
55 case BCSR_WHOAMI_PB1500: 56 case BCSR_WHOAMI_PB1500:
56 case BCSR_WHOAMI_PB1500R2: 57 case BCSR_WHOAMI_PB1500R2:
57 return "PB1500";
58 case BCSR_WHOAMI_PB1100: 58 case BCSR_WHOAMI_PB1100:
59 return "PB1100"; 59 pr_info("AMD Alchemy %s Board\n", get_system_type());
60 default: 60 return 0;
61 return "(unknown)";
62 } 61 }
62 return -ENODEV;
63} 63}
64 64
65const char *get_system_type(void)
66{
67 return board_type_str();
68}
69
70void __init board_setup(void)
71{
72 /* initialize board register space */
73 bcsr_init(DB1000_BCSR_PHYS_ADDR,
74 DB1000_BCSR_PHYS_ADDR + DB1000_BCSR_HEXLED_OFS);
75
76 printk(KERN_INFO "AMD Alchemy %s Board\n", board_type_str());
77}
78
79
80static int db1500_map_pci_irq(const struct pci_dev *d, u8 slot, u8 pin) 65static int db1500_map_pci_irq(const struct pci_dev *d, u8 slot, u8 pin)
81{ 66{
82 if ((slot < 12) || (slot > 13) || pin == 0) 67 if ((slot < 12) || (slot > 13) || pin == 0)
@@ -114,17 +99,10 @@ static struct platform_device db1500_pci_host_dev = {
114 .resource = alchemy_pci_host_res, 99 .resource = alchemy_pci_host_res,
115}; 100};
116 101
117static int __init db1500_pci_init(void) 102int __init db1500_pci_setup(void)
118{ 103{
119 int id = BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI)); 104 return platform_device_register(&db1500_pci_host_dev);
120 if ((id == BCSR_WHOAMI_DB1500) || (id == BCSR_WHOAMI_PB1500) ||
121 (id == BCSR_WHOAMI_PB1500R2))
122 return platform_device_register(&db1500_pci_host_dev);
123 return 0;
124} 105}
125/* must be arch_initcall; MIPS PCI scans busses in a subsys_initcall */
126arch_initcall(db1500_pci_init);
127
128 106
129static struct resource au1100_lcd_resources[] = { 107static struct resource au1100_lcd_resources[] = {
130 [0] = { 108 [0] = {
@@ -513,7 +491,7 @@ static struct platform_device *db1100_devs[] = {
513 &db1000_irda_dev, 491 &db1000_irda_dev,
514}; 492};
515 493
516static int __init db1000_dev_init(void) 494int __init db1000_dev_setup(void)
517{ 495{
518 int board = BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI)); 496 int board = BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI));
519 int c0, c1, d0, d1, s0, s1, flashsize = 32, twosocks = 1; 497 int c0, c1, d0, d1, s0, s1, flashsize = 32, twosocks = 1;
@@ -623,4 +601,3 @@ static int __init db1000_dev_init(void)
623 db1x_register_norflash(flashsize << 20, 4 /* 32bit */, F_SWAPPED); 601 db1x_register_norflash(flashsize << 20, 4 /* 32bit */, F_SWAPPED);
624 return 0; 602 return 0;
625} 603}
626device_initcall(db1000_dev_init);
diff --git a/arch/mips/alchemy/devboards/db1200.c b/arch/mips/alchemy/devboards/db1200.c
index a84d98b8f96e..a60d0a3410ea 100644
--- a/arch/mips/alchemy/devboards/db1200.c
+++ b/arch/mips/alchemy/devboards/db1200.c
@@ -89,6 +89,15 @@ int __init db1200_board_setup(void)
89 return -ENODEV; 89 return -ENODEV;
90 90
91 whoami = bcsr_read(BCSR_WHOAMI); 91 whoami = bcsr_read(BCSR_WHOAMI);
92 switch (BCSR_WHOAMI_BOARD(whoami)) {
93 case BCSR_WHOAMI_PB1200_DDR1:
94 case BCSR_WHOAMI_PB1200_DDR2:
95 case BCSR_WHOAMI_DB1200:
96 break;
97 default:
98 return -ENODEV;
99 }
100
92 printk(KERN_INFO "Alchemy/AMD/RMI %s Board, CPLD Rev %d" 101 printk(KERN_INFO "Alchemy/AMD/RMI %s Board, CPLD Rev %d"
93 " Board-ID %d Daughtercard ID %d\n", get_system_type(), 102 " Board-ID %d Daughtercard ID %d\n", get_system_type(),
94 (whoami >> 4) & 0xf, (whoami >> 8) & 0xf, whoami & 0xf); 103 (whoami >> 4) & 0xf, (whoami >> 8) & 0xf, whoami & 0xf);
diff --git a/arch/mips/alchemy/devboards/db1300.c b/arch/mips/alchemy/devboards/db1300.c
index 6167e73eef9c..509602cb463a 100644
--- a/arch/mips/alchemy/devboards/db1300.c
+++ b/arch/mips/alchemy/devboards/db1300.c
@@ -759,11 +759,15 @@ int __init db1300_board_setup(void)
759{ 759{
760 unsigned short whoami; 760 unsigned short whoami;
761 761
762 db1300_gpio_config();
763 bcsr_init(DB1300_BCSR_PHYS_ADDR, 762 bcsr_init(DB1300_BCSR_PHYS_ADDR,
764 DB1300_BCSR_PHYS_ADDR + DB1300_BCSR_HEXLED_OFS); 763 DB1300_BCSR_PHYS_ADDR + DB1300_BCSR_HEXLED_OFS);
765 764
766 whoami = bcsr_read(BCSR_WHOAMI); 765 whoami = bcsr_read(BCSR_WHOAMI);
766 if (BCSR_WHOAMI_BOARD(whoami) != BCSR_WHOAMI_DB1300)
767 return -ENODEV;
768
769 db1300_gpio_config();
770
767 printk(KERN_INFO "NetLogic DBAu1300 Development Platform.\n\t" 771 printk(KERN_INFO "NetLogic DBAu1300 Development Platform.\n\t"
768 "BoardID %d CPLD Rev %d DaughtercardID %d\n", 772 "BoardID %d CPLD Rev %d DaughtercardID %d\n",
769 BCSR_WHOAMI_BOARD(whoami), BCSR_WHOAMI_CPLD(whoami), 773 BCSR_WHOAMI_BOARD(whoami), BCSR_WHOAMI_CPLD(whoami),
diff --git a/arch/mips/alchemy/devboards/db1550.c b/arch/mips/alchemy/devboards/db1550.c
index 016cddacd7ea..bbd8d9884702 100644
--- a/arch/mips/alchemy/devboards/db1550.c
+++ b/arch/mips/alchemy/devboards/db1550.c
@@ -62,10 +62,16 @@ int __init db1550_board_setup(void)
62 DB1550_BCSR_PHYS_ADDR + DB1550_BCSR_HEXLED_OFS); 62 DB1550_BCSR_PHYS_ADDR + DB1550_BCSR_HEXLED_OFS);
63 63
64 whoami = bcsr_read(BCSR_WHOAMI); /* PB1550 hexled offset differs */ 64 whoami = bcsr_read(BCSR_WHOAMI); /* PB1550 hexled offset differs */
65 if ((BCSR_WHOAMI_BOARD(whoami) == BCSR_WHOAMI_PB1550_SDR) || 65 switch (BCSR_WHOAMI_BOARD(whoami)) {
66 (BCSR_WHOAMI_BOARD(whoami) == BCSR_WHOAMI_PB1550_DDR)) 66 case BCSR_WHOAMI_PB1550_SDR:
67 case BCSR_WHOAMI_PB1550_DDR:
67 bcsr_init(PB1550_BCSR_PHYS_ADDR, 68 bcsr_init(PB1550_BCSR_PHYS_ADDR,
68 PB1550_BCSR_PHYS_ADDR + PB1550_BCSR_HEXLED_OFS); 69 PB1550_BCSR_PHYS_ADDR + PB1550_BCSR_HEXLED_OFS);
70 case BCSR_WHOAMI_DB1550:
71 break;
72 default:
73 return -ENODEV;
74 }
69 75
70 pr_info("Alchemy/AMD %s Board, CPLD Rev %d Board-ID %d " \ 76 pr_info("Alchemy/AMD %s Board, CPLD Rev %d Board-ID %d " \
71 "Daughtercard ID %d\n", get_system_type(), 77 "Daughtercard ID %d\n", get_system_type(),
diff --git a/arch/mips/alchemy/devboards/db1235.c b/arch/mips/alchemy/devboards/db1xxx.c
index bac19dc43d1d..2d47f951121a 100644
--- a/arch/mips/alchemy/devboards/db1235.c
+++ b/arch/mips/alchemy/devboards/db1xxx.c
@@ -1,12 +1,13 @@
1/* 1/*
2 * DB1200/PB1200 / DB1550 / DB1300 board support. 2 * Alchemy DB/PB1xxx board support.
3 *
4 * These 4 boards can reliably be supported in a single kernel image.
5 */ 3 */
6 4
7#include <asm/mach-au1x00/au1000.h> 5#include <asm/mach-au1x00/au1000.h>
8#include <asm/mach-db1x00/bcsr.h> 6#include <asm/mach-db1x00/bcsr.h>
9 7
8int __init db1000_board_setup(void);
9int __init db1000_dev_setup(void);
10int __init db1500_pci_setup(void);
10int __init db1200_board_setup(void); 11int __init db1200_board_setup(void);
11int __init db1200_dev_setup(void); 12int __init db1200_dev_setup(void);
12int __init db1300_board_setup(void); 13int __init db1300_board_setup(void);
@@ -18,6 +19,17 @@ int __init db1550_pci_setup(int);
18static const char *board_type_str(void) 19static const char *board_type_str(void)
19{ 20{
20 switch (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI))) { 21 switch (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI))) {
22 case BCSR_WHOAMI_DB1000:
23 return "DB1000";
24 case BCSR_WHOAMI_DB1500:
25 return "DB1500";
26 case BCSR_WHOAMI_DB1100:
27 return "DB1100";
28 case BCSR_WHOAMI_PB1500:
29 case BCSR_WHOAMI_PB1500R2:
30 return "PB1500";
31 case BCSR_WHOAMI_PB1100:
32 return "PB1100";
21 case BCSR_WHOAMI_PB1200_DDR1: 33 case BCSR_WHOAMI_PB1200_DDR1:
22 case BCSR_WHOAMI_PB1200_DDR2: 34 case BCSR_WHOAMI_PB1200_DDR2:
23 return "PB1200"; 35 return "PB1200";
@@ -45,6 +57,11 @@ void __init board_setup(void)
45 int ret; 57 int ret;
46 58
47 switch (alchemy_get_cputype()) { 59 switch (alchemy_get_cputype()) {
60 case ALCHEMY_CPU_AU1000:
61 case ALCHEMY_CPU_AU1500:
62 case ALCHEMY_CPU_AU1100:
63 ret = db1000_board_setup();
64 break;
48 case ALCHEMY_CPU_AU1550: 65 case ALCHEMY_CPU_AU1550:
49 ret = db1550_board_setup(); 66 ret = db1550_board_setup();
50 break; 67 break;
@@ -62,7 +79,7 @@ void __init board_setup(void)
62 panic("cannot initialize board support"); 79 panic("cannot initialize board support");
63} 80}
64 81
65int __init db1235_arch_init(void) 82static int __init db1xxx_arch_init(void)
66{ 83{
67 int id = BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI)); 84 int id = BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI));
68 if (id == BCSR_WHOAMI_DB1550) 85 if (id == BCSR_WHOAMI_DB1550)
@@ -70,14 +87,24 @@ int __init db1235_arch_init(void)
70 else if ((id == BCSR_WHOAMI_PB1550_SDR) || 87 else if ((id == BCSR_WHOAMI_PB1550_SDR) ||
71 (id == BCSR_WHOAMI_PB1550_DDR)) 88 (id == BCSR_WHOAMI_PB1550_DDR))
72 return db1550_pci_setup(1); 89 return db1550_pci_setup(1);
90 else if ((id == BCSR_WHOAMI_DB1500) || (id == BCSR_WHOAMI_PB1500) ||
91 (id == BCSR_WHOAMI_PB1500R2))
92 return db1500_pci_setup();
73 93
74 return 0; 94 return 0;
75} 95}
76arch_initcall(db1235_arch_init); 96arch_initcall(db1xxx_arch_init);
77 97
78int __init db1235_dev_init(void) 98static int __init db1xxx_dev_init(void)
79{ 99{
80 switch (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI))) { 100 switch (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI))) {
101 case BCSR_WHOAMI_DB1000:
102 case BCSR_WHOAMI_DB1500:
103 case BCSR_WHOAMI_DB1100:
104 case BCSR_WHOAMI_PB1500:
105 case BCSR_WHOAMI_PB1500R2:
106 case BCSR_WHOAMI_PB1100:
107 return db1000_dev_setup();
81 case BCSR_WHOAMI_PB1200_DDR1: 108 case BCSR_WHOAMI_PB1200_DDR1:
82 case BCSR_WHOAMI_PB1200_DDR2: 109 case BCSR_WHOAMI_PB1200_DDR2:
83 case BCSR_WHOAMI_DB1200: 110 case BCSR_WHOAMI_DB1200:
@@ -91,4 +118,4 @@ int __init db1235_dev_init(void)
91 } 118 }
92 return 0; 119 return 0;
93} 120}
94device_initcall(db1235_dev_init); 121device_initcall(db1xxx_dev_init);