xref: /rk3399_rockchip-uboot/include/configs/s32v234evb.h (revision 9702ec00e95dbc1fd66ef8e9624c649e1ee818e5)
1*9702ec00SEddy Petrișor /*
2*9702ec00SEddy Petrișor  * (C) Copyright 2015-2016 Freescale Semiconductor, Inc.
3*9702ec00SEddy Petrișor  *
4*9702ec00SEddy Petrișor  * SPDX-License-Identifier:     GPL-2.0+
5*9702ec00SEddy Petrișor  *
6*9702ec00SEddy Petrișor  * Configuration settings for the Freescale S32V234 EVB board.
7*9702ec00SEddy Petrișor  */
8*9702ec00SEddy Petrișor 
9*9702ec00SEddy Petrișor #ifndef __CONFIG_H
10*9702ec00SEddy Petrișor #define __CONFIG_H
11*9702ec00SEddy Petrișor 
12*9702ec00SEddy Petrișor #ifndef CONFIG_SPL_BUILD
13*9702ec00SEddy Petrișor #include <config_distro_defaults.h>
14*9702ec00SEddy Petrișor #endif
15*9702ec00SEddy Petrișor 
16*9702ec00SEddy Petrișor #include <asm/arch/imx-regs.h>
17*9702ec00SEddy Petrișor 
18*9702ec00SEddy Petrișor #define CONFIG_S32V234
19*9702ec00SEddy Petrișor #define CONFIG_DM
20*9702ec00SEddy Petrișor 
21*9702ec00SEddy Petrișor #define CONFIG_DISPLAY_CPUINFO
22*9702ec00SEddy Petrișor #define CONFIG_DISPLAY_BOARDINFO
23*9702ec00SEddy Petrișor 
24*9702ec00SEddy Petrișor /* Config GIC */
25*9702ec00SEddy Petrișor #define CONFIG_GICV2
26*9702ec00SEddy Petrișor #define GICD_BASE 0x7D001000
27*9702ec00SEddy Petrișor #define GICC_BASE 0x7D002000
28*9702ec00SEddy Petrișor 
29*9702ec00SEddy Petrișor #define CONFIG_REMAKE_ELF
30*9702ec00SEddy Petrișor #undef CONFIG_RUN_FROM_IRAM_ONLY
31*9702ec00SEddy Petrișor 
32*9702ec00SEddy Petrișor #define CONFIG_RUN_FROM_DDR1
33*9702ec00SEddy Petrișor #undef CONFIG_RUN_FROM_DDR0
34*9702ec00SEddy Petrișor 
35*9702ec00SEddy Petrișor /* Run by default from DDR1  */
36*9702ec00SEddy Petrișor #ifdef CONFIG_RUN_FROM_DDR0
37*9702ec00SEddy Petrișor #define DDR_BASE_ADDR		0x80000000
38*9702ec00SEddy Petrișor #else
39*9702ec00SEddy Petrișor #define DDR_BASE_ADDR		0xC0000000
40*9702ec00SEddy Petrișor #endif
41*9702ec00SEddy Petrișor 
42*9702ec00SEddy Petrișor #define CONFIG_MACH_TYPE		4146
43*9702ec00SEddy Petrișor 
44*9702ec00SEddy Petrișor #define CONFIG_SKIP_LOWLEVEL_INIT
45*9702ec00SEddy Petrișor 
46*9702ec00SEddy Petrișor /* Config CACHE */
47*9702ec00SEddy Petrișor #define CONFIG_CMD_CACHE
48*9702ec00SEddy Petrișor 
49*9702ec00SEddy Petrișor #define CONFIG_SYS_FULL_VA
50*9702ec00SEddy Petrișor 
51*9702ec00SEddy Petrișor /* Enable passing of ATAGs */
52*9702ec00SEddy Petrișor #define CONFIG_CMDLINE_TAG
53*9702ec00SEddy Petrișor 
54*9702ec00SEddy Petrișor /* SMP Spin Table Definitions */
55*9702ec00SEddy Petrișor #define CPU_RELEASE_ADDR                (CONFIG_SYS_SDRAM_BASE + 0x7fff0)
56*9702ec00SEddy Petrișor 
57*9702ec00SEddy Petrișor /* Generic Timer Definitions */
58*9702ec00SEddy Petrișor #define COUNTER_FREQUENCY               (1000000000)	/* 1000MHz */
59*9702ec00SEddy Petrișor #define CONFIG_SYS_FSL_ERRATUM_A008585
60*9702ec00SEddy Petrișor 
61*9702ec00SEddy Petrișor /* Size of malloc() pool */
62*9702ec00SEddy Petrișor #ifdef CONFIG_RUN_FROM_IRAM_ONLY
63*9702ec00SEddy Petrișor #define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + 1 * 1024 * 1024)
64*9702ec00SEddy Petrișor #else
65*9702ec00SEddy Petrișor #define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + 2 * 1024 * 1024)
66*9702ec00SEddy Petrișor #endif
67*9702ec00SEddy Petrișor #define CONFIG_BOARD_EARLY_INIT_F
68*9702ec00SEddy Petrișor 
69*9702ec00SEddy Petrișor #define CONFIG_DM_SERIAL
70*9702ec00SEddy Petrișor #define CONFIG_FSL_LINFLEXUART
71*9702ec00SEddy Petrișor #define LINFLEXUART_BASE		LINFLEXD0_BASE_ADDR
72*9702ec00SEddy Petrișor 
73*9702ec00SEddy Petrișor #define CONFIG_DEBUG_UART_LINFLEXUART
74*9702ec00SEddy Petrișor #define CONFIG_DEBUG_UART_BASE		LINFLEXUART_BASE
75*9702ec00SEddy Petrișor 
76*9702ec00SEddy Petrișor /* Allow to overwrite serial and ethaddr */
77*9702ec00SEddy Petrișor #define CONFIG_ENV_OVERWRITE
78*9702ec00SEddy Petrișor #define CONFIG_SYS_UART_PORT		(1)
79*9702ec00SEddy Petrișor #define CONFIG_BAUDRATE				115200
80*9702ec00SEddy Petrișor 
81*9702ec00SEddy Petrișor #undef CONFIG_CMD_IMLS
82*9702ec00SEddy Petrișor 
83*9702ec00SEddy Petrișor #define CONFIG_MMC
84*9702ec00SEddy Petrișor #define CONFIG_FSL_ESDHC
85*9702ec00SEddy Petrișor #define CONFIG_FSL_USDHC
86*9702ec00SEddy Petrișor #define CONFIG_SYS_FSL_ESDHC_ADDR	USDHC_BASE_ADDR
87*9702ec00SEddy Petrișor #define CONFIG_SYS_FSL_ESDHC_NUM	1
88*9702ec00SEddy Petrișor 
89*9702ec00SEddy Petrișor #define CONFIG_SYS_FSL_ERRATUM_ESDHC111
90*9702ec00SEddy Petrișor 
91*9702ec00SEddy Petrișor #define CONFIG_CMD_MMC
92*9702ec00SEddy Petrișor #define CONFIG_GENERIC_MMC
93*9702ec00SEddy Petrișor /* #define CONFIG_CMD_EXT2 EXT2 Support */
94*9702ec00SEddy Petrișor #define CONFIG_CMD_FAT		/* FAT support */
95*9702ec00SEddy Petrișor #define CONFIG_DOS_PARTITION
96*9702ec00SEddy Petrișor 
97*9702ec00SEddy Petrișor #if 0
98*9702ec00SEddy Petrișor 
99*9702ec00SEddy Petrișor /* Ethernet config */
100*9702ec00SEddy Petrișor #define CONFIG_CMD_PING
101*9702ec00SEddy Petrișor #define CONFIG_CMD_DHCP
102*9702ec00SEddy Petrișor #define CONFIG_CMD_MII
103*9702ec00SEddy Petrișor #define CONFIG_FEC_MXC
104*9702ec00SEddy Petrișor #define CONFIG_MII
105*9702ec00SEddy Petrișor #define IMX_FEC_BASE            ENET_BASE_ADDR
106*9702ec00SEddy Petrișor #define CONFIG_FEC_XCV_TYPE     RMII
107*9702ec00SEddy Petrișor #define CONFIG_FEC_MXC_PHYADDR  0
108*9702ec00SEddy Petrișor #define CONFIG_PHYLIB
109*9702ec00SEddy Petrișor #define CONFIG_PHY_MICREL
110*9702ec00SEddy Petrișor #endif
111*9702ec00SEddy Petrișor 
112*9702ec00SEddy Petrișor #if 0				/* Disable until the I2C driver will be updated */
113*9702ec00SEddy Petrișor 
114*9702ec00SEddy Petrișor /* I2C Configs */
115*9702ec00SEddy Petrișor #define CONFIG_CMD_I2C
116*9702ec00SEddy Petrișor #define CONFIG_HARD_I2C
117*9702ec00SEddy Petrișor #define CONFIG_I2C_MXC
118*9702ec00SEddy Petrișor #define CONFIG_SYS_I2C_BASE		I2C0_BASE_ADDR
119*9702ec00SEddy Petrișor #define CONFIG_SYS_I2C_SPEED		100000
120*9702ec00SEddy Petrișor #endif
121*9702ec00SEddy Petrișor 
122*9702ec00SEddy Petrișor #if 0				/* Disable until the FLASH will be implemented */
123*9702ec00SEddy Petrișor #define CONFIG_SYS_USE_NAND
124*9702ec00SEddy Petrișor #endif
125*9702ec00SEddy Petrișor 
126*9702ec00SEddy Petrișor #ifdef CONFIG_SYS_USE_NAND
127*9702ec00SEddy Petrișor /* Nand Flash Configs */
128*9702ec00SEddy Petrișor #define	CONFIG_CMD_NAND
129*9702ec00SEddy Petrișor #define CONFIG_JFFS2_NAND
130*9702ec00SEddy Petrișor #define MTD_NAND_FSL_NFC_SWECC 1
131*9702ec00SEddy Petrișor #define CONFIG_NAND_FSL_NFC
132*9702ec00SEddy Petrișor #define CONFIG_SYS_NAND_BASE		0x400E0000
133*9702ec00SEddy Petrișor #define CONFIG_SYS_MAX_NAND_DEVICE	1
134*9702ec00SEddy Petrișor #define NAND_MAX_CHIPS			CONFIG_SYS_MAX_NAND_DEVICE
135*9702ec00SEddy Petrișor #define CONFIG_SYS_NAND_SELECT_DEVICE
136*9702ec00SEddy Petrișor #define CONFIG_SYS_64BIT_VSPRINTF	/* needed for nand_util.c */
137*9702ec00SEddy Petrișor #endif
138*9702ec00SEddy Petrișor 
139*9702ec00SEddy Petrișor #define CONFIG_CMD_DHCP
140*9702ec00SEddy Petrișor 
141*9702ec00SEddy Petrișor #define CONFIG_LOADADDR			0xC307FFC0
142*9702ec00SEddy Petrișor #define CONFIG_BOOTARGS			"console=ttyLF0 root=/dev/ram rw"
143*9702ec00SEddy Petrișor 
144*9702ec00SEddy Petrișor #define CONFIG_CMD_ENV
145*9702ec00SEddy Petrișor #define CONFIG_EXTRA_ENV_SETTINGS \
146*9702ec00SEddy Petrișor 	"boot_scripts=boot.scr.uimg boot.scr\0" \
147*9702ec00SEddy Petrișor 	"scriptaddr=" __stringify(CONFIG_LOADADDR) "\0" \
148*9702ec00SEddy Petrișor 	"console=ttyLF0,115200\0" \
149*9702ec00SEddy Petrișor 	"fdt_file=s32v234-evb.dtb\0" \
150*9702ec00SEddy Petrișor 	"fdt_high=0xffffffff\0" \
151*9702ec00SEddy Petrișor 	"initrd_high=0xffffffff\0" \
152*9702ec00SEddy Petrișor 	"fdt_addr_r=0xC2000000\0" \
153*9702ec00SEddy Petrișor 	"kernel_addr_r=0xC307FFC0\0" \
154*9702ec00SEddy Petrișor 	"ramdisk_addr_r=0xC4000000\0" \
155*9702ec00SEddy Petrișor 	"ramdisk=rootfs.uimg\0"\
156*9702ec00SEddy Petrișor 	"ip_dyn=yes\0" \
157*9702ec00SEddy Petrișor 	"mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
158*9702ec00SEddy Petrișor 	"update_sd_firmware_filename=u-boot.imx\0" \
159*9702ec00SEddy Petrișor 	"update_sd_firmware=" \
160*9702ec00SEddy Petrișor 		"if test ${ip_dyn} = yes; then " \
161*9702ec00SEddy Petrișor 			"setenv get_cmd dhcp; " \
162*9702ec00SEddy Petrișor 		"else " \
163*9702ec00SEddy Petrișor 			"setenv get_cmd tftp; " \
164*9702ec00SEddy Petrișor 		"fi; " \
165*9702ec00SEddy Petrișor 		"if mmc dev ${mmcdev}; then "	\
166*9702ec00SEddy Petrișor 			"if ${get_cmd} ${update_sd_firmware_filename}; then " \
167*9702ec00SEddy Petrișor 				"setexpr fw_sz ${filesize} / 0x200; " \
168*9702ec00SEddy Petrișor 				"setexpr fw_sz ${fw_sz} + 1; "	\
169*9702ec00SEddy Petrișor 				"mmc write ${loadaddr} 0x2 ${fw_sz}; " \
170*9702ec00SEddy Petrișor 			"fi; "	\
171*9702ec00SEddy Petrișor 		"fi\0" \
172*9702ec00SEddy Petrișor 	"loadramdisk=fatload mmc ${mmcdev}:${mmcpart} ${ramdisk_addr} ${ramdisk}\0" \
173*9702ec00SEddy Petrișor 	"jtagboot=echo Booting using jtag...; " \
174*9702ec00SEddy Petrișor 		"bootm ${kernel_addr} ${ramdisk_addr} ${fdt_addr}\0" \
175*9702ec00SEddy Petrișor 	"jtagsdboot=echo Booting loading Linux with ramdisk from SD...; " \
176*9702ec00SEddy Petrișor 		"run loaduimage; run loadramdisk; run loadfdt;"\
177*9702ec00SEddy Petrișor 		"bootm ${kernel_addr} ${ramdisk_addr} ${fdt_addr}\0" \
178*9702ec00SEddy Petrișor 	"boot_net_usb_start=true\0" \
179*9702ec00SEddy Petrișor 	BOOTENV
180*9702ec00SEddy Petrișor 
181*9702ec00SEddy Petrișor #define BOOT_TARGET_DEVICES(func) \
182*9702ec00SEddy Petrișor 	func(MMC, mmc, 1) \
183*9702ec00SEddy Petrișor 	func(MMC, mmc, 0) \
184*9702ec00SEddy Petrișor 	func(DHCP, dhcp, na)
185*9702ec00SEddy Petrișor 
186*9702ec00SEddy Petrișor #define CONFIG_BOOTCOMMAND \
187*9702ec00SEddy Petrișor 	"run distro_bootcmd"
188*9702ec00SEddy Petrișor 
189*9702ec00SEddy Petrișor #include <config_distro_bootcmd.h>
190*9702ec00SEddy Petrișor 
191*9702ec00SEddy Petrișor /* Miscellaneous configurable options */
192*9702ec00SEddy Petrișor #define CONFIG_SYS_LONGHELP	/* undef to save memory */
193*9702ec00SEddy Petrișor #define CONFIG_SYS_HUSH_PARSER	/* use "hush" command parser */
194*9702ec00SEddy Petrișor #define CONFIG_SYS_PROMPT_HUSH_PS2	"> "
195*9702ec00SEddy Petrișor #define CONFIG_SYS_PROMPT		"=> "
196*9702ec00SEddy Petrișor #undef CONFIG_AUTO_COMPLETE
197*9702ec00SEddy Petrișor #define CONFIG_SYS_CBSIZE		256	/* Console I/O Buffer Size */
198*9702ec00SEddy Petrișor #define CONFIG_SYS_PBSIZE		\
199*9702ec00SEddy Petrișor 			(CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
200*9702ec00SEddy Petrișor #define CONFIG_SYS_MAXARGS		16	/* max number of command args */
201*9702ec00SEddy Petrișor #define CONFIG_SYS_BARGSIZE		CONFIG_SYS_CBSIZE
202*9702ec00SEddy Petrișor #define CONFIG_CMDLINE_EDITING
203*9702ec00SEddy Petrișor 
204*9702ec00SEddy Petrișor #define CONFIG_CMD_MEMTEST
205*9702ec00SEddy Petrișor #define CONFIG_SYS_MEMTEST_START	(DDR_BASE_ADDR)
206*9702ec00SEddy Petrișor #define CONFIG_SYS_MEMTEST_END		(DDR_BASE_ADDR + 0x7C00000)
207*9702ec00SEddy Petrișor 
208*9702ec00SEddy Petrișor #define CONFIG_SYS_LOAD_ADDR		CONFIG_LOADADDR
209*9702ec00SEddy Petrișor #define CONFIG_SYS_HZ				1000
210*9702ec00SEddy Petrișor 
211*9702ec00SEddy Petrișor #define CONFIG_SYS_TEXT_BASE		0x3E800000	/* SDRAM */
212*9702ec00SEddy Petrișor 
213*9702ec00SEddy Petrișor #ifdef CONFIG_RUN_FROM_IRAM_ONLY
214*9702ec00SEddy Petrișor #define CONFIG_SYS_MALLOC_BASE		(DDR_BASE_ADDR)
215*9702ec00SEddy Petrișor #endif
216*9702ec00SEddy Petrișor 
217*9702ec00SEddy Petrișor /*
218*9702ec00SEddy Petrișor  * Stack sizes
219*9702ec00SEddy Petrișor  * The stack sizes are set up in start.S using the settings below
220*9702ec00SEddy Petrișor  */
221*9702ec00SEddy Petrișor #define CONFIG_STACKSIZE		(128 * 1024)	/* regular stack */
222*9702ec00SEddy Petrișor 
223*9702ec00SEddy Petrișor #if 0
224*9702ec00SEddy Petrișor /* Configure PXE */
225*9702ec00SEddy Petrișor #define CONFIG_CMD_PXE
226*9702ec00SEddy Petrișor #define CONFIG_BOOTP_PXE
227*9702ec00SEddy Petrișor #define CONFIG_BOOTP_PXE_CLIENTARCH	0x100
228*9702ec00SEddy Petrișor #endif
229*9702ec00SEddy Petrișor 
230*9702ec00SEddy Petrișor /* Physical memory map */
231*9702ec00SEddy Petrișor /* EVB board has 2x256 MB DDR chips, DDR0 and DDR1, u-boot is using just one */
232*9702ec00SEddy Petrișor #define CONFIG_NR_DRAM_BANKS		1
233*9702ec00SEddy Petrișor #define PHYS_SDRAM			(DDR_BASE_ADDR)
234*9702ec00SEddy Petrișor #define PHYS_SDRAM_SIZE			(256 * 1024 * 1024)
235*9702ec00SEddy Petrișor 
236*9702ec00SEddy Petrișor #define CONFIG_SYS_SDRAM_BASE		PHYS_SDRAM
237*9702ec00SEddy Petrișor #define CONFIG_SYS_INIT_RAM_ADDR	IRAM_BASE_ADDR
238*9702ec00SEddy Petrișor #define CONFIG_SYS_INIT_RAM_SIZE	IRAM_SIZE
239*9702ec00SEddy Petrișor 
240*9702ec00SEddy Petrișor #define CONFIG_SYS_INIT_SP_OFFSET \
241*9702ec00SEddy Petrișor 	(CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
242*9702ec00SEddy Petrișor #define CONFIG_SYS_INIT_SP_ADDR \
243*9702ec00SEddy Petrișor 	(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
244*9702ec00SEddy Petrișor 
245*9702ec00SEddy Petrișor /* FLASH and environment organization */
246*9702ec00SEddy Petrișor #define CONFIG_SYS_NO_FLASH
247*9702ec00SEddy Petrișor 
248*9702ec00SEddy Petrișor #define CONFIG_ENV_SIZE			(8 * 1024)
249*9702ec00SEddy Petrișor #define CONFIG_ENV_IS_IN_MMC
250*9702ec00SEddy Petrișor 
251*9702ec00SEddy Petrișor #define CONFIG_ENV_OFFSET		(12 * 64 * 1024)
252*9702ec00SEddy Petrișor #define CONFIG_SYS_MMC_ENV_DEV		0
253*9702ec00SEddy Petrișor 
254*9702ec00SEddy Petrișor 
255*9702ec00SEddy Petrișor #define CONFIG_BOOTP_BOOTFILESIZE
256*9702ec00SEddy Petrișor #define CONFIG_BOOTP_BOOTPATH
257*9702ec00SEddy Petrișor #define CONFIG_BOOTP_GATEWAY
258*9702ec00SEddy Petrișor #define CONFIG_BOOTP_HOSTNAME
259*9702ec00SEddy Petrișor 
260*9702ec00SEddy Petrișor #endif
261