2 * Copyright (C) 2012 Altera Corporation <www.altera.com>
4 * SPDX-License-Identifier: GPL-2.0+
9 #include <asm/arch/socfpga_base_addrs.h>
10 #include "../../board/altera/socfpga/pinmux_config.h"
11 #include "../../board/altera/socfpga/iocsr_config.h"
12 #include "../../board/altera/socfpga/pll_config.h"
15 * High level configuration
17 /* Virtual target or real hardware */
18 #undef CONFIG_SOCFPGA_VIRTUAL_TARGET
23 #define CONFIG_MISC_INIT_R
24 #define CONFIG_SINGLE_BOOTLOADER
25 #define CONFIG_SOCFPGA
28 #define CONFIG_SYS_ARM_CACHE_WRITEALLOC
29 #define CONFIG_SYS_CACHELINE_SIZE 32
30 #define CONFIG_SYS_L2_PL310
31 #define CONFIG_SYS_PL310_BASE SOCFPGA_MPUL2_ADDRESS
33 /* base address for .text section */
34 #ifdef CONFIG_SOCFPGA_VIRTUAL_TARGET
35 #define CONFIG_SYS_TEXT_BASE 0x08000040
37 #define CONFIG_SYS_TEXT_BASE 0x01000040
39 #define CONFIG_SYS_LOAD_ADDR 0x7fc0
41 /* Console I/O Buffer Size */
42 #define CONFIG_SYS_CBSIZE 256
43 /* Monitor Command Prompt */
44 #define CONFIG_SYS_PROMPT "SOCFPGA_CYCLONE5 # "
45 #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \
46 sizeof(CONFIG_SYS_PROMPT) + 16)
49 * Display CPU and Board Info
51 #define CONFIG_DISPLAY_CPUINFO
52 #define CONFIG_DISPLAY_BOARDINFO
55 * Enable early stage initialization at C environment
57 #define CONFIG_BOARD_EARLY_INIT_F
59 /* flat device tree */
60 #define CONFIG_OF_LIBFDT
61 /* skip updating the FDT blob */
62 #define CONFIG_FDT_BLOB_SKIP_UPDATE
63 /* Initial Memory map size for Linux, minus 4k alignment for DFT blob */
64 #define CONFIG_SYS_BOOTMAPSZ ((256*1024*1024) - (4*1024))
66 #define CONFIG_SPL_RAM_DEVICE
67 #define CONFIG_SPL_STACK CONFIG_SYS_INIT_SP_ADDR
68 #define CONFIG_SYS_SPL_MALLOC_START ((unsigned long) (&__malloc_start))
69 #define CONFIG_SYS_SPL_MALLOC_SIZE (&__malloc_end - &__malloc_start)
72 * Memory allocation (MALLOC)
74 /* Room required on the stack for the environment data */
75 #define CONFIG_ENV_SIZE 1024
76 /* Size of DRAM reserved for malloc() use */
77 #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 128*1024)
79 /* SP location before relocation, must use scratch RAM */
80 #define CONFIG_SYS_INIT_RAM_ADDR 0xFFFF0000
81 /* Reserving 0x100 space at back of scratch RAM for debug info */
82 #define CONFIG_SYS_INIT_RAM_SIZE (0x10000 - 0x100)
83 /* Stack pointer prior relocation, must situated at on-chip RAM */
84 #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \
85 CONFIG_SYS_INIT_RAM_SIZE - \
86 GENERATED_GBL_DATA_SIZE)
90 * Command line configuration.
92 #define CONFIG_SYS_NO_FLASH
93 #include <config_cmd_default.h>
94 /* FAT file system support */
95 #define CONFIG_CMD_FAT
101 #define CONFIG_DOS_PARTITION 1
103 #ifdef CONFIG_SPL_BUILD
104 #undef CONFIG_PARTITIONS
111 /* Delay before automatically booting the default image */
112 #define CONFIG_BOOTDELAY 3
113 /* Enable auto completion of commands using TAB */
114 #define CONFIG_AUTO_COMPLETE
115 /* use "hush" command parser */
116 #define CONFIG_SYS_HUSH_PARSER
117 #define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
118 #define CONFIG_CMD_RUN
120 #define CONFIG_BOOTCOMMAND "run ramboot"
123 * arguments passed to the bootm command. The value of
124 * CONFIG_BOOTARGS goes into the environment value "bootargs".
125 * Do note the value will overide also the chosen node in FDT blob.
127 #define CONFIG_BOOTARGS "console=ttyS0,57600,mem=256M@0x0"
129 #define CONFIG_EXTRA_ENV_SETTINGS \
131 "loadaddr= " __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
132 "ramboot=setenv bootargs " CONFIG_BOOTARGS ";" \
133 "bootm ${loadaddr} - ${fdt_addr}\0" \
134 "bootimage=uImage\0" \
136 "fsloadcmd=ext2load\0" \
137 "bootm ${loadaddr} - ${fdt_addr}\0" \
138 "qspiroot=/dev/mtdblock0\0" \
139 "qspirootfstype=jffs2\0" \
140 "qspiboot=setenv bootargs " CONFIG_BOOTARGS \
141 " root=${qspiroot} rw rootfstype=${qspirootfstype};"\
142 "bootm ${loadaddr} - ${fdt_addr}\0"
144 /* using environment setting for stdin, stdout, stderr */
145 #define CONFIG_SYS_CONSOLE_IS_IN_ENV
146 /* Enable the call to overwrite_console() */
147 #define CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE
148 /* Enable overwrite of previous console environment settings */
149 #define CONFIG_SYS_CONSOLE_ENV_OVERWRITE
151 /* max number of command args */
152 #define CONFIG_SYS_MAXARGS 16
162 /* We have 1 bank of DRAM */
163 #define CONFIG_NR_DRAM_BANKS 1
165 #define CONFIG_SYS_SDRAM_BASE 0x00000000
166 /* SDRAM memory size */
167 #define PHYS_SDRAM_1_SIZE 0x40000000
169 #define PHYS_SDRAM_1 CONFIG_SYS_SDRAM_BASE
170 #define CONFIG_SYS_MEMTEST_START 0x00000000
171 #define CONFIG_SYS_MEMTEST_END PHYS_SDRAM_1_SIZE
174 * NS16550 Configuration
176 #define UART0_BASE SOCFPGA_UART0_ADDRESS
177 #define CONFIG_SYS_NS16550
178 #define CONFIG_SYS_NS16550_SERIAL
179 #define CONFIG_SYS_NS16550_REG_SIZE -4
180 #define CONFIG_SYS_NS16550_CLK V_NS16550_CLK
181 #define CONFIG_CONS_INDEX 1
182 #define CONFIG_SYS_NS16550_COM1 UART0_BASE
183 #define CONFIG_SYS_BAUDRATE_TABLE {4800, 9600, 19200, 38400, 57600, 115200}
184 #ifdef CONFIG_SOCFPGA_VIRTUAL_TARGET
185 #define V_NS16550_CLK 1000000
187 #define V_NS16550_CLK 100000000
189 #define CONFIG_BAUDRATE 115200
194 #define CONFIG_SYS_NO_FLASH
199 /* This timer use eosc1 where the clock frequency is fixed
200 * throughout any condition */
201 #define CONFIG_SYS_TIMERBASE SOCFPGA_OSC1TIMER0_ADDRESS
203 #ifdef CONFIG_SOCFPGA_VIRTUAL_TARGET
204 #define CONFIG_SYS_TIMER_RATE 2400000
206 #define CONFIG_SYS_TIMER_RATE 25000000
208 #define CONFIG_SYS_TIMER_COUNTS_DOWN
209 #define CONFIG_SYS_TIMER_COUNTER (CONFIG_SYS_TIMERBASE + 0x4)
211 #define CONFIG_ENV_IS_NOWHERE
216 #ifndef CONFIG_SOCFPGA_VIRTUAL_TARGET
217 #define CONFIG_DESIGNWARE_ETH 1
220 #ifdef CONFIG_DESIGNWARE_ETH
221 #define CONFIG_EMAC0_BASE SOCFPGA_EMAC0_ADDRESS
222 #define CONFIG_EMAC1_BASE SOCFPGA_EMAC1_ADDRESS
223 /* console support for network */
224 #define CONFIG_CMD_DHCP
225 #define CONFIG_CMD_MII
226 #define CONFIG_CMD_NET
227 #define CONFIG_CMD_PING
229 #define CONFIG_NET_MULTI
230 #define CONFIG_DW_ALTDESCRIPTOR
232 #define CONFIG_PHY_GIGE
233 #define CONFIG_DW_AUTONEG
234 #define CONFIG_AUTONEG_TIMEOUT (15 * CONFIG_SYS_HZ)
235 #define CONFIG_PHYLIB
236 #define CONFIG_PHY_MICREL
237 #define CONFIG_PHY_MICREL_KSZ9021
238 /* EMAC controller and PHY used */
239 #define CONFIG_EMAC_BASE CONFIG_EMAC1_BASE
240 #define CONFIG_EPHY_PHY_ADDR CONFIG_EPHY1_PHY_ADDR
241 #define CONFIG_PHY_INTERFACE_MODE PHY_INTERFACE_MODE_RGMII
242 #endif /* CONFIG_DESIGNWARE_ETH */
247 #define CONFIG_HW_WATCHDOG
248 #define CONFIG_HW_WATCHDOG_TIMEOUT_MS 2000
249 #define CONFIG_DESIGNWARE_WATCHDOG
250 #define CONFIG_DW_WDT_BASE SOCFPGA_L4WD0_ADDRESS
251 /* Clocks source frequency to watchdog timer */
252 #define CONFIG_DW_WDT_CLOCK_KHZ 25000
256 * SPL "Second Program Loader" aka Initial Software
259 /* Enable building of SPL globally */
260 #define CONFIG_SPL_FRAMEWORK
262 /* TEXT_BASE for linking the SPL binary */
263 #define CONFIG_SPL_TEXT_BASE 0xFFFF0000
265 /* Stack size for SPL */
266 #define CONFIG_SPL_STACK_SIZE (4 * 1024)
268 /* MALLOC size for SPL */
269 #define CONFIG_SPL_MALLOC_SIZE (5 * 1024)
271 #define CONFIG_SPL_SERIAL_SUPPORT
272 #define CONFIG_SPL_BOARD_INIT
274 #define CHUNKSZ_CRC32 (1 * 1024)
276 #define CONFIG_CRC32_VERIFY
278 /* Linker script for SPL */
279 #define CONFIG_SPL_LDSCRIPT "arch/arm/cpu/armv7/socfpga/u-boot-spl.lds"
281 /* Support for common/libcommon.o in SPL binary */
282 #define CONFIG_SPL_LIBCOMMON_SUPPORT
283 /* Support for lib/libgeneric.o in SPL binary */
284 #define CONFIG_SPL_LIBGENERIC_SUPPORT
286 /* Support for watchdog */
287 #define CONFIG_SPL_WATCHDOG_SUPPORT
289 #endif /* __CONFIG_H */