mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 00/11] Switch ZII boards to use MMC boot partitions
@ 2018-09-18 22:22 Andrey Smirnov
  2018-09-18 22:22 ` [PATCH 01/11] ARM: i.MX: bbu: Add support for v1 header to MMC boot handler Andrey Smirnov
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: Andrey Smirnov @ 2018-09-18 22:22 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov

Everyone:

This patchset contains code to switch all supported ZII platforms to
use MMC boot partitions for BBU functionality as well as various
additional fixes that were developed in the process. Hopefully all of
the patches are self-explanatory.

Feedback is welcome!

Thanks,
Andrey Smirnov

Andrey Smirnov (11):
  ARM: i.MX: bbu: Add support for v1 header to MMC boot handler
  ARM: i.MX51: bbu: Add a handler for MMC boot partitions
  ARM: i.MX: bbu: Check retrun value of getenv()
  ARM: i.MX: bbu: Convert devicefile to device name
  ARM: i.MX: bbu: Detect MMC before reading current boot partition
  ARM: VFxxx: bbu: Add a handler for MMC boot partitions
  dts: VFxxx: Add aliases for ESDHC controllers
  ARM: zii-vf610-dev: Switch MMC BBU to use boot partitions
  ARM: rdu2: Switch MMC BBU to use boot partitions
  ARM: rdu1: Change BBU names to match RDU2
  ARM: rdu1: Switch MMC BBU to use boot partitions

 arch/arm/boards/zii-imx51-rdu1/board.c |  4 +-
 arch/arm/boards/zii-imx6q-rdu2/board.c |  2 +-
 arch/arm/boards/zii-vf610-dev/board.c  | 12 +++---
 arch/arm/dts/vf610-twr.dts             |  1 +
 arch/arm/dts/vf610-zii-dev.dtsi        |  1 +
 arch/arm/dts/vf610.dtsi                | 12 ++++++
 arch/arm/mach-imx/imx-bbu-internal.c   | 58 ++++++++++++++++++--------
 arch/arm/mach-imx/include/mach/bbu.h   | 21 ++++++++++
 8 files changed, 86 insertions(+), 25 deletions(-)
 create mode 100644 arch/arm/dts/vf610.dtsi

-- 
2.17.1


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

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

* [PATCH 01/11] ARM: i.MX: bbu: Add support for v1 header to MMC boot handler
  2018-09-18 22:22 [PATCH 00/11] Switch ZII boards to use MMC boot partitions Andrey Smirnov
@ 2018-09-18 22:22 ` Andrey Smirnov
  2018-09-18 22:22 ` [PATCH 02/11] ARM: i.MX51: bbu: Add a handler for MMC boot partitions Andrey Smirnov
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Andrey Smirnov @ 2018-09-18 22:22 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov

Convert imx_bbu_internal_v2_mmcboot_update() to use imx_bbu_update()
for actual update in order to be able to support v1 as well as v2
headers. While at it rename the function to
imx_bbu_internal_mmcboot_update() to reflect that change.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 arch/arm/mach-imx/imx-bbu-internal.c | 32 +++++++++++++++-------------
 1 file changed, 17 insertions(+), 15 deletions(-)

diff --git a/arch/arm/mach-imx/imx-bbu-internal.c b/arch/arm/mach-imx/imx-bbu-internal.c
index 504e359bc..a283b7c5c 100644
--- a/arch/arm/mach-imx/imx-bbu-internal.c
+++ b/arch/arm/mach-imx/imx-bbu-internal.c
@@ -401,11 +401,10 @@ static int imx_bbu_update(struct bbu_handler *handler, struct bbu_data *data)
 	return imx_handler->write_device(imx_handler, data);
 }
 
-static int imx_bbu_internal_v2_mmcboot_update(struct bbu_handler *handler,
-					      struct bbu_data *data)
+static int imx_bbu_internal_mmcboot_update(struct bbu_handler *handler,
+					   struct bbu_data *data)
 {
-	struct imx_internal_bbu_handler *imx_handler =
-		container_of(handler, struct imx_internal_bbu_handler, handler);
+	struct bbu_data _data = *data;
 	int ret;
 	char *bootpartvar;
 	const char *bootpart;
@@ -427,16 +426,14 @@ static int imx_bbu_internal_v2_mmcboot_update(struct bbu_handler *handler,
 	if (ret < 0)
 		goto free_bootpartvar;
 
-	ret = imx_bbu_check_prereq(imx_handler, devicefile, data,
-				   filetype_imx_image_v2);
+	_data.devicefile = devicefile;
+
+	ret = imx_bbu_update(handler, &_data);
 	if (ret)
 		goto free_devicefile;
 
-	ret = imx_bbu_write_device(imx_handler, devicefile, data, data->image, data->len);
-
-	if (!ret)
-		/* on success switch boot source */
-		ret = setenv(bootpartvar, bootpart);
+	/* on success switch boot source */
+	ret = setenv(bootpartvar, bootpart);
 
 free_devicefile:
 	free(devicefile);
@@ -586,20 +583,25 @@ int imx8mq_bbu_internal_mmc_register_handler(const char *name,
  * Note that no further partitioning of the boot partition is supported up to
  * now.
  */
-int imx6_bbu_internal_mmcboot_register_handler(const char *name,
-					       const char *devicefile,
-					       unsigned long flags)
+static int imx_bbu_internal_mmcboot_register_handler(const char *name,
+						     const char *devicefile,
+						     unsigned long flags)
 {
 	struct imx_internal_bbu_handler *imx_handler;
 
 	imx_handler = __init_handler(name, devicefile, flags);
 	imx_handler->flash_header_offset = imx_bbu_flash_header_offset_mmc();
 
-	imx_handler->handler.handler = imx_bbu_internal_v2_mmcboot_update;
+	imx_handler->handler.handler = imx_bbu_internal_mmcboot_update;
 
 	return __register_handler(imx_handler);
 }
 
+int imx6_bbu_internal_mmcboot_register_handler(const char *name,
+					       const char *devicefile,
+					       unsigned long flags)
+	__alias(imx_bbu_internal_mmcboot_register_handler);
+
 /*
  * Register an i.MX53 internal boot update handler for i2c/spi
  * EEPROMs / flashes. Nearly the same as MMC/SD, but we do not need to
-- 
2.17.1


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

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

* [PATCH 02/11] ARM: i.MX51: bbu: Add a handler for MMC boot partitions
  2018-09-18 22:22 [PATCH 00/11] Switch ZII boards to use MMC boot partitions Andrey Smirnov
  2018-09-18 22:22 ` [PATCH 01/11] ARM: i.MX: bbu: Add support for v1 header to MMC boot handler Andrey Smirnov
