xref: /openbmc/u-boot/include/configs/mx7ulp_evk.h (revision b9553986)
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright (C) 2016 Freescale Semiconductor, Inc.
4  *
5  * Configuration settings for the Freescale i.MX7ULP EVK board.
6  */
7 
8 #ifndef __MX7ULP_EVK_CONFIG_H
9 #define __MX7ULP_EVK_CONFIG_H
10 
11 #include <linux/sizes.h>
12 #include <asm/arch/imx-regs.h>
13 
14 /*Uncomment it to use secure boot*/
15 /*#define CONFIG_SECURE_BOOT*/
16 
17 #ifdef CONFIG_SECURE_BOOT
18 #ifndef CONFIG_CSF_SIZE
19 #define CONFIG_CSF_SIZE			0x4000
20 #endif
21 #endif
22 
23 #define CONFIG_BOARD_POSTCLK_INIT
24 #define CONFIG_SYS_BOOTM_LEN		0x1000000
25 
26 #define SRC_BASE_ADDR			CMC1_RBASE
27 #define IRAM_BASE_ADDR			OCRAM_0_BASE
28 #define IOMUXC_BASE_ADDR		IOMUXC1_RBASE
29 
30 #define CONFIG_FSL_USDHC
31 #define CONFIG_SUPPORT_EMMC_BOOT /* eMMC specific */
32 
33 #define CONFIG_SYS_FSL_USDHC_NUM        1
34 
35 #define CONFIG_SYS_FSL_ESDHC_ADDR       0
36 #define CONFIG_SYS_MMC_ENV_DEV          0	/* USDHC1 */
37 #define CONFIG_SYS_MMC_ENV_PART         0	/* user area */
38 #define CONFIG_MMCROOT                  "/dev/mmcblk0p2"  /* USDHC1 */
39 #define CONFIG_SYS_MMC_IMG_LOAD_PART    1
40 
41 #define CONFIG_ENV_OFFSET		(12 * SZ_64K)
42 #define CONFIG_ENV_SIZE			SZ_8K
43 
44 /* Using ULP WDOG for reset */
45 #define WDOG_BASE_ADDR			WDG1_RBASE
46 
47 #define CONFIG_SYS_HZ_CLOCK		1000000 /* Fixed at 1Mhz from TSTMR */
48 
49 #define CONFIG_INITRD_TAG
50 #define CONFIG_CMDLINE_TAG
51 #define CONFIG_SETUP_MEMORY_TAGS
52 /*#define CONFIG_REVISION_TAG*/
53 
54 /* Size of malloc() pool */
55 #define CONFIG_SYS_MALLOC_LEN		(8 * SZ_1M)
56 
57 #define CONFIG_BOARD_EARLY_INIT_F
58 
59 /* UART */
60 #define LPUART_BASE			LPUART4_RBASE
61 
62 /* allow to overwrite serial and ethaddr */
63 #define CONFIG_ENV_OVERWRITE
64 #define CONFIG_BAUDRATE			115200
65 
66 #define CONFIG_SYS_CACHELINE_SIZE      64
67 
68 /* Miscellaneous configurable options */
69 #define CONFIG_SYS_PROMPT		"=> "
70 #define CONFIG_SYS_CBSIZE		512
71 
72 #define CONFIG_SYS_MAXARGS		256
73 
74 /* Physical Memory Map */
75 
76 #define PHYS_SDRAM			0x60000000
77 #define PHYS_SDRAM_SIZE			SZ_1G
78 #define CONFIG_SYS_MEMTEST_START	PHYS_SDRAM
79 #define CONFIG_SYS_SDRAM_BASE		PHYS_SDRAM
80 
81 #define CONFIG_LOADADDR             0x60800000
82 
83 #define CONFIG_SYS_MEMTEST_END      0x9E000000
84 
85 #define CONFIG_EXTRA_ENV_SETTINGS \
86 	"script=boot.scr\0" \
87 	"image=zImage\0" \
88 	"console=ttyLP0\0" \
89 	"fdt_high=0xffffffff\0" \
90 	"initrd_high=0xffffffff\0" \
91 	"fdt_file=imx7ulp-evk.dtb\0" \
92 	"fdt_addr=0x63000000\0" \
93 	"boot_fdt=try\0" \
94 	"earlycon=lpuart32,0x402D0010\0" \
95 	"ip_dyn=yes\0" \
96 	"mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \
97 	"mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \
98 	"mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
99 	"mmcautodetect=yes\0" \
100 	"mmcargs=setenv bootargs console=${console},${baudrate} " \
101 		"root=${mmcroot}\0" \
102 	"loadbootscript=" \
103 		"fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
104 	"bootscript=echo Running bootscript from mmc ...; " \
105 		"source\0" \
106 	"loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
107 	"loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
108 	"mmcboot=echo Booting from mmc ...; " \
109 		"run mmcargs; " \
110 		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
111 			"if run loadfdt; then " \
112 				"bootz ${loadaddr} - ${fdt_addr}; " \
113 			"else " \
114 				"if test ${boot_fdt} = try; then " \
115 					"bootz; " \
116 				"else " \
117 					"echo WARN: Cannot load the DT; " \
118 				"fi; " \
119 			"fi; " \
120 		"else " \
121 			"bootz; " \
122 		"fi;\0" \
123 	"netargs=setenv bootargs console=${console},${baudrate} " \
124 		"root=/dev/nfs " \
125 		"ip=:::::eth0:dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
126 	"netboot=echo Booting from net ...; " \
127 		"run netargs; " \
128 		"if test ${ip_dyn} = yes; then " \
129 			"setenv get_cmd dhcp; " \
130 		"else " \
131 			"setenv get_cmd tftp; " \
132 		"fi; " \
133 		"usb start; "\
134 		"${get_cmd} ${image}; " \
135 		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
136 			"if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
137 				"bootz ${loadaddr} - ${fdt_addr}; " \
138 			"else " \
139 				"if test ${boot_fdt} = try; then " \
140 					"bootz; " \
141 				"else " \
142 					"echo WARN: Cannot load the DT; " \
143 				"fi; " \
144 			"fi; " \
145 		"else " \
146 			"bootz; " \
147 		"fi;\0" \
148 
149 #define CONFIG_BOOTCOMMAND \
150 	   "mmc dev ${mmcdev}; if mmc rescan; then " \
151 		   "if run loadbootscript; then " \
152 			   "run bootscript; " \
153 		   "else " \
154 			   "if run loadimage; then " \
155 				   "run mmcboot; " \
156 			   "fi; " \
157 		   "fi; " \
158 	   "fi"
159 
160 #define CONFIG_SYS_HZ			1000
161 #define CONFIG_SYS_LOAD_ADDR		CONFIG_LOADADDR
162 
163 #define CONFIG_SYS_INIT_RAM_ADDR	IRAM_BASE_ADDR
164 #define CONFIG_SYS_INIT_RAM_SIZE	SZ_256K
165 
166 #define CONFIG_SYS_INIT_SP_OFFSET \
167 	(CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
168 #define CONFIG_SYS_INIT_SP_ADDR \
169 	(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
170 
171 #ifndef CONFIG_SYS_DCACHE_OFF
172 #define CONFIG_CMD_CACHE
173 #endif
174 
175 #endif	/* __CONFIG_H */
176