blob: 26f0741be3f10e84eae1dd6c1f1abb3cad4c0176 [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
Simon Glassfb64e362020-05-10 11:40:09 -060014#include <linux/stringify.h>
15
Heiko Schocher3c773bb2014-01-25 07:53:48 +010016/*
17 * High Level Configuration Options
18 */
Heiko Schocher3c773bb2014-01-25 07:53:48 +010019
Heiko Schocher3c773bb2014-01-25 07:53:48 +010020#define CONFIG_SYS_SICRH 0x00000000
21#define CONFIG_SYS_SICRL (SICRL_LBC | SICRL_SPI_D)
22
23#define CONFIG_HWCONFIG
24
Heiko Schocher3c773bb2014-01-25 07:53:48 +010025/*
26 * Definitions for initial stack pointer and data area (in DCACHE )
27 */
28#define CONFIG_SYS_INIT_RAM_LOCK
29#define CONFIG_SYS_INIT_RAM_ADDR 0xFD000000
30#define CONFIG_SYS_INIT_RAM_SIZE 0x1000 /* End of used area in DPRAM */
Heiko Schocher3c773bb2014-01-25 07:53:48 +010031
32/*
Heiko Schocher3c773bb2014-01-25 07:53:48 +010033 * Internal Definitions
34 */
35/*
36 * DDR Setup
37 */
Mario Sixc9f92772019-01-21 09:18:15 +010038#define CONFIG_SYS_SDRAM_BASE 0x00000000
Heiko Schocher3c773bb2014-01-25 07:53:48 +010039
40/*
41 * Manually set up DDR parameters,
42 * as this board has not the SPD connected to I2C.
43 */
Tom Rini2f05fef2022-07-23 13:04:56 -040044#define CONFIG_SYS_SDRAM_SIZE 0x10000000 /* 256 MiB */
Heiko Schocher3c773bb2014-01-25 07:53:48 +010045#define CONFIG_SYS_DDR_CONFIG (CSCONFIG_EN |\
46 0x00010000 |\
47 CSCONFIG_ROW_BIT_13 |\
48 CSCONFIG_COL_BIT_10)
49
50#define CONFIG_SYS_DDR_CONFIG_256 (CONFIG_SYS_DDR_CONFIG | \
51 CSCONFIG_BANK_BIT_3)
52
53#define CONFIG_SYS_DDR_TIMING_3 (1 << 16) /* ext refrec */
54#define CONFIG_SYS_DDR_TIMING_0 ((3 << TIMING_CFG0_RWT_SHIFT) |\
55 (3 << TIMING_CFG0_WRT_SHIFT) |\
56 (3 << TIMING_CFG0_RRT_SHIFT) |\
57 (3 << TIMING_CFG0_WWT_SHIFT) |\
58 (6 << TIMING_CFG0_ACT_PD_EXIT_SHIFT) |\
59 (2 << TIMING_CFG0_PRE_PD_EXIT_SHIFT) |\
60 (8 << TIMING_CFG0_ODT_PD_EXIT_SHIFT) | \
61 (2 << TIMING_CFG0_MRS_CYC_SHIFT))
62#define CONFIG_SYS_DDR_TIMING_1 ((4 << TIMING_CFG1_PRETOACT_SHIFT) |\
63 (12 << TIMING_CFG1_ACTTOPRE_SHIFT) |\
64 (4 << TIMING_CFG1_ACTTORW_SHIFT) |\
65 (7 << TIMING_CFG1_CASLAT_SHIFT) |\
66 (4 << TIMING_CFG1_REFREC_SHIFT) |\
67 (4 << TIMING_CFG1_WRREC_SHIFT) |\
68 (2 << TIMING_CFG1_ACTTOACT_SHIFT) |\
69 (2 << TIMING_CFG1_WRTORD_SHIFT))
70#define CONFIG_SYS_DDR_TIMING_2 ((1 << TIMING_CFG2_ADD_LAT_SHIFT) |\
71 (5 << TIMING_CFG2_CPO_SHIFT) |\
72 (4 << TIMING_CFG2_WR_LAT_DELAY_SHIFT) |\
73 (2 << TIMING_CFG2_RD_TO_PRE_SHIFT) |\
74 (0 << TIMING_CFG2_WR_DATA_DELAY_SHIFT) |\
75 (1 << TIMING_CFG2_CKE_PLS_SHIFT) |\
76 (6 << TIMING_CFG2_FOUR_ACT_SHIFT))
77
78#define CONFIG_SYS_DDR_INTERVAL ((0x800 << SDRAM_INTERVAL_REFINT_SHIFT) |\
79 (0x800 << SDRAM_INTERVAL_BSTOPRE_SHIFT))
80
81#define CONFIG_SYS_SDRAM_CFG (SDRAM_CFG_SREN |\
82 SDRAM_CFG_2T_EN | SDRAM_CFG_HSE |\
83 SDRAM_CFG_DBW_32 |\
84 SDRAM_CFG_SDRAM_TYPE_DDR2)
85
86#define CONFIG_SYS_SDRAM_CFG2 0x00401000
87#define CONFIG_SYS_DDR_MODE ((0x0448 << SDRAM_MODE_ESD_SHIFT) |\
88 (0x0242 << SDRAM_MODE_SD_SHIFT))
89#define CONFIG_SYS_DDR_MODE_2 0x00000000
90#define CONFIG_SYS_DDR_CLK_CNTL DDR_SDRAM_CLK_CNTL_CLK_ADJUST_075
91#define CONFIG_SYS_DDRCDR_VALUE (DDRCDR_EN |\
92 DDRCDR_PZ_NOMZ |\
93 DDRCDR_NZ_NOMZ |\
94 DDRCDR_ODT |\
95 DDRCDR_M_ODR |\
96 DDRCDR_Q_DRN)
97
98/*
99 * on-board devices
100 */
101#define CONFIG_TSEC1
102#define CONFIG_TSEC2
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100103
104/*
105 * NOR FLASH setup
106 */
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100107#define CONFIG_FLASH_SHOW_PROGRESS 50
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100108
109#define CONFIG_SYS_FLASH_BASE 0xFF800000
110#define CONFIG_SYS_FLASH_SIZE 8
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100111
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100112
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100113#define CONFIG_SYS_MAX_FLASH_SECT 128
114
115#define CONFIG_SYS_FLASH_ERASE_TOUT 60000
116#define CONFIG_SYS_FLASH_WRITE_TOUT 500
117
118/*
119 * NAND FLASH setup
120 */
121#define CONFIG_SYS_NAND_BASE 0xE1000000
122#define CONFIG_SYS_MAX_NAND_DEVICE 1
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100123#define NAND_CACHE_PAGES 64
124
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100125
126/*
127 * MRAM setup
128 */
129#define CONFIG_SYS_MRAM_BASE 0xE2000000
130#define CONFIG_SYS_MRAM_SIZE 0x20000 /* 128 Kb */
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100131
132#define CONFIG_SYS_OR_TIMING_MRAM
133
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100134
135/*
136 * CPLD setup
137 */
138#define CONFIG_SYS_CPLD_BASE 0xE3000000
139#define CONFIG_SYS_CPLD_SIZE 0x8000
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100140
141#define CONFIG_SYS_OR_TIMING_MRAM
142
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100143
144/*
145 * HW-Watchdog
146 */
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100147#define CONFIG_SYS_WATCHDOG_VALUE 0xFFFF
148
149/*
150 * I2C setup
151 */
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100152#define CONFIG_SYS_I2C_RTC_ADDR 0x51
153
154/*
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100155 * Ethernet setup
156 */
157#ifdef CONFIG_TSEC1
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100158#define CONFIG_TSEC1_NAME "TSEC0"
159#define CONFIG_SYS_TSEC1_OFFSET 0x24000
160#define TSEC1_PHY_ADDR 0x1
161#define TSEC1_FLAGS TSEC_GIGABIT
162#define TSEC1_PHYIDX 0
163#endif
164
165#ifdef CONFIG_TSEC2
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100166#define CONFIG_TSEC2_NAME "TSEC1"
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100167#define TSEC2_PHY_ADDR 0x3
168#define TSEC2_FLAGS TSEC_GIGABIT
169#define TSEC2_PHYIDX 0
170#endif
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100171
172/*
173 * Serial Port
174 */
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100175#define CONFIG_SYS_NS16550_SERIAL
176#define CONFIG_SYS_NS16550_REG_SIZE 1
177
178#define CONFIG_SYS_BAUDRATE_TABLE \
179 {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 115200}
180#define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_IMMR + 0x4500)
181#define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_IMMR + 0x4600)
Mario Sixcd677ca2019-01-21 09:17:52 +0100182#define CONFIG_SYS_NS16550_CLK (get_bus_freq(0))
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100183
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100184#define CONFIG_SYS_SCCR_USBDRCM 3
185
186/*
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100187 * U-Boot environment setup
188 */
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100189
190/*
191 * The reserved memory
192 */
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100193#define CONFIG_SYS_MONITOR_LEN (768 * 1024)
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100194
195/*
196 * Environment Configuration
197 */
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100198
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100199#define CONFIG_NETDEV eth1
Mario Six790d8442018-03-28 14:38:20 +0200200#define CONFIG_HOSTNAME "ids8313"
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100201#define CONFIG_ROOTPATH "/opt/eldk-4.2/ppc_6xx"
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100202#define CONFIG_UBOOTPATH "ids8313/u-boot.bin"
203#define CONFIG_FDTFILE "ids8313/ids8313.dtb"
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100204#define CONFIG_ENV_FLAGS_LIST_STATIC "ethaddr:mo,eth1addr:mo"
205
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100206/* Initial Memory map for Linux*/
207#define CONFIG_SYS_BOOTMAPSZ (256 << 20)
208
209/*
210 * Miscellaneous configurable options
211 */
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100212
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100213#define CONFIG_LOADS_ECHO
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100214#undef CONFIG_SYS_LOADS_BAUD_CHANGE
215
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100216/* mtdparts command line support */
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100217
218#define CONFIG_EXTRA_ENV_SETTINGS \
219 "netdev=" __stringify(CONFIG_NETDEV) "\0" \
220 "ethprime=TSEC1\0" \
221 "uboot=" __stringify(CONFIG_UBOOTPATH) "\0" \
222 "tftpflash=tftpboot ${loadaddr} ${uboot}; " \
223 "protect off " __stringify(CONFIG_SYS_TEXT_BASE) \
224 " +${filesize}; " \
225 "erase " __stringify(CONFIG_SYS_TEXT_BASE) \
226 " +${filesize}; " \
227 "cp.b ${loadaddr} " __stringify(CONFIG_SYS_TEXT_BASE) \
228 " ${filesize}; " \
229 "protect on " __stringify(CONFIG_SYS_TEXT_BASE) \
230 " +${filesize}; " \
231 "cmp.b ${loadaddr} " __stringify(CONFIG_SYS_TEXT_BASE) \
232 " ${filesize}\0" \
233 "console=ttyS0\0" \
234 "fdtaddr=0x780000\0" \
235 "kernel_addr=ff800000\0" \
236 "fdtfile=" __stringify(CONFIG_FDTFILE) "\0" \
237 "setbootargs=setenv bootargs " \
238 "root=${rootdev} rw console=${console}," \
239 "${baudrate} ${othbootargs}\0" \
240 "setipargs=setenv bootargs root=${rootdev} rw " \
241 "nfsroot=${serverip}:${rootpath} " \
242 "ip=${ipaddr}:${serverip}:${gatewayip}:" \
243 "${netmask}:${hostname}:${netdev}:off " \
244 "console=${console},${baudrate} ${othbootargs}\0" \
245 "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0" \
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100246 "\0"
247
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100248/* UBI Support */
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100249
Heiko Schocher3c773bb2014-01-25 07:53:48 +0100250#endif /* __CONFIG_H */