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#define FPGA_BASE_ADDR 0x80002000
33
34
35
36
37
38#define FPGA_SETTING_REG (FPGA_BASE_ADDR+0x3)
39
40#define FPGA_SET_REG_BOOT_SMALL_FLASH 0x80
41
42#define FPGA_SET_REG_OP_CODE_SRAM_SEL_MASK 0x40
43#define FPGA_SET_REG_OP_CODE_FLASH_ABOVE 0x40
44#define FPGA_SET_REG_SRAM_ABOVE 0x00
45
46#define FPGA_SET_REG_BOOT_NAND_FLASH_MASK 0x40
47#define FPGA_SET_REG_BOOT_NAND_FLASH_SELECT 0x00
48
49#define FPGA_SET_REG_PCI_EXT_ARBITER_SEL_MASK 0x10
50#define FPGA_SET_REG_PCI_EXT_ARBITER_SEL 0x00
51
52
53
54
55#define FPGA_SELECTION_1_REG (FPGA_BASE_ADDR+0x4)
56#define FPGA_SEL_1_REG_PHY_MASK 0xE0
57#define FPGA_SEL_1_REG_MII 0x80
58#define FPGA_SEL_1_REG_RMII 0x40
59#define FPGA_SEL_1_REG_SMII 0x20
60#define FPGA_SEL_1_REG_USB2_DEV_SEL 0x10
61#define FPGA_SEL_1_REG_USB2_HOST_SEL 0x08
62#define FPGA_SEL_1_REG_NF_SELEC_MASK 0x07
63#define FPGA_SEL_1_REG_NF0_SEL_BY_NFCS1 0x04
64#define FPGA_SEL_1_REG_NF1_SEL_BY_NFCS2 0x02
65#define FPGA_SEL_1_REG_NF1_SEL_BY_NFCS3 0x01
66
67
68
69
70#define FPGA_SELECTION_2_REG (FPGA_BASE_ADDR+0x5)
71#define FPGA_SEL2_REG_IIC1_SCP_SEL_MASK 0x80
72#define FPGA_SEL2_REG_SEL_FRAM 0x80
73#define FPGA_SEL2_REG_SEL_SCP 0x80
74#define FPGA_SEL2_REG_SEL_IIC1 0x00
75#define FPGA_SEL2_REG_SEL_DMA_A_B 0x40
76#define FPGA_SEL2_REG_SEL_DMA_C_D 0x20
77#define FPGA_SEL2_REG_DMA_EOT_TC_3_SEL 0x10
78
79#define FPGA_SEL2_REG_DMA_EOT_TC_2_SEL 0x08
80
81#define FPGA_SEL2_REG_SEL_GPIO_1 0x04
82#define FPGA_SEL2_REG_SEL_GPIO_2 0x02
83#define FPGA_SEL2_REG_SEL_GPIO_3 0x01
84
85
86
87
88#define FPGA_SELECTION_3_REG (FPGA_BASE_ADDR+0x6)
89#define FPGA_SEL3_REG_EXP_SLOT_EN 0x80
90#define FPGA_SEL3_REG_SEL_UART_CONFIG_MASK 0x70
91#define FPGA_SEL3_REG_SEL_UART_CONFIG1 0x40
92#define FPGA_SEL3_REG_SEL_UART_CONFIG2 0x20
93#define FPGA_SEL3_REG_SEL_UART_CONFIG3 0x10
94#define FPGA_SEL3_REG_SEL_UART_CONFIG4 0x08
95#define FPGA_SEL3_REG_DTR_DSR_MODE_4_PIN_UART 0x00
96#define FPGA_SEL3_REG_RTS_CTS_MODE_4_PIN_UART 0x04
97
98
99
100
101#define FPGA_RESET_REG (FPGA_BASE_ADDR+0x7)
102#define FPGA_RESET_REG_RESET_USB20_DEV 0x80
103#define FPGA_RESET_REG_RESET_DISPLAY 0x40
104#define FPGA_RESET_REG_STATUS_LED_0 0x08
105#define FPGA_RESET_REG_STATUS_LED_1 0x04
106#define FPGA_RESET_REG_STATUS_LED_2 0x02
107#define FPGA_RESET_REG_STATUS_LED_3 0x01
108
109
110
111
112
113#define SDR0_SDSTP1_EBC_ROM_BS_MASK 0x00006000
114#define SDR0_SDSTP1_EBC_ROM_BS_32BIT 0x00004000
115#define SDR0_SDSTP1_EBC_ROM_BS_16BIT 0x00002000
116#define SDR0_SDSTP1_EBC_ROM_BS_8BIT 0x00000000
117
118#define SDR0_SDSTP1_BOOT_SEL_MASK 0x00001800
119#define SDR0_SDSTP1_BOOT_SEL_EBC 0x00000000
120#define SDR0_SDSTP1_BOOT_SEL_PCI 0x00000800
121#define SDR0_SDSTP1_BOOT_SEL_NDFC 0x00001000
122
123
124#define SDR0_PSTRP0_BOOTSTRAP_IIC_A8_EN SDR0_PSTRP0_BOOTSTRAP_SETTINGS5
125
126#define SDR0_PSTRP0_BOOTSTRAP_IIC_A4_EN SDR0_PSTRP0_BOOTSTRAP_SETTINGS7
127
128
129#define SDR0_PSTRP0 0x0040
130#define SDR0_PSTRP0_BOOTSTRAP_MASK 0xE0000000
131
132#define SDR0_PSTRP0_BOOTSTRAP_SETTINGS0 0x00000000
133#define SDR0_PSTRP0_BOOTSTRAP_SETTINGS1 0x20000000
134#define SDR0_PSTRP0_BOOTSTRAP_SETTINGS2 0x40000000
135#define SDR0_PSTRP0_BOOTSTRAP_SETTINGS3 0x60000000
136#define SDR0_PSTRP0_BOOTSTRAP_SETTINGS4 0x80000000
137#define SDR0_PSTRP0_BOOTSTRAP_SETTINGS5 0xA0000000
138#define SDR0_PSTRP0_BOOTSTRAP_SETTINGS6 0xC0000000
139#define SDR0_PSTRP0_BOOTSTRAP_SETTINGS7 0xE0000000
140
141
142
143
144
145#define EBC0_CFG_EBTC_DRIVEN 0x80000000
146
147#define EBC0_CFG_PTD_ENABLED 0x00000000
148
149#define EBC0_CFG_RTC_MASK 0x38000000
150#define EBC0_CFG_RTC_16PERCLK 0x00000000
151#define EBC0_CFG_RTC_32PERCLK 0x08000000
152#define EBC0_CFG_RTC_64PERCLK 0x10000000
153#define EBC0_CFG_RTC_128PERCLK 0x18000000
154#define EBC0_CFG_RTC_256PERCLK 0x20000000
155#define EBC0_CFG_RTC_512PERCLK 0x28000000
156#define EBC0_CFG_RTC_1024PERCLK 0x30000000
157#define EBC0_CFG_RTC_2048PERCLK 0x38000000
158
159#define EBC0_CFG_EMPL_LOW 0x00000000
160#define EBC0_CFG_EMPL_MEDIUM_LOW 0x02000000
161#define EBC0_CFG_EMPL_MEDIUM_HIGH 0x04000000
162#define EBC0_CFG_EMPL_HIGH 0x06000000
163
164#define EBC0_CFG_EMPH_LOW 0x00000000
165#define EBC0_CFG_EMPH_MEDIUM_LOW 0x00800000
166#define EBC0_CFG_EMPH_MEDIUM_HIGH 0x01000000
167#define EBC0_CFG_EMPH_HIGH 0x01800000
168
169#define EBC0_CFG_CSTC_DRIVEN 0x00400000
170
171#define EBC0_CFG_BPF_ONEDW 0x00000000
172#define EBC0_CFG_BPF_TWODW 0x00100000
173#define EBC0_CFG_BPF_FOURDW 0x00200000
174
175#define EBC0_CFG_EMS_8BIT 0x00000000
176
177#define EBC0_CFG_PME_DISABLED 0x00000000
178#define EBC0_CFG_PME_ENABLED 0x00020000
179
180#define EBC0_CFG_PMT_ENCODE(n) ((((unsigned long)(n))&0x1F)<<12)
181
182
183
184
185
186#define EBC0_BNCR_BAS_ENCODE(n) ((((unsigned long)(n))&0xFFF00000)<<0)
187
188#define EBC0_BNCR_BS_MASK 0x000E0000
189#define EBC0_BNCR_BS_1MB 0x00000000
190#define EBC0_BNCR_BS_2MB 0x00020000
191#define EBC0_BNCR_BS_4MB 0x00040000
192#define EBC0_BNCR_BS_8MB 0x00060000
193#define EBC0_BNCR_BS_16MB 0x00080000
194#define EBC0_BNCR_BS_32MB 0x000A0000
195#define EBC0_BNCR_BS_64MB 0x000C0000
196#define EBC0_BNCR_BS_128MB 0x000E0000
197
198#define EBC0_BNCR_BU_MASK 0x00018000
199#define EBC0_BNCR_BU_RO 0x00008000
200#define EBC0_BNCR_BU_WO 0x00010000
201#define EBC0_BNCR_BU_RW 0x00018000
202
203#define EBC0_BNCR_BW_MASK 0x00006000
204#define EBC0_BNCR_BW_8BIT 0x00000000
205#define EBC0_BNCR_BW_16BIT 0x00002000
206#define EBC0_BNCR_BW_32BIT 0x00004000
207
208
209
210
211
212#define EBC0_BNAP_BME_ENABLED 0x80000000
213#define EBC0_BNAP_BME_DISABLED 0x00000000
214
215#define EBC0_BNAP_TWT_ENCODE(n) ((((unsigned long)(n))&0xFF)<<23)
216
217#define EBC0_BNAP_CSN_ENCODE(n) ((((unsigned long)(n))&0x3)<<18)
218
219#define EBC0_BNAP_OEN_ENCODE(n) ((((unsigned long)(n))&0x3)<<16)
220
221#define EBC0_BNAP_WBN_ENCODE(n) ((((unsigned long)(n))&0x3)<<14)
222
223#define EBC0_BNAP_WBF_ENCODE(n) ((((unsigned long)(n))&0x3)<<12)
224
225#define EBC0_BNAP_TH_ENCODE(n) ((((unsigned long)(n))&0x7)<<9)
226
227#define EBC0_BNAP_RE_ENABLED 0x00000100
228#define EBC0_BNAP_RE_DISABLED 0x00000000
229
230#define EBC0_BNAP_SOR_DELAYED 0x00000000
231#define EBC0_BNAP_SOR_NOT_DELAYED 0x00000080
232
233#define EBC0_BNAP_BEM_WRITEONLY 0x00000000
234#define EBC0_BNAP_BEM_RW 0x00000040
235
236#define EBC0_BNAP_PEN_DISABLED 0x00000000
237#define EBC0_BNAP_PEN_ENABLED 0x00000020
238
239
240
241
242
243#define BOOT_FROM_SMALL_FLASH 0x00
244#define BOOT_FROM_LARGE_FLASH_OR_SRAM 0x01
245#define BOOT_FROM_NAND_FLASH0 0x02
246#define BOOT_FROM_PCI 0x03
247#define BOOT_DEVICE_UNKNOWN 0x04
248
249
250#define PVR_POWERPC_440EP_PASS1 0x42221850
251#define PVR_POWERPC_440EP_PASS2 0x422218D3
252
253#define GPIO0 0
254#define GPIO1 1
255
256
257#define MAX_CORE_SELECT_NB 22
258
259
260
261
262#define GPIO0_REAL 0xEF600B00
263
264#define GPIO1_REAL 0xEF600C00
265
266
267#define GPIOx_OR 0x00
268#define GPIOx_TCR 0x04
269#define GPIOx_OSL 0x08
270#define GPIOx_OSH 0x0C
271#define GPIOx_TSL 0x10
272#define GPIOx_TSH 0x14
273#define GPIOx_ODR 0x18
274#define GPIOx_IR 0x1C
275#define GPIOx_RR1 0x20
276#define GPIOx_RR2 0x24
277#define GPIOx_RR3 0x28
278#define GPIOx_IS1L 0x30
279#define GPIOx_IS1H 0x34
280#define GPIOx_IS2L 0x38
281#define GPIOx_IS2H 0x3C
282#define GPIOx_IS3L 0x40
283#define GPIOx_IS3H 0x44
284
285
286#define GPIO0_IS1L (GPIO0_BASE+GPIOx_IS1L)
287#define GPIO0_IS1H (GPIO0_BASE+GPIOx_IS1H)
288#define GPIO0_IS2L (GPIO0_BASE+GPIOx_IS2L)
289#define GPIO0_IS2H (GPIO0_BASE+GPIOx_IS2H)
290#define GPIO0_IS3L (GPIO0_BASE+GPIOx_IS3L)
291#define GPIO0_IS3H (GPIO0_BASE+GPIOx_IS3L)
292
293
294#define GPIO1_IS1L (GPIO1_BASE+GPIOx_IS1L)
295#define GPIO1_IS1H (GPIO1_BASE+GPIOx_IS1H)
296#define GPIO1_IS2L (GPIO1_BASE+GPIOx_IS2L)
297#define GPIO1_IS2H (GPIO1_BASE+GPIOx_IS2H)
298#define GPIO1_IS3L (GPIO1_BASE+GPIOx_IS3L)
299#define GPIO1_IS3H (GPIO1_BASE+GPIOx_IS3L)
300
301#define GPIO_OS(x) (x+GPIOx_OSL)
302#define GPIO_TS(x) (x+GPIOx_TSL)
303#define GPIO_IS1(x) (x+GPIOx_IS1L)
304#define GPIO_IS2(x) (x+GPIOx_IS2L)
305#define GPIO_IS3(x) (x+GPIOx_IS3L)
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320typedef enum zmii_config { ZMII_CONFIGURATION_UNKNOWN,
321 ZMII_CONFIGURATION_IS_MII,
322 ZMII_CONFIGURATION_IS_RMII,
323 ZMII_CONFIGURATION_IS_SMII
324} zmii_config_t;
325
326
327
328
329typedef enum uart_config_nb { L1, L2, L3, L4 } uart_config_nb_t;
330typedef enum core_selection { CORE_NOT_SELECTED, CORE_SELECTED} core_selection_t;
331typedef enum config_list { IIC_CORE,
332 SCP_CORE,
333 DMA_CHANNEL_AB,
334 UIC_4_9,
335 USB2_HOST,
336 DMA_CHANNEL_CD,
337 USB2_DEVICE,
338 PACKET_REJ_FUNC_AVAIL,
339 USB1_DEVICE,
340 EBC_MASTER,
341 NAND_FLASH,
342 UART_CORE0,
343 UART_CORE1,
344 UART_CORE2,
345 UART_CORE3,
346 MII_SEL,
347 RMII_SEL,
348 SMII_SEL,
349 PACKET_REJ_FUNC_EN,
350 UIC_0_3,
351 USB1_HOST,
352 PCI_PATCH,
353 CORE_NB
354} core_list_t;
355
356typedef enum block3_value { B3_V1, B3_V2, B3_V3, B3_V4, B3_V5,
357 B3_V6, B3_V7, B3_V8, B3_V9, B3_V10,
358 B3_V11, B3_V12, B3_V13, B3_V14, B3_V15,
359 B3_V16, B3_VALUE_UNKNOWN
360} block3_value_t;
361
362typedef enum config_validity { CONFIG_IS_VALID,
363 CONFIG_IS_INVALID
364} config_validity_t;
365