mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 00/23] A number of ZII related fixes
@ 2020-03-31 18:46 Andrey Smirnov
  2020-03-31 18:47 ` [PATCH 01/23] ARM: zii-common: Gate rdu_i210_invm() call with CONFIG_PCI_IMX6 Andrey Smirnov
                   ` (23 more replies)
  0 siblings, 24 replies; 34+ messages in thread
From: Andrey Smirnov @ 2020-03-31 18:46 UTC (permalink / raw)
  To: Barebox List; +Cc: Andrey Smirnov

Everyone:

Here's a patchset containing a number of ZII board related fixes I've
had in my tree for a while. Hopefully none of them are controversial.

Thanks,
Andrey Smirnov

Andrey Smirnov (23):
  ARM: zii-common: Gate rdu_i210_invm() call with CONFIG_PCI_IMX6
  ARM: imx7d-zii-rpu2: Drop redundant chosen node
  ARM: zii-imx7d-dev: Fix compatible name
  ARM: zii-common: Check for I2C errors in do_rdu2_switch_reset()
  i2c: Port of_find_i2c_device_by_node() from Linux
  ARM: zii-common: Find switch watchdog via DT
  ARM: zii-common: Support rave_switch_reset on ZII Ultra
  ARM: zii-imx6q-rdu2: Differentiate between RDU2 and RDU2+
  ARM: zii-imx7d-dev: Differentiate between RPU2 and RMU2
  ARM: zii-imx8mq-dev: Differentiate between Zest and RMB3
  ARM: zii-common: Add common environment directory
  ARM: zii-imx6q-rdu2: Register SD card slot with BBU
  ARM: zii-vf610-dev: Register SD card slot with BBU
  ARM: zii-imx8mq-dev: Register SD card slot with BBU
  ARM: zii-vf610-dev: Add newline to end of board.c
  ARM: rdu2: Drop redundant USB GPIO hog nodes
  ARM: imx8mq: Drop trailing whitespace
  ARM: imx8mq: Drop redundant DT nodes
  ARM: zii-imx8mq-dev: Add boot source info
  ARM: zii-imx8mq-dev: Drop redundant "stdout-path"
  ARM: zii-imx7d-dev: Drop redundant RMU2 .dtsi
  ARM: zii-imx7d-rmu2: Add SPI NOR partition info
  ARM: zii-imx7d-rmu2: Add boot source info

 arch/arm/boards/zii-common/Makefile           |   1 +
 arch/arm/boards/zii-common/board.c            |   4 +
 .../defaultenv-zii-common}/boot/net           |   9 +-
 arch/arm/boards/zii-common/switch-cmd.c       |  49 ++-
 arch/arm/boards/zii-imx51-rdu1/board.c        |   1 +
 arch/arm/boards/zii-imx6q-rdu2/board.c        |  11 +-
 .../zii-imx6q-rdu2/defaultenv-rdu2/boot/net   |  24 --
 arch/arm/boards/zii-imx7d-dev/board.c         |  14 +-
 arch/arm/boards/zii-imx8mq-dev/board.c        |  16 +-
 .../defaultenv-imx8mq-zii-dev/boot/net        |  24 --
 .../network/eth0-discover                     |   4 +
 arch/arm/boards/zii-vf610-dev/board.c         |  11 +-
 arch/arm/dts/imx6qdl-zii-rdu2.dtsi            |  36 --
 arch/arm/dts/imx7d-zii-rmu2.dts               |  37 +-
 arch/arm/dts/imx7d-zii-rmu2.dtsi              | 361 ------------------
 arch/arm/dts/imx7d-zii-rpu2.dts               |   9 -
 arch/arm/dts/imx8mq-zii-ultra.dtsi            |  12 +-
 arch/arm/dts/imx8mq.dtsi                      |  99 +----
 include/i2c/i2c.h                             |   8 +
 19 files changed, 156 insertions(+), 574 deletions(-)
 rename arch/arm/boards/{zii-imx51-rdu1/defaultenv-rdu1 => zii-common/defaultenv-zii-common}/boot/net (73%)
 delete mode 100644 arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/boot/net
 delete mode 100644 arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/boot/net
 create mode 100644 arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/network/eth0-discover
 delete mode 100644 arch/arm/dts/imx7d-zii-rmu2.dtsi

--
2.21.0

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

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 01/23] ARM: zii-common: Gate rdu_i210_invm() call with CONFIG_PCI_IMX6
  2020-03-31 18:46 [PATCH 00/23] A number of ZII related fixes Andrey Smirnov
@ 2020-03-31 18:47 ` Andrey Smirnov
  2020-04-01  5:20   ` Sascha Hauer
  2020-03-31 18:47 ` [PATCH 02/23] ARM: imx7d-zii-rpu2: Drop redundant chosen node Andrey Smirnov
                   ` (22 subsequent siblings)
  23 siblings, 1 reply; 34+ messages in thread
From: Andrey Smirnov @ 2020-03-31 18:47 UTC (permalink / raw)
  To: Barebox List; +Cc: Andrey Smirnov

There's no reason to have rdu_i210_invm() inicalli if CONFIG_PCI_IMX6
is not selected. Add appropriate ifdef to handle that.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 arch/arm/boards/zii-common/board.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/boards/zii-common/board.c b/arch/arm/boards/zii-common/board.c
index 7bd3a6cab..08e2f8b9b 100644
--- a/arch/arm/boards/zii-common/board.c
+++ b/arch/arm/boards/zii-common/board.c
@@ -104,6 +104,8 @@ static int rdu_networkconfig(void)
 }
 late_initcall(rdu_networkconfig);
 
+#ifdef CONFIG_PCI_IMX6
+
 #define I210_CFGWORD_PCIID_157B		0x157b1a11
 static int rdu_i210_invm(void)
 {
@@ -136,3 +138,5 @@ static int rdu_i210_invm(void)
 	return 0;
 }
 late_initcall(rdu_i210_invm);
+
+#endif
-- 
2.21.0


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

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 02/23] ARM: imx7d-zii-rpu2: Drop redundant chosen node
  2020-03-31 18:46 [PATCH 00/23] A number of ZII related fixes Andrey Smirnov
  2020-03-31 18:47 ` [PATCH 01/23] ARM: zii-common: Gate rdu_i210_invm() call with CONFIG_PCI_IMX6 Andrey Smirnov
@ 2020-03-31 18:47 ` Andrey Smirnov
  2020-03-31 18:47 ` [PATCH 03/23] ARM: zii-imx7d-dev: Fix compatible name Andrey Smirnov
                   ` (21 subsequent siblings)
  23 siblings, 0 replies; 34+ messages in thread
From: Andrey Smirnov @ 2020-03-31 18:47 UTC (permalink / raw)
  To: Barebox List; +Cc: Andrey Smirnov

This code is no longer necessary. Upstream DT code has all the
necessary bits. Remove it.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 arch/arm/dts/imx7d-zii-rpu2.dts | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/arch/arm/dts/imx7d-zii-rpu2.dts b/arch/arm/dts/imx7d-zii-rpu2.dts
index f8d6e8904..168f66c73 100644
--- a/arch/arm/dts/imx7d-zii-rpu2.dts
+++ b/arch/arm/dts/imx7d-zii-rpu2.dts
@@ -8,15 +8,6 @@
 #include "imx7d-ddrc.dtsi"
 
 / {
-	chosen {
-		/*
-		 * Kernel DTS incorrectly specifies stdout-path as
-                 * &uart1, this can be removed once the fix trickles
-                 * down
-		 */
-		stdout-path = &uart2;
-	};
-
 	aliases {
 		/*
 		 * NVMEM device corresponding to EEPROM attached to
-- 
2.21.0


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

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 03/23] ARM: zii-imx7d-dev: Fix compatible name
  2020-03-31 18:46 [PATCH 00/23] A number of ZII related fixes Andrey Smirnov
  2020-03-31 18:47 ` [PATCH 01/23] ARM: zii-common: Gate rdu_i210_invm() call with CONFIG_PCI_IMX6 Andrey Smirnov
  2020-03-31 18:47 ` [PATCH 02/23] ARM: imx7d-zii-rpu2: Drop redundant chosen node Andrey Smirnov
@ 2020-03-31 18:47 ` Andrey Smirnov
  2020-03-31 18:47 ` [PATCH 04/23] ARM: zii-common: Check for I2C errors in do_rdu2_switch_reset() Andrey Smirnov
                   ` (20 subsequent siblings)
  23 siblings, 0 replies; 34+ messages in thread
From: Andrey Smirnov @ 2020-03-31 18:47 UTC (permalink / raw)
  To: Barebox List; +Cc: Andrey Smirnov

Fix compatible name use in zii_imx7d_rpu2_coredevices_init(). Upstream
uses "zii,imx7d-rpu2" and so should we.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 arch/arm/boards/zii-imx7d-dev/board.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boards/zii-imx7d-dev/board.c b/arch/arm/boards/zii-imx7d-dev/board.c
index 89f051530..e46a4b181 100644
--- a/arch/arm/boards/zii-imx7d-dev/board.c
+++ b/arch/arm/boards/zii-imx7d-dev/board.c
@@ -33,7 +33,7 @@ static void zii_imx7d_rpu2_init_fec(void)
 
 static int zii_imx7d_rpu2_coredevices_init(void)
 {
-	if (!of_machine_is_compatible("zii,imx7d-zii-rpu2") &&
+	if (!of_machine_is_compatible("zii,imx7d-rpu2") &&
 	    !of_machine_is_compatible("zii,imx7d-rmu2"))
 		return 0;
 
-- 
2.21.0


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

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 04/23] ARM: zii-common: Check for I2C errors in do_rdu2_switch_reset()
  2020-03-31 18:46 [PATCH 00/23] A number of ZII related fixes Andrey Smirnov
                   ` (2 preceding siblings ...)
  2020-03-31 18:47 ` [PATCH 03/23] ARM: zii-imx7d-dev: Fix compatible name Andrey Smirnov
@ 2020-03-31 18:47 ` Andrey Smirnov
  2020-04-01  5:23   ` Sascha Hauer
  2020-03-31 18:47 ` [PATCH 05/23] i2c: Port of_find_i2c_device_by_node() from Linux Andrey Smirnov
                   ` (19 subsequent siblings)
  23 siblings, 1 reply; 34+ messages in thread
From: Andrey Smirnov @ 2020-03-31 18:47 UTC (permalink / raw)
  To: Barebox List; +Cc: Andrey Smirnov

---
 arch/arm/boards/zii-common/switch-cmd.c | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boards/zii-common/switch-cmd.c b/arch/arm/boards/zii-common/switch-cmd.c
index 2b9c34bfa..5e39d8fc6 100644
--- a/arch/arm/boards/zii-common/switch-cmd.c
+++ b/arch/arm/boards/zii-common/switch-cmd.c
@@ -19,6 +19,7 @@
 static int do_rdu2_switch_reset(void)
 {
 	struct i2c_client client;
+	int ret;
 	u8 reg;
 
 	client.adapter = i2c_get_adapter(1);
@@ -29,12 +30,25 @@ static int do_rdu2_switch_reset(void)
 	client.addr = 0x38;
 	reg = 0x78;
 	/* set switch reset time to 100ms */
-	i2c_write_reg(&client, 0x0a, &reg, 1);
+
+	ret = i2c_write_reg(&client, 0x0a, &reg, 1);
+	if (ret < 0) {
+		pr_err("Failed to set switch reset time\n");
+		return ret;
+	}
 	/* reset the switch */
 	reg = 0x01;
-	i2c_write_reg(&client, 0x0d, &reg, 1);
+	ret = i2c_write_reg(&client, 0x0d, &reg, 1);
+	if (ret < 0) {
+		pr_err("Failed to reset the switch\n");
+		return ret;
+	}
 	/* issue dummy command to work around firmware bug */
-	i2c_read_reg(&client, 0x01, &reg, 1);
+	ret = i2c_read_reg(&client, 0x01, &reg, 1);
+	if (ret < 0) {
+		pr_err("Failed to issue a dummy command\n");
+		return ret;
+	}
 
 	return 0;
 }
-- 
2.21.0


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

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 05/23] i2c: Port of_find_i2c_device_by_node() from Linux
  2020-03-31 18:46 [PATCH 00/23] A number of ZII related fixes Andrey Smirnov
                   ` (3 preceding siblings ...)
  2020-03-31 18:47 ` [PATCH 04/23] ARM: zii-common: Check for I2C errors in do_rdu2_switch_reset() Andrey Smirnov
@ 2020-03-31 18:47 ` Andrey Smirnov
  2020-04-01  5:29   ` Sascha Hauer
  2020-03-31 18:47 ` [PATCH 06/23] ARM: zii-common: Find switch watchdog via DT Andrey Smirnov
                   ` (18 subsequent siblings)
  23 siblings, 1 reply; 34+ messages in thread
From: Andrey Smirnov @ 2020-03-31 18:47 UTC (permalink / raw)
  To: Barebox List; +Cc: Andrey Smirnov

Port of_find_i2c_device_by_node() from Linux in order to allow looking
i2c_client up by corresponding DT node. Useful for interacting with
identical raw/driverless I2C devices that are not found on the same
bus between board variants.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 include/i2c/i2c.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/include/i2c/i2c.h b/include/i2c/i2c.h
index a694e4ab2..7eaa97dde 100644
--- a/include/i2c/i2c.h
+++ b/include/i2c/i2c.h
@@ -281,6 +281,14 @@ static inline int i2c_register_board_info(int busnum,
 extern int i2c_add_numbered_adapter(struct i2c_adapter *adapter);
 struct i2c_adapter *i2c_get_adapter(int busnum);
 struct i2c_adapter *of_find_i2c_adapter_by_node(struct device_node *node);
+static inline struct i2c_client *
+of_find_i2c_device_by_node(struct device_node *node)
+{
+	struct device_d *dev = of_find_device_by_node(node);
+
+	return dev ? to_i2c_client(dev) : NULL;
+}
+
 
 void i2c_parse_fw_timings(struct device_d *dev, struct i2c_timings *t, bool use_defaults);
 
-- 
2.21.0


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

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 06/23] ARM: zii-common: Find switch watchdog via DT
  2020-03-31 18:46 [PATCH 00/23] A number of ZII related fixes Andrey Smirnov
                   ` (4 preceding siblings ...)
  2020-03-31 18:47 ` [PATCH 05/23] i2c: Port of_find_i2c_device_by_node() from Linux Andrey Smirnov
