From: Jan Luebbe <jlu@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 10/13] defaultenv: support NAND and NOR kernel partitions at the same time
Date: Mon, 20 Aug 2012 16:20:25 +0200 [thread overview]
Message-ID: <1345472428-17417-11-git-send-email-jlu@pengutronix.de> (raw)
In-Reply-To: <1345472428-17417-1-git-send-email-jlu@pengutronix.de>
Also make the NOR device names configurable.
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
---
defaultenv/bin/boot | 24 ++++++++++++++++++++----
defaultenv/bin/init | 4 ++--
defaultenv/config | 8 +++++---
3 files changed, 27 insertions(+), 9 deletions(-)
diff --git a/defaultenv/bin/boot b/defaultenv/bin/boot
index 61b893a..cc72af5 100644
--- a/defaultenv/bin/boot
+++ b/defaultenv/bin/boot
@@ -79,7 +79,11 @@ else
fi
if [ x$rootfs_type = xubifs ]; then
- if [ -z $ubiroot ]; then
+ if [ x$rootfs_loc = xnand -a -n ${ubiroot_nand} ]; then
+ ubiroot=${ubiroot_nand}
+ elif [ x$rootfs_loc = xnor -a -n ${ubiroot_nor} ]; then
+ ubiroot=${ubiroot_nor}
+ elif [ -z $ubiroot ]; then
ubiroot="root"
fi
bootargs="$bootargs root=ubi0:$ubiroot ubi.mtd=$rootfs_mtdblock"
@@ -91,7 +95,13 @@ else
fi
if [ -n $nor_parts ]; then
- mtdparts="${mtdparts}physmap-flash.0:${nor_parts}"
+ if [ -z $nor_name ]; then
+ nor_name="nor0"
+ fi
+ if [ -z $nor_device ]; then
+ nor_device="physmap-flash.0"
+ fi
+ mtdparts="${mtdparts}${nor_device}:${nor_parts}"
fi
if [ -n $nand_parts ]; then
@@ -109,9 +119,15 @@ if [ x$kernel_loc = xnfs -o x$kernel_loc = xtftp ]; then
kdev=/image
$kernel_loc $kernelimage $kdev || exit 1
elif [ x$kernel_loc = xnor ]; then
- kdev="/dev/nor0.kernel"
+ if [ -z $kernel_mtd_nor ]; then
+ kernel_mtd_nor="kernel"
+ fi
+ kdev="/dev/${nor_name}.${kernel_mtd_nor}"
elif [ x$kernel_loc = xnand ]; then
- kdev="/dev/nand0.kernel.bb"
+ if [ -z $kernel_mtd_nand ]; then
+ kernel_mtd_nand="kernel"
+ fi
+ kdev="/dev/nand0.${kernel_mtd_nand}.bb"
elif [ x$kernel_loc = xdisk ]; then
kdev="/dev/$kernel_part"
else
diff --git a/defaultenv/bin/init b/defaultenv/bin/init
index f535e37..56fb66c 100644
--- a/defaultenv/bin/init
+++ b/defaultenv/bin/init
@@ -4,8 +4,8 @@ PATH=/env/bin
export PATH
. /env/config
-if [ -e /dev/nor0 -a -n "$nor_parts" ]; then
- addpart /dev/nor0 $nor_parts
+if [ -e /dev/$nor_name -a -n "$nor_parts" ]; then
+ addpart /dev/$nor_name $nor_parts
fi
if [ -e /dev/disk0 -a -n "$disk_parts" ]; then
diff --git a/defaultenv/config b/defaultenv/config
index 7b61d29..97e796b 100644
--- a/defaultenv/config
+++ b/defaultenv/config
@@ -58,12 +58,14 @@ autoboot_timeout=3
bootargs="console=ttyFIXME,115200"
+#nor_name="FIXME" # device name in barebox, default is nor0
nor_parts="256k(barebox)ro,128k(bareboxenv),3M(kernel),-(root)"
-rootfs_mtdblock_nor=3
+nor_device="FIXME" # device name in the kernel
+rootfs_mtdblock_nor=3 # this can also be a name when using ubi
nand_parts="256k(barebox)ro,128k(bareboxenv),3M(kernel),-(root)"
-nand_device="FIXME"
-rootfs_mtdblock_nand=7
+nand_device="FIXME" # device name in the kernel
+rootfs_mtdblock_nand=7 # this can also be a name when using ubi
# set a fancy prompt (if support is compiled in)
PS1="\e[1;32mbarebox@\e[1;31m\h:\w\e[0m "
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2012-08-20 14:21 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-20 14:20 Jan Luebbe
2012-08-20 14:20 ` [PATCH 01/13] Makefile: add target to produce a SPL compatible uimage Jan Luebbe
2012-08-20 14:20 ` [PATCH 02/13] scripts: add tool to create image for SPI boot on AM35xx Jan Luebbe
2012-08-20 14:40 ` Jean-Christophe PLAGNIOL-VILLARD
2012-08-21 6:51 ` Jan Luebbe
2012-08-21 13:04 ` Jean-Christophe PLAGNIOL-VILLARD
2012-08-20 14:20 ` [PATCH 03/13] common: split out meminfo output and make it optional Jan Luebbe
2012-08-20 14:42 ` Jean-Christophe PLAGNIOL-VILLARD
2012-08-21 6:55 ` Jan Luebbe
2012-08-20 14:20 ` [PATCH 04/13] omap: add SPI as a boot mode for xload Jan Luebbe
2012-08-20 14:20 ` [PATCH 05/13] drivers/net/ksz8864rmn: add driver for Micrel KSZ8864RMN Ethernet Switch Jan Luebbe
2012-08-20 14:20 ` [PATCH 06/13] drivers/net: add driver for the EMAC device found in some TI SoCs Jan Luebbe
2012-08-20 14:47 ` Jean-Christophe PLAGNIOL-VILLARD
2012-08-21 6:59 ` Jan Luebbe
2012-08-21 12:16 ` Jean-Christophe PLAGNIOL-VILLARD
2012-08-20 14:20 ` [PATCH 07/13] omap3: allow enabling clocks for UART3, MMC1 and SPI Jan Luebbe
2012-08-20 14:47 ` Jean-Christophe PLAGNIOL-VILLARD
2012-08-21 7:08 ` Jan Luebbe
2012-08-21 12:15 ` Jean-Christophe PLAGNIOL-VILLARD
2012-08-20 14:20 ` [PATCH 08/13] drivers/spi: add driver for the Multichannel SPI controller found in TI SoCs Jan Luebbe
2012-08-20 14:58 ` Jean-Christophe PLAGNIOL-VILLARD
2012-08-21 7:16 ` Jan Luebbe
2012-08-21 12:14 ` Jean-Christophe PLAGNIOL-VILLARD
2012-08-20 14:20 ` [PATCH 09/13] m25p80: add JEDEC ID for Micron/Numonyx SPI NOR flash Jan Luebbe
2012-08-20 14:20 ` Jan Luebbe [this message]
2012-08-20 14:59 ` [PATCH 10/13] defaultenv: support NAND and NOR kernel partitions at the same time Jean-Christophe PLAGNIOL-VILLARD
2012-08-20 14:20 ` [PATCH 11/13] defaultenv: use /env/oftree if it exists Jan Luebbe
2012-08-20 15:00 ` Jean-Christophe PLAGNIOL-VILLARD
2012-08-20 14:20 ` [PATCH 12/13] defaultenv: support kernel and oftree on a filesystem Jan Luebbe
2012-08-20 15:00 ` Jean-Christophe PLAGNIOL-VILLARD
2012-08-20 14:20 ` [PATCH 13/13] omap3_clock: avoid initializing cores not present on TI AM35xx Jan Luebbe
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=1345472428-17417-11-git-send-email-jlu@pengutronix.de \
--to=jlu@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