@ 2018-09-18 22:22 ` Andrey Smirnov
  2018-09-18 22:22 ` [PATCH 03/11] ARM: i.MX: bbu: Check retrun value of getenv() Andrey Smirnov
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Andrey Smirnov @ 2018-09-18 22:22 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 arch/arm/mach-imx/imx-bbu-internal.c |  5 +++++
 arch/arm/mach-imx/include/mach/bbu.h | 10 ++++++++++
 2 files changed, 15 insertions(+)

diff --git a/arch/arm/mach-imx/imx-bbu-internal.c b/arch/arm/mach-imx/imx-bbu-internal.c
index a283b7c5c..697e59f12 100644
--- a/arch/arm/mach-imx/imx-bbu-internal.c
+++ b/arch/arm/mach-imx/imx-bbu-internal.c
@@ -602,6 +602,11 @@ int imx6_bbu_internal_mmcboot_register_handler(const char *name,
 					       unsigned long flags)
 	__alias(imx_bbu_internal_mmcboot_register_handler);
 
+int imx51_bbu_internal_mmcboot_register_handler(const char *name,
+						const char *devicefile,
+						unsigned long flags)
+	__alias(imx_bbu_internal_mmcboot_register_handler);
+
 /*
  * Register an i.MX53 internal boot update handler for i2c/spi
  * EEPROMs / flashes. Nearly the same as MMC/SD, but we do not need to
diff --git a/arch/arm/mach-imx/include/mach/bbu.h b/arch/arm/mach-imx/include/mach/bbu.h
index b64c8d118..f0b6233f6 100644
--- a/arch/arm/mach-imx/include/mach/bbu.h
+++ b/arch/arm/mach-imx/include/mach/bbu.h
@@ -53,6 +53,9 @@ int imx6_bbu_internal_mmc_register_handler(const char *name, const char *devicef
 int imx6_bbu_internal_mmcboot_register_handler(const char *name, const char *devicefile,
 		unsigned long flags);
 
+int imx51_bbu_internal_mmcboot_register_handler(const char *name, const char *devicefile,
+		unsigned long flags);
+
 int imx6_bbu_internal_spi_i2c_register_handler(const char *name, const char *devicefile,
 		unsigned long flags);
 
@@ -113,6 +116,13 @@ static inline int imx6_bbu_internal_mmcboot_register_handler(const char *name,
 	return -ENOSYS;
 }
 
+static inline int imx51_bbu_internal_mmcboot_register_handler(const char *name,
+							      const char *devicefile,
+							      unsigned long flags)
+{
+	return -ENOSYS;
+}
+
 static inline int imx6_bbu_internal_spi_i2c_register_handler(const char *name, const char *devicefile,
 		unsigned long flags)
 {
-- 
2.17.1


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

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

* [PATCH 03/11] ARM: i.MX: bbu: Check retrun value of getenv()
  2018-09-18 22:22 [PATCH 00/11] Switch ZII boards to use MMC boot partitions Andrey Smirnov
  2018-09-18 22:22 ` [PATCH 01/11] ARM: i.MX: bbu: Add support for v1 header to MMC boot handler Andrey Smirnov
  2018-09-18 22:22 ` [PATCH 02/11] ARM: i.MX51: bbu: Add a handler for MMC boot partitions Andrey Smirnov
@ 2018-09-18 22:22 ` Andrey Smirnov
  2018-09-18 22:22 ` [PATCH 04/11] ARM: i.MX: bbu: Convert devicefile to device name Andrey Smirnov
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Andrey Smirnov @ 2018-09-18 22:22 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov

Add code to make sure that getenv() returned correct result and bail
out if it failed.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 arch/arm/mach-imx/imx-bbu-internal.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/mach-imx/imx-bbu-internal.c b/arch/arm/mach-imx/imx-bbu-internal.c
index 697e59f12..faa266572 100644
--- a/arch/arm/mach-imx/imx-bbu-internal.c
+++ b/arch/arm/mach-imx/imx-bbu-internal.c
@@ -415,6 +415,11 @@ static int imx_bbu_internal_mmcboot_update(struct bbu_handler *handler,
 		return ret;
 
 	bootpart = getenv(bootpartvar);
+	if (!bootpart) {
+		pr_err("Couldn't read the value of '%s'\n", bootpartvar);
+		ret = -ENOENT;
+		goto free_bootpartvar;
+	}
 
 	if (!strcmp(bootpart, "boot0")) {
 		bootpart = "boot1";
-- 
2.17.1


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

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

* [PATCH 04/11] ARM: i.MX: bbu: Convert devicefile to device name
  2018-09-18 22:22 [PATCH 00/11] Switch ZII boards to use MMC boot partitions Andrey Smirnov
                   ` (2 preceding siblings ...)
  2018-09-18 22:22 ` [PATCH 03/11] ARM: i.MX: bbu: Check retrun value of getenv() Andrey Smirnov
@ 2018-09-18 22:22 ` Andrey Smirnov
  2018-09-18 22:22 ` [PATCH 05/11] ARM: i.MX: bbu: Detect MMC before reading current boot partition Andrey Smirnov
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Andrey Smirnov @ 2018-09-18 22:22 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov

Data->devicefile can contain absolute path to target device, so we
need to convert it to a device name before we can safely use it.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 arch/arm/mach-imx/imx-bbu-internal.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-imx/imx-bbu-internal.c b/arch/arm/mach-imx/imx-bbu-internal.c
index faa266572..14bc569b7 100644
--- a/arch/arm/mach-imx/imx-bbu-internal.c
+++ b/arch/arm/mach-imx/imx-bbu-internal.c
@@ -409,8 +409,9 @@ static int imx_bbu_internal_mmcboot_update(struct bbu_handler *handler,
 	char *bootpartvar;
 	const char *bootpart;
 	char *devicefile;
+	const char *devname = devpath_to_name(data->devicefile);
 
-	ret = asprintf(&bootpartvar, "%s.boot", data->devicefile);
+	ret = asprintf(&bootpartvar, "%s.boot", devname);
 	if (ret < 0)
 		return ret;
 
@@ -427,7 +428,7 @@ static int imx_bbu_internal_mmcboot_update(struct bbu_handler *handler,
 		bootpart = "boot0";
 	}
 
-	ret = asprintf(&devicefile, "/dev/%s.%s", data->devicefile, bootpart);
+	ret = asprintf(&devicefile, "/dev/%s.%s", devname, bootpart);
 	if (ret < 0)
 		goto free_bootpartvar;
 
-- 
2.17.1


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

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

* [PATCH 05/11] ARM: i.MX: bbu: Detect MMC before reading current boot partition
  2018-09-18 22:22 [PATCH 00/11] Switch ZII boards to use MMC boot partitions Andrey Smirnov
                   ` (3 preceding siblings ...)
  2018-09-18 22:22 ` [PATCH 04/11] ARM: i.MX: bbu: Convert devicefile to device name Andrey Smirnov
@ 2018-09-18 22:22 ` Andrey Smirnov
  2018-09-18 22:23 ` [PATCH 06/11] ARM: VFxxx: bbu: Add a handler for MMC boot partitions Andrey Smirnov
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Andrey Smirnov @ 2018-09-18 22:22 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov

In order to be able to read "mmcN.boot" we need to detect that device
first. Not doing so would result in failure if "barebox_update" is
executed before "detect mmc0".

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 arch/arm/mach-imx/imx-bbu-internal.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/mach-imx/imx-bbu-internal.c b/arch/arm/mach-imx/imx-bbu-internal.c
index 14bc569b7..796d9454c 100644
--- a/arch/arm/mach-imx/imx-bbu-internal.c
+++ b/arch/arm/mach-imx/imx-bbu-internal.c
@@ -411,6 +411,12 @@ static int imx_bbu_internal_mmcboot_update(struct bbu_handler *handler,
 	char *devicefile;
 	const char *devname = devpath_to_name(data->devicefile);
 
+	ret = device_detect_by_name(devname);
+	if (ret) {
+		pr_err("Couldn't detect device '%s'\n", devname);
+		return ret;
+	}
+
 	ret = asprintf(&bootpartvar, "%s.boot", devname);
 	if (ret < 0)
 		return ret;
-- 
2.17.1


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

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

* [PATCH 06/11] ARM: VFxxx: bbu: Add a handler for MMC boot partitions
  2018-09-18 22:22 [PATCH 00/11] Switch ZII boards to use MMC boot partitions Andrey Smirnov
                   ` (4 preceding siblings ...)
  2018-09-18 22:22 ` [PATCH 05/11] ARM: i.MX: bbu: Detect MMC before reading current boot partition Andrey Smirnov
@ 2018-09-18 22:23 ` Andrey Smirnov
  2018-09-18 22:23 ` [PATCH 07/11] dts: VFxxx: Add aliases for ESDHC controllers Andrey Smirnov
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Andrey Smirnov @ 2018-09-18 22:23 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 arch/arm/mach-imx/imx-bbu-internal.c |  5 +++++
 arch/arm/mach-imx/include/mach/bbu.h | 11 +++++++++++
 2 files changed, 16 insertions(+)

diff --git a/arch/arm/mach-imx/imx-bbu-internal.c b/arch/arm/mach-imx/imx-bbu-internal.c
index 796d9454c..799b97361 100644
--- a/arch/arm/mach-imx/imx-bbu-internal.c
+++ b/arch/arm/mach-imx/imx-bbu-internal.c
@@ -619,6 +619,11 @@ int imx51_bbu_internal_mmcboot_register_handler(const char *name,
 						unsigned long flags)
 	__alias(imx_bbu_internal_mmcboot_register_handler);
 
+int vf610_bbu_internal_mmcboot_register_handler(const char *name,
+						const char *devicefile,
+						unsigned long flags)
+	__alias(imx_bbu_internal_mmcboot_register_handler);
+
 /*
  * Register an i.MX53 internal boot update handler for i2c/spi
  * EEPROMs / flashes. Nearly the same as MMC/SD, but we do not need to
diff --git a/arch/arm/mach-imx/include/mach/bbu.h b/arch/arm/mach-imx/include/mach/bbu.h
index f0b6233f6..bc1fc4ba6 100644
--- a/arch/arm/mach-imx/include/mach/bbu.h
+++ b/arch/arm/mach-imx/include/mach/bbu.h
@@ -56,6 +56,9 @@ int imx6_bbu_internal_mmcboot_register_handler(const char *name, const char *dev
 int imx51_bbu_internal_mmcboot_register_handler(const char *name, const char *devicefile,
 		unsigned long flags);
 
+int vf610_bbu_internal_mmcboot_register_handler(const char *name, const char *devicefile,
+						unsigned long flags);
+
 int imx6_bbu_internal_spi_i2c_register_handler(const char *name, const char *devicefile,
 		unsigned long flags);
 
@@ -123,6 +126,14 @@ static inline int imx51_bbu_internal_mmcboot_register_handler(const char *name,
 	return -ENOSYS;
 }
 
+
+static inline int vf610_bbu_internal_mmcboot_register_handler(const char *name,
+							      const char *devicefile,
+							      unsigned long flags)
+{
+	return -ENOSYS;
+}
+
 static inline int imx6_bbu_internal_spi_i2c_register_handler(const char *name, const char *devicefile,
 		unsigned long flags)
 {
-- 
2.17.1


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

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

* [PATCH 07/11] dts: VFxxx: Add aliases for ESDHC controllers
  2018-09-18 22:22 [PATCH 00/11] Switch ZII boards to use MMC boot partitions Andrey Smirnov
                   ` (5 preceding siblings ...)
  2018-09-18 22:23 ` [PATCH 06/11] ARM: VFxxx: bbu: Add a handler for MMC boot partitions Andrey Smirnov
@ 2018-09-18 22:23 ` Andrey Smirnov
  2018-09-18 22:23 ` [PATCH 08/11] ARM: zii-vf610-dev: Switch MMC BBU to use boot partitions Andrey Smirnov
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Andrey Smirnov @ 2018-09-18 22:23 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov

Add aliases for ESDHC controllers in order to make their naming across
Vybrid and i.MX.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 arch/arm/boards/zii-vf610-dev/board.c |  5 +++--
 arch/arm/dts/vf610-twr.dts            |  1 +
 arch/arm/dts/vf610-zii-dev.dtsi       |  1 +
 arch/arm/dts/vf610.dtsi               | 12 ++++++++++++
 4 files changed, 17 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/dts/vf610.dtsi

diff --git a/arch/arm/boards/zii-vf610-dev/board.c b/arch/arm/boards/zii-vf610-dev/board.c
index 91c653804..42b5c59df 100644
--- a/arch/arm/boards/zii-vf610-dev/board.c
+++ b/arch/arm/boards/zii-vf610-dev/board.c
@@ -174,8 +174,9 @@ static int zii_vf610_spu3_register_bbu(void)
 	if (!of_machine_is_compatible("zii,vf610spu3-a"))
 		return 0;
 
-	ret = vf610_bbu_internal_mmc_register_handler("eMMC", "/dev/disk0",
-						      BBU_HANDLER_FLAG_DEFAULT);
+	ret = vf610_bbu_internal_mmcboot_register_handler("eMMC",
+					      "/dev/mmc0",
+					      BBU_HANDLER_FLAG_DEFAULT);
 	if (ret) {
 		pr_err("Failed to register eMMC BBU handler\n");
 		return ret;
diff --git a/arch/arm/dts/vf610-twr.dts b/arch/arm/dts/vf610-twr.dts
index 2456ade5f..ac2774979 100644
--- a/arch/arm/dts/vf610-twr.dts
+++ b/arch/arm/dts/vf610-twr.dts
@@ -8,6 +8,7 @@
  */
 
 #include <arm/vf610-twr.dts>
