Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
db1235.c
Go to the documentation of this file.
1 /*
2  * DB1200/PB1200 / DB1550 / DB1300 board support.
3  *
4  * These 4 boards can reliably be supported in a single kernel image.
5  */
6 
8 #include <asm/mach-db1x00/bcsr.h>
9 
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);
17 
18 static const char *board_type_str(void)
19 {
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";
32  return "PB1550";
33  default:
34  return "(unknown)";
35  }
36 }
37 
38 const char *get_system_type(void)
39 {
40  return board_type_str();
41 }
42 
43 void __init board_setup(void)
44 {
45  int ret;
46 
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;
60  }
61  if (ret)
62  panic("cannot initialize board support\n");
63 }
64 
66 {
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);
73 
74  return 0;
75 }
77 
79 {
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:
90  return db1550_dev_setup();
91  }
92  return 0;
93 }