From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 2/5] ARM: Phytec-phyCORE-imx27: Register board env during runtime
Date: Thu, 12 Jun 2014 08:53:40 +0200 [thread overview]
Message-ID: <1402556023-1811-3-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1402556023-1811-1-git-send-email-s.hauer@pengutronix.de>
Register the board specific environment during runtime using
defaultenv_append_directory() to make it available for multi
image support.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/boards/phytec-phycore-imx27/Makefile | 1 +
.../phytec-phycore-imx27/defaultenv-pcm038/boot/nand-ubi | 10 ++++++++++
.../arm/boards/phytec-phycore-imx27/defaultenv-pcm038/boot/nor | 9 +++++++++
arch/arm/boards/phytec-phycore-imx27/env/boot/nand-ubi | 10 ----------
arch/arm/boards/phytec-phycore-imx27/env/boot/nor | 9 ---------
arch/arm/boards/phytec-phycore-imx27/pcm038.c | 3 +++
arch/arm/configs/phytec-phycore-imx27_defconfig | 2 +-
7 files changed, 24 insertions(+), 20 deletions(-)
create mode 100644 arch/arm/boards/phytec-phycore-imx27/defaultenv-pcm038/boot/nand-ubi
create mode 100644 arch/arm/boards/phytec-phycore-imx27/defaultenv-pcm038/boot/nor
delete mode 100644 arch/arm/boards/phytec-phycore-imx27/env/boot/nand-ubi
delete mode 100644 arch/arm/boards/phytec-phycore-imx27/env/boot/nor
diff --git a/arch/arm/boards/phytec-phycore-imx27/Makefile b/arch/arm/boards/phytec-phycore-imx27/Makefile
index eb82f0d..4723c77 100644
--- a/arch/arm/boards/phytec-phycore-imx27/Makefile
+++ b/arch/arm/boards/phytec-phycore-imx27/Makefile
@@ -1,2 +1,3 @@
obj-y += pcm038.o pcm970.o
lwl-y += lowlevel.o
+bbenv-y += defaultenv-pcm038
diff --git a/arch/arm/boards/phytec-phycore-imx27/defaultenv-pcm038/boot/nand-ubi b/arch/arm/boards/phytec-phycore-imx27/defaultenv-pcm038/boot/nand-ubi
new file mode 100644
index 0000000..67b0cb4
--- /dev/null
+++ b/arch/arm/boards/phytec-phycore-imx27/defaultenv-pcm038/boot/nand-ubi
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+if [ "$1" = menu ]; then
+ boot-menu-add-entry "$0" "nand (UBI)"
+ exit
+fi
+
+global.bootm.image="/dev/nand0.kernel.bb"
+#global.bootm.oftree="/env/oftree"
+global.linux.bootargs.dyn.root="root=ubi0:root ubi.mtd=nand0.root rootfstype=ubifs"
diff --git a/arch/arm/boards/phytec-phycore-imx27/defaultenv-pcm038/boot/nor b/arch/arm/boards/phytec-phycore-imx27/defaultenv-pcm038/boot/nor
new file mode 100644
index 0000000..0d10584
--- /dev/null
+++ b/arch/arm/boards/phytec-phycore-imx27/defaultenv-pcm038/boot/nor
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+if [ "$1" = menu ]; then
+ boot-menu-add-entry "$0" "nor"
+ exit
+fi
+
+global.bootm.image="/dev/nor0.kernel"
+global.linux.bootargs.dyn.root="root=/dev/mtdblock3 ro"
diff --git a/arch/arm/boards/phytec-phycore-imx27/env/boot/nand-ubi b/arch/arm/boards/phytec-phycore-imx27/env/boot/nand-ubi
deleted file mode 100644
index 67b0cb4..0000000
--- a/arch/arm/boards/phytec-phycore-imx27/env/boot/nand-ubi
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-
-if [ "$1" = menu ]; then
- boot-menu-add-entry "$0" "nand (UBI)"
- exit
-fi
-
-global.bootm.image="/dev/nand0.kernel.bb"
-#global.bootm.oftree="/env/oftree"
-global.linux.bootargs.dyn.root="root=ubi0:root ubi.mtd=nand0.root rootfstype=ubifs"
diff --git a/arch/arm/boards/phytec-phycore-imx27/env/boot/nor b/arch/arm/boards/phytec-phycore-imx27/env/boot/nor
deleted file mode 100644
index 0d10584..0000000
--- a/arch/arm/boards/phytec-phycore-imx27/env/boot/nor
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-if [ "$1" = menu ]; then
- boot-menu-add-entry "$0" "nor"
- exit
-fi
-
-global.bootm.image="/dev/nor0.kernel"
-global.linux.bootargs.dyn.root="root=/dev/mtdblock3 ro"
diff --git a/arch/arm/boards/phytec-phycore-imx27/pcm038.c b/arch/arm/boards/phytec-phycore-imx27/pcm038.c
index 07982fa..294f4ec 100644
--- a/arch/arm/boards/phytec-phycore-imx27/pcm038.c
+++ b/arch/arm/boards/phytec-phycore-imx27/pcm038.c
@@ -21,6 +21,7 @@
#include <io.h>
#include <notifier.h>
#include <sizes.h>
+#include <envfs.h>
#include <mach/devices-imx27.h>
#include <mach/imx-pll.h>
#include <mach/imx27-regs.h>
@@ -174,6 +175,8 @@ static int pcm038_init(void)
/* Clock gating enable */
writel(0x00050f08, MX27_SYSCTRL_BASE_ADDR + MX27_GPCR);
+ defaultenv_append_directory(defaultenv_pcm038);
+
return 0;
}
device_initcall(pcm038_init);
diff --git a/arch/arm/configs/phytec-phycore-imx27_defconfig b/arch/arm/configs/phytec-phycore-imx27_defconfig
index 277d21c..b3cd0bc 100644
--- a/arch/arm/configs/phytec-phycore-imx27_defconfig
+++ b/arch/arm/configs/phytec-phycore-imx27_defconfig
@@ -17,7 +17,7 @@ CONFIG_CMDLINE_EDITING=y
CONFIG_AUTO_COMPLETE=y
CONFIG_MENU=y
CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/phytec-phycore-imx27/env"
+CONFIG_DEFAULT_ENVIRONMENT_PATH=""
CONFIG_LONGHELP=y
CONFIG_CMD_IOMEM=y
CONFIG_CMD_MEMINFO=y
--
2.0.0.rc2
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2014-06-12 6:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-12 6:53 phyCORE-imx27 updates Sascha Hauer
2014-06-12 6:53 ` [PATCH 1/5] ARM: uncompress.c: copy executable to SDRAM if necessary Sascha Hauer
2014-06-12 6:53 ` Sascha Hauer [this message]
2014-06-12 6:53 ` [PATCH 3/5] ARM: i.MX bbu: Add update handler for external NOR boot Sascha Hauer
2014-06-12 6:53 ` [PATCH 4/5] ARM: Phytec-phyCORE-imx27: Register NOR/NAND update handlers Sascha Hauer
2014-06-12 6:53 ` [PATCH 5/5] ARM: Phytec-phyCORE-imx27: Switch to multiimage support Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1402556023-1811-3-git-send-email-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox