summaryrefslogtreecommitdiff
path: root/include/configs/cogent_common.h
blob: 7eab9ea11ea34568c51079e8e33ff990359025ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
/*
 * (C) Copyright 2000
 * Murray Jensen, CSIRO-MST
 *
 * See file CREDITS for list of people who contributed to this
 * project.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of
 * the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 * MA 02111-1307 USA
 */

#ifndef _CONFIG_COGENT_COMMON_H
#define _CONFIG_COGENT_COMMON_H

/*
 * Cogent Motherboard Capabilities
 */
#define CMA_MB_CAP_SERPAR	0x0001	/* has dual serial+parallel (16C552) */
#define CMA_MB_CAP_LCD		0x0002	/* has LCD display (HD44780) */
#define CMA_MB_CAP_FLASH	0x0004	/* has flash (E28F800B or AM29F800BB) */
#define CMA_MB_CAP_RTC		0x0008	/* has RTC+NVRAM (MK48T02) */
#define CMA_MB_CAP_ETHER	0x0010	/* has Ethernet (MB86964) */
#define CMA_MB_CAP_SLOT1	0x0020	/* has CMABus slot 1 */
#define CMA_MB_CAP_SLOT2	0x0040	/* has CMABus slot 2 */
#define CMA_MB_CAP_SLOT3	0x0080	/* has CMABus slot 3 */
#define CMA_MB_CAP_KBM		0x0100	/* has PS/2 keyboard+mouse (HT6542B) */
#define CMA_MB_CAP_SER2		0x0200	/* has 2nd dual serial (16C2552) */
#define CMA_MB_CAP_PCI		0x0400	/* has pci bridge (V360EPC) */
#define CMA_MB_CAP_PCI_EXT	0x0800	/* can access extended pci space  */
#define CMA_MB_CAP_PCI_ETHER	0x1000	/* has 10/100 ether on PCI (GD82559) */
#define CMA_MB_CAP_PCI_VIDEO	0x2000	/* has video int'face on PCI (B69000) */
#define CMA_MB_CAP_PCI_CARDBUS	0x4000	/* has Cardbus Ctlr on PCI (PD6832) */

/*
 * Cogent option sanity checking
 */

#if defined(CONFIG_MPC821) || defined(CONFIG_MPC823) || \
      defined(CONFIG_MPC850) || defined(CONFIG_MPC860)

/*
 * check a PowerPC 8xx cpu module has been selected
 */

# if defined(CONFIG_CMA286_21)

#  define COGENT_CPU_MODULE	"CMA286-21"

# elif defined(CONFIG_CMA286_60_OLD)

#  define COGENT_CPU_MODULE	"CMA286-60 (old)"

# elif defined(CONFIG_CMA286_60)

#  define COGENT_CPU_MODULE	"CMA286-60"

# elif defined(CONFIG_CMA286_60P)

#  define COGENT_CPU_MODULE	"CMA286-60P"

# elif defined(CONFIG_CMA287_21)

#  define COGENT_CPU_MODULE	"CMA287-21"

# elif defined(CONFIG_CMA287_50)

#  define COGENT_CPU_MODULE	"CMA287-50"

# else

#  error Cogent CPU Module must be a PowerPC MPC8xx module

# endif

#elif defined(CONFIG_MPC8260)

/*
 * check a PowerPC 8260 cpu module has been selected
 */

# if defined(CONFIG_CMA282)

#  define COGENT_CPU_MODULE	"CMA282"

# else

#  error Cogent CPU Module must be a PowerPC MPC8260 module

# endif

#else

# error CPU type must be PowerPC 8xx or 8260

#endif

/*
 * check a motherboard has been selected
 * define the motherboard capabilities while we're at it
 */

#if defined(CONFIG_CMA101)

# define COGENT_MOTHERBOARD	"CMA101"
# define CMA_MB_CAPS		(CMA_MB_CAP_SERPAR | CMA_MB_CAP_LCD | \
				 CMA_MB_CAP_RTC | CMA_MB_CAP_ETHER | \
				 CMA_MB_CAP_SLOT1 | CMA_MB_CAP_SLOT2 | \
				 CMA_MB_CAP_SLOT3)
# define CMA_MB_NSLOTS		3

#elif defined(CONFIG_CMA102)

# define COGENT_MOTHERBOARD	"CMA102"
# define CMA_MB_CAPS		(CMA_MB_CAP_SERPAR | CMA_MB_CAP_LCD | \
				 CMA_MB_CAP_RTC | CMA_MB_CAP_SLOT1 | \
				 CMA_MB_CAP_SLOT2 | CMA_MB_CAP_SLOT3)
# define CMA_MB_NSLOTS		3

#elif defined(CONFIG_CMA110)

# define COGENT_MOTHERBOARD	"CMA110"
# define CMA_MB_CAPS		(CMA_MB_CAP_SERPAR | CMA_MB_CAP_LCD | \
				 CMA_MB_CAP_FLASH | CMA_MB_CAP_RTC | \
				 CMA_MB_CAP_KBM | CMA_MB_CAP_PCI)
# define CMA_MB_NSLOTS		0

#elif defined(CONFIG_CMA111)

# define COGENT_MOTHERBOARD	"CMA111"
# define CMA_MB_CAPS		(CMA_MB_CAP_SERPAR | CMA_MB_CAP_LCD | \
				 CMA_MB_CAP_FLASH | CMA_MB_CAP_RTC | \
				 CMA_MB_CAP_SLOT1 | CMA_MB_CAP_KBM | \
				 CMA_MB_CAP_PCI | CMA_MB_CAP_PCI_EXT | \
				 CMA_MB_CAP_PCI_ETHER)
# define CMA_MB_NSLOTS		1

#elif defined(CONFIG_CMA120)

# define COGENT_MOTHERBOARD	"CMA120"
# define CMA_MB_CAPS		(CMA_MB_CAP_SERPAR | CMA_MB_CAP_LCD | \
				 CMA_MB_CAP_FLASH | CMA_MB_CAP_RTC | \
				 CMA_MB_CAP_SLOT1 | CMA_MB_CAP_KBM | \
				 CMA_MB_CAP_SER2 | CMA_MB_CAP_PCI | \
				 CMA_MB_CAP_PCI_EXT | CMA_MB_CAP_PCI_ETHER | \
				 CMA_MB_CAP_PCI_VIDEO | CMA_MB_CAP_PCI_CARDBUS)
# define CMA_MB_NSLOTS		1

#elif defined(CONFIG_CMA150)

# define COGENT_MOTHERBOARD	"CMA150"
# define CMA_MB_CAPS		(CMA_MB_CAP_SERPAR | CMA_MB_CAP_LCD | \
				 CMA_MB_CAP_FLASH | CMA_MB_CAP_RTC | \
				 CMA_MB_CAP_KBM)
# define CMA_MB_NSLOTS		0

#else

# error Cogent Motherboard either unsupported or undefined

#endif

/*
 * check a flash i/o module has been selected if no flash on m/b
 */

#if defined(CONFIG_CMA302)

# define COGENT_FLASH_MODULE	"CMA302"

#elif (CMA_MB_CAPS & CMA_MB_CAP_FLASH) == 0

# error Cogent Flash I/O module (e.g. CMA302) is required with this Motherboard

#endif

/*
 * some further sanity checks
 */

#if (CMA_MB_CAPS & CMA_MB_CAP_PCI) && (CMA_MB_CAPS & CMA_MB_CAP_SLOT2)
#error Cogent Sanity Check: Both Slot2 and PCI are defined
#endif

#if (CMA_MB_CAPS & CMA_MB_CAP_PCI_EXT) && !(CMA_MB_CAPS & CMA_MB_CAP_PCI)
#error Extended PCI capability defined without PCI capability
#endif

#if (CMA_MB_CAPS & CMA_MB_CAP_PCI_ETHER) && !(CMA_MB_CAPS & CMA_MB_CAP_PCI)
#error Motherboard ethernet capability defined without PCI capability
#endif

#if (CMA_MB_CAPS & CMA_MB_CAP_SER2) && !(CMA_MB_CAPS & CMA_MB_CAP_SERPAR)
#error 2nd dual serial capability defined without serial/parallel capability
#endif
#include <board/cogent/mb.h>
#endif	/* _CONFIG_COGENT_COMMON_H */