blob: 32d9050adb952f14838e96ba00ed4ac5ba00f28e [file] [log] [blame]
Dirk Eibach9a13d812010-10-21 10:50:05 +02001/*
2 * (C) Copyright 2010
3 * Dirk Eibach, Guntermann & Drunck GmbH, eibach@gdsys.de
4 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
Dirk Eibach9a13d812010-10-21 10:50:05 +02006 */
7
8#ifndef __CONFIG_H
9#define __CONFIG_H
10
11#define CONFIG_405EP 1 /* this is a PPC405 CPU */
12#define CONFIG_4xx 1 /* member of PPC4xx family */
13#define CONFIG_IOCON 1 /* on a IoCon board */
14
15#define CONFIG_SYS_TEXT_BASE 0xFFFC0000
16
17/*
18 * Include common defines/options for all AMCC eval boards
19 */
20#define CONFIG_HOSTNAME iocon
Dirk Eibach5373c2b2012-04-26 03:54:25 +000021#define CONFIG_IDENT_STRING " iocon 0.04"
Dirk Eibach9a13d812010-10-21 10:50:05 +020022#include "amcc-common.h"
23
Dirk Eibach9a659572012-04-26 03:54:22 +000024#define CONFIG_BOARD_EARLY_INIT_F
25#define CONFIG_BOARD_EARLY_INIT_R
Dirk Eibach9a13d812010-10-21 10:50:05 +020026#define CONFIG_LAST_STAGE_INIT
27
28#define CONFIG_SYS_CLK_FREQ 33333333 /* external frequency to pll */
29
30/*
31 * Configure PLL
32 */
33#define PLLMR0_DEFAULT PLLMR0_266_133_66
34#define PLLMR1_DEFAULT PLLMR1_266_133_66
35
Dirk Eibach5373c2b2012-04-26 03:54:25 +000036#undef CONFIG_ZERO_BOOTDELAY_CHECK /* ignore keypress on bootdelay==0 */
37#define CONFIG_AUTOBOOT_KEYED /* use key strings to stop autoboot */
38#define CONFIG_AUTOBOOT_STOP_STR " "
39
Dirk Eibach9a13d812010-10-21 10:50:05 +020040/* new uImage format support */
41#define CONFIG_FIT
42#define CONFIG_FIT_VERBOSE /* enable fit_format_{error,warning}() */
43
44#define CONFIG_ENV_IS_IN_FLASH /* use FLASH for environment vars */
45
46/*
47 * Default environment variables
48 */
49#define CONFIG_EXTRA_ENV_SETTINGS \
50 CONFIG_AMCC_DEF_ENV \
51 CONFIG_AMCC_DEF_ENV_POWERPC \
52 CONFIG_AMCC_DEF_ENV_NOR_UPD \
53 "kernel_addr=fc000000\0" \
54 "fdt_addr=fc1e0000\0" \
55 "ramdisk_addr=fc200000\0" \
56 ""
57
58#define CONFIG_PHY_ADDR 4 /* PHY address */
59#define CONFIG_HAS_ETH0
60#define CONFIG_PHY_CLK_FREQ EMAC_STACR_CLK_66MHZ
61
62/*
63 * Commands additional to the ones defined in amcc-common.h
64 */
65#define CONFIG_CMD_CACHE
66#undef CONFIG_CMD_EEPROM
67
68/*
69 * SDRAM configuration (please see cpu/ppc/sdram.[ch])
70 */
71#define CONFIG_SDRAM_BANK0 1 /* init onboard SDRAM bank 0 */
72
73/* SDRAM timings used in datasheet */
74#define CONFIG_SYS_SDRAM_CL 3 /* CAS latency */
75#define CONFIG_SYS_SDRAM_tRP 20 /* PRECHARGE command period */
76#define CONFIG_SYS_SDRAM_tRC 66 /* ACTIVE-to-ACTIVE period */
77#define CONFIG_SYS_SDRAM_tRCD 20 /* ACTIVE-to-READ delay */
78#define CONFIG_SYS_SDRAM_tRFC 66 /* Auto refresh period */
79
80/*
81 * If CONFIG_SYS_EXT_SERIAL_CLOCK, then the UART divisor is 1.
82 * If CONFIG_SYS_405_UART_ERRATA_59, then UART divisor is 31.
83 * Otherwise, UART divisor is determined by CPU Clock and CONFIG_SYS_BASE_BAUD.
84 * The Linux BASE_BAUD define should match this configuration.
85 * baseBaud = cpuClock/(uartDivisor*16)
86 * If CONFIG_SYS_405_UART_ERRATA_59 and 200MHz CPU clock,
87 * set Linux BASE_BAUD to 403200.
88 */
89#define CONFIG_CONS_INDEX 1 /* Use UART0 */
90#undef CONFIG_SYS_EXT_SERIAL_CLOCK /* external serial clock */
91#undef CONFIG_SYS_405_UART_ERRATA_59 /* 405GP/CR Rev. D silicon */
92#define CONFIG_SYS_BASE_BAUD 691200
93
94/*
95 * I2C stuff
96 */
Heiko Schocher479a4cf2013-01-29 08:53:15 +010097#define CONFIG_SYS_I2C
Dirk Eibach42b204f2013-04-25 02:40:01 +000098#define CONFIG_SYS_I2C_PPC4XX
99#define CONFIG_SYS_I2C_PPC4XX_CH0
100#define CONFIG_SYS_I2C_PPC4XX_SPEED_0 400000
101#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
Dirk Eibach9a13d812010-10-21 10:50:05 +0200102
103/*
104 * Software (bit-bang) I2C driver configuration
105 */
106
107#ifndef __ASSEMBLY__
108void fpga_gpio_set(int pin);
109void fpga_gpio_clear(int pin);
110int fpga_gpio_get(int pin);
111#endif
112
113#define I2C_ACTIVE { }
114#define I2C_TRISTATE { }
115#define I2C_READ fpga_gpio_get(0x0040) ? 1 : 0
116#define I2C_SDA(bit) if (bit) fpga_gpio_set(0x0040); \
117 else fpga_gpio_clear(0x0040)
118#define I2C_SCL(bit) if (bit) fpga_gpio_set(0x0020); \
119 else fpga_gpio_clear(0x0020)
120#define I2C_DELAY udelay(25) /* 1/4 I2C clock duration */
121
122/*
Dirk Eibach81b37932011-01-21 09:31:21 +0100123 * OSD hardware
124 */
125#define CONFIG_SYS_MPC92469AC
126#define CONFIG_SYS_CH7301
127
128/*
Dirk Eibach9a13d812010-10-21 10:50:05 +0200129 * FLASH organization
130 */
131#define CONFIG_SYS_FLASH_CFI /* The flash is CFI compatible */
132#define CONFIG_FLASH_CFI_DRIVER /* Use common CFI driver */
133
134#define CONFIG_SYS_FLASH_BASE 0xFC000000
135#define CONFIG_SYS_FLASH_BANKS_LIST { CONFIG_SYS_FLASH_BASE }
136
137#define CONFIG_SYS_MAX_FLASH_BANKS 1 /* max num of memory banks */
138#define CONFIG_SYS_MAX_FLASH_SECT 512 /* max num of sectors per chip*/
139
140#define CONFIG_SYS_FLASH_ERASE_TOUT 120000 /* Timeout for Flash Erase/ms */
141#define CONFIG_SYS_FLASH_WRITE_TOUT 500 /* Timeout for Flash Write/ms */
142
143#define CONFIG_SYS_FLASH_USE_BUFFER_WRITE 1 /* use buff'd writes */
144#define CONFIG_SYS_FLASH_PROTECTION 1 /* use hardware flash protect */
145
146#define CONFIG_SYS_FLASH_EMPTY_INFO /* 'E' for empty sector on flinfo */
147#define CONFIG_SYS_FLASH_QUIET_TEST 1 /* no warn upon unknown flash */
148
149#ifdef CONFIG_ENV_IS_IN_FLASH
150#define CONFIG_ENV_SECT_SIZE 0x20000 /* size of one complete sector */
151#define CONFIG_ENV_ADDR ((-CONFIG_SYS_MONITOR_LEN)-CONFIG_ENV_SECT_SIZE)
152#define CONFIG_ENV_SIZE 0x2000 /* Total Size of Environment Sector */
153
154/* Address and size of Redundant Environment Sector */
155#define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR-CONFIG_ENV_SECT_SIZE)
156#define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SIZE)
157#endif
158
159/*
160 * PPC405 GPIO Configuration
161 */
162#define CONFIG_SYS_4xx_GPIO_TABLE { /* GPIO Alternate1 */ \
163{ \
164/* GPIO Core 0 */ \
165{ GPIO_BASE, GPIO_OUT, GPIO_ALT1, GPIO_OUT_NO_CHG }, /* GPIO0 PerBLast */ \
166{ GPIO_BASE, GPIO_OUT, GPIO_SEL, GPIO_OUT_NO_CHG }, /* GPIO1 TS1E */ \
167{ GPIO_BASE, GPIO_OUT, GPIO_SEL, GPIO_OUT_NO_CHG }, /* GPIO2 TS2E */ \
168{ GPIO_BASE, GPIO_IN, GPIO_SEL, GPIO_OUT_NO_CHG }, /* GPIO3 TS1O */ \
169{ GPIO_BASE, GPIO_OUT, GPIO_SEL, GPIO_OUT_NO_CHG }, /* GPIO4 TS2O */ \
170{ GPIO_BASE, GPIO_OUT, GPIO_SEL, GPIO_OUT_1 }, /* GPIO5 TS3 */ \
171{ GPIO_BASE, GPIO_IN, GPIO_SEL, GPIO_OUT_NO_CHG }, /* GPIO6 TS4 */ \
172{ GPIO_BASE, GPIO_OUT, GPIO_SEL, GPIO_OUT_NO_CHG }, /* GPIO7 TS5 */ \
173{ GPIO_BASE, GPIO_OUT, GPIO_SEL, GPIO_OUT_NO_CHG }, /* GPIO8 TS6 */ \
174{ GPIO_BASE, GPIO_OUT, GPIO_SEL, GPIO_OUT_NO_CHG }, /* GPIO9 TrcClk */ \
175{ GPIO_BASE, GPIO_OUT, GPIO_ALT1, GPIO_OUT_NO_CHG }, /* GPIO10 PerCS1 */ \
176{ GPIO_BASE, GPIO_OUT, GPIO_ALT1, GPIO_OUT_NO_CHG }, /* GPIO11 PerCS2 */ \
177{ GPIO_BASE, GPIO_OUT, GPIO_ALT1, GPIO_OUT_NO_CHG }, /* GPIO12 PerCS3 */ \
178{ GPIO_BASE, GPIO_OUT, GPIO_ALT1, GPIO_OUT_NO_CHG }, /* GPIO13 PerCS4 */ \
179{ GPIO_BASE, GPIO_OUT, GPIO_ALT1, GPIO_OUT_NO_CHG }, /* GPIO14 PerAddr03 */ \
180{ GPIO_BASE, GPIO_OUT, GPIO_ALT1, GPIO_OUT_NO_CHG }, /* GPIO15 PerAddr04 */ \
181{ GPIO_BASE, GPIO_OUT, GPIO_ALT1, GPIO_OUT_NO_CHG }, /* GPIO16 PerAddr05 */ \
182{ GPIO_BASE, GPIO_IN, GPIO_ALT1, GPIO_OUT_NO_CHG }, /* GPIO17 IRQ0 */ \
183{ GPIO_BASE, GPIO_IN, GPIO_ALT1, GPIO_OUT_NO_CHG }, /* GPIO18 IRQ1 */ \
184{ GPIO_BASE, GPIO_IN, GPIO_ALT1, GPIO_OUT_NO_CHG }, /* GPIO19 IRQ2 */ \
185{ GPIO_BASE, GPIO_IN, GPIO_SEL, GPIO_OUT_NO_CHG }, /* GPIO20 IRQ3 */ \
186{ GPIO_BASE, GPIO_OUT, GPIO_SEL, GPIO_OUT_NO_CHG }, /* GPIO21 IRQ4 */ \
187{ GPIO_BASE, GPIO_OUT, GPIO_SEL, GPIO_OUT_NO_CHG }, /* GPIO22 IRQ5 */ \
188{ GPIO_BASE, GPIO_IN, GPIO_SEL, GPIO_OUT_NO_CHG }, /* GPIO23 IRQ6 */ \
189{ GPIO_BASE, GPIO_IN, GPIO_ALT1, GPIO_OUT_NO_CHG }, /* GPIO24 UART0_DCD */ \
190{ GPIO_BASE, GPIO_IN, GPIO_ALT1, GPIO_OUT_NO_CHG }, /* GPIO25 UART0_DSR */ \
191{ GPIO_BASE, GPIO_IN, GPIO_ALT1, GPIO_OUT_NO_CHG }, /* GPIO26 UART0_RI */ \
192{ GPIO_BASE, GPIO_OUT, GPIO_ALT1, GPIO_OUT_NO_CHG }, /* GPIO27 UART0_DTR */ \
193{ GPIO_BASE, GPIO_IN, GPIO_ALT1, GPIO_OUT_NO_CHG }, /* GPIO28 UART1_Rx */ \
194{ GPIO_BASE, GPIO_OUT, GPIO_ALT1, GPIO_OUT_NO_CHG }, /* GPIO29 UART1_Tx */ \
195{ GPIO_BASE, GPIO_OUT, GPIO_SEL, GPIO_OUT_NO_CHG }, /* GPIO30 RejectPkt0 */ \
196{ GPIO_BASE, GPIO_IN, GPIO_SEL, GPIO_OUT_NO_CHG }, /* GPIO31 RejectPkt1 */ \
197} \
198}
199
200/*
201 * Definitions for initial stack pointer and data area (in data cache)
202 */
203/* use on chip memory (OCM) for temperary stack until sdram is tested */
204#define CONFIG_SYS_TEMP_STACK_OCM 1
205
206/* On Chip Memory location */
207#define CONFIG_SYS_OCM_DATA_ADDR 0xF8000000
208#define CONFIG_SYS_OCM_DATA_SIZE 0x1000
209#define CONFIG_SYS_INIT_RAM_ADDR CONFIG_SYS_OCM_DATA_ADDR /* in SDRAM */
210#define CONFIG_SYS_INIT_RAM_END CONFIG_SYS_OCM_DATA_SIZE /* End of used area */
211
212#define CONFIG_SYS_GBL_DATA_SIZE 128 /* size/bytes res'd for init data*/
213#define CONFIG_SYS_GBL_DATA_OFFSET \
214 (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE)
215#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET
216
217/*
218 * External Bus Controller (EBC) Setup
219 */
220
221/* Memory Bank 0 (NOR-FLASH) initialization */
222#define CONFIG_SYS_EBC_PB0AP 0xa382a880
223#define CONFIG_SYS_EBC_PB0CR 0xFC0DA000
224
225/* Memory Bank 1 (NVRAM) initializatio */
226#define CONFIG_SYS_EBC_PB1AP 0x92015480
227#define CONFIG_SYS_EBC_PB1CR 0xFB858000
228
Dirk Eibach81b37932011-01-21 09:31:21 +0100229/* Memory Bank 2 (FPGA0) initialization */
230#define CONFIG_SYS_FPGA0_BASE 0x7f100000
Dirk Eibach9a13d812010-10-21 10:50:05 +0200231#define CONFIG_SYS_EBC_PB2AP 0x02825080
Dirk Eibach81b37932011-01-21 09:31:21 +0100232#define CONFIG_SYS_EBC_PB2CR (CONFIG_SYS_FPGA0_BASE | 0x1a000)
Dirk Eibach9a13d812010-10-21 10:50:05 +0200233
Dirk Eibach81b37932011-01-21 09:31:21 +0100234#define CONFIG_SYS_FPGA_BASE(k) CONFIG_SYS_FPGA0_BASE
235#define CONFIG_SYS_FPGA_DONE(k) 0x0010
236
237#define CONFIG_SYS_FPGA_COUNT 1
Dirk Eibach9a13d812010-10-21 10:50:05 +0200238
239/* Memory Bank 3 (Latches) initialization */
240#define CONFIG_SYS_LATCH_BASE 0x7f200000
241#define CONFIG_SYS_EBC_PB3AP 0x02025080
242#define CONFIG_SYS_EBC_PB3CR 0x7f21a000
243
244#define CONFIG_SYS_LATCH0_RESET 0xffef
245#define CONFIG_SYS_LATCH0_BOOT 0xffff
246#define CONFIG_SYS_LATCH1_RESET 0xffff
247#define CONFIG_SYS_LATCH1_BOOT 0xffff
248
Dirk Eibach81b37932011-01-21 09:31:21 +0100249/*
250 * OSD Setup
251 */
252#define CONFIG_SYS_MPC92469AC
253#define CONFIG_SYS_CH7301
254#define CONFIG_SYS_OSD_SCREENS CONFIG_SYS_FPGA_COUNT
255
Dirk Eibach9a13d812010-10-21 10:50:05 +0200256#endif /* __CONFIG_H */