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