2 * Alchemy DB/PB1xxx board support.
5 #include <asm/mach-au1x00/au1000.h>
6 #include <asm/mach-db1x00/bcsr.h>
8 int __init
db1000_board_setup(void);
9 int __init
db1000_dev_setup(void);
10 int __init
db1500_pci_setup(void);
11 int __init
db1200_board_setup(void);
12 int __init
db1200_dev_setup(void);
13 int __init
db1300_board_setup(void);
14 int __init
db1300_dev_setup(void);
15 int __init
db1550_board_setup(void);
16 int __init
db1550_dev_setup(void);
17 int __init
db1550_pci_setup(int);
19 static const char *board_type_str(void)
21 switch (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI
))) {
22 case BCSR_WHOAMI_DB1000
:
24 case BCSR_WHOAMI_DB1500
:
26 case BCSR_WHOAMI_DB1100
:
28 case BCSR_WHOAMI_PB1500
:
29 case BCSR_WHOAMI_PB1500R2
:
31 case BCSR_WHOAMI_PB1100
:
33 case BCSR_WHOAMI_PB1200_DDR1
:
34 case BCSR_WHOAMI_PB1200_DDR2
:
36 case BCSR_WHOAMI_DB1200
:
38 case BCSR_WHOAMI_DB1300
:
40 case BCSR_WHOAMI_DB1550
:
42 case BCSR_WHOAMI_PB1550_SDR
:
43 case BCSR_WHOAMI_PB1550_DDR
:
50 const char *get_system_type(void)
52 return board_type_str();
55 void __init
board_setup(void)
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();
65 case ALCHEMY_CPU_AU1550
:
66 ret
= db1550_board_setup();
68 case ALCHEMY_CPU_AU1200
:
69 ret
= db1200_board_setup();
71 case ALCHEMY_CPU_AU1300
:
72 ret
= db1300_board_setup();
75 pr_err("unsupported CPU on board\n");
79 panic("cannot initialize board support");
82 static int __init
db1xxx_arch_init(void)
84 int id
= BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI
));
85 if (id
== BCSR_WHOAMI_DB1550
)
86 return db1550_pci_setup(0);
87 else if ((id
== BCSR_WHOAMI_PB1550_SDR
) ||
88 (id
== BCSR_WHOAMI_PB1550_DDR
))
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();
96 arch_initcall(db1xxx_arch_init
);
98 static int __init
db1xxx_dev_init(void)
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();
108 case BCSR_WHOAMI_PB1200_DDR1
:
109 case BCSR_WHOAMI_PB1200_DDR2
:
110 case BCSR_WHOAMI_DB1200
:
111 return db1200_dev_setup();
112 case BCSR_WHOAMI_DB1300
:
113 return db1300_dev_setup();
114 case BCSR_WHOAMI_DB1550
:
115 case BCSR_WHOAMI_PB1550_SDR
:
116 case BCSR_WHOAMI_PB1550_DDR
:
117 return db1550_dev_setup();
121 device_initcall(db1xxx_dev_init
);