+#include "vf610.dtsi"
 #include "vf610-ddrmc.dtsi"
 
 &usbdev0 {
diff --git a/arch/arm/dts/vf610-zii-dev.dtsi b/arch/arm/dts/vf610-zii-dev.dtsi
index dc16280bc..b6db26202 100644
--- a/arch/arm/dts/vf610-zii-dev.dtsi
+++ b/arch/arm/dts/vf610-zii-dev.dtsi
@@ -42,6 +42,7 @@ n *     copy, modify, merge, publish, distribute, sublicense, and/or
  *     OTHER DEALINGS IN THE SOFTWARE.
 */
 
+#include "vf610.dtsi"
 #include "vf610-ddrmc.dtsi"
 
 / {
diff --git a/arch/arm/dts/vf610.dtsi b/arch/arm/dts/vf610.dtsi
new file mode 100644
index 000000000..3060031b8
--- /dev/null
+++ b/arch/arm/dts/vf610.dtsi
@@ -0,0 +1,12 @@
+/*
+ * Two aliases missing in upstream DT needed to make VFxxx's SD/MMC
+ * device naming scheme consistent with the rest of i.MX (which the
+ * following aliases from upstream.
+ */
+
+/ {
+	aliases {
+		mmc0 = &esdhc0;
+		mmc1 = &esdhc1;
+	};
+};	
-- 
2.17.1


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

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

* [PATCH 08/11] ARM: zii-vf610-dev: Switch MMC BBU to use boot partitions
  2018-09-18 22:22 [PATCH 00/11] Switch ZII boards to use MMC boot partitions Andrey Smirnov
                   ` (6 preceding siblings ...)
  2018-09-18 22:23 ` [PATCH 07/11] dts: VFxxx: Add aliases for ESDHC controllers Andrey Smirnov
@ 2018-09-18 22:23 ` Andrey Smirnov
  2018-09-18 22:23 ` [PATCH 09/11] ARM: rdu2: " Andrey Smirnov
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Andrey Smirnov @ 2018-09-18 22:23 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov

Convert SPU3 to use MMC boot partitions as well as extend the initcall
to cover CFU1 which can support this feature as well.

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

diff --git a/arch/arm/boards/zii-vf610-dev/board.c b/arch/arm/boards/zii-vf610-dev/board.c
index 42b5c59df..cc3ecbda2 100644
--- a/arch/arm/boards/zii-vf610-dev/board.c
+++ b/arch/arm/boards/zii-vf610-dev/board.c
@@ -168,10 +168,11 @@ static int zii_vf610_dev_register_bbu(void)
 }
 late_initcall(zii_vf610_dev_register_bbu);
 
-static int zii_vf610_spu3_register_bbu(void)
+static int zii_vf610_register_emmc_bbu(void)
 {
 	int ret;
-	if (!of_machine_is_compatible("zii,vf610spu3-a"))
+	if (!of_machine_is_compatible("zii,vf610spu3-a") &&
+	    !of_machine_is_compatible("zii,vf610cfu1-a"))
 		return 0;
 
 	ret = vf610_bbu_internal_mmcboot_register_handler("eMMC",
@@ -184,4 +185,4 @@ static int zii_vf610_spu3_register_bbu(void)
 
 	return 0;
 }
-late_initcall(zii_vf610_spu3_register_bbu);
\ No newline at end of file
+late_initcall(zii_vf610_register_emmc_bbu);
\ No newline at end of file
-- 
2.17.1


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

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

* [PATCH 09/11] ARM: rdu2: Switch MMC BBU to use boot partitions
  2018-09-18 22:22 [PATCH 00/11] Switch ZII boards to use MMC boot partitions Andrey Smirnov
                   ` (7 preceding siblings ...)
  2018-09-18 22:23 ` [PATCH 08/11] ARM: zii-vf610-dev: Switch MMC BBU to use boot partitions Andrey Smirnov
@ 2018-09-18 22:23 ` Andrey Smirnov
  2018-09-18 22:23 ` [PATCH 10/11] ARM: rdu1: Change BBU names to match RDU2 Andrey Smirnov
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Andrey Smirnov @ 2018-09-18 22:23 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov

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

diff --git a/arch/arm/boards/zii-imx6q-rdu2/board.c b/arch/arm/boards/zii-imx6q-rdu2/board.c
index f6c908c9f..c99f993f0 100644
--- a/arch/arm/boards/zii-imx6q-rdu2/board.c
+++ b/arch/arm/boards/zii-imx6q-rdu2/board.c
@@ -146,7 +146,7 @@ static int rdu2_devices_init(void)
 	imx6_bbu_internal_spi_i2c_register_handler("SPI", "/dev/m25p0.barebox",
 						   BBU_HANDLER_FLAG_DEFAULT);
 
-	imx6_bbu_internal_mmc_register_handler("eMMC", "/dev/mmc3", 0);
+	imx6_bbu_internal_mmcboot_register_handler("eMMC", "/dev/mmc3", 0);
 
 	defaultenv_append_directory(defaultenv_rdu2);
 
-- 
2.17.1


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

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

* [PATCH 10/11] ARM: rdu1: Change BBU names to match RDU2
  2018-09-18 22:22 [PATCH 00/11] Switch ZII boards to use MMC boot partitions Andrey Smirnov
                   ` (8 preceding siblings ...)
  2018-09-18 22:23 ` [PATCH 09/11] ARM: rdu2: " Andrey Smirnov
@ 2018-09-18 22:23 ` Andrey Smirnov
  2018-09-18 22:23 ` [PATCH 11/11] ARM: rdu1: Switch MMC BBU to use boot partitions Andrey Smirnov
  2018-09-19  7:54 ` [PATCH 00/11] Switch ZII boards to use MMC " Sascha Hauer
  11 siblings, 0 replies; 13+ messages in thread
From: Andrey Smirnov @ 2018-09-18 22:23 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov

Change BBU names to match RDU2 and the rest of ZII boards.

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

diff --git a/arch/arm/boards/zii-imx51-rdu1/board.c b/arch/arm/boards/zii-imx51-rdu1/board.c
index ac5232e17..a8c11cc46 100644
--- a/arch/arm/boards/zii-imx51-rdu1/board.c
+++ b/arch/arm/boards/zii-imx51-rdu1/board.c
@@ -30,8 +30,8 @@ static int zii_rdu1_init(void)
 
 	barebox_set_hostname("rdu1");
 
-	imx51_bbu_internal_mmc_register_handler("mmc", "/dev/mmc0", 0);
-	imx51_bbu_internal_spi_i2c_register_handler("spi",
+	imx51_bbu_internal_mmc_register_handler("eMMC", "/dev/mmc0", 0);
+	imx51_bbu_internal_spi_i2c_register_handler("SPI",
 		"/dev/dataflash0.barebox",
 		BBU_HANDLER_FLAG_DEFAULT |
 		IMX_BBU_FLAG_PARTITION_STARTS_AT_HEADER);
-- 
2.17.1


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

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

* [PATCH 11/11] ARM: rdu1: Switch MMC BBU to use boot partitions
  2018-09-18 22:22 [PATCH 00/11] Switch ZII boards to use MMC boot partitions Andrey Smirnov
                   ` (9 preceding siblings ...)
  2018-09-18 22:23 ` [PATCH 10/11] ARM: rdu1: Change BBU names to match RDU2 Andrey Smirnov
@ 2018-09-18 22:23 ` Andrey Smirnov
  2018-09-19  7:54 ` [PATCH 00/11] Switch ZII boards to use MMC " Sascha Hauer
  11 siblings, 0 replies; 13+ messages in thread
From: Andrey Smirnov @ 2018-09-18 22:23 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov

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

diff --git a/arch/arm/boards/zii-imx51-rdu1/board.c b/arch/arm/boards/zii-imx51-rdu1/board.c
index a8c11cc46..601c9a236 100644
--- a/arch/arm/boards/zii-imx51-rdu1/board.c
+++ b/arch/arm/boards/zii-imx51-rdu1/board.c
@@ -30,7 +30,7 @@ static int zii_rdu1_init(void)
 
 	barebox_set_hostname("rdu1");
 
-	imx51_bbu_internal_mmc_register_handler("eMMC", "/dev/mmc0", 0);
+	imx51_bbu_internal_mmcboot_register_handler("eMMC", "/dev/mmc0", 0);
 	imx51_bbu_internal_spi_i2c_register_handler("SPI",
 		"/dev/dataflash0.barebox",
 		BBU_HANDLER_FLAG_DEFAULT |
-- 
2.17.1


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

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

* Re: [PATCH 00/11] Switch ZII boards to use MMC boot partitions
  2018-09-18 22:22 [PATCH 00/11] Switch ZII boards to use MMC boot partitions Andrey Smirnov
                   ` (10 preceding siblings ...)
  2018-09-18 22:23 ` [PATCH 11/11] ARM: rdu1: Switch MMC BBU to use boot partitions Andrey Smirnov
@ 2018-09-19  7:54 ` Sascha Hauer
  11 siblings, 0 replies; 13+ messages in thread
From: Sascha Hauer @ 2018-09-19  7:54 UTC (permalink / raw)
  To: Andrey Smirnov; +Cc: barebox

On Tue, Sep 18, 2018 at 03:22:54PM -0700, Andrey Smirnov wrote:
> Everyone:
> 
> This patchset contains code to switch all supported ZII platforms to
> use MMC boot partitions for BBU functionality as well as various
> additional fixes that were developed in the process. Hopefully all of
> the patches are self-explanatory.
> 
> Feedback is welcome!
> 

Applied, thanks

Sascha

> Thanks,
> Andrey Smirnov
> 
> Andrey Smirnov (11):
>   ARM: i.MX: bbu: Add support for v1 header to MMC boot handler
>   ARM: i.MX51: bbu: Add a handler for MMC boot partitions
>   ARM: i.MX: bbu: Check retrun value of getenv()
>   ARM: i.MX: bbu: Convert devicefile to device name
>   ARM: i.MX: bbu: Detect MMC before reading current boot partition
>   ARM: VFxxx: bbu: Add a handler for MMC boot partitions
>   dts: VFxxx: Add aliases for ESDHC controllers
>   ARM: zii-vf610-dev: Switch MMC BBU to use boot partitions
>   ARM: rdu2: Switch MMC BBU to use boot partitions
>   ARM: rdu1: Change BBU names to match RDU2
>   ARM: rdu1: Switch MMC BBU to use boot partitions
> 
>  arch/arm/boards/zii-imx51-rdu1/board.c |  4 +-
>  arch/arm/boards/zii-imx6q-rdu2/board.c |  2 +-
>  arch/arm/boards/zii-vf610-dev/board.c  | 12 +++---
>  arch/arm/dts/vf610-twr.dts             |  1 +
>  arch/arm/dts/vf610-zii-dev.dtsi        |  1 +
>  arch/arm/dts/vf610.dtsi                | 12 ++++++
>  arch/arm/mach-imx/imx-bbu-internal.c   | 58 ++++++++++++++++++--------
>  arch/arm/mach-imx/include/mach/bbu.h   | 21 ++++++++++
>  8 files changed, 86 insertions(+), 25 deletions(-)
>  create mode 100644 arch/arm/dts/vf610.dtsi
> 
> -- 
> 2.17.1
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

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

end of thread, other threads:[~2018-09-19  7:54 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-18 22:22 [PATCH 00/11] Switch ZII boards to use MMC boot partitions Andrey Smirnov
2018-09-18 22:22 ` [PATCH 01/11] ARM: i.MX: bbu: Add support for v1 header to MMC boot handler Andrey Smirnov
2018-09-18 22:22 ` [PATCH 02/11] ARM: i.MX51: bbu: Add a handler for MMC boot partitions Andrey Smirnov
2018-09-18 22:22 ` [PATCH 03/11] ARM: i.MX: bbu: Check retrun value of getenv() Andrey Smirnov
2018-09-18 22:22 ` [PATCH 04/11] ARM: i.MX: bbu: Convert devicefile to device name Andrey Smirnov
2018-09-18 22:22 ` [PATCH 05/11] ARM: i.MX: bbu: Detect MMC before reading current boot partition Andrey Smirnov
2018-09-18 22:23 ` [PATCH 06/11] ARM: VFxxx: bbu: Add a handler for MMC boot partitions Andrey Smirnov
2018-09-18 22:23 ` [PATCH 07/11] dts: VFxxx: Add aliases for ESDHC controllers Andrey Smirnov
2018-09-18 22:23 ` [PATCH 08/11] ARM: zii-vf610-dev: Switch MMC BBU to use boot partitions Andrey Smirnov
2018-09-18 22:23 ` [PATCH 09/11] ARM: rdu2: " Andrey Smirnov
2018-09-18 22:23 ` [PATCH 10/11] ARM: rdu1: Change BBU names to match RDU2 Andrey Smirnov
2018-09-18 22:23 ` [PATCH 11/11] ARM: rdu1: Switch MMC BBU to use boot partitions Andrey Smirnov
2018-09-19  7:54 ` [PATCH 00/11] Switch ZII boards to use MMC " Sascha Hauer

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