3 * Murray Jensen, CSIRO-MST
5 * SPDX-License-Identifier: GPL-2.0+
8 #ifndef _CONFIG_COGENT_COMMON_H
9 #define _CONFIG_COGENT_COMMON_H
12 * Cogent Motherboard Capabilities
14 #define CMA_MB_CAP_SERPAR 0x0001 /* has dual serial+parallel (16C552) */
15 #define CMA_MB_CAP_LCD 0x0002 /* has LCD display (HD44780) */
16 #define CMA_MB_CAP_FLASH 0x0004 /* has flash (E28F800B or AM29F800BB) */
17 #define CMA_MB_CAP_RTC 0x0008 /* has RTC+NVRAM (MK48T02) */
18 #define CMA_MB_CAP_ETHER 0x0010 /* has Ethernet (MB86964) */
19 #define CMA_MB_CAP_SLOT1 0x0020 /* has CMABus slot 1 */
20 #define CMA_MB_CAP_SLOT2 0x0040 /* has CMABus slot 2 */
21 #define CMA_MB_CAP_SLOT3 0x0080 /* has CMABus slot 3 */
22 #define CMA_MB_CAP_KBM 0x0100 /* has PS/2 keyboard+mouse (HT6542B) */
23 #define CMA_MB_CAP_SER2 0x0200 /* has 2nd dual serial (16C2552) */
24 #define CMA_MB_CAP_PCI 0x0400 /* has pci bridge (V360EPC) */
25 #define CMA_MB_CAP_PCI_EXT 0x0800 /* can access extended pci space */
26 #define CMA_MB_CAP_PCI_ETHER 0x1000 /* has 10/100 ether on PCI (GD82559) */
27 #define CMA_MB_CAP_PCI_VIDEO 0x2000 /* has video int'face on PCI (B69000) */
28 #define CMA_MB_CAP_PCI_CARDBUS 0x4000 /* has Cardbus Ctlr on PCI (PD6832) */
31 * Cogent option sanity checking
34 #if defined(CONFIG_MPC821) || defined(CONFIG_MPC823) || \
35 defined(CONFIG_MPC850) || defined(CONFIG_MPC860)
38 * check a PowerPC 8xx cpu module has been selected
41 # if defined(CONFIG_CMA286_21)
43 # define COGENT_CPU_MODULE "CMA286-21"
45 # elif defined(CONFIG_CMA286_60_OLD)
47 # define COGENT_CPU_MODULE "CMA286-60 (old)"
49 # elif defined(CONFIG_CMA286_60)
51 # define COGENT_CPU_MODULE "CMA286-60"
53 # elif defined(CONFIG_CMA286_60P)
55 # define COGENT_CPU_MODULE "CMA286-60P"
57 # elif defined(CONFIG_CMA287_21)
59 # define COGENT_CPU_MODULE "CMA287-21"
61 # elif defined(CONFIG_CMA287_50)
63 # define COGENT_CPU_MODULE "CMA287-50"
67 # error Cogent CPU Module must be a PowerPC MPC8xx module
71 #elif defined(CONFIG_MPC8260)
74 * check a PowerPC 8260 cpu module has been selected
77 # if defined(CONFIG_CMA282)
79 # define COGENT_CPU_MODULE "CMA282"
83 # error Cogent CPU Module must be a PowerPC MPC8260 module
89 # error CPU type must be PowerPC 8xx or 8260
94 * check a motherboard has been selected
95 * define the motherboard capabilities while we're at it
98 #if defined(CONFIG_CMA101)
100 # define COGENT_MOTHERBOARD "CMA101"
101 # define CMA_MB_CAPS (CMA_MB_CAP_SERPAR | CMA_MB_CAP_LCD | \
102 CMA_MB_CAP_RTC | CMA_MB_CAP_ETHER | \
103 CMA_MB_CAP_SLOT1 | CMA_MB_CAP_SLOT2 | \
105 # define CMA_MB_NSLOTS 3
107 #elif defined(CONFIG_CMA102)
109 # define COGENT_MOTHERBOARD "CMA102"
110 # define CMA_MB_CAPS (CMA_MB_CAP_SERPAR | CMA_MB_CAP_LCD | \
111 CMA_MB_CAP_RTC | CMA_MB_CAP_SLOT1 | \
112 CMA_MB_CAP_SLOT2 | CMA_MB_CAP_SLOT3)
113 # define CMA_MB_NSLOTS 3
115 #elif defined(CONFIG_CMA110)
117 # define COGENT_MOTHERBOARD "CMA110"
118 # define CMA_MB_CAPS (CMA_MB_CAP_SERPAR | CMA_MB_CAP_LCD | \
119 CMA_MB_CAP_FLASH | CMA_MB_CAP_RTC | \
120 CMA_MB_CAP_KBM | CMA_MB_CAP_PCI)
121 # define CMA_MB_NSLOTS 0
123 #elif defined(CONFIG_CMA111)
125 # define COGENT_MOTHERBOARD "CMA111"
126 # define CMA_MB_CAPS (CMA_MB_CAP_SERPAR | CMA_MB_CAP_LCD | \
127 CMA_MB_CAP_FLASH | CMA_MB_CAP_RTC | \
128 CMA_MB_CAP_SLOT1 | CMA_MB_CAP_KBM | \
129 CMA_MB_CAP_PCI | CMA_MB_CAP_PCI_EXT | \
130 CMA_MB_CAP_PCI_ETHER)
131 # define CMA_MB_NSLOTS 1
133 #elif defined(CONFIG_CMA120)
135 # define COGENT_MOTHERBOARD "CMA120"
136 # define CMA_MB_CAPS (CMA_MB_CAP_SERPAR | CMA_MB_CAP_LCD | \
137 CMA_MB_CAP_FLASH | CMA_MB_CAP_RTC | \
138 CMA_MB_CAP_SLOT1 | CMA_MB_CAP_KBM | \
139 CMA_MB_CAP_SER2 | CMA_MB_CAP_PCI | \
140 CMA_MB_CAP_PCI_EXT | CMA_MB_CAP_PCI_ETHER | \
141 CMA_MB_CAP_PCI_VIDEO | CMA_MB_CAP_PCI_CARDBUS)
142 # define CMA_MB_NSLOTS 1
144 #elif defined(CONFIG_CMA150)
146 # define COGENT_MOTHERBOARD "CMA150"
147 # define CMA_MB_CAPS (CMA_MB_CAP_SERPAR | CMA_MB_CAP_LCD | \
148 CMA_MB_CAP_FLASH | CMA_MB_CAP_RTC | \
150 # define CMA_MB_NSLOTS 0
154 # error Cogent Motherboard either unsupported or undefined
159 * check a flash i/o module has been selected if no flash on m/b
162 #if defined(CONFIG_CMA302)
164 # define COGENT_FLASH_MODULE "CMA302"
166 #elif (CMA_MB_CAPS & CMA_MB_CAP_FLASH) == 0
168 # error Cogent Flash I/O module (e.g. CMA302) is required with this Motherboard
173 * some further sanity checks
176 #if (CMA_MB_CAPS & CMA_MB_CAP_PCI) && (CMA_MB_CAPS & CMA_MB_CAP_SLOT2)
177 #error Cogent Sanity Check: Both Slot2 and PCI are defined
180 #if (CMA_MB_CAPS & CMA_MB_CAP_PCI_EXT) && !(CMA_MB_CAPS & CMA_MB_CAP_PCI)
181 #error Extended PCI capability defined without PCI capability
184 #if (CMA_MB_CAPS & CMA_MB_CAP_PCI_ETHER) && !(CMA_MB_CAPS & CMA_MB_CAP_PCI)
185 #error Motherboard ethernet capability defined without PCI capability
188 #if (CMA_MB_CAPS & CMA_MB_CAP_SER2) && !(CMA_MB_CAPS & CMA_MB_CAP_SERPAR)
189 #error 2nd dual serial capability defined without serial/parallel capability
191 #include "../board/cogent/mb.h"
192 #endif /* _CONFIG_COGENT_COMMON_H */