xref: /rk3399_rockchip-uboot/include/configs/s32v234evb.h (revision e090579d0a2d1aa38eab94b98877de9bcdd4f31d)
19702ec00SEddy Petrișor /*
29702ec00SEddy Petrișor  * (C) Copyright 2015-2016 Freescale Semiconductor, Inc.
39702ec00SEddy Petrișor  *
49702ec00SEddy Petrișor  * SPDX-License-Identifier:     GPL-2.0+
59702ec00SEddy Petrișor  *
69702ec00SEddy Petrișor  * Configuration settings for the Freescale S32V234 EVB board.
79702ec00SEddy Petrișor  */
89702ec00SEddy Petrișor 
99702ec00SEddy Petrișor #ifndef __CONFIG_H
109702ec00SEddy Petrișor #define __CONFIG_H
119702ec00SEddy Petrișor 
129702ec00SEddy Petrișor #ifndef CONFIG_SPL_BUILD
139702ec00SEddy Petrișor #include <config_distro_defaults.h>
149702ec00SEddy Petrișor #endif
159702ec00SEddy Petrișor 
169702ec00SEddy Petrișor #include <asm/arch/imx-regs.h>
179702ec00SEddy Petrișor 
189702ec00SEddy Petrișor #define CONFIG_S32V234
199702ec00SEddy Petrișor #define CONFIG_DM
209702ec00SEddy Petrișor 
219702ec00SEddy Petrișor /* Config GIC */
229702ec00SEddy Petrișor #define CONFIG_GICV2
239702ec00SEddy Petrișor #define GICD_BASE 0x7D001000
249702ec00SEddy Petrișor #define GICC_BASE 0x7D002000
259702ec00SEddy Petrișor 
269702ec00SEddy Petrișor #define CONFIG_REMAKE_ELF
279702ec00SEddy Petrișor #undef CONFIG_RUN_FROM_IRAM_ONLY
289702ec00SEddy Petrișor 
299702ec00SEddy Petrișor #define CONFIG_RUN_FROM_DDR1
309702ec00SEddy Petrișor #undef CONFIG_RUN_FROM_DDR0
319702ec00SEddy Petrișor 
329702ec00SEddy Petrișor /* Run by default from DDR1  */
339702ec00SEddy Petrișor #ifdef CONFIG_RUN_FROM_DDR0
349702ec00SEddy Petrișor #define DDR_BASE_ADDR		0x80000000
359702ec00SEddy Petrișor #else
369702ec00SEddy Petrișor #define DDR_BASE_ADDR		0xC0000000
379702ec00SEddy Petrișor #endif
389702ec00SEddy Petrișor 
399702ec00SEddy Petrișor #define CONFIG_MACH_TYPE		4146
409702ec00SEddy Petrișor 
419702ec00SEddy Petrișor #define CONFIG_SKIP_LOWLEVEL_INIT
429702ec00SEddy Petrișor 
439702ec00SEddy Petrișor /* Config CACHE */
449702ec00SEddy Petrișor #define CONFIG_CMD_CACHE
459702ec00SEddy Petrișor 
469702ec00SEddy Petrișor #define CONFIG_SYS_FULL_VA
479702ec00SEddy Petrișor 
489702ec00SEddy Petrișor /* Enable passing of ATAGs */
499702ec00SEddy Petrișor #define CONFIG_CMDLINE_TAG
509702ec00SEddy Petrișor 
519702ec00SEddy Petrișor /* SMP Spin Table Definitions */
529702ec00SEddy Petrișor #define CPU_RELEASE_ADDR                (CONFIG_SYS_SDRAM_BASE + 0x7fff0)
539702ec00SEddy Petrișor 
549702ec00SEddy Petrișor /* Generic Timer Definitions */
559702ec00SEddy Petrișor #define COUNTER_FREQUENCY               (1000000000)	/* 1000MHz */
569702ec00SEddy Petrișor #define CONFIG_SYS_FSL_ERRATUM_A008585
579702ec00SEddy Petrișor 
589702ec00SEddy Petrișor /* Size of malloc() pool */
599702ec00SEddy Petrișor #ifdef CONFIG_RUN_FROM_IRAM_ONLY
609702ec00SEddy Petrișor #define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + 1 * 1024 * 1024)
619702ec00SEddy Petrișor #else
629702ec00SEddy Petrișor #define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + 2 * 1024 * 1024)
639702ec00SEddy Petrișor #endif
649702ec00SEddy Petrișor 
659702ec00SEddy Petrișor #define CONFIG_DM_SERIAL
669702ec00SEddy Petrișor #define CONFIG_FSL_LINFLEXUART
679702ec00SEddy Petrișor #define LINFLEXUART_BASE		LINFLEXD0_BASE_ADDR
689702ec00SEddy Petrișor 
699702ec00SEddy Petrișor #define CONFIG_DEBUG_UART_LINFLEXUART
709702ec00SEddy Petrișor #define CONFIG_DEBUG_UART_BASE		LINFLEXUART_BASE
719702ec00SEddy Petrișor 
729702ec00SEddy Petrișor /* Allow to overwrite serial and ethaddr */
739702ec00SEddy Petrișor #define CONFIG_ENV_OVERWRITE
749702ec00SEddy Petrișor #define CONFIG_SYS_UART_PORT		(1)
759702ec00SEddy Petrișor 
769702ec00SEddy Petrișor #undef CONFIG_CMD_IMLS
779702ec00SEddy Petrișor 
789702ec00SEddy Petrișor #define CONFIG_FSL_ESDHC
799702ec00SEddy Petrișor #define CONFIG_FSL_USDHC
809702ec00SEddy Petrișor #define CONFIG_SYS_FSL_ESDHC_ADDR	USDHC_BASE_ADDR
819702ec00SEddy Petrișor #define CONFIG_SYS_FSL_ESDHC_NUM	1
829702ec00SEddy Petrișor 
839702ec00SEddy Petrișor #define CONFIG_CMD_MMC
849702ec00SEddy Petrișor /* #define CONFIG_CMD_EXT2 EXT2 Support */
859702ec00SEddy Petrișor 
869702ec00SEddy Petrișor #if 0
879702ec00SEddy Petrișor 
889702ec00SEddy Petrișor /* Ethernet config */
899702ec00SEddy Petrișor #define CONFIG_CMD_PING
909702ec00SEddy Petrișor #define CONFIG_CMD_MII
919702ec00SEddy Petrișor #define CONFIG_FEC_MXC
929702ec00SEddy Petrișor #define CONFIG_MII
939702ec00SEddy Petrișor #define IMX_FEC_BASE            ENET_BASE_ADDR
949702ec00SEddy Petrișor #define CONFIG_FEC_XCV_TYPE     RMII
959702ec00SEddy Petrișor #define CONFIG_FEC_MXC_PHYADDR  0
969702ec00SEddy Petrișor #endif
979702ec00SEddy Petrișor 
989702ec00SEddy Petrișor #if 0				/* Disable until the FLASH will be implemented */
999702ec00SEddy Petrișor #define CONFIG_SYS_USE_NAND
1009702ec00SEddy Petrișor #endif
1019702ec00SEddy Petrișor 
1029702ec00SEddy Petrișor #ifdef CONFIG_SYS_USE_NAND
1039702ec00SEddy Petrișor /* Nand Flash Configs */
1049702ec00SEddy Petrișor #define CONFIG_JFFS2_NAND
1059702ec00SEddy Petrișor #define MTD_NAND_FSL_NFC_SWECC 1
1069702ec00SEddy Petrișor #define CONFIG_NAND_FSL_NFC
1079702ec00SEddy Petrișor #define CONFIG_SYS_NAND_BASE		0x400E0000
1089702ec00SEddy Petrișor #define CONFIG_SYS_MAX_NAND_DEVICE	1
1099702ec00SEddy Petrișor #define NAND_MAX_CHIPS			CONFIG_SYS_MAX_NAND_DEVICE
1109702ec00SEddy Petrișor #define CONFIG_SYS_NAND_SELECT_DEVICE
1119702ec00SEddy Petrișor #define CONFIG_SYS_64BIT_VSPRINTF	/* needed for nand_util.c */
1129702ec00SEddy Petrișor #endif
1139702ec00SEddy Petrișor 
1149702ec00SEddy Petrișor #define CONFIG_LOADADDR			0xC307FFC0
1159702ec00SEddy Petrișor 
1169702ec00SEddy Petrișor #define CONFIG_EXTRA_ENV_SETTINGS \
1179702ec00SEddy Petrișor 	"boot_scripts=boot.scr.uimg boot.scr\0" \
1189702ec00SEddy Petrișor 	"scriptaddr=" __stringify(CONFIG_LOADADDR) "\0" \
1199702ec00SEddy Petrișor 	"console=ttyLF0,115200\0" \
1209702ec00SEddy Petrișor 	"fdt_file=s32v234-evb.dtb\0" \
1219702ec00SEddy Petrișor 	"fdt_high=0xffffffff\0" \
1229702ec00SEddy Petrișor 	"initrd_high=0xffffffff\0" \
1239702ec00SEddy Petrișor 	"fdt_addr_r=0xC2000000\0" \
1249702ec00SEddy Petrișor 	"kernel_addr_r=0xC307FFC0\0" \
1259702ec00SEddy Petrișor 	"ramdisk_addr_r=0xC4000000\0" \
1269702ec00SEddy Petrișor 	"ramdisk=rootfs.uimg\0"\
1279702ec00SEddy Petrișor 	"ip_dyn=yes\0" \
1289702ec00SEddy Petrișor 	"mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
1299702ec00SEddy Petrișor 	"update_sd_firmware_filename=u-boot.imx\0" \
1309702ec00SEddy Petrișor 	"update_sd_firmware=" \
1319702ec00SEddy Petrișor 		"if test ${ip_dyn} = yes; then " \
1329702ec00SEddy Petrișor 			"setenv get_cmd dhcp; " \
1339702ec00SEddy Petrișor 		"else " \
1349702ec00SEddy Petrișor 			"setenv get_cmd tftp; " \
1359702ec00SEddy Petrișor 		"fi; " \
1369702ec00SEddy Petrișor 		"if mmc dev ${mmcdev}; then "	\
1379702ec00SEddy Petrișor 			"if ${get_cmd} ${update_sd_firmware_filename}; then " \
1389702ec00SEddy Petrișor 				"setexpr fw_sz ${filesize} / 0x200; " \
1399702ec00SEddy Petrișor 				"setexpr fw_sz ${fw_sz} + 1; "	\
1409702ec00SEddy Petrișor 				"mmc write ${loadaddr} 0x2 ${fw_sz}; " \
1419702ec00SEddy Petrișor 			"fi; "	\
1429702ec00SEddy Petrișor 		"fi\0" \
1439702ec00SEddy Petrișor 	"loadramdisk=fatload mmc ${mmcdev}:${mmcpart} ${ramdisk_addr} ${ramdisk}\0" \
1449702ec00SEddy Petrișor 	"jtagboot=echo Booting using jtag...; " \
1459702ec00SEddy Petrișor 		"bootm ${kernel_addr} ${ramdisk_addr} ${fdt_addr}\0" \
1469702ec00SEddy Petrișor 	"jtagsdboot=echo Booting loading Linux with ramdisk from SD...; " \
1479702ec00SEddy Petrișor 		"run loaduimage; run loadramdisk; run loadfdt;"\
1489702ec00SEddy Petrișor 		"bootm ${kernel_addr} ${ramdisk_addr} ${fdt_addr}\0" \
1499702ec00SEddy Petrișor 	"boot_net_usb_start=true\0" \
1509702ec00SEddy Petrișor 	BOOTENV
1519702ec00SEddy Petrișor 
1529702ec00SEddy Petrișor #define BOOT_TARGET_DEVICES(func) \
1539702ec00SEddy Petrișor 	func(MMC, mmc, 1) \
1549702ec00SEddy Petrișor 	func(MMC, mmc, 0) \
1559702ec00SEddy Petrișor 	func(DHCP, dhcp, na)
1569702ec00SEddy Petrișor 
1579702ec00SEddy Petrișor #define CONFIG_BOOTCOMMAND \
1589702ec00SEddy Petrișor 	"run distro_bootcmd"
1599702ec00SEddy Petrișor 
1609702ec00SEddy Petrișor #include <config_distro_bootcmd.h>
1619702ec00SEddy Petrișor 
1629702ec00SEddy Petrișor /* Miscellaneous configurable options */
1639702ec00SEddy Petrișor #define CONFIG_SYS_LONGHELP	/* undef to save memory */
1649702ec00SEddy Petrișor #define CONFIG_SYS_PROMPT_HUSH_PS2	"> "
1659702ec00SEddy Petrișor #define CONFIG_SYS_PROMPT		"=> "
1669702ec00SEddy Petrișor #undef CONFIG_AUTO_COMPLETE
1679702ec00SEddy Petrișor #define CONFIG_CMDLINE_EDITING
1689702ec00SEddy Petrișor 
1699702ec00SEddy Petrișor #define CONFIG_CMD_MEMTEST
1709702ec00SEddy Petrișor #define CONFIG_SYS_MEMTEST_START	(DDR_BASE_ADDR)
1719702ec00SEddy Petrișor #define CONFIG_SYS_MEMTEST_END		(DDR_BASE_ADDR + 0x7C00000)
1729702ec00SEddy Petrișor 
1739702ec00SEddy Petrișor #define CONFIG_SYS_LOAD_ADDR		CONFIG_LOADADDR
1749702ec00SEddy Petrișor #define CONFIG_SYS_HZ				1000
1759702ec00SEddy Petrișor 
1769702ec00SEddy Petrișor #define CONFIG_SYS_TEXT_BASE		0x3E800000	/* SDRAM */
1779702ec00SEddy Petrișor 
1789702ec00SEddy Petrișor #ifdef CONFIG_RUN_FROM_IRAM_ONLY
1799702ec00SEddy Petrișor #define CONFIG_SYS_MALLOC_BASE		(DDR_BASE_ADDR)
1809702ec00SEddy Petrișor #endif
1819702ec00SEddy Petrișor 
1829702ec00SEddy Petrișor #if 0
1839702ec00SEddy Petrișor /* Configure PXE */
1849702ec00SEddy Petrișor #define CONFIG_BOOTP_PXE
1859702ec00SEddy Petrișor #define CONFIG_BOOTP_PXE_CLIENTARCH	0x100
1869702ec00SEddy Petrișor #endif
1879702ec00SEddy Petrișor 
1889702ec00SEddy Petrișor /* Physical memory map */
1899702ec00SEddy Petrișor /* EVB board has 2x256 MB DDR chips, DDR0 and DDR1, u-boot is using just one */
1909702ec00SEddy Petrișor #define CONFIG_NR_DRAM_BANKS		1
1919702ec00SEddy Petrișor #define PHYS_SDRAM			(DDR_BASE_ADDR)
1929702ec00SEddy Petrișor #define PHYS_SDRAM_SIZE			(256 * 1024 * 1024)
1939702ec00SEddy Petrișor 
1949702ec00SEddy Petrișor #define CONFIG_SYS_SDRAM_BASE		PHYS_SDRAM
1959702ec00SEddy Petrișor #define CONFIG_SYS_INIT_RAM_ADDR	IRAM_BASE_ADDR
1969702ec00SEddy Petrișor #define CONFIG_SYS_INIT_RAM_SIZE	IRAM_SIZE
1979702ec00SEddy Petrișor 
1989702ec00SEddy Petrișor #define CONFIG_SYS_INIT_SP_OFFSET \
1999702ec00SEddy Petrișor 	(CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
2009702ec00SEddy Petrișor #define CONFIG_SYS_INIT_SP_ADDR \
2019702ec00SEddy Petrișor 	(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
2029702ec00SEddy Petrișor 
203*e856bdcfSMasahiro Yamada /* environment organization */
2049702ec00SEddy Petrișor #define CONFIG_ENV_SIZE			(8 * 1024)
2059702ec00SEddy Petrișor 
2069702ec00SEddy Petrișor #define CONFIG_ENV_OFFSET		(12 * 64 * 1024)
2079702ec00SEddy Petrișor #define CONFIG_SYS_MMC_ENV_DEV		0
2089702ec00SEddy Petrișor 
2099702ec00SEddy Petrișor 
2109702ec00SEddy Petrișor #define CONFIG_BOOTP_BOOTFILESIZE
2119702ec00SEddy Petrișor #define CONFIG_BOOTP_BOOTPATH
2129702ec00SEddy Petrișor #define CONFIG_BOOTP_GATEWAY
2139702ec00SEddy Petrișor #define CONFIG_BOOTP_HOSTNAME
2149702ec00SEddy Petrișor 
2159702ec00SEddy Petrișor #endif
216