From: Andre Przywara Date: Sat, 8 Jun 2019 02:26:57 +0100 Subject: [U-Boot] [PATCH 4/5] sunxi: use FAT environment from boot source In-Reply-To: <20190608012658.5369-1-andre.przywara@arm.com> References: <20190608012658.5369-1-andre.przywara@arm.com> Message-ID: <20190608012658.5369-5-andre.przywara@arm.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 --- 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