diff options
author | Eric Bénard <eric@eukrea.com> | 2013-02-19 10:17:24 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-02-21 14:45:43 +0100 |
commit | 2ce56634a58ac9beaba7f951d0177ae2c2131631 (patch) | |
tree | 4da90e8f38de0c22ce3e41ac9605ade4e8e4a22d | |
parent | eec960e3b33845af5f28f75bc0a758a3a083ad90 (diff) | |
download | barebox-2ce56634a58ac9beaba7f951d0177ae2c2131631.tar.gz barebox-2ce56634a58ac9beaba7f951d0177ae2c2131631.tar.xz |
imx23-olinuxino: swith to generic peristent env
Signed-off-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | arch/arm/boards/imx233-olinuxino/imx23-olinuxino.c | 45 |
1 files changed, 3 insertions, 42 deletions
diff --git a/arch/arm/boards/imx233-olinuxino/imx23-olinuxino.c b/arch/arm/boards/imx233-olinuxino/imx23-olinuxino.c index 04826388d4..9620e85f9a 100644 --- a/arch/arm/boards/imx233-olinuxino/imx23-olinuxino.c +++ b/arch/arm/boards/imx233-olinuxino/imx23-olinuxino.c @@ -25,6 +25,7 @@ #include <init.h> #include <gpio.h> #include <environment.h> +#include <envfs.h> #include <errno.h> #include <mci.h> #include <asm/armlinux.h> @@ -111,46 +112,6 @@ static void olinuxino_init_usb(void) add_generic_usb_ehci_device(DEVICE_ID_DYNAMIC, IMX_USB_BASE, NULL); } -/** - * Try to register an environment storage on the attached MCI card - * @return 0 on success - * - * We rely on the existence of a usable SD card, already attached to - * our system, to get something like a persistent memory for our environment. - * If this SD card is also the boot media, we can use the second partition - * for our environment purpose (if present!). - */ -static int register_persistant_environment(void) -{ - struct cdev *cdev; - - /* - * The imx23-olinuxino only has one MCI card socket. - * So, we expect its name as "disk0". - */ - cdev = cdev_by_name("disk0"); - if (cdev == NULL) { - pr_err("No MCI card preset\n"); - return -ENODEV; - } - - - - /* MCI card is present, also a useable partition on it? */ - cdev = cdev_by_name("disk0.1"); - if (cdev == NULL) { - pr_err("No second partition available\n"); - pr_info("Please create at least a second partition with" - " 256 kiB...512 kiB in size (your choice)\n"); - return -ENODEV; - } - - /* use the full partition as our persistent environment storage */ - return devfs_add_partition("disk0.1", 0, cdev->size, - DEVFS_PARTITION_FIXED, "env0"); -} - - static int imx23_olinuxino_devices_init(void) { int i, rc; @@ -174,9 +135,9 @@ static int imx23_olinuxino_devices_init(void) olinuxino_init_usb(); - rc = register_persistant_environment(); + rc = envfs_register_partition("disk0", 1); if (rc != 0) - printf("Cannot create the 'env0' persistant " + printf("Cannot create the 'env0' persistent " "environment storage (%d)\n", rc); return 0; |