Commit 0dbc05440c35328098c3596893c8e6bb8c4e8e40
Committed by
Ye Li
1 parent
0ae25a4851
Exists in
smarc-n7.1.2_2.0.0-ga
and in
4 other branches
imx: mx7ulp_evk: enable mmc/regulator support
Enable MMC support. The fsl sdhc driver needs regulator to enable power, so enable regulator support. And bootcmd and more env. Signed-off-by: Peng Fan <peng.fan@nxp.com> Cc: Stefano Babic <sbabic@denx.de>
Showing 3 changed files with 106 additions and 1 deletions Side-by-side Diff
configs/mx7ulp_evk_defconfig
... | ... | @@ -15,4 +15,12 @@ |
15 | 15 | CONFIG_PINCTRL_IMX7ULP=y |
16 | 16 | CONFIG_DM_SERIAL=y |
17 | 17 | CONFIG_FSL_LPUART=y |
18 | +CONFIG_CMD_MMC=y | |
19 | +CONFIG_DM_MMC=y | |
20 | +# CONFIG_DM_MMC_OPS is not set | |
21 | +# CONFIG_BLK is not set | |
22 | +CONFIG_DM_REGULATOR=y | |
23 | +CONFIG_DM_REGULATOR_FIXED=y | |
24 | +CONFIG_DM_REGULATOR_GPIO=y | |
25 | +CONFIG_CMD_GPIO=y |
configs/mx7ulp_evk_plugin_defconfig
... | ... | @@ -16,4 +16,12 @@ |
16 | 16 | CONFIG_PINCTRL_IMX7ULP=y |
17 | 17 | CONFIG_DM_SERIAL=y |
18 | 18 | CONFIG_FSL_LPUART=y |
19 | +CONFIG_CMD_MMC=y | |
20 | +CONFIG_DM_MMC=y | |
21 | +# CONFIG_DM_MMC_OPS is not set | |
22 | +# CONFIG_BLK is not set | |
23 | +CONFIG_DM_REGULATOR=y | |
24 | +CONFIG_DM_REGULATOR_FIXED=y | |
25 | +CONFIG_DM_REGULATOR_GPIO=y | |
26 | +CONFIG_CMD_GPIO=y |
include/configs/mx7ulp_evk.h
... | ... | @@ -28,7 +28,21 @@ |
28 | 28 | #define IRAM_BASE_ADDR OCRAM_0_BASE |
29 | 29 | #define IOMUXC_BASE_ADDR IOMUXC1_RBASE |
30 | 30 | |
31 | -#define CONFIG_ENV_IS_NOWHERE | |
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 | |
32 | 46 | #define CONFIG_ENV_SIZE SZ_8K |
33 | 47 | |
34 | 48 | #define CONFIG_CMD_FAT |
... | ... | @@ -90,6 +104,81 @@ |
90 | 104 | |
91 | 105 | #define CONFIG_CMD_MEMTEST |
92 | 106 | #define CONFIG_SYS_MEMTEST_END 0x9E000000 |
107 | + | |
108 | +#define CONFIG_EXTRA_ENV_SETTINGS \ | |
109 | + "script=boot.scr\0" \ | |
110 | + "image=zImage\0" \ | |
111 | + "console=ttyLP0\0" \ | |
112 | + "fdt_high=0xffffffff\0" \ | |
113 | + "initrd_high=0xffffffff\0" \ | |
114 | + "fdt_file=imx7ulp-evk.dtb\0" \ | |
115 | + "fdt_addr=0x63000000\0" \ | |
116 | + "boot_fdt=try\0" \ | |
117 | + "earlycon=lpuart32,0x402D0010\0" \ | |
118 | + "ip_dyn=yes\0" \ | |
119 | + "mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \ | |
120 | + "mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \ | |
121 | + "mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \ | |
122 | + "mmcautodetect=yes\0" \ | |
123 | + "mmcargs=setenv bootargs console=${console},${baudrate} " \ | |
124 | + "root=${mmcroot}\0" \ | |
125 | + "loadbootscript=" \ | |
126 | + "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ | |
127 | + "bootscript=echo Running bootscript from mmc ...; " \ | |
128 | + "source\0" \ | |
129 | + "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \ | |
130 | + "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \ | |
131 | + "mmcboot=echo Booting from mmc ...; " \ | |
132 | + "run mmcargs; " \ | |
133 | + "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ | |
134 | + "if run loadfdt; then " \ | |
135 | + "bootz ${loadaddr} - ${fdt_addr}; " \ | |
136 | + "else " \ | |
137 | + "if test ${boot_fdt} = try; then " \ | |
138 | + "bootz; " \ | |
139 | + "else " \ | |
140 | + "echo WARN: Cannot load the DT; " \ | |
141 | + "fi; " \ | |
142 | + "fi; " \ | |
143 | + "else " \ | |
144 | + "bootz; " \ | |
145 | + "fi;\0" \ | |
146 | + "netargs=setenv bootargs console=${console},${baudrate} " \ | |
147 | + "root=/dev/nfs " \ | |
148 | + "ip=:::::eth0:dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \ | |
149 | + "netboot=echo Booting from net ...; " \ | |
150 | + "run netargs; " \ | |
151 | + "if test ${ip_dyn} = yes; then " \ | |
152 | + "setenv get_cmd dhcp; " \ | |
153 | + "else " \ | |
154 | + "setenv get_cmd tftp; " \ | |
155 | + "fi; " \ | |
156 | + "usb start; "\ | |
157 | + "${get_cmd} ${image}; " \ | |
158 | + "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ | |
159 | + "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \ | |
160 | + "bootz ${loadaddr} - ${fdt_addr}; " \ | |
161 | + "else " \ | |
162 | + "if test ${boot_fdt} = try; then " \ | |
163 | + "bootz; " \ | |
164 | + "else " \ | |
165 | + "echo WARN: Cannot load the DT; " \ | |
166 | + "fi; " \ | |
167 | + "fi; " \ | |
168 | + "else " \ | |
169 | + "bootz; " \ | |
170 | + "fi;\0" \ | |
171 | + | |
172 | +#define CONFIG_BOOTCOMMAND \ | |
173 | + "mmc dev ${mmcdev}; if mmc rescan; then " \ | |
174 | + "if run loadbootscript; then " \ | |
175 | + "run bootscript; " \ | |
176 | + "else " \ | |
177 | + "if run loadimage; then " \ | |
178 | + "run mmcboot; " \ | |
179 | + "fi; " \ | |
180 | + "fi; " \ | |
181 | + "fi" | |
93 | 182 | |
94 | 183 | #define CONFIG_SYS_HZ 1000 |
95 | 184 | #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR |