mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* Re: [PATCH 1/2] firmware: altera-serial: Make the driver match the dt binding documentation
From: Sascha Hauer @ 2016-09-27  6:10 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: barebox
In-Reply-To: <20160926093729.txxe5hjd2i6a7fiv@pengutronix.de>

On Mon, Sep 26, 2016 at 11:37:29AM +0200, Uwe Kleine-König wrote:
> Hello Sascha
> 
> I just noticed there is an additional change needed:
> 
> diff --git a/drivers/firmware/altera_serial.c b/drivers/firmware/altera_serial.c
> index ddee991ed073..b119778d720d 100644
> --- a/drivers/firmware/altera_serial.c
> +++ b/drivers/firmware/altera_serial.c
> @@ -328,7 +328,7 @@ out:
>  
>  static struct of_device_id altera_spi_id_table[] = {
>  	{
> -		.compatible = "altr,passive-serial",
> +		.compatible = "altr,fpga-passive-serial",
>  	},
>  };
>  
> Should I resend, or can you fixup yourself?

Fixed while applying

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply

* Re: [PATCH 0/2 (try 2)] mtd: ubi: implement the new command 'ubirename'
From: Sascha Hauer @ 2016-09-27  6:21 UTC (permalink / raw)
  To: Giorgio Dal Molin; +Cc: barebox
In-Reply-To: <20160926105233.26387-1-iw3gtf@arcor.de>

On Mon, Sep 26, 2016 at 12:52:31PM +0200, Giorgio Dal Molin wrote:
> Here a new set of patches implementing the command 'ubirename'.
> 
> They are based on a patch serie from Sascha that restructures a bit
> the barebox UBI APIs. In particular it is now easier to find the ubi
> volume ids from the command code. Moreover the command code uses now
> api functions to do the rename.
> 
> This new set also fixes some minor cosmetic details noted by Sascha and
> a real problem found in the function 'get_vol_id()': it was missing
> a call to 'ubi_close_volume(desc)' hence leaving ubi volumes busy.
> A simple test that showed the problem was:
> 
> bb> ubimkvol /dev/nand0.ubi_volumes.ubi vol_A 10MiB
> bb> ubirename /dev/nand0.ubi_volumes.ubi vol_A vol_B
> bb> ubirmvol /dev/nand0.ubi_volumes.ubi vol_B
> 
> The last command, ubirmvol, failed because 'vol_B' appeared to be still
> busy after the rename (vol->readers==1).
> 	
> Giorgio Dal Molin (2):
>   mtd: ubi: add API call to rename volumes.
>   mtd: ubi: commands: added the new command 'ubirename'.

Applied, thanks

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply

* Re: [PATCH] blspec: fix erroneus free in entry_is_of_compatible()
From: Sascha Hauer @ 2016-09-27  6:22 UTC (permalink / raw)
  To: Ulrich Ölmann; +Cc: Barebox List
In-Reply-To: <20160927054524.26545-1-u.oelmann@pengutronix.de>

On Tue, Sep 27, 2016 at 07:45:24AM +0200, Ulrich Ölmann wrote:
> Whenever of_unflatten_dtb() encountered an error it already released the memory
> before returning the error code. Make this apparent by setting the pointer to
> NULL to avoid an erroneus free.
> 
> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
> ---
>  common/blspec.c | 1 +
>  1 file changed, 1 insertion(+)

Applied, thanks

Sascha

> 
> diff --git a/common/blspec.c b/common/blspec.c
> index 66decb161ebd..c205d481c911 100644
> --- a/common/blspec.c
> +++ b/common/blspec.c
> @@ -399,6 +399,7 @@ static bool entry_is_of_compatible(struct blspec_entry *entry)
>  	root = of_unflatten_dtb(fdt);
>  	if (IS_ERR(root)) {
>  		ret = PTR_ERR(root);
> +		root = NULL;
>  		goto out;
>  	}
>  
> -- 
> 2.9.3
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply

* Re: Re: [PATCH 2/2] commands: ubi: added the new command 'ubirename' to rename ubi volumes.
From: Sascha Hauer @ 2016-09-27  6:23 UTC (permalink / raw)
  To: iw3gtf; +Cc: barebox
In-Reply-To: <405969938.1037814.1474625516057.JavaMail.ngmail@webmail12.arcor-online.net>

On Fri, Sep 23, 2016 at 12:11:56PM +0200, iw3gtf@arcor.de wrote:
> Hi,
> 
> 
> ----- Original Nachricht ----
> Von:     Sascha Hauer <s.hauer@pengutronix.de>
> An:      Giorgio Dal Molin <iw3gtf@arcor.de>
> Datum:   22.09.2016 10:04
> Betreff: Re: [PATCH 2/2] commands: ubi: added the new command 'ubirename' to
>  rename ubi volumes.
> 
> > On Wed, Sep 21, 2016 at 10:04:43AM +0200, Giorgio Dal Molin wrote:
> > > From: Giorgio Dal Molin <giorgio.dal.molin@mobotix.com>
> > > 
> > > The syntax was taken from the corresponding command of the 'mts-utils'
> > > userland package:
> > > 
> > > # ubirename UBIDEV OLD_NAME NEW_NAME [OLD_NAME NEW_NAME ...]
> > > 
> > > Signed-off-by: Giorgio Dal Molin <iw3gtf@arcor.de>
> > > ---
> > >  commands/ubi.c | 87
> > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> > >  1 file changed, 87 insertions(+)
> > > 
> > > diff --git a/commands/ubi.c b/commands/ubi.c
> > > index 26b521f..3479340 100644
> > > --- a/commands/ubi.c
> > > +++ b/commands/ubi.c
> > > @@ -6,6 +6,8 @@
> > >  #include <errno.h>
> > >  #include <getopt.h>
> > >  #include <linux/mtd/mtd.h>
> > > +#include <linux/mtd/ubi.h>
> > > +#include <libgen.h>
> > >  #include <linux/kernel.h>
> > >  #include <linux/stat.h>
> > >  #include <linux/mtd/mtd-abi.h>
> > > @@ -306,3 +308,88 @@ BAREBOX_CMD_START(ubirmvol)
> > >  	BAREBOX_CMD_GROUP(CMD_GRP_PART)
> > >  	BAREBOX_CMD_HELP(cmd_ubirmvol_help)
> > >  BAREBOX_CMD_END
> > > +
> > > +
> > > +static int get_vol_id(const char *vol_name)
> > > +{
> > > +	struct ubi_volume_desc *desc;
> > > +	struct cdev *vol_cdev;
> > > +	struct ubi_volume_info vi;
> > > +
> > > +	vol_cdev = cdev_by_name(vol_name);
> > > +	if(!vol_cdev) {
> > > +		perror("cdev_by_name");
> > > +		return -1;
> > > +	}
> > > +	desc = ubi_open_volume_cdev(vol_cdev, UBI_READONLY);
> > > +	if(IS_ERR(desc)) {
> > > +		perror("ubi_open_volume_cdev");
> > > +		return -1;
> > > +	}
> > > +	ubi_get_volume_info(desc, &vi);
> > > +	ubi_close_volume(desc);
> > > +
> > > +	return vi.vol_id;
> > > +};
> > 
> > This get_vol_id() is not particularly nice. Also I do not like having
> > the rename operation inside the ioctl parser as this means we cannot
> > make the ubirename code optional for users that do not need renaming.
> > 
> > I just sent out a series which should help you in this regard. Can you
> > base your code ontop of this?
> 
> I've noticed a problem in the 3rd patch ([PATCH 3/4] mtd: ubi: commands: use function API to access ubi volumes)
> of your last UBI serie: in the resulting code in 'commands/ubi.c', function 'do_ubirmvol()':
> 
> ...
> 	desc = ubi_open_volume_nm(ubinum, argv[2], UBI_EXCLUSIVE);
> 	if (IS_ERR(desc)) {
> 		ret = PTR_ERR(desc);
> 		printf("failed to open volume %s: %s\n", argv[2], strerror(-ret));
> 		goto err1;
> 	}
> 
> 	ret = ubi_api_remove_volume(desc, 0);
> 	if (ret)
> 		printf("failed to remove volume %s: %s\n", argv[2], strerror(-ret));
> 
> err1:
> 	ubi_close_volume(desc);
> err:
> 	close(fd);
> 
> 	return ret ? 1 : 0;
> }
> 
> You have a wrong 'goto err1': in that case the 'desc' pointer is not a memory address, it
> represent a negative error code and you cannot use it in ubi_close_volume(desc) (it segfaults).

Fixed that. Thanks for noting.

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply

* [PATCH] blspec: fix return value of entry_is_of_compatible()
From: Ulrich Ölmann @ 2016-09-27  7:30 UTC (permalink / raw)
  To: Barebox List

The function returns a boolean and not an integer. Hence the former
explicit/implicit cast of an ERR_PTR to a boolean has led to a return value of
true although a bootspec entry with a faulty devicetree is not compatible.

Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
---
 common/blspec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/blspec.c b/common/blspec.c
index c205d481c911..40d4546d2880 100644
--- a/common/blspec.c
+++ b/common/blspec.c
@@ -398,7 +398,7 @@ static bool entry_is_of_compatible(struct blspec_entry *entry)
 
 	root = of_unflatten_dtb(fdt);
 	if (IS_ERR(root)) {
-		ret = PTR_ERR(root);
+		ret = false;
 		root = NULL;
 		goto out;
 	}
-- 
2.9.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply related

* [PATCH] blspec: fix typo
From: Ulrich Ölmann @ 2016-09-27  7:33 UTC (permalink / raw)
  To: Barebox List

Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
---
 common/blspec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/blspec.c b/common/blspec.c
index 40d4546d2880..1846fa277076 100644
--- a/common/blspec.c
+++ b/common/blspec.c
@@ -348,7 +348,7 @@ out:
  * entry_is_of_compatible - check if a bootspec entry is compatible with
  *                          the current machine.
  *
- * returns true is the entry is compatible, false otherwise
+ * returns true if the entry is compatible, false otherwise
  */
 static bool entry_is_of_compatible(struct blspec_entry *entry)
 {
-- 
2.9.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply related

* [PATCH 1/2] mfd: syscon: fix exported symbol name
From: Lucas Stach @ 2016-09-27  9:59 UTC (permalink / raw)
  To: barebox

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 drivers/mfd/syscon.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c
index 295e210f6e2d..9f8baee1aadf 100644
--- a/drivers/mfd/syscon.c
+++ b/drivers/mfd/syscon.c
@@ -76,8 +76,7 @@ static void __iomem *syscon_node_to_base(struct device_node *np)
 
 	return syscon->base;
 }
-EXPORT_SYMBOL_GPL(syscon_node_to_regmap);
-
+EXPORT_SYMBOL_GPL(syscon_node_to_base);
 
 void __iomem *syscon_base_lookup_by_pdevname(const char *s)
 {
-- 
2.9.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply related

* [PATCH 2/2] serial: arm_dcc: depend on !CPU_V8
From: Lucas Stach @ 2016-09-27  9:59 UTC (permalink / raw)
  To: barebox
In-Reply-To: <20160927095919.3461-1-l.stach@pengutronix.de>

The DCC console uses coprocessor registers registers accesses, the
implementation of those for ARMv8 is currently missing.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 drivers/serial/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index 146bf1ec3c30..b112d7ee044a 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -2,7 +2,7 @@ menu "serial drivers"
 	depends on !CONSOLE_NONE
 
 config DRIVER_SERIAL_ARM_DCC
-	depends on ARM
+	depends on ARM && !CPU_V8
 	bool "ARM Debug Communications Channel (DCC) serial driver"
 
 config SERIAL_AMBA_PL011
-- 
2.9.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply related

* Re: [PATCH 1/2] mfd: syscon: fix exported symbol name
From: Antony Pavlov @ 2016-09-27 10:24 UTC (permalink / raw)
  To: Lucas Stach; +Cc: barebox
In-Reply-To: <20160927095919.3461-1-l.stach@pengutronix.de>

On Tue, 27 Sep 2016 11:59:18 +0200
Lucas Stach <l.stach@pengutronix.de> wrote:

> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> ---
>  drivers/mfd/syscon.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c
> index 295e210f6e2d..9f8baee1aadf 100644
> --- a/drivers/mfd/syscon.c
> +++ b/drivers/mfd/syscon.c
> @@ -76,8 +76,7 @@ static void __iomem *syscon_node_to_base(struct device_node *np)
                    ^^^^^^

Hmm. In the current next and master branches syscon_node_to_base() is a static function.
Can we just drop this EXPORT_SYMBOL_GPL()?

>  	return syscon->base;
>  }
> -EXPORT_SYMBOL_GPL(syscon_node_to_regmap);
> -
> +EXPORT_SYMBOL_GPL(syscon_node_to_base);
>  
>  void __iomem *syscon_base_lookup_by_pdevname(const char *s)
>  {
> -- 
> 2.9.3
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox


-- 
-- 
Best regards,
  Antony Pavlov

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply

* Re: [PATCH 1/2] mfd: syscon: fix exported symbol name
From: Lucas Stach @ 2016-09-27 10:22 UTC (permalink / raw)
  To: Antony Pavlov; +Cc: barebox
In-Reply-To: <20160927132431.404514747b5951608fe05389@gmail.com>

Am Dienstag, den 27.09.2016, 13:24 +0300 schrieb Antony Pavlov:
> On Tue, 27 Sep 2016 11:59:18 +0200
> Lucas Stach <l.stach@pengutronix.de> wrote:
> 
> > Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> > ---
> >  drivers/mfd/syscon.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> > 
> > diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c
> > index 295e210f6e2d..9f8baee1aadf 100644
> > --- a/drivers/mfd/syscon.c
> > +++ b/drivers/mfd/syscon.c
> > @@ -76,8 +76,7 @@ static void __iomem *syscon_node_to_base(struct device_node *np)
>                     ^^^^^^
> 
> Hmm. In the current next and master branches syscon_node_to_base() is a static function.
> Can we just drop this EXPORT_SYMBOL_GPL()?
> 
You are right. I'll just drop the EXPORT_SYMBOL.

Thanks,
Lucas


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply

* [PATCH 2/2] Make generic default environment type a use choice
From: Sascha Hauer @ 2016-09-27 14:16 UTC (permalink / raw)
  To: Barebox List
In-Reply-To: <20160927141639.27403-1-s.hauer@pengutronix.de>

So far it was hardcoded for each board if defenv-1 or defenv-2 is used.
Make this a user choice so that a particular board no longer enforces
a defenv type.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/Kconfig                |  1 -
 arch/arm/mach-at91/Kconfig      |  3 ---
 arch/arm/mach-clps711x/Kconfig  |  1 -
 arch/arm/mach-davinci/Kconfig   |  1 -
 arch/arm/mach-highbank/Kconfig  |  1 -
 arch/arm/mach-imx/Kconfig       |  9 ---------
 arch/arm/mach-mxs/Kconfig       |  5 -----
 arch/arm/mach-omap/Kconfig      |  3 ---
 arch/arm/mach-samsung/Kconfig   |  1 -
 arch/arm/mach-socfpga/Kconfig   |  4 ----
 arch/arm/mach-uemd/Kconfig      |  1 -
 arch/arm/mach-versatile/Kconfig |  1 -
 arch/efi/Kconfig                |  1 -
 arch/openrisc/Kconfig           |  1 -
 common/Kconfig                  | 36 +++++++++++++++---------------------
 15 files changed, 15 insertions(+), 54 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 150320c..f13cc1d 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -232,7 +232,6 @@ config ARCH_TEGRA
 	select CLKDEV_LOOKUP
 	select GPIOLIB
 	select GPIO_TEGRA
-	select HAVE_DEFAULT_ENVIRONMENT_NEW
 	select HAVE_PBL_MULTI_IMAGES
 	select OFDEVICE
 	select OFTREE
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 4166fa5..c45fc4d 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -255,7 +255,6 @@ config MACH_USB_A9260
 
 config MACH_GE863
 	bool "Telit EVK-PRO3"
-	select HAVE_DEFAULT_ENVIRONMENT_NEW
 	help
 	  Say y here if you are using Telit EVK-PRO3 with GE863-PRO3
 	  <http://www.telit.com>
@@ -494,13 +493,11 @@ choice
 
 config MACH_SAMA5D4EK
 	bool "Atmel SAMA5D4 Evaluation Kit"
-	select HAVE_DEFAULT_ENVIRONMENT_NEW
 	help
 	  Select this if you are using Atmel's SAMA5D4-EK Evaluation Kit.
 
 config MACH_SAMA5D4_XPLAINED
 	bool "Atmel SAMA5D4 XPLAINED ULTRA Evaluation Kit"
-	select HAVE_DEFAULT_ENVIRONMENT_NEW
 	help
 	  Select this if you are using Atmel's SAMA5D4_XPLAINED ULTRA Evaluation Kit.
 
diff --git a/arch/arm/mach-clps711x/Kconfig b/arch/arm/mach-clps711x/Kconfig
index 92dd51a..0853ce2 100644
--- a/arch/arm/mach-clps711x/Kconfig
+++ b/arch/arm/mach-clps711x/Kconfig
@@ -5,7 +5,6 @@ choice
 
 config MACH_CLEP7212
 	bool "Cirrus Logic CLEP7212"
-	select HAVE_DEFAULT_ENVIRONMENT_NEW
 	help
 	  Boards based on the Cirrus Logic 7212/7312 CPU.
 
diff --git a/arch/arm/mach-davinci/Kconfig b/arch/arm/mach-davinci/Kconfig
index 3165d50..66d3d7a 100644
--- a/arch/arm/mach-davinci/Kconfig
+++ b/arch/arm/mach-davinci/Kconfig
@@ -9,7 +9,6 @@ choice
 
 config MACH_VIRT2REAL
 	bool "Virt2Real"
-	select HAVE_DEFAULT_ENVIRONMENT_NEW
 
 endchoice
 
diff --git a/arch/arm/mach-highbank/Kconfig b/arch/arm/mach-highbank/Kconfig
index 8af4808..8a22348 100644
--- a/arch/arm/mach-highbank/Kconfig
+++ b/arch/arm/mach-highbank/Kconfig
@@ -10,7 +10,6 @@ choice
 config MACH_HIGHBANK
 	bool "Calxeda Highbank"
 	select OFTREE
-	select HAVE_DEFAULT_ENVIRONMENT_NEW
 
 endchoice
 
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index a80bc6b..ae35aaa 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -151,7 +151,6 @@ config ARCH_IMX6SX
 
 config IMX_MULTI_BOARDS
 	bool "Allow multiple boards to be selected"
-	select HAVE_DEFAULT_ENVIRONMENT_NEW
 	select HAVE_PBL_MULTI_IMAGES
 
 if IMX_MULTI_BOARDS
@@ -166,7 +165,6 @@ config MACH_TX25
 config MACH_PCA100
 	bool "phyCard-i.MX27"
 	select ARCH_IMX27
-	select HAVE_DEFAULT_ENVIRONMENT_NEW
 	select ARCH_IMX_EXTERNAL_BOOT_NAND
 	help
 	  Say Y here if you are using Phytec's phyCard-i.MX27 (pca100) equipped
@@ -178,7 +176,6 @@ config MACH_PCM038
 	select SPI
 	select DRIVER_SPI_IMX
 	select MFD_MC13XXX
-	select HAVE_DEFAULT_ENVIRONMENT_NEW
 	select ARCH_IMX_EXTERNAL_BOOT_NAND
 	help
 	  Say Y here if you are using Phytec's phyCORE-i.MX27 (pcm038) equipped
@@ -272,7 +269,6 @@ config MACH_TX6X
 config MACH_SABRELITE
 	bool "Freescale i.MX6 Sabre Lite"
 	select ARCH_IMX6
-	select HAVE_DEFAULT_ENVIRONMENT_NEW
 	select HAVE_PBL_MULTI_IMAGES
 
 config MACH_SABRESD
@@ -404,7 +400,6 @@ config MACH_PCM037
 	bool "phyCORE-i.MX31"
 	select ARCH_IMX31
 	select USB_ULPI if USB
-	select HAVE_DEFAULT_ENVIRONMENT_NEW
 	select ARCH_HAS_L2X0
 	help
 	  Say Y here if you are using Phytec's phyCORE-i.MX31 (pcm037) equipped
@@ -414,7 +409,6 @@ config MACH_MX31MOBOARD
 	bool "mx31moboard-i.MX31"
 	select ARCH_IMX31
 	select USB_ULPI if USB
-	select HAVE_DEFAULT_ENVIRONMENT_NEW
 	select ARCH_HAS_L2X0
 	help
 	  Say Y here if you are using EPFL mx31moboard board equipped
@@ -447,7 +441,6 @@ config MACH_PCM043
 	bool "phyCORE-i.MX35"
 	select ARCH_IMX35
 	select ARCH_HAS_L2X0
-	select HAVE_DEFAULT_ENVIRONMENT_NEW
 	help
 	  Say Y here if you are using Phytec's phyCORE-i.MX35 (pcm043) equipped
 	  with a Freescale i.MX35 Processor
@@ -464,7 +457,6 @@ config MACH_KINDLE3
 	bool "Amazon Kindle3"
 	select ARCH_IMX35
 	select ARCH_HAS_L2X0
-	select HAVE_DEFAULT_ENVIRONMENT_NEW
 	help
 	  Say Y here if you are using the Amazon Model No. D00901 Kindle
 
@@ -515,7 +507,6 @@ config MACH_FREESCALE_MX53_SMD
 config MACH_TX53
 	bool "Ka-Ro TX53"
 	select ARCH_IMX53
-	select HAVE_DEFAULT_ENVIRONMENT_NEW
 	help
 	  Say Y here if you are using the Ka-Ro tx53 board
 
diff --git a/arch/arm/mach-mxs/Kconfig b/arch/arm/mach-mxs/Kconfig
index ea0fa5a..facab9c 100644
--- a/arch/arm/mach-mxs/Kconfig
+++ b/arch/arm/mach-mxs/Kconfig
@@ -45,7 +45,6 @@ config MACH_CHUMBY
 
 config MACH_IMX233_OLINUXINO
 	bool "Olimex.ltd imx223-olinuxino"
-	select HAVE_DEFAULT_ENVIRONMENT_NEW
 	select HAVE_PBL_MULTI_IMAGES
 	help
 	  Say Y here if you are using the imx233-olinuxino
@@ -61,14 +60,12 @@ choice
 
 config MACH_TX28
 	bool "KARO tx28"
-	select HAVE_DEFAULT_ENVIRONMENT_NEW
 	select HAVE_PBL_MULTI_IMAGES
 	help
 	  Say Y here if you are using the KARO TX28 CPU module.
 
 config MACH_MX28EVK
 	bool "mx28-evk"
-	select HAVE_DEFAULT_ENVIRONMENT_NEW
 	select MXS_OCOTP
 	select HAVE_PBL_MULTI_IMAGES
 	help
@@ -76,7 +73,6 @@ config MACH_MX28EVK
 
 config MACH_DUCKBILL
 	bool "Duckbill"
-	select HAVE_DEFAULT_ENVIRONMENT_NEW
 	select MXS_OCOTP
 	select HAVE_PBL_MULTI_IMAGES
 	help
@@ -84,7 +80,6 @@ config MACH_DUCKBILL
 
 config MACH_CFA10036
 	bool "cfa-10036"
-	select HAVE_DEFAULT_ENVIRONMENT_NEW
 	select MXS_OCOTP
 	select I2C_GPIO
 	select EEPROM_AT24
diff --git a/arch/arm/mach-omap/Kconfig b/arch/arm/mach-omap/Kconfig
index d7c863c..f8ec195 100644
--- a/arch/arm/mach-omap/Kconfig
+++ b/arch/arm/mach-omap/Kconfig
@@ -155,7 +155,6 @@ config OMAP_SERIALBOOT
 
 config OMAP_MULTI_BOARDS
 	bool "Allow multiple boards to be selected"
-	select HAVE_DEFAULT_ENVIRONMENT_NEW
 	select HAVE_PBL_MULTI_IMAGES
 
 if OMAP_MULTI_BOARDS
@@ -168,7 +167,6 @@ config MACH_AFI_GF
 
 config MACH_BEAGLE
 	bool "Texas Instrument's Beagle Board"
-	select HAVE_DEFAULT_ENVIRONMENT_NEW
 	select ARCH_OMAP3
 	help
 	  Say Y here if you are using Beagle Board
@@ -204,7 +202,6 @@ config MACH_OMAP3EVM
 
 config MACH_PANDA
 	bool "Texas Instrument's Panda Board"
-	select HAVE_DEFAULT_ENVIRONMENT_NEW
 	select ARCH_OMAP4
 	help
 	  Say Y here if you are using OMAP4 Panda board
diff --git a/arch/arm/mach-samsung/Kconfig b/arch/arm/mach-samsung/Kconfig
index 8f421bb..a2ddabf 100644
--- a/arch/arm/mach-samsung/Kconfig
+++ b/arch/arm/mach-samsung/Kconfig
@@ -52,7 +52,6 @@ config MACH_MINI2440
 	select S3C_PLL_INIT
 	select S3C_SDRAM_INIT
 	select HAS_DM9000
-	select HAVE_DEFAULT_ENVIRONMENT_NEW
 	help
 	  Say Y here if you are using Mini 2440 dev board equipped
 	  with a Samsung S3C2440 Processor
diff --git a/arch/arm/mach-socfpga/Kconfig b/arch/arm/mach-socfpga/Kconfig
index 94689e3..04b5416 100644
--- a/arch/arm/mach-socfpga/Kconfig
+++ b/arch/arm/mach-socfpga/Kconfig
@@ -13,19 +13,15 @@ config ARCH_TEXT_BASE
 	default 0x00100000 if MACH_SOCFPGA_CYCLONE5
 
 config MACH_SOCFPGA_ALTERA_SOCDK
-	select HAVE_DEFAULT_ENVIRONMENT_NEW
 	bool "Altera SoCFPGA Development Kit"
 
 config MACH_SOCFPGA_EBV_SOCRATES
-	select HAVE_DEFAULT_ENVIRONMENT_NEW
 	bool "EBV Socrates"
 
 config MACH_SOCFPGA_TERASIC_DE0_NANO_SOC
-	select HAVE_DEFAULT_ENVIRONMENT_NEW
 	bool "Terasic DE0-NANO-SoC aka Atlas"
 
 config MACH_SOCFPGA_TERASIC_SOCKIT
-	select HAVE_DEFAULT_ENVIRONMENT_NEW
 	bool "Terasic SoCKit"
 
 endif
diff --git a/arch/arm/mach-uemd/Kconfig b/arch/arm/mach-uemd/Kconfig
index aedd757..2bcdd32 100644
--- a/arch/arm/mach-uemd/Kconfig
+++ b/arch/arm/mach-uemd/Kconfig
@@ -9,7 +9,6 @@ choice
 
 config MACH_MB7707
 	bool "MB7707"
-	select HAVE_DEFAULT_ENVIRONMENT_NEW
 
 endchoice
 
diff --git a/arch/arm/mach-versatile/Kconfig b/arch/arm/mach-versatile/Kconfig
index 755fdc1..3c5cced 100644
--- a/arch/arm/mach-versatile/Kconfig
+++ b/arch/arm/mach-versatile/Kconfig
@@ -9,7 +9,6 @@ config MACH_VERSATILEPB
 	default y
 	select ARM_AMBA
 	select CLKDEV_LOOKUP
-	select HAVE_DEFAULT_ENVIRONMENT_NEW
 
 choice
 	prompt "ARM Board type"
diff --git a/arch/efi/Kconfig b/arch/efi/Kconfig
index 26fecaa..d8d0592 100644
--- a/arch/efi/Kconfig
+++ b/arch/efi/Kconfig
@@ -3,7 +3,6 @@ config ARCH_EFI
 	default y
 	select HAS_DEBUG_LL
 	select HAS_KALLSYMS
-	select HAVE_DEFAULT_ENVIRONMENT_NEW
 	select EFI_GUID
 	select EFI_DEVICEPATH
 	select PRINTF_UUID
diff --git a/arch/openrisc/Kconfig b/arch/openrisc/Kconfig
index 483ae6d..2a8abf0 100644
--- a/arch/openrisc/Kconfig
+++ b/arch/openrisc/Kconfig
@@ -3,7 +3,6 @@ config OPENRISC
 	select OFTREE
 	select HAS_CACHE
 	select HAVE_CONFIGURABLE_MEMORY_LAYOUT
-	select HAVE_DEFAULT_ENVIRONMENT_NEW
 	select GENERIC_FIND_NEXT_BIT
 	default y
 
diff --git a/common/Kconfig b/common/Kconfig
index f2badc7..3923c6c 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -826,11 +826,8 @@ config DEFAULT_COMPRESSION_NONE
 
 endchoice
 
-config HAVE_DEFAULT_ENVIRONMENT_NEW
-	bool
-
 config DEFAULT_ENVIRONMENT_GENERIC_NEW
-	bool
+	bool "Generic environment template"
 	depends on DEFAULT_ENVIRONMENT
 	depends on SHELL_HUSH
 	select BOOTM
@@ -850,31 +847,16 @@ config DEFAULT_ENVIRONMENT_GENERIC_NEW
 	select FLEXIBLE_BOOTARGS
 	select CMD_BOOT
 	select NET_CMD_IFUP if NET
-	prompt "Generic environment template"
-
-config DEFAULT_ENVIRONMENT_GENERIC_NEW_MENU
-	bool
-	depends on DEFAULT_ENVIRONMENT_GENERIC_NEW
-	depends on CMD_MENUTREE
-	default y
-
-config DEFAULT_ENVIRONMENT_GENERIC_NEW_DFU
-	bool
-	depends on DEFAULT_ENVIRONMENT_GENERIC_NEW
-	depends on USB_GADGET_DFU
-	default y
 
 config DEFAULT_ENVIRONMENT_GENERIC
-	bool
-	depends on !HAVE_DEFAULT_ENVIRONMENT_NEW
+	bool "Generic environment template (old version)"
 	depends on DEFAULT_ENVIRONMENT
+	depends on !DEFAULT_ENVIRONMENT_GENERIC_NEW
 	depends on SHELL_HUSH
 	select CMD_GETOPT
 	select CMD_CRC
 	select CMD_CRC_CMP
-	select CMD_AUTOMOUNT if HAVE_DEFAULT_ENVIRONMENT_NEW
 	select CMD_GLOBAL
-	prompt "Default environment generic"
 	help
 	  With this option barebox will use the generic default
 	  environment found under defaultenv/ in the src tree.
@@ -883,6 +865,18 @@ config DEFAULT_ENVIRONMENT_GENERIC
 	  at least contain a /env/config file.
 	  This will be able to overwrite the files from defaultenv.
 
+config DEFAULT_ENVIRONMENT_GENERIC_NEW_MENU
+	bool
+	depends on DEFAULT_ENVIRONMENT_GENERIC_NEW
+	depends on CMD_MENUTREE
+	default y
+
+config DEFAULT_ENVIRONMENT_GENERIC_NEW_DFU
+	bool
+	depends on DEFAULT_ENVIRONMENT_GENERIC_NEW
+	depends on USB_GADGET_DFU
+	default y
+
 config DEFAULT_ENVIRONMENT_PATH
 	string
 	depends on DEFAULT_ENVIRONMENT
-- 
2.9.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply related

* [PATCH 1/2] defaultenv: add defaultenv-1 in boards via defaultenv_append_directory()
From: Sascha Hauer @ 2016-09-27 14:16 UTC (permalink / raw)
  To: Barebox List

Currently it's hardcoded for each board which defaultenv version is
used. This is unfortunate since some people like the other defaultenv
version better and may want to select it.

This patch removes the board specific environment path
CONFIG_DEFAULT_ENVIRONMENT_PATH and instead adds it via:

	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
		defaultenv_append_directory(defaultenv_<board>);

This way we can make sure that the defaultenv-1 board specific bits are
only compiled in when defaultenv-1 is actually in use.

The next step is to make the defaultenv version selection a user visible
choice.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/boards/animeo_ip/Makefile                                    | 1 +
 arch/arm/boards/animeo_ip/{env => defaultenv-animeo_ip}/config        | 0
 arch/arm/boards/animeo_ip/init.c                                      | 4 ++++
 arch/arm/boards/at91rm9200ek/Makefile                                 | 1 +
 .../at91rm9200ek/{env => defaultenv-at91rm9200ek}/bin/init_board      | 0
 arch/arm/boards/at91rm9200ek/{env => defaultenv-at91rm9200ek}/config  | 0
 arch/arm/boards/at91rm9200ek/init.c                                   | 4 ++++
 arch/arm/boards/at91sam9260ek/Makefile                                | 1 +
 .../at91sam9260ek/{env => defaultenv-at91sam9260ek}/bin/init_board    | 0
 .../arm/boards/at91sam9260ek/{env => defaultenv-at91sam9260ek}/config | 0
 arch/arm/boards/at91sam9260ek/init.c                                  | 4 ++++
 arch/arm/boards/at91sam9261ek/Makefile                                | 1 +
 .../at91sam9261ek/{env => defaultenv-at91sam9261ek}/bin/init_board    | 0
 .../arm/boards/at91sam9261ek/{env => defaultenv-at91sam9261ek}/config | 0
 arch/arm/boards/at91sam9261ek/init.c                                  | 4 ++++
 arch/arm/boards/at91sam9263ek/Makefile                                | 1 +
 .../at91sam9263ek/{env => defaultenv-at91sam9263ek}/bin/init_board    | 0
 .../arm/boards/at91sam9263ek/{env => defaultenv-at91sam9263ek}/config | 0
 arch/arm/boards/at91sam9263ek/init.c                                  | 4 ++++
 arch/arm/boards/at91sam9m10g45ek/Makefile                             | 1 +
 .../{env => defaultenv-at91sam9m10g45ek}/bin/boot_board               | 0
 .../{env => defaultenv-at91sam9m10g45ek}/bin/menu_boot                | 0
 .../at91sam9m10g45ek/{env => defaultenv-at91sam9m10g45ek}/config      | 0
 arch/arm/boards/at91sam9m10g45ek/init.c                               | 4 ++++
 arch/arm/boards/at91sam9n12ek/Makefile                                | 1 +
 .../at91sam9n12ek/{env => defaultenv-at91sam9n12ek}/bin/init_board    | 0
 .../arm/boards/at91sam9n12ek/{env => defaultenv-at91sam9n12ek}/config | 0
 arch/arm/boards/at91sam9n12ek/init.c                                  | 4 ++++
 arch/arm/boards/at91sam9x5ek/Makefile                                 | 1 +
 .../at91sam9x5ek/{env => defaultenv-at91sam9x5ek}/bin/init_board      | 0
 arch/arm/boards/at91sam9x5ek/{env => defaultenv-at91sam9x5ek}/config  | 0
 arch/arm/boards/at91sam9x5ek/init.c                                   | 4 ++++
 arch/arm/boards/eukrea_cpuimx25/Makefile                              | 1 +
 .../{env => defaultenv-eukrea_cpuimx25}/bin/init_board                | 0
 .../boards/eukrea_cpuimx25/{env => defaultenv-eukrea_cpuimx25}/config | 0
 arch/arm/boards/eukrea_cpuimx25/eukrea_cpuimx25.c                     | 4 ++++
 arch/arm/boards/eukrea_cpuimx35/Makefile                              | 1 +
 .../{env => defaultenv-eukrea_cpuimx35}/bin/init_board                | 0
 .../boards/eukrea_cpuimx35/{env => defaultenv-eukrea_cpuimx35}/config | 0
 arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c                     | 4 ++++
 arch/arm/boards/eukrea_cpuimx51/Makefile                              | 1 +
 .../{env => defaultenv-eukrea_cpuimx51}/bin/init_board                | 0
 .../boards/eukrea_cpuimx51/{env => defaultenv-eukrea_cpuimx51}/config | 0
 arch/arm/boards/eukrea_cpuimx51/eukrea_cpuimx51.c                     | 4 ++++
 arch/arm/boards/freescale-mx25-3ds/3stack.c                           | 4 ++++
 arch/arm/boards/freescale-mx25-3ds/Makefile                           | 1 +
 .../{env => defaultenv-freescale-mx25-3ds}/bin/_update                | 0
 .../{env => defaultenv-freescale-mx25-3ds}/bin/boot                   | 0
 .../{env => defaultenv-freescale-mx25-3ds}/bin/init                   | 0
 .../{env => defaultenv-freescale-mx25-3ds}/bin/update_kernel          | 0
 .../{env => defaultenv-freescale-mx25-3ds}/bin/update_root            | 0
 .../freescale-mx25-3ds/{env => defaultenv-freescale-mx25-3ds}/config  | 0
 arch/arm/boards/freescale-mx35-3ds/3stack.c                           | 4 ++++
 arch/arm/boards/freescale-mx35-3ds/Makefile                           | 1 +
 .../freescale-mx35-3ds/{env => defaultenv-freescale-mx35-3ds}/config  | 0
 arch/arm/boards/freescale-mx53-smd/Makefile                           | 1 +
 arch/arm/boards/freescale-mx53-smd/board.c                            | 4 ++++
 .../freescale-mx53-smd/{env => defaultenv-freescale-mx53-smd}/config  | 0
 arch/arm/boards/friendlyarm-mini6410/Makefile                         | 1 +
 .../{env => defaultenv-friendlyarm-mini6410}/config                   | 0
 arch/arm/boards/friendlyarm-mini6410/mini6410.c                       | 4 ++++
 arch/arm/boards/friendlyarm-tiny6410/Makefile                         | 1 +
 .../{env => defaultenv-friendlyarm-tiny6410}/config                   | 0
 arch/arm/boards/guf-cupid/Makefile                                    | 1 +
 arch/arm/boards/guf-cupid/board.c                                     | 4 ++++
 arch/arm/boards/guf-cupid/{env => defaultenv-guf-cupid}/config        | 0
 arch/arm/boards/guf-neso/Makefile                                     | 1 +
 arch/arm/boards/guf-neso/board.c                                      | 4 ++++
 arch/arm/boards/guf-neso/{env => defaultenv-guf-neso}/config          | 0
 arch/arm/boards/haba-knx/Makefile                                     | 1 +
 arch/arm/boards/haba-knx/{env => defaultenv-haba-knx}/bin/init_board  | 0
 arch/arm/boards/haba-knx/{env => defaultenv-haba-knx}/config          | 0
 arch/arm/boards/haba-knx/init.c                                       | 4 ++++
 arch/arm/boards/highbank/Makefile                                     | 1 +
 .../boards/highbank/{env => defaultenv-highbank}/boot.d/010-ahci-boot | 0
 arch/arm/boards/highbank/{env => defaultenv-highbank}/boot.d/011-ahci | 0
 .../boards/highbank/{env => defaultenv-highbank}/boot.d/020-mmc-boot  | 0
 arch/arm/boards/highbank/{env => defaultenv-highbank}/boot.d/021-mmc  | 0
 arch/arm/boards/highbank/{env => defaultenv-highbank}/boot.d/030-net  | 0
 .../boards/highbank/{env => defaultenv-highbank}/boot.d/031-net-eth1  | 0
 arch/arm/boards/highbank/{env => defaultenv-highbank}/boot/ahci       | 0
 arch/arm/boards/highbank/{env => defaultenv-highbank}/boot/ahci-boot  | 0
 arch/arm/boards/highbank/{env => defaultenv-highbank}/boot/mmc        | 0
 arch/arm/boards/highbank/{env => defaultenv-highbank}/boot/mmc-boot   | 0
 arch/arm/boards/highbank/{env => defaultenv-highbank}/boot/net        | 0
 arch/arm/boards/highbank/{env => defaultenv-highbank}/boot/net-eth1   | 0
 arch/arm/boards/highbank/{env => defaultenv-highbank}/data/oftree     | 0
 .../boards/highbank/{env => defaultenv-highbank}/init/001-dtb-probe   | 0
 arch/arm/boards/highbank/{env => defaultenv-highbank}/init/automount  | 0
 arch/arm/boards/highbank/{env => defaultenv-highbank}/nv/boot.default | 0
 arch/arm/boards/highbank/{env => defaultenv-highbank}/nv/bootm.oftree | 0
 .../highbank/{env => defaultenv-highbank}/nv/linux.bootargs.console   | 0
 arch/arm/boards/highbank/init.c                                       | 4 ++++
 arch/arm/boards/nhk8815/Makefile                                      | 1 +
 arch/arm/boards/nhk8815/{env => defaultenv-nhk8815}/config            | 0
 arch/arm/boards/nhk8815/setup.c                                       | 4 ++++
 arch/arm/boards/phytec-phycard-omap4/Makefile                         | 1 +
 .../{env => defaultenv-phytec-phycard-omap4}/bin/nand_bootstrap       | 0
 .../{env => defaultenv-phytec-phycard-omap4}/config                   | 0
 arch/arm/boards/phytec-phycore-omap4460/Makefile                      | 1 +
 arch/arm/boards/phytec-phycore-omap4460/board.c                       | 4 ++++
 .../{env => defaultenv-phytec-phycore-omap4460}/bin/init_board        | 0
 .../{env => defaultenv-phytec-phycore-omap4460}/bin/nand_bootstrap    | 0
 .../{env => defaultenv-phytec-phycore-omap4460}/config                | 0
 arch/arm/boards/pm9261/Makefile                                       | 1 +
 arch/arm/boards/pm9261/{env => defaultenv-pm9261}/config              | 0
 arch/arm/boards/pm9261/init.c                                         | 4 ++++
 arch/arm/boards/pm9g45/Makefile                                       | 1 +
 arch/arm/boards/pm9g45/{env => defaultenv-pm9g45}/config              | 0
 arch/arm/boards/pm9g45/init.c                                         | 4 ++++
 arch/arm/boards/qemu-virt64/Makefile                                  | 1 +
 arch/arm/boards/qemu-virt64/{env => defaultenv-qemu-virt64}/config    | 0
 arch/arm/boards/qemu-virt64/init.c                                    | 4 ++++
 arch/arm/boards/qil-a926x/Makefile                                    | 1 +
 .../arm/boards/qil-a926x/{env => defaultenv-qil-a926x}/bin/init_board | 0
 arch/arm/boards/qil-a926x/{env => defaultenv-qil-a926x}/config        | 0
 arch/arm/boards/qil-a926x/init.c                                      | 4 ++++
 arch/arm/boards/sama5d3_xplained/Makefile                             | 1 +
 .../sama5d3_xplained/{env => defaultenv-sama5d3_xplained}/config      | 0
 arch/arm/boards/sama5d3_xplained/init.c                               | 4 ++++
 arch/arm/boards/sama5d3xek/Makefile                                   | 1 +
 .../boards/sama5d3xek/{env => defaultenv-sama5d3xek}/bin/init_board   | 0
 arch/arm/boards/sama5d3xek/{env => defaultenv-sama5d3xek}/config      | 0
 arch/arm/boards/sama5d3xek/init.c                                     | 4 ++++
 arch/arm/boards/scb9328/Makefile                                      | 1 +
 arch/arm/boards/scb9328/{env => defaultenv-scb9328}/config            | 0
 arch/arm/boards/scb9328/scb9328.c                                     | 4 ++++
 arch/arm/boards/tny-a926x/Makefile                                    | 1 +
 .../arm/boards/tny-a926x/{env => defaultenv-tny-a926x}/bin/init_board | 0
 arch/arm/boards/tny-a926x/{env => defaultenv-tny-a926x}/config        | 0
 arch/arm/boards/tny-a926x/init.c                                      | 4 ++++
 arch/arm/boards/usb-a926x/Makefile                                    | 1 +
 .../arm/boards/usb-a926x/{env => defaultenv-usb-a926x}/bin/init_board | 0
 arch/arm/boards/usb-a926x/{env => defaultenv-usb-a926x}/config        | 0
 arch/arm/boards/usb-a926x/init.c                                      | 4 ++++
 arch/arm/boards/vexpress/Makefile                                     | 1 +
 arch/arm/boards/vexpress/{env => defaultenv-vexpress}/config          | 0
 arch/arm/boards/vexpress/init.c                                       | 4 ++++
 arch/arm/configs/animeo_ip_defconfig                                  | 1 -
 arch/arm/configs/at91rm9200ek_defconfig                               | 1 -
 arch/arm/configs/at91sam9260ek_defconfig                              | 1 -
 arch/arm/configs/at91sam9261ek_defconfig                              | 1 -
 arch/arm/configs/at91sam9261ek_first_stage_defconfig                  | 1 -
 arch/arm/configs/at91sam9263ek_defconfig                              | 1 -
 arch/arm/configs/at91sam9g10ek_defconfig                              | 1 -
 arch/arm/configs/at91sam9g20ek_defconfig                              | 1 -
 arch/arm/configs/at91sam9m10g45ek_defconfig                           | 1 -
 arch/arm/configs/at91sam9n12ek_defconfig                              | 1 -
 arch/arm/configs/at91sam9x5ek_defconfig                               | 1 -
 arch/arm/configs/cupid_defconfig                                      | 1 -
 arch/arm/configs/eukrea_cpuimx25_defconfig                            | 1 -
 arch/arm/configs/eukrea_cpuimx35_defconfig                            | 1 -
 arch/arm/configs/eukrea_cpuimx51_defconfig                            | 1 -
 arch/arm/configs/freescale-mx25-3ds_defconfig                         | 1 -
 arch/arm/configs/freescale-mx35-3ds_defconfig                         | 1 -
 arch/arm/configs/freescale-mx53-smd_defconfig                         | 1 -
 arch/arm/configs/friendlyarm_mini6410_defconfig                       | 1 -
 arch/arm/configs/friendlyarm_tiny6410_defconfig                       | 1 -
 arch/arm/configs/haba_knx_lite_defconfig                              | 1 -
 arch/arm/configs/highbank_defconfig                                   | 1 -
 arch/arm/configs/neso_defconfig                                       | 1 -
 arch/arm/configs/nhk8815_defconfig                                    | 1 -
 arch/arm/configs/phytec-phycard-omap4_defconfig                       | 1 -
 arch/arm/configs/phytec-phycore-omap4460_defconfig                    | 1 -
 arch/arm/configs/pm9261_defconfig                                     | 1 -
 arch/arm/configs/pm9g45_defconfig                                     | 1 -
 arch/arm/configs/qemu_virt64_defconfig                                | 1 -
 arch/arm/configs/qil_a9260_128mib_defconfig                           | 1 -
 arch/arm/configs/qil_a9260_defconfig                                  | 1 -
 arch/arm/configs/qil_a9g20_128mib_defconfig                           | 1 -
 arch/arm/configs/qil_a9g20_defconfig                                  | 1 -
 arch/arm/configs/sama5d3_xplained_defconfig                           | 1 -
 arch/arm/configs/sama5d3xek_defconfig                                 | 1 -
 arch/arm/configs/scb9328_defconfig                                    | 1 -
 arch/arm/configs/tny_a9260_defconfig                                  | 1 -
 arch/arm/configs/tny_a9263_defconfig                                  | 1 -
 arch/arm/configs/tny_a9g20_defconfig                                  | 1 -
 arch/arm/configs/usb_a9260_defconfig                                  | 1 -
 arch/arm/configs/usb_a9263_128mib_defconfig                           | 1 -
 arch/arm/configs/usb_a9263_defconfig                                  | 1 -
 arch/arm/configs/usb_a9g20_128mib_defconfig                           | 1 -
 arch/arm/configs/usb_a9g20_defconfig                                  | 1 -
 arch/arm/configs/vexpress_ca9_defconfig                               | 1 -
 arch/arm/configs/vexpress_defconfig                                   | 1 -
 arch/nios2/boards/generic/Makefile                                    | 1 +
 arch/nios2/boards/generic/{env => defaultenv-generic}/config          | 0
 arch/nios2/boards/generic/generic.c                                   | 4 ++++
 arch/nios2/configs/generic_defconfig                                  | 1 -
 arch/ppc/boards/freescale-p1010rdb/Makefile                           | 3 ++-
 .../{env => defaultenv-freescale-p1010rdb}/bin/init                   | 0
 .../freescale-p1010rdb/{env => defaultenv-freescale-p1010rdb}/config  | 0
 arch/ppc/boards/freescale-p1010rdb/p1010rdb.c                         | 4 ++++
 arch/ppc/boards/freescale-p1022ds/Makefile                            | 1 +
 .../freescale-p1022ds/{env => defaultenv-freescale-p1022ds}/bin/init  | 0
 .../freescale-p1022ds/{env => defaultenv-freescale-p1022ds}/config    | 0
 arch/ppc/boards/freescale-p1022ds/p1022ds.c                           | 4 ++++
 arch/ppc/boards/freescale-p2020rdb/Makefile                           | 1 +
 .../{env => defaultenv-freescale-p2020rdb}/bin/init                   | 0
 .../freescale-p2020rdb/{env => defaultenv-freescale-p2020rdb}/config  | 0
 arch/ppc/boards/freescale-p2020rdb/p2020rdb.c                         | 4 ++++
 arch/ppc/boards/geip-da923rc/Makefile                                 | 1 +
 arch/ppc/boards/geip-da923rc/da923rc.c                                | 4 ++++
 .../ppc/boards/geip-da923rc/{env => defaultenv-geip-da923rc}/bin/boot | 0
 .../ppc/boards/geip-da923rc/{env => defaultenv-geip-da923rc}/bin/init | 0
 arch/ppc/boards/geip-da923rc/{env => defaultenv-geip-da923rc}/config  | 0
 arch/ppc/configs/da923rc_defconfig                                    | 1 -
 arch/ppc/configs/p1010rdb_defconfig                                   | 1 -
 arch/ppc/configs/p1022ds_defconfig                                    | 1 -
 arch/ppc/configs/p2020rdb_defconfig                                   | 1 -
 209 files changed, 183 insertions(+), 52 deletions(-)
 rename arch/arm/boards/animeo_ip/{env => defaultenv-animeo_ip}/config (100%)
 rename arch/arm/boards/at91rm9200ek/{env => defaultenv-at91rm9200ek}/bin/init_board (100%)
 rename arch/arm/boards/at91rm9200ek/{env => defaultenv-at91rm9200ek}/config (100%)
 rename arch/arm/boards/at91sam9260ek/{env => defaultenv-at91sam9260ek}/bin/init_board (100%)
 rename arch/arm/boards/at91sam9260ek/{env => defaultenv-at91sam9260ek}/config (100%)
 rename arch/arm/boards/at91sam9261ek/{env => defaultenv-at91sam9261ek}/bin/init_board (100%)
 rename arch/arm/boards/at91sam9261ek/{env => defaultenv-at91sam9261ek}/config (100%)
 rename arch/arm/boards/at91sam9263ek/{env => defaultenv-at91sam9263ek}/bin/init_board (100%)
 rename arch/arm/boards/at91sam9263ek/{env => defaultenv-at91sam9263ek}/config (100%)
 rename arch/arm/boards/at91sam9m10g45ek/{env => defaultenv-at91sam9m10g45ek}/bin/boot_board (100%)
 rename arch/arm/boards/at91sam9m10g45ek/{env => defaultenv-at91sam9m10g45ek}/bin/menu_boot (100%)
 rename arch/arm/boards/at91sam9m10g45ek/{env => defaultenv-at91sam9m10g45ek}/config (100%)
 rename arch/arm/boards/at91sam9n12ek/{env => defaultenv-at91sam9n12ek}/bin/init_board (100%)
 rename arch/arm/boards/at91sam9n12ek/{env => defaultenv-at91sam9n12ek}/config (100%)
 rename arch/arm/boards/at91sam9x5ek/{env => defaultenv-at91sam9x5ek}/bin/init_board (100%)
 rename arch/arm/boards/at91sam9x5ek/{env => defaultenv-at91sam9x5ek}/config (100%)
 rename arch/arm/boards/eukrea_cpuimx25/{env => defaultenv-eukrea_cpuimx25}/bin/init_board (100%)
 rename arch/arm/boards/eukrea_cpuimx25/{env => defaultenv-eukrea_cpuimx25}/config (100%)
 rename arch/arm/boards/eukrea_cpuimx35/{env => defaultenv-eukrea_cpuimx35}/bin/init_board (100%)
 rename arch/arm/boards/eukrea_cpuimx35/{env => defaultenv-eukrea_cpuimx35}/config (100%)
 rename arch/arm/boards/eukrea_cpuimx51/{env => defaultenv-eukrea_cpuimx51}/bin/init_board (100%)
 rename arch/arm/boards/eukrea_cpuimx51/{env => defaultenv-eukrea_cpuimx51}/config (100%)
 rename arch/arm/boards/freescale-mx25-3ds/{env => defaultenv-freescale-mx25-3ds}/bin/_update (100%)
 rename arch/arm/boards/freescale-mx25-3ds/{env => defaultenv-freescale-mx25-3ds}/bin/boot (100%)
 rename arch/arm/boards/freescale-mx25-3ds/{env => defaultenv-freescale-mx25-3ds}/bin/init (100%)
 rename arch/arm/boards/freescale-mx25-3ds/{env => defaultenv-freescale-mx25-3ds}/bin/update_kernel (100%)
 rename arch/arm/boards/freescale-mx25-3ds/{env => defaultenv-freescale-mx25-3ds}/bin/update_root (100%)
 rename arch/arm/boards/freescale-mx25-3ds/{env => defaultenv-freescale-mx25-3ds}/config (100%)
 rename arch/arm/boards/freescale-mx35-3ds/{env => defaultenv-freescale-mx35-3ds}/config (100%)
 rename arch/arm/boards/freescale-mx53-smd/{env => defaultenv-freescale-mx53-smd}/config (100%)
 rename arch/arm/boards/friendlyarm-mini6410/{env => defaultenv-friendlyarm-mini6410}/config (100%)
 rename arch/arm/boards/friendlyarm-tiny6410/{env => defaultenv-friendlyarm-tiny6410}/config (100%)
 rename arch/arm/boards/guf-cupid/{env => defaultenv-guf-cupid}/config (100%)
 rename arch/arm/boards/guf-neso/{env => defaultenv-guf-neso}/config (100%)
 rename arch/arm/boards/haba-knx/{env => defaultenv-haba-knx}/bin/init_board (100%)
 rename arch/arm/boards/haba-knx/{env => defaultenv-haba-knx}/config (100%)
 rename arch/arm/boards/highbank/{env => defaultenv-highbank}/boot.d/010-ahci-boot (100%)
 rename arch/arm/boards/highbank/{env => defaultenv-highbank}/boot.d/011-ahci (100%)
 rename arch/arm/boards/highbank/{env => defaultenv-highbank}/boot.d/020-mmc-boot (100%)
 rename arch/arm/boards/highbank/{env => defaultenv-highbank}/boot.d/021-mmc (100%)
 rename arch/arm/boards/highbank/{env => defaultenv-highbank}/boot.d/030-net (100%)
 rename arch/arm/boards/highbank/{env => defaultenv-highbank}/boot.d/031-net-eth1 (100%)
 rename arch/arm/boards/highbank/{env => defaultenv-highbank}/boot/ahci (100%)
 rename arch/arm/boards/highbank/{env => defaultenv-highbank}/boot/ahci-boot (100%)
 rename arch/arm/boards/highbank/{env => defaultenv-highbank}/boot/mmc (100%)
 rename arch/arm/boards/highbank/{env => defaultenv-highbank}/boot/mmc-boot (100%)
 rename arch/arm/boards/highbank/{env => defaultenv-highbank}/boot/net (100%)
 rename arch/arm/boards/highbank/{env => defaultenv-highbank}/boot/net-eth1 (100%)
 rename arch/arm/boards/highbank/{env => defaultenv-highbank}/data/oftree (100%)
 rename arch/arm/boards/highbank/{env => defaultenv-highbank}/init/001-dtb-probe (100%)
 rename arch/arm/boards/highbank/{env => defaultenv-highbank}/init/automount (100%)
 rename arch/arm/boards/highbank/{env => defaultenv-highbank}/nv/boot.default (100%)
 rename arch/arm/boards/highbank/{env => defaultenv-highbank}/nv/bootm.oftree (100%)
 rename arch/arm/boards/highbank/{env => defaultenv-highbank}/nv/linux.bootargs.console (100%)
 rename arch/arm/boards/nhk8815/{env => defaultenv-nhk8815}/config (100%)
 rename arch/arm/boards/phytec-phycard-omap4/{env => defaultenv-phytec-phycard-omap4}/bin/nand_bootstrap (100%)
 rename arch/arm/boards/phytec-phycard-omap4/{env => defaultenv-phytec-phycard-omap4}/config (100%)
 rename arch/arm/boards/phytec-phycore-omap4460/{env => defaultenv-phytec-phycore-omap4460}/bin/init_board (100%)
 rename arch/arm/boards/phytec-phycore-omap4460/{env => defaultenv-phytec-phycore-omap4460}/bin/nand_bootstrap (100%)
 rename arch/arm/boards/phytec-phycore-omap4460/{env => defaultenv-phytec-phycore-omap4460}/config (100%)
 rename arch/arm/boards/pm9261/{env => defaultenv-pm9261}/config (100%)
 rename arch/arm/boards/pm9g45/{env => defaultenv-pm9g45}/config (100%)
 rename arch/arm/boards/qemu-virt64/{env => defaultenv-qemu-virt64}/config (100%)
 rename arch/arm/boards/qil-a926x/{env => defaultenv-qil-a926x}/bin/init_board (100%)
 rename arch/arm/boards/qil-a926x/{env => defaultenv-qil-a926x}/config (100%)
 rename arch/arm/boards/sama5d3_xplained/{env => defaultenv-sama5d3_xplained}/config (100%)
 rename arch/arm/boards/sama5d3xek/{env => defaultenv-sama5d3xek}/bin/init_board (100%)
 rename arch/arm/boards/sama5d3xek/{env => defaultenv-sama5d3xek}/config (100%)
 rename arch/arm/boards/scb9328/{env => defaultenv-scb9328}/config (100%)
 rename arch/arm/boards/tny-a926x/{env => defaultenv-tny-a926x}/bin/init_board (100%)
 rename arch/arm/boards/tny-a926x/{env => defaultenv-tny-a926x}/config (100%)
 rename arch/arm/boards/usb-a926x/{env => defaultenv-usb-a926x}/bin/init_board (100%)
 rename arch/arm/boards/usb-a926x/{env => defaultenv-usb-a926x}/config (100%)
 rename arch/arm/boards/vexpress/{env => defaultenv-vexpress}/config (100%)
 rename arch/nios2/boards/generic/{env => defaultenv-generic}/config (100%)
 rename arch/ppc/boards/freescale-p1010rdb/{env => defaultenv-freescale-p1010rdb}/bin/init (100%)
 rename arch/ppc/boards/freescale-p1010rdb/{env => defaultenv-freescale-p1010rdb}/config (100%)
 rename arch/ppc/boards/freescale-p1022ds/{env => defaultenv-freescale-p1022ds}/bin/init (100%)
 rename arch/ppc/boards/freescale-p1022ds/{env => defaultenv-freescale-p1022ds}/config (100%)
 rename arch/ppc/boards/freescale-p2020rdb/{env => defaultenv-freescale-p2020rdb}/bin/init (100%)
 rename arch/ppc/boards/freescale-p2020rdb/{env => defaultenv-freescale-p2020rdb}/config (100%)
 rename arch/ppc/boards/geip-da923rc/{env => defaultenv-geip-da923rc}/bin/boot (100%)
 rename arch/ppc/boards/geip-da923rc/{env => defaultenv-geip-da923rc}/bin/init (100%)
 rename arch/ppc/boards/geip-da923rc/{env => defaultenv-geip-da923rc}/config (100%)

diff --git a/arch/arm/boards/animeo_ip/Makefile b/arch/arm/boards/animeo_ip/Makefile
index eb072c0..510b142 100644
--- a/arch/arm/boards/animeo_ip/Makefile
+++ b/arch/arm/boards/animeo_ip/Makefile
@@ -1 +1,2 @@
 obj-y += init.o
+bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-animeo_ip
diff --git a/arch/arm/boards/animeo_ip/env/config b/arch/arm/boards/animeo_ip/defaultenv-animeo_ip/config
similarity index 100%
rename from arch/arm/boards/animeo_ip/env/config
rename to arch/arm/boards/animeo_ip/defaultenv-animeo_ip/config
diff --git a/arch/arm/boards/animeo_ip/init.c b/arch/arm/boards/animeo_ip/init.c
index 14b33dc..8474173 100644
--- a/arch/arm/boards/animeo_ip/init.c
+++ b/arch/arm/boards/animeo_ip/init.c
@@ -14,6 +14,7 @@
 #include <fs.h>
 #include <fcntl.h>
 #include <io.h>
+#include <envfs.h>
 #include <mach/hardware.h>
 #include <nand.h>
 #include <linux/sizes.h>
@@ -321,6 +322,9 @@ static int animeo_ip_devices_init(void)
 
 	animeo_ip_add_device_eth();
 
+	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
+		defaultenv_append_directory(defaultenv_animeo_ip);
+
 	return 0;
 }
 
diff --git a/arch/arm/boards/at91rm9200ek/Makefile b/arch/arm/boards/at91rm9200ek/Makefile
index eb072c0..dec1c50 100644
--- a/arch/arm/boards/at91rm9200ek/Makefile
+++ b/arch/arm/boards/at91rm9200ek/Makefile
@@ -1 +1,2 @@
 obj-y += init.o
+bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-at91rm9200ek
diff --git a/arch/arm/boards/at91rm9200ek/env/bin/init_board b/arch/arm/boards/at91rm9200ek/defaultenv-at91rm9200ek/bin/init_board
similarity index 100%
rename from arch/arm/boards/at91rm9200ek/env/bin/init_board
rename to arch/arm/boards/at91rm9200ek/defaultenv-at91rm9200ek/bin/init_board
diff --git a/arch/arm/boards/at91rm9200ek/env/config b/arch/arm/boards/at91rm9200ek/defaultenv-at91rm9200ek/config
similarity index 100%
rename from arch/arm/boards/at91rm9200ek/env/config
rename to arch/arm/boards/at91rm9200ek/defaultenv-at91rm9200ek/config
diff --git a/arch/arm/boards/at91rm9200ek/init.c b/arch/arm/boards/at91rm9200ek/init.c
index 43c8b1b..7626786 100644
--- a/arch/arm/boards/at91rm9200ek/init.c
+++ b/arch/arm/boards/at91rm9200ek/init.c
@@ -25,6 +25,7 @@
 #include <gpio.h>
 #include <fcntl.h>
 #include <io.h>
+#include <envfs.h>
 #include <linux/sizes.h>
 #include <mach/hardware.h>
 #include <mach/at91_pmc.h>
@@ -177,6 +178,9 @@ static int at91rm9200ek_devices_init(void)
 
 	armlinux_set_architecture(MACH_TYPE_AT91RM9200EK);
 
+	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
+		defaultenv_append_directory(defaultenv_at91rm9200ek);
+
 	return 0;
 }
 device_initcall(at91rm9200ek_devices_init);
diff --git a/arch/arm/boards/at91sam9260ek/Makefile b/arch/arm/boards/at91sam9260ek/Makefile
index eb072c0..6e07f18 100644
--- a/arch/arm/boards/at91sam9260ek/Makefile
+++ b/arch/arm/boards/at91sam9260ek/Makefile
@@ -1 +1,2 @@
 obj-y += init.o
+bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-at91sam9260ek
diff --git a/arch/arm/boards/at91sam9260ek/env/bin/init_board b/arch/arm/boards/at91sam9260ek/defaultenv-at91sam9260ek/bin/init_board
similarity index 100%
rename from arch/arm/boards/at91sam9260ek/env/bin/init_board
rename to arch/arm/boards/at91sam9260ek/defaultenv-at91sam9260ek/bin/init_board
diff --git a/arch/arm/boards/at91sam9260ek/env/config b/arch/arm/boards/at91sam9260ek/defaultenv-at91sam9260ek/config
similarity index 100%
rename from arch/arm/boards/at91sam9260ek/env/config
rename to arch/arm/boards/at91sam9260ek/defaultenv-at91sam9260ek/config
diff --git a/arch/arm/boards/at91sam9260ek/init.c b/arch/arm/boards/at91sam9260ek/init.c
index 422feb2..5a21ac1 100644
--- a/arch/arm/boards/at91sam9260ek/init.c
+++ b/arch/arm/boards/at91sam9260ek/init.c
@@ -14,6 +14,7 @@
 
 #include <common.h>
 #include <init.h>
+#include <envfs.h>
 #include <environment.h>
 #include <asm/armlinux.h>
 #include <generated/mach-types.h>
@@ -261,6 +262,9 @@ static int at91sam9260ek_devices_init(void)
 	devfs_add_partition("nand0", SZ_512K, SZ_128K, DEVFS_PARTITION_FIXED, "env_raw1");
 	dev_add_bb_dev("env_raw1", "env1");
 
+	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
+		defaultenv_append_directory(defaultenv_at91sam9260ek);
+
 	return 0;
 }
 device_initcall(at91sam9260ek_devices_init);
diff --git a/arch/arm/boards/at91sam9261ek/Makefile b/arch/arm/boards/at91sam9261ek/Makefile
index 1398c26..1764da9 100644
--- a/arch/arm/boards/at91sam9261ek/Makefile
+++ b/arch/arm/boards/at91sam9261ek/Makefile
@@ -1,3 +1,4 @@
 obj-y += init.o
 
 lwl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
+bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-at91sam9261ek
diff --git a/arch/arm/boards/at91sam9261ek/env/bin/init_board b/arch/arm/boards/at91sam9261ek/defaultenv-at91sam9261ek/bin/init_board
similarity index 100%
rename from arch/arm/boards/at91sam9261ek/env/bin/init_board
rename to arch/arm/boards/at91sam9261ek/defaultenv-at91sam9261ek/bin/init_board
diff --git a/arch/arm/boards/at91sam9261ek/env/config b/arch/arm/boards/at91sam9261ek/defaultenv-at91sam9261ek/config
similarity index 100%
rename from arch/arm/boards/at91sam9261ek/env/config
rename to arch/arm/boards/at91sam9261ek/defaultenv-at91sam9261ek/config
diff --git a/arch/arm/boards/at91sam9261ek/init.c b/arch/arm/boards/at91sam9261ek/init.c
index b9e4914..72716b8 100644
--- a/arch/arm/boards/at91sam9261ek/init.c
+++ b/arch/arm/boards/at91sam9261ek/init.c
@@ -17,6 +17,7 @@
 #include <common.h>
 #include <net.h>
 #include <init.h>
+#include <envfs.h>
 #include <environment.h>
 #include <asm/armlinux.h>
 #include <generated/mach-types.h>
@@ -396,6 +397,9 @@ static int at91sam9261ek_devices_init(void)
 	else
 		armlinux_set_architecture(MACH_TYPE_AT91SAM9261EK);
 
+	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
+		defaultenv_append_directory(defaultenv_at91sam9261ek);
+
 	return 0;
 }
 
diff --git a/arch/arm/boards/at91sam9263ek/Makefile b/arch/arm/boards/at91sam9263ek/Makefile
index 1398c26..2072cd4 100644
--- a/arch/arm/boards/at91sam9263ek/Makefile
+++ b/arch/arm/boards/at91sam9263ek/Makefile
@@ -1,3 +1,4 @@
 obj-y += init.o
 
 lwl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
+bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-at91sam9263ek
diff --git a/arch/arm/boards/at91sam9263ek/env/bin/init_board b/arch/arm/boards/at91sam9263ek/defaultenv-at91sam9263ek/bin/init_board
similarity index 100%
rename from arch/arm/boards/at91sam9263ek/env/bin/init_board
rename to arch/arm/boards/at91sam9263ek/defaultenv-at91sam9263ek/bin/init_board
diff --git a/arch/arm/boards/at91sam9263ek/env/config b/arch/arm/boards/at91sam9263ek/defaultenv-at91sam9263ek/config
similarity index 100%
rename from arch/arm/boards/at91sam9263ek/env/config
rename to arch/arm/boards/at91sam9263ek/defaultenv-at91sam9263ek/config
diff --git a/arch/arm/boards/at91sam9263ek/init.c b/arch/arm/boards/at91sam9263ek/init.c
index 3bb2dda..682449b 100644
--- a/arch/arm/boards/at91sam9263ek/init.c
+++ b/arch/arm/boards/at91sam9263ek/init.c
@@ -19,6 +19,7 @@
 #include <common.h>
 #include <net.h>
 #include <init.h>
+#include <envfs.h>
 #include <environment.h>
 #include <asm/armlinux.h>
 #include <generated/mach-types.h>
@@ -273,6 +274,9 @@ static int at91sam9263ek_devices_init(void)
 
 	armlinux_set_architecture(MACH_TYPE_AT91SAM9263EK);
 
+	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
+		defaultenv_append_directory(defaultenv_at91sam9263ek);
+
 	return 0;
 }
 
diff --git a/arch/arm/boards/at91sam9m10g45ek/Makefile b/arch/arm/boards/at91sam9m10g45ek/Makefile
index eb072c0..dd80521 100644
--- a/arch/arm/boards/at91sam9m10g45ek/Makefile
+++ b/arch/arm/boards/at91sam9m10g45ek/Makefile
@@ -1 +1,2 @@
 obj-y += init.o
+bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-at91sam9m10g45ek
diff --git a/arch/arm/boards/at91sam9m10g45ek/env/bin/boot_board b/arch/arm/boards/at91sam9m10g45ek/defaultenv-at91sam9m10g45ek/bin/boot_board
similarity index 100%
rename from arch/arm/boards/at91sam9m10g45ek/env/bin/boot_board
rename to arch/arm/boards/at91sam9m10g45ek/defaultenv-at91sam9m10g45ek/bin/boot_board
diff --git a/arch/arm/boards/at91sam9m10g45ek/env/bin/menu_boot b/arch/arm/boards/at91sam9m10g45ek/defaultenv-at91sam9m10g45ek/bin/menu_boot
similarity index 100%
rename from arch/arm/boards/at91sam9m10g45ek/env/bin/menu_boot
rename to arch/arm/boards/at91sam9m10g45ek/defaultenv-at91sam9m10g45ek/bin/menu_boot
diff --git a/arch/arm/boards/at91sam9m10g45ek/env/config b/arch/arm/boards/at91sam9m10g45ek/defaultenv-at91sam9m10g45ek/config
similarity index 100%
rename from arch/arm/boards/at91sam9m10g45ek/env/config
rename to arch/arm/boards/at91sam9m10g45ek/defaultenv-at91sam9m10g45ek/config
diff --git a/arch/arm/boards/at91sam9m10g45ek/init.c b/arch/arm/boards/at91sam9m10g45ek/init.c
index fb444d8..ee69263 100644
--- a/arch/arm/boards/at91sam9m10g45ek/init.c
+++ b/arch/arm/boards/at91sam9m10g45ek/init.c
@@ -21,6 +21,7 @@
 #include <mci.h>
 #include <init.h>
 #include <gpio.h>
+#include <envfs.h>
 #include <environment.h>
 #include <asm/armlinux.h>
 #include <generated/mach-types.h>
@@ -321,6 +322,9 @@ static int at91sam9m10g45ek_devices_init(void)
 	armlinux_set_architecture(MACH_TYPE_AT91SAM9M10G45EK);
 	ek_set_board_revision();
 
+	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
+		defaultenv_append_directory(defaultenv_at91sam9m10g45ek);
+
 	return 0;
 }
 device_initcall(at91sam9m10g45ek_devices_init);
diff --git a/arch/arm/boards/at91sam9n12ek/Makefile b/arch/arm/boards/at91sam9n12ek/Makefile
index eb072c0..f5d125a 100644
--- a/arch/arm/boards/at91sam9n12ek/Makefile
+++ b/arch/arm/boards/at91sam9n12ek/Makefile
@@ -1 +1,2 @@
 obj-y += init.o
+bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-at91sam9n12ek
diff --git a/arch/arm/boards/at91sam9n12ek/env/bin/init_board b/arch/arm/boards/at91sam9n12ek/defaultenv-at91sam9n12ek/bin/init_board
similarity index 100%
rename from arch/arm/boards/at91sam9n12ek/env/bin/init_board
rename to arch/arm/boards/at91sam9n12ek/defaultenv-at91sam9n12ek/bin/init_board
diff --git a/arch/arm/boards/at91sam9n12ek/env/config b/arch/arm/boards/at91sam9n12ek/defaultenv-at91sam9n12ek/config
similarity index 100%
rename from arch/arm/boards/at91sam9n12ek/env/config
rename to arch/arm/boards/at91sam9n12ek/defaultenv-at91sam9n12ek/config
diff --git a/arch/arm/boards/at91sam9n12ek/init.c b/arch/arm/boards/at91sam9n12ek/init.c
index 2ed58c1..b9431b2 100644
--- a/arch/arm/boards/at91sam9n12ek/init.c
+++ b/arch/arm/boards/at91sam9n12ek/init.c
@@ -24,6 +24,7 @@
 #include <fs.h>
 #include <fcntl.h>
 #include <io.h>
+#include <envfs.h>
 #include <mach/hardware.h>
 #include <nand.h>
 #include <linux/sizes.h>
@@ -327,6 +328,9 @@ static int at91sam9n12ek_devices_init(void)
 	devfs_add_partition("nand0", SZ_512K + SZ_256K, SZ_128K, DEVFS_PARTITION_FIXED, "env_raw1");
 	dev_add_bb_dev("env_raw1", "env1");
 
+	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
+		defaultenv_append_directory(defaultenv_at91sam9n12ek);
+
 	return 0;
 }
 device_initcall(at91sam9n12ek_devices_init);
diff --git a/arch/arm/boards/at91sam9x5ek/Makefile b/arch/arm/boards/at91sam9x5ek/Makefile
index f2acf20..559df8f 100644
--- a/arch/arm/boards/at91sam9x5ek/Makefile
+++ b/arch/arm/boards/at91sam9x5ek/Makefile
@@ -1,2 +1,3 @@
 obj-y += init.o
 obj-y += hw_version.o
+bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-at91sam9x5ek
diff --git a/arch/arm/boards/at91sam9x5ek/env/bin/init_board b/arch/arm/boards/at91sam9x5ek/defaultenv-at91sam9x5ek/bin/init_board
similarity index 100%
rename from arch/arm/boards/at91sam9x5ek/env/bin/init_board
rename to arch/arm/boards/at91sam9x5ek/defaultenv-at91sam9x5ek/bin/init_board
diff --git a/arch/arm/boards/at91sam9x5ek/env/config b/arch/arm/boards/at91sam9x5ek/defaultenv-at91sam9x5ek/config
similarity index 100%
rename from arch/arm/boards/at91sam9x5ek/env/config
rename to arch/arm/boards/at91sam9x5ek/defaultenv-at91sam9x5ek/config
diff --git a/arch/arm/boards/at91sam9x5ek/init.c b/arch/arm/boards/at91sam9x5ek/init.c
index 1ef3580..9fe117c 100644
--- a/arch/arm/boards/at91sam9x5ek/init.c
+++ b/arch/arm/boards/at91sam9x5ek/init.c
@@ -24,6 +24,7 @@
 #include <fs.h>
 #include <fcntl.h>
 #include <io.h>
+#include <envfs.h>
 #include <mach/hardware.h>
 #include <nand.h>
 #include <linux/sizes.h>
@@ -320,6 +321,9 @@ static int at91sam9x5ek_devices_init(void)
 	devfs_add_partition("nand0", SZ_512K + SZ_256K, SZ_128K, DEVFS_PARTITION_FIXED, "env_raw1");
 	dev_add_bb_dev("env_raw1", "env1");
 
+	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
+		defaultenv_append_directory(defaultenv_at91sam9x5ek);
+
 	return 0;
 }
 device_initcall(at91sam9x5ek_devices_init);
diff --git a/arch/arm/boards/eukrea_cpuimx25/Makefile b/arch/arm/boards/eukrea_cpuimx25/Makefile
index 4f08476..159701d 100644
--- a/arch/arm/boards/eukrea_cpuimx25/Makefile
+++ b/arch/arm/boards/eukrea_cpuimx25/Makefile
@@ -18,3 +18,4 @@
 
 obj-y += eukrea_cpuimx25.o
 lwl-y += lowlevel.o
+bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-eukrea_cpuimx25
diff --git a/arch/arm/boards/eukrea_cpuimx25/env/bin/init_board b/arch/arm/boards/eukrea_cpuimx25/defaultenv-eukrea_cpuimx25/bin/init_board
similarity index 100%
rename from arch/arm/boards/eukrea_cpuimx25/env/bin/init_board
rename to arch/arm/boards/eukrea_cpuimx25/defaultenv-eukrea_cpuimx25/bin/init_board
diff --git a/arch/arm/boards/eukrea_cpuimx25/env/config b/arch/arm/boards/eukrea_cpuimx25/defaultenv-eukrea_cpuimx25/config
similarity index 100%
rename from arch/arm/boards/eukrea_cpuimx25/env/config
rename to arch/arm/boards/eukrea_cpuimx25/defaultenv-eukrea_cpuimx25/config
diff --git a/arch/arm/boards/eukrea_cpuimx25/eukrea_cpuimx25.c b/arch/arm/boards/eukrea_cpuimx25/eukrea_cpuimx25.c
index 9045191..25bf40c 100644
--- a/arch/arm/boards/eukrea_cpuimx25/eukrea_cpuimx25.c
+++ b/arch/arm/boards/eukrea_cpuimx25/eukrea_cpuimx25.c
@@ -30,6 +30,7 @@
 #include <io.h>
 #include <asm/mmu.h>
 #include <led.h>
+#include <envfs.h>
 
 #include <partition.h>
 #include <generated/mach-types.h>
@@ -216,6 +217,9 @@ static int eukrea_cpuimx25_devices_init(void)
 
 	armlinux_set_architecture(MACH_TYPE_EUKREA_CPUIMX25SD);
 
+	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
+		defaultenv_append_directory(defaultenv_eukrea_cpuimx25);
+
 	return 0;
 }
 
diff --git a/arch/arm/boards/eukrea_cpuimx35/Makefile b/arch/arm/boards/eukrea_cpuimx35/Makefile
index 060f3b1..3ef2c4e 100644
--- a/arch/arm/boards/eukrea_cpuimx35/Makefile
+++ b/arch/arm/boards/eukrea_cpuimx35/Makefile
@@ -18,3 +18,4 @@
 
 obj-y					+= eukrea_cpuimx35.o
 lwl-y					+= lowlevel.o
+bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-eukrea_cpuimx35
diff --git a/arch/arm/boards/eukrea_cpuimx35/env/bin/init_board b/arch/arm/boards/eukrea_cpuimx35/defaultenv-eukrea_cpuimx35/bin/init_board
similarity index 100%
rename from arch/arm/boards/eukrea_cpuimx35/env/bin/init_board
rename to arch/arm/boards/eukrea_cpuimx35/defaultenv-eukrea_cpuimx35/bin/init_board
diff --git a/arch/arm/boards/eukrea_cpuimx35/env/config b/arch/arm/boards/eukrea_cpuimx35/defaultenv-eukrea_cpuimx35/config
similarity index 100%
rename from arch/arm/boards/eukrea_cpuimx35/env/config
rename to arch/arm/boards/eukrea_cpuimx35/defaultenv-eukrea_cpuimx35/config
diff --git a/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c b/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c
index 04ef9b2..a107637 100644
--- a/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c
+++ b/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c
@@ -34,6 +34,7 @@
 #include <net.h>
 #include <partition.h>
 #include <gpio.h>
+#include <envfs.h>
 
 #include <asm/armlinux.h>
 #include <io.h>
@@ -212,6 +213,9 @@ static int eukrea_cpuimx35_devices_init(void)
 #endif
 	armlinux_set_architecture(MACH_TYPE_EUKREA_CPUIMX35SD);
 
+	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
+		defaultenv_append_directory(defaultenv_eukrea_cpuimx35);
+
 	return 0;
 }
 
diff --git a/arch/arm/boards/eukrea_cpuimx51/Makefile b/arch/arm/boards/eukrea_cpuimx51/Makefile
index 96e26d0..e8c84fe 100644
--- a/arch/arm/boards/eukrea_cpuimx51/Makefile
+++ b/arch/arm/boards/eukrea_cpuimx51/Makefile
@@ -1,2 +1,3 @@
 obj-y += eukrea_cpuimx51.o
 lwl-y += lowlevel.o
+bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-eukrea_cpuimx51
diff --git a/arch/arm/boards/eukrea_cpuimx51/env/bin/init_board b/arch/arm/boards/eukrea_cpuimx51/defaultenv-eukrea_cpuimx51/bin/init_board
similarity index 100%
rename from arch/arm/boards/eukrea_cpuimx51/env/bin/init_board
rename to arch/arm/boards/eukrea_cpuimx51/defaultenv-eukrea_cpuimx51/bin/init_board
diff --git a/arch/arm/boards/eukrea_cpuimx51/env/config b/arch/arm/boards/eukrea_cpuimx51/defaultenv-eukrea_cpuimx51/config
similarity index 100%
rename from arch/arm/boards/eukrea_cpuimx51/env/config
rename to arch/arm/boards/eukrea_cpuimx51/defaultenv-eukrea_cpuimx51/config
diff --git a/arch/arm/boards/eukrea_cpuimx51/eukrea_cpuimx51.c b/arch/arm/boards/eukrea_cpuimx51/eukrea_cpuimx51.c
index fc57f6c..bb493d7 100644
--- a/arch/arm/boards/eukrea_cpuimx51/eukrea_cpuimx51.c
+++ b/arch/arm/boards/eukrea_cpuimx51/eukrea_cpuimx51.c
@@ -26,6 +26,7 @@
 #include <generated/mach-types.h>
 #include <partition.h>
 #include <fs.h>
+#include <envfs.h>
 #include <fcntl.h>
 #include <nand.h>
 #include <spi/spi.h>
@@ -122,6 +123,9 @@ static int eukrea_cpuimx51_devices_init(void)
 
 	armlinux_set_architecture(MACH_TYPE_EUKREA_CPUIMX51SD);
 
+	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
+		defaultenv_append_directory(defaultenv_eukrea_cpuimx51);
+
 	return 0;
 }
 
diff --git a/arch/arm/boards/freescale-mx25-3ds/3stack.c b/arch/arm/boards/freescale-mx25-3ds/3stack.c
index 36ad591..3ab8c4a 100644
--- a/arch/arm/boards/freescale-mx25-3ds/3stack.c
+++ b/arch/arm/boards/freescale-mx25-3ds/3stack.c
@@ -27,6 +27,7 @@
 #include <asm/sections.h>
 #include <asm/barebox-arm.h>
 #include <io.h>
+#include <envfs.h>
 #include <partition.h>
 #include <generated/mach-types.h>
 #include <mach/imx-nand.h>
@@ -156,6 +157,9 @@ static int imx25_3ds_devices_init(void)
 	armlinux_set_architecture(MACH_TYPE_MX25_3DS);
 	armlinux_set_serial(imx_uid());
 
+	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
+		defaultenv_append_directory(defaultenv_freescale_mx25_3ds);
+
 	return 0;
 }
 
diff --git a/arch/arm/boards/freescale-mx25-3ds/Makefile b/arch/arm/boards/freescale-mx25-3ds/Makefile
index 52c416e..20787ef 100644
--- a/arch/arm/boards/freescale-mx25-3ds/Makefile
+++ b/arch/arm/boards/freescale-mx25-3ds/Makefile
@@ -18,3 +18,4 @@
 
 lwl-y += lowlevel_init.o
 obj-y += 3stack.o
+bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-freescale-mx25-3ds
diff --git a/arch/arm/boards/freescale-mx25-3ds/env/bin/_update b/arch/arm/boards/freescale-mx25-3ds/defaultenv-freescale-mx25-3ds/bin/_update
similarity index 100%
rename from arch/arm/boards/freescale-mx25-3ds/env/bin/_update
rename to arch/arm/boards/freescale-mx25-3ds/defaultenv-freescale-mx25-3ds/bin/_update
diff --git a/arch/arm/boards/freescale-mx25-3ds/env/bin/boot b/arch/arm/boards/freescale-mx25-3ds/defaultenv-freescale-mx25-3ds/bin/boot
similarity index 100%
rename from arch/arm/boards/freescale-mx25-3ds/env/bin/boot
rename to arch/arm/boards/freescale-mx25-3ds/defaultenv-freescale-mx25-3ds/bin/boot
diff --git a/arch/arm/boards/freescale-mx25-3ds/env/bin/init b/arch/arm/boards/freescale-mx25-3ds/defaultenv-freescale-mx25-3ds/bin/init
similarity index 100%
rename from arch/arm/boards/freescale-mx25-3ds/env/bin/init
rename to arch/arm/boards/freescale-mx25-3ds/defaultenv-freescale-mx25-3ds/bin/init
diff --git a/arch/arm/boards/freescale-mx25-3ds/env/bin/update_kernel b/arch/arm/boards/freescale-mx25-3ds/defaultenv-freescale-mx25-3ds/bin/update_kernel
similarity index 100%
rename from arch/arm/boards/freescale-mx25-3ds/env/bin/update_kernel
rename to arch/arm/boards/freescale-mx25-3ds/defaultenv-freescale-mx25-3ds/bin/update_kernel
diff --git a/arch/arm/boards/freescale-mx25-3ds/env/bin/update_root b/arch/arm/boards/freescale-mx25-3ds/defaultenv-freescale-mx25-3ds/bin/update_root
similarity index 100%
rename from arch/arm/boards/freescale-mx25-3ds/env/bin/update_root
rename to arch/arm/boards/freescale-mx25-3ds/defaultenv-freescale-mx25-3ds/bin/update_root
diff --git a/arch/arm/boards/freescale-mx25-3ds/env/config b/arch/arm/boards/freescale-mx25-3ds/defaultenv-freescale-mx25-3ds/config
similarity index 100%
rename from arch/arm/boards/freescale-mx25-3ds/env/config
rename to arch/arm/boards/freescale-mx25-3ds/defaultenv-freescale-mx25-3ds/config
diff --git a/arch/arm/boards/freescale-mx35-3ds/3stack.c b/arch/arm/boards/freescale-mx35-3ds/3stack.c
index caeb3f7..97a9968 100644
--- a/arch/arm/boards/freescale-mx35-3ds/3stack.c
+++ b/arch/arm/boards/freescale-mx35-3ds/3stack.c
@@ -30,6 +30,7 @@
 #include <init.h>
 #include <nand.h>
 #include <net.h>
+#include <envfs.h>
 #include <linux/sizes.h>
 #include <partition.h>
 #include <gpio.h>
@@ -208,6 +209,9 @@ static int f3s_devices_init(void)
 
 	armlinux_set_architecture(MACH_TYPE_MX35_3DS);
 
+	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
+		defaultenv_append_directory(defaultenv_freescale_mx35_3ds);
+
 	return 0;
 }
 
diff --git a/arch/arm/boards/freescale-mx35-3ds/Makefile b/arch/arm/boards/freescale-mx35-3ds/Makefile
index c0de068..c192854 100644
--- a/arch/arm/boards/freescale-mx35-3ds/Makefile
+++ b/arch/arm/boards/freescale-mx35-3ds/Makefile
@@ -1,2 +1,3 @@
 obj-y					+= 3stack.o
 lwl-y					+= lowlevel_init.o
+bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-freescale-mx35-3ds
diff --git a/arch/arm/boards/freescale-mx35-3ds/env/config b/arch/arm/boards/freescale-mx35-3ds/defaultenv-freescale-mx35-3ds/config
similarity index 100%
rename from arch/arm/boards/freescale-mx35-3ds/env/config
rename to arch/arm/boards/freescale-mx35-3ds/defaultenv-freescale-mx35-3ds/config
diff --git a/arch/arm/boards/freescale-mx53-smd/Makefile b/arch/arm/boards/freescale-mx53-smd/Makefile
index 01c7a25..98ed275 100644
--- a/arch/arm/boards/freescale-mx53-smd/Makefile
+++ b/arch/arm/boards/freescale-mx53-smd/Makefile
@@ -1,2 +1,3 @@
 obj-y += board.o
 lwl-y += lowlevel.o
+bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-freescale-mx53-smd
diff --git a/arch/arm/boards/freescale-mx53-smd/board.c b/arch/arm/boards/freescale-mx53-smd/board.c
index 5dbeeb1..2b58f49 100644
--- a/arch/arm/boards/freescale-mx53-smd/board.c
+++ b/arch/arm/boards/freescale-mx53-smd/board.c
@@ -26,6 +26,7 @@
 #include <linux/sizes.h>
 #include <gpio.h>
 #include <mci.h>
+#include <envfs.h>
 
 #include <generated/mach-types.h>
 
@@ -135,6 +136,9 @@ static int smd_devices_init(void)
 
 	armlinux_set_architecture(MACH_TYPE_MX53_SMD);
 
+	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
+		defaultenv_append_directory(defaultenv_freescale_mx53_smd);
+
 	return 0;
 }
 device_initcall(smd_devices_init);
diff --git a/arch/arm/boards/freescale-mx53-smd/env/config b/arch/arm/boards/freescale-mx53-smd/defaultenv-freescale-mx53-smd/config
similarity index 100%
rename from arch/arm/boards/freescale-mx53-smd/env/config
rename to arch/arm/boards/freescale-mx53-smd/defaultenv-freescale-mx53-smd/config
diff --git a/arch/arm/boards/friendlyarm-mini6410/Makefile b/arch/arm/boards/friendlyarm-mini6410/Makefile
index 0710d39..c04150e 100644
--- a/arch/arm/boards/friendlyarm-mini6410/Makefile
+++ b/arch/arm/boards/friendlyarm-mini6410/Makefile
@@ -1,2 +1,3 @@
 obj-y += mini6410.o
 lwl-y += lowlevel.o
+bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-friendlyarm-mini6410
diff --git a/arch/arm/boards/friendlyarm-mini6410/env/config b/arch/arm/boards/friendlyarm-mini6410/defaultenv-friendlyarm-mini6410/config
similarity index 100%
rename from arch/arm/boards/friendlyarm-mini6410/env/config
rename to arch/arm/boards/friendlyarm-mini6410/defaultenv-friendlyarm-mini6410/config
diff --git a/arch/arm/boards/friendlyarm-mini6410/mini6410.c b/arch/arm/boards/friendlyarm-mini6410/mini6410.c
index a85b1bd..90fb3f5 100644
--- a/arch/arm/boards/friendlyarm-mini6410/mini6410.c
+++ b/arch/arm/boards/friendlyarm-mini6410/mini6410.c
@@ -16,6 +16,7 @@
 #include <init.h>
 #include <platform_data/eth-dm9000.h>
 #include <gpio.h>
+#include <envfs.h>
 #include <generated/mach-types.h>
 #include <asm/armlinux.h>
 #include <mach/s3c-iomap.h>
@@ -285,6 +286,9 @@ static int mini6410_devices_init(void)
 
 	armlinux_set_architecture(MACH_TYPE_MINI6410);
 
+	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
+		defaultenv_append_directory(defaultenv_friendlyarm_mini6410);
+
 	return 0;
 }
 
diff --git a/arch/arm/boards/friendlyarm-tiny6410/Makefile b/arch/arm/boards/friendlyarm-tiny6410/Makefile
index bf17eaa..ba3f336 100644
--- a/arch/arm/boards/friendlyarm-tiny6410/Makefile
+++ b/arch/arm/boards/friendlyarm-tiny6410/Makefile
@@ -1,3 +1,4 @@
 obj-y += tiny6410.o
 lwl-y += lowlevel.o
 lwl-$(CONFIG_MACH_TINY6410_FA) += development-board.o
+bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-friendlyarm-tiny6410
diff --git a/arch/arm/boards/friendlyarm-tiny6410/env/config b/arch/arm/boards/friendlyarm-tiny6410/defaultenv-friendlyarm-tiny6410/config
similarity index 100%
rename from arch/arm/boards/friendlyarm-tiny6410/env/config
rename to arch/arm/boards/friendlyarm-tiny6410/defaultenv-friendlyarm-tiny6410/config
diff --git a/arch/arm/boards/guf-cupid/Makefile b/arch/arm/boards/guf-cupid/Makefile
index b33952c..eaf2a4f 100644
--- a/arch/arm/boards/guf-cupid/Makefile
+++ b/arch/arm/boards/guf-cupid/Makefile
@@ -18,3 +18,4 @@
 
 lwl-y += lowlevel.o
 obj-y += board.o
+bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-guf-cupid
diff --git a/arch/arm/boards/guf-cupid/board.c b/arch/arm/boards/guf-cupid/board.c
index d1b285c..a02cecf 100644
--- a/arch/arm/boards/guf-cupid/board.c
+++ b/arch/arm/boards/guf-cupid/board.c
@@ -25,6 +25,7 @@
 #include <driver.h>
 #include <environment.h>
 #include <fs.h>
+#include <envfs.h>
 #include <mach/imx35-regs.h>
 #include <asm/armlinux.h>
 #include <io.h>
@@ -128,6 +129,9 @@ static int cupid_devices_init(void)
 
 	armlinux_set_architecture(MACH_TYPE_GUF_CUPID);
 
+	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
+		defaultenv_append_directory(defaultenv_guf_cupid);
+
 	return 0;
 }
 
diff --git a/arch/arm/boards/guf-cupid/env/config b/arch/arm/boards/guf-cupid/defaultenv-guf-cupid/config
similarity index 100%
rename from arch/arm/boards/guf-cupid/env/config
rename to arch/arm/boards/guf-cupid/defaultenv-guf-cupid/config
diff --git a/arch/arm/boards/guf-neso/Makefile b/arch/arm/boards/guf-neso/Makefile
index 81263cc..af90c36 100644
--- a/arch/arm/boards/guf-neso/Makefile
+++ b/arch/arm/boards/guf-neso/Makefile
@@ -1,3 +1,4 @@
 lwl-y += lowlevel.o
 obj-y += board.o
 obj-y += pll_init.o
+bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-guf-neso
diff --git a/arch/arm/boards/guf-neso/board.c b/arch/arm/boards/guf-neso/board.c
index 176d77e..e1cd909 100644
--- a/arch/arm/boards/guf-neso/board.c
+++ b/arch/arm/boards/guf-neso/board.c
@@ -23,6 +23,7 @@
 #include <partition.h>
 #include <gpio.h>
 #include <fs.h>
+#include <envfs.h>
 #include <fcntl.h>
 #include <nand.h>
 #include <command.h>
@@ -282,6 +283,9 @@ static int neso_devices_init(void)
 
 	armlinux_set_architecture(MACH_TYPE_NESO);
 
+	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
+		defaultenv_append_directory(defaultenv_guf_neso);
+
 	return 0;
 }
 
diff --git a/arch/arm/boards/guf-neso/env/config b/arch/arm/boards/guf-neso/defaultenv-guf-neso/config
similarity index 100%
rename from arch/arm/boards/guf-neso/env/config
rename to arch/arm/boards/guf-neso/defaultenv-guf-neso/config
diff --git a/arch/arm/boards/haba-knx/Makefile b/arch/arm/boards/haba-knx/Makefile
index eb072c0..d9db6ab 100644
--- a/arch/arm/boards/haba-knx/Makefile
+++ b/arch/arm/boards/haba-knx/Makefile
@@ -1 +1,2 @@
 obj-y += init.o
+bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-haba-knx
diff --git a/arch/arm/boards/haba-knx/env/bin/init_board b/arch/arm/boards/haba-knx/defaultenv-haba-knx/bin/init_board
similarity index 100%
rename from arch/arm/boards/haba-knx/env/bin/init_board
rename to arch/arm/boards/haba-knx/defaultenv-haba-knx/bin/init_board
diff --git a/arch/arm/boards/haba-knx/env/config b/arch/arm/boards/haba-knx/defaultenv-haba-knx/config
similarity index 100%
rename from arch/arm/boards/haba-knx/env/config
rename to arch/arm/boards/haba-knx/defaultenv-haba-knx/config
diff --git a/arch/arm/boards/haba-knx/init.c b/arch/arm/boards/haba-knx/init.c
index f9d8f0f..36f1e8b 100644
--- a/arch/arm/boards/haba-knx/init.c
+++ b/arch/arm/boards/haba-knx/init.c
@@ -25,6 +25,7 @@
 #include <fs.h>
 #include <fcntl.h>
 #include <io.h>
+#include <envfs.h>
 #include <mach/hardware.h>
 #include <nand.h>
 #include <linux/sizes.h>
@@ -323,6 +324,9 @@ static int haba_knx_devices_init(void)
 
 	devfs_create_partitions("nand0", haba_knx_nand0_partitions);
 
+	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
+		defaultenv_append_directory(defaultenv_haba_knx);
+
 	return 0;
 }
 device_initcall(haba_knx_devices_init);
diff --git a/arch/arm/boards/highbank/Makefile b/arch/arm/boards/highbank/Makefile
index e11fd5b..e5e4536 100644
--- a/arch/arm/boards/highbank/Makefile
+++ b/arch/arm/boards/highbank/Makefile
@@ -1,3 +1,4 @@
 obj-y += init.o
 
 lwl-y += lowlevel.o
+bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-highbank
diff --git a/arch/arm/boards/highbank/env/boot.d/010-ahci-boot b/arch/arm/boards/highbank/defaultenv-highbank/boot.d/010-ahci-boot
similarity index 100%
rename from arch/arm/boards/highbank/env/boot.d/010-ahci-boot
rename to arch/arm/boards/highbank/defaultenv-highbank/boot.d/010-ahci-boot
diff --git a/arch/arm/boards/highbank/env/boot.d/011-ahci b/arch/arm/boards/highbank/defaultenv-highbank/boot.d/011-ahci
similarity index 100%
rename from arch/arm/boards/highbank/env/boot.d/011-ahci
rename to arch/arm/boards/highbank/defaultenv-highbank/boot.d/011-ahci
diff --git a/arch/arm/boards/highbank/env/boot.d/020-mmc-boot b/arch/arm/boards/highbank/defaultenv-highbank/boot.d/020-mmc-boot
similarity index 100%
rename from arch/arm/boards/highbank/env/boot.d/020-mmc-boot
rename to arch/arm/boards/highbank/defaultenv-highbank/boot.d/020-mmc-boot
diff --git a/arch/arm/boards/highbank/env/boot.d/021-mmc b/arch/arm/boards/highbank/defaultenv-highbank/boot.d/021-mmc
similarity index 100%
rename from arch/arm/boards/highbank/env/boot.d/021-mmc
rename to arch/arm/boards/highbank/defaultenv-highbank/boot.d/021-mmc
diff --git a/arch/arm/boards/highbank/env/boot.d/030-net b/arch/arm/boards/highbank/defaultenv-highbank/boot.d/030-net
similarity index 100%
rename from arch/arm/boards/highbank/env/boot.d/030-net
rename to arch/arm/boards/highbank/defaultenv-highbank/boot.d/030-net
diff --git a/arch/arm/boards/highbank/env/boot.d/031-net-eth1 b/arch/arm/boards/highbank/defaultenv-highbank/boot.d/031-net-eth1
similarity index 100%
rename from arch/arm/boards/highbank/env/boot.d/031-net-eth1
rename to arch/arm/boards/highbank/defaultenv-highbank/boot.d/031-net-eth1
diff --git a/arch/arm/boards/highbank/env/boot/ahci b/arch/arm/boards/highbank/defaultenv-highbank/boot/ahci
similarity index 100%
rename from arch/arm/boards/highbank/env/boot/ahci
rename to arch/arm/boards/highbank/defaultenv-highbank/boot/ahci
diff --git a/arch/arm/boards/highbank/env/boot/ahci-boot b/arch/arm/boards/highbank/defaultenv-highbank/boot/ahci-boot
similarity index 100%
rename from arch/arm/boards/highbank/env/boot/ahci-boot
rename to arch/arm/boards/highbank/defaultenv-highbank/boot/ahci-boot
diff --git a/arch/arm/boards/highbank/env/boot/mmc b/arch/arm/boards/highbank/defaultenv-highbank/boot/mmc
similarity index 100%
rename from arch/arm/boards/highbank/env/boot/mmc
rename to arch/arm/boards/highbank/defaultenv-highbank/boot/mmc
diff --git a/arch/arm/boards/highbank/env/boot/mmc-boot b/arch/arm/boards/highbank/defaultenv-highbank/boot/mmc-boot
similarity index 100%
rename from arch/arm/boards/highbank/env/boot/mmc-boot
rename to arch/arm/boards/highbank/defaultenv-highbank/boot/mmc-boot
diff --git a/arch/arm/boards/highbank/env/boot/net b/arch/arm/boards/highbank/defaultenv-highbank/boot/net
similarity index 100%
rename from arch/arm/boards/highbank/env/boot/net
rename to arch/arm/boards/highbank/defaultenv-highbank/boot/net
diff --git a/arch/arm/boards/highbank/env/boot/net-eth1 b/arch/arm/boards/highbank/defaultenv-highbank/boot/net-eth1
similarity index 100%
rename from arch/arm/boards/highbank/env/boot/net-eth1
rename to arch/arm/boards/highbank/defaultenv-highbank/boot/net-eth1
diff --git a/arch/arm/boards/highbank/env/data/oftree b/arch/arm/boards/highbank/defaultenv-highbank/data/oftree
similarity index 100%
rename from arch/arm/boards/highbank/env/data/oftree
rename to arch/arm/boards/highbank/defaultenv-highbank/data/oftree
diff --git a/arch/arm/boards/highbank/env/init/001-dtb-probe b/arch/arm/boards/highbank/defaultenv-highbank/init/001-dtb-probe
similarity index 100%
rename from arch/arm/boards/highbank/env/init/001-dtb-probe
rename to arch/arm/boards/highbank/defaultenv-highbank/init/001-dtb-probe
diff --git a/arch/arm/boards/highbank/env/init/automount b/arch/arm/boards/highbank/defaultenv-highbank/init/automount
similarity index 100%
rename from arch/arm/boards/highbank/env/init/automount
rename to arch/arm/boards/highbank/defaultenv-highbank/init/automount
diff --git a/arch/arm/boards/highbank/env/nv/boot.default b/arch/arm/boards/highbank/defaultenv-highbank/nv/boot.default
similarity index 100%
rename from arch/arm/boards/highbank/env/nv/boot.default
rename to arch/arm/boards/highbank/defaultenv-highbank/nv/boot.default
diff --git a/arch/arm/boards/highbank/env/nv/bootm.oftree b/arch/arm/boards/highbank/defaultenv-highbank/nv/bootm.oftree
similarity index 100%
rename from arch/arm/boards/highbank/env/nv/bootm.oftree
rename to arch/arm/boards/highbank/defaultenv-highbank/nv/bootm.oftree
diff --git a/arch/arm/boards/highbank/env/nv/linux.bootargs.console b/arch/arm/boards/highbank/defaultenv-highbank/nv/linux.bootargs.console
similarity index 100%
rename from arch/arm/boards/highbank/env/nv/linux.bootargs.console
rename to arch/arm/boards/highbank/defaultenv-highbank/nv/linux.bootargs.console
diff --git a/arch/arm/boards/highbank/init.c b/arch/arm/boards/highbank/init.c
index 295d475..577ccc0 100644
--- a/arch/arm/boards/highbank/init.c
+++ b/arch/arm/boards/highbank/init.c
@@ -17,6 +17,7 @@
 #include <linux/sizes.h>
 #include <io.h>
 #include <of.h>
+#include <envfs.h>
 
 #define FIRMWARE_DTB_BASE	0x1000
 
@@ -126,6 +127,9 @@ static int highbank_devices_init(void)
 
 	devfs_add_partition("nvram", 0x00000, SZ_16K, DEVFS_PARTITION_FIXED, "env0");
 
+	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
+		defaultenv_append_directory(defaultenv_highbank);
+
 	return 0;
 }
 device_initcall(highbank_devices_init);
diff --git a/arch/arm/boards/nhk8815/Makefile b/arch/arm/boards/nhk8815/Makefile
index f429852..56f2013 100644
--- a/arch/arm/boards/nhk8815/Makefile
+++ b/arch/arm/boards/nhk8815/Makefile
@@ -1,2 +1,3 @@
 obj-y += setup.o
 lwl-y += lowlevel.o
+bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-nhk8815
diff --git a/arch/arm/boards/nhk8815/env/config b/arch/arm/boards/nhk8815/defaultenv-nhk8815/config
similarity index 100%
rename from arch/arm/boards/nhk8815/env/config
rename to arch/arm/boards/nhk8815/defaultenv-nhk8815/config
diff --git a/arch/arm/boards/nhk8815/setup.c b/arch/arm/boards/nhk8815/setup.c
index aaf9cd7..0b69010 100644
--- a/arch/arm/boards/nhk8815/setup.c
+++ b/arch/arm/boards/nhk8815/setup.c
@@ -23,6 +23,7 @@
 #include <asm/armlinux.h>
 #include <generated/mach-types.h>
 #include <io.h>
+#include <envfs.h>
 
 #include <mach/hardware.h>
 #include <mach/board.h>
@@ -106,6 +107,9 @@ static int nhk8815_devices_init(void)
 	devfs_add_partition("nand0", 0x7FE0000, 0x020000, DEVFS_PARTITION_FIXED, "env_raw");
 	dev_add_bb_dev("env_raw", "env0");
 
+	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
+		defaultenv_append_directory(defaultenv_nhk8815);
+
 	return 0;
 }
 device_initcall(nhk8815_devices_init);
diff --git a/arch/arm/boards/phytec-phycard-omap4/Makefile b/arch/arm/boards/phytec-phycard-omap4/Makefile
index 64782e0..0fec0c7 100644
--- a/arch/arm/boards/phytec-phycard-omap4/Makefile
+++ b/arch/arm/boards/phytec-phycard-omap4/Makefile
@@ -15,3 +15,4 @@
 #
 obj-y += pca-a-xl2.o
 lwl-y += mux.o lowlevel.o
+bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-phytec-phycard-omap4
diff --git a/arch/arm/boards/phytec-phycard-omap4/env/bin/nand_bootstrap b/arch/arm/boards/phytec-phycard-omap4/defaultenv-phytec-phycard-omap4/bin/nand_bootstrap
similarity index 100%
rename from arch/arm/boards/phytec-phycard-omap4/env/bin/nand_bootstrap
rename to arch/arm/boards/phytec-phycard-omap4/defaultenv-phytec-phycard-omap4/bin/nand_bootstrap
diff --git a/arch/arm/boards/phytec-phycard-omap4/env/config b/arch/arm/boards/phytec-phycard-omap4/defaultenv-phytec-phycard-omap4/config
similarity index 100%
rename from arch/arm/boards/phytec-phycard-omap4/env/config
rename to arch/arm/boards/phytec-phycard-omap4/defaultenv-phytec-phycard-omap4/config
diff --git a/arch/arm/boards/phytec-phycore-omap4460/Makefile b/arch/arm/boards/phytec-phycore-omap4460/Makefile
index 5d4eb10..5e78e11 100644
--- a/arch/arm/boards/phytec-phycore-omap4460/Makefile
+++ b/arch/arm/boards/phytec-phycore-omap4460/Makefile
@@ -1,2 +1,3 @@
 obj-y += board.o
 lwl-y += lowlevel.o mux.o
+bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-phytec-phycore-omap4460
diff --git a/arch/arm/boards/phytec-phycore-omap4460/board.c b/arch/arm/boards/phytec-phycore-omap4460/board.c
index 807cdd6..b7aeeca 100644
--- a/arch/arm/boards/phytec-phycore-omap4460/board.c
+++ b/arch/arm/boards/phytec-phycore-omap4460/board.c
@@ -20,6 +20,7 @@
 #include <driver.h>
 #include <gpio.h>
 #include <io.h>
+#include <envfs.h>
 #include <asm/armlinux.h>
 #include <generated/mach-types.h>
 #include <mach/omap4-silicon.h>
@@ -307,6 +308,9 @@ static int pcm049_devices_init(void)
 	if (IS_ENABLED(CONFIG_DRIVER_VIDEO_OMAP))
 		omap_add_display(&pcm049_fb_data);
 
+	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
+		defaultenv_append_directory(defaultenv_phytec_phycore_omap4460);
+
 	return 0;
 }
 device_initcall(pcm049_devices_init);
diff --git a/arch/arm/boards/phytec-phycore-omap4460/env/bin/init_board b/arch/arm/boards/phytec-phycore-omap4460/defaultenv-phytec-phycore-omap4460/bin/init_board
similarity index 100%
rename from arch/arm/boards/phytec-phycore-omap4460/env/bin/init_board
rename to arch/arm/boards/phytec-phycore-omap4460/defaultenv-phytec-phycore-omap4460/bin/init_board
diff --git a/arch/arm/boards/phytec-phycore-omap4460/env/bin/nand_bootstrap b/arch/arm/boards/phytec-phycore-omap4460/defaultenv-phytec-phycore-omap4460/bin/nand_bootstrap
similarity index 100%
rename from arch/arm/boards/phytec-phycore-omap4460/env/bin/nand_bootstrap
rename to arch/arm/boards/phytec-phycore-omap4460/defaultenv-phytec-phycore-omap4460/bin/nand_bootstrap
diff --git a/arch/arm/boards/phytec-phycore-omap4460/env/config b/arch/arm/boards/phytec-phycore-omap4460/defaultenv-phytec-phycore-omap4460/config
similarity index 100%
rename from arch/arm/boards/phytec-phycore-omap4460/env/config
rename to arch/arm/boards/phytec-phycore-omap4460/defaultenv-phytec-phycore-omap4460/config
diff --git a/arch/arm/boards/pm9261/Makefile b/arch/arm/boards/pm9261/Makefile
index 1398c26..bff467b 100644
--- a/arch/arm/boards/pm9261/Makefile
+++ b/arch/arm/boards/pm9261/Makefile
@@ -1,3 +1,4 @@
 obj-y += init.o
 
 lwl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += lowlevel_init.o
+bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-pm9261
diff --git a/arch/arm/boards/pm9261/env/config b/arch/arm/boards/pm9261/defaultenv-pm9261/config
similarity index 100%
rename from arch/arm/boards/pm9261/env/config
rename to arch/arm/boards/pm9261/defaultenv-pm9261/config
diff --git a/arch/arm/boards/pm9261/init.c b/arch/arm/boards/pm9261/init.c
index 177355b..b0377d0 100644
--- a/arch/arm/boards/pm9261/init.c
+++ b/arch/arm/boards/pm9261/init.c
@@ -27,6 +27,7 @@
 #include <fs.h>
 #include <fcntl.h>
 #include <io.h>
+#include <envfs.h>
 #include <mach/hardware.h>
 #include <nand.h>
 #include <linux/mtd/nand.h>
@@ -152,6 +153,9 @@ static int pm9261_devices_init(void)
 
 	armlinux_set_architecture(MACH_TYPE_PM9261);
 
+	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
+		defaultenv_append_directory(defaultenv_pm9261);
+
 	return 0;
 }
 device_initcall(pm9261_devices_init);
diff --git a/arch/arm/boards/pm9g45/Makefile b/arch/arm/boards/pm9g45/Makefile
index eb072c0..d81b188 100644
--- a/arch/arm/boards/pm9g45/Makefile
+++ b/arch/arm/boards/pm9g45/Makefile
@@ -1 +1,2 @@
 obj-y += init.o
+bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-pm9g45
diff --git a/arch/arm/boards/pm9g45/env/config b/arch/arm/boards/pm9g45/defaultenv-pm9g45/config
similarity index 100%
rename from arch/arm/boards/pm9g45/env/config
rename to arch/arm/boards/pm9g45/defaultenv-pm9g45/config
diff --git a/arch/arm/boards/pm9g45/init.c b/arch/arm/boards/pm9g45/init.c
index 524fe53..efa5dc0 100644
--- a/arch/arm/boards/pm9g45/init.c
+++ b/arch/arm/boards/pm9g45/init.c
@@ -27,6 +27,7 @@
 #include <fcntl.h>
 #include <gpio.h>
 #include <io.h>
+#include <envfs.h>
 #include <mach/hardware.h>
 #include <nand.h>
 #include <linux/mtd/nand.h>
@@ -164,6 +165,9 @@ static int pm9g45_devices_init(void)
 
 	armlinux_set_architecture(MACH_TYPE_PM9G45);
 
+	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
+		defaultenv_append_directory(defaultenv_pm9g45);
+
 	return 0;
 }
 device_initcall(pm9g45_devices_init);
diff --git a/arch/arm/boards/qemu-virt64/Makefile b/arch/arm/boards/qemu-virt64/Makefile
index 2da0494..e354607 100644
--- a/arch/arm/boards/qemu-virt64/Makefile
+++ b/arch/arm/boards/qemu-virt64/Makefile
@@ -1,2 +1,3 @@
 obj-y += init.o
 lwl-y += lowlevel.o
+bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-qemu-virt64
diff --git a/arch/arm/boards/qemu-virt64/env/config b/arch/arm/boards/qemu-virt64/defaultenv-qemu-virt64/config
similarity index 100%
rename from arch/arm/boards/qemu-virt64/env/config
rename to arch/arm/boards/qemu-virt64/defaultenv-qemu-virt64/config
diff --git a/arch/arm/boards/qemu-virt64/init.c b/arch/arm/boards/qemu-virt64/init.c
index 58dba0f..a85bd84 100644
--- a/arch/arm/boards/qemu-virt64/init.c
+++ b/arch/arm/boards/qemu-virt64/init.c
@@ -12,6 +12,7 @@
 #include <environment.h>
 #include <linux/sizes.h>
 #include <io.h>
+#include <envfs.h>
 #include <globalvar.h>
 #include <asm/mmu.h>
 
@@ -30,6 +31,9 @@ static int virt_env_init(void)
 	devfs_add_partition("nor0", 0x00000, 0x40000, DEVFS_PARTITION_FIXED, "self0");
 	devfs_add_partition("nor0", 0x40000, 0x20000, DEVFS_PARTITION_FIXED, "env0");
 
+	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
+		defaultenv_append_directory(defaultenv_qemu_virt64);
+
 	return 0;
 }
 device_initcall(virt_env_init);
diff --git a/arch/arm/boards/qil-a926x/Makefile b/arch/arm/boards/qil-a926x/Makefile
index eb072c0..0c7bc3f 100644
--- a/arch/arm/boards/qil-a926x/Makefile
+++ b/arch/arm/boards/qil-a926x/Makefile
@@ -1 +1,2 @@
 obj-y += init.o
+bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-qil-a926x
diff --git a/arch/arm/boards/qil-a926x/env/bin/init_board b/arch/arm/boards/qil-a926x/defaultenv-qil-a926x/bin/init_board
similarity index 100%
rename from arch/arm/boards/qil-a926x/env/bin/init_board
rename to arch/arm/boards/qil-a926x/defaultenv-qil-a926x/bin/init_board
diff --git a/arch/arm/boards/qil-a926x/env/config b/arch/arm/boards/qil-a926x/defaultenv-qil-a926x/config
similarity index 100%
rename from arch/arm/boards/qil-a926x/env/config
rename to arch/arm/boards/qil-a926x/defaultenv-qil-a926x/config
diff --git a/arch/arm/boards/qil-a926x/init.c b/arch/arm/boards/qil-a926x/init.c
index 8727437..3ef9872 100644
--- a/arch/arm/boards/qil-a926x/init.c
+++ b/arch/arm/boards/qil-a926x/init.c
@@ -15,6 +15,7 @@
 #include <fs.h>
 #include <fcntl.h>
 #include <io.h>
+#include <envfs.h>
 #include <mach/hardware.h>
 #include <nand.h>
 #include <linux/sizes.h>
@@ -215,6 +216,9 @@ static int qil_a9260_devices_init(void)
 	devfs_add_partition("nand0", SZ_512K, SZ_128K, DEVFS_PARTITION_FIXED, "env_raw1");
 	dev_add_bb_dev("env_raw1", "env1");
 
+	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
+		defaultenv_append_directory(defaultenv_qil_a926x);
+
 	return 0;
 }
 device_initcall(qil_a9260_devices_init);
diff --git a/arch/arm/boards/sama5d3_xplained/Makefile b/arch/arm/boards/sama5d3_xplained/Makefile
index eb072c0..3c301cb 100644
--- a/arch/arm/boards/sama5d3_xplained/Makefile
+++ b/arch/arm/boards/sama5d3_xplained/Makefile
@@ -1 +1,2 @@
 obj-y += init.o
+bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-sama5d3_xplained
diff --git a/arch/arm/boards/sama5d3_xplained/env/config b/arch/arm/boards/sama5d3_xplained/defaultenv-sama5d3_xplained/config
similarity index 100%
rename from arch/arm/boards/sama5d3_xplained/env/config
rename to arch/arm/boards/sama5d3_xplained/defaultenv-sama5d3_xplained/config
diff --git a/arch/arm/boards/sama5d3_xplained/init.c b/arch/arm/boards/sama5d3_xplained/init.c
index 373ab81..fda4c56 100644
--- a/arch/arm/boards/sama5d3_xplained/init.c
+++ b/arch/arm/boards/sama5d3_xplained/init.c
@@ -22,6 +22,7 @@
 #include <fs.h>
 #include <fcntl.h>
 #include <io.h>
+#include <envfs.h>
 #include <mach/hardware.h>
 #include <nand.h>
 #include <linux/sizes.h>
@@ -224,6 +225,9 @@ static int sama5d3_xplained_devices_init(void)
 
 	devfs_create_partitions("nand0", sama5d3_xplained_nand0_partitions);
 
+	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
+		defaultenv_append_directory(defaultenv_sama5d3_xplained);
+
 	return 0;
 }
 device_initcall(sama5d3_xplained_devices_init);
diff --git a/arch/arm/boards/sama5d3xek/Makefile b/arch/arm/boards/sama5d3xek/Makefile
index db021ee..32dcb42 100644
--- a/arch/arm/boards/sama5d3xek/Makefile
+++ b/arch/arm/boards/sama5d3xek/Makefile
@@ -1,2 +1,3 @@
 obj-y += init.o
 obj-$(CONFIG_W1) += hw_version.o
+bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-sama5d3xek
diff --git a/arch/arm/boards/sama5d3xek/env/bin/init_board b/arch/arm/boards/sama5d3xek/defaultenv-sama5d3xek/bin/init_board
similarity index 100%
rename from arch/arm/boards/sama5d3xek/env/bin/init_board
rename to arch/arm/boards/sama5d3xek/defaultenv-sama5d3xek/bin/init_board
diff --git a/arch/arm/boards/sama5d3xek/env/config b/arch/arm/boards/sama5d3xek/defaultenv-sama5d3xek/config
similarity index 100%
rename from arch/arm/boards/sama5d3xek/env/config
rename to arch/arm/boards/sama5d3xek/defaultenv-sama5d3xek/config
diff --git a/arch/arm/boards/sama5d3xek/init.c b/arch/arm/boards/sama5d3xek/init.c
index 7504bf8..b35bdb5 100644
--- a/arch/arm/boards/sama5d3xek/init.c
+++ b/arch/arm/boards/sama5d3xek/init.c
@@ -24,6 +24,7 @@
 #include <fs.h>
 #include <fcntl.h>
 #include <io.h>
+#include <envfs.h>
 #include <mach/hardware.h>
 #include <nand.h>
 #include <linux/sizes.h>
@@ -463,6 +464,9 @@ static int at91sama5d3xek_devices_init(void)
 
 	devfs_create_partitions("nand0", at91sama5d3xek_nand0_partitions);
 
+	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
+		defaultenv_append_directory(defaultenv_sama5d3xek);
+
 	return 0;
 }
 device_initcall(at91sama5d3xek_devices_init);
diff --git a/arch/arm/boards/scb9328/Makefile b/arch/arm/boards/scb9328/Makefile
index 002f218..7ef6c3f 100644
--- a/arch/arm/boards/scb9328/Makefile
+++ b/arch/arm/boards/scb9328/Makefile
@@ -1,3 +1,4 @@
 
 lwl-y += lowlevel_init.o
 obj-y += scb9328.o
+bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-scb9328
diff --git a/arch/arm/boards/scb9328/env/config b/arch/arm/boards/scb9328/defaultenv-scb9328/config
similarity index 100%
rename from arch/arm/boards/scb9328/env/config
rename to arch/arm/boards/scb9328/defaultenv-scb9328/config
diff --git a/arch/arm/boards/scb9328/scb9328.c b/arch/arm/boards/scb9328/scb9328.c
index fda3b14..697ed4b 100644
--- a/arch/arm/boards/scb9328/scb9328.c
+++ b/arch/arm/boards/scb9328/scb9328.c
@@ -25,6 +25,7 @@
 #include <io.h>
 #include <partition.h>
 #include <fs.h>
+#include <envfs.h>
 #include <fcntl.h>
 #include <platform_data/eth-dm9000.h>
 #include <led.h>
@@ -79,6 +80,9 @@ static int scb9328_devices_init(void)
 
 	armlinux_set_architecture(MACH_TYPE_SCB9328);
 
+	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
+		defaultenv_append_directory(defaultenv_scb9328);
+
 	return 0;
 }
 
diff --git a/arch/arm/boards/tny-a926x/Makefile b/arch/arm/boards/tny-a926x/Makefile
index 45b10ec..dba2f8c 100644
--- a/arch/arm/boards/tny-a926x/Makefile
+++ b/arch/arm/boards/tny-a926x/Makefile
@@ -6,3 +6,4 @@ obj-$(CONFIG_AT91_BOOTSTRAP) += $(bootstrap-y)
 lowlevel_init-$(CONFIG_MACH_TNY_A9263) = tny_a9263_lowlevel_init.o
 
 lwl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += $(lowlevel_init-y)
+bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-tny-a926x
diff --git a/arch/arm/boards/tny-a926x/env/bin/init_board b/arch/arm/boards/tny-a926x/defaultenv-tny-a926x/bin/init_board
similarity index 100%
rename from arch/arm/boards/tny-a926x/env/bin/init_board
rename to arch/arm/boards/tny-a926x/defaultenv-tny-a926x/bin/init_board
diff --git a/arch/arm/boards/tny-a926x/env/config b/arch/arm/boards/tny-a926x/defaultenv-tny-a926x/config
similarity index 100%
rename from arch/arm/boards/tny-a926x/env/config
rename to arch/arm/boards/tny-a926x/defaultenv-tny-a926x/config
diff --git a/arch/arm/boards/tny-a926x/init.c b/arch/arm/boards/tny-a926x/init.c
index 3ebd8aa..3b83c9f 100644
--- a/arch/arm/boards/tny-a926x/init.c
+++ b/arch/arm/boards/tny-a926x/init.c
@@ -24,6 +24,7 @@
 #include <fs.h>
 #include <fcntl.h>
 #include <io.h>
+#include <envfs.h>
 #include <mach/hardware.h>
 #include <nand.h>
 #include <linux/sizes.h>
@@ -241,6 +242,9 @@ static int tny_a9260_devices_init(void)
 	devfs_add_partition("nand0", SZ_512K, SZ_128K, DEVFS_PARTITION_FIXED, "env_raw1");
 	dev_add_bb_dev("env_raw1", "env1");
 
+	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
+		defaultenv_append_directory(defaultenv_tny_a926x);
+
 	return 0;
 }
 device_initcall(tny_a9260_devices_init);
diff --git a/arch/arm/boards/usb-a926x/Makefile b/arch/arm/boards/usb-a926x/Makefile
index f1370a4..4f09581 100644
--- a/arch/arm/boards/usb-a926x/Makefile
+++ b/arch/arm/boards/usb-a926x/Makefile
@@ -6,3 +6,4 @@ obj-$(CONFIG_AT91_BOOTSTRAP) += $(bootstrap-y)
 lowlevel_init-$(CONFIG_MACH_USB_A9263) = usb_a9263_lowlevel_init.o
 
 lwl-$(CONFIG_HAVE_AT91_LOWLEVEL_INIT) += $(lowlevel_init-y)
+bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-usb-a926x
diff --git a/arch/arm/boards/usb-a926x/env/bin/init_board b/arch/arm/boards/usb-a926x/defaultenv-usb-a926x/bin/init_board
similarity index 100%
rename from arch/arm/boards/usb-a926x/env/bin/init_board
rename to arch/arm/boards/usb-a926x/defaultenv-usb-a926x/bin/init_board
diff --git a/arch/arm/boards/usb-a926x/env/config b/arch/arm/boards/usb-a926x/defaultenv-usb-a926x/config
similarity index 100%
rename from arch/arm/boards/usb-a926x/env/config
rename to arch/arm/boards/usb-a926x/defaultenv-usb-a926x/config
diff --git a/arch/arm/boards/usb-a926x/init.c b/arch/arm/boards/usb-a926x/init.c
index a9a0549..12e8f4e 100644
--- a/arch/arm/boards/usb-a926x/init.c
+++ b/arch/arm/boards/usb-a926x/init.c
@@ -24,6 +24,7 @@
 #include <fs.h>
 #include <fcntl.h>
 #include <io.h>
+#include <envfs.h>
 #include <mach/hardware.h>
 #include <nand.h>
 #include <linux/sizes.h>
@@ -416,6 +417,9 @@ static int usb_a9260_devices_init(void)
 	devfs_add_partition("nand0", SZ_512K, SZ_128K, DEVFS_PARTITION_FIXED, "env_raw1");
 	dev_add_bb_dev("env_raw1", "env1");
 
+	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
+		defaultenv_append_directory(defaultenv_usb_a926x);
+
 	return 0;
 }
 device_initcall(usb_a9260_devices_init);
diff --git a/arch/arm/boards/vexpress/Makefile b/arch/arm/boards/vexpress/Makefile
index e11fd5b..c89d7bf 100644
--- a/arch/arm/boards/vexpress/Makefile
+++ b/arch/arm/boards/vexpress/Makefile
@@ -1,3 +1,4 @@
 obj-y += init.o
 
 lwl-y += lowlevel.o
+bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-vexpress
diff --git a/arch/arm/boards/vexpress/env/config b/arch/arm/boards/vexpress/defaultenv-vexpress/config
similarity index 100%
rename from arch/arm/boards/vexpress/env/config
rename to arch/arm/boards/vexpress/defaultenv-vexpress/config
diff --git a/arch/arm/boards/vexpress/init.c b/arch/arm/boards/vexpress/init.c
index 5b2035b..f89dff9 100644
--- a/arch/arm/boards/vexpress/init.c
+++ b/arch/arm/boards/vexpress/init.c
@@ -14,6 +14,7 @@
 #include <partition.h>
 #include <linux/sizes.h>
 #include <io.h>
+#include <envfs.h>
 #include <globalvar.h>
 #include <linux/amba/sp804.h>
 #include <mci.h>
@@ -109,6 +110,9 @@ static int vexpress_devices_init(void)
 	devfs_add_partition("nor0", 0x00000, 0x40000, DEVFS_PARTITION_FIXED, "self");
 	devfs_add_partition("nor0", 0x40000, 0x20000, DEVFS_PARTITION_FIXED, "env0");
 
+	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
+		defaultenv_append_directory(defaultenv_vexpress);
+
 	return 0;
 }
 device_initcall(vexpress_devices_init);
diff --git a/arch/arm/configs/animeo_ip_defconfig b/arch/arm/configs/animeo_ip_defconfig
index d4fbfef..0f2e3a0 100644
--- a/arch/arm/configs/animeo_ip_defconfig
+++ b/arch/arm/configs/animeo_ip_defconfig
@@ -17,7 +17,6 @@ CONFIG_HUSH_FANCY_PROMPT=y
 CONFIG_CMDLINE_EDITING=y
 CONFIG_AUTO_COMPLETE=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/animeo_ip/env"
 CONFIG_CMD_EDIT=y
 CONFIG_CMD_SLEEP=y
 CONFIG_CMD_SAVEENV=y
diff --git a/arch/arm/configs/at91rm9200ek_defconfig b/arch/arm/configs/at91rm9200ek_defconfig
index cca69b8..c82fe09 100644
--- a/arch/arm/configs/at91rm9200ek_defconfig
+++ b/arch/arm/configs/at91rm9200ek_defconfig
@@ -13,7 +13,6 @@ CONFIG_MENU=y
 # CONFIG_CONSOLE_ACTIVATE_FIRST is not set
 CONFIG_CONSOLE_ACTIVATE_ALL=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/at91rm9200ek/env"
 CONFIG_CMD_EDIT=y
 CONFIG_CMD_SLEEP=y
 CONFIG_CMD_SAVEENV=y
diff --git a/arch/arm/configs/at91sam9260ek_defconfig b/arch/arm/configs/at91sam9260ek_defconfig
index 5190b19..10a735d 100644
--- a/arch/arm/configs/at91sam9260ek_defconfig
+++ b/arch/arm/configs/at91sam9260ek_defconfig
@@ -17,7 +17,6 @@ CONFIG_AUTO_COMPLETE=y
 # CONFIG_CONSOLE_ACTIVATE_FIRST is not set
 CONFIG_CONSOLE_ACTIVATE_ALL=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/at91sam9260ek/env"
 CONFIG_CMD_EDIT=y
 CONFIG_CMD_SLEEP=y
 CONFIG_CMD_SAVEENV=y
diff --git a/arch/arm/configs/at91sam9261ek_defconfig b/arch/arm/configs/at91sam9261ek_defconfig
index 2febff0..ad262e9 100644
--- a/arch/arm/configs/at91sam9261ek_defconfig
+++ b/arch/arm/configs/at91sam9261ek_defconfig
@@ -17,7 +17,6 @@ CONFIG_MENU=y
 # CONFIG_CONSOLE_ACTIVATE_FIRST is not set
 CONFIG_CONSOLE_ACTIVATE_ALL=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/at91sam9261ek/env"
 CONFIG_CMD_EDIT=y
 CONFIG_CMD_SLEEP=y
 CONFIG_CMD_SAVEENV=y
diff --git a/arch/arm/configs/at91sam9261ek_first_stage_defconfig b/arch/arm/configs/at91sam9261ek_first_stage_defconfig
index 36b2dad..e3b6e5f 100644
--- a/arch/arm/configs/at91sam9261ek_first_stage_defconfig
+++ b/arch/arm/configs/at91sam9261ek_first_stage_defconfig
@@ -18,7 +18,6 @@ CONFIG_AUTO_COMPLETE=y
 CONFIG_MENU=y
 CONFIG_CONSOLE_ACTIVATE_ALL=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/at91sam9261ek/env"
 CONFIG_CMD_EDIT=y
 CONFIG_CMD_SLEEP=y
 CONFIG_CMD_SAVEENV=y
diff --git a/arch/arm/configs/at91sam9263ek_defconfig b/arch/arm/configs/at91sam9263ek_defconfig
index 5154c78..5f98cd6 100644
--- a/arch/arm/configs/at91sam9263ek_defconfig
+++ b/arch/arm/configs/at91sam9263ek_defconfig
@@ -15,7 +15,6 @@ CONFIG_AUTO_COMPLETE=y
 # CONFIG_CONSOLE_ACTIVATE_FIRST is not set
 CONFIG_CONSOLE_ACTIVATE_ALL=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/at91sam9263ek/env"
 CONFIG_CMD_EDIT=y
 CONFIG_CMD_SLEEP=y
 CONFIG_CMD_SAVEENV=y
diff --git a/arch/arm/configs/at91sam9g10ek_defconfig b/arch/arm/configs/at91sam9g10ek_defconfig
index 1c913c0..40b4b9a 100644
--- a/arch/arm/configs/at91sam9g10ek_defconfig
+++ b/arch/arm/configs/at91sam9g10ek_defconfig
@@ -17,7 +17,6 @@ CONFIG_MENU=y
 # CONFIG_CONSOLE_ACTIVATE_FIRST is not set
 CONFIG_CONSOLE_ACTIVATE_ALL=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/at91sam9261ek/env"
 CONFIG_CMD_EDIT=y
 CONFIG_CMD_SLEEP=y
 CONFIG_CMD_SAVEENV=y
diff --git a/arch/arm/configs/at91sam9g20ek_defconfig b/arch/arm/configs/at91sam9g20ek_defconfig
index 2f22328..a501ec5 100644
--- a/arch/arm/configs/at91sam9g20ek_defconfig
+++ b/arch/arm/configs/at91sam9g20ek_defconfig
@@ -17,7 +17,6 @@ CONFIG_AUTO_COMPLETE=y
 # CONFIG_CONSOLE_ACTIVATE_FIRST is not set
 CONFIG_CONSOLE_ACTIVATE_ALL=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/at91sam9260ek/env"
 CONFIG_CMD_EDIT=y
 CONFIG_CMD_SLEEP=y
 CONFIG_CMD_SAVEENV=y
diff --git a/arch/arm/configs/at91sam9m10g45ek_defconfig b/arch/arm/configs/at91sam9m10g45ek_defconfig
index 1ba7a9c..3985072 100644
--- a/arch/arm/configs/at91sam9m10g45ek_defconfig
+++ b/arch/arm/configs/at91sam9m10g45ek_defconfig
@@ -18,7 +18,6 @@ CONFIG_AUTO_COMPLETE=y
 CONFIG_MENU=y
 CONFIG_PASSWD_SUM_SHA1=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/at91sam9m10g45ek/env"
 CONFIG_CMD_EDIT=y
 CONFIG_CMD_SLEEP=y
 CONFIG_CMD_SAVEENV=y
diff --git a/arch/arm/configs/at91sam9n12ek_defconfig b/arch/arm/configs/at91sam9n12ek_defconfig
index 8d1216e..e73e383 100644
--- a/arch/arm/configs/at91sam9n12ek_defconfig
+++ b/arch/arm/configs/at91sam9n12ek_defconfig
@@ -18,7 +18,6 @@ CONFIG_CMDLINE_EDITING=y
 CONFIG_AUTO_COMPLETE=y
 CONFIG_CONSOLE_ACTIVATE_ALL=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/at91sam9n12ek/env"
 CONFIG_CMD_EDIT=y
 CONFIG_CMD_SLEEP=y
 CONFIG_CMD_SAVEENV=y
diff --git a/arch/arm/configs/at91sam9x5ek_defconfig b/arch/arm/configs/at91sam9x5ek_defconfig
index 22ad72f..1af5ec6 100644
--- a/arch/arm/configs/at91sam9x5ek_defconfig
+++ b/arch/arm/configs/at91sam9x5ek_defconfig
@@ -18,7 +18,6 @@ CONFIG_AUTO_COMPLETE=y
 # CONFIG_CONSOLE_ACTIVATE_FIRST is not set
 CONFIG_CONSOLE_ACTIVATE_ALL=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/at91sam9x5ek/env"
 CONFIG_CMD_EDIT=y
 CONFIG_CMD_SLEEP=y
 CONFIG_CMD_SAVEENV=y
diff --git a/arch/arm/configs/cupid_defconfig b/arch/arm/configs/cupid_defconfig
index 4b90556..a1776d2 100644
--- a/arch/arm/configs/cupid_defconfig
+++ b/arch/arm/configs/cupid_defconfig
@@ -18,7 +18,6 @@ CONFIG_CMDLINE_EDITING=y
 CONFIG_AUTO_COMPLETE=y
 CONFIG_MENU=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/guf-cupid/env"
 CONFIG_CMD_EDIT=y
 CONFIG_CMD_SLEEP=y
 CONFIG_CMD_SAVEENV=y
diff --git a/arch/arm/configs/eukrea_cpuimx25_defconfig b/arch/arm/configs/eukrea_cpuimx25_defconfig
index 0080dcf..feebb13 100644
--- a/arch/arm/configs/eukrea_cpuimx25_defconfig
+++ b/arch/arm/configs/eukrea_cpuimx25_defconfig
@@ -19,7 +19,6 @@ CONFIG_AUTO_COMPLETE=y
 CONFIG_CONSOLE_ACTIVATE_ALL=y
 CONFIG_DEFAULT_COMPRESSION_LZO=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/eukrea_cpuimx25/env"
 CONFIG_LONGHELP=y
 CONFIG_CMD_IOMEM=y
 CONFIG_CMD_MEMINFO=y
diff --git a/arch/arm/configs/eukrea_cpuimx35_defconfig b/arch/arm/configs/eukrea_cpuimx35_defconfig
index 5882530..edc5b9c 100644
--- a/arch/arm/configs/eukrea_cpuimx35_defconfig
+++ b/arch/arm/configs/eukrea_cpuimx35_defconfig
@@ -19,7 +19,6 @@ CONFIG_AUTO_COMPLETE=y
 CONFIG_CONSOLE_ACTIVATE_ALL=y
 CONFIG_DEFAULT_COMPRESSION_LZO=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/eukrea_cpuimx35/env"
 CONFIG_LONGHELP=y
 CONFIG_CMD_IOMEM=y
 CONFIG_CMD_IMD=y
diff --git a/arch/arm/configs/eukrea_cpuimx51_defconfig b/arch/arm/configs/eukrea_cpuimx51_defconfig
index 8e8fd94..e1b011b 100644
--- a/arch/arm/configs/eukrea_cpuimx51_defconfig
+++ b/arch/arm/configs/eukrea_cpuimx51_defconfig
@@ -14,7 +14,6 @@ CONFIG_HUSH_FANCY_PROMPT=y
 CONFIG_CMDLINE_EDITING=y
 CONFIG_AUTO_COMPLETE=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/eukrea_cpuimx51/env"
 CONFIG_CMD_EDIT=y
 CONFIG_CMD_SLEEP=y
 CONFIG_CMD_SAVEENV=y
diff --git a/arch/arm/configs/freescale-mx25-3ds_defconfig b/arch/arm/configs/freescale-mx25-3ds_defconfig
index 8d2a200..1fd8be2 100644
--- a/arch/arm/configs/freescale-mx25-3ds_defconfig
+++ b/arch/arm/configs/freescale-mx25-3ds_defconfig
@@ -17,7 +17,6 @@ CONFIG_AUTO_COMPLETE=y
 # CONFIG_ERRNO_MESSAGES is not set
 CONFIG_PARTITION=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/freescale-mx25-3ds/env/"
 CONFIG_CMD_EDIT=y
 CONFIG_CMD_SLEEP=y
 CONFIG_CMD_SAVEENV=y
diff --git a/arch/arm/configs/freescale-mx35-3ds_defconfig b/arch/arm/configs/freescale-mx35-3ds_defconfig
index f45750f..816dc78 100644
--- a/arch/arm/configs/freescale-mx35-3ds_defconfig
+++ b/arch/arm/configs/freescale-mx35-3ds_defconfig
@@ -15,7 +15,6 @@ CONFIG_CMDLINE_EDITING=y
 CONFIG_AUTO_COMPLETE=y
 CONFIG_PARTITION=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/freescale-mx35-3ds/env/"
 CONFIG_CMD_EDIT=y
 CONFIG_CMD_SLEEP=y
 CONFIG_CMD_SAVEENV=y
diff --git a/arch/arm/configs/freescale-mx53-smd_defconfig b/arch/arm/configs/freescale-mx53-smd_defconfig
index b055dc8..c7f2191 100644
--- a/arch/arm/configs/freescale-mx53-smd_defconfig
+++ b/arch/arm/configs/freescale-mx53-smd_defconfig
@@ -17,7 +17,6 @@ CONFIG_HUSH_FANCY_PROMPT=y
 CONFIG_CMDLINE_EDITING=y
 CONFIG_AUTO_COMPLETE=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/freescale-mx53-smd/env/"
 CONFIG_DEBUG_INFO=y
 CONFIG_CMD_EDIT=y
 CONFIG_CMD_SLEEP=y
diff --git a/arch/arm/configs/friendlyarm_mini6410_defconfig b/arch/arm/configs/friendlyarm_mini6410_defconfig
index 7d21633..1789374 100644
--- a/arch/arm/configs/friendlyarm_mini6410_defconfig
+++ b/arch/arm/configs/friendlyarm_mini6410_defconfig
@@ -10,7 +10,6 @@ CONFIG_AUTO_COMPLETE=y
 CONFIG_PARTITION=y
 CONFIG_PARTITION_DISK=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/friendlyarm-mini6410/env"
 CONFIG_DEBUG_INFO=y
 CONFIG_CMD_EDIT=y
 CONFIG_CMD_SLEEP=y
diff --git a/arch/arm/configs/friendlyarm_tiny6410_defconfig b/arch/arm/configs/friendlyarm_tiny6410_defconfig
index 3342cf8..90208c3 100644
--- a/arch/arm/configs/friendlyarm_tiny6410_defconfig
+++ b/arch/arm/configs/friendlyarm_tiny6410_defconfig
@@ -11,7 +11,6 @@ CONFIG_AUTO_COMPLETE=y
 CONFIG_PARTITION=y
 CONFIG_PARTITION_DISK=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/friendlyarm-tiny6410/env"
 CONFIG_DEBUG_INFO=y
 CONFIG_CMD_EDIT=y
 CONFIG_CMD_SLEEP=y
diff --git a/arch/arm/configs/haba_knx_lite_defconfig b/arch/arm/configs/haba_knx_lite_defconfig
index d33d440..d01c412 100644
--- a/arch/arm/configs/haba_knx_lite_defconfig
+++ b/arch/arm/configs/haba_knx_lite_defconfig
@@ -17,7 +17,6 @@ CONFIG_AUTO_COMPLETE=y
 CONFIG_MENU=y
 CONFIG_CONSOLE_ACTIVATE_ALL=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/haba-knx/env"
 # CONFIG_CMD_ARM_CPUINFO is not set
 CONFIG_LONGHELP=y
 CONFIG_CMD_MEMINFO=y
diff --git a/arch/arm/configs/highbank_defconfig b/arch/arm/configs/highbank_defconfig
index 3e3619d..01b17bc 100644
--- a/arch/arm/configs/highbank_defconfig
+++ b/arch/arm/configs/highbank_defconfig
@@ -13,7 +13,6 @@ CONFIG_CMDLINE_EDITING=y
 CONFIG_AUTO_COMPLETE=y
 CONFIG_MENU=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/highbank/env"
 CONFIG_CMD_EDIT=y
 CONFIG_CMD_SLEEP=y
 CONFIG_CMD_SAVEENV=y
diff --git a/arch/arm/configs/neso_defconfig b/arch/arm/configs/neso_defconfig
index 209396e..3015663 100644
--- a/arch/arm/configs/neso_defconfig
+++ b/arch/arm/configs/neso_defconfig
@@ -17,7 +17,6 @@ CONFIG_CMDLINE_EDITING=y
 CONFIG_AUTO_COMPLETE=y
 CONFIG_PARTITION=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/guf-neso/env"
 CONFIG_CMD_EDIT=y
 CONFIG_CMD_SLEEP=y
 CONFIG_CMD_SAVEENV=y
diff --git a/arch/arm/configs/nhk8815_defconfig b/arch/arm/configs/nhk8815_defconfig
index 02eddcc..1526d79 100644
--- a/arch/arm/configs/nhk8815_defconfig
+++ b/arch/arm/configs/nhk8815_defconfig
@@ -11,7 +11,6 @@ CONFIG_MENU=y
 CONFIG_PASSWD_SUM_SHA1=y
 CONFIG_PARTITION=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/nhk8815/env"
 CONFIG_CMD_EDIT=y
 CONFIG_CMD_SLEEP=y
 CONFIG_CMD_SAVEENV=y
diff --git a/arch/arm/configs/phytec-phycard-omap4_defconfig b/arch/arm/configs/phytec-phycard-omap4_defconfig
index cd9310e..d9c89bb 100644
--- a/arch/arm/configs/phytec-phycard-omap4_defconfig
+++ b/arch/arm/configs/phytec-phycard-omap4_defconfig
@@ -17,7 +17,6 @@ CONFIG_AUTO_COMPLETE=y
 # CONFIG_TIMESTAMP is not set
 CONFIG_PARTITION=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/phytec-phycard-omap4/env/"
 CONFIG_CMD_EDIT=y
 CONFIG_CMD_SLEEP=y
 CONFIG_CMD_SAVEENV=y
diff --git a/arch/arm/configs/phytec-phycore-omap4460_defconfig b/arch/arm/configs/phytec-phycore-omap4460_defconfig
index ce5d75d..54d7722 100644
--- a/arch/arm/configs/phytec-phycore-omap4460_defconfig
+++ b/arch/arm/configs/phytec-phycore-omap4460_defconfig
@@ -16,7 +16,6 @@ CONFIG_CMDLINE_EDITING=y
 CONFIG_AUTO_COMPLETE=y
 # CONFIG_TIMESTAMP is not set
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/phytec-phycore-omap4460/env"
 CONFIG_CMD_EDIT=y
 CONFIG_CMD_SLEEP=y
 CONFIG_CMD_SAVEENV=y
diff --git a/arch/arm/configs/pm9261_defconfig b/arch/arm/configs/pm9261_defconfig
index c3cecb2..4455d9c 100644
--- a/arch/arm/configs/pm9261_defconfig
+++ b/arch/arm/configs/pm9261_defconfig
@@ -10,7 +10,6 @@ CONFIG_AUTO_COMPLETE=y
 CONFIG_MENU=y
 CONFIG_PARTITION=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/pm9261/env/"
 CONFIG_CMD_EDIT=y
 CONFIG_CMD_SLEEP=y
 CONFIG_CMD_SAVEENV=y
diff --git a/arch/arm/configs/pm9g45_defconfig b/arch/arm/configs/pm9g45_defconfig
index a5b54ff..7bb3b9e 100644
--- a/arch/arm/configs/pm9g45_defconfig
+++ b/arch/arm/configs/pm9g45_defconfig
@@ -14,7 +14,6 @@ CONFIG_HUSH_FANCY_PROMPT=y
 CONFIG_CMDLINE_EDITING=y
 CONFIG_AUTO_COMPLETE=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/pm9g45/env"
 CONFIG_CMD_EDIT=y
 CONFIG_CMD_SAVEENV=y
 CONFIG_CMD_EXPORT=y
diff --git a/arch/arm/configs/qemu_virt64_defconfig b/arch/arm/configs/qemu_virt64_defconfig
index ed5abef..f8128aa 100644
--- a/arch/arm/configs/qemu_virt64_defconfig
+++ b/arch/arm/configs/qemu_virt64_defconfig
@@ -14,7 +14,6 @@ CONFIG_AUTO_COMPLETE=y
 CONFIG_MENU=y
 CONFIG_PARTITION=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/qemu-virt64/env"
 CONFIG_DEBUG_INFO=y
 CONFIG_LONGHELP=y
 CONFIG_CMD_MEMINFO=y
diff --git a/arch/arm/configs/qil_a9260_128mib_defconfig b/arch/arm/configs/qil_a9260_128mib_defconfig
index b92847f..7b6c352 100644
--- a/arch/arm/configs/qil_a9260_128mib_defconfig
+++ b/arch/arm/configs/qil_a9260_128mib_defconfig
@@ -19,7 +19,6 @@ CONFIG_AUTO_COMPLETE=y
 CONFIG_MENU=y
 CONFIG_CONSOLE_ACTIVATE_ALL=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/qil-a926x/env"
 CONFIG_CMD_EDIT=y
 CONFIG_CMD_SLEEP=y
 CONFIG_CMD_SAVEENV=y
diff --git a/arch/arm/configs/qil_a9260_defconfig b/arch/arm/configs/qil_a9260_defconfig
index 72db60b..6918abb 100644
--- a/arch/arm/configs/qil_a9260_defconfig
+++ b/arch/arm/configs/qil_a9260_defconfig
@@ -18,7 +18,6 @@ CONFIG_AUTO_COMPLETE=y
 CONFIG_MENU=y
 CONFIG_CONSOLE_ACTIVATE_ALL=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/qil-a926x/env"
 CONFIG_CMD_EDIT=y
 CONFIG_CMD_SLEEP=y
 CONFIG_CMD_SAVEENV=y
diff --git a/arch/arm/configs/qil_a9g20_128mib_defconfig b/arch/arm/configs/qil_a9g20_128mib_defconfig
index 3e30a07..7546a5b 100644
--- a/arch/arm/configs/qil_a9g20_128mib_defconfig
+++ b/arch/arm/configs/qil_a9g20_128mib_defconfig
@@ -19,7 +19,6 @@ CONFIG_AUTO_COMPLETE=y
 CONFIG_MENU=y
 CONFIG_CONSOLE_ACTIVATE_ALL=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/qil-a926x/env"
 CONFIG_CMD_EDIT=y
 CONFIG_CMD_SLEEP=y
 CONFIG_CMD_SAVEENV=y
diff --git a/arch/arm/configs/qil_a9g20_defconfig b/arch/arm/configs/qil_a9g20_defconfig
index 6294692..bf9e8bb 100644
--- a/arch/arm/configs/qil_a9g20_defconfig
+++ b/arch/arm/configs/qil_a9g20_defconfig
@@ -18,7 +18,6 @@ CONFIG_AUTO_COMPLETE=y
 CONFIG_MENU=y
 CONFIG_CONSOLE_ACTIVATE_ALL=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/qil-a926x/env"
 CONFIG_CMD_EDIT=y
 CONFIG_CMD_SLEEP=y
 CONFIG_CMD_SAVEENV=y
diff --git a/arch/arm/configs/sama5d3_xplained_defconfig b/arch/arm/configs/sama5d3_xplained_defconfig
index 156f032..773223e 100644
--- a/arch/arm/configs/sama5d3_xplained_defconfig
+++ b/arch/arm/configs/sama5d3_xplained_defconfig
@@ -19,7 +19,6 @@ CONFIG_CMDLINE_EDITING=y
 CONFIG_AUTO_COMPLETE=y
 CONFIG_CONSOLE_ACTIVATE_ALL=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/sama5d3_xplained/env"
 CONFIG_CMD_EDIT=y
 CONFIG_CMD_SLEEP=y
 CONFIG_CMD_SAVEENV=y
diff --git a/arch/arm/configs/sama5d3xek_defconfig b/arch/arm/configs/sama5d3xek_defconfig
index 9e2d41e..48535e5 100644
--- a/arch/arm/configs/sama5d3xek_defconfig
+++ b/arch/arm/configs/sama5d3xek_defconfig
@@ -18,7 +18,6 @@ CONFIG_CMDLINE_EDITING=y
 CONFIG_AUTO_COMPLETE=y
 CONFIG_CONSOLE_ACTIVATE_ALL=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/sama5d3xek/env"
 CONFIG_CMD_EDIT=y
 CONFIG_CMD_SLEEP=y
 CONFIG_CMD_SAVEENV=y
diff --git a/arch/arm/configs/scb9328_defconfig b/arch/arm/configs/scb9328_defconfig
index 09767aa..a707732 100644
--- a/arch/arm/configs/scb9328_defconfig
+++ b/arch/arm/configs/scb9328_defconfig
@@ -12,7 +12,6 @@ CONFIG_CMDLINE_EDITING=y
 CONFIG_AUTO_COMPLETE=y
 CONFIG_PARTITION=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/scb9328/env/"
 CONFIG_CMD_EDIT=y
 CONFIG_CMD_SLEEP=y
 CONFIG_CMD_SAVEENV=y
diff --git a/arch/arm/configs/tny_a9260_defconfig b/arch/arm/configs/tny_a9260_defconfig
index d9395fa..f288387 100644
--- a/arch/arm/configs/tny_a9260_defconfig
+++ b/arch/arm/configs/tny_a9260_defconfig
@@ -20,7 +20,6 @@ CONFIG_MENU=y
 # CONFIG_CONSOLE_ACTIVATE_FIRST is not set
 CONFIG_CONSOLE_ACTIVATE_ALL=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/tny-a926x/env"
 CONFIG_CMD_EDIT=y
 CONFIG_CMD_SLEEP=y
 CONFIG_CMD_SAVEENV=y
diff --git a/arch/arm/configs/tny_a9263_defconfig b/arch/arm/configs/tny_a9263_defconfig
index e250ab3..cd955f7 100644
--- a/arch/arm/configs/tny_a9263_defconfig
+++ b/arch/arm/configs/tny_a9263_defconfig
@@ -20,7 +20,6 @@ CONFIG_MENU=y
 # CONFIG_CONSOLE_ACTIVATE_FIRST is not set
 CONFIG_CONSOLE_ACTIVATE_ALL=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/tny-a926x/env"
 CONFIG_CMD_EDIT=y
 CONFIG_CMD_SLEEP=y
 CONFIG_CMD_SAVEENV=y
diff --git a/arch/arm/configs/tny_a9g20_defconfig b/arch/arm/configs/tny_a9g20_defconfig
index 4a8da59..dc3c13a 100644
--- a/arch/arm/configs/tny_a9g20_defconfig
+++ b/arch/arm/configs/tny_a9g20_defconfig
@@ -20,7 +20,6 @@ CONFIG_MENU=y
 # CONFIG_CONSOLE_ACTIVATE_FIRST is not set
 CONFIG_CONSOLE_ACTIVATE_ALL=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/tny-a926x/env"
 CONFIG_CMD_EDIT=y
 CONFIG_CMD_SLEEP=y
 CONFIG_CMD_SAVEENV=y
diff --git a/arch/arm/configs/usb_a9260_defconfig b/arch/arm/configs/usb_a9260_defconfig
index a5785aa..2a8d1a6 100644
--- a/arch/arm/configs/usb_a9260_defconfig
+++ b/arch/arm/configs/usb_a9260_defconfig
@@ -20,7 +20,6 @@ CONFIG_MENU=y
 CONFIG_CONSOLE_ACTIVATE_ALL=y
 CONFIG_PARTITION=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/usb-a926x/env"
 CONFIG_CMD_EDIT=y
 CONFIG_CMD_SLEEP=y
 CONFIG_CMD_SAVEENV=y
diff --git a/arch/arm/configs/usb_a9263_128mib_defconfig b/arch/arm/configs/usb_a9263_128mib_defconfig
index f84743b..c091a97 100644
--- a/arch/arm/configs/usb_a9263_128mib_defconfig
+++ b/arch/arm/configs/usb_a9263_128mib_defconfig
@@ -21,7 +21,6 @@ CONFIG_MENU=y
 CONFIG_CONSOLE_ACTIVATE_ALL=y
 CONFIG_PARTITION=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/usb-a926x/env"
 CONFIG_CMD_EDIT=y
 CONFIG_CMD_SLEEP=y
 CONFIG_CMD_SAVEENV=y
diff --git a/arch/arm/configs/usb_a9263_defconfig b/arch/arm/configs/usb_a9263_defconfig
index 41d8284..51234cd 100644
--- a/arch/arm/configs/usb_a9263_defconfig
+++ b/arch/arm/configs/usb_a9263_defconfig
@@ -20,7 +20,6 @@ CONFIG_MENU=y
 CONFIG_CONSOLE_ACTIVATE_ALL=y
 CONFIG_PARTITION=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/usb-a926x/env"
 CONFIG_CMD_EDIT=y
 CONFIG_CMD_SLEEP=y
 CONFIG_CMD_SAVEENV=y
diff --git a/arch/arm/configs/usb_a9g20_128mib_defconfig b/arch/arm/configs/usb_a9g20_128mib_defconfig
index d5e8e5e..7890776 100644
--- a/arch/arm/configs/usb_a9g20_128mib_defconfig
+++ b/arch/arm/configs/usb_a9g20_128mib_defconfig
@@ -21,7 +21,6 @@ CONFIG_MENU=y
 CONFIG_CONSOLE_ACTIVATE_ALL=y
 CONFIG_PARTITION=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/usb-a926x/env"
 CONFIG_CMD_EDIT=y
 CONFIG_CMD_SLEEP=y
 CONFIG_CMD_SAVEENV=y
diff --git a/arch/arm/configs/usb_a9g20_defconfig b/arch/arm/configs/usb_a9g20_defconfig
index 6e59cf5..0953aaf 100644
--- a/arch/arm/configs/usb_a9g20_defconfig
+++ b/arch/arm/configs/usb_a9g20_defconfig
@@ -20,7 +20,6 @@ CONFIG_MENU=y
 CONFIG_CONSOLE_ACTIVATE_ALL=y
 CONFIG_PARTITION=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/usb-a926x/env"
 CONFIG_CMD_EDIT=y
 CONFIG_CMD_SLEEP=y
 CONFIG_CMD_SAVEENV=y
diff --git a/arch/arm/configs/vexpress_ca9_defconfig b/arch/arm/configs/vexpress_ca9_defconfig
index c24c0ea..fb40567 100644
--- a/arch/arm/configs/vexpress_ca9_defconfig
+++ b/arch/arm/configs/vexpress_ca9_defconfig
@@ -13,7 +13,6 @@ CONFIG_AUTO_COMPLETE=y
 CONFIG_MENU=y
 CONFIG_PARTITION=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/vexpress/env"
 CONFIG_CMD_EDIT=y
 CONFIG_CMD_SLEEP=y
 CONFIG_CMD_SAVEENV=y
diff --git a/arch/arm/configs/vexpress_defconfig b/arch/arm/configs/vexpress_defconfig
index 241889b..9e74bb4 100644
--- a/arch/arm/configs/vexpress_defconfig
+++ b/arch/arm/configs/vexpress_defconfig
@@ -12,7 +12,6 @@ CONFIG_AUTO_COMPLETE=y
 CONFIG_MENU=y
 CONFIG_PARTITION=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/vexpress/env"
 CONFIG_CMD_EDIT=y
 CONFIG_CMD_SLEEP=y
 CONFIG_CMD_SAVEENV=y
diff --git a/arch/nios2/boards/generic/Makefile b/arch/nios2/boards/generic/Makefile
index d8a3d7f..f262838 100644
--- a/arch/nios2/boards/generic/Makefile
+++ b/arch/nios2/boards/generic/Makefile
@@ -1 +1,2 @@
 obj-y += generic.o
+bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-generic
diff --git a/arch/nios2/boards/generic/env/config b/arch/nios2/boards/generic/defaultenv-generic/config
similarity index 100%
rename from arch/nios2/boards/generic/env/config
rename to arch/nios2/boards/generic/defaultenv-generic/config
diff --git a/arch/nios2/boards/generic/generic.c b/arch/nios2/boards/generic/generic.c
index 61b60b6..0c2c67c 100644
--- a/arch/nios2/boards/generic/generic.c
+++ b/arch/nios2/boards/generic/generic.c
@@ -4,6 +4,7 @@
 #include <partition.h>
 #include <fs.h>
 #include <memory.h>
+#include <envfs.h>
 
 static int phy_address = 1;
 
@@ -52,6 +53,9 @@ static int generic_devices_init(void)
 
 	protect_file("/dev/env0", 1);
 
+	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
+		defaultenv_append_directory(defaultenv_generic);
+
 	return 0;
 }
 
diff --git a/arch/nios2/configs/generic_defconfig b/arch/nios2/configs/generic_defconfig
index 39f41dd..91d364f 100644
--- a/arch/nios2/configs/generic_defconfig
+++ b/arch/nios2/configs/generic_defconfig
@@ -6,7 +6,6 @@ CONFIG_CMDLINE_EDITING=y
 CONFIG_AUTO_COMPLETE=y
 CONFIG_PARTITION=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/nios2/boards/generic/env"
 CONFIG_CMD_EDIT=y
 CONFIG_CMD_SLEEP=y
 CONFIG_CMD_SAVEENV=y
diff --git a/arch/ppc/boards/freescale-p1010rdb/Makefile b/arch/ppc/boards/freescale-p1010rdb/Makefile
index 2a51091..a7b64ee 100644
--- a/arch/ppc/boards/freescale-p1010rdb/Makefile
+++ b/arch/ppc/boards/freescale-p1010rdb/Makefile
@@ -1,4 +1,5 @@
 obj-y	+= p1010rdb.o
 obj-y	+= law.o
 obj-y	+= tlb.o
-obj-y	+= ddr.o
\ No newline at end of file
+obj-y	+= ddr.o
+bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-freescale-p1010rdb
diff --git a/arch/ppc/boards/freescale-p1010rdb/env/bin/init b/arch/ppc/boards/freescale-p1010rdb/defaultenv-freescale-p1010rdb/bin/init
similarity index 100%
rename from arch/ppc/boards/freescale-p1010rdb/env/bin/init
rename to arch/ppc/boards/freescale-p1010rdb/defaultenv-freescale-p1010rdb/bin/init
diff --git a/arch/ppc/boards/freescale-p1010rdb/env/config b/arch/ppc/boards/freescale-p1010rdb/defaultenv-freescale-p1010rdb/config
similarity index 100%
rename from arch/ppc/boards/freescale-p1010rdb/env/config
rename to arch/ppc/boards/freescale-p1010rdb/defaultenv-freescale-p1010rdb/config
diff --git a/arch/ppc/boards/freescale-p1010rdb/p1010rdb.c b/arch/ppc/boards/freescale-p1010rdb/p1010rdb.c
index eab3aba..b163327 100644
--- a/arch/ppc/boards/freescale-p1010rdb/p1010rdb.c
+++ b/arch/ppc/boards/freescale-p1010rdb/p1010rdb.c
@@ -22,6 +22,7 @@
 #include <types.h>
 #include <i2c/i2c.h>
 #include <gpio.h>
+#include <envfs.h>
 #include <partition.h>
 #include <memory.h>
 #include <asm/cache.h>
@@ -121,6 +122,9 @@ static int p1010rdb_devices_init(void)
 			IORESOURCE_MEM, &i2cplat[1]);
 	board_eth_init();
 
+	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
+		defaultenv_append_directory(defaultenv_freescale_p1010rdb);
+
 	return 0;
 }
 
diff --git a/arch/ppc/boards/freescale-p1022ds/Makefile b/arch/ppc/boards/freescale-p1022ds/Makefile
index e9b59d5..48867fa 100644
--- a/arch/ppc/boards/freescale-p1022ds/Makefile
+++ b/arch/ppc/boards/freescale-p1022ds/Makefile
@@ -3,3 +3,4 @@ obj-y	+= law.o
 obj-y	+= tlb.o
 obj-y	+= ddr.o
 obj-y	+= ics307_clk.o
+bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-freescale-p1022ds
diff --git a/arch/ppc/boards/freescale-p1022ds/env/bin/init b/arch/ppc/boards/freescale-p1022ds/defaultenv-freescale-p1022ds/bin/init
similarity index 100%
rename from arch/ppc/boards/freescale-p1022ds/env/bin/init
rename to arch/ppc/boards/freescale-p1022ds/defaultenv-freescale-p1022ds/bin/init
diff --git a/arch/ppc/boards/freescale-p1022ds/env/config b/arch/ppc/boards/freescale-p1022ds/defaultenv-freescale-p1022ds/config
similarity index 100%
rename from arch/ppc/boards/freescale-p1022ds/env/config
rename to arch/ppc/boards/freescale-p1022ds/defaultenv-freescale-p1022ds/config
diff --git a/arch/ppc/boards/freescale-p1022ds/p1022ds.c b/arch/ppc/boards/freescale-p1022ds/p1022ds.c
index 95a7234..d80c234 100644
--- a/arch/ppc/boards/freescale-p1022ds/p1022ds.c
+++ b/arch/ppc/boards/freescale-p1022ds/p1022ds.c
@@ -23,6 +23,7 @@
 #include <i2c/i2c.h>
 #include <partition.h>
 #include <memory.h>
+#include <envfs.h>
 #include <asm/cache.h>
 #include <asm/fsl_ddr_sdram.h>
 #include <asm/fsl_law.h>
@@ -113,6 +114,9 @@ static int p1022ds_devices_init(void)
 
 	board_eth_init();
 
+	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
+		defaultenv_append_directory(defaultenv_freescale_p1022ds);
+
 	return 0;
 }
 
diff --git a/arch/ppc/boards/freescale-p2020rdb/Makefile b/arch/ppc/boards/freescale-p2020rdb/Makefile
index dbd2af6..b2497f6 100644
--- a/arch/ppc/boards/freescale-p2020rdb/Makefile
+++ b/arch/ppc/boards/freescale-p2020rdb/Makefile
@@ -1,3 +1,4 @@
 obj-y	+= p2020rdb.o
 obj-y	+= law.o
 obj-y	+= tlb.o
+bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-freescale-p2020rdb
diff --git a/arch/ppc/boards/freescale-p2020rdb/env/bin/init b/arch/ppc/boards/freescale-p2020rdb/defaultenv-freescale-p2020rdb/bin/init
similarity index 100%
rename from arch/ppc/boards/freescale-p2020rdb/env/bin/init
rename to arch/ppc/boards/freescale-p2020rdb/defaultenv-freescale-p2020rdb/bin/init
diff --git a/arch/ppc/boards/freescale-p2020rdb/env/config b/arch/ppc/boards/freescale-p2020rdb/defaultenv-freescale-p2020rdb/config
similarity index 100%
rename from arch/ppc/boards/freescale-p2020rdb/env/config
rename to arch/ppc/boards/freescale-p2020rdb/defaultenv-freescale-p2020rdb/config
diff --git a/arch/ppc/boards/freescale-p2020rdb/p2020rdb.c b/arch/ppc/boards/freescale-p2020rdb/p2020rdb.c
index b03d791..5559765 100644
--- a/arch/ppc/boards/freescale-p2020rdb/p2020rdb.c
+++ b/arch/ppc/boards/freescale-p2020rdb/p2020rdb.c
@@ -25,6 +25,7 @@
 #include <i2c/i2c.h>
 #include <partition.h>
 #include <memory.h>
+#include <envfs.h>
 #include <asm/cache.h>
 #include <asm/fsl_ddr_sdram.h>
 #include <asm/fsl_law.h>
@@ -95,6 +96,9 @@ static int devices_init(void)
 	fsl_eth_init(2, &gfar_info[0]);
 	fsl_eth_init(3, &gfar_info[1]);
 
+	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
+		defaultenv_append_directory(defaultenv_freescale_p2020rdb);
+
 	return 0;
 }
 
diff --git a/arch/ppc/boards/geip-da923rc/Makefile b/arch/ppc/boards/geip-da923rc/Makefile
index 3abc6c6..7177bfa 100644
--- a/arch/ppc/boards/geip-da923rc/Makefile
+++ b/arch/ppc/boards/geip-da923rc/Makefile
@@ -4,3 +4,4 @@ obj-y += law.o
 obj-y += ddr.o
 obj-y += nand.o
 obj-y += product_data.o
+bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-geip-da923rc
diff --git a/arch/ppc/boards/geip-da923rc/da923rc.c b/arch/ppc/boards/geip-da923rc/da923rc.c
index 85c9747..6ec4ee2 100644
--- a/arch/ppc/boards/geip-da923rc/da923rc.c
+++ b/arch/ppc/boards/geip-da923rc/da923rc.c
@@ -22,6 +22,7 @@
 #include <asm/io.h>
 #include <net.h>
 #include <gpio.h>
+#include <envfs.h>
 #include <platform_data/serial-ns16550.h>
 #include <partition.h>
 #include <environment.h>
@@ -96,6 +97,9 @@ static int da923rc_devices_init(void)
 
 	board_eth_init();
 
+	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
+		defaultenv_append_directory(defaultenv_geip_da923rc);
+
 	return 0;
 }
 
diff --git a/arch/ppc/boards/geip-da923rc/env/bin/boot b/arch/ppc/boards/geip-da923rc/defaultenv-geip-da923rc/bin/boot
similarity index 100%
rename from arch/ppc/boards/geip-da923rc/env/bin/boot
rename to arch/ppc/boards/geip-da923rc/defaultenv-geip-da923rc/bin/boot
diff --git a/arch/ppc/boards/geip-da923rc/env/bin/init b/arch/ppc/boards/geip-da923rc/defaultenv-geip-da923rc/bin/init
similarity index 100%
rename from arch/ppc/boards/geip-da923rc/env/bin/init
rename to arch/ppc/boards/geip-da923rc/defaultenv-geip-da923rc/bin/init
diff --git a/arch/ppc/boards/geip-da923rc/env/config b/arch/ppc/boards/geip-da923rc/defaultenv-geip-da923rc/config
similarity index 100%
rename from arch/ppc/boards/geip-da923rc/env/config
rename to arch/ppc/boards/geip-da923rc/defaultenv-geip-da923rc/config
diff --git a/arch/ppc/configs/da923rc_defconfig b/arch/ppc/configs/da923rc_defconfig
index a6d38fd..f873eb5 100644
--- a/arch/ppc/configs/da923rc_defconfig
+++ b/arch/ppc/configs/da923rc_defconfig
@@ -18,7 +18,6 @@ CONFIG_CMD_EXPORT=y
 CONFIG_CMD_FLASH=y
 CONFIG_CMD_GO=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=n
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/ppc/boards/geip-da923rc/env/"
 CONFIG_CMD_LOADENV=y
 CONFIG_CMD_PRINTENV=y
 CONFIG_CMD_SAVEENV=y
diff --git a/arch/ppc/configs/p1010rdb_defconfig b/arch/ppc/configs/p1010rdb_defconfig
index a891a6c..b1f1002 100644
--- a/arch/ppc/configs/p1010rdb_defconfig
+++ b/arch/ppc/configs/p1010rdb_defconfig
@@ -18,7 +18,6 @@ CONFIG_CMD_RESET=y
 CONFIG_CMD_TIMEOUT=y
 CONFIG_CMD_GO=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=n
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/ppc/boards/freescale-p1010rdb/env/"
 CONFIG_CMD_LOADENV=y
 CONFIG_CMD_PRINTENV=y
 CONFIG_CMD_SAVEENV=y
diff --git a/arch/ppc/configs/p1022ds_defconfig b/arch/ppc/configs/p1022ds_defconfig
index 4d0fe99..f517708 100644
--- a/arch/ppc/configs/p1022ds_defconfig
+++ b/arch/ppc/configs/p1022ds_defconfig
@@ -16,7 +16,6 @@ CONFIG_CMD_FLASH=y
 CONFIG_CMD_RESET=y
 CONFIG_CMD_GO=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=n
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/ppc/boards/freescale-p1022ds/env/"
 CONFIG_CMD_LOADENV=y
 CONFIG_CMD_PRINTENV=y
 CONFIG_CMD_SAVEENV=y
diff --git a/arch/ppc/configs/p2020rdb_defconfig b/arch/ppc/configs/p2020rdb_defconfig
index 817c9a0..d0b11b4 100644
--- a/arch/ppc/configs/p2020rdb_defconfig
+++ b/arch/ppc/configs/p2020rdb_defconfig
@@ -17,7 +17,6 @@ CONFIG_CMD_FLASH=y
 CONFIG_CMD_RESET=y
 CONFIG_CMD_GO=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC=n
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/ppc/boards/freescale-p2020rdb/env/"
 CONFIG_CMD_LOADENV=y
 CONFIG_CMD_PRINTENV=y
 CONFIG_CMD_SAVEENV=y
-- 
2.9.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply related

* Re: [PATCH] blspec: fix return value of entry_is_of_compatible()
From: Sascha Hauer @ 2016-09-28  6:29 UTC (permalink / raw)
  To: Ulrich Ölmann; +Cc: Barebox List
In-Reply-To: <20160927073058.20476-1-u.oelmann@pengutronix.de>

On Tue, Sep 27, 2016 at 09:30:58AM +0200, Ulrich Ölmann wrote:
> The function returns a boolean and not an integer. Hence the former
> explicit/implicit cast of an ERR_PTR to a boolean has led to a return value of
> true although a bootspec entry with a faulty devicetree is not compatible.
> 
> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
> ---
>  common/blspec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks

Sascha

> 
> diff --git a/common/blspec.c b/common/blspec.c
> index c205d481c911..40d4546d2880 100644
> --- a/common/blspec.c
> +++ b/common/blspec.c
> @@ -398,7 +398,7 @@ static bool entry_is_of_compatible(struct blspec_entry *entry)
>  
>  	root = of_unflatten_dtb(fdt);
>  	if (IS_ERR(root)) {
> -		ret = PTR_ERR(root);
> +		ret = false;
>  		root = NULL;
>  		goto out;
>  	}
> -- 
> 2.9.3
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply

* Re: [PATCH 2/2] ARM: Fix calling of arm_mem_barebox_image()
From: Sascha Hauer @ 2016-09-28  8:37 UTC (permalink / raw)
  To: Trent Piepho; +Cc: Barebox List
In-Reply-To: <1474504514.22305.66.camel@rtred1test09.kymeta.local>

On Thu, Sep 22, 2016 at 12:35:14AM +0000, Trent Piepho wrote:
> On Thu, 2016-09-15 at 09:10 +0200, Sascha Hauer wrote:
> > On Wed, Sep 14, 2016 at 06:27:04PM +0000, Trent Piepho wrote:
> > > On Wed, 2016-09-14 at 10:21 +0200, Sascha Hauer wrote:
> > > > arm_mem_barebox_image() is used to pick a suitable place where to
> > > > put the final image to. This is called from both the PBL uncompression
> > > > code and also from the final image. To make it work properly it is
> > > > crucial that it's called with the same arguments both times. Currently
> > > 
> > > This code has changed since I was working with it, but wouldn't
> > > arm_mem_barebox_image() returning a different value from when the PBL
> > > code calls it versus barebox_non_pbl_start() just result in an
> > > unnecessary relocation of the uncompressed barebox from the PBL's choice
> > > to the main barebox choice?
> > 
> > That may work when both regions do not overlap.
> 
> Ah, good point.  I suppose barebox could check that it doesn't try to
> relocate on top of itself while running.
> 
> 
> > I already tried. Somehow I didn't like the result that much, see the
> > patch below. The patch also still misses the single pbl handling.
> 
> Here's what I was thinking.  multi and single pbl should work, getting
> the size (data+bss) from the compressed data's size word.  Non-pbl and
> PBL main barebox know the data via the linker symbols.

The single pbl does not work with this patch. It only adds the size to
barebox.z, but that files is only generated and used for the multi pbl
case.

Generally we can go in this direction, but the single pbl case must
work, or alternatively, the multi pbl and single pbl case should be
unified.

>  void __noreturn barebox_multi_pbl_start(unsigned long membase,
>  		unsigned long memsize, void *boarddata)
>  {
> -	uint32_t pg_len;
> +	uint32_t pg_len, barebox_mem_len;
>  	void __noreturn (*barebox)(unsigned long, unsigned long, void *);
>  	uint32_t endmem = membase + memsize;
>  	unsigned long barebox_base;
> @@ -69,13 +70,16 @@ void __noreturn barebox_multi_pbl_start(unsigned long membase,
>  	/*
>  	 * image_end is the first location after the executable. It contains
>  	 * the size of the appended compressed binary followed by the binary.
> +	 * The final word of the compressed binary is the space (uncompressed
> +	 * image plus bss room) needed by barebox.
>  	 */
>  	pg_start = image_end + 1;
>  	pg_len = *(image_end);

I believe we must substract 4 from pg_len here as pg_len now includes
the additional size including bss value. pbl_barebox_uncompress() needs
the real size of the compressed binary. I don't know how tolerant the
different decompression algorithms are against additional garbage at the
end. I think this should be:

-	pg_len = *(image_end);
+	pg_len = *(image_end) - sizeof(uint32_t);
+	barebox_mem_len = get_unaligned_le32((void *)(pg_start + pg_len));

> +	barebox_mem_len = get_unaligned((const u32 *)(pg_start + pg_len - 4));
>  
>  	if (IS_ENABLED(CONFIG_RELOCATABLE))
>  		barebox_base = arm_mem_barebox_image(membase, endmem,
> -						     pg_len);
> +						     barebox_mem_len);
>  	else
>  		barebox_base = TEXT_BASE;
>  
> diff --git a/images/Makefile b/images/Makefile
> index da9cc8d..cc76958 100644
> --- a/images/Makefile
> +++ b/images/Makefile
> @@ -89,8 +89,12 @@ suffix_$(CONFIG_IMAGE_COMPRESSION_NONE) = shipped
>  
>  # barebox.z - compressed barebox binary
>  # ----------------------------------------------------------------
> +quiet_cmd_sizebss = SIZEBSS $@
> +cmd_sizebss = $(call size_append, $<, $(obj)/../barebox) >> $@
> +
>  $(obj)/barebox.z: $(obj)/../barebox.bin FORCE
>  	$(call if_changed,$(suffix_y))
> +	$(call if_changed,sizebss)
>  
>  # %.img - create a copy from another file
>  # ----------------------------------------------------------------
> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
> index e55bc27..5b9d172 100644
> --- a/scripts/Makefile.lib
> +++ b/scripts/Makefile.lib
> @@ -299,20 +299,17 @@ cmd_env=$(srctree)/scripts/genenv $(srctree) $(objtree) $@ $<
>  
>  # Bzip2 and LZMA do not include size in file... so we have to fake that;
>  # append the size as a 32-bit littleendian number as gzip does.
> -size_append = printf $(shell						\
> -dec_size=0;								\
> -for F in $1; do								\
> -	fsize=$$(stat -c "%s" $$F);					\
> -	dec_size=$$(expr $$dec_size + $$fsize);				\
> +# If a second argument is supplied, include the BSS space it uses, as
> +# this gives the memory needs to load a compressed binary.
> +size_append = size=0;							\
> +[ -n "$2" ] && size=`size -A $2 | awk '$$1==".bss"{print $$2}'`;	\
> +for F in $1; do 							\
> +	fsize=`stat -c %s $$F`;						\
> +	size=$$((size + fsize));					\
>  done;									\
> -printf "%08x\n" $$dec_size |						\
> -	sed 's/\(..\)/\1 /g' | {					\
> -		read ch0 ch1 ch2 ch3;					\
> -		for ch in $$ch3 $$ch2 $$ch1 $$ch0; do			\
> -			printf '%s%03o' '\\' $$((0x$$ch)); 		\
> -		done;							\
> -	}								\
> -)
> +printf `printf '\\\\%03o\\\\%03o\\\\%03o\\\\%03o' 			\
> +	$$((size&0xff)) $$((size>>8&0xff)) 				\
> +	$$((size>>16&0xff)) $$((size>>24&0xff))`

This last change that changes the way the size is converted to binary is
not necessary, right?

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply

* [PATCH 6/7] scripts: kwboot: set boot source to UART before sending
From: Uwe Kleine-König @ 2016-09-28 18:50 UTC (permalink / raw)
  To: barebox
In-Reply-To: <20160928185017.25002-1-u.kleine-koenig@pengutronix.de>

Sending an image that specifies one of the alternative boot sources doesn't
make sense. So change the boot source to UART on the fly.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 scripts/kwboot.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/scripts/kwboot.c b/scripts/kwboot.c
index 1fcb49b7acda..9e4181e539ac 100644
--- a/scripts/kwboot.c
+++ b/scripts/kwboot.c
@@ -600,7 +600,7 @@ out:
 }
 
 static int
-kwboot_check_image(const unsigned char *img, size_t size)
+kwboot_check_image(unsigned char *img, size_t size)
 {
 	size_t i;
 	size_t header_size, image_size;
@@ -613,12 +613,20 @@ kwboot_check_image(const unsigned char *img, size_t size)
 	}
 
 	switch (img[0x0]) {
-		case 0x5a: /* SPI/NOR */
 		case 0x69: /* UART0 */
+			break;
+
+		case 0x5a: /* SPI/NOR */
 		case 0x78: /* SATA */
 		case 0x8b: /* NAND */
 		case 0x9c: /* PCIe */
+			/* change boot source to UART and fix checksum */
+			img[0x1f] -= img[0x0];
+			img[0x1f] += 0x69;
+			img[0x0] = 0x69;
+
 			break;
+
 		default:
 			fprintf(stderr,
 				"Unknown boot source: 0x%hhx\n", img[0x0]);
@@ -674,7 +682,7 @@ kwboot_mmap_image(const char *path, size_t *size)
 	if (rc)
 		goto out;
 
-	img = mmap(NULL, st.st_size, PROT_READ, MAP_SHARED, fd, 0);
+	img = mmap(NULL, st.st_size, PROT_WRITE, MAP_PRIVATE, fd, 0);
 	if (img == MAP_FAILED) {
 		img = NULL;
 		goto out;
-- 
2.9.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply related

* [PATCH 2/7] scripts: kwboot: flush input and output only once
From: Uwe Kleine-König @ 2016-09-28 18:50 UTC (permalink / raw)
  To: barebox
In-Reply-To: <20160928185017.25002-1-u.kleine-koenig@pengutronix.de>

When flushing input before sending of a boot message the acknowledging
reply for the previous message from the CPU might be discarded and so
missed.

So only flush once before sending boot messages in a loop.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 scripts/kwboot.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/scripts/kwboot.c b/scripts/kwboot.c
index 9d680dc576a7..9dfaf4a8dfb0 100644
--- a/scripts/kwboot.c
+++ b/scripts/kwboot.c
@@ -273,11 +273,11 @@ kwboot_bootmsg(int tty, void *msg)
 	else
 		kwboot_printv("Sending boot message. Please reboot the target...");
 
-	do {
-		rc = tcflush(tty, TCIOFLUSH);
-		if (rc)
-			break;
+	rc = tcflush(tty, TCIOFLUSH);
+	if (rc)
+		return rc;
 
+	do {
 		rc = kwboot_tty_send(tty, msg, 8);
 		if (rc) {
 			usleep(KWBOOT_MSG_REQ_DELAY * 1000);
@@ -302,13 +302,13 @@ kwboot_debugmsg(int tty, void *msg)
 
 	kwboot_printv("Sending debug message. Please reboot the target...");
 
+	rc = tcflush(tty, TCIOFLUSH);
+	if (rc)
+		return rc;
+
 	do {
 		char buf[16];
 
-		rc = tcflush(tty, TCIOFLUSH);
-		if (rc)
-			break;
-
 		rc = kwboot_tty_send(tty, msg, 8);
 		if (rc) {
 			usleep(KWBOOT_MSG_REQ_DELAY * 1000);
-- 
2.9.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply related

* [PATCH 4/7] scripts: kwboot: shorten delay between two boot messages
From: Uwe Kleine-König @ 2016-09-28 18:50 UTC (permalink / raw)
  To: barebox
In-Reply-To: <20160928185017.25002-1-u.kleine-koenig@pengutronix.de>

Together with the previous changes that allow to handle the scenario where
too many messages were sent, this greatly improves the probability to hit
the time window during which the CPU accepts a boot message.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 scripts/kwboot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/kwboot.c b/scripts/kwboot.c
index 0a089b593625..58ea1ad7a7b3 100644
--- a/scripts/kwboot.c
+++ b/scripts/kwboot.c
@@ -36,7 +36,7 @@ static unsigned char kwboot_msg_debug[] = {
 };
 
 #define KWBOOT_MSG_REQ_DELAY	1000 /* ms */
-#define KWBOOT_MSG_RSP_TIMEO	1000 /* ms */
+#define KWBOOT_MSG_RSP_TIMEO	1 /* ms */
 
 /*
  * Xmodem Transfers
-- 
2.9.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply related

* [PATCH 7/7] images: mvebu: don't generate uart images
From: Uwe Kleine-König @ 2016-09-28 18:50 UTC (permalink / raw)
  To: barebox
In-Reply-To: <20160928185017.25002-1-u.kleine-koenig@pengutronix.de>

kwboot knows how to work with an image for a different boot medium now.
So there is no reason to generate a dedicated UART image any more.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 images/Makefile.mvebu | 29 -----------------------------
 1 file changed, 29 deletions(-)

diff --git a/images/Makefile.mvebu b/images/Makefile.mvebu
index 195f48d47073..c925afd4a2f5 100644
--- a/images/Makefile.mvebu
+++ b/images/Makefile.mvebu
@@ -6,110 +6,81 @@
 # ----------------------------------------------------------------
 $(obj)/%.kwbimg: $(obj)/% FORCE
 	$(call if_changed,kwb_image)
-$(obj)/%.kwbuartimg: $(obj)/% FORCE
-	$(call if_changed,kwb_image)
 
 KWBOPTS = -c -d 0x1000000 -e 0x1000000
 
 # ----------------------- Armada 370 based boards ---------------------------
 GLOBALSCALE_MIRABOX_KWBOPTS = ${KWBOPTS} -i $(board)/globalscale-mirabox/kwbimage.cfg
 OPTS_start_globalscale_mirabox.pblx.kwbimg = $(GLOBALSCALE_MIRABOX_KWBOPTS)
-OPTS_start_globalscale_mirabox.pblx.kwbuartimg = -m uart $(GLOBALSCALE_MIRABOX_KWBOPTS)
 FILE_barebox-globalscale-mirabox.img	= start_globalscale_mirabox.pblx.kwbimg
-FILE_barebox-globalscale-mirabox-uart.img = start_globalscale_mirabox.pblx.kwbuartimg
 FILE_barebox-globalscale-mirabox-2nd.img = start_globalscale_mirabox.pblx
 pblx-$(CONFIG_MACH_GLOBALSCALE_MIRABOX) += start_globalscale_mirabox
 image-$(CONFIG_MACH_GLOBALSCALE_MIRABOX) += barebox-globalscale-mirabox.img
-image-$(CONFIG_MACH_GLOBALSCALE_MIRABOX) += barebox-globalscale-mirabox-uart.img
 image-$(CONFIG_MACH_GLOBALSCALE_MIRABOX) += barebox-globalscale-mirabox-2nd.img
 
 NETGEAR_RN104_KWBOPTS = ${KWBOPTS} -i $(board)/netgear-rn104/kwbimage.cfg
 OPTS_start_netgear_rn104.pblx.kwbimg = $(NETGEAR_RN104_KWBOPTS)
-OPTS_start_netgear_rn104.pblx.kwbuartimg = -m uart $(NETGEAR_RN104_KWBOPTS)
 FILE_barebox-netgear-rn104.img	= start_netgear_rn104.pblx.kwbimg
-FILE_barebox-netgear-rn104-uart.img = start_netgear_rn104.pblx.kwbuartimg
 FILE_barebox-netgear-rn104-2nd.img = start_netgear_rn104.pblx
 pblx-$(CONFIG_MACH_NETGEAR_RN104) += start_netgear_rn104
 image-$(CONFIG_MACH_NETGEAR_RN104) += barebox-netgear-rn104.img
-image-$(CONFIG_MACH_NETGEAR_RN104) += barebox-netgear-rn104-uart.img
 image-$(CONFIG_MACH_NETGEAR_RN104) += barebox-netgear-rn104-2nd.img
 
 # ----------------------- Armada XP based boards ---------------------------
 LENOVO_IX4_300D_KWBOPTS = ${KWBOPTS} -i $(board)/lenovo-ix4-300d/kwbimage.cfg
 OPTS_start_lenovo_ix4_300d.pblx.kwbimg = $(LENOVO_IX4_300D_KWBOPTS)
-OPTS_start_lenovo_ix4_300d.pblx.kwbuartimg = -m uart $(LENOVO_IX4_300D_KWBOPTS)
 FILE_barebox-lenovo-ix4-300d.img   = start_lenovo_ix4_300d.pblx.kwbimg
-FILE_barebox-lenovo-ix4-300d-uart.img = start_lenovo_ix4_300d.pblx.kwbuartimg
 FILE_barebox-lenovo-ix4-300d-2nd.img = start_lenovo_ix4_300d.pblx
 pblx-$(CONFIG_MACH_LENOVO_IX4_300D) += start_lenovo_ix4_300d
 image-$(CONFIG_MACH_LENOVO_IX4_300D) += barebox-lenovo-ix4-300d.img
-image-$(CONFIG_MACH_LENOVO_IX4_300D) += barebox-lenovo-ix4-300d-uart.img
 image-$(CONFIG_MACH_LENOVO_IX4_300D) += barebox-lenovo-ix4-300d-2nd.img
 
 MARVELL_ARMADA_XP_GP_KWBOPTS = ${KWBOPTS} -i $(board)/marvell-armada-xp-gp/kwbimage.cfg
 OPTS_start_marvell_armada_xp_gp.pblx.kwbimg = $(MARVELL_ARMADA_XP_GP_KWBOPTS)
-OPTS_start_marvell_armada_xp_gp.pblx.kwbuartimg = -m uart $(MARVELL_ARMADA_XP_GP_KWBOPTS)
 FILE_barebox-marvell-armada-xp-gp.img   = start_marvell_armada_xp_gp.pblx.kwbimg
-FILE_barebox-marvell-armada-xp-gp-uart.img = start_marvell_armada_xp_gp.pblx.kwbuartimg
 FILE_barebox-marvell-armada-xp-gp-2nd.img = start_marvell_armada_xp_gp.pblx
 pblx-$(CONFIG_MACH_MARVELL_ARMADA_XP_GP) += start_marvell_armada_xp_gp
 image-$(CONFIG_MACH_MARVELL_ARMADA_XP_GP) += barebox-marvell-armada-xp-gp.img
-image-$(CONFIG_MACH_MARVELL_ARMADA_XP_GP) += barebox-marvell-armada-xp-gp-uart.img
 image-$(CONFIG_MACH_MARVELL_ARMADA_XP_GP) += barebox-marvell-armada-xp-gp-2nd.img
 
 PLATHOME_OPENBLOCKS_AX3_KWBOPTS = ${KWBOPTS} -i $(board)/plathome-openblocks-ax3/kwbimage.cfg
 OPTS_start_plathome_openblocks_ax3.pblx.kwbimg = $(PLATHOME_OPENBLOCKS_AX3_KWBOPTS)
-OPTS_start_plathome_openblocks_ax3.pblx.kwbuartimg = -m uart $(PLATHOME_OPENBLOCKS_AX3_KWBOPTS)
 FILE_barebox-plathome-openblocks-ax3.img   = start_plathome_openblocks_ax3.pblx.kwbimg
-FILE_barebox-plathome-openblocks-ax3-uart.img = start_plathome_openblocks_ax3.pblx.kwbuartimg
 FILE_barebox-plathome-openblocks-ax3-2nd.img = start_plathome_openblocks_ax3.pblx
 pblx-$(CONFIG_MACH_PLATHOME_OPENBLOCKS_AX3) += start_plathome_openblocks_ax3
 image-$(CONFIG_MACH_PLATHOME_OPENBLOCKS_AX3) += barebox-plathome-openblocks-ax3.img
-image-$(CONFIG_MACH_PLATHOME_OPENBLOCKS_AX3) += barebox-plathome-openblocks-ax3-uart.img
 image-$(CONFIG_MACH_PLATHOME_OPENBLOCKS_AX3) += barebox-plathome-openblocks-ax3-2nd.img
 
 # ----------------------- Dove 88AP510 based boards ---------------------------
 SOLIDRUN_CUBOX_KWBOPTS = ${KWBOPTS} -i $(board)/solidrun-cubox/kwbimage.cfg
 OPTS_start_solidrun_cubox.pblx.kwbimg = $(SOLIDRUN_CUBOX_KWBOPTS)
-OPTS_start_solidrun_cubox.pblx.kwbuartimg = -m uart $(SOLIDRUN_CUBOX_KWBOPTS)
 FILE_barebox-solidrun-cubox.img	= start_solidrun_cubox.pblx.kwbimg
-FILE_barebox-solidrun-cubox-uart.img = start_solidrun_cubox.pblx.kwbuartimg
 FILE_barebox-solidrun-cubox-2nd.img = start_solidrun_cubox.pblx
 pblx-$(CONFIG_MACH_SOLIDRUN_CUBOX) += start_solidrun_cubox
 image-$(CONFIG_MACH_SOLIDRUN_CUBOX) += barebox-solidrun-cubox.img
-image-$(CONFIG_MACH_SOLIDRUN_CUBOX) += barebox-solidrun-cubox-uart.img
 image-$(CONFIG_MACH_SOLIDRUN_CUBOX) += barebox-solidrun-cubox-2nd.img
 
 # ----------------------- Kirkwood based boards ---------------------------
 GLOBALSCALE_GURUPLUG_KWBOPTS = ${KWBOPTS} -i $(board)/globalscale-guruplug/kwbimage.cfg
 OPTS_start_globalscale_guruplug.pblx.kwbimg = $(GLOBALSCALE_GURUPLUG_KWBOPTS)
-OPTS_start_globalscale_guruplug.pblx.kwbuartimg = -m uart $(GLOBALSCALE_GURUPLUG_KWBOPTS)
 FILE_barebox-globalscale-guruplug.img	= start_globalscale_guruplug.pblx.kwbimg
-FILE_barebox-globalscale-guruplug-uart.img = start_globalscale_guruplug.pblx.kwbuartimg
 FILE_barebox-globalscale-guruplug-2nd.img = start_globalscale_guruplug.pblx
 pblx-$(CONFIG_MACH_GLOBALSCALE_GURUPLUG) += start_globalscale_guruplug
 image-$(CONFIG_MACH_GLOBALSCALE_GURUPLUG) += barebox-globalscale-guruplug.img
-image-$(CONFIG_MACH_GLOBALSCALE_GURUPLUG) += barebox-globalscale-guruplug-uart.img
 image-$(CONFIG_MACH_GLOBALSCALE_GURUPLUG) += barebox-globalscale-guruplug-2nd.img
 
 PLATHOME_OPENBLOCKS_A6_KWBOPTS = ${KWBOPTS} -i $(board)/plathome-openblocks-a6/kwbimage.cfg
 OPTS_start_plathome_openblocks_a6.pblx.kwbimg = $(PLATHOME_OPENBLOCKS_A6_KWBOPTS)
-OPTS_start_plathome_openblocks_a6.pblx.kwbuartimg = -m uart $(PLATHOME_OPENBLOCKS_A6_KWBOPTS)
 FILE_barebox-plathome-openblocks-a6.img   = start_plathome_openblocks_a6.pblx.kwbimg
-FILE_barebox-plathome-openblocks-a6-uart.img = start_plathome_openblocks_a6.pblx.kwbuartimg
 FILE_barebox-plathome-openblocks-a6-2nd.img = start_plathome_openblocks_a6.pblx
 pblx-$(CONFIG_MACH_PLATHOME_OPENBLOCKS_A6) += start_plathome_openblocks_a6
 image-$(CONFIG_MACH_PLATHOME_OPENBLOCKS_A6) += barebox-plathome-openblocks-a6.img
-image-$(CONFIG_MACH_PLATHOME_OPENBLOCKS_A6) += barebox-plathome-openblocks-a6-uart.img
 image-$(CONFIG_MACH_PLATHOME_OPENBLOCKS_A6) += barebox-plathome-openblocks-a6-2nd.img
 
 USI_TOPKICK_KWBOPTS = ${KWBOPTS} -i $(board)/usi-topkick/kwbimage.cfg
 OPTS_start_usi_topkick.pblx.kwbimg = $(USI_TOPKICK_KWBOPTS)
-OPTS_start_usi_topkick.pblx.kwbuartimg = -m uart $(USI_TOPKICK_KWBOPTS)
 FILE_barebox-usi-topkick.img	= start_usi_topkick.pblx.kwbimg
-FILE_barebox-usi-topkick-uart.img = start_usi_topkick.pblx.kwbuartimg
 FILE_barebox-usi-topkick-2nd.img = start_usi_topkick.pblx
 pblx-$(CONFIG_MACH_USI_TOPKICK) += start_usi_topkick
 image-$(CONFIG_MACH_USI_TOPKICK) += barebox-usi-topkick.img
-image-$(CONFIG_MACH_USI_TOPKICK) += barebox-usi-topkick-uart.img
 image-$(CONFIG_MACH_USI_TOPKICK) += barebox-usi-topkick-2nd.img
-- 
2.9.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply related

* [PATCH 5/7] scripts: kwboot: simplify kwboot_mmap_image
From: Uwe Kleine-König @ 2016-09-28 18:50 UTC (permalink / raw)
  To: barebox
In-Reply-To: <20160928185017.25002-1-u.kleine-koenig@pengutronix.de>

There was only a single caller who passes prot=PROT_READ unconditionally.
So drop this parameter and simplify accordingly.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 scripts/kwboot.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/scripts/kwboot.c b/scripts/kwboot.c
index 58ea1ad7a7b3..1fcb49b7acda 100644
--- a/scripts/kwboot.c
+++ b/scripts/kwboot.c
@@ -657,9 +657,9 @@ kwboot_check_image(const unsigned char *img, size_t size)
 }
 
 static void *
-kwboot_mmap_image(const char *path, size_t *size, int prot)
+kwboot_mmap_image(const char *path, size_t *size)
 {
-	int rc, fd, flags;
+	int rc, fd;
 	struct stat st;
 	void *img;
 
@@ -674,9 +674,7 @@ kwboot_mmap_image(const char *path, size_t *size, int prot)
 	if (rc)
 		goto out;
 
-	flags = (prot & PROT_WRITE) ? MAP_PRIVATE : MAP_SHARED;
-
-	img = mmap(NULL, st.st_size, prot, flags, fd, 0);
+	img = mmap(NULL, st.st_size, PROT_READ, MAP_SHARED, fd, 0);
 	if (img == MAP_FAILED) {
 		img = NULL;
 		goto out;
@@ -793,7 +791,7 @@ main(int argc, char **argv)
 	}
 
 	if (imgpath) {
-		img = kwboot_mmap_image(imgpath, &size, PROT_READ);
+		img = kwboot_mmap_image(imgpath, &size);
 		if (!img) {
 			perror(imgpath);
 			goto out;
-- 
2.9.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply related

* [PATCH 3/7] scripts: kwboot: improve diagnostic output
From: Uwe Kleine-König @ 2016-09-28 18:50 UTC (permalink / raw)
  To: barebox
In-Reply-To: <20160928185017.25002-1-u.kleine-koenig@pengutronix.de>

After entering uart boot mode the CPU prints some diagnostic messages.
Showing them to the user helps her to notice when the message window was
missed or there is an other problem.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 scripts/kwboot.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/scripts/kwboot.c b/scripts/kwboot.c
index 9dfaf4a8dfb0..0a089b593625 100644
--- a/scripts/kwboot.c
+++ b/scripts/kwboot.c
@@ -9,6 +9,7 @@
  *   2008. Chapter 24.2 "BootROM Firmware".
  */
 
+#include <ctype.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -285,12 +286,20 @@ kwboot_bootmsg(int tty, void *msg)
 		}
 
 		rc = kwboot_tty_recv(tty, &c, 1, KWBOOT_MSG_RSP_TIMEO);
-
-		kwboot_spinner();
+		while (!rc && c != NAK) {
+			if (c == '\\')
+				kwboot_printv("\\\\", c);
+			else if (isprint(c) || c == '\r' || c == '\n')
+				kwboot_printv("%c", c);
+			else
+				kwboot_printv("\\x%02hhx", c);
+
+			rc = kwboot_tty_recv(tty, &c, 1, KWBOOT_MSG_RSP_TIMEO);
+		}
 
 	} while (rc || c != NAK);
 
-	kwboot_printv("\n");
+	kwboot_printv("\nGot expected NAK\n");
 
 	return rc;
 }
-- 
2.9.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply related

* [PATCH 1/7] scripts: kwboot: try to resync on packet boundary after receiving a NAK
From: Uwe Kleine-König @ 2016-09-28 18:50 UTC (permalink / raw)
  To: barebox
In-Reply-To: <20160928185017.25002-1-u.kleine-koenig@pengutronix.de>

If we sent the boot message too often the CPU might already have started
to interpret this as an xmodem packet. As sender and receiver are not in
sync it's impossible to transfer a packet successfully.

After inspecting the bootROM of an Armada XP machine (version 1.20) I found
that on sending 0xff the CPU replies with a NAK when waiting for a packet
and allows to start a new packet with the next byte. This can be used to
resync sender and receiver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 scripts/kwboot.c | 46 +++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 45 insertions(+), 1 deletion(-)

diff --git a/scripts/kwboot.c b/scripts/kwboot.c
index 9b0d1d0602a0..9d680dc576a7 100644
--- a/scripts/kwboot.c
+++ b/scripts/kwboot.c
@@ -349,6 +349,48 @@ kwboot_xm_makeblock(struct kwboot_block *block, const void *data,
 	return n;
 }
 
+#define min(a, b) ((a) < (b) ? (a) : (b))
+
+static int
+kwboot_xm_resync(int fd)
+{
+	/*
+	 * When the SoC has a different perception of where the package boundary
+	 * is, just resending the packet doesn't help. To resync send 0xff until
+	 * we get another NAK.
+	 * The BootROM code (of the Armada XP at least) doesn't interpret 0xff
+	 * as a start of a package and sends a NAK for each 0xff when waiting
+	 * for SOH, so it's possible to send >1 byte without the SoC starting a
+	 * new frame.
+	 * When there is no response after sizeof(struct kwboot_block) bytes,
+	 * there is another problem.
+	 */
+	int rc;
+	char buf[sizeof(struct kwboot_block)];
+	unsigned interval = 1;
+	unsigned len;
+	char *p = buf;
+
+	memset(buf, 0xff, sizeof(buf));
+
+	while (interval <= sizeof(buf)) {
+		len = min(interval, buf + sizeof(buf) - p);
+		rc = kwboot_tty_send(fd, p, len);
+		if (rc)
+			return rc;
+
+		kwboot_tty_recv(fd, p, len, KWBOOT_BLK_RSP_TIMEO);
+		if (*p != 0xff)
+			/* got at least one char, if it's a NAK we're synced. */
+			return (*p == NAK);
+
+		p += len;
+		interval *= 2;
+	}
+
+	return 0;
+}
+
 static int
 kwboot_xm_sendblock(int fd, struct kwboot_block *block)
 {
@@ -371,7 +413,9 @@ kwboot_xm_sendblock(int fd, struct kwboot_block *block)
 
 		} while (c != ACK && c != NAK && c != CAN);
 
-		if (c != ACK)
+		if (c == NAK && kwboot_xm_resync(fd))
+			kwboot_progress(-1, 'S');
+		else if (c != ACK)
 			kwboot_progress(-1, '+');
 
 	} while (c == NAK && retries-- > 0);
-- 
2.9.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply related

* [PATCH 0/7] scripts: kwboot: various improvements
From: Uwe Kleine-König @ 2016-09-28 18:50 UTC (permalink / raw)
  To: barebox

Hello,

this series is the result of my efforts to make UART booting on an
Netgear ReadyNAS 2120 work.

Best regards
Uwe

Uwe Kleine-König (7):
  scripts: kwboot: try to resync on packet boundary after receiving a
    NAK
  scripts: kwboot: flush input and output only once
  scripts: kwboot: improve diagnostic output
  scripts: kwboot: shorten delay between two boot messages
  scripts: kwboot: simplify kwboot_mmap_image
  scripts: kwboot: set boot source to UART before sending
  images: mvebu: don't generate uart images

 images/Makefile.mvebu |  29 ---------------
 scripts/kwboot.c      | 101 +++++++++++++++++++++++++++++++++++++++-----------
 2 files changed, 80 insertions(+), 50 deletions(-)

-- 
2.9.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply

* [PATCH] pinctrl: mvebu: add newline to error message
From: Uwe Kleine-König @ 2016-09-28 19:51 UTC (permalink / raw)
  To: Sebastian Hesselbarth, barebox

Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
---
 drivers/pinctrl/mvebu/common.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/pinctrl/mvebu/common.c b/drivers/pinctrl/mvebu/common.c
index 532705286795..ae16b39268d7 100644
--- a/drivers/pinctrl/mvebu/common.c
+++ b/drivers/pinctrl/mvebu/common.c
@@ -78,7 +78,8 @@ static int mvebu_pinctrl_set_state(struct pinctrl_device *pdev,
 
 		set = mvebu_pinctrl_find_setting_by_name(pctl, mode, function);
 		if (!set) {
-			dev_err(pdev->dev, "unsupported function %s on pin %s",
+			dev_err(pdev->dev,
+				"unsupported function %s on pin %s\n",
 				function, group);
 			continue;
 		}
-- 
2.8.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply related

* [PATCH 6/9] phy: Introduce to_usbphy conversion function
From: Sascha Hauer @ 2016-09-29 12:38 UTC (permalink / raw)
  To: Barebox List
In-Reply-To: <20160929123900.24853-1-s.hauer@pengutronix.de>

The generic phy support layer has the necessary list handling
and phy retrieval functions, so we should reuse them for usb
phys. This adds a phy_to_usbphy() conversion function which
drivers can implement which attach to the generic phy layer
and are really usb phys.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/phy/phy-core.c  | 12 ++++++++++++
 include/linux/phy/phy.h |  8 ++++++++
 2 files changed, 20 insertions(+)

diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
index 7c1f3d4..1b6a9f7 100644
--- a/drivers/phy/phy-core.c
+++ b/drivers/phy/phy-core.c
@@ -15,6 +15,7 @@
 #include <common.h>
 #include <malloc.h>
 #include <linux/phy/phy.h>
+#include <usb/phy.h>
 
 static LIST_HEAD(phy_provider_list);
 static int phy_ida;
@@ -201,6 +202,17 @@ int phy_power_off(struct phy *phy)
 	return 0;
 }
 
+struct usb_phy *phy_to_usbphy(struct phy *phy)
+{
+	if (!phy)
+		return NULL;
+
+	if (!phy->ops->to_usbphy)
+		return ERR_PTR(-EINVAL);
+
+	return phy->ops->to_usbphy(phy);
+}
+
 static struct phy_provider *of_phy_provider_lookup(struct device_node *node)
 {
 	struct phy_provider *phy_provider;
diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h
index 0d78923..5d96e02 100644
--- a/include/linux/phy/phy.h
+++ b/include/linux/phy/phy.h
@@ -33,6 +33,7 @@ struct phy_ops {
 	int	(*exit)(struct phy *phy);
 	int	(*power_on)(struct phy *phy);
 	int	(*power_off)(struct phy *phy);
+	struct usb_phy *(*to_usbphy)(struct phy *phy);
 };
 
 /**
@@ -150,6 +151,7 @@ struct phy_provider *__of_phy_provider_register(struct device_d *dev,
 	struct phy * (*of_xlate)(struct device_d *dev,
 	struct of_phandle_args *args));
 void of_phy_provider_unregister(struct phy_provider *phy_provider);
+struct usb_phy *phy_to_usbphy(struct phy *phy);
 #else
 static inline int phy_init(struct phy *phy)
 {
@@ -243,6 +245,12 @@ static inline struct phy_provider *__of_phy_provider_register(
 static inline void of_phy_provider_unregister(struct phy_provider *phy_provider)
 {
 }
+
+static inline struct usb_phy *phy_to_usbphy(struct phy *phy)
+{
+	return NULL;
+}
+
 #endif
 
 #endif /* __DRIVERS_PHY_H */
-- 
2.9.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply related

* [PATCH 7/9] phy: Add usb-nop-xceiv support
From: Sascha Hauer @ 2016-09-29 12:38 UTC (permalink / raw)
  To: Barebox List
In-Reply-To: <20160929123900.24853-1-s.hauer@pengutronix.de>

Add a nop usb transcveiver driver. At the moment it does nothing,
so is nothing more than a driver to satisfy the device tree
dependencies. clk / vbus-regulator / vbus-detect-gpio support can be
added later.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/phy/Kconfig         |  15 +++++--
 drivers/phy/Makefile        |   1 +
 drivers/phy/usb-nop-xceiv.c | 104 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 116 insertions(+), 4 deletions(-)
 create mode 100644 drivers/phy/usb-nop-xceiv.c

diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig
index e9461e1..b0c8b9b 100644
--- a/drivers/phy/Kconfig
+++ b/drivers/phy/Kconfig
@@ -2,9 +2,7 @@
 # PHY
 #
 
-menu "PHY Subsystem"
-
-config GENERIC_PHY
+menuconfig GENERIC_PHY
 	bool "PHY Core"
 	help
 	  Generic PHY support.
@@ -15,4 +13,13 @@ config GENERIC_PHY
 	  phy users can obtain reference to the PHY. All the users of this
 	  framework should select this config.
 
-endmenu
+if GENERIC_PHY
+
+config USB_NOP_XCEIV
+	bool "Generic USB nop phy"
+	help
+	  This driver is to be used by all the usb transceiver which are either
+	  built-in with usb ip or which are autonomous and doesn't require any
+	  phy programming such as ISP1x04 etc.
+
+endif
diff --git a/drivers/phy/Makefile b/drivers/phy/Makefile
index 74514ae..8fc8595 100644
--- a/drivers/phy/Makefile
+++ b/drivers/phy/Makefile
@@ -3,3 +3,4 @@
 #
 
 obj-$(CONFIG_GENERIC_PHY)		+= phy-core.o
+obj-$(CONFIG_USB_NOP_XCEIV)		+= usb-nop-xceiv.o
diff --git a/drivers/phy/usb-nop-xceiv.c b/drivers/phy/usb-nop-xceiv.c
new file mode 100644
index 0000000..606e098
--- /dev/null
+++ b/drivers/phy/usb-nop-xceiv.c
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2016 Sascha Hauer <s.hauer@pengutronix.de>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * for more details.
+ */
+
+#include <common.h>
+#include <init.h>
+#include <of.h>
+#include <errno.h>
+#include <driver.h>
+#include <malloc.h>
+#include <usb/phy.h>
+#include <linux/phy/phy.h>
+#include <linux/clk.h>
+#include <linux/err.h>
+
+struct nop_usbphy {
+	struct usb_phy usb_phy;
+	struct phy *phy;
+	struct phy_provider *provider;
+};
+
+static struct phy *nop_usbphy_xlate(struct device_d *dev,
+				    struct of_phandle_args *args)
+{
+	struct nop_usbphy *nopphy = dev->priv;
+
+	return nopphy->phy;
+}
+
+static struct usb_phy *nop_usbphy_to_usbphy(struct phy *phy)
+{
+	struct nop_usbphy *nopphy = phy_get_drvdata(phy);
+
+	return &nopphy->usb_phy;
+}
+
+static const struct phy_ops nop_phy_ops = {
+	.to_usbphy = nop_usbphy_to_usbphy,
+};
+
+static int nop_usbphy_probe(struct device_d *dev)
+{
+	int ret;
+	struct nop_usbphy *nopphy;
+
+	nopphy = xzalloc(sizeof(*nopphy));
+
+	dev->priv = nopphy;
+
+	/* FIXME: Add clk support */
+	/* FIXME: Add vbus regulator support */
+	/* FIXME: Add vbus-detect-gpio support */
+
+	nopphy->usb_phy.dev = dev;
+	nopphy->phy = phy_create(dev, NULL, &nop_phy_ops, NULL);
+	if (IS_ERR(nopphy->phy)) {
+		ret = PTR_ERR(nopphy->phy);
+		goto err_free;
+	}
+
+	phy_set_drvdata(nopphy->phy, nopphy);
+
+	nopphy->provider = of_phy_provider_register(dev, nop_usbphy_xlate);
+	if (IS_ERR(nopphy->provider)) {
+		ret = PTR_ERR(nopphy->provider);
+		goto err_free;
+	}
+
+	return 0;
+err_free:
+	free(nopphy);
+
+	return ret;
+};
+
+static __maybe_unused struct of_device_id nop_usbphy_dt_ids[] = {
+	{
+		.compatible = "usb-nop-xceiv",
+	}, {
+		/* sentinel */
+	},
+};
+
+static struct driver_d nop_usbphy_driver = {
+	.name   = "usb-nop-xceiv",
+	.probe  = nop_usbphy_probe,
+	.of_compatible = DRV_OF_COMPAT(nop_usbphy_dt_ids),
+};
+
+static int nop_usbphy_init(void)
+{
+	return platform_driver_register(&nop_usbphy_driver);
+}
+fs_initcall(nop_usbphy_init);
-- 
2.9.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox