blob: 7c4dba0387e126f72f7de1d49ebb4829fe2560ad [file] [log] [blame]
Masahiro Yamada5894ca02014-10-03 19:21:06 +09001/*
2 * Copyright (C) 2012-2014 Panasonic Corporation
3 * Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
4 *
5 * SPDX-License-Identifier: GPL-2.0+
6 */
7
8/* U-boot - Common settings for UniPhier Family */
9
10#ifndef __CONFIG_UNIPHIER_COMMON_H__
11#define __CONFIG_UNIPHIER_COMMON_H__
12
13#if defined(CONFIG_PFC_MICRO_SUPPORT_CARD) && \
14 defined(CONFIG_DCC_MICRO_SUPPORT_CARD)
15# error "Both CONFIG_PFC_MICRO_SUPPORT_CARD and CONFIG_DCC_MICRO_SUPPORT_CARD \
16are defined. Select only one of them."
17#endif
18
19/*
20 * Support card address map
21 */
22#if defined(CONFIG_PFC_MICRO_SUPPORT_CARD)
23# define CONFIG_SUPPORT_CARD_BASE 0x03f00000
24# define CONFIG_SUPPORT_CARD_ETHER_BASE (CONFIG_SUPPORT_CARD_BASE + 0x00000000)
25# define CONFIG_SUPPORT_CARD_LED_BASE (CONFIG_SUPPORT_CARD_BASE + 0x00090000)
26# define CONFIG_SUPPORT_CARD_UART_BASE (CONFIG_SUPPORT_CARD_BASE + 0x000b0000)
27#endif
28
29#if defined(CONFIG_DCC_MICRO_SUPPORT_CARD)
30# define CONFIG_SUPPORT_CARD_BASE 0x08000000
31# define CONFIG_SUPPORT_CARD_ETHER_BASE (CONFIG_SUPPORT_CARD_BASE + 0x00000000)
32# define CONFIG_SUPPORT_CARD_LED_BASE (CONFIG_SUPPORT_CARD_BASE + 0x00401630)
33# define CONFIG_SUPPORT_CARD_UART_BASE (CONFIG_SUPPORT_CARD_BASE + 0x00200000)
34#endif
35
Masahiro Yamadad064cbf2014-10-23 22:26:10 +090036#ifdef CONFIG_SYS_NS16550_SERIAL
Masahiro Yamada5894ca02014-10-03 19:21:06 +090037#define CONFIG_SYS_NS16550
38#define CONFIG_SYS_NS16550_COM1 CONFIG_SUPPORT_CARD_UART_BASE
39#define CONFIG_SYS_NS16550_CLK 12288000
40#define CONFIG_SYS_NS16550_REG_SIZE -2
Masahiro Yamadad064cbf2014-10-23 22:26:10 +090041#endif
Masahiro Yamada5894ca02014-10-03 19:21:06 +090042
43#define CONFIG_SMC911X_BASE CONFIG_SUPPORT_CARD_ETHER_BASE
44#define CONFIG_SMC911X_32_BIT
45
Masahiro Yamada0d8c7f72014-11-11 21:50:41 +090046#define CONFIG_SYS_MALLOC_F_LEN 0x2000
Masahiro Yamada5894ca02014-10-03 19:21:06 +090047
48/*-----------------------------------------------------------------------
49 * MMU and Cache Setting
50 *----------------------------------------------------------------------*/
51
52/* Comment out the following to enable L1 cache */
53/* #define CONFIG_SYS_ICACHE_OFF */
54/* #define CONFIG_SYS_DCACHE_OFF */
55
56/* Comment out the following to enable L2 cache */
57#define CONFIG_UNIPHIER_L2CACHE_ON
58
59#define CONFIG_DISPLAY_CPUINFO
60#define CONFIG_DISPLAY_BOARDINFO
61#define CONFIG_BOARD_LATE_INIT
62
63#define CONFIG_SYS_MALLOC_LEN (4 * 1024 * 1024)
64
65#define CONFIG_TIMESTAMP
66
67/* FLASH related */
68#define CONFIG_MTD_DEVICE
69
70/*
71 * uncomment the following to disable FLASH related code.
72 */
73/* #define CONFIG_SYS_NO_FLASH */
74
75#define CONFIG_FLASH_CFI_DRIVER
76#define CONFIG_SYS_FLASH_CFI
77
78#define CONFIG_SYS_MAX_FLASH_SECT 256
79#define CONFIG_SYS_MONITOR_BASE 0
80#define CONFIG_SYS_FLASH_BASE 0
81
82/*
83 * flash_toggle does not work for out supoort card.
84 * We need to use flash_status_poll.
85 */
86#define CONFIG_SYS_CFI_FLASH_STATUS_POLL
87
88#define CONFIG_FLASH_SHOW_PROGRESS 45 /* count down from 45/5: 9..1 */
89
90#if defined(CONFIG_PFC_MICRO_SUPPORT_CARD)
91# define CONFIG_SYS_MAX_FLASH_BANKS 1
92# define CONFIG_SYS_FLASH_BANKS_LIST {0x00000000}
93# define CONFIG_SYS_FLASH_BANKS_SIZES {0x02000000}
94#endif
95
96#if defined(CONFIG_DCC_MICRO_SUPPORT_CARD)
97# define CONFIG_SYS_MAX_FLASH_BANKS 1
98# define CONFIG_SYS_FLASH_BANKS_LIST {0x04000000}
99# define CONFIG_SYS_FLASH_BANKS_SIZES {0x04000000}
100#endif
101
102/* serial console configuration */
103#define CONFIG_BAUDRATE 115200
104
105#define CONFIG_SYS_GENERIC_BOARD
106
107#if !defined(CONFIG_SPL_BUILD)
108#define CONFIG_USE_ARCH_MEMSET
109#define CONFIG_USE_ARCH_MEMCPY
110#endif
111
112#define CONFIG_SYS_LONGHELP /* undef to save memory */
113
114#define CONFIG_CMDLINE_EDITING /* add command line history */
115#define CONFIG_SYS_HUSH_PARSER /* use "hush" command parser */
116#define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
117/* Print Buffer Size */
118#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
119#define CONFIG_SYS_MAXARGS 16 /* max number of command */
120/* Boot Argument Buffer Size */
121#define CONFIG_SYS_BARGSIZE (CONFIG_SYS_CBSIZE)
122
123#define CONFIG_CONS_INDEX 1
124
125/*
126 * For NAND booting the environment is embedded in the U-Boot image. Please take
127 * look at the file board/amcc/canyonlands/u-boot-nand.lds for details.
128 */
129/* #define CONFIG_ENV_IS_IN_NAND */
130#define CONFIG_ENV_IS_NOWHERE
131#define CONFIG_ENV_SIZE 0x2000
132#define CONFIG_ENV_OFFSET 0x0
133/* #define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE) */
134
135/* Time clock 1MHz */
136#define CONFIG_SYS_TIMER_RATE 1000000
137
138/*
139 * By default, ARP timeout is 5 sec.
140 * The first ARP request does not seem to work.
141 * So we need to retry ARP request anyway.
142 * We want to shrink the interval until the second ARP request.
143 */
144#define CONFIG_ARP_TIMEOUT 500UL /* 0.5 msec */
145
146/*
147 * Command line configuration.
148 */
149#include <config_cmd_default.h>
150
151#define CONFIG_CMD_PING
152#define CONFIG_CMD_TIME
153#define CONFIG_CMD_NAND /* NAND flash suppport */
154
155#define CONFIG_SYS_MAX_NAND_DEVICE 1
156#define CONFIG_SYS_NAND_MAX_CHIPS 2
157#define CONFIG_SYS_NAND_ONFI_DETECTION
158
159#define CONFIG_NAND_DENALI_ECC_SIZE 1024
160
161#define CONFIG_SYS_NAND_REGS_BASE 0x68100000
162#define CONFIG_SYS_NAND_DATA_BASE 0x68000000
163
164#define CONFIG_SYS_NAND_BASE (CONFIG_SYS_NAND_DATA_BASE + 0x10)
165
166#define CONFIG_SYS_NAND_USE_FLASH_BBT
167#define CONFIG_SYS_NAND_BAD_BLOCK_POS 0
168
Masahiro Yamada495deb42014-11-07 18:48:34 +0900169/* USB */
170#define CONFIG_CMD_USB
171#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
172#define CONFIG_CMD_FAT
173#define CONFIG_FAT_WRITE
174#define CONFIG_DOS_PARTITION
175
Masahiro Yamada5894ca02014-10-03 19:21:06 +0900176/* memtest works on */
177#define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE
178#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_SDRAM_BASE + 0x01000000)
179
180#define CONFIG_BOOTDELAY 3
181#define CONFIG_ZERO_BOOTDELAY_CHECK /* check for keypress on bootdelay==0 */
182#define CONFIG_AUTOBOOT_KEYED 1
183#define CONFIG_AUTOBOOT_PROMPT \
184 "Press SPACE to abort autoboot in %d seconds\n", bootdelay
185#define CONFIG_AUTOBOOT_DELAY_STR "d"
186#define CONFIG_AUTOBOOT_STOP_STR " "
187
188/*
189 * Network Configuration
190 */
191#define CONFIG_ETHADDR 00:21:83:24:00:00
192#define CONFIG_SERVERIP 192.168.11.1
193#define CONFIG_IPADDR 192.168.11.10
194#define CONFIG_GATEWAYIP 192.168.11.1
195#define CONFIG_NETMASK 255.255.255.0
196
197#define CONFIG_LOADADDR 0x84000000
198#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
199#define CONFIG_BOOTFILE "fit.itb"
200
201#define CONFIG_CMDLINE_EDITING /* add command line history */
202
203#define CONFIG_BOOTCOMMAND "run $bootmode"
204
205#define CONFIG_ROOTPATH "/nfs/root/path"
206#define CONFIG_NFSBOOTCOMMAND \
207 "setenv bootargs $bootargs root=/dev/nfs rw " \
208 "nfsroot=$serverip:$rootpath " \
209 "ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off;" \
210 "tftpboot; bootm;"
211
212#define CONFIG_BOOTARGS " user_debug=0x1f init=/sbin/init"
213
214#define CONFIG_EXTRA_ENV_SETTINGS \
215 "netdev=eth0\0" \
216 "image_offset=0x00080000\0" \
217 "image_size=0x00f00000\0" \
218 "verify=n\0" \
219 "autostart=yes\0" \
220 "norboot=run add_default_bootargs;" \
221 "bootm $image_offset\0" \
222 "nandboot=run add_default_bootargs;" \
223 "nand read $loadaddr $image_offset $image_size;" \
224 "bootm\0" \
225 "add_default_bootargs=setenv bootargs $bootargs" \
226 " console=ttyS0,$baudrate\0" \
227
228/* FIT support */
229#define CONFIG_FIT
230#define CONFIG_FIT_VERBOSE 1 /* enable fit_format_{error,warning}() */
231
232/* Open Firmware flat tree */
233#define CONFIG_OF_LIBFDT
234
235#define CONFIG_HAVE_ARM_SECURE
236
237/* Memory Size & Mapping */
238#define CONFIG_SYS_SDRAM_BASE CONFIG_SDRAM0_BASE
239
240#if CONFIG_SDRAM0_BASE + CONFIG_SDRAM0_SIZE >= CONFIG_SDRAM1_BASE
241/* Thre is no memory hole */
242#define CONFIG_NR_DRAM_BANKS 1
243#define CONFIG_SYS_SDRAM_SIZE (CONFIG_SDRAM0_SIZE + CONFIG_SDRAM1_SIZE)
244#else
245#define CONFIG_NR_DRAM_BANKS 2
246#define CONFIG_SYS_SDRAM_SIZE (CONFIG_SDRAM0_SIZE)
247#endif
248
249#define CONFIG_SYS_TEXT_BASE 0x84000000
250
Masahiro Yamada5894ca02014-10-03 19:21:06 +0900251#define CONFIG_BOARD_POSTCLK_INIT
Masahiro Yamadab67932e2014-11-11 22:18:22 +0900252
253#ifndef CONFIG_SPL_BUILD
Masahiro Yamada5894ca02014-10-03 19:21:06 +0900254#define CONFIG_SKIP_LOWLEVEL_INIT
255#endif
256
257#define CONFIG_SYS_SPL_MALLOC_START (0x0ff00000)
258#define CONFIG_SYS_SPL_MALLOC_SIZE (0x00004000)
259
260#define CONFIG_SYS_INIT_SP_ADDR (0x0ff08000)
261
262#define CONFIG_SPL_FRAMEWORK
263#define CONFIG_SPL_NAND_SUPPORT
264
265#define CONFIG_SPL_LIBCOMMON_SUPPORT /* for mem_malloc_init */
266#define CONFIG_SPL_LIBGENERIC_SUPPORT
267
268#define CONFIG_SPL_BOARD_INIT
269
270#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x10000
271
272#endif /* __CONFIG_UNIPHIER_COMMON_H__ */