@ 2020-03-31 18:47 ` Andrey Smirnov
  2020-03-31 18:47 ` [PATCH 07/23] ARM: zii-common: Support rave_switch_reset on ZII Ultra Andrey Smirnov
                   ` (17 subsequent siblings)
  23 siblings, 0 replies; 34+ messages in thread
From: Andrey Smirnov @ 2020-03-31 18:47 UTC (permalink / raw)
  To: Barebox List; +Cc: Andrey Smirnov

Use of_find_i2c_device_by_node() in swith reset code in order to be
able to support other devices that have this MCU on a different I2C
busses.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 arch/arm/boards/zii-common/switch-cmd.c | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/arch/arm/boards/zii-common/switch-cmd.c b/arch/arm/boards/zii-common/switch-cmd.c
index 5e39d8fc6..02802ff86 100644
--- a/arch/arm/boards/zii-common/switch-cmd.c
+++ b/arch/arm/boards/zii-common/switch-cmd.c
@@ -18,33 +18,40 @@
 
 static int do_rdu2_switch_reset(void)
 {
-	struct i2c_client client;
+	struct device_node *np;
+	struct i2c_client *client;
 	int ret;
 	u8 reg;
 
-	client.adapter = i2c_get_adapter(1);
-	if (!client.adapter)
+	np = of_find_compatible_node(NULL, NULL, "zii,rave-wdt");
+	if (!np) {
+		pr_err("No switch watchdog node found\n");
 		return -ENODEV;
+	}
+
+	client = of_find_i2c_device_by_node(np);
+	if (!client) {
+		pr_err("No switch watchdog I2C device found\n");
+		return -ENODEV;
+	}
 
-	/* address of the switch watchdog microcontroller */
-	client.addr = 0x38;
 	reg = 0x78;
-	/* set switch reset time to 100ms */
 
-	ret = i2c_write_reg(&client, 0x0a, &reg, 1);
+	/* set switch reset time to 100ms */
+	ret = i2c_write_reg(client, 0x0a, &reg, 1);
 	if (ret < 0) {
 		pr_err("Failed to set switch reset time\n");
 		return ret;
 	}
 	/* reset the switch */
 	reg = 0x01;
-	ret = i2c_write_reg(&client, 0x0d, &reg, 1);
+	ret = i2c_write_reg(client, 0x0d, &reg, 1);
 	if (ret < 0) {
 		pr_err("Failed to reset the switch\n");
 		return ret;
 	}
 	/* issue dummy command to work around firmware bug */
-	ret = i2c_read_reg(&client, 0x01, &reg, 1);
+	ret = i2c_read_reg(client, 0x01, &reg, 1);
 	if (ret < 0) {
 		pr_err("Failed to issue a dummy command\n");
 		return ret;
-- 
2.21.0


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

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 07/23] ARM: zii-common: Support rave_switch_reset on ZII Ultra
  2020-03-31 18:46 [PATCH 00/23] A number of ZII related fixes Andrey Smirnov
                   ` (5 preceding siblings ...)
  2020-03-31 18:47 ` [PATCH 06/23] ARM: zii-common: Find switch watchdog via DT Andrey Smirnov
@ 2020-03-31 18:47 ` Andrey Smirnov
  2020-03-31 18:47 ` [PATCH 08/23] ARM: zii-imx6q-rdu2: Differentiate between RDU2 and RDU2+ Andrey Smirnov
                   ` (16 subsequent siblings)
  23 siblings, 0 replies; 34+ messages in thread
From: Andrey Smirnov @ 2020-03-31 18:47 UTC (permalink / raw)
  To: Barebox List; +Cc: Andrey Smirnov

ZII Ultra boards implement switch watchdog the same way as ZII
RDU2. Add necessary code to make rave_switch_reset availible.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 arch/arm/boards/zii-common/switch-cmd.c              | 12 +++++++++++-
 arch/arm/boards/zii-imx8mq-dev/board.c               |  9 +++++++++
 .../defaultenv-imx8mq-zii-dev/network/eth0-discover  |  4 ++++
 arch/arm/dts/imx8mq-zii-ultra.dtsi                   |  1 -
 4 files changed, 24 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/network/eth0-discover

diff --git a/arch/arm/boards/zii-common/switch-cmd.c b/arch/arm/boards/zii-common/switch-cmd.c
index 02802ff86..cf5554e2e 100644
--- a/arch/arm/boards/zii-common/switch-cmd.c
+++ b/arch/arm/boards/zii-common/switch-cmd.c
@@ -29,6 +29,15 @@ static int do_rdu2_switch_reset(void)
 		return -ENODEV;
 	}
 
+	if (!of_device_is_available(np)) {
+		/*
+		 * If switch watchdog device is not available assume
+		 * it was removed for a reason and switch reset
+		 * command should be a no-op
+		 */
+		return 0;
+	}
+
 	client = of_find_i2c_device_by_node(np);
 	if (!client) {
 		pr_err("No switch watchdog I2C device found\n");
@@ -78,7 +87,8 @@ static int do_rdu1_switch_reset(void)
 static int do_rave_switch_reset(int argc, char *argv[])
 {
 	if (of_machine_is_compatible("zii,imx6q-zii-rdu2") ||
-	    of_machine_is_compatible("zii,imx6qp-zii-rdu2"))
+	    of_machine_is_compatible("zii,imx6qp-zii-rdu2") ||
+	    of_machine_is_compatible("zii,imx8mq-ultra"))
 		return do_rdu2_switch_reset();
 
 	if (of_machine_is_compatible("zii,imx51-rdu1"))
diff --git a/arch/arm/boards/zii-imx8mq-dev/board.c b/arch/arm/boards/zii-imx8mq-dev/board.c
index ac455990b..7591841fe 100644
--- a/arch/arm/boards/zii-imx8mq-dev/board.c
+++ b/arch/arm/boards/zii-imx8mq-dev/board.c
@@ -110,6 +110,15 @@ static int zii_imx8mq_dev_fixup_deb_internal(void)
 	/* Refresh the internal aliases list from the patched DT */
 	of_alias_scan();
 
+	/*
+	 * Disable switch watchdog to make rave_reset_switch a no-op
+	 */
+	np = of_find_compatible_node(NULL, NULL, "zii,rave-wdt");
+	if (!np)
+		return -ENODEV;
+
+	of_device_disable(np);
+
 	return 0;
 }
 
diff --git a/arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/network/eth0-discover b/arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/network/eth0-discover
new file mode 100644
index 000000000..00f312011
--- /dev/null
+++ b/arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/network/eth0-discover
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+# reset switch to clear DSA config
+rave_reset_switch
diff --git a/arch/arm/dts/imx8mq-zii-ultra.dtsi b/arch/arm/dts/imx8mq-zii-ultra.dtsi
index 50bad9b1a..2df87d07a 100644
--- a/arch/arm/dts/imx8mq-zii-ultra.dtsi
+++ b/arch/arm/dts/imx8mq-zii-ultra.dtsi
@@ -114,4 +114,3 @@
 		reg = <0xe0000 0x20000>;
 	};
 };
-
-- 
2.21.0


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

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 08/23] ARM: zii-imx6q-rdu2: Differentiate between RDU2 and RDU2+
  2020-03-31 18:46 [PATCH 00/23] A number of ZII related fixes Andrey Smirnov
                   ` (6 preceding siblings ...)
  2020-03-31 18:47 ` [PATCH 07/23] ARM: zii-common: Support rave_switch_reset on ZII Ultra Andrey Smirnov
@ 2020-03-31 18:47 ` Andrey Smirnov
  2020-03-31 18:47 ` [PATCH 09/23] ARM: zii-imx7d-dev: Differentiate between RPU2 and RMU2 Andrey Smirnov
                   ` (15 subsequent siblings)
  23 siblings, 0 replies; 34+ messages in thread
From: Andrey Smirnov @ 2020-03-31 18:47 UTC (permalink / raw)
  To: Barebox List; +Cc: Andrey Smirnov

Add code to configure hostname so we could differentiate between the
two in scripts.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 arch/arm/boards/zii-imx6q-rdu2/board.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boards/zii-imx6q-rdu2/board.c b/arch/arm/boards/zii-imx6q-rdu2/board.c
index d41609bfa..0bb4700b6 100644
--- a/arch/arm/boards/zii-imx6q-rdu2/board.c
+++ b/arch/arm/boards/zii-imx6q-rdu2/board.c
@@ -128,8 +128,11 @@ static int rdu2_devices_init(void)
 {
 	struct i2c_client client;
 
-	if (!of_machine_is_compatible("zii,imx6q-zii-rdu2") &&
-	    !of_machine_is_compatible("zii,imx6qp-zii-rdu2"))
+	if (of_machine_is_compatible("zii,imx6q-zii-rdu2"))
+		barebox_set_hostname("rdu2");
+	else if (of_machine_is_compatible("zii,imx6qp-zii-rdu2"))
+		barebox_set_hostname("rdu2p");
+	else
 		return 0;
 
 	client.adapter = i2c_get_adapter(1);
@@ -147,8 +150,6 @@ static int rdu2_devices_init(void)
 		i2c_write_reg(&client, 0x2e, &reg, 1);
 	}
 
-	barebox_set_hostname("rdu2");
-
 	imx6_bbu_internal_spi_i2c_register_handler("SPI", "/dev/m25p0.barebox",
 						   BBU_HANDLER_FLAG_DEFAULT);
 
-- 
2.21.0


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

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 09/23] ARM: zii-imx7d-dev: Differentiate between RPU2 and RMU2
  2020-03-31 18:46 [PATCH 00/23] A number of ZII related fixes Andrey Smirnov
                   ` (7 preceding siblings ...)
  2020-03-31 18:47 ` [PATCH 08/23] ARM: zii-imx6q-rdu2: Differentiate between RDU2 and RDU2+ Andrey Smirnov
@ 2020-03-31 18:47 ` Andrey Smirnov
  2020-03-31 18:47 ` [PATCH 10/23] ARM: zii-imx8mq-dev: Differentiate between Zest and RMB3 Andrey Smirnov
                   ` (14 subsequent siblings)
  23 siblings, 0 replies; 34+ messages in thread
From: Andrey Smirnov @ 2020-03-31 18:47 UTC (permalink / raw)
  To: Barebox List; +Cc: Andrey Smirnov

Add code to configure hostname so we could differentiate between the
two in scripts.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 arch/arm/boards/zii-imx7d-dev/board.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/boards/zii-imx7d-dev/board.c b/arch/arm/boards/zii-imx7d-dev/board.c
index e46a4b181..b53a6af49 100644
--- a/arch/arm/boards/zii-imx7d-dev/board.c
+++ b/arch/arm/boards/zii-imx7d-dev/board.c
@@ -48,3 +48,13 @@ static int zii_imx7d_rpu2_coredevices_init(void)
 }
 coredevice_initcall(zii_imx7d_rpu2_coredevices_init);
 
+static int zii_imx7d_dev_init(void)
+{
+	if (of_machine_is_compatible("zii,imx7d-rpu2"))
+		barebox_set_hostname("rpu2");
+	else if (of_machine_is_compatible("zii,imx7d-rmu2"))
+		barebox_set_hostname("rmu2");
+
+	return 0;
+}
+late_initcall(zii_imx7d_dev_init);
-- 
2.21.0


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

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 10/23] ARM: zii-imx8mq-dev: Differentiate between Zest and RMB3
  2020-03-31 18:46 [PATCH 00/23] A number of ZII related fixes Andrey Smirnov
                   ` (8 preceding siblings ...)
  2020-03-31 18:47 ` [PATCH 09/23] ARM: zii-imx7d-dev: Differentiate between RPU2 and RMU2 Andrey Smirnov
@ 2020-03-31 18:47 ` Andrey Smirnov
  2020-03-31 18:47 ` [PATCH 11/23] ARM: zii-common: Add common environment directory Andrey Smirnov
                   ` (13 subsequent siblings)
  23 siblings, 0 replies; 34+ messages in thread
From: Andrey Smirnov @ 2020-03-31 18:47 UTC (permalink / raw)
  To: Barebox List; +Cc: Andrey Smirnov

Add code to configure hostname so we could differentiate between the
two in scripts.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 arch/arm/boards/zii-imx8mq-dev/board.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boards/zii-imx8mq-dev/board.c b/arch/arm/boards/zii-imx8mq-dev/board.c
index 7591841fe..ddd15299c 100644
--- a/arch/arm/boards/zii-imx8mq-dev/board.c
+++ b/arch/arm/boards/zii-imx8mq-dev/board.c
@@ -26,7 +26,10 @@ static int zii_imx8mq_dev_init(void)
 	if (!of_machine_is_compatible("zii,imx8mq-ultra"))
 		return 0;
 
-	barebox_set_hostname("imx8mq-zii-rdu3");
+	if (of_machine_is_compatible("zii,imx8mq-ultra-zest"))
+		barebox_set_hostname("zest");
+	if (of_machine_is_compatible("zii,imx8mq-ultra-rmb3"))
+		barebox_set_hostname("rmb3");
 
 	imx8mq_bbu_internal_mmcboot_register_handler("eMMC", "/dev/mmc0",
 						     BBU_HANDLER_FLAG_DEFAULT);
-- 
2.21.0


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

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 11/23] ARM: zii-common: Add common environment directory
  2020-03-31 18:46 [PATCH 00/23] A number of ZII related fixes Andrey Smirnov
                   ` (9 preceding siblings ...)
  2020-03-31 18:47 ` [PATCH 10/23] ARM: zii-imx8mq-dev: Differentiate between Zest and RMB3 Andrey Smirnov
@ 2020-03-31 18:47 ` Andrey Smirnov
  2020-04-02  6:49   ` Sascha Hauer
  2020-03-31 18:47 ` [PATCH 12/23] ARM: zii-imx6q-rdu2: Register SD card slot with BBU Andrey Smirnov
                   ` (12 subsequent siblings)
  23 siblings, 1 reply; 34+ messages in thread
From: Andrey Smirnov @ 2020-03-31 18:47 UTC (permalink / raw)
  To: Barebox List; +Cc: Andrey Smirnov

Establish a common environment directory between all ZII boards, so
that we could share common bits and pieces. As a first step, get rid
of board scecific net boot scripts and replace them with a single
shared one.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 arch/arm/boards/zii-common/Makefile           |  1 +
 .../defaultenv-zii-common}/boot/net           |  9 +++++--
 arch/arm/boards/zii-imx51-rdu1/board.c        |  1 +
 arch/arm/boards/zii-imx6q-rdu2/board.c        |  1 +
 .../zii-imx6q-rdu2/defaultenv-rdu2/boot/net   | 24 -------------------
 arch/arm/boards/zii-imx7d-dev/board.c         |  2 ++
 arch/arm/boards/zii-imx8mq-dev/board.c        |  1 +
 .../defaultenv-imx8mq-zii-dev/boot/net        | 24 -------------------
 arch/arm/boards/zii-vf610-dev/board.c         |  1 +
 9 files changed, 14 insertions(+), 50 deletions(-)
 rename arch/arm/boards/{zii-imx51-rdu1/defaultenv-rdu1 => zii-common/defaultenv-zii-common}/boot/net (73%)
 delete mode 100644 arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/boot/net
 delete mode 100644 arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/boot/net

diff --git a/arch/arm/boards/zii-common/Makefile b/arch/arm/boards/zii-common/Makefile
index fcc5cdf97..90bdf21e7 100644
--- a/arch/arm/boards/zii-common/Makefile
+++ b/arch/arm/boards/zii-common/Makefile
@@ -1 +1,2 @@
 obj-y += board.o switch-cmd.o pn-fixup.o
+bbenv-y += defaultenv-zii-common
diff --git a/arch/arm/boards/zii-imx51-rdu1/defaultenv-rdu1/boot/net b/arch/arm/boards/zii-common/defaultenv-zii-common/boot/net
similarity index 73%
rename from arch/arm/boards/zii-imx51-rdu1/defaultenv-rdu1/boot/net
rename to arch/arm/boards/zii-common/defaultenv-zii-common/boot/net
index 4be8e1e2d..8b07cbbc9 100644
--- a/arch/arm/boards/zii-imx51-rdu1/defaultenv-rdu1/boot/net
+++ b/arch/arm/boards/zii-common/defaultenv-zii-common/boot/net
@@ -2,8 +2,13 @@
 
 path="/mnt/tftp"
 
-# clear seat network config
-global.linux.bootargs.rdu_network=
+#
+# Clear seat network config. Some boards don't have that config, so
+# check that it is set first
+#
+if [ -n ${global.linux.bootargs.rdu_network} ]; then
+    global.linux.bootargs.rdu_network=
+fi
 
 global.bootm.image="${path}/${global.user}-linux-${global.hostname}"
 
diff --git a/arch/arm/boards/zii-imx51-rdu1/board.c b/arch/arm/boards/zii-imx51-rdu1/board.c
index 640bb0d1b..8fdcb7626 100644
--- a/arch/arm/boards/zii-imx51-rdu1/board.c
+++ b/arch/arm/boards/zii-imx51-rdu1/board.c
@@ -50,6 +50,7 @@ static int zii_rdu1_init(void)
 		BBU_HANDLER_FLAG_DEFAULT |
 		IMX_BBU_FLAG_PARTITION_STARTS_AT_HEADER);
 
+	defaultenv_append_directory(defaultenv_zii_common);
 	defaultenv_append_directory(defaultenv_rdu1);
 
 	return 0;
diff --git a/arch/arm/boards/zii-imx6q-rdu2/board.c b/arch/arm/boards/zii-imx6q-rdu2/board.c
index 0bb4700b6..6d6bc1caa 100644
--- a/arch/arm/boards/zii-imx6q-rdu2/board.c
+++ b/arch/arm/boards/zii-imx6q-rdu2/board.c
@@ -155,6 +155,7 @@ static int rdu2_devices_init(void)
 
 	imx6_bbu_internal_mmcboot_register_handler("eMMC", "/dev/mmc3", 0);
 
+	defaultenv_append_directory(defaultenv_zii_common);
 	defaultenv_append_directory(defaultenv_rdu2);
 
 	return 0;
diff --git a/arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/boot/net b/arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/boot/net
deleted file mode 100644
index 4090c2f4a..000000000
--- a/arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/boot/net
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh
-
-path="/mnt/tftp"
-
-# clear seat network config
-global.linux.bootargs.rdu_network=
-
-global.bootm.image="${path}/${global.user}-linux-${global.hostname}"
-
-oftree="${path}/${global.user}-oftree-${global.hostname}"
-if [ -f "${oftree}" ]; then
-	global.bootm.oftree="$oftree"
-fi
-
-nfsroot="/home/${global.user}/nfsroot/${global.hostname}"
-
-ip_route_get -b ${global.net.server} global.linux.bootargs.dyn.ip
-
-initramfs="${path}/${global.user}-initramfs-${global.hostname}"
-if [ -f "${initramfs}" ]; then
-	global.bootm.initrd="$initramfs"
-else
-	global.linux.bootargs.dyn.root="root=/dev/nfs nfsroot=$nfsroot,v3,tcp"
-fi
\ No newline at end of file
diff --git a/arch/arm/boards/zii-imx7d-dev/board.c b/arch/arm/boards/zii-imx7d-dev/board.c
index b53a6af49..6b409e23b 100644
--- a/arch/arm/boards/zii-imx7d-dev/board.c
+++ b/arch/arm/boards/zii-imx7d-dev/board.c
@@ -55,6 +55,8 @@ static int zii_imx7d_dev_init(void)
 	else if (of_machine_is_compatible("zii,imx7d-rmu2"))
 		barebox_set_hostname("rmu2");
 
+	defaultenv_append_directory(defaultenv_zii_common);
+
 	return 0;
 }
 late_initcall(zii_imx7d_dev_init);
diff --git a/arch/arm/boards/zii-imx8mq-dev/board.c b/arch/arm/boards/zii-imx8mq-dev/board.c
index ddd15299c..285e889fe 100644
--- a/arch/arm/boards/zii-imx8mq-dev/board.c
+++ b/arch/arm/boards/zii-imx8mq-dev/board.c
@@ -39,6 +39,7 @@ static int zii_imx8mq_dev_init(void)
 	else
 		of_device_enable_path("/chosen/environment-sd");
 
+	defaultenv_append_directory(defaultenv_zii_common);
 	defaultenv_append_directory(defaultenv_imx8mq_zii_dev);
 
 	return 0;
diff --git a/arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/boot/net b/arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/boot/net
deleted file mode 100644
index 4090c2f4a..000000000
--- a/arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/boot/net
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh
-
-path="/mnt/tftp"
-
-# clear seat network config
-global.linux.bootargs.rdu_network=
-
-global.bootm.image="${path}/${global.user}-linux-${global.hostname}"
-
-oftree="${path}/${global.user}-oftree-${global.hostname}"
-if [ -f "${oftree}" ]; then
-	global.bootm.oftree="$oftree"
-fi
-
-nfsroot="/home/${global.user}/nfsroot/${global.hostname}"
-
-ip_route_get -b ${global.net.server} global.linux.bootargs.dyn.ip
-
-initramfs="${path}/${global.user}-initramfs-${global.hostname}"
-if [ -f "${initramfs}" ]; then
-	global.bootm.initrd="$initramfs"
-else
-	global.linux.bootargs.dyn.root="root=/dev/nfs nfsroot=$nfsroot,v3,tcp"
-fi
\ No newline at end of file
diff --git a/arch/arm/boards/zii-vf610-dev/board.c b/arch/arm/boards/zii-vf610-dev/board.c
index 1d10f12f6..6b80ec428 100644
--- a/arch/arm/boards/zii-vf610-dev/board.c
+++ b/arch/arm/boards/zii-vf610-dev/board.c
@@ -141,6 +141,7 @@ static int zii_vf610_dev_set_hostname(void)
 		}
 	}
 
+	defaultenv_append_directory(defaultenv_zii_common);
 	defaultenv_append_directory(defaultenv_zii_vf610_dev);
 	return 0;
 }
-- 
2.21.0


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

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 12/23] ARM: zii-imx6q-rdu2: Register SD card slot with BBU
  2020-03-31 18:46 [PATCH 00/23] A number of ZII related fixes Andrey Smirnov
                   ` (10 preceding siblings ...)
  2020-03-31 18:47 ` [PATCH 11/23] ARM: zii-common: Add common environment directory Andrey Smirnov
@ 2020-03-31 18:47 ` Andrey Smirnov
  2020-03-31 18:47 ` [PATCH 13/23] ARM: zii-vf610-dev: " Andrey Smirnov
                   ` (11 subsequent siblings)
  23 siblings, 0 replies; 34+ messages in thread
From: Andrey Smirnov @ 2020-03-31 18:47 UTC (permalink / raw)
  To: Barebox List; +Cc: Andrey Smirnov

Register SD card slot with BBU. This is really useful for development
since this allows to update the bootloader on SD card without having
to take it out of the device.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 arch/arm/boards/zii-imx6q-rdu2/board.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boards/zii-imx6q-rdu2/board.c b/arch/arm/boards/zii-imx6q-rdu2/board.c
index 6d6bc1caa..0f298d6a4 100644
--- a/arch/arm/boards/zii-imx6q-rdu2/board.c
+++ b/arch/arm/boards/zii-imx6q-rdu2/board.c
@@ -154,6 +154,7 @@ static int rdu2_devices_init(void)
 						   BBU_HANDLER_FLAG_DEFAULT);
 
 	imx6_bbu_internal_mmcboot_register_handler("eMMC", "/dev/mmc3", 0);
+	imx6_bbu_internal_mmc_register_handler("SD", "/dev/mmc1", 0);
 
 	defaultenv_append_directory(defaultenv_zii_common);
 	defaultenv_append_directory(defaultenv_rdu2);
-- 
2.21.0


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

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 13/23] ARM: zii-vf610-dev: Register SD card slot with BBU
  2020-03-31 18:46 [PATCH 00/23] A number of ZII related fixes Andrey Smirnov
                   ` (11 preceding siblings ...)
  2020-03-31 18:47 ` [PATCH 12/23] ARM: zii-imx6q-rdu2: Register SD card slot with BBU Andrey Smirnov
@ 2020-03-31 18:47 ` Andrey Smirnov
  2020-03-31 18:47 ` [PATCH 14/23] ARM: zii-imx8mq-dev: " Andrey Smirnov
                   ` (10 subsequent siblings)
  23 siblings, 0 replies; 34+ messages in thread
From: Andrey Smirnov @ 2020-03-31 18:47 UTC (permalink / raw)
  To: Barebox List; +Cc: Andrey Smirnov

Register SD card slot with BBU. This is really useful for development
since this allows to update the bootloader on SD card without having
to take it out of the device.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 arch/arm/boards/zii-vf610-dev/board.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/boards/zii-vf610-dev/board.c b/arch/arm/boards/zii-vf610-dev/board.c
index 6b80ec428..35fc9e404 100644
--- a/arch/arm/boards/zii-vf610-dev/board.c
+++ b/arch/arm/boards/zii-vf610-dev/board.c
@@ -162,6 +162,14 @@ static int zii_vf610_dev_register_bbu(void)
 		return ret;
 	}
 
+	ret = vf610_bbu_internal_mmc_register_handler("SD",
+						      "/dev/mmc1",
+						      0);
+	if (ret) {
+		pr_err("Failed to register SD BBU handler\n");
+		return ret;
+	}
+
 	return 0;
 }
 late_initcall(zii_vf610_dev_register_bbu);
-- 
2.21.0


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

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 14/23] ARM: zii-imx8mq-dev: Register SD card slot with BBU
  2020-03-31 18:46 [PATCH 00/23] A number of ZII related fixes Andrey Smirnov
                   ` (12 preceding siblings ...)
  2020-03-31 18:47 ` [PATCH 13/23] ARM: zii-vf610-dev: " Andrey Smirnov
@ 2020-03-31 18:47 ` Andrey Smirnov
  2020-03-31 18:47 ` [PATCH 15/23] ARM: zii-vf610-dev: Add newline to end of board.c Andrey Smirnov
                   ` (9 subsequent siblings)
  23 siblings, 0 replies; 34+ messages in thread
From: Andrey Smirnov @ 2020-03-31 18:47 UTC (permalink / raw)
  To: Barebox List; +Cc: Andrey Smirnov

Register SD card slot with BBU. This is really useful for development
since this allows to update the bootloader on SD card without having
to take it out of the device.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 arch/arm/boards/zii-imx8mq-dev/board.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boards/zii-imx8mq-dev/board.c b/arch/arm/boards/zii-imx8mq-dev/board.c
index 285e889fe..cfe879c20 100644
--- a/arch/arm/boards/zii-imx8mq-dev/board.c
+++ b/arch/arm/boards/zii-imx8mq-dev/board.c
@@ -33,6 +33,7 @@ static int zii_imx8mq_dev_init(void)
 
 	imx8mq_bbu_internal_mmcboot_register_handler("eMMC", "/dev/mmc0",
 						     BBU_HANDLER_FLAG_DEFAULT);
+	imx8mq_bbu_internal_mmc_register_handler("SD", "/dev/mmc1", 0);
 
 	if (bootsource_get_instance() == 0)
 		of_device_enable_path("/chosen/environment-emmc");
-- 
2.21.0


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

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 15/23] ARM: zii-vf610-dev: Add newline to end of board.c
  2020-03-31 18:46 [PATCH 00/23] A number of ZII related fixes Andrey Smirnov
                   ` (13 preceding siblings ...)
  2020-03-31 18:47 ` [PATCH 14/23] ARM: zii-imx8mq-dev: " Andrey Smirnov
@ 2020-03-31 18:47 ` Andrey Smirnov
  2020-03-31 18:47 ` [PATCH 16/23] ARM: rdu2: Drop redundant USB GPIO hog nodes Andrey Smirnov
                   ` (8 subsequent siblings)
  23 siblings, 0 replies; 34+ messages in thread
From: Andrey Smirnov @ 2020-03-31 18:47 UTC (permalink / raw)
  To: Barebox List; +Cc: Andrey Smirnov

Add newline to end of board.c so that git doesn't complain.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 arch/arm/boards/zii-vf610-dev/board.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boards/zii-vf610-dev/board.c b/arch/arm/boards/zii-vf610-dev/board.c
index 35fc9e404..6445025b2 100644
--- a/arch/arm/boards/zii-vf610-dev/board.c
+++ b/arch/arm/boards/zii-vf610-dev/board.c
@@ -194,4 +194,4 @@ static int zii_vf610_register_emmc_bbu(void)
 
 	return 0;
 }
-late_initcall(zii_vf610_register_emmc_bbu);
\ No newline at end of file
+late_initcall(zii_vf610_register_emmc_bbu);
-- 
2.21.0


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

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 16/23] ARM: rdu2: Drop redundant USB GPIO hog nodes
  2020-03-31 18:46 [PATCH 00/23] A number of ZII related fixes Andrey Smirnov
                   ` (14 preceding siblings ...)
  2020-03-31 18:47 ` [PATCH 15/23] ARM: zii-vf610-dev: Add newline to end of board.c Andrey Smirnov
@ 2020-03-31 18:47 ` Andrey Smirnov
  2020-03-31 18:47 ` [PATCH 17/23] ARM: imx8mq: Drop trailing whitespace Andrey Smirnov
                   ` (7 subsequent siblings)
  23 siblings, 0 replies; 34+ messages in thread
From: Andrey Smirnov @ 2020-03-31 18:47 UTC (permalink / raw)
  To: Barebox List; +Cc: Andrey Smirnov

All of those nodes are already present in upstream DT. Drop them.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 arch/arm/dts/imx6qdl-zii-rdu2.dtsi | 36 ------------------------------
 1 file changed, 36 deletions(-)

diff --git a/arch/arm/dts/imx6qdl-zii-rdu2.dtsi b/arch/arm/dts/imx6qdl-zii-rdu2.dtsi
index c31a27904..b593545ff 100644
--- a/arch/arm/dts/imx6qdl-zii-rdu2.dtsi
+++ b/arch/arm/dts/imx6qdl-zii-rdu2.dtsi
@@ -292,39 +292,3 @@
 		};
 	};
 };
-
-&gpio3 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&pinctrl_gpio3_hog>;
-
-	usb-emulation {
-		gpio-hog;
-		gpios = <19 GPIO_ACTIVE_HIGH>;
-		output-low;
-		line-name = "usb-emulation";
-	};
-
-	usb-mode1 {
-		gpio-hog;
-		gpios = <20 GPIO_ACTIVE_HIGH>;
-		output-high;
-		line-name = "usb-mode1";
-	};
-
-	usb-mode2 {
-		gpio-hog;
-		gpios = <23 GPIO_ACTIVE_HIGH>;
-		output-high;
-		line-name = "usb-mode2";
-	};
-};
-
-&iomuxc {
-	pinctrl_gpio3_hog: gpio3hoggrp {
-		fsl,pins = <
-			MX6QDL_PAD_EIM_D19__GPIO3_IO19		0x40000038
-			MX6QDL_PAD_EIM_D20__GPIO3_IO20		0x40000038
-			MX6QDL_PAD_EIM_D23__GPIO3_IO23		0x40000038
-		>;
-	};
-};
-- 
2.21.0


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

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 17/23] ARM: imx8mq: Drop trailing whitespace
  2020-03-31 18:46 [PATCH 00/23] A number of ZII related fixes Andrey Smirnov
                   ` (15 preceding siblings ...)
  2020-03-31 18:47 ` [PATCH 16/23] ARM: rdu2: Drop redundant USB GPIO hog nodes Andrey Smirnov
@ 2020-03-31 18:47 ` Andrey Smirnov
  2020-03-31 18:47 ` [PATCH 18/23] ARM: imx8mq: Drop redundant DT nodes Andrey Smirnov
                   ` (6 subsequent siblings)
  23 siblings, 0 replies; 34+ messages in thread
From: Andrey Smirnov @ 2020-03-31 18:47 UTC (permalink / raw)
  To: Barebox List; +Cc: Andrey Smirnov

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 arch/arm/dts/imx8mq.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/dts/imx8mq.dtsi b/arch/arm/dts/imx8mq.dtsi
index e334a15c9..936e48610 100644
--- a/arch/arm/dts/imx8mq.dtsi
+++ b/arch/arm/dts/imx8mq.dtsi
@@ -114,7 +114,7 @@
 			  <&clk IMX8MQ_CLK_ENET_AXI>,
 			  <&clk IMX8MQ_CLK_ENET_TIMER>,
 			  <&clk IMX8MQ_CLK_ENET_REF>;
-			  
+
 	assigned-clock-parents =  <&clk IMX8MQ_SYS1_PLL_400M>,
 				  <&clk IMX8MQ_SYS1_PLL_400M>,
 				  <&clk IMX8MQ_SYS1_PLL_266M>,
-- 
2.21.0


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

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 18/23] ARM: imx8mq: Drop redundant DT nodes
  2020-03-31 18:46 [PATCH 00/23] A number of ZII related fixes Andrey Smirnov
                   ` (16 preceding siblings ...)
  2020-03-31 18:47 ` [PATCH 17/23] ARM: imx8mq: Drop trailing whitespace Andrey Smirnov
@ 2020-03-31 18:47 ` Andrey Smirnov
  2020-03-31 18:47 ` [PATCH 19/23] ARM: zii-imx8mq-dev: Add boot source info Andrey Smirnov
                   ` (5 subsequent siblings)
  23 siblings, 0 replies; 34+ messages in thread
From: Andrey Smirnov @ 2020-03-31 18:47 UTC (permalink / raw)
  To: Barebox List; +Cc: Andrey Smirnov

Drop all of the aliases and themrmal-zone nodes in imx8mq.dtsi since
those nodes are now present in upstream DT file.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 arch/arm/dts/imx8mq.dtsi | 97 ----------------------------------------
 1 file changed, 97 deletions(-)

diff --git a/arch/arm/dts/imx8mq.dtsi b/arch/arm/dts/imx8mq.dtsi
index 936e48610..44a86c715 100644
--- a/arch/arm/dts/imx8mq.dtsi
+++ b/arch/arm/dts/imx8mq.dtsi
@@ -4,108 +4,11 @@
  * Copyright (C) 2017 Pengutronix, Lucas Stach <kernel@pengutronix.de>
  */
 
-#include <dt-bindings/reset/imx8mq-reset.h>
-#include <dt-bindings/thermal/thermal.h>
-
 / {
 	aliases {
-		gpio0 = &gpio1;
-		gpio1 = &gpio2;
-		gpio2 = &gpio3;
-		gpio3 = &gpio4;
-		gpio4 = &gpio5;
 		mmc0 = &usdhc1;
 		mmc1 = &usdhc2;
 	};
-
-	thermal-zones {
-		cpu-thermal {
-			polling-delay-passive = <250>;
-			polling-delay = <2000>;
-			thermal-sensors = <&tmu>;
-
-			trips {
-				cpu_alert0: trip0 {
-					temperature = <85000>;
-					hysteresis = <2000>;
-					type = "passive";
-				};
-
-				cpu_crit0: trip1 {
-					temperature = <95000>;
-					hysteresis = <2000>;
-					type = "critical";
-				};
-			};
-
-			cooling-maps {
-				map0 {
-					trip = <&cpu_alert0>;
-					cooling-device = <&A53_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
-				};
-			};
-		};
-	};
-
-	soc@0 {
-		bus@30000000 {
-			tmu: tmu@30260000 {
-				compatible = "fsl,imx8mq-tmu";
-				reg = <0x30260000 0x10000>;
-				interrupt = <GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>;
-				little-endian;
-				fsl,tmu-range = <0xb0000 0xa0026 0x80048 0x70061>;
-				fsl,tmu-calibration = <0x00000000 0x00000023
-				                       0x00000001 0x00000029
-				                       0x00000002 0x0000002f
-				                       0x00000003 0x00000035
-				                       0x00000004 0x0000003d
-				                       0x00000005 0x00000043
-				                       0x00000006 0x0000004b
-				                       0x00000007 0x00000051
-				                       0x00000008 0x00000057
-				                       0x00000009 0x0000005f
-				                       0x0000000a 0x00000067
-				                       0x0000000b 0x0000006f
-
-				                       0x00010000 0x0000001b
-				                       0x00010001 0x00000023
-				                       0x00010002 0x0000002b
-				                       0x00010003 0x00000033
-				                       0x00010004 0x0000003b
-				                       0x00010005 0x00000043
-				                       0x00010006 0x0000004b
-				                       0x00010007 0x00000055
-				                       0x00010008 0x0000005d
-				                       0x00010009 0x00000067
-				                       0x0001000a 0x00000070
-
-				                       0x00020000 0x00000017
-				                       0x00020001 0x00000023
-				                       0x00020002 0x0000002d
-				                       0x00020003 0x00000037
-				                       0x00020004 0x00000041
-				                       0x00020005 0x0000004b
-				                       0x00020006 0x00000057
-				                       0x00020007 0x00000063
-				                       0x00020008 0x0000006f
-
-				                       0x00030000 0x00000015
-				                       0x00030001 0x00000021
-				                       0x00030002 0x0000002d
-				                       0x00030003 0x00000039
-				                       0x00030004 0x00000045
-				                       0x00030005 0x00000053
-				                       0x00030006 0x0000005f
-				                       0x00030007 0x00000071>;
-				#thermal-sensor-cells =  <0>;
-			};
-		};
-	};
-};
-
-&A53_0 {
-	#cooling-cells = <2>;
 };
 
 &clk {
-- 
2.21.0


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

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 19/23] ARM: zii-imx8mq-dev: Add boot source info
  2020-03-31 18:46 [PATCH 00/23] A number of ZII related fixes Andrey Smirnov
                   ` (17 preceding siblings ...)
  2020-03-31 18:47 ` [PATCH 18/23] ARM: imx8mq: Drop redundant DT nodes Andrey Smirnov
@ 2020-03-31 18:47 ` Andrey Smirnov
  2020-03-31 18:47 ` [PATCH 20/23] ARM: zii-imx8mq-dev: Drop redundant "stdout-path" Andrey Smirnov
                   ` (4 subsequent siblings)
  23 siblings, 0 replies; 34+ messages in thread
From: Andrey Smirnov @ 2020-03-31 18:47 UTC (permalink / raw)
  To: Barebox List; +Cc: Andrey Smirnov

Add boot source info so that RAVE SP driver can properly query it.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 arch/arm/dts/imx8mq-zii-ultra.dtsi | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/arm/dts/imx8mq-zii-ultra.dtsi b/arch/arm/dts/imx8mq-zii-ultra.dtsi
index 2df87d07a..35cc21b57 100644
--- a/arch/arm/dts/imx8mq-zii-ultra.dtsi
+++ b/arch/arm/dts/imx8mq-zii-ultra.dtsi
@@ -68,12 +68,21 @@
 
 &uart2 {
 	rave-sp {
+		watchdog {
+			nvmem-cells = <&boot_source>;
+			nvmem-cell-names = "boot-source";
+		};
+
 		eeprom@a4 {
 			lru_part_number: lru-part-number@21 {
 				reg = <0x21 15>;
 				read-only;
 			};
 
+			boot_source: boot-source@83 {
+				reg = <0x83 1>;
+			};
+
 			mac_address_0: mac-address@180 {
 				reg = <0x180 6>;
 			};
-- 
2.21.0


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

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 20/23] ARM: zii-imx8mq-dev: Drop redundant "stdout-path"
  2020-03-31 18:46 [PATCH 00/23] A number of ZII related fixes Andrey Smirnov
                   ` (18 preceding siblings ...)
  2020-03-31 18:47 ` [PATCH 19/23] ARM: zii-imx8mq-dev: Add boot source info Andrey Smirnov
@ 2020-03-31 18:47 ` Andrey Smirnov
  2020-03-31 18:47 ` [PATCH 21/23] ARM: zii-imx7d-dev: Drop redundant RMU2 .dtsi Andrey Smirnov
                   ` (3 subsequent siblings)
  23 siblings, 0 replies; 34+ messages in thread
From: Andrey Smirnov @ 2020-03-31 18:47 UTC (permalink / raw)
  To: Barebox List; +Cc: Andrey Smirnov

Drop redundant "stdout-path" since it already present in upstream DT.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 arch/arm/dts/imx8mq-zii-ultra.dtsi | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/arm/dts/imx8mq-zii-ultra.dtsi b/arch/arm/dts/imx8mq-zii-ultra.dtsi
index 35cc21b57..896993a0e 100644
--- a/arch/arm/dts/imx8mq-zii-ultra.dtsi
+++ b/arch/arm/dts/imx8mq-zii-ultra.dtsi
@@ -8,8 +8,6 @@
 
 / {
 	chosen {
-		stdout-path = &uart1;
-
 		environment-emmc {
 			compatible = "barebox,environment";
 			device-path = &usdhc1, "partname:barebox-environment";
-- 
2.21.0


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

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 21/23] ARM: zii-imx7d-dev: Drop redundant RMU2 .dtsi
  2020-03-31 18:46 [PATCH 00/23] A number of ZII related fixes Andrey Smirnov
                   ` (19 preceding siblings ...)
  2020-03-31 18:47 ` [PATCH 20/23] ARM: zii-imx8mq-dev: Drop redundant "stdout-path" Andrey Smirnov
@ 2020-03-31 18:47 ` Andrey Smirnov
  2020-03-31 18:47 ` [PATCH 22/23] ARM: zii-imx7d-rmu2: Add SPI NOR partition info Andrey Smirnov
                   ` (2 subsequent siblings)
  23 siblings, 0 replies; 34+ messages in thread
From: Andrey Smirnov @ 2020-03-31 18:47 UTC (permalink / raw)
  To: Barebox List; +Cc: Andrey Smirnov

The file has made it upstream so we can drop our local copy.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 arch/arm/dts/imx7d-zii-rmu2.dts  |   2 +-
 arch/arm/dts/imx7d-zii-rmu2.dtsi | 361 -------------------------------
 2 files changed, 1 insertion(+), 362 deletions(-)
 delete mode 100644 arch/arm/dts/imx7d-zii-rmu2.dtsi

diff --git a/arch/arm/dts/imx7d-zii-rmu2.dts b/arch/arm/dts/imx7d-zii-rmu2.dts
index 1d0d631de..de330c413 100644
--- a/arch/arm/dts/imx7d-zii-rmu2.dts
+++ b/arch/arm/dts/imx7d-zii-rmu2.dts
@@ -4,5 +4,5 @@
  * Copyright (C) 2019 Zodiac Inflight Innovations
  */
 
-#include "imx7d-zii-rmu2.dtsi"
+#include <arm/imx7d-zii-rmu2.dts>
 #include "imx7d-ddrc.dtsi"
diff --git a/arch/arm/dts/imx7d-zii-rmu2.dtsi b/arch/arm/dts/imx7d-zii-rmu2.dtsi
deleted file mode 100644
index 7b36b1c0e..000000000
--- a/arch/arm/dts/imx7d-zii-rmu2.dtsi
+++ /dev/null
@@ -1,361 +0,0 @@
-// SPDX-License-Identifier: (GPL-2.0 OR MIT)
-/*
- * Device tree file for ZII's RMU2 board
- *
- * RMU - Remote Modem Unit
- *
- * Copyright (C) 2019 Zodiac Inflight Innovations
- */
-
-/dts-v1/;
-#include <dt-bindings/thermal/thermal.h>
-#include <arm/imx7d.dtsi>
-
-/ {
-	model = "ZII RMU2 Board";
-	compatible = "zii,imx7d-rmu2", "fsl,imx7d";
-
-	chosen {
-		stdout-path = &uart2;
-	};
-
-	gpio-leds {
-		compatible = "gpio-leds";
-		pinctrl-0 = <&pinctrl_leds_debug>;
-		pinctrl-names = "default";
-
-		debug {
-			label = "zii:green:debug1";
-			gpios = <&gpio2 8 GPIO_ACTIVE_HIGH>;
-			linux,default-trigger = "heartbeat";
-		};
-	};
-};
-
-&cpu0 {
-	arm-supply = <&sw1a_reg>;
-};
-
-&ecspi1 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&pinctrl_ecspi1>;
-	cs-gpios = <&gpio4 19 GPIO_ACTIVE_HIGH>;
-	status = "okay";
-
-	flash@0 {
-		compatible = "jedec,spi-nor";
-		spi-max-frequency = <20000000>;
-		reg = <0>;
-		#address-cells = <1>;
-		#size-cells = <1>;
-	};
-};
-
-&fec1 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&pinctrl_enet1>;
-	assigned-clocks = <&clks IMX7D_ENET1_TIME_ROOT_SRC>,
-			  <&clks IMX7D_ENET1_TIME_ROOT_CLK>;
-	assigned-clock-parents = <&clks IMX7D_PLL_ENET_MAIN_100M_CLK>;
-	assigned-clock-rates = <0>, <100000000>;
-	phy-mode = "rgmii";
-	phy-handle = <&fec1_phy>;
-	status = "okay";
-
-	mdio {
-		#address-cells = <1>;
-		#size-cells = <0>;
-
-		fec1_phy: phy@0 {
-			pinctrl-names = "default";
-			pinctrl-0 = <&pinctrl_enet1_phy_reset>,
-				    <&pinctrl_enet1_phy_interrupt>;
-			reg = <0>;
-			interrupt-parent = <&gpio1>;
-			interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
-			reset-gpios = <&gpio5 11 GPIO_ACTIVE_LOW>;
-		};
-	};
-};
-
-&i2c1 {
-	clock-frequency = <100000>;
-	pinctrl-names = "default";
-	pinctrl-0 = <&pinctrl_i2c1>;
-	status = "okay";
-
-	pmic: pmic@8 {
-		compatible = "fsl,pfuze3000";
-		reg = <0x08>;
-
-		regulators {
-			sw1a_reg: sw1a {
-				regulator-min-microvolt = <700000>;
-				regulator-max-microvolt = <3300000>;
-				regulator-boot-on;
-				regulator-always-on;
-				regulator-ramp-delay = <6250>;
-			};
-
-			sw1c_reg: sw1b {
-				regulator-min-microvolt = <700000>;
-				regulator-max-microvolt = <1475000>;
-				regulator-boot-on;
-				regulator-always-on;
-				regulator-ramp-delay = <6250>;
-			};
-
-			sw2_reg: sw2 {
-				regulator-min-microvolt = <1500000>;
-				regulator-max-microvolt = <1850000>;
-				regulator-boot-on;
-				regulator-always-on;
-			};
-
-			sw3a_reg: sw3 {
-				regulator-min-microvolt = <900000>;
-				regulator-max-microvolt = <1650000>;
-				regulator-boot-on;
-				regulator-always-on;
-			};
-
-			swbst_reg: swbst {
-				regulator-min-microvolt = <5000000>;
-				regulator-max-microvolt = <5150000>;
-			};
-
-			snvs_reg: vsnvs {
-				regulator-min-microvolt = <1000000>;
-				regulator-max-microvolt = <3000000>;
-				regulator-boot-on;
-				regulator-always-on;
-			};
-
-			vref_reg: vrefddr {
-				regulator-boot-on;
-				regulator-always-on;
-			};
-
-			vgen1_reg: vldo1 {
-				regulator-min-microvolt = <1800000>;
-				regulator-max-microvolt = <3300000>;
-				regulator-always-on;
-			};
-
-			vgen2_reg: vldo2 {
-				regulator-min-microvolt = <800000>;
-				regulator-max-microvolt = <1550000>;
-				regulator-always-on;
-			};
-
-			vgen3_reg: vccsd {
-				regulator-min-microvolt = <2850000>;
-				regulator-max-microvolt = <3300000>;
-				regulator-always-on;
-			};
-
-			vgen4_reg: v33 {
-				regulator-min-microvolt = <2850000>;
-				regulator-max-microvolt = <3300000>;
-				regulator-always-on;
-			};
-
-			vgen5_reg: vldo3 {
-				regulator-min-microvolt = <1800000>;
-				regulator-max-microvolt = <3300000>;
-				regulator-always-on;
-			};
-
-			vgen6_reg: vldo4 {
-				regulator-min-microvolt = <1800000>;
-				regulator-max-microvolt = <3300000>;
-				regulator-always-on;
-			};
-		};
-	};
-
-	eeprom@50 {
-		compatible = "atmel,24c04";
-		reg = <0x50>;
-	};
-
-	eeprom@52 {
-		compatible = "atmel,24c04";
-		reg = <0x52>;
-	};
-};
-
-&uart2 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&pinctrl_uart2>;
-	assigned-clocks = <&clks IMX7D_UART2_ROOT_SRC>;
-	assigned-clock-parents = <&clks IMX7D_OSC_24M_CLK>;
-	status = "okay";
-};
-
-&uart4 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&pinctrl_uart4>;
-	assigned-clocks = <&clks IMX7D_UART4_ROOT_SRC>;
-	assigned-clock-parents = <&clks IMX7D_PLL_SYS_MAIN_240M_CLK>;
-	status = "okay";
-
-	rave-sp {
-		compatible = "zii,rave-sp-rdu2";
-		current-speed = <1000000>;
-		#address-cells = <1>;
-		#size-cells = <1>;
-
-		watchdog {
-			compatible = "zii,rave-sp-watchdog";
-		};
-
-		eeprom@a3 {
-			compatible = "zii,rave-sp-eeprom";
-			reg = <0xa3 0x4000>;
-			#address-cells = <1>;
-			#size-cells = <1>;
-			zii,eeprom-name = "main-eeprom";
-		};
-	};
-};
-
-&usbotg2 {
-	dr_mode = "host";
-	disable-over-current;
-	status = "okay";
-};
-
-&usdhc1 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&pinctrl_usdhc1>;
-	bus-width = <4>;
-	no-1-8-v;
-	no-sdio;
-	keep-power-in-suspend;
-	status = "okay";
-};
-
-&usdhc3 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&pinctrl_usdhc3>;
-	bus-width = <8>;
-	no-1-8-v;
-	non-removable;
-	no-sdio;
-	no-sd;
-	keep-power-in-suspend;
-	status = "okay";
-};
-
-&wdog1 {
-	status = "disabled";
-};
-
-&snvs_rtc {
-	status = "disabled";
-};
-
-&snvs_pwrkey {
-	status = "disabled";
-};
-
-&iomuxc {
-	pinctrl_ecspi1: ecspi1grp {
-		fsl,pins = <
-			MX7D_PAD_ECSPI1_SCLK__ECSPI1_SCLK	0x2
-			MX7D_PAD_ECSPI1_MOSI__ECSPI1_MOSI	0x2
-			MX7D_PAD_ECSPI1_MISO__ECSPI1_MISO	0x2
-			MX7D_PAD_ECSPI1_SS0__GPIO4_IO19         0x59
-		>;
-	};
-
-	pinctrl_enet1: enet1grp {
-		fsl,pins = <
-			MX7D_PAD_SD2_CD_B__ENET1_MDIO				0x3
-			MX7D_PAD_SD2_WP__ENET1_MDC				0x3
-			MX7D_PAD_ENET1_RGMII_TXC__ENET1_RGMII_TXC		0x1
-			MX7D_PAD_ENET1_RGMII_TD0__ENET1_RGMII_TD0		0x1
-			MX7D_PAD_ENET1_RGMII_TD1__ENET1_RGMII_TD1		0x1
-			MX7D_PAD_ENET1_RGMII_TD2__ENET1_RGMII_TD2		0x1
-			MX7D_PAD_ENET1_RGMII_TD3__ENET1_RGMII_TD3		0x1
-			MX7D_PAD_ENET1_RGMII_TX_CTL__ENET1_RGMII_TX_CTL		0x1
-			MX7D_PAD_ENET1_RGMII_RXC__ENET1_RGMII_RXC		0x1
-			MX7D_PAD_ENET1_RGMII_RD0__ENET1_RGMII_RD0		0x1
-			MX7D_PAD_ENET1_RGMII_RD1__ENET1_RGMII_RD1		0x1
-			MX7D_PAD_ENET1_RGMII_RD2__ENET1_RGMII_RD2		0x1
-			MX7D_PAD_ENET1_RGMII_RD3__ENET1_RGMII_RD3		0x1
-			MX7D_PAD_ENET1_RGMII_RX_CTL__ENET1_RGMII_RX_CTL		0x1
-		>;
-	};
-
-	pinctrl_enet1_phy_reset: enet1phyresetgrp {
-		fsl,pins = <
-			MX7D_PAD_SD2_RESET_B__GPIO5_IO11	0x14
-
-		>;
-	};
-
-	pinctrl_i2c1: i2c1grp {
-		fsl,pins = <
-			MX7D_PAD_I2C1_SDA__I2C1_SDA		0x4000007f
-			MX7D_PAD_I2C1_SCL__I2C1_SCL		0x4000007f
-		>;
-	};
-
-	pinctrl_leds_debug: debuggrp {
-		fsl,pins = <
-			MX7D_PAD_EPDC_DATA08__GPIO2_IO8		0x59
-		>;
-	};
-
-
-	pinctrl_uart2: uart2grp {
-		fsl,pins = <
-			MX7D_PAD_UART2_RX_DATA__UART2_DCE_RX	0x79
-			MX7D_PAD_UART2_TX_DATA__UART2_DCE_TX	0x79
-		>;
-	};
-
-	pinctrl_uart4: uart4grp {
-		fsl,pins = <
-			MX7D_PAD_SD2_DATA0__UART4_DCE_RX	0x79
-			MX7D_PAD_SD2_DATA1__UART4_DCE_TX	0x79
-		>;
-	};
-
-	pinctrl_usdhc1: usdhc1grp {
-		fsl,pins = <
-			MX7D_PAD_SD1_CMD__SD1_CMD		0x59
-			MX7D_PAD_SD1_CLK__SD1_CLK		0x19
-			MX7D_PAD_SD1_DATA0__SD1_DATA0		0x59
-			MX7D_PAD_SD1_DATA1__SD1_DATA1		0x59
-			MX7D_PAD_SD1_DATA2__SD1_DATA2		0x59
-			MX7D_PAD_SD1_DATA3__SD1_DATA3		0x59
-		>;
-	};
-
-	pinctrl_usdhc3: usdhc3grp {
-		fsl,pins = <
-			MX7D_PAD_SD3_CMD__SD3_CMD		0x59
-			MX7D_PAD_SD3_CLK__SD3_CLK		0x19
-			MX7D_PAD_SD3_DATA0__SD3_DATA0		0x59
-			MX7D_PAD_SD3_DATA1__SD3_DATA1		0x59
-			MX7D_PAD_SD3_DATA2__SD3_DATA2		0x59
-			MX7D_PAD_SD3_DATA3__SD3_DATA3		0x59
-			MX7D_PAD_SD3_DATA4__SD3_DATA4		0x59
-			MX7D_PAD_SD3_DATA5__SD3_DATA5		0x59
-			MX7D_PAD_SD3_DATA6__SD3_DATA6		0x59
-			MX7D_PAD_SD3_DATA7__SD3_DATA7		0x59
-			MX7D_PAD_SD3_RESET_B__SD3_RESET_B	0x59
-		>;
-	};
-};
-
-&iomuxc_lpsr {
-	pinctrl_enet1_phy_interrupt: enet1phyinterruptgrp {
-		fsl,phy = <
-			MX7D_PAD_LPSR_GPIO1_IO02__GPIO1_IO2	0x08
-		>;
-	};
-};
-- 
2.21.0


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

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 22/23] ARM: zii-imx7d-rmu2: Add SPI NOR partition info
  2020-03-31 18:46 [PATCH 00/23] A number of ZII related fixes Andrey Smirnov
                   ` (20 preceding siblings ...)
  2020-03-31 18:47 ` [PATCH 21/23] ARM: zii-imx7d-dev: Drop redundant RMU2 .dtsi Andrey Smirnov
@ 2020-03-31 18:47 ` Andrey Smirnov
  2020-03-31 18:47 ` [PATCH 23/23] ARM: zii-imx7d-rmu2: Add boot source info Andrey Smirnov
  2020-04-01  6:10 ` [PATCH 00/23] A number of ZII related fixes Sascha Hauer
  23 siblings, 0 replies; 34+ messages in thread
From: Andrey Smirnov @ 2020-03-31 18:47 UTC (permalink / raw)
  To: Barebox List; +Cc: Andrey Smirnov

Add SPI NOR partition info necessary for SPI BBU target to work.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 arch/arm/dts/imx7d-zii-rmu2.dts | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/arch/arm/dts/imx7d-zii-rmu2.dts b/arch/arm/dts/imx7d-zii-rmu2.dts
index de330c413..7bb0ab264 100644
--- a/arch/arm/dts/imx7d-zii-rmu2.dts
+++ b/arch/arm/dts/imx7d-zii-rmu2.dts
@@ -6,3 +6,20 @@
 
 #include <arm/imx7d-zii-rmu2.dts>
 #include "imx7d-ddrc.dtsi"
+
+&ecspi1 {
+	nor_flash: flash@0 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		partition@0 {
+			label = "barebox";
+			reg = <0x0 0xc0000>;
+		};
+
+		partition@c0000 {
+			label = "barebox-environment";
+			reg = <0xc0000 0x40000>;
+		};
+	};
+};
-- 
2.21.0


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

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 23/23] ARM: zii-imx7d-rmu2: Add boot source info
  2020-03-31 18:46 [PATCH 00/23] A number of ZII related fixes Andrey Smirnov
                   ` (21 preceding siblings ...)
  2020-03-31 18:47 ` [PATCH 22/23] ARM: zii-imx7d-rmu2: Add SPI NOR partition info Andrey Smirnov
@ 2020-03-31 18:47 ` Andrey Smirnov
  2020-04-01  6:10 ` [PATCH 00/23] A number of ZII related fixes Sascha Hauer
  23 siblings, 0 replies; 34+ messages in thread
From: Andrey Smirnov @ 2020-03-31 18:47 UTC (permalink / raw)
  To: Barebox List; +Cc: Andrey Smirnov

Add boot source info so that RAVE SP driver could query it.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 arch/arm/dts/imx7d-zii-rmu2.dts | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/arch/arm/dts/imx7d-zii-rmu2.dts b/arch/arm/dts/imx7d-zii-rmu2.dts
index 7bb0ab264..a4116308b 100644
--- a/arch/arm/dts/imx7d-zii-rmu2.dts
+++ b/arch/arm/dts/imx7d-zii-rmu2.dts
@@ -23,3 +23,21 @@
 		};
 	};
 };
+
+&uart4 {
+	rave-sp {
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		watchdog {
+			nvmem-cells = <&boot_source>;
+			nvmem-cell-names = "boot-source";
+		};
+
+		eeprom@a3 {
+			boot_source: boot-source@83 {
+				reg = <0x83 1>;
+			};
+		};
+	};
+};
-- 
2.21.0


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

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 01/23] ARM: zii-common: Gate rdu_i210_invm() call with CONFIG_PCI_IMX6
  2020-03-31 18:47 ` [PATCH 01/23] ARM: zii-common: Gate rdu_i210_invm() call with CONFIG_PCI_IMX6 Andrey Smirnov
@ 2020-04-01  5:20   ` Sascha Hauer
  2020-04-01 19:47     ` Andrey Smirnov
  0 siblings, 1 reply; 34+ messages in thread
From: Sascha Hauer @ 2020-04-01  5:20 UTC (permalink / raw)
  To: Andrey Smirnov; +Cc: Barebox List

On Tue, Mar 31, 2020 at 11:47:00AM -0700, Andrey Smirnov wrote:
> There's no reason to have rdu_i210_invm() inicalli if CONFIG_PCI_IMX6
> is not selected. Add appropriate ifdef to handle that.

Either this is the wrong way round...

> 
> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
> ---
>  arch/arm/boards/zii-common/board.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/arm/boards/zii-common/board.c b/arch/arm/boards/zii-common/board.c
> index 7bd3a6cab..08e2f8b9b 100644
> --- a/arch/arm/boards/zii-common/board.c
> +++ b/arch/arm/boards/zii-common/board.c
> @@ -104,6 +104,8 @@ static int rdu_networkconfig(void)
>  }
>  late_initcall(rdu_networkconfig);
>  
> +#ifdef CONFIG_PCI_IMX6

...or this should be #ifndef

Sascha

> +
>  #define I210_CFGWORD_PCIID_157B		0x157b1a11
>  static int rdu_i210_invm(void)
>  {
> @@ -136,3 +138,5 @@ static int rdu_i210_invm(void)
>  	return 0;
>  }
>  late_initcall(rdu_i210_invm);
> +
> +#endif
> -- 
> 2.21.0
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
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] 34+ messages in thread

* Re: [PATCH 04/23] ARM: zii-common: Check for I2C errors in do_rdu2_switch_reset()
  2020-03-31 18:47 ` [PATCH 04/23] ARM: zii-common: Check for I2C errors in do_rdu2_switch_reset() Andrey Smirnov
@ 2020-04-01  5:23   ` Sascha Hauer
  0 siblings, 0 replies; 34+ messages in thread
From: Sascha Hauer @ 2020-04-01  5:23 UTC (permalink / raw)
  To: Andrey Smirnov; +Cc: Barebox List

On Tue, Mar 31, 2020 at 11:47:03AM -0700, Andrey Smirnov wrote:
> ---
>  arch/arm/boards/zii-common/switch-cmd.c | 20 +++++++++++++++++---
>  1 file changed, 17 insertions(+), 3 deletions(-)

Missing Signed-off-by:

Sascha

> 
> diff --git a/arch/arm/boards/zii-common/switch-cmd.c b/arch/arm/boards/zii-common/switch-cmd.c
> index 2b9c34bfa..5e39d8fc6 100644
> --- a/arch/arm/boards/zii-common/switch-cmd.c
> +++ b/arch/arm/boards/zii-common/switch-cmd.c
> @@ -19,6 +19,7 @@
>  static int do_rdu2_switch_reset(void)
>  {
>  	struct i2c_client client;
> +	int ret;
>  	u8 reg;
>  
>  	client.adapter = i2c_get_adapter(1);
> @@ -29,12 +30,25 @@ static int do_rdu2_switch_reset(void)
>  	client.addr = 0x38;
>  	reg = 0x78;
>  	/* set switch reset time to 100ms */
> -	i2c_write_reg(&client, 0x0a, &reg, 1);
> +
> +	ret = i2c_write_reg(&client, 0x0a, &reg, 1);
> +	if (ret < 0) {
> +		pr_err("Failed to set switch reset time\n");
> +		return ret;
> +	}
>  	/* reset the switch */
>  	reg = 0x01;
> -	i2c_write_reg(&client, 0x0d, &reg, 1);
> +	ret = i2c_write_reg(&client, 0x0d, &reg, 1);
> +	if (ret < 0) {
> +		pr_err("Failed to reset the switch\n");
> +		return ret;
> +	}
>  	/* issue dummy command to work around firmware bug */
> -	i2c_read_reg(&client, 0x01, &reg, 1);
> +	ret = i2c_read_reg(&client, 0x01, &reg, 1);
> +	if (ret < 0) {
> +		pr_err("Failed to issue a dummy command\n");
> +		return ret;
> +	}
>  
>  	return 0;
>  }
> -- 
> 2.21.0
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
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] 34+ messages in thread

* Re: [PATCH 05/23] i2c: Port of_find_i2c_device_by_node() from Linux
  2020-03-31 18:47 ` [PATCH 05/23] i2c: Port of_find_i2c_device_by_node() from Linux Andrey Smirnov
