mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Christian Hemp <c.hemp@phytec.de>
To: barebox@lists.infradead.org
Subject: [PATCH 04/10] ARM:imx6:phyflex: Add defaultenv
Date: Fri, 12 Sep 2014 15:33:41 +0200	[thread overview]
Message-ID: <1410528827-12722-4-git-send-email-c.hemp@phytec.de> (raw)
In-Reply-To: <1410528827-12722-1-git-send-email-c.hemp@phytec.de>

Add defaultenv_append_directory to phyFLEX-i.MX6.

Signed-off-by: Christian Hemp <c.hemp@phytec.de>
---
 arch/arm/boards/phytec-phyflex-imx6/Makefile       |    1 +
 arch/arm/boards/phytec-phyflex-imx6/board.c        |    3 +++
 .../defaultenv-phyflex-imx6/boot/nand              |    6 ++++++
 .../defaultenv-phyflex-imx6/boot/sd-ext3           |    6 ++++++
 .../defaultenv-phyflex-imx6/config-board           |    9 +++++++++
 .../defaultenv-phyflex-imx6/init/automount         |   14 ++++++++++++++
 6 files changed, 39 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boards/phytec-phyflex-imx6/defaultenv-phyflex-imx6/boot/nand
 create mode 100644 arch/arm/boards/phytec-phyflex-imx6/defaultenv-phyflex-imx6/boot/sd-ext3
 create mode 100644 arch/arm/boards/phytec-phyflex-imx6/defaultenv-phyflex-imx6/config-board
 create mode 100644 arch/arm/boards/phytec-phyflex-imx6/defaultenv-phyflex-imx6/init/automount

diff --git a/arch/arm/boards/phytec-phyflex-imx6/Makefile b/arch/arm/boards/phytec-phyflex-imx6/Makefile
index 01c7a25..11e1c7d 100644
--- a/arch/arm/boards/phytec-phyflex-imx6/Makefile
+++ b/arch/arm/boards/phytec-phyflex-imx6/Makefile
@@ -1,2 +1,3 @@
 obj-y += board.o
 lwl-y += lowlevel.o
+bbenv-y += defaultenv-phyflex-imx6
diff --git a/arch/arm/boards/phytec-phyflex-imx6/board.c b/arch/arm/boards/phytec-phyflex-imx6/board.c
index 94e3f6f..843edac 100644
--- a/arch/arm/boards/phytec-phyflex-imx6/board.c
+++ b/arch/arm/boards/phytec-phyflex-imx6/board.c
@@ -17,6 +17,7 @@
  *
  */
 
+#include <envfs.h>
 #include <common.h>
 #include <gpio.h>
 #include <init.h>
@@ -102,6 +103,8 @@ static int phytec_pfla02_init(void)
 
 	imx6_bbu_nand_register_handler("nand", BBU_HANDLER_FLAG_DEFAULT);
 
+	defaultenv_append_directory(defaultenv_phyflex_imx6);
+
 	return 0;
 }
 device_initcall(phytec_pfla02_init);
diff --git a/arch/arm/boards/phytec-phyflex-imx6/defaultenv-phyflex-imx6/boot/nand b/arch/arm/boards/phytec-phyflex-imx6/defaultenv-phyflex-imx6/boot/nand
new file mode 100644
index 0000000..79dc03c
--- /dev/null
+++ b/arch/arm/boards/phytec-phyflex-imx6/defaultenv-phyflex-imx6/boot/nand
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+global.bootm.image="/dev/nand0.kernel.bb"
+global.bootm.oftree="/dev/nand0.oftree.bb"
+bootargs-ip
+global.linux.bootargs.dyn.root="root=ubi0:root ubi.mtd=root rootfstype=ubifs rw"
diff --git a/arch/arm/boards/phytec-phyflex-imx6/defaultenv-phyflex-imx6/boot/sd-ext3 b/arch/arm/boards/phytec-phyflex-imx6/defaultenv-phyflex-imx6/boot/sd-ext3
new file mode 100644
index 0000000..fd35fe0
--- /dev/null
+++ b/arch/arm/boards/phytec-phyflex-imx6/defaultenv-phyflex-imx6/boot/sd-ext3
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+global.bootm.image="/mnt/mmc/linuximage"
+global.bootm.oftree="/mnt/mmc/oftree"
+bootargs-ip
+global.linux.bootargs.dyn.root="root=/dev/mmcblk0p2 rootfstype=ext3 rootwait rw"
diff --git a/arch/arm/boards/phytec-phyflex-imx6/defaultenv-phyflex-imx6/config-board b/arch/arm/boards/phytec-phyflex-imx6/defaultenv-phyflex-imx6/config-board
new file mode 100644
index 0000000..b40a4de
--- /dev/null
+++ b/arch/arm/boards/phytec-phyflex-imx6/defaultenv-phyflex-imx6/config-board
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+# board defaults, do not change in running system. Change /env/config
+# instead
+
+global.boot.default=nand
+
+global.hostname=phyFLEX-i.MX6
+global.linux.bootargs.base="console=ttymxc3,115200"
diff --git a/arch/arm/boards/phytec-phyflex-imx6/defaultenv-phyflex-imx6/init/automount b/arch/arm/boards/phytec-phyflex-imx6/defaultenv-phyflex-imx6/init/automount
new file mode 100644
index 0000000..49d99bd
--- /dev/null
+++ b/arch/arm/boards/phytec-phyflex-imx6/defaultenv-phyflex-imx6/init/automount
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+if [ "$1" = menu ]; then
+	init-menu-add-entry "$0" "Automountpoints"
+	exit
+fi
+
+# automount tftp server based on $eth0.serverip
+
+mkdir -p /mnt/tftp
+automount /mnt/tftp 'ifup eth0 && mount -t tftp $eth0.serverip /mnt/tftp'
+
+mkdir -p /mnt/mmc
+automount -d /mnt/mmc 'mmc2.probe=1 && [ -e /dev/mmc2.0 ] && mount /dev/mmc2.0 /mnt/mmc'
-- 
1.7.0.4


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

  parent reply	other threads:[~2014-09-12 13:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-12 13:33 [PATCH 01/10] dts:imx6:pfla02: Add nand partitions Christian Hemp
2014-09-12 13:33 ` [PATCH 02/10] dts:imx6q:pcaaxl3: Add oftree partition to nand Christian Hemp
2014-09-12 13:33 ` [PATCH 03/10] ARM:imx6:phycard: Switch env to defaultenv_append_directory Christian Hemp
2014-09-12 13:33 ` Christian Hemp [this message]
2014-09-12 13:33 ` [PATCH 05/10] ARM:imx6:pfla02: Remove redundant code Christian Hemp
2014-09-12 13:33 ` [PATCH 06/10] dts:imx6:pfla02: Remove memory node Christian Hemp
2014-09-12 13:33 ` [PATCH 07/10] dts:imx6:pfla02: move mac read to module Christian Hemp
2014-09-12 13:33 ` [PATCH 08/10] dts:imx6:pfla02:Move spi partitions imx6qdl-phytec-pfla02 Christian Hemp
2014-09-12 13:33 ` [PATCH 09/10] dts:imx6:pfla02: Add env node for SPI-NOR and NAND Christian Hemp
2014-09-12 13:33 ` [PATCH 10/10] ARM:phyFLEX-iMX6: Add bootsource detection Christian Hemp
2014-09-15  5:33 ` [PATCH 01/10] dts:imx6:pfla02: Add nand partitions 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=1410528827-12722-4-git-send-email-c.hemp@phytec.de \
    --to=c.hemp@phytec.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