wandboard: Fix version detection for mx6q/mx6dl revD1
authorFabio Estevam <festevam@gmail.com>
Fri, 17 Apr 2020 12:27:09 +0000 (09:27 -0300)
committerStefano Babic <sbabic@denx.de>
Sat, 18 Apr 2020 10:59:23 +0000 (12:59 +0200)
The detection of the revD1 version is based on the presence of the PMIC.

Currently revb1 device trees are used for mx6q/mx6dl variants, which
do not have the PMIC nodes.

This causes revD1 boards to be incorrectly be detected as revB1.

Fix this issue by using the revd1 device trees, so that the PMIC node can be
found and then the PMIC can be detected by reading its register ID.

Imported the revd1 device trees from mainline kernel version 5.7-rc1.

Reported-by: Heiko Schocher <hs@denx.de>
Reported-by: Derek Atkins <derek@ihtfp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Derek Atkins <derek@ihtfp.com>
Tested-by: Heiko Schocher <hs@denx.de>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
arch/arm/dts/Makefile
arch/arm/dts/imx6dl-wandboard-revb1.dts [deleted file]
arch/arm/dts/imx6dl-wandboard-revd1.dts [new file with mode: 0644]
arch/arm/dts/imx6q-wandboard-revb1.dts [deleted file]
arch/arm/dts/imx6q-wandboard-revd1.dts [new file with mode: 0644]
board/wandboard/wandboard.c
configs/wandboard_defconfig

index e6262c9f1968e0288027a76225154ad2ed73ffe3..f28da2174ac25a285fb6b124b0c36fa89cb5b729 100644 (file)
@@ -627,7 +627,7 @@ dtb-y += \
        imx6dl-pico.dtb \
        imx6dl-sabreauto.dtb \
        imx6dl-sabresd.dtb \
-       imx6dl-wandboard-revb1.dtb \
+       imx6dl-wandboard-revd1.dtb \
 
 endif
 
@@ -661,7 +661,7 @@ dtb-y += \
        imx6q-sabrelite.dtb \
        imx6q-sabresd.dtb \
        imx6q-tbs2910.dtb \
-       imx6q-wandboard-revb1.dtb \
+       imx6q-wandboard-revd1.dtb \
        imx6qp-sabreauto.dtb \
        imx6qp-sabresd.dtb \
        imx6qp-wandboard-revd1.dtb \
diff --git a/arch/arm/dts/imx6dl-wandboard-revb1.dts b/arch/arm/dts/imx6dl-wandboard-revb1.dts
deleted file mode 100644 (file)
index c2946fb..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * Copyright 2013 Freescale Semiconductor, Inc.
- *
- * Author: Fabio Estevam <fabio.estevam@freescale.com>
- */
-/dts-v1/;
-#include "imx6dl.dtsi"
-#include "imx6qdl-wandboard-revb1.dtsi"
-
-/ {
-       model = "Wandboard i.MX6 Dual Lite Board rev B1";
-       compatible = "wand,imx6dl-wandboard", "fsl,imx6dl";
-
-       memory@10000000 {
-               device_type = "memory";
-               reg = <0x10000000 0x40000000>;
-       };
-};
diff --git a/arch/arm/dts/imx6dl-wandboard-revd1.dts b/arch/arm/dts/imx6dl-wandboard-revd1.dts
new file mode 100644 (file)
index 0000000..6d1d863
--- /dev/null
@@ -0,0 +1,19 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright 2013 Freescale Semiconductor, Inc.
+ *
+ * Author: Fabio Estevam <fabio.estevam@freescale.com>
+ */
+/dts-v1/;
+#include "imx6dl.dtsi"
+#include "imx6qdl-wandboard-revd1.dtsi"
+
+/ {
+       model = "Wandboard i.MX6 Dual Lite Board revD1";
+       compatible = "wand,imx6dl-wandboard", "fsl,imx6dl";
+
+       memory@10000000 {
+               device_type = "memory";
+               reg = <0x10000000 0x40000000>;
+       };
+};
diff --git a/arch/arm/dts/imx6q-wandboard-revb1.dts b/arch/arm/dts/imx6q-wandboard-revb1.dts
deleted file mode 100644 (file)
index f6ccbec..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * Copyright 2013 Freescale Semiconductor, Inc.
- *
- * Author: Fabio Estevam <fabio.estevam@freescale.com>
- */
-/dts-v1/;
-#include "imx6q.dtsi"
-#include "imx6qdl-wandboard-revb1.dtsi"
-
-/ {
-       model = "Wandboard i.MX6 Quad Board rev B1";
-       compatible = "wand,imx6q-wandboard", "fsl,imx6q";
-
-       memory@10000000 {
-               device_type = "memory";
-               reg = <0x10000000 0x80000000>;
-       };
-};
-
-&sata {
-       status = "okay";
-};
diff --git a/arch/arm/dts/imx6q-wandboard-revd1.dts b/arch/arm/dts/imx6q-wandboard-revd1.dts
new file mode 100644 (file)
index 0000000..5533102
--- /dev/null
@@ -0,0 +1,23 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright 2013 Freescale Semiconductor, Inc.
+ *
+ * Author: Fabio Estevam <fabio.estevam@freescale.com>
+ */
+/dts-v1/;
+#include "imx6q.dtsi"
+#include "imx6qdl-wandboard-revd1.dtsi"
+
+/ {
+       model = "Wandboard i.MX6 Quad Board revD1";
+       compatible = "wand,imx6q-wandboard", "fsl,imx6q";
+
+       memory@10000000 {
+               device_type = "memory";
+               reg = <0x10000000 0x80000000>;
+       };
+};
+
+&sata {
+       status = "okay";
+};
index 5725c5816cda61509bd2fa3eb082b594037d9328..90957167b2ae6abc52e8b1dbcd4ea04117883592 100644 (file)
@@ -484,13 +484,13 @@ int checkboard(void)
 int board_fit_config_name_match(const char *name)
 {
        if (is_mx6dq()) {
-               if (!strcmp(name, "imx6q-wandboard-revb1"))
+               if (!strcmp(name, "imx6q-wandboard-revd1"))
                        return 0;
        } else if (is_mx6dqp()) {
                if (!strcmp(name, "imx6qp-wandboard-revd1"))
                        return 0;
        } else if (is_mx6dl() || is_mx6solo()) {
-               if (!strcmp(name, "imx6dl-wandboard-revb1"))
+               if (!strcmp(name, "imx6dl-wandboard-revd1"))
                        return 0;
        }
 
index 82e517b90fc2c3486b628ace545c7d90f86ca4d4..ee70758f3aa71837e113c0b1f6b00aa5536c4add 100644 (file)
@@ -46,8 +46,8 @@ CONFIG_CMD_BMP=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_OF_CONTROL=y
-CONFIG_DEFAULT_DEVICE_TREE="imx6dl-wandboard-revb1"
-CONFIG_OF_LIST="imx6q-wandboard-revb1 imx6qp-wandboard-revd1 imx6dl-wandboard-revb1"
+CONFIG_DEFAULT_DEVICE_TREE="imx6dl-wandboard-revd1"
+CONFIG_OF_LIST="imx6q-wandboard-revd1 imx6qp-wandboard-revd1 imx6dl-wandboard-revd1"
 CONFIG_MULTI_DTB_FIT=y
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y