@ 2020-04-01  5:29   ` Sascha Hauer
  2020-04-01  5:46     ` Sascha Hauer
  0 siblings, 1 reply; 34+ messages in thread
From: Sascha Hauer @ 2020-04-01  5:29 UTC (permalink / raw)
  To: Andrey Smirnov; +Cc: Barebox List

On Tue, Mar 31, 2020 at 11:47:04AM -0700, Andrey Smirnov wrote:
> Port of_find_i2c_device_by_node() from Linux in order to allow looking
> i2c_client up by corresponding DT node. Useful for interacting with
> identical raw/driverless I2C devices that are not found on the same
> bus between board variants.
> 
> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
> ---
>  include/i2c/i2c.h | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/include/i2c/i2c.h b/include/i2c/i2c.h
> index a694e4ab2..7eaa97dde 100644
> --- a/include/i2c/i2c.h
> +++ b/include/i2c/i2c.h
> @@ -281,6 +281,14 @@ static inline int i2c_register_board_info(int busnum,
>  extern int i2c_add_numbered_adapter(struct i2c_adapter *adapter);
>  struct i2c_adapter *i2c_get_adapter(int busnum);
>  struct i2c_adapter *of_find_i2c_adapter_by_node(struct device_node *node);
> +static inline struct i2c_client *
> +of_find_i2c_device_by_node(struct device_node *node)
> +{
> +	struct device_d *dev = of_find_device_by_node(node);
> +
> +	return dev ? to_i2c_client(dev) : NULL;
> +}

Can we have a sanity check if this is actually a I2C device? At least
a test for dev->bus == &i2c_bus would be nice.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
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] 34+ messages in thread

* Re: [PATCH 05/23] i2c: Port of_find_i2c_device_by_node() from Linux
  2020-04-01  5:29   ` Sascha Hauer
@ 2020-04-01  5:46     ` Sascha Hauer
  0 siblings, 0 replies; 34+ messages in thread
From: Sascha Hauer @ 2020-04-01  5:46 UTC (permalink / raw)
  To: Andrey Smirnov; +Cc: Barebox List

On Wed, Apr 01, 2020 at 07:29:47AM +0200, Sascha Hauer wrote:
> On Tue, Mar 31, 2020 at 11:47:04AM -0700, Andrey Smirnov wrote:
> > Port of_find_i2c_device_by_node() from Linux in order to allow looking
> > i2c_client up by corresponding DT node. Useful for interacting with
> > identical raw/driverless I2C devices that are not found on the same
> > bus between board variants.
> > 
> > Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
> > ---
> >  include/i2c/i2c.h | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> > 
> > diff --git a/include/i2c/i2c.h b/include/i2c/i2c.h
> > index a694e4ab2..7eaa97dde 100644
> > --- a/include/i2c/i2c.h
> > +++ b/include/i2c/i2c.h
> > @@ -281,6 +281,14 @@ static inline int i2c_register_board_info(int busnum,
> >  extern int i2c_add_numbered_adapter(struct i2c_adapter *adapter);
> >  struct i2c_adapter *i2c_get_adapter(int busnum);
> >  struct i2c_adapter *of_find_i2c_adapter_by_node(struct device_node *node);
> > +static inline struct i2c_client *
> > +of_find_i2c_device_by_node(struct device_node *node)
> > +{
> > +	struct device_d *dev = of_find_device_by_node(node);
> > +
> > +	return dev ? to_i2c_client(dev) : NULL;
> > +}
> 
> Can we have a sanity check if this is actually a I2C device? At least
> a test for dev->bus == &i2c_bus would be nice.

This should do it:

--------------------------------8<--------------------------------

From 1437676f8cdf8fafd3269e364fc06f996acc0aad Mon Sep 17 00:00:00 2001
From: Andrey Smirnov <andrew.smirnov@gmail.com>
Date: Tue, 31 Mar 2020 11:47:04 -0700
Subject: [PATCH] i2c: Port of_find_i2c_device_by_node() from Linux

Port of_find_i2c_device_by_node() from Linux in order to allow looking
i2c_client up by corresponding DT node. Useful for interacting with
identical raw/driverless I2C devices that are not found on the same
bus between board variants.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/i2c/i2c.c | 13 +++++++++++++
 include/i2c/i2c.h |  1 +
 2 files changed, 14 insertions(+)

diff --git a/drivers/i2c/i2c.c b/drivers/i2c/i2c.c
index 9df5ee70c7..2fed624d69 100644
--- a/drivers/i2c/i2c.c
+++ b/drivers/i2c/i2c.c
@@ -556,6 +556,19 @@ struct i2c_adapter *of_find_i2c_adapter_by_node(struct device_node *node)
 	return NULL;
 }
 
+struct i2c_client *of_find_i2c_device_by_node(struct device_node *node)
+{
+	struct device_d *dev = of_find_device_by_node(node);
+
+	if (!dev)
+		return NULL;
+
+	if (dev->bus != &i2c_bus)
+		return NULL;
+
+	return to_i2c_client(dev);
+}
+
 /**
  * i2c_parse_fw_timings - get I2C related timing parameters from firmware
  * @dev: The device to scan for I2C timing properties
diff --git a/include/i2c/i2c.h b/include/i2c/i2c.h
index a694e4ab2f..56a887a13a 100644
--- a/include/i2c/i2c.h
+++ b/include/i2c/i2c.h
@@ -281,6 +281,7 @@ static inline int i2c_register_board_info(int busnum,
 extern int i2c_add_numbered_adapter(struct i2c_adapter *adapter);
 struct i2c_adapter *i2c_get_adapter(int busnum);
 struct i2c_adapter *of_find_i2c_adapter_by_node(struct device_node *node);
+struct i2c_client *of_find_i2c_device_by_node(struct device_node *node);
 
 void i2c_parse_fw_timings(struct device_d *dev, struct i2c_timings *t, bool use_defaults);
 
-- 
2.26.0.rc2

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
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] 34+ messages in thread

* Re: [PATCH 00/23] A number of ZII related fixes
  2020-03-31 18:46 [PATCH 00/23] A number of ZII related fixes Andrey Smirnov
                   ` (22 preceding siblings ...)
  2020-03-31 18:47 ` [PATCH 23/23] ARM: zii-imx7d-rmu2: Add boot source info Andrey Smirnov
@ 2020-04-01  6:10 ` Sascha Hauer
  23 siblings, 0 replies; 34+ messages in thread
From: Sascha Hauer @ 2020-04-01  6:10 UTC (permalink / raw)
  To: Andrey Smirnov; +Cc: Barebox List

On Tue, Mar 31, 2020 at 11:46:59AM -0700, Andrey Smirnov wrote:
> Everyone:
> 
> Here's a patchset containing a number of ZII board related fixes I've
> had in my tree for a while. Hopefully none of them are controversial.
> 
> Thanks,
> Andrey Smirnov
> 
> Andrey Smirnov (23):
>   ARM: zii-common: Gate rdu_i210_invm() call with CONFIG_PCI_IMX6
>   ARM: imx7d-zii-rpu2: Drop redundant chosen node
>   ARM: zii-imx7d-dev: Fix compatible name
>   ARM: zii-common: Check for I2C errors in do_rdu2_switch_reset()
>   i2c: Port of_find_i2c_device_by_node() from Linux
>   ARM: zii-common: Find switch watchdog via DT
>   ARM: zii-common: Support rave_switch_reset on ZII Ultra
>   ARM: zii-imx6q-rdu2: Differentiate between RDU2 and RDU2+
>   ARM: zii-imx7d-dev: Differentiate between RPU2 and RMU2
>   ARM: zii-imx8mq-dev: Differentiate between Zest and RMB3
>   ARM: zii-common: Add common environment directory
>   ARM: zii-imx6q-rdu2: Register SD card slot with BBU
>   ARM: zii-vf610-dev: Register SD card slot with BBU
>   ARM: zii-imx8mq-dev: Register SD card slot with BBU
>   ARM: zii-vf610-dev: Add newline to end of board.c
>   ARM: rdu2: Drop redundant USB GPIO hog nodes
>   ARM: imx8mq: Drop trailing whitespace
>   ARM: imx8mq: Drop redundant DT nodes
>   ARM: zii-imx8mq-dev: Add boot source info
>   ARM: zii-imx8mq-dev: Drop redundant "stdout-path"
>   ARM: zii-imx7d-dev: Drop redundant RMU2 .dtsi
>   ARM: zii-imx7d-rmu2: Add SPI NOR partition info
>   ARM: zii-imx7d-rmu2: Add boot source info

I applied all except the first patch with my comments addressed.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
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] 34+ messages in thread

* Re: [PATCH 01/23] ARM: zii-common: Gate rdu_i210_invm() call with CONFIG_PCI_IMX6
  2020-04-01  5:20   ` Sascha Hauer
@ 2020-04-01 19:47     ` Andrey Smirnov
  2020-04-02  6:46       ` Sascha Hauer
  0 siblings, 1 reply; 34+ messages in thread
From: Andrey Smirnov @ 2020-04-01 19:47 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: Barebox List

On Tue, Mar 31, 2020 at 10:20 PM Sascha Hauer <s.hauer@pengutronix.de> wrote:
>
> On Tue, Mar 31, 2020 at 11:47:00AM -0700, Andrey Smirnov wrote:
> > There's no reason to have rdu_i210_invm() inicalli if CONFIG_PCI_IMX6
> > is not selected. Add appropriate ifdef to handle that.
>
> Either this is the wrong way round...
>

Hmm, not sure I understand what you mean. I210 card and its INVM won't
appear if PCIe is not enabled, that's why there's no reason to have
rdu_i210_invm() initcall if CONFIG_PCI_IMX6 is _not_ selected. Did I
miss something?

> >
> > Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
> > ---
> >  arch/arm/boards/zii-common/board.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/arch/arm/boards/zii-common/board.c b/arch/arm/boards/zii-common/board.c
> > index 7bd3a6cab..08e2f8b9b 100644
> > --- a/arch/arm/boards/zii-common/board.c
> > +++ b/arch/arm/boards/zii-common/board.c
> > @@ -104,6 +104,8 @@ static int rdu_networkconfig(void)
> >  }
> >  late_initcall(rdu_networkconfig);
> >
> > +#ifdef CONFIG_PCI_IMX6
>
> ...or this should be #ifndef
>
> Sascha
>
> > +
> >  #define I210_CFGWORD_PCIID_157B              0x157b1a11
> >  static int rdu_i210_invm(void)
> >  {
> > @@ -136,3 +138,5 @@ static int rdu_i210_invm(void)
> >       return 0;
> >  }
> >  late_initcall(rdu_i210_invm);
> > +
> > +#endif
> > --
> > 2.21.0
> >
> >
> > _______________________________________________
> > barebox mailing list
> > barebox@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/barebox
> >
>
> --
> Pengutronix e.K.                           |                             |
> Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
> 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] 34+ messages in thread

* Re: [PATCH 01/23] ARM: zii-common: Gate rdu_i210_invm() call with CONFIG_PCI_IMX6
  2020-04-01 19:47     ` Andrey Smirnov
@ 2020-04-02  6:46       ` Sascha Hauer
  0 siblings, 0 replies; 34+ messages in thread
From: Sascha Hauer @ 2020-04-02  6:46 UTC (permalink / raw)
  To: Andrey Smirnov; +Cc: Barebox List

On Wed, Apr 01, 2020 at 12:47:18PM -0700, Andrey Smirnov wrote:
> On Tue, Mar 31, 2020 at 10:20 PM Sascha Hauer <s.hauer@pengutronix.de> wrote:
> >
> > On Tue, Mar 31, 2020 at 11:47:00AM -0700, Andrey Smirnov wrote:
> > > There's no reason to have rdu_i210_invm() inicalli if CONFIG_PCI_IMX6
> > > is not selected. Add appropriate ifdef to handle that.
> >
> > Either this is the wrong way round...
> >
> 
> Hmm, not sure I understand what you mean. I210 card and its INVM won't
> appear if PCIe is not enabled, that's why there's no reason to have
> rdu_i210_invm() initcall if CONFIG_PCI_IMX6 is _not_ selected. Did I
> miss something?

Erm, no. It was me who missed something, I had a knot in my brain :-|

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
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] 34+ messages in thread

* Re: [PATCH 11/23] ARM: zii-common: Add common environment directory
  2020-03-31 18:47 ` [PATCH 11/23] ARM: zii-common: Add common environment directory Andrey Smirnov
@ 2020-04-02  6:49   ` Sascha Hauer
  2020-04-02 22:27     ` Andrey Smirnov
  0 siblings, 1 reply; 34+ messages in thread
From: Sascha Hauer @ 2020-04-02  6:49 UTC (permalink / raw)
  To: Andrey Smirnov; +Cc: Barebox List

On Tue, Mar 31, 2020 at 11:47:10AM -0700, Andrey Smirnov wrote:
> Establish a common environment directory between all ZII boards, so
> that we could share common bits and pieces. As a first step, get rid
> of board scecific net boot scripts and replace them with a single
> shared one.
> 
> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
> ---
>  arch/arm/boards/zii-common/Makefile           |  1 +
>  .../defaultenv-zii-common}/boot/net           |  9 +++++--
>  arch/arm/boards/zii-imx51-rdu1/board.c        |  1 +
>  arch/arm/boards/zii-imx6q-rdu2/board.c        |  1 +
>  .../zii-imx6q-rdu2/defaultenv-rdu2/boot/net   | 24 -------------------
>  arch/arm/boards/zii-imx7d-dev/board.c         |  2 ++
>  arch/arm/boards/zii-imx8mq-dev/board.c        |  1 +
>  .../defaultenv-imx8mq-zii-dev/boot/net        | 24 -------------------
>  arch/arm/boards/zii-vf610-dev/board.c         |  1 +
>  9 files changed, 14 insertions(+), 50 deletions(-)
>  rename arch/arm/boards/{zii-imx51-rdu1/defaultenv-rdu1 => zii-common/defaultenv-zii-common}/boot/net (73%)
>  delete mode 100644 arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/boot/net
>  delete mode 100644 arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/boot/net
> 
> diff --git a/arch/arm/boards/zii-common/Makefile b/arch/arm/boards/zii-common/Makefile
> index fcc5cdf97..90bdf21e7 100644
> --- a/arch/arm/boards/zii-common/Makefile
> +++ b/arch/arm/boards/zii-common/Makefile
> @@ -1 +1,2 @@
>  obj-y += board.o switch-cmd.o pn-fixup.o
> +bbenv-y += defaultenv-zii-common
> diff --git a/arch/arm/boards/zii-imx51-rdu1/defaultenv-rdu1/boot/net b/arch/arm/boards/zii-common/defaultenv-zii-common/boot/net
> similarity index 73%
> rename from arch/arm/boards/zii-imx51-rdu1/defaultenv-rdu1/boot/net
> rename to arch/arm/boards/zii-common/defaultenv-zii-common/boot/net
> index 4be8e1e2d..8b07cbbc9 100644
> --- a/arch/arm/boards/zii-imx51-rdu1/defaultenv-rdu1/boot/net
> +++ b/arch/arm/boards/zii-common/defaultenv-zii-common/boot/net
> @@ -2,8 +2,13 @@
>  
>  path="/mnt/tftp"
>  
> -# clear seat network config
> -global.linux.bootargs.rdu_network=
> +#
> +# Clear seat network config. Some boards don't have that config, so
> +# check that it is set first
> +#
> +if [ -n ${global.linux.bootargs.rdu_network} ]; then
> +    global.linux.bootargs.rdu_network=
> +fi
>  
>  global.bootm.image="${path}/${global.user}-linux-${global.hostname}"
>  
> diff --git a/arch/arm/boards/zii-imx51-rdu1/board.c b/arch/arm/boards/zii-imx51-rdu1/board.c
> index 640bb0d1b..8fdcb7626 100644
> --- a/arch/arm/boards/zii-imx51-rdu1/board.c
> +++ b/arch/arm/boards/zii-imx51-rdu1/board.c
> @@ -50,6 +50,7 @@ static int zii_rdu1_init(void)
>  		BBU_HANDLER_FLAG_DEFAULT |
>  		IMX_BBU_FLAG_PARTITION_STARTS_AT_HEADER);
>  
> +	defaultenv_append_directory(defaultenv_zii_common);
>  	defaultenv_append_directory(defaultenv_rdu1);
>  
>  	return 0;
> diff --git a/arch/arm/boards/zii-imx6q-rdu2/board.c b/arch/arm/boards/zii-imx6q-rdu2/board.c
> index 0bb4700b6..6d6bc1caa 100644
> --- a/arch/arm/boards/zii-imx6q-rdu2/board.c
> +++ b/arch/arm/boards/zii-imx6q-rdu2/board.c
> @@ -155,6 +155,7 @@ static int rdu2_devices_init(void)
>  
>  	imx6_bbu_internal_mmcboot_register_handler("eMMC", "/dev/mmc3", 0);
>  
> +	defaultenv_append_directory(defaultenv_zii_common);
>  	defaultenv_append_directory(defaultenv_rdu2);
>  
>  	return 0;
> diff --git a/arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/boot/net b/arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/boot/net
> deleted file mode 100644
> index 4090c2f4a..000000000
> --- a/arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/boot/net
> +++ /dev/null
> @@ -1,24 +0,0 @@
> -#!/bin/sh
> -
> -path="/mnt/tftp"
> -
> -# clear seat network config
> -global.linux.bootargs.rdu_network=
> -
> -global.bootm.image="${path}/${global.user}-linux-${global.hostname}"
> -
> -oftree="${path}/${global.user}-oftree-${global.hostname}"
> -if [ -f "${oftree}" ]; then
> -	global.bootm.oftree="$oftree"
> -fi
> -
> -nfsroot="/home/${global.user}/nfsroot/${global.hostname}"
> -
> -ip_route_get -b ${global.net.server} global.linux.bootargs.dyn.ip
> -
> -initramfs="${path}/${global.user}-initramfs-${global.hostname}"
> -if [ -f "${initramfs}" ]; then
> -	global.bootm.initrd="$initramfs"
> -else
> -	global.linux.bootargs.dyn.root="root=/dev/nfs nfsroot=$nfsroot,v3,tcp"
> -fi
> \ No newline at end of file
> diff --git a/arch/arm/boards/zii-imx7d-dev/board.c b/arch/arm/boards/zii-imx7d-dev/board.c
> index b53a6af49..6b409e23b 100644
> --- a/arch/arm/boards/zii-imx7d-dev/board.c
> +++ b/arch/arm/boards/zii-imx7d-dev/board.c
> @@ -55,6 +55,8 @@ static int zii_imx7d_dev_init(void)
>  	else if (of_machine_is_compatible("zii,imx7d-rmu2"))
>  		barebox_set_hostname("rmu2");
>  
> +	defaultenv_append_directory(defaultenv_zii_common);
> +
>  	return 0;
>  }
>  late_initcall(zii_imx7d_dev_init);
> diff --git a/arch/arm/boards/zii-imx8mq-dev/board.c b/arch/arm/boards/zii-imx8mq-dev/board.c
> index ddd15299c..285e889fe 100644
> --- a/arch/arm/boards/zii-imx8mq-dev/board.c
> +++ b/arch/arm/boards/zii-imx8mq-dev/board.c
> @@ -39,6 +39,7 @@ static int zii_imx8mq_dev_init(void)
>  	else
>  		of_device_enable_path("/chosen/environment-sd");
>  
> +	defaultenv_append_directory(defaultenv_zii_common);
>  	defaultenv_append_directory(defaultenv_imx8mq_zii_dev);
>  
>  	return 0;
> diff --git a/arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/boot/net b/arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/boot/net
> deleted file mode 100644
> index 4090c2f4a..000000000
> --- a/arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/boot/net
> +++ /dev/null
> @@ -1,24 +0,0 @@
> -#!/bin/sh
> -
> -path="/mnt/tftp"
> -
> -# clear seat network config
> -global.linux.bootargs.rdu_network=
> -
> -global.bootm.image="${path}/${global.user}-linux-${global.hostname}"
> -
> -oftree="${path}/${global.user}-oftree-${global.hostname}"
> -if [ -f "${oftree}" ]; then
> -	global.bootm.oftree="$oftree"
> -fi
> -
> -nfsroot="/home/${global.user}/nfsroot/${global.hostname}"
> -
> -ip_route_get -b ${global.net.server} global.linux.bootargs.dyn.ip
> -
> -initramfs="${path}/${global.user}-initramfs-${global.hostname}"
> -if [ -f "${initramfs}" ]; then
> -	global.bootm.initrd="$initramfs"
> -else
> -	global.linux.bootargs.dyn.root="root=/dev/nfs nfsroot=$nfsroot,v3,tcp"
> -fi
> \ No newline at end of file
> diff --git a/arch/arm/boards/zii-vf610-dev/board.c b/arch/arm/boards/zii-vf610-dev/board.c
> index 1d10f12f6..6b80ec428 100644
> --- a/arch/arm/boards/zii-vf610-dev/board.c
> +++ b/arch/arm/boards/zii-vf610-dev/board.c
> @@ -141,6 +141,7 @@ static int zii_vf610_dev_set_hostname(void)
>  		}
>  	}
>  
> +	defaultenv_append_directory(defaultenv_zii_common);

The zii-vf610 doesn't set CONFIG_MACH_ZII_COMMON, so the common env is not
compiled in which results in a linker error. What's the correct way to
fix that? Specify CONFIG_MACH_ZII_COMMON for the vf610 board?

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
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] 34+ messages in thread

* Re: [PATCH 11/23] ARM: zii-common: Add common environment directory
  2020-04-02  6:49   ` Sascha Hauer
@ 2020-04-02 22:27     ` Andrey Smirnov
  2020-04-03  7:58       ` Sascha Hauer
  0 siblings, 1 reply; 34+ messages in thread
From: Andrey Smirnov @ 2020-04-02 22:27 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: Barebox List

On Wed, Apr 1, 2020 at 11:49 PM Sascha Hauer <s.hauer@pengutronix.de> wrote:
>
> On Tue, Mar 31, 2020 at 11:47:10AM -0700, Andrey Smirnov wrote:
> > Establish a common environment directory between all ZII boards, so
> > that we could share common bits and pieces. As a first step, get rid
> > of board scecific net boot scripts and replace them with a single
> > shared one.
> >
> > Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
> > ---
> >  arch/arm/boards/zii-common/Makefile           |  1 +
> >  .../defaultenv-zii-common}/boot/net           |  9 +++++--
> >  arch/arm/boards/zii-imx51-rdu1/board.c        |  1 +
> >  arch/arm/boards/zii-imx6q-rdu2/board.c        |  1 +
> >  .../zii-imx6q-rdu2/defaultenv-rdu2/boot/net   | 24 -------------------
> >  arch/arm/boards/zii-imx7d-dev/board.c         |  2 ++
> >  arch/arm/boards/zii-imx8mq-dev/board.c        |  1 +
> >  .../defaultenv-imx8mq-zii-dev/boot/net        | 24 -------------------
> >  arch/arm/boards/zii-vf610-dev/board.c         |  1 +
> >  9 files changed, 14 insertions(+), 50 deletions(-)
> >  rename arch/arm/boards/{zii-imx51-rdu1/defaultenv-rdu1 => zii-common/defaultenv-zii-common}/boot/net (73%)
> >  delete mode 100644 arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/boot/net
> >  delete mode 100644 arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/boot/net
> >
> > diff --git a/arch/arm/boards/zii-common/Makefile b/arch/arm/boards/zii-common/Makefile
> > index fcc5cdf97..90bdf21e7 100644
> > --- a/arch/arm/boards/zii-common/Makefile
> > +++ b/arch/arm/boards/zii-common/Makefile
> > @@ -1 +1,2 @@
> >  obj-y += board.o switch-cmd.o pn-fixup.o
> > +bbenv-y += defaultenv-zii-common
> > diff --git a/arch/arm/boards/zii-imx51-rdu1/defaultenv-rdu1/boot/net b/arch/arm/boards/zii-common/defaultenv-zii-common/boot/net
> > similarity index 73%
> > rename from arch/arm/boards/zii-imx51-rdu1/defaultenv-rdu1/boot/net
> > rename to arch/arm/boards/zii-common/defaultenv-zii-common/boot/net
> > index 4be8e1e2d..8b07cbbc9 100644
> > --- a/arch/arm/boards/zii-imx51-rdu1/defaultenv-rdu1/boot/net
> > +++ b/arch/arm/boards/zii-common/defaultenv-zii-common/boot/net
> > @@ -2,8 +2,13 @@
> >
> >  path="/mnt/tftp"
> >
> > -# clear seat network config
> > -global.linux.bootargs.rdu_network=
> > +#
> > +# Clear seat network config. Some boards don't have that config, so
> > +# check that it is set first
> > +#
> > +if [ -n ${global.linux.bootargs.rdu_network} ]; then
> > +    global.linux.bootargs.rdu_network=
> > +fi
> >
> >  global.bootm.image="${path}/${global.user}-linux-${global.hostname}"
> >
> > diff --git a/arch/arm/boards/zii-imx51-rdu1/board.c b/arch/arm/boards/zii-imx51-rdu1/board.c
> > index 640bb0d1b..8fdcb7626 100644
> > --- a/arch/arm/boards/zii-imx51-rdu1/board.c
> > +++ b/arch/arm/boards/zii-imx51-rdu1/board.c
> > @@ -50,6 +50,7 @@ static int zii_rdu1_init(void)
> >               BBU_HANDLER_FLAG_DEFAULT |
> >               IMX_BBU_FLAG_PARTITION_STARTS_AT_HEADER);
> >
> > +     defaultenv_append_directory(defaultenv_zii_common);
> >       defaultenv_append_directory(defaultenv_rdu1);
> >
> >       return 0;
> > diff --git a/arch/arm/boards/zii-imx6q-rdu2/board.c b/arch/arm/boards/zii-imx6q-rdu2/board.c
> > index 0bb4700b6..6d6bc1caa 100644
> > --- a/arch/arm/boards/zii-imx6q-rdu2/board.c
> > +++ b/arch/arm/boards/zii-imx6q-rdu2/board.c
> > @@ -155,6 +155,7 @@ static int rdu2_devices_init(void)
> >
> >       imx6_bbu_internal_mmcboot_register_handler("eMMC", "/dev/mmc3", 0);
> >
> > +     defaultenv_append_directory(defaultenv_zii_common);
> >       defaultenv_append_directory(defaultenv_rdu2);
> >
> >       return 0;
> > diff --git a/arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/boot/net b/arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/boot/net
> > deleted file mode 100644
> > index 4090c2f4a..000000000
> > --- a/arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/boot/net
> > +++ /dev/null
> > @@ -1,24 +0,0 @@
> > -#!/bin/sh
> > -
> > -path="/mnt/tftp"
> > -
> > -# clear seat network config
> > -global.linux.bootargs.rdu_network=
> > -
> > -global.bootm.image="${path}/${global.user}-linux-${global.hostname}"
> > -
> > -oftree="${path}/${global.user}-oftree-${global.hostname}"
> > -if [ -f "${oftree}" ]; then
> > -     global.bootm.oftree="$oftree"
> > -fi
> > -
> > -nfsroot="/home/${global.user}/nfsroot/${global.hostname}"
> > -
> > -ip_route_get -b ${global.net.server} global.linux.bootargs.dyn.ip
> > -
> > -initramfs="${path}/${global.user}-initramfs-${global.hostname}"
> > -if [ -f "${initramfs}" ]; then
> > -     global.bootm.initrd="$initramfs"
> > -else
> > -     global.linux.bootargs.dyn.root="root=/dev/nfs nfsroot=$nfsroot,v3,tcp"
> > -fi
> > \ No newline at end of file
> > diff --git a/arch/arm/boards/zii-imx7d-dev/board.c b/arch/arm/boards/zii-imx7d-dev/board.c
> > index b53a6af49..6b409e23b 100644
> > --- a/arch/arm/boards/zii-imx7d-dev/board.c
> > +++ b/arch/arm/boards/zii-imx7d-dev/board.c
> > @@ -55,6 +55,8 @@ static int zii_imx7d_dev_init(void)
> >       else if (of_machine_is_compatible("zii,imx7d-rmu2"))
> >               barebox_set_hostname("rmu2");
> >
> > +     defaultenv_append_directory(defaultenv_zii_common);
> > +
> >       return 0;
> >  }
> >  late_initcall(zii_imx7d_dev_init);
> > diff --git a/arch/arm/boards/zii-imx8mq-dev/board.c b/arch/arm/boards/zii-imx8mq-dev/board.c
> > index ddd15299c..285e889fe 100644
> > --- a/arch/arm/boards/zii-imx8mq-dev/board.c
> > +++ b/arch/arm/boards/zii-imx8mq-dev/board.c
> > @@ -39,6 +39,7 @@ static int zii_imx8mq_dev_init(void)
> >       else
> >               of_device_enable_path("/chosen/environment-sd");
> >
> > +     defaultenv_append_directory(defaultenv_zii_common);
> >       defaultenv_append_directory(defaultenv_imx8mq_zii_dev);
> >
> >       return 0;
> > diff --git a/arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/boot/net b/arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/boot/net
> > deleted file mode 100644
> > index 4090c2f4a..000000000
> > --- a/arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/boot/net
> > +++ /dev/null
> > @@ -1,24 +0,0 @@
> > -#!/bin/sh
> > -
> > -path="/mnt/tftp"
> > -
> > -# clear seat network config
> > -global.linux.bootargs.rdu_network=
> > -
> > -global.bootm.image="${path}/${global.user}-linux-${global.hostname}"
> > -
> > -oftree="${path}/${global.user}-oftree-${global.hostname}"
> > -if [ -f "${oftree}" ]; then
> > -     global.bootm.oftree="$oftree"
> > -fi
> > -
> > -nfsroot="/home/${global.user}/nfsroot/${global.hostname}"
> > -
> > -ip_route_get -b ${global.net.server} global.linux.bootargs.dyn.ip
> > -
> > -initramfs="${path}/${global.user}-initramfs-${global.hostname}"
> > -if [ -f "${initramfs}" ]; then
> > -     global.bootm.initrd="$initramfs"
> > -else
> > -     global.linux.bootargs.dyn.root="root=/dev/nfs nfsroot=$nfsroot,v3,tcp"
> > -fi
> > \ No newline at end of file
> > diff --git a/arch/arm/boards/zii-vf610-dev/board.c b/arch/arm/boards/zii-vf610-dev/board.c
> > index 1d10f12f6..6b80ec428 100644
> > --- a/arch/arm/boards/zii-vf610-dev/board.c
> > +++ b/arch/arm/boards/zii-vf610-dev/board.c
> > @@ -141,6 +141,7 @@ static int zii_vf610_dev_set_hostname(void)
> >               }
> >       }
> >
> > +     defaultenv_append_directory(defaultenv_zii_common);
>
> The zii-vf610 doesn't set CONFIG_MACH_ZII_COMMON, so the common env is not
> compiled in which results in a linker error. What's the correct way to
> fix that? Specify CONFIG_MACH_ZII_COMMON for the vf610 board?
>

Ugh, sorry about that. I always select all of those boards at the same
time, so I missed that. Yes, I think CONFIG_MACH_ZII_COMMON for VF610
would be the way to go. Let me know if you want me to re-spin this
patch with that fix included.

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

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 11/23] ARM: zii-common: Add common environment directory
  2020-04-02 22:27     ` Andrey Smirnov
@ 2020-04-03  7:58       ` Sascha Hauer
  0 siblings, 0 replies; 34+ messages in thread
From: Sascha Hauer @ 2020-04-03  7:58 UTC (permalink / raw)
  To: Andrey Smirnov; +Cc: Barebox List

On Thu, Apr 02, 2020 at 03:27:59PM -0700, Andrey Smirnov wrote:
> On Wed, Apr 1, 2020 at 11:49 PM Sascha Hauer <s.hauer@pengutronix.de> wrote:
> >
> > On Tue, Mar 31, 2020 at 11:47:10AM -0700, Andrey Smirnov wrote:
> > > Establish a common environment directory between all ZII boards, so
> > > that we could share common bits and pieces. As a first step, get rid
> > > of board scecific net boot scripts and replace them with a single
> > > shared one.
> > >
> > > Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
> > > ---
> > >  arch/arm/boards/zii-common/Makefile           |  1 +
> > >  .../defaultenv-zii-common}/boot/net           |  9 +++++--
> > >  arch/arm/boards/zii-imx51-rdu1/board.c        |  1 +
> > >  arch/arm/boards/zii-imx6q-rdu2/board.c        |  1 +
> > >  .../zii-imx6q-rdu2/defaultenv-rdu2/boot/net   | 24 -------------------
> > >  arch/arm/boards/zii-imx7d-dev/board.c         |  2 ++
> > >  arch/arm/boards/zii-imx8mq-dev/board.c        |  1 +
> > >  .../defaultenv-imx8mq-zii-dev/boot/net        | 24 -------------------
> > >  arch/arm/boards/zii-vf610-dev/board.c         |  1 +
> > >  9 files changed, 14 insertions(+), 50 deletions(-)
> > >  rename arch/arm/boards/{zii-imx51-rdu1/defaultenv-rdu1 => zii-common/defaultenv-zii-common}/boot/net (73%)
> > >  delete mode 100644 arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/boot/net
> > >  delete mode 100644 arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/boot/net
> > >
> > > diff --git a/arch/arm/boards/zii-common/Makefile b/arch/arm/boards/zii-common/Makefile
> > > index fcc5cdf97..90bdf21e7 100644
> > > --- a/arch/arm/boards/zii-common/Makefile
> > > +++ b/arch/arm/boards/zii-common/Makefile
> > > @@ -1 +1,2 @@
> > >  obj-y += board.o switch-cmd.o pn-fixup.o
> > > +bbenv-y += defaultenv-zii-common
> > > diff --git a/arch/arm/boards/zii-imx51-rdu1/defaultenv-rdu1/boot/net b/arch/arm/boards/zii-common/defaultenv-zii-common/boot/net
> > > similarity index 73%
> > > rename from arch/arm/boards/zii-imx51-rdu1/defaultenv-rdu1/boot/net
> > > rename to arch/arm/boards/zii-common/defaultenv-zii-common/boot/net
> > > index 4be8e1e2d..8b07cbbc9 100644
> > > --- a/arch/arm/boards/zii-imx51-rdu1/defaultenv-rdu1/boot/net
> > > +++ b/arch/arm/boards/zii-common/defaultenv-zii-common/boot/net
> > > @@ -2,8 +2,13 @@
> > >
> > >  path="/mnt/tftp"
> > >
> > > -# clear seat network config
> > > -global.linux.bootargs.rdu_network=
> > > +#
> > > +# Clear seat network config. Some boards don't have that config, so
> > > +# check that it is set first
> > > +#
> > > +if [ -n ${global.linux.bootargs.rdu_network} ]; then
> > > +    global.linux.bootargs.rdu_network=
> > > +fi
> > >
> > >  global.bootm.image="${path}/${global.user}-linux-${global.hostname}"
> > >
> > > diff --git a/arch/arm/boards/zii-imx51-rdu1/board.c b/arch/arm/boards/zii-imx51-rdu1/board.c
> > > index 640bb0d1b..8fdcb7626 100644
> > > --- a/arch/arm/boards/zii-imx51-rdu1/board.c
> > > +++ b/arch/arm/boards/zii-imx51-rdu1/board.c
> > > @@ -50,6 +50,7 @@ static int zii_rdu1_init(void)
> > >               BBU_HANDLER_FLAG_DEFAULT |
> > >               IMX_BBU_FLAG_PARTITION_STARTS_AT_HEADER);
> > >
> > > +     defaultenv_append_directory(defaultenv_zii_common);
> > >       defaultenv_append_directory(defaultenv_rdu1);
> > >
> > >       return 0;
> > > diff --git a/arch/arm/boards/zii-imx6q-rdu2/board.c b/arch/arm/boards/zii-imx6q-rdu2/board.c
> > > index 0bb4700b6..6d6bc1caa 100644
> > > --- a/arch/arm/boards/zii-imx6q-rdu2/board.c
> > > +++ b/arch/arm/boards/zii-imx6q-rdu2/board.c
> > > @@ -155,6 +155,7 @@ static int rdu2_devices_init(void)
> > >
> > >       imx6_bbu_internal_mmcboot_register_handler("eMMC", "/dev/mmc3", 0);
> > >
> > > +     defaultenv_append_directory(defaultenv_zii_common);
> > >       defaultenv_append_directory(defaultenv_rdu2);
> > >
> > >       return 0;
> > > diff --git a/arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/boot/net b/arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/boot/net
> > > deleted file mode 100644
> > > index 4090c2f4a..000000000
> > > --- a/arch/arm/boards/zii-imx6q-rdu2/defaultenv-rdu2/boot/net
> > > +++ /dev/null
> > > @@ -1,24 +0,0 @@
> > > -#!/bin/sh
> > > -
> > > -path="/mnt/tftp"
> > > -
> > > -# clear seat network config
> > > -global.linux.bootargs.rdu_network=
> > > -
> > > -global.bootm.image="${path}/${global.user}-linux-${global.hostname}"
> > > -
> > > -oftree="${path}/${global.user}-oftree-${global.hostname}"
> > > -if [ -f "${oftree}" ]; then
> > > -     global.bootm.oftree="$oftree"
> > > -fi
> > > -
> > > -nfsroot="/home/${global.user}/nfsroot/${global.hostname}"
> > > -
> > > -ip_route_get -b ${global.net.server} global.linux.bootargs.dyn.ip
> > > -
> > > -initramfs="${path}/${global.user}-initramfs-${global.hostname}"
> > > -if [ -f "${initramfs}" ]; then
> > > -     global.bootm.initrd="$initramfs"
> > > -else
> > > -     global.linux.bootargs.dyn.root="root=/dev/nfs nfsroot=$nfsroot,v3,tcp"
> > > -fi
> > > \ No newline at end of file
> > > diff --git a/arch/arm/boards/zii-imx7d-dev/board.c b/arch/arm/boards/zii-imx7d-dev/board.c
> > > index b53a6af49..6b409e23b 100644
> > > --- a/arch/arm/boards/zii-imx7d-dev/board.c
> > > +++ b/arch/arm/boards/zii-imx7d-dev/board.c
> > > @@ -55,6 +55,8 @@ static int zii_imx7d_dev_init(void)
> > >       else if (of_machine_is_compatible("zii,imx7d-rmu2"))
> > >               barebox_set_hostname("rmu2");
> > >
> > > +     defaultenv_append_directory(defaultenv_zii_common);
> > > +
> > >       return 0;
> > >  }
> > >  late_initcall(zii_imx7d_dev_init);
> > > diff --git a/arch/arm/boards/zii-imx8mq-dev/board.c b/arch/arm/boards/zii-imx8mq-dev/board.c
> > > index ddd15299c..285e889fe 100644
> > > --- a/arch/arm/boards/zii-imx8mq-dev/board.c
> > > +++ b/arch/arm/boards/zii-imx8mq-dev/board.c
> > > @@ -39,6 +39,7 @@ static int zii_imx8mq_dev_init(void)
> > >       else
> > >               of_device_enable_path("/chosen/environment-sd");
> > >
> > > +     defaultenv_append_directory(defaultenv_zii_common);
> > >       defaultenv_append_directory(defaultenv_imx8mq_zii_dev);
> > >
> > >       return 0;
> > > diff --git a/arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/boot/net b/arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/boot/net
> > > deleted file mode 100644
> > > index 4090c2f4a..000000000
> > > --- a/arch/arm/boards/zii-imx8mq-dev/defaultenv-imx8mq-zii-dev/boot/net
> > > +++ /dev/null
> > > @@ -1,24 +0,0 @@
> > > -#!/bin/sh
> > > -
> > > -path="/mnt/tftp"
> > > -
> > > -# clear seat network config
> > > -global.linux.bootargs.rdu_network=
> > > -
> > > -global.bootm.image="${path}/${global.user}-linux-${global.hostname}"
> > > -
> > > -oftree="${path}/${global.user}-oftree-${global.hostname}"
> > > -if [ -f "${oftree}" ]; then
> > > -     global.bootm.oftree="$oftree"
> > > -fi
> > > -
> > > -nfsroot="/home/${global.user}/nfsroot/${global.hostname}"
> > > -
> > > -ip_route_get -b ${global.net.server} global.linux.bootargs.dyn.ip
> > > -
> > > -initramfs="${path}/${global.user}-initramfs-${global.hostname}"
> > > -if [ -f "${initramfs}" ]; then
> > > -     global.bootm.initrd="$initramfs"
> > > -else
> > > -     global.linux.bootargs.dyn.root="root=/dev/nfs nfsroot=$nfsroot,v3,tcp"
> > > -fi
> > > \ No newline at end of file
> > > diff --git a/arch/arm/boards/zii-vf610-dev/board.c b/arch/arm/boards/zii-vf610-dev/board.c
> > > index 1d10f12f6..6b80ec428 100644
> > > --- a/arch/arm/boards/zii-vf610-dev/board.c
> > > +++ b/arch/arm/boards/zii-vf610-dev/board.c
> > > @@ -141,6 +141,7 @@ static int zii_vf610_dev_set_hostname(void)
> > >               }
> > >       }
> > >
> > > +     defaultenv_append_directory(defaultenv_zii_common);
> >
> > The zii-vf610 doesn't set CONFIG_MACH_ZII_COMMON, so the common env is not
> > compiled in which results in a linker error. What's the correct way to
> > fix that? Specify CONFIG_MACH_ZII_COMMON for the vf610 board?
> >
> 
> Ugh, sorry about that. I always select all of those boards at the same
> time, so I missed that. Yes, I think CONFIG_MACH_ZII_COMMON for VF610
> would be the way to go. Let me know if you want me to re-spin this
> patch with that fix included.

That shouldn't be necessary, thanks. I added a select to
CONFIG_MACH_ZII_COMMON, it compiles without errors now.

Sascha


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
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] 34+ messages in thread

end of thread, other threads:[~2020-04-03  7:58 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-31 18:46 [PATCH 00/23] A number of ZII related fixes Andrey Smirnov
2020-03-31 18:47 ` [PATCH 01/23] ARM: zii-common: Gate rdu_i210_invm() call with CONFIG_PCI_IMX6 Andrey Smirnov
2020-04-01  5:20   ` Sascha Hauer
2020-04-01 19:47     ` Andrey Smirnov
2020-04-02  6:46       ` Sascha Hauer
2020-03-31 18:47 ` [PATCH 02/23] ARM: imx7d-zii-rpu2: Drop redundant chosen node Andrey Smirnov
2020-03-31 18:47 ` [PATCH 03/23] ARM: zii-imx7d-dev: Fix compatible name Andrey Smirnov
2020-03-31 18:47 ` [PATCH 04/23] ARM: zii-common: Check for I2C errors in do_rdu2_switch_reset() Andrey Smirnov
2020-04-01  5:23   ` Sascha Hauer
2020-03-31 18:47 ` [PATCH 05/23] i2c: Port of_find_i2c_device_by_node() from Linux Andrey Smirnov
2020-04-01  5:29   ` Sascha Hauer
2020-04-01  5:46     ` Sascha Hauer
2020-03-31 18:47 ` [PATCH 06/23] ARM: zii-common: Find switch watchdog via DT Andrey Smirnov
2020-03-31 18:47 ` [PATCH 07/23] ARM: zii-common: Support rave_switch_reset on ZII Ultra Andrey Smirnov
2020-03-31 18:47 ` [PATCH 08/23] ARM: zii-imx6q-rdu2: Differentiate between RDU2 and RDU2+ Andrey Smirnov
2020-03-31 18:47 ` [PATCH 09/23] ARM: zii-imx7d-dev: Differentiate between RPU2 and RMU2 Andrey Smirnov
2020-03-31 18:47 ` [PATCH 10/23] ARM: zii-imx8mq-dev: Differentiate between Zest and RMB3 Andrey Smirnov
2020-03-31 18:47 ` [PATCH 11/23] ARM: zii-common: Add common environment directory Andrey Smirnov
2020-04-02  6:49   ` Sascha Hauer
2020-04-02 22:27     ` Andrey Smirnov
2020-04-03  7:58       ` Sascha Hauer
2020-03-31 18:47 ` [PATCH 12/23] ARM: zii-imx6q-rdu2: Register SD card slot with BBU Andrey Smirnov
2020-03-31 18:47 ` [PATCH 13/23] ARM: zii-vf610-dev: " Andrey Smirnov
2020-03-31 18:47 ` [PATCH 14/23] ARM: zii-imx8mq-dev: " Andrey Smirnov
2020-03-31 18:47 ` [PATCH 15/23] ARM: zii-vf610-dev: Add newline to end of board.c Andrey Smirnov
2020-03-31 18:47 ` [PATCH 16/23] ARM: rdu2: Drop redundant USB GPIO hog nodes Andrey Smirnov
2020-03-31 18:47 ` [PATCH 17/23] ARM: imx8mq: Drop trailing whitespace Andrey Smirnov
2020-03-31 18:47 ` [PATCH 18/23] ARM: imx8mq: Drop redundant DT nodes Andrey Smirnov
2020-03-31 18:47 ` [PATCH 19/23] ARM: zii-imx8mq-dev: Add boot source info Andrey Smirnov
2020-03-31 18:47 ` [PATCH 20/23] ARM: zii-imx8mq-dev: Drop redundant "stdout-path" Andrey Smirnov
2020-03-31 18:47 ` [PATCH 21/23] ARM: zii-imx7d-dev: Drop redundant RMU2 .dtsi Andrey Smirnov
2020-03-31 18:47 ` [PATCH 22/23] ARM: zii-imx7d-rmu2: Add SPI NOR partition info Andrey Smirnov
2020-03-31 18:47 ` [PATCH 23/23] ARM: zii-imx7d-rmu2: Add boot source info Andrey Smirnov
2020-04-01  6:10 ` [PATCH 00/23] A number of ZII related fixes Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox