1 // SPDX-License-Identifier: GPL-2.0
3 * Alchemy DB/PB1xxx board support.
7 #include <asm/mach-au1x00/au1000.h>
8 #include <asm/mach-db1x00/bcsr.h>
10 int __init
db1000_board_setup(void);
11 int __init
db1000_dev_setup(void);
12 int __init
db1500_pci_setup(void);
13 int __init
db1200_board_setup(void);
14 int __init
db1200_dev_setup(void);
15 int __init
db1300_board_setup(void);
16 int __init
db1300_dev_setup(void);
17 int __init
db1550_board_setup(void);
18 int __init
db1550_dev_setup(void);
19 int __init
db1550_pci_setup(int);
21 static const char *board_type_str(void)
23 switch (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI
))) {
24 case BCSR_WHOAMI_DB1000
:
26 case BCSR_WHOAMI_DB1500
:
28 case BCSR_WHOAMI_DB1100
:
30 case BCSR_WHOAMI_PB1500
:
31 case BCSR_WHOAMI_PB1500R2
:
33 case BCSR_WHOAMI_PB1100
:
35 case BCSR_WHOAMI_PB1200_DDR1
:
36 case BCSR_WHOAMI_PB1200_DDR2
:
38 case BCSR_WHOAMI_DB1200
:
40 case BCSR_WHOAMI_DB1300
:
42 case BCSR_WHOAMI_DB1550
:
44 case BCSR_WHOAMI_PB1550_SDR
:
45 case BCSR_WHOAMI_PB1550_DDR
:
52 const char *get_system_type(void)
54 return board_type_str();
57 void __init
board_setup(void)
61 switch (alchemy_get_cputype()) {
62 case ALCHEMY_CPU_AU1000
:
63 case ALCHEMY_CPU_AU1500
:
64 case ALCHEMY_CPU_AU1100
:
65 ret
= db1000_board_setup();
67 case ALCHEMY_CPU_AU1550
:
68 ret
= db1550_board_setup();
70 case ALCHEMY_CPU_AU1200
:
71 ret
= db1200_board_setup();
73 case ALCHEMY_CPU_AU1300
:
74 ret
= db1300_board_setup();
77 pr_err("unsupported CPU on board\n");
81 panic("cannot initialize board support");
84 static int __init
db1xxx_arch_init(void)
86 int id
= BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI
));
87 if (id
== BCSR_WHOAMI_DB1550
)
88 return db1550_pci_setup(0);
89 else if ((id
== BCSR_WHOAMI_PB1550_SDR
) ||
90 (id
== BCSR_WHOAMI_PB1550_DDR
))
91 return db1550_pci_setup(1);
92 else if ((id
== BCSR_WHOAMI_DB1500
) || (id
== BCSR_WHOAMI_PB1500
) ||
93 (id
== BCSR_WHOAMI_PB1500R2
))
94 return db1500_pci_setup();
98 arch_initcall(db1xxx_arch_init
);
100 static int __init
db1xxx_dev_init(void)
102 mips_set_machine_name(board_type_str());
103 switch (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI
))) {
104 case BCSR_WHOAMI_DB1000
:
105 case BCSR_WHOAMI_DB1500
:
106 case BCSR_WHOAMI_DB1100
:
107 case BCSR_WHOAMI_PB1500
:
108 case BCSR_WHOAMI_PB1500R2
:
109 case BCSR_WHOAMI_PB1100
:
110 return db1000_dev_setup();
111 case BCSR_WHOAMI_PB1200_DDR1
:
112 case BCSR_WHOAMI_PB1200_DDR2
:
113 case BCSR_WHOAMI_DB1200
:
114 return db1200_dev_setup();
115 case BCSR_WHOAMI_DB1300
:
116 return db1300_dev_setup();
117 case BCSR_WHOAMI_DB1550
:
118 case BCSR_WHOAMI_PB1550_SDR
:
119 case BCSR_WHOAMI_PB1550_DDR
:
120 return db1550_dev_setup();
124 device_initcall(db1xxx_dev_init
);