blob: 504a136daab23566098d8341b758f92ce2fcad21 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Heiko Schocher3c773bb2014-01-25 07:53:48 +01002/*
3 * (C) Copyright 2013
4 * Heiko Schocher, DENX Software Engineering, hs@denx.de.
5 *
6 * Based on:
7 * Copyright (c) 2011 IDS GmbH, Germany
8 * Sergej Stepanov <ste@ids.de>
Heiko Schocher3c773bb2014-01-25 07:53:48 +01009 */
10
11#ifndef __CONFIG_H
12#define __CONFIG_H
13
14/*
15 * High Level Configuration Options
16 */
Heiko Schocher3c773bb2014-01-25 07:53:48 +010017#define CONFIG_FSL_ELBC
18
Heiko Schocher3c773bb2014-01-25 07:53:48 +010019#define CONFIG_BOOT_RETRY_TIME 900
20#define CONFIG_BOOT_RETRY_MIN 30
Heiko Schocher3c773bb2014-01-25 07:53:48 +010021#define CONFIG_RESET_TO_RETRY
22
Heiko Schocher3c773bb2014-01-25 07:53:48 +010023#define CONFIG_SYS_SICRH 0x00000000
24#define CONFIG_SYS_SICRL (SICRL_LBC | SICRL_SPI_D)
25
26#define CONFIG_HWCONFIG
27
Heiko Schocher3c773bb2014-01-25 07:53:48 +010028/*
29 * Definitions for initial stack pointer and data area (in DCACHE )
30 */
31#define CONFIG_SYS_INIT_RAM_LOCK
32#define CONFIG_SYS_INIT_RAM_ADDR 0xFD000000
33#define CONFIG_SYS_INIT_RAM_SIZE 0x1000 /* End of used area in DPRAM */
34#define CONFIG_SYS_GBL_DATA_SIZE 0x100
35#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_SIZE \
36 - CONFIG_SYS_GBL_DATA_SIZE)
37#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET
38
39/*
40 * Local Bus LCRR and LBCR regs
41 */
Heiko Schocher3c773bb2014-01-25 07:53:48 +010042#define CONFIG_SYS_LBC_LBCR (0x00040000 |\
43 (0xFF << LBCR_BMT_SHIFT) |\
44 0xF)
45
46#define CONFIG_SYS_LBC_MRTPR 0x20000000
47
48/*
49 * Internal Definitions
50 */
51/*
52 * DDR Setup
53 */
Mario Sixc9f92772019-01-21 09:18:15 +010054#define CONFIG_SYS_SDRAM_BASE 0x00000000
55#define CONFIG_SYS_DDR_SDRAM_BASE CONFIG_SYS_SDRAM_BASE
Heiko Schocher3c773bb2014-01-25 07:53:48 +010056
57/*
58 * Manually set up DDR parameters,
59 * as this board has not the SPD connected to I2C.
60 */
61#define CONFIG_SYS_DDR_SIZE 256 /* MB */
62#define CONFIG_SYS_DDR_CONFIG (CSCONFIG_EN |\
63 0x00010000 |\
64 CSCONFIG_ROW_BIT_13 |\
65 CSCONFIG_COL_BIT_10)
66
67#define CONFIG_SYS_DDR_CONFIG_256 (CONFIG_SYS_DDR_CONFIG | \
68 CSCONFIG_BANK_BIT_3)
69
70#define CONFIG_SYS_DDR_TIMING_3 (1 << 16) /* ext refrec */
71#define CONFIG_SYS_DDR_TIMING_0 ((3 << TIMING_CFG0_RWT_SHIFT) |\
72 (3 << TIMING_CFG0_WRT_SHIFT) |\
73 (3 << TIMING_CFG0_RRT_SHIFT) |\
74 (3 << TIMING_CFG0_WWT_SHIFT) |\
75 (6 << TIMING_CFG0_ACT_PD_EXIT_SHIFT) |\
76 (2 << TIMING_CFG0_PRE_PD_EXIT_SHIFT) |\
77 (8 << TIMING_CFG0_ODT_PD_EXIT_SHIFT) | \
78 (2 << TIMING_CFG0_MRS_CYC_SHIFT))
79#define CONFIG_SYS_DDR_TIMING_1 ((4 << TIMING_CFG1_PRETOACT_SHIFT) |\
80 (12 << TIMING_CFG1_ACTTOPRE_SHIFT) |\
81 (4 << TIMING_CFG1_ACTTORW_SHIFT) |\
82 (7 << TIMING_CFG1_CASLAT_SHIFT) |\
83 (4 << TIMING_CFG1_REFREC_SHIFT) |\
84 (4 << TIMING_CFG1_WRREC_SHIFT) |\
85 (2 << TIMING_CFG1_ACTTOACT_SHIFT) |\
86 (2 << TIMING_CFG1_WRTORD_SHIFT))
87#define CONFIG_SYS_DDR_TIMING_2 ((1 << TIMING_CFG2_ADD_LAT_SHIFT) |\
88 (5 << TIMING_CFG2_CPO_SHIFT) |\
89 (4 << TIMING_CFG2_WR_LAT_DELAY_SHIFT) |\
90 (2 << TIMING_CFG2_RD_TO_PRE_SHIFT) |\
91 (0 << TIMING_CFG2_WR_DATA_DELAY_SHIFT) |\
92 (1 << TIMING_CFG2_CKE_PLS_SHIFT) |\
93 (6 << TIMING_CFG2_FOUR_ACT_SHIFT))
94
95#define CONFIG_SYS_DDR_INTERVAL ((0x800 << SDRAM_INTERVAL_REFINT_SHIFT) |\
96 (0x800 << SDRAM_INTERVAL_BSTOPRE_SHIFT))
97
98#define CONFIG_SYS_SDRAM_CFG (SDRAM_CFG_SREN |\
99 SDRAM_CFG_2T_EN | SDRAM_CFG_HSE |\
100 SDRAM_CFG_DBW_32 |\
101 SDRAM_CFG_SDRAM_TYPE_DDR2)
102
103#define CONFIG_SYS_SDRAM_CFG2 0x00401000
104#define CONFIG_SYS_DDR_MODE ((0x0448 << SDRAM_MODE_ESD_SHIFT) |\
105 (0x0242 << SDRAM_MODE_SD_SHIFT))
106#define CONFIG_SYS_DDR_MODE_2 0x00000000
107#define CONFIG_SYS_DDR_CLK_CNTL DDR_SDRAM_CLK_CNTL_CLK_ADJUST_075
108#define CONFIG_SYS_DDRCDR_VALUE (DDRCDR_EN |\
109 DDRCDR_PZ_NOMZ |\
110 DDRCDR_NZ_NOMZ |\
111 DDRCDR_ODT |\
112 DDRCDR_M_ODR |\
113 DDRCDR_Q_DRN)
114
115/*
116 * on-board devices
117 */
118#define CONFIG_TSEC1
119#define CONFIG_TSEC2
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100120
121/*
122 * NOR FLASH setup
123 */
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100124#define CONFIG_SYS_FLASH_CFI_WIDTH FLASH_CFI_8BIT
125#define CONFIG_FLASH_SHOW_PROGRESS 50
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100126
127#define CONFIG_SYS_FLASH_BASE 0xFF800000
128#define CONFIG_SYS_FLASH_SIZE 8
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100129
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100130
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100131#define CONFIG_SYS_MAX_FLASH_BANKS 1
132#define CONFIG_SYS_MAX_FLASH_SECT 128
133
134#define CONFIG_SYS_FLASH_ERASE_TOUT 60000
135#define CONFIG_SYS_FLASH_WRITE_TOUT 500
136
137/*
138 * NAND FLASH setup
139 */
140#define CONFIG_SYS_NAND_BASE 0xE1000000
141#define CONFIG_SYS_MAX_NAND_DEVICE 1
142#define CONFIG_SYS_NAND_MAX_CHIPS 1
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100143#define CONFIG_NAND_FSL_ELBC
144#define CONFIG_SYS_NAND_PAGE_SIZE (2048)
145#define CONFIG_SYS_NAND_BLOCK_SIZE (128 << 10)
146#define NAND_CACHE_PAGES 64
147
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100148
149/*
150 * MRAM setup
151 */
152#define CONFIG_SYS_MRAM_BASE 0xE2000000
153#define CONFIG_SYS_MRAM_SIZE 0x20000 /* 128 Kb */
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100154
155#define CONFIG_SYS_OR_TIMING_MRAM
156
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100157
158/*
159 * CPLD setup
160 */
161#define CONFIG_SYS_CPLD_BASE 0xE3000000
162#define CONFIG_SYS_CPLD_SIZE 0x8000
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100163
164#define CONFIG_SYS_OR_TIMING_MRAM
165
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100166
167/*
168 * HW-Watchdog
169 */
170#define CONFIG_WATCHDOG 1
171#define CONFIG_SYS_WATCHDOG_VALUE 0xFFFF
172
173/*
174 * I2C setup
175 */
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100176#define CONFIG_SYS_I2C
177#define CONFIG_SYS_I2C_FSL
178#define CONFIG_SYS_FSL_I2C_SPEED 400000
179#define CONFIG_SYS_FSL_I2C_SLAVE 0x7F
180#define CONFIG_SYS_FSL_I2C_OFFSET 0x3100
181#define CONFIG_RTC_PCF8563
182#define CONFIG_SYS_I2C_RTC_ADDR 0x51
183
184/*
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100185 * Ethernet setup
186 */
187#ifdef CONFIG_TSEC1
188#define CONFIG_HAS_ETH0
189#define CONFIG_TSEC1_NAME "TSEC0"
190#define CONFIG_SYS_TSEC1_OFFSET 0x24000
191#define TSEC1_PHY_ADDR 0x1
192#define TSEC1_FLAGS TSEC_GIGABIT
193#define TSEC1_PHYIDX 0
194#endif
195
196#ifdef CONFIG_TSEC2
197#define CONFIG_HAS_ETH1
198#define CONFIG_TSEC2_NAME "TSEC1"
199#define CONFIG_SYS_TSEC2_OFFSET 0x25000
200#define TSEC2_PHY_ADDR 0x3
201#define TSEC2_FLAGS TSEC_GIGABIT
202#define TSEC2_PHYIDX 0
203#endif
204#define CONFIG_ETHPRIME "TSEC1"
205
206/*
207 * Serial Port
208 */
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100209#define CONFIG_SYS_NS16550_SERIAL
210#define CONFIG_SYS_NS16550_REG_SIZE 1
211
212#define CONFIG_SYS_BAUDRATE_TABLE \
213 {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 115200}
214#define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_IMMR + 0x4500)
215#define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_IMMR + 0x4600)
Mario Sixcd677ca2019-01-21 09:17:52 +0100216#define CONFIG_SYS_NS16550_CLK (get_bus_freq(0))
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100217
218#define CONFIG_HAS_FSL_DR_USB
219#define CONFIG_SYS_SCCR_USBDRCM 3
220
221/*
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100222 * U-Boot environment setup
223 */
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100224#define CONFIG_BOOTP_BOOTFILESIZE
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100225
226/*
227 * The reserved memory
228 */
229#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE
230#define CONFIG_SYS_MONITOR_LEN (768 * 1024)
231#define CONFIG_SYS_MALLOC_LEN (8 * 1024 * 1024)
232
233/*
234 * Environment Configuration
235 */
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100236#define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE \
237 + CONFIG_SYS_MONITOR_LEN)
238#define CONFIG_ENV_SIZE 0x20000
239#define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR + CONFIG_ENV_SIZE)
240#define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SIZE)
241
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100242#define CONFIG_NETDEV eth1
Mario Six790d8442018-03-28 14:38:20 +0200243#define CONFIG_HOSTNAME "ids8313"
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100244#define CONFIG_ROOTPATH "/opt/eldk-4.2/ppc_6xx"
245#define CONFIG_BOOTFILE "ids8313/uImage"
246#define CONFIG_UBOOTPATH "ids8313/u-boot.bin"
247#define CONFIG_FDTFILE "ids8313/ids8313.dtb"
248#define CONFIG_LOADADDR 0x400000
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100249#define CONFIG_ENV_FLAGS_LIST_STATIC "ethaddr:mo,eth1addr:mo"
250
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100251/* Initial Memory map for Linux*/
252#define CONFIG_SYS_BOOTMAPSZ (256 << 20)
253
254/*
255 * Miscellaneous configurable options
256 */
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100257#define CONFIG_SYS_CBSIZE 1024
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100258#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100259
260#define CONFIG_SYS_MEMTEST_START 0x00001000
261#define CONFIG_SYS_MEMTEST_END 0x00C00000
262
263#define CONFIG_SYS_LOAD_ADDR 0x100000
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100264#define CONFIG_LOADS_ECHO
265#define CONFIG_TIMESTAMP
266#define CONFIG_PREBOOT "echo;" \
267 "echo Type \\\"run nfsboot\\\" " \
268 "to mount root filesystem over NFS;echo"
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100269#define CONFIG_BOOTCOMMAND "run boot_cramfs"
270#undef CONFIG_SYS_LOADS_BAUD_CHANGE
271
272#define CONFIG_JFFS2_NAND
273#define CONFIG_JFFS2_DEV "0"
274
275/* mtdparts command line support */
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100276
277#define CONFIG_EXTRA_ENV_SETTINGS \
278 "netdev=" __stringify(CONFIG_NETDEV) "\0" \
279 "ethprime=TSEC1\0" \
280 "uboot=" __stringify(CONFIG_UBOOTPATH) "\0" \
281 "tftpflash=tftpboot ${loadaddr} ${uboot}; " \
282 "protect off " __stringify(CONFIG_SYS_TEXT_BASE) \
283 " +${filesize}; " \
284 "erase " __stringify(CONFIG_SYS_TEXT_BASE) \
285 " +${filesize}; " \
286 "cp.b ${loadaddr} " __stringify(CONFIG_SYS_TEXT_BASE) \
287 " ${filesize}; " \
288 "protect on " __stringify(CONFIG_SYS_TEXT_BASE) \
289 " +${filesize}; " \
290 "cmp.b ${loadaddr} " __stringify(CONFIG_SYS_TEXT_BASE) \
291 " ${filesize}\0" \
292 "console=ttyS0\0" \
293 "fdtaddr=0x780000\0" \
294 "kernel_addr=ff800000\0" \
295 "fdtfile=" __stringify(CONFIG_FDTFILE) "\0" \
296 "setbootargs=setenv bootargs " \
297 "root=${rootdev} rw console=${console}," \
298 "${baudrate} ${othbootargs}\0" \
299 "setipargs=setenv bootargs root=${rootdev} rw " \
300 "nfsroot=${serverip}:${rootpath} " \
301 "ip=${ipaddr}:${serverip}:${gatewayip}:" \
302 "${netmask}:${hostname}:${netdev}:off " \
303 "console=${console},${baudrate} ${othbootargs}\0" \
304 "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0" \
Tom Rini5ad8e112017-10-22 17:55:07 -0400305 "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
306 "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100307 "\0"
308
309#define CONFIG_NFSBOOTCOMMAND \
310 "setenv rootdev /dev/nfs;" \
311 "run setipargs;run addmtd;" \
312 "tftp ${loadaddr} ${bootfile};" \
313 "tftp ${fdtaddr} ${fdtfile};" \
314 "fdt addr ${fdtaddr};" \
315 "bootm ${loadaddr} - ${fdtaddr}"
316
317/* UBI Support */
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100318
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100319#endif /* __CONFIG_H */