summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap/omap_generic.c
diff options
context:
space:
mode:
authorTrent Piepho <tpiepho@kymetacorp.com>2015-11-04 21:10:20 +0000
committerSascha Hauer <s.hauer@pengutronix.de>2015-11-05 09:03:17 +0100
commita341b4d8139df6361a9d2c9d088674d5c119ce4d (patch)
treef69cd6a14f07f3f85ccaae1153b6e350aef4b3dd /arch/arm/mach-omap/omap_generic.c
parente6b5597ac6e8503c908328ddf5a9712f8a764293 (diff)
downloadbarebox-a341b4d8139df6361a9d2c9d088674d5c119ce4d.tar.gz
barebox-a341b4d8139df6361a9d2c9d088674d5c119ce4d.tar.xz
omap socfpga: Switch in flash env loading to use different config
On these systems, the base arch has code to load the in flash environment from a file located in a FAT filesystem. This was controlled by the config option DEFAULT_ENVIRONMENT. However, that option turns on compiling the env into the barebox binary itself, as a backup if the in flash env can't be loaded. Most other boards have in flash env support unconditionally. But omap and socfpga also have xloader configurations, which aren't supposed to have environment support, either in flash or compiled in. If the in flash env code were unconditional, then the xloaders would gain it. So the code depends on ENV_HANDLING, which is only set on those boards that are supposed to have an in flash env and not set on all the boards that aren't supposed to have it. If someone wanted to create a board that did have a saved env, but used an alternate to this generic omap/socfpga file in FAT method, then they'd probably want to create a new config option to control this code and have it not be enabled for their board. Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-omap/omap_generic.c')
-rw-r--r--arch/arm/mach-omap/omap_generic.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/arm/mach-omap/omap_generic.c b/arch/arm/mach-omap/omap_generic.c
index 165487c645..071a1bfced 100644
--- a/arch/arm/mach-omap/omap_generic.c
+++ b/arch/arm/mach-omap/omap_generic.c
@@ -107,7 +107,8 @@ const char *omap_get_bootmmc_devname(void)
return omap_bootmmc_dev;
}
-#if defined(CONFIG_DEFAULT_ENVIRONMENT)
+#if defined(CONFIG_ENV_HANDLING)
+#define ENV_PATH "/boot/barebox.env"
static int omap_env_init(void)
{
struct stat s;
@@ -132,18 +133,19 @@ static int omap_env_init(void)
free(partname);
if (ret) {
- printf("no %s. using default env\n", diskdev);
+ pr_err("Failed to load environment: no device '%s'\n", diskdev);
return 0;
}
mkdir("/boot", 0666);
ret = mount(diskdev, "fat", "/boot", NULL);
if (ret) {
- printf("failed to mount %s\n", diskdev);
+ pr_err("Failed to load environment: mount %s failed (%d)\n", diskdev, ret);
return 0;
}
- default_environment_path_set("/boot/barebox.env");
+ pr_debug("Loading default env from %s on device %s\n", ENV_PATH, diskdev);
+ default_environment_path_set(ENV_PATH);
return 0;
}