[U-Boot] [PATCH 4/5] sunxi: use FAT environment from boot source

Andre Przywara andre.przywara at arm.com
Sat Jun 8 01:26:57 UTC 2019


Until now we were required to configure the environment FAT partition
and device at compile time, which led to problems if boards have both SD
cards and eMMC and we wanted to use the same image for booting from
both.

Check the boot source and use this device for finding the environment.

Signed-off-by: Andre Przywara <andre.przywara at arm.com>
---
 board/sunxi/board.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index 973dba4578..5802b079b6 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -227,6 +227,15 @@ int mmc_get_env_dev(void)
 	return 1;
 }
 
+static char fat_device[7];
+
+char *fat_get_env_dev_part(void)
+{
+	sprintf(fat_device, "%d:auto", mmc_get_env_dev());
+
+	return fat_device;
+}
+
 #ifdef CONFIG_DM_MMC
 static void mmc_pinmux_setup(int sdc);
 #endif
-- 
2.14.5



More information about the U-Boot mailing list