* [PATCH] ARM: i.MX WaRP7: Add defaultenv and boot pre-installed kernel
@ 2017-03-19 17:02 Alexander Kurz
2017-03-20 7:39 ` Sascha Hauer
0 siblings, 1 reply; 2+ messages in thread
From: Alexander Kurz @ 2017-03-19 17:02 UTC (permalink / raw)
To: barebox; +Cc: Alexander Kurz
The WaRP7 board is shipped with a pre-installed system.
Boot the zImage and dtb from the first partition by default.
Signed-off-by: Alexander Kurz <akurz@blala.de>
---
arch/arm/boards/element14-warp7/Makefile | 1 +
arch/arm/boards/element14-warp7/board.c | 3 +++
arch/arm/boards/element14-warp7/defaultenv-warp7/boot/mmc_kernel | 7 +++++++
arch/arm/boards/element14-warp7/defaultenv-warp7/nv/boot.default | 1 +
4 files changed, 12 insertions(+)
create mode 100644 arch/arm/boards/element14-warp7/defaultenv-warp7/boot/mmc_kernel
create mode 100644 arch/arm/boards/element14-warp7/defaultenv-warp7/nv/boot.default
diff --git a/arch/arm/boards/element14-warp7/Makefile b/arch/arm/boards/element14-warp7/Makefile
index 01c7a25..847f452 100644
--- a/arch/arm/boards/element14-warp7/Makefile
+++ b/arch/arm/boards/element14-warp7/Makefile
@@ -1,2 +1,3 @@
obj-y += board.o
lwl-y += lowlevel.o
+bbenv-y += defaultenv-warp7
diff --git a/arch/arm/boards/element14-warp7/board.c b/arch/arm/boards/element14-warp7/board.c
index 84fc885..b1fe202 100644
--- a/arch/arm/boards/element14-warp7/board.c
+++ b/arch/arm/boards/element14-warp7/board.c
@@ -21,6 +21,7 @@
#include <partition.h>
#include <mach/generic.h>
#include <linux/sizes.h>
+#include <envfs.h>
static int warp7_devices_init(void)
{
@@ -30,6 +31,8 @@ static int warp7_devices_init(void)
imx6_bbu_internal_mmc_register_handler("mmc", "/dev/mmc2.boot0.barebox",
BBU_HANDLER_FLAG_DEFAULT);
+ defaultenv_append_directory(defaultenv_warp7);
+
return 0;
}
device_initcall(warp7_devices_init);
diff --git a/arch/arm/boards/element14-warp7/defaultenv-warp7/boot/mmc_kernel b/arch/arm/boards/element14-warp7/defaultenv-warp7/boot/mmc_kernel
new file mode 100644
index 0000000..dd0a31b
--- /dev/null
+++ b/arch/arm/boards/element14-warp7/defaultenv-warp7/boot/mmc_kernel
@@ -0,0 +1,7 @@
+#!/bin/sh
+[ -d /mnt/mmc2.0 ] || mkdir /mnt/mmc2.0
+mount -t fat /dev/mmc2.0 /mnt/mmc2.0/
+
+global linux.bootargs.dyn.root="console=ttymxc0,115200 root=/dev/mmcblk2p2 rootwait rw"
+
+bootm -v -o /mnt/mmc2.0/imx7s-warp.dtb /mnt/mmc2.0/zImage
diff --git a/arch/arm/boards/element14-warp7/defaultenv-warp7/nv/boot.default b/arch/arm/boards/element14-warp7/defaultenv-warp7/nv/boot.default
new file mode 100644
index 0000000..3118b7a
--- /dev/null
+++ b/arch/arm/boards/element14-warp7/defaultenv-warp7/nv/boot.default
@@ -0,0 +1 @@
+mmc_kernel
--
2.1.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] ARM: i.MX WaRP7: Add defaultenv and boot pre-installed kernel
2017-03-19 17:02 [PATCH] ARM: i.MX WaRP7: Add defaultenv and boot pre-installed kernel Alexander Kurz
@ 2017-03-20 7:39 ` Sascha Hauer
0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2017-03-20 7:39 UTC (permalink / raw)
To: Alexander Kurz; +Cc: barebox
Hi Alexander,
Some small optimizations for the boot script inside.
On Sun, Mar 19, 2017 at 06:02:21PM +0100, Alexander Kurz wrote:
> static int warp7_devices_init(void)
> {
> @@ -30,6 +31,8 @@ static int warp7_devices_init(void)
> imx6_bbu_internal_mmc_register_handler("mmc", "/dev/mmc2.boot0.barebox",
> BBU_HANDLER_FLAG_DEFAULT);
>
> + defaultenv_append_directory(defaultenv_warp7);
> +
> return 0;
> }
> device_initcall(warp7_devices_init);
> diff --git a/arch/arm/boards/element14-warp7/defaultenv-warp7/boot/mmc_kernel b/arch/arm/boards/element14-warp7/defaultenv-warp7/boot/mmc_kernel
> new file mode 100644
> index 0000000..dd0a31b
> --- /dev/null
> +++ b/arch/arm/boards/element14-warp7/defaultenv-warp7/boot/mmc_kernel
> @@ -0,0 +1,7 @@
> +#!/bin/sh
> +[ -d /mnt/mmc2.0 ] || mkdir /mnt/mmc2.0
mkdir -p would be simpler, but this is not needed when...
> +mount -t fat /dev/mmc2.0 /mnt/mmc2.0/
...this is replaced with "mount mmc2.0". The partition is then mounted
to the default path which is also /mnt/mmc2.0.
> +
> +global linux.bootargs.dyn.root="console=ttymxc0,115200 root=/dev/mmcblk2p2 rootwait rw"
The console=ttymxc0,115200 shouldn't be necessary. barebox adds this
automatically.
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 [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-03-20 7:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-19 17:02 [PATCH] ARM: i.MX WaRP7: Add defaultenv and boot pre-installed kernel Alexander Kurz
2017-03-20 7:39 ` Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox