mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 03/10] video: tc358767: depend on EDID helpers
From: Lucas Stach @ 2016-09-30 10:36 UTC (permalink / raw)
  To: barebox
In-Reply-To: <20160930103607.15791-1-l.stach@pengutronix.de>

The eDP part need to be able to read the panel EDID.

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

diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 2457bb9e45f9..8f31f5af745e 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -130,6 +130,7 @@ config DRIVER_VIDEO_MTL017
 config DRIVER_VIDEO_TC358767
 	bool "TC358767A Display Port encoder"
 	select VIDEO_VPL
+	depends on DRIVER_VIDEO_EDID
 	depends on I2C
 	depends on OFTREE
 	help
-- 
2.9.3


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

^ permalink raw reply related

* [PATCH 01/10] serial: arm_dcc: depend on !CPU_V8
From: Lucas Stach @ 2016-09-30 10:35 UTC (permalink / raw)
  To: barebox

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

* [PATCH 2/2] i.MX: Register imx6_fixup_cpus() for MX6Q+ as well
From: Andrey Smirnov @ 2016-09-29 22:21 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov
In-Reply-To: <1475187703-5748-1-git-send-email-andrew.smirnov@gmail.com>

Register imx6_fixup_cpus() for MX6Q+ as well as for MX6Q and MX6DL.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 arch/arm/mach-imx/imx6.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-imx/imx6.c b/arch/arm/mach-imx/imx6.c
index 101a2f6..809584e 100644
--- a/arch/arm/mach-imx/imx6.c
+++ b/arch/arm/mach-imx/imx6.c
@@ -255,7 +255,8 @@ static int imx6_fixup_cpus(struct device_node *root, void *context)
 
 static int imx6_fixup_cpus_register(void)
 {
-	if (!of_machine_is_compatible("fsl,imx6q") &&
+	if (!of_machine_is_compatible("fsl,imx6qp") &&
+	    !of_machine_is_compatible("fsl,imx6q")  &&
 	    !of_machine_is_compatible("fsl,imx6dl"))
 		return 0;
 
-- 
2.5.5


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

^ permalink raw reply related

* [PATCH 1/2] i.MX: Introduce imx6_cpu_revision()
From: Andrey Smirnov @ 2016-09-29 22:21 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov

Factor out CPU revision identification code from imx6_init() into a
standalone inline function (similar to imx6_cpu_type()), so that it
would be possible to use that functionality in PBL code.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---

Sascha:

I have an almost ready to send, board support patch that uses this in
PBL. Unfortunately at the last minute a regression in functionality
was discovered in that code, so I can't post it until that is
resolved, meanwhile I am hoping I can get this code in while I am
debugging.

Let me know if you'd rathe I send everything together.

 arch/arm/mach-imx/imx6.c              | 38 +----------------------------------
 arch/arm/mach-imx/include/mach/imx6.h | 36 +++++++++++++++++++++++++++++++++
 2 files changed, 37 insertions(+), 37 deletions(-)

diff --git a/arch/arm/mach-imx/imx6.c b/arch/arm/mach-imx/imx6.c
index ba8fb89..101a2f6 100644
--- a/arch/arm/mach-imx/imx6.c
+++ b/arch/arm/mach-imx/imx6.c
@@ -25,8 +25,6 @@
 #include <asm/mmu.h>
 #include <asm/cache-l2x0.h>
 
-#define SI_REV 0x260
-
 void imx6_init_lowlevel(void)
 {
 	void __iomem *aips1 = (void *)MX6_AIPS1_ON_BASE_ADDR;
@@ -115,47 +113,13 @@ void imx6_init_lowlevel(void)
 int imx6_init(void)
 {
 	const char *cputypestr;
-	u32 rev;
 	u32 mx6_silicon_revision;
 
 	imx6_init_lowlevel();
 
 	imx6_boot_save_loc((void *)MX6_SRC_BASE_ADDR);
 
-	rev = readl(MX6_ANATOP_BASE_ADDR + SI_REV);
-
-	switch (rev & 0xfff) {
-	case 0x00:
-		mx6_silicon_revision = IMX_CHIP_REV_1_0;
-		break;
-
-	case 0x01:
-		mx6_silicon_revision = IMX_CHIP_REV_1_1;
-		break;
-
-	case 0x02:
-		mx6_silicon_revision = IMX_CHIP_REV_1_2;
-		break;
-
-	case 0x03:
-		mx6_silicon_revision = IMX_CHIP_REV_1_3;
-		break;
-
-	case 0x04:
-		mx6_silicon_revision = IMX_CHIP_REV_1_4;
-		break;
-
-	case 0x05:
-		mx6_silicon_revision = IMX_CHIP_REV_1_5;
-		break;
-
-	case 0x100:
-		mx6_silicon_revision = IMX_CHIP_REV_2_0;
-		break;
-
-	default:
-		mx6_silicon_revision = IMX_CHIP_REV_UNKNOWN;
-	}
+	mx6_silicon_revision = imx6_cpu_revision();
 
 	switch (imx6_cpu_type()) {
 	case IMX6_CPUTYPE_IMX6Q:
diff --git a/arch/arm/mach-imx/include/mach/imx6.h b/arch/arm/mach-imx/include/mach/imx6.h
index e8ffa47..fb5eaf1 100644
--- a/arch/arm/mach-imx/include/mach/imx6.h
+++ b/arch/arm/mach-imx/include/mach/imx6.h
@@ -4,6 +4,7 @@
 #include <io.h>
 #include <mach/generic.h>
 #include <mach/imx6-regs.h>
+#include <mach/revision.h>
 
 void imx6_init_lowlevel(void);
 
@@ -48,6 +49,41 @@ static inline int imx6_cpu_type(void)
 	return __imx6_cpu_type();
 }
 
+static inline int __imx6_cpu_revision(void)
+{
+
+	uint32_t rev;
+
+	rev = readl(MX6_ANATOP_BASE_ADDR + IMX6_ANATOP_SI_REV);
+
+	switch (rev & 0xfff) {
+	case 0x00:
+		return IMX_CHIP_REV_1_0;
+	case 0x01:
+		return IMX_CHIP_REV_1_1;
+	case 0x02:
+		return IMX_CHIP_REV_1_2;
+	case 0x03:
+		return IMX_CHIP_REV_1_3;
+	case 0x04:
+		return IMX_CHIP_REV_1_4;
+	case 0x05:
+		return IMX_CHIP_REV_1_5;
+	case 0x100:
+		return IMX_CHIP_REV_2_0;
+	}
+
+	return IMX_CHIP_REV_UNKNOWN;
+}
+
+static inline int imx6_cpu_revision(void)
+{
+	if (!cpu_is_mx6())
+		return 0;
+
+	return __imx6_cpu_revision();
+}
+
 #define DEFINE_MX6_CPU_TYPE(str, type)					\
 	static inline int cpu_mx6_is_##str(void)			\
 	{								\
-- 
2.5.5


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

^ permalink raw reply related

* [PATCH 8/9] usb: imx-us-phy: Convert driver to generic phy 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>

The generic phy layer now supports USB phys, so convert
the driver over to use it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/configs/imx_defconfig    |  2 ++
 arch/arm/configs/imx_v7_defconfig |  2 ++
 drivers/usb/imx/Kconfig           |  3 +--
 drivers/usb/imx/chipidea-imx.c    | 21 ++++++++++++++++++
 drivers/usb/imx/imx-usb-phy.c     | 46 +++++++++++++++++++++++++++++++++++++--
 5 files changed, 70 insertions(+), 4 deletions(-)

diff --git a/arch/arm/configs/imx_defconfig b/arch/arm/configs/imx_defconfig
index 69ab021..7d061cd 100644
--- a/arch/arm/configs/imx_defconfig
+++ b/arch/arm/configs/imx_defconfig
@@ -107,6 +107,8 @@ CONFIG_EEPROM_AT24=y
 CONFIG_WATCHDOG=y
 CONFIG_WATCHDOG_IMX=y
 CONFIG_IMX_WEIM=y
+CONFIG_GENERIC_PHY=y
+CONFIG_USB_NOP_XCEIV=y
 CONFIG_FS_EXT4=y
 CONFIG_FS_TFTP=y
 CONFIG_FS_NFS=y
diff --git a/arch/arm/configs/imx_v7_defconfig b/arch/arm/configs/imx_v7_defconfig
index e3a8f47..ac649ac 100644
--- a/arch/arm/configs/imx_v7_defconfig
+++ b/arch/arm/configs/imx_v7_defconfig
@@ -177,6 +177,8 @@ CONFIG_MXS_APBH_DMA=y
 CONFIG_GPIO_STMPE=y
 CONFIG_REGULATOR=y
 CONFIG_REGULATOR_FIXED=y
+CONFIG_GENERIC_PHY=y
+CONFIG_USB_NOP_XCEIV=y
 CONFIG_FS_EXT4=y
 CONFIG_FS_TFTP=y
 CONFIG_FS_NFS=y
diff --git a/drivers/usb/imx/Kconfig b/drivers/usb/imx/Kconfig
index b1ce682..b0c6a41 100644
--- a/drivers/usb/imx/Kconfig
+++ b/drivers/usb/imx/Kconfig
@@ -16,5 +16,4 @@ config USB_IMX_CHIPIDEA
 
 config USB_IMX_PHY
 	bool
-	depends on ARCH_IMX
-	default y if ARCH_IMX6
+	default y if ARCH_IMX6 && GENERIC_PHY
diff --git a/drivers/usb/imx/chipidea-imx.c b/drivers/usb/imx/chipidea-imx.c
index a6f5926..ed00ff4 100644
--- a/drivers/usb/imx/chipidea-imx.c
+++ b/drivers/usb/imx/chipidea-imx.c
@@ -26,6 +26,7 @@
 #include <usb/ulpi.h>
 #include <usb/fsl_usb2.h>
 #include <linux/err.h>
+#include <linux/phy/phy.h>
 
 #define MXC_EHCI_PORTSC_MASK ((0xf << 28) | (1 << 25))
 
@@ -40,6 +41,8 @@ struct imx_chipidea {
 	struct param_d *param_mode;
 	int role_registered;
 	struct regulator *vbus;
+	struct phy *phy;
+	struct usb_phy *usbphy;
 };
 
 static int imx_chipidea_port_init(void *drvdata)
@@ -260,6 +263,23 @@ static int imx_chipidea_probe(struct device_d *dev)
 	if (IS_ERR(ci->vbus))
 		ci->vbus = NULL;
 
+	if (of_property_read_bool(dev->device_node, "fsl,usbphy")) {
+		ci->phy = of_phy_get_by_phandle(dev, "fsl,usbphy", 0);
+		if (IS_ERR(ci->phy)) {
+			ret = PTR_ERR(ci->phy);
+			dev_err(dev, "Cannot get phy: %s\n", strerror(-ret));
+			return ret;
+		} else {
+			ci->usbphy = phy_to_usbphy(ci->phy);
+			if (IS_ERR(ci->usbphy))
+				return PTR_ERR(ci->usbphy);
+
+			ret = phy_init(ci->phy);
+			if (ret)
+				return ret;
+		}
+	}
+
 	iores = dev_request_mem_resource(dev, 0);
 	if (IS_ERR(iores))
 		return PTR_ERR(iores);
@@ -270,6 +290,7 @@ static int imx_chipidea_probe(struct device_d *dev)
 	ci->data.init = imx_chipidea_port_init;
 	ci->data.post_init = imx_chipidea_port_post_init;
 	ci->data.drvdata = ci;
+	ci->data.usbphy = ci->usbphy;
 
 	if ((ci->flags & MXC_EHCI_PORTSC_MASK) == MXC_EHCI_MODE_HSIC)
 		imx_chipidea_port_init(ci);
diff --git a/drivers/usb/imx/imx-usb-phy.c b/drivers/usb/imx/imx-usb-phy.c
index eec195d..2829ffc 100644
--- a/drivers/usb/imx/imx-usb-phy.c
+++ b/drivers/usb/imx/imx-usb-phy.c
@@ -19,6 +19,8 @@
 #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>
 
@@ -33,12 +35,17 @@
 #define USBPHY_CTRL_ENUTMILEVEL2	(1 << 14)
 
 struct imx_usbphy {
+	struct usb_phy usb_phy;
+	struct phy *phy;
 	void __iomem *base;
 	struct clk *clk;
+	struct phy_provider *provider;
 };
 
-static int imx_usbphy_enable(struct imx_usbphy *imxphy)
+static int imx_usbphy_phy_init(struct phy *phy)
 {
+	struct imx_usbphy *imxphy = phy_get_drvdata(phy);
+
 	clk_enable(imxphy->clk);
 
 	/* reset usbphy */
@@ -60,6 +67,26 @@ static int imx_usbphy_enable(struct imx_usbphy *imxphy)
 	return 0;
 }
 
+static struct phy *imx_usbphy_xlate(struct device_d *dev,
+				    struct of_phandle_args *args)
+{
+	struct imx_usbphy *imxphy = dev->priv;
+
+	return imxphy->phy;
+}
+
+static struct usb_phy *imx_usbphy_to_usbphy(struct phy *phy)
+{
+	struct imx_usbphy *imxphy = phy_get_drvdata(phy);
+
+	return &imxphy->usb_phy;
+}
+
+static const struct phy_ops imx_phy_ops = {
+	.init = imx_usbphy_phy_init,
+	.to_usbphy = imx_usbphy_to_usbphy,
+};
+
 static int imx_usbphy_probe(struct device_d *dev)
 {
 	struct resource *iores;
@@ -82,7 +109,22 @@ static int imx_usbphy_probe(struct device_d *dev)
 		goto err_clk;
 	}
 
-	imx_usbphy_enable(imxphy);
+	dev->priv = imxphy;
+
+	imxphy->usb_phy.dev = dev;
+	imxphy->phy = phy_create(dev, NULL, &imx_phy_ops, NULL);
+	if (IS_ERR(imxphy->phy)) {
+		ret = PTR_ERR(imxphy->phy);
+		goto err_clk;
+	}
+
+	phy_set_drvdata(imxphy->phy, imxphy);
+
+	imxphy->provider = of_phy_provider_register(dev, imx_usbphy_xlate);
+	if (IS_ERR(imxphy->provider)) {
+		ret = PTR_ERR(imxphy->provider);
+		goto err_clk;
+	}
 
 	dev_dbg(dev, "phy enabled\n");
 
-- 
2.9.3


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

^ permalink raw reply related

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

Currently generic phy support assumes that the standard phy binding from
dts/Bindings/phy/phy-bindings.txt is used. This adds a helper function
which can be used to retrieve a phy when this standard binding is not
used.

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

diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
index 67af14f..7c1f3d4 100644
--- a/drivers/phy/phy-core.c
+++ b/drivers/phy/phy-core.c
@@ -268,6 +268,42 @@ struct phy *of_phy_get(struct device_node *np, const char *con_id)
 }
 
 /**
+ * of_phy_get_by_phandle() - lookup and obtain a reference to a phy.
+ * @dev: device that requests this phy
+ * @phandle - name of the property holding the phy phandle value
+ * @index - the index of the phy
+ *
+ * Returns the phy driver, after getting a refcount to it; or
+ * -ENODEV if there is no such phy. The caller is responsible for
+ * calling phy_put() to release that count.
+ */
+struct phy *of_phy_get_by_phandle(struct device_d *dev, const char *phandle,
+				  u8 index)
+{
+	struct device_node *np;
+	struct phy_provider *phy_provider;
+
+	if (!dev->device_node) {
+		dev_dbg(dev, "device does not have a device node entry\n");
+		return ERR_PTR(-EINVAL);
+	}
+
+	np = of_parse_phandle(dev->device_node, phandle, index);
+	if (!np) {
+		dev_dbg(dev, "failed to get %s phandle in %s node\n", phandle,
+			dev->device_node->full_name);
+		return ERR_PTR(-ENODEV);
+	}
+
+	phy_provider = of_phy_provider_lookup(np);
+	if (IS_ERR(phy_provider)) {
+		return ERR_PTR(-ENODEV);
+	}
+
+	return phy_provider->of_xlate(phy_provider->dev, NULL);
+}
+
+/**
  * phy_get() - lookup and obtain a reference to a phy.
  * @dev: device that requests this phy
  * @string: the phy name as given in the dt data or the name of the controller
diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h
index 94f0044..0d78923 100644
--- a/include/linux/phy/phy.h
+++ b/include/linux/phy/phy.h
@@ -136,6 +136,8 @@ static inline void phy_set_bus_width(struct phy *phy, int bus_width)
 }
 struct phy *phy_get(struct device_d *dev, const char *string);
 struct phy *phy_optional_get(struct device_d *dev, const char *string);
+struct phy *of_phy_get_by_phandle(struct device_d *dev, const char *phandle,
+				  u8 index);
 void phy_put(struct phy *phy);
 struct phy *of_phy_get(struct device_node *np, const char *con_id);
 struct phy *of_phy_simple_xlate(struct device_d *dev,
@@ -198,6 +200,12 @@ static inline struct phy *phy_optional_get(struct device_d *dev,
 	return ERR_PTR(-ENOSYS);
 }
 
+static inline struct phy *of_phy_get_by_phandle(struct device_d *dev,
+						const char *phandle, u8 index)
+{
+	return ERR_PTR(-ENOSYS);
+}
+
 static inline void phy_put(struct phy *phy)
 {
 }
-- 
2.9.3


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

^ permalink raw reply related

* [PATCH 1/9] usb: Use standard debug macro
From: Sascha Hauer @ 2016-09-29 12:38 UTC (permalink / raw)
  To: Barebox List

Use standard pr_debug instead of homebrew USB_PRINTF

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/usb/core/usb.c | 52 ++++++++++++++++++++++++--------------------------
 1 file changed, 25 insertions(+), 27 deletions(-)

diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index ce229f2..aba2da0 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -40,6 +40,9 @@
  *
  * For each transfer (except "Interrupt") we wait for completion.
  */
+
+#define pr_fmt(fmt) "usb: " fmt
+
 #include <common.h>
 #include <command.h>
 #include <malloc.h>
@@ -56,14 +59,6 @@
 #include "usb.h"
 #include "hub.h"
 
-/* #define USB_DEBUG */
-
-#ifdef	USB_DEBUG
-#define	USB_PRINTF(fmt, args...)	printf(fmt , ##args)
-#else
-#define USB_PRINTF(fmt, args...)
-#endif
-
 #define USB_BUFSIZ	512
 
 static int dev_count;
@@ -113,7 +108,9 @@ int usb_register_host(struct usb_host *host)
 static int usb_set_configuration(struct usb_device *dev, int configuration)
 {
 	int res;
-	USB_PRINTF("set configuration %d\n", configuration);
+
+	pr_debug("set configuration %d\n", configuration);
+
 	/* set setup command */
 	res = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
 				USB_REQ_SET_CONFIGURATION, 0,
@@ -147,21 +144,21 @@ usb_set_maxpacket_ep(struct usb_device *dev, struct usb_endpoint_descriptor *ep)
 		/* Control => bidirectional */
 		dev->epmaxpacketout[b] = ep->wMaxPacketSize;
 		dev->epmaxpacketin[b] = ep->wMaxPacketSize;
-		USB_PRINTF("##Control EP epmaxpacketout/in[%d] = %d\n",
+		pr_debug("##Control EP epmaxpacketout/in[%d] = %d\n",
 			   b, dev->epmaxpacketin[b]);
 	} else {
 		if ((ep->bEndpointAddress & 0x80) == 0) {
 			/* OUT Endpoint */
 			if (ep->wMaxPacketSize > dev->epmaxpacketout[b]) {
 				dev->epmaxpacketout[b] = ep->wMaxPacketSize;
-				USB_PRINTF("##EP epmaxpacketout[%d] = %d\n",
+				pr_debug("##EP epmaxpacketout[%d] = %d\n",
 					   b, dev->epmaxpacketout[b]);
 			}
 		} else {
 			/* IN Endpoint */
 			if (ep->wMaxPacketSize > dev->epmaxpacketin[b]) {
 				dev->epmaxpacketin[b] = ep->wMaxPacketSize;
-				USB_PRINTF("##EP epmaxpacketin[%d] = %d\n",
+				pr_debug("##EP epmaxpacketin[%d] = %d\n",
 					   b, dev->epmaxpacketin[b]);
 			}
 		} /* if out */
@@ -250,20 +247,20 @@ static int usb_parse_config(struct usb_device *dev, unsigned char *buffer, int c
 				&buffer[index], buffer[index]);
 			le16_to_cpus(&(dev->config.interface[ifno].ep_desc[epno].\
 							       wMaxPacketSize));
-			USB_PRINTF("if %d, ep %d\n", ifno, epno);
+			pr_debug("if %d, ep %d\n", ifno, epno);
 			break;
 		default:
 			if (head->bLength == 0)
 				return 1;
 
-			USB_PRINTF("unknown Description Type : %x\n",
+			pr_debug("unknown Description Type : %x\n",
 				   head->bDescriptorType);
 
 			{
 				ch = (unsigned char *)head;
 				for (i = 0; i < head->bLength; i++)
-					USB_PRINTF("%02X ", *ch++);
-				USB_PRINTF("\n\n\n");
+					pr_debug("%02X ", *ch++);
+				pr_debug("\n\n\n");
 			}
 			break;
 		}
@@ -281,7 +278,8 @@ static int usb_set_address(struct usb_device *dev)
 {
 	int res;
 
-	USB_PRINTF("set address %d\n", dev->devnum);
+	pr_debug("set address %d\n", dev->devnum);
+
 	res = usb_control_msg(dev, usb_snddefctrl(dev),
 				USB_REQ_SET_ADDRESS, 0,
 				(dev->devnum), 0,
@@ -345,7 +343,7 @@ int usb_new_device(struct usb_device *dev)
 
 	err = usb_get_descriptor(dev, USB_DT_DEVICE, 0, desc, 64);
 	if (err < 0) {
-		USB_PRINTF("%s: usb_get_descriptor() failed with %d\n", __func__, err);
+		pr_debug("%s: usb_get_descriptor() failed with %d\n", __func__, err);
 		goto err_out;
 	}
 
@@ -417,7 +415,7 @@ int usb_new_device(struct usb_device *dev)
 			"len %d, status %lX\n", dev->act_len, dev->status);
 		goto err_out;
 	}
-	USB_PRINTF("new device: Mfr=%d, Product=%d, SerialNumber=%d\n",
+	pr_debug("new device: Mfr=%d, Product=%d, SerialNumber=%d\n",
 		   dev->descriptor->iManufacturer, dev->descriptor->iProduct,
 		   dev->descriptor->iSerialNumber);
 	memset(dev->mf, 0, sizeof(dev->mf));
@@ -624,7 +622,7 @@ int usb_control_msg(struct usb_device *dev, unsigned int pipe,
 	setup_packet->value = cpu_to_le16(value);
 	setup_packet->index = cpu_to_le16(index);
 	setup_packet->length = cpu_to_le16(size);
-	USB_PRINTF("usb_control_msg: request: 0x%X, requesttype: 0x%X, " \
+	pr_debug("usb_control_msg: request: 0x%X, requesttype: 0x%X, " \
 		   "value 0x%X index 0x%X length 0x%X\n",
 		   request, requesttype, value, index, size);
 	dev->status = USB_ST_NOT_PROC; /*not yet processed */
@@ -744,13 +742,13 @@ int usb_get_configuration_no(struct usb_device *dev,
 	tmp = le16_to_cpu(config->wTotalLength);
 
 	if (tmp > USB_BUFSIZ) {
-		USB_PRINTF("usb_get_configuration_no: failed to get " \
+		pr_debug("usb_get_configuration_no: failed to get " \
 			   "descriptor - too long: %u\n", tmp);
 		return -1;
 	}
 
 	result = usb_get_descriptor(dev, USB_DT_CONFIG, cfgno, buffer, tmp);
-	USB_PRINTF("get_conf_no %d Result %d, wLength %u\n",
+	pr_debug("get_conf_no %d Result %d, wLength %u\n",
 		   cfgno, result, tmp);
 	return result;
 }
@@ -931,17 +929,17 @@ int usb_string(struct usb_device *dev, int index, char *buf, size_t size)
 	if (!dev->have_langid) {
 		err = usb_string_sub(dev, 0, 0, tbuf);
 		if (err < 0) {
-			USB_PRINTF("error getting string descriptor 0 " \
+			pr_debug("error getting string descriptor 0 " \
 				   "(error=%lx)\n", dev->status);
 			return -1;
 		} else if (tbuf[0] < 4) {
-			USB_PRINTF("string descriptor 0 too short\n");
+			pr_debug("string descriptor 0 too short\n");
 			return -1;
 		} else {
 			dev->have_langid = -1;
 			dev->string_langid = tbuf[2] | (tbuf[3] << 8);
 				/* always use the first langid listed */
-			USB_PRINTF("USB device number %d default " \
+			pr_debug("USB device number %d default " \
 				   "language ID 0x%x\n",
 				   dev->devnum, dev->string_langid);
 		}
@@ -1063,12 +1061,12 @@ static int usb_match(struct device_d *dev, struct driver_d *drv)
 	struct usb_driver *usbdrv = container_of(dev->driver, struct usb_driver, driver);
 	const struct usb_device_id *id;
 
-	debug("matching: 0x%04x 0x%04x\n", usbdev->descriptor->idVendor,
+	pr_debug("matching: 0x%04x 0x%04x\n", usbdev->descriptor->idVendor,
 			usbdev->descriptor->idProduct);
 
 	id = usb_match_id(usbdev, usbdrv->id_table);
 	if (id) {
-		debug("match: 0x%04x 0x%04x\n", id->idVendor, id->idProduct);
+		pr_debug("match: 0x%04x 0x%04x\n", id->idVendor, id->idProduct);
 		return 0;
 	}
 	return 1;
-- 
2.9.3


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

^ permalink raw reply related

* [PATCH 3/9] usb: ehci: forward phy given in registration data to host
From: Sascha Hauer @ 2016-09-29 12:38 UTC (permalink / raw)
  To: Barebox List
In-Reply-To: <20160929123900.24853-1-s.hauer@pengutronix.de>

Allow to pass a phy in the registration data and forward it to
the usb_host structure.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/usb/host/ehci-hcd.c | 1 +
 include/usb/ehci.h          | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 35cf6aa..f6e9099 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -1297,6 +1297,7 @@ int ehci_register(struct device_d *dev, struct ehci_data *data)
 
 	host->hw_dev = dev;
 	host->init = ehci_init;
+	host->usbphy = data->usbphy;
 	host->submit_int_msg = submit_int_msg;
 	host->submit_control_msg = submit_control_msg;
 	host->submit_bulk_msg = submit_bulk_msg;
diff --git a/include/usb/ehci.h b/include/usb/ehci.h
index 93f980d..1008e92 100644
--- a/include/usb/ehci.h
+++ b/include/usb/ehci.h
@@ -11,6 +11,7 @@ struct ehci_data {
 	void __iomem *hccr;
 	void __iomem *hcor;
 	unsigned long flags;
+	struct usb_phy *usbphy;
 
 	/* platform specific init functions */
 	int (*init)(void *drvdata);
-- 
2.9.3


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

^ permalink raw reply related

* [PATCH 9/9] usb: imx-us-phy: implement notify_(dis)concect
From: Sascha Hauer @ 2016-09-29 12:39 UTC (permalink / raw)
  To: Barebox List
In-Reply-To: <20160929123900.24853-1-s.hauer@pengutronix.de>

The i.MX6 USB phy does not recognize disconnects of high speed
devices when the USBPHY_CTRL_ENHOSTDISCONDETECT is not set. The
phy does not work properly though when this bit is always set, so
implement the notify_(dis)concect() callbacks to set this bit
whenever a high speed device is connected and to clear it again
when the device is disconnected.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/usb/imx/imx-usb-phy.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/drivers/usb/imx/imx-usb-phy.c b/drivers/usb/imx/imx-usb-phy.c
index 2829ffc..9f46f8d 100644
--- a/drivers/usb/imx/imx-usb-phy.c
+++ b/drivers/usb/imx/imx-usb-phy.c
@@ -33,6 +33,7 @@
 #define USBPHY_CTRL_CLKGATE		(1 << 30)
 #define USBPHY_CTRL_ENUTMILEVEL3	(1 << 15)
 #define USBPHY_CTRL_ENUTMILEVEL2	(1 << 14)
+#define USBPHY_CTRL_ENHOSTDISCONDETECT	(1 << 1)
 
 struct imx_usbphy {
 	struct usb_phy usb_phy;
@@ -67,6 +68,30 @@ static int imx_usbphy_phy_init(struct phy *phy)
 	return 0;
 }
 
+static int imx_usbphy_notify_connect(struct usb_phy *phy,
+				     enum usb_device_speed speed)
+{
+	struct imx_usbphy *imxphy = container_of(phy, struct imx_usbphy, usb_phy);
+
+	if (speed == USB_SPEED_HIGH) {
+		writel(USBPHY_CTRL_ENHOSTDISCONDETECT,
+		       imxphy->base + USBPHY_CTRL + SET);
+	}
+
+	return 0;
+}
+
+static int imx_usbphy_notify_disconnect(struct usb_phy *phy,
+					enum usb_device_speed speed)
+{
+	struct imx_usbphy *imxphy = container_of(phy, struct imx_usbphy, usb_phy);
+
+	writel(USBPHY_CTRL_ENHOSTDISCONDETECT,
+	       imxphy->base + USBPHY_CTRL + CLR);
+
+	return 0;
+}
+
 static struct phy *imx_usbphy_xlate(struct device_d *dev,
 				    struct of_phandle_args *args)
 {
@@ -112,6 +137,8 @@ static int imx_usbphy_probe(struct device_d *dev)
 	dev->priv = imxphy;
 
 	imxphy->usb_phy.dev = dev;
+	imxphy->usb_phy.notify_connect = imx_usbphy_notify_connect;
+	imxphy->usb_phy.notify_disconnect = imx_usbphy_notify_disconnect;
 	imxphy->phy = phy_create(dev, NULL, &imx_phy_ops, NULL);
 	if (IS_ERR(imxphy->phy)) {
 		ret = PTR_ERR(imxphy->phy);
-- 
2.9.3


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

^ permalink raw reply related

* [PATCH 2/9] usb: Add usb phy to usb host
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 struct usb_phy * member to struct usb_host. Also, call
usb_phy_notify_connect() / usb_phy_notify_disconnect() when there
are connection changes on the root hub.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/usb/core/hub.c | 8 ++++++++
 include/usb/usb.h      | 1 +
 2 files changed, 9 insertions(+)

diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index dd3c10e..f44aea5 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -22,6 +22,7 @@
 #include <malloc.h>
 #include <errno.h>
 #include <scsi.h>
+#include <usb/phy.h>
 #include <usb/usb.h>
 #include <usb/usb_defs.h>
 
@@ -189,6 +190,10 @@ static void usb_hub_port_connect_change(struct usb_device *dev, int port)
 	if (dev->children[port] && !(portstatus & USB_PORT_STAT_CONNECTION)) {
 		dev_dbg(&dev->dev, "disconnect detected on port %d\n", port + 1);
 		usb_remove_device(dev->children[port]);
+
+		if (!dev->parent && dev->host->usbphy)
+			usb_phy_notify_disconnect(dev->host->usbphy, dev->speed);
+
 		return;
 	}
 
@@ -231,6 +236,9 @@ static void usb_hub_port_connect_change(struct usb_device *dev, int port)
 		return;
 	}
 
+	if (!dev->parent && dev->host->usbphy)
+		usb_phy_notify_connect(dev->host->usbphy, usb->speed);
+
 	device_detect(&usb->dev);
 }
 
diff --git a/include/usb/usb.h b/include/usb/usb.h
index aedc527..93308ce 100644
--- a/include/usb/usb.h
+++ b/include/usb/usb.h
@@ -153,6 +153,7 @@ struct usb_host {
 	int busnum;
 	struct usb_device *root_dev;
 	int sem;
+	struct usb_phy *usbphy;
 };
 
 int usb_register_host(struct usb_host *);
-- 
2.9.3


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

^ permalink raw reply related

* [PATCH 4/9] usb: imx-usb-phy: Drop unnecessary read/modify/write
From: Sascha Hauer @ 2016-09-29 12:38 UTC (permalink / raw)
  To: Barebox List
In-Reply-To: <20160929123900.24853-1-s.hauer@pengutronix.de>

When writing to the USBPHY_CTRL register read/modify/write is unncessary
since we are writing to the associated bit set register anyway.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/usb/imx/imx-usb-phy.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/imx/imx-usb-phy.c b/drivers/usb/imx/imx-usb-phy.c
index 1aa12be..eec195d 100644
--- a/drivers/usb/imx/imx-usb-phy.c
+++ b/drivers/usb/imx/imx-usb-phy.c
@@ -39,8 +39,6 @@ struct imx_usbphy {
 
 static int imx_usbphy_enable(struct imx_usbphy *imxphy)
 {
-	u32 val;
-
 	clk_enable(imxphy->clk);
 
 	/* reset usbphy */
@@ -56,9 +54,8 @@ static int imx_usbphy_enable(struct imx_usbphy *imxphy)
 	writel(0xffffffff, imxphy->base + CLR);
 
 	/* set utmilvl2/3 */
-	val = readl(imxphy->base + USBPHY_CTRL);
-	val |= USBPHY_CTRL_ENUTMILEVEL3 | USBPHY_CTRL_ENUTMILEVEL2;
-	writel(val, imxphy->base + USBPHY_CTRL + SET);
+	writel(USBPHY_CTRL_ENUTMILEVEL3 | USBPHY_CTRL_ENUTMILEVEL2,
+	       imxphy->base + USBPHY_CTRL + SET);
 
 	return 0;
 }
-- 
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

* [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] 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 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 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 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 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 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 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 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 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

* 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

* 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

* [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


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