ARM: rpi_b: load /uEnv.txt from MMC at startup
authorStephen Warren <swarren@wwwdotorg.org>
Thu, 6 Feb 2014 03:49:22 +0000 (20:49 -0700)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Fri, 21 Feb 2014 14:30:18 +0000 (15:30 +0100)
The Pi has no flash to store an environment in the usual fashion. However,
the user may wish to customize the environment. We know that the SD card
must be present, since that's where the boot ROM has loaded U-Boot from.
So, load uEnv.txt from there early during boot. This allows the user to
e.g. customize boot_targets, in order to automatically select network
boot.

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
include/configs/rpi_b.h

index 202c9c309fc5151839da8fdab6ea4b0158d72aca..4b5a0c2150fb10dce6708cfe6a62c104c01a6fa0 100644 (file)
 #define CONFIG_SYS_LOAD_ADDR           0x1000000
 #define CONFIG_CONSOLE_MUX
 #define CONFIG_SYS_CONSOLE_IS_IN_ENV
+#define CONFIG_PREBOOT \
+       "if load mmc 0:1 ${loadaddr} /uEnv.txt; then " \
+               "env import -t ${loadaddr} ${filesize}; " \
+       "fi"
+
 /*
  * Memory layout for where various images get loaded by boot scripts:
  *