mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Lucas Stach <l.stach@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 3/3] ARM: rdu2: bring board support in line with other boards
Date: Wed, 30 Nov 2016 12:07:41 +0100	[thread overview]
Message-ID: <20161130110741.23345-3-l.stach@pengutronix.de> (raw)
In-Reply-To: <20161130110741.23345-1-l.stach@pengutronix.de>

- add barebox update handler
- add barebox environment partition
- automount using the PCIe ethernet
- set hostname from board file

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 arch/arm/boards/zii-imx6q-rdu2/board.c                 | 18 ++++++++++++++++++
 .../zii-imx6q-rdu2/defaultenv-rdu2/init/automount      | 17 +++++++++++++++++
 arch/arm/dts/imx6qdl-zii-rdu2.dtsi                     | 12 +++++++++++-
 3 files changed, 46 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/init/automount

diff --git a/arch/arm/boards/zii-imx6q-rdu2/board.c b/arch/arm/boards/zii-imx6q-rdu2/board.c
index 636c57630803..ee04517d2985 100644
--- a/arch/arm/boards/zii-imx6q-rdu2/board.c
+++ b/arch/arm/boards/zii-imx6q-rdu2/board.c
@@ -33,6 +33,7 @@
 #include <spi/spi.h>
 #include <mach/spi.h>
 #include <mach/usb.h>
+#include <mach/bbu.h>
 
 #define RDU2_DAC1_RESET	IMX_GPIO_NR(1, 0)
 #define RDU2_DAC2_RESET	IMX_GPIO_NR(1, 2)
@@ -151,3 +152,20 @@ static int rdu2_enable_front_panel_usb(void)
 	return ret;
 }
 late_initcall(rdu2_enable_front_panel_usb);
+
+static int rdu2_devices_init(void)
+{
+	if (!of_machine_is_compatible("zii,imx6q-zii-rdu2") &&
+	    !of_machine_is_compatible("zii,imx6qp-zii-rdu2"))
+		return 0;
+
+	barebox_set_hostname("rdu2");
+
+	imx6_bbu_internal_spi_i2c_register_handler("SPI", "/dev/m25p0.barebox",
+						   BBU_HANDLER_FLAG_DEFAULT);
+
+	imx6_bbu_internal_mmc_register_handler("eMMC", "/dev/mmc3", 0);
+
+	return 0;
+}
+device_initcall(rdu2_devices_init);
diff --git a/arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/init/automount b/arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/init/automount
new file mode 100644
index 000000000000..6c04eb48a1a7
--- /dev/null
+++ b/arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/init/automount
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+# automount tftp server based on $eth0.serverip
+
+mkdir -p /mnt/tftp
+automount /mnt/tftp 'ifup eth1 && mount -t tftp $eth1.serverip /mnt/tftp'
+
+# automount nfs server's nfsroot
+
+mkdir -p /mnt/nfs
+automount /mnt/nfs 'ifup eth1 && mount -t nfs ${eth1.serverip}:/home/${global.user}/nfsroot/${global.hostname} /mnt/nfs'
+
+
+# FAT on usb disk example
+
+#mkdir -p /mnt/fat
+#automount -d /mnt/fat 'usb && [ -e /dev/disk0.0 ] && mount /dev/disk0.0 /mnt/fat'
diff --git a/arch/arm/dts/imx6qdl-zii-rdu2.dtsi b/arch/arm/dts/imx6qdl-zii-rdu2.dtsi
index 55af3f964e49..5b255e9aaa57 100644
--- a/arch/arm/dts/imx6qdl-zii-rdu2.dtsi
+++ b/arch/arm/dts/imx6qdl-zii-rdu2.dtsi
@@ -46,6 +46,11 @@
 / {
 	chosen {
 		linux,stdout-path = &uart1;
+
+		environment@0 {
+			compatible = "barebox,environment";
+			device-path = &nor_flash, "partname:barebox-environment";
+		};
 	};
 
 	mdio {
@@ -389,7 +394,12 @@
 
 		partition@0 {
 			label = "barebox";
-			reg = <0x0 0x100000>;
+			reg = <0x0 0xc0000>;
+		};
+
+		partition@e0000 {
+			label = "barebox-environment";
+			reg = <0xc0000 0x40000>;
 		};
 	};
 };
-- 
2.10.2


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

      parent reply	other threads:[~2016-11-30 11:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-30 11:07 [PATCH 1/3] ARM: imx: Add support for ZII RDU2 board Lucas Stach
2016-11-30 11:07 ` [PATCH 2/3] ARM: rdu2: support QP variant Lucas Stach
2016-11-30 11:07 ` Lucas Stach [this message]

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=20161130110741.23345-3-l.stach@pengutronix.de \
    --to=l.stach@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