[U-Boot] loading u-boot env from flash (eMMC 1) and not eMMC0 on am335x_evm

Hi All,
I had to made a change into this file common/env_mmc.c in order to be able to Load u-boot env from the MMC1 in SPL.
I had to change all occurrence of dev = 0 to dev = 1 inside this file, is it sound right ? Is the code not adapted to have this part configurable ? I have feeling that I am doing something wrong. Our board is a derivation of the am335x EVM SK of TI. One of the changes is the fact we have a FLASH and a SD-Card slot connected (like in the BBB). So we want to save uboot env into a sector of the FLASH and having u-boot loading them at boot time. Things are working for us with the patch below:
<sweiss@ubuntu-obelix dir="u-boot"/>$ grep -n CONFIG_SPL -A2 common/env_mmc.c 78:#ifdef CONFIG_SPL_BUILD 79- dev = 1; 80-#endif -- 113:#ifdef CONFIG_SPL_BUILD 114- dev = 1; 115-#endif -- 197:#ifdef CONFIG_SPL_BUILD 198- dev = 1; 199-#endif -- 225:#ifdef CONFIG_SPL_BUILD 226- dev = 1; 227-#endif -- 308:#ifdef CONFIG_SPL_BUILD 309- dev = 1; 310-#endif
I have added also these lines into include/configs/am335x_evm.h
#define CONFIG_ENV_IS_IN_MMC
#ifdef CONFIG_ENV_IS_IN_MMC #define CONFIG_ENV_IS_IN_MMC #define CONFIG_SPL_ENV_SUPPORT #define CONFIG_SYS_MMC_ENV_DEV 1 #define CONFIG_SYS_MMC_ENV_PART 0 #define CONFIG_ENV_OFFSET (256 << 10) #endif
What I am missing here ?
Thanks
participants (1)
-
Shmuel Weiss