x86/efi: Enforce CONFIG_RELOCATABLE for EFI boot stub
[linux/fpc-iii.git] / arch / mips / alchemy / devboards / db1235.c
blobc76a90f7866427724d74a4df340ab3de9fdf6d9d
1 /*
2 * DB1200/PB1200 / DB1550 / DB1300 board support.
4 * These 4 boards can reliably be supported in a single kernel image.
5 */
7 #include <asm/mach-au1x00/au1000.h>
8 #include <asm/mach-db1x00/bcsr.h>
10 int __init db1200_board_setup(void);
11 int __init db1200_dev_setup(void);
12 int __init db1300_board_setup(void);
13 int __init db1300_dev_setup(void);
14 int __init db1550_board_setup(void);
15 int __init db1550_dev_setup(void);
16 int __init db1550_pci_setup(int);
18 static const char *board_type_str(void)
20 switch (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI))) {
21 case BCSR_WHOAMI_PB1200_DDR1:
22 case BCSR_WHOAMI_PB1200_DDR2:
23 return "PB1200";
24 case BCSR_WHOAMI_DB1200:
25 return "DB1200";
26 case BCSR_WHOAMI_DB1300:
27 return "DB1300";
28 case BCSR_WHOAMI_DB1550:
29 return "DB1550";
30 case BCSR_WHOAMI_PB1550_SDR:
31 case BCSR_WHOAMI_PB1550_DDR:
32 return "PB1550";
33 default:
34 return "(unknown)";
38 const char *get_system_type(void)
40 return board_type_str();
43 void __init board_setup(void)
45 int ret;
47 switch (alchemy_get_cputype()) {
48 case ALCHEMY_CPU_AU1550:
49 ret = db1550_board_setup();
50 break;
51 case ALCHEMY_CPU_AU1200:
52 ret = db1200_board_setup();
53 break;
54 case ALCHEMY_CPU_AU1300:
55 ret = db1300_board_setup();
56 break;
57 default:
58 pr_err("unsupported CPU on board\n");
59 ret = -ENODEV;
61 if (ret)
62 panic("cannot initialize board support\n");
65 int __init db1235_arch_init(void)
67 int id = BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI));
68 if (id == BCSR_WHOAMI_DB1550)
69 return db1550_pci_setup(0);
70 else if ((id == BCSR_WHOAMI_PB1550_SDR) ||
71 (id == BCSR_WHOAMI_PB1550_DDR))
72 return db1550_pci_setup(1);
74 return 0;
76 arch_initcall(db1235_arch_init);
78 int __init db1235_dev_init(void)
80 switch (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI))) {
81 case BCSR_WHOAMI_PB1200_DDR1:
82 case BCSR_WHOAMI_PB1200_DDR2:
83 case BCSR_WHOAMI_DB1200:
84 return db1200_dev_setup();
85 case BCSR_WHOAMI_DB1300:
86 return db1300_dev_setup();
87 case BCSR_WHOAMI_DB1550:
88 case BCSR_WHOAMI_PB1550_SDR:
89 case BCSR_WHOAMI_PB1550_DDR:
90 return db1550_dev_setup();
92 return 0;
94 device_initcall(db1235_dev_init);