diff mbox series

[v2,1/5] wandboard: Fix version detection for mx6q/mx6dl revD1

Message ID 20200417122713.30574-1-festevam@gmail.com
State Accepted
Commit 4c13a4db60b4d570ea8cc496d02e5ea31adf27f0
Headers show
Series [v2,1/5] wandboard: Fix version detection for mx6q/mx6dl revD1 | expand

Commit Message

Fabio Estevam April 17, 2020, 12:27 p.m. UTC
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 at denx.de>
Reported-by: Derek Atkins <derek at ihtfp.com>
Signed-off-by: Fabio Estevam <festevam at gmail.com>
Tested-by: Derek Atkins <derek at ihtfp.com>
---
Changes since v1:
- Also use the revd1 dtb's inside board_fit_config_name_match(), which
fixes truncated console output on i.MX6DL wandboard as reported by Heiko.
- Added Tested-by from Derek as he confirmed it works on a imx6q revd1.

 arch/arm/dts/Makefile                                         | 4 ++--
 ...{imx6dl-wandboard-revb1.dts => imx6dl-wandboard-revd1.dts} | 4 ++--
 .../{imx6q-wandboard-revb1.dts => imx6q-wandboard-revd1.dts}  | 4 ++--
 board/wandboard/wandboard.c                                   | 4 ++--
 configs/wandboard_defconfig                                   | 4 ++--
 5 files changed, 10 insertions(+), 10 deletions(-)
 rename arch/arm/dts/{imx6dl-wandboard-revb1.dts => imx6dl-wandboard-revd1.dts} (78%)
 rename arch/arm/dts/{imx6q-wandboard-revb1.dts => imx6q-wandboard-revd1.dts} (80%)

Comments

Heiko Schocher April 17, 2020, 2:51 p.m. UTC | #1
Hello Fabio,

Am 17.04.2020 um 14:27 schrieb Fabio Estevam:
> 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 at denx.de>
> Reported-by: Derek Atkins <derek at ihtfp.com>
> Signed-off-by: Fabio Estevam <festevam at gmail.com>
> Tested-by: Derek Atkins <derek at ihtfp.com>
> ---
> Changes since v1:
> - Also use the revd1 dtb's inside board_fit_config_name_match(), which
> fixes truncated console output on i.MX6DL wandboard as reported by Heiko.
> - Added Tested-by from Derek as he confirmed it works on a imx6q revd1.
> 
>   arch/arm/dts/Makefile                                         | 4 ++--
>   ...{imx6dl-wandboard-revb1.dts => imx6dl-wandboard-revd1.dts} | 4 ++--
>   .../{imx6q-wandboard-revb1.dts => imx6q-wandboard-revd1.dts}  | 4 ++--
>   board/wandboard/wandboard.c                                   | 4 ++--
>   configs/wandboard_defconfig                                   | 4 ++--
>   5 files changed, 10 insertions(+), 10 deletions(-)
>   rename arch/arm/dts/{imx6dl-wandboard-revb1.dts => imx6dl-wandboard-revd1.dts} (78%)
>   rename arch/arm/dts/{imx6q-wandboard-revb1.dts => imx6q-wandboard-revd1.dts} (80%)

Tested-by: Heiko Schocher <hs at denx.de>

Thanks!

bye,
Heiko
Peter Robinson April 17, 2020, 4:09 p.m. UTC | #2
On Fri, Apr 17, 2020 at 1:32 PM Fabio Estevam <festevam at gmail.com> wrote:
>
> 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 at denx.de>
> Reported-by: Derek Atkins <derek at ihtfp.com>
> Signed-off-by: Fabio Estevam <festevam at gmail.com>
> Tested-by: Derek Atkins <derek at ihtfp.com>

Tested-by: Peter Robinson <pbrobinson at gmail.com>

Series is tested on a B1 and a C1

> ---
> Changes since v1:
> - Also use the revd1 dtb's inside board_fit_config_name_match(), which
> fixes truncated console output on i.MX6DL wandboard as reported by Heiko.
> - Added Tested-by from Derek as he confirmed it works on a imx6q revd1.
>
>  arch/arm/dts/Makefile                                         | 4 ++--
>  ...{imx6dl-wandboard-revb1.dts => imx6dl-wandboard-revd1.dts} | 4 ++--
>  .../{imx6q-wandboard-revb1.dts => imx6q-wandboard-revd1.dts}  | 4 ++--
>  board/wandboard/wandboard.c                                   | 4 ++--
>  configs/wandboard_defconfig                                   | 4 ++--
>  5 files changed, 10 insertions(+), 10 deletions(-)
>  rename arch/arm/dts/{imx6dl-wandboard-revb1.dts => imx6dl-wandboard-revd1.dts} (78%)
>  rename arch/arm/dts/{imx6q-wandboard-revb1.dts => imx6q-wandboard-revd1.dts} (80%)
>
> diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
> index 820ee9733a..2a71917c92 100644
> --- a/arch/arm/dts/Makefile
> +++ b/arch/arm/dts/Makefile
> @@ -622,7 +622,7 @@ dtb-y += \
>         imx6dl-pico.dtb \
>         imx6dl-sabreauto.dtb \
>         imx6dl-sabresd.dtb \
> -       imx6dl-wandboard-revb1.dtb \
> +       imx6dl-wandboard-revd1.dtb \
>
>  endif
>
> @@ -654,7 +654,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-revd1.dts
> similarity index 78%
> rename from arch/arm/dts/imx6dl-wandboard-revb1.dts
> rename to arch/arm/dts/imx6dl-wandboard-revd1.dts
> index c2946fbaa0..6d1d863c2e 100644
> --- a/arch/arm/dts/imx6dl-wandboard-revb1.dts
> +++ b/arch/arm/dts/imx6dl-wandboard-revd1.dts
> @@ -6,10 +6,10 @@
>   */
>  /dts-v1/;
>  #include "imx6dl.dtsi"
> -#include "imx6qdl-wandboard-revb1.dtsi"
> +#include "imx6qdl-wandboard-revd1.dtsi"
>
>  / {
> -       model = "Wandboard i.MX6 Dual Lite Board rev B1";
> +       model = "Wandboard i.MX6 Dual Lite Board revD1";
>         compatible = "wand,imx6dl-wandboard", "fsl,imx6dl";
>
>         memory at 10000000 {
> diff --git a/arch/arm/dts/imx6q-wandboard-revb1.dts b/arch/arm/dts/imx6q-wandboard-revd1.dts
> similarity index 80%
> rename from arch/arm/dts/imx6q-wandboard-revb1.dts
> rename to arch/arm/dts/imx6q-wandboard-revd1.dts
> index f6ccbecff9..55331021d8 100644
> --- a/arch/arm/dts/imx6q-wandboard-revb1.dts
> +++ b/arch/arm/dts/imx6q-wandboard-revd1.dts
> @@ -6,10 +6,10 @@
>   */
>  /dts-v1/;
>  #include "imx6q.dtsi"
> -#include "imx6qdl-wandboard-revb1.dtsi"
> +#include "imx6qdl-wandboard-revd1.dtsi"
>
>  / {
> -       model = "Wandboard i.MX6 Quad Board rev B1";
> +       model = "Wandboard i.MX6 Quad Board revD1";
>         compatible = "wand,imx6q-wandboard", "fsl,imx6q";
>
>         memory at 10000000 {
> diff --git a/board/wandboard/wandboard.c b/board/wandboard/wandboard.c
> index 5725c5816c..90957167b2 100644
> --- a/board/wandboard/wandboard.c
> +++ b/board/wandboard/wandboard.c
> @@ -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;
>         }
>
> diff --git a/configs/wandboard_defconfig b/configs/wandboard_defconfig
> index 82e517b90f..ee70758f3a 100644
> --- a/configs/wandboard_defconfig
> +++ b/configs/wandboard_defconfig
> @@ -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
> --
> 2.17.1
>
Stefano Babic April 19, 2020, 9:08 a.m. UTC | #3
> 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 at denx.de>
> Reported-by: Derek Atkins <derek at ihtfp.com>
> Signed-off-by: Fabio Estevam <festevam at gmail.com>
> Tested-by: Derek Atkins <derek at ihtfp.com>
> Tested-by: Heiko Schocher <hs at denx.de>
> Tested-by: Peter Robinson <pbrobinson at gmail.com>
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 820ee9733a..2a71917c92 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -622,7 +622,7 @@  dtb-y += \
 	imx6dl-pico.dtb \
 	imx6dl-sabreauto.dtb \
 	imx6dl-sabresd.dtb \
-	imx6dl-wandboard-revb1.dtb \
+	imx6dl-wandboard-revd1.dtb \
 
 endif
 
@@ -654,7 +654,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-revd1.dts
similarity index 78%
rename from arch/arm/dts/imx6dl-wandboard-revb1.dts
rename to arch/arm/dts/imx6dl-wandboard-revd1.dts
index c2946fbaa0..6d1d863c2e 100644
--- a/arch/arm/dts/imx6dl-wandboard-revb1.dts
+++ b/arch/arm/dts/imx6dl-wandboard-revd1.dts
@@ -6,10 +6,10 @@ 
  */
 /dts-v1/;
 #include "imx6dl.dtsi"
-#include "imx6qdl-wandboard-revb1.dtsi"
+#include "imx6qdl-wandboard-revd1.dtsi"
 
 / {
-	model = "Wandboard i.MX6 Dual Lite Board rev B1";
+	model = "Wandboard i.MX6 Dual Lite Board revD1";
 	compatible = "wand,imx6dl-wandboard", "fsl,imx6dl";
 
 	memory at 10000000 {
diff --git a/arch/arm/dts/imx6q-wandboard-revb1.dts b/arch/arm/dts/imx6q-wandboard-revd1.dts
similarity index 80%
rename from arch/arm/dts/imx6q-wandboard-revb1.dts
rename to arch/arm/dts/imx6q-wandboard-revd1.dts
index f6ccbecff9..55331021d8 100644
--- a/arch/arm/dts/imx6q-wandboard-revb1.dts
+++ b/arch/arm/dts/imx6q-wandboard-revd1.dts
@@ -6,10 +6,10 @@ 
  */
 /dts-v1/;
 #include "imx6q.dtsi"
-#include "imx6qdl-wandboard-revb1.dtsi"
+#include "imx6qdl-wandboard-revd1.dtsi"
 
 / {
-	model = "Wandboard i.MX6 Quad Board rev B1";
+	model = "Wandboard i.MX6 Quad Board revD1";
 	compatible = "wand,imx6q-wandboard", "fsl,imx6q";
 
 	memory at 10000000 {
diff --git a/board/wandboard/wandboard.c b/board/wandboard/wandboard.c
index 5725c5816c..90957167b2 100644
--- a/board/wandboard/wandboard.c
+++ b/board/wandboard/wandboard.c
@@ -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;
 	}
 
diff --git a/configs/wandboard_defconfig b/configs/wandboard_defconfig
index 82e517b90f..ee70758f3a 100644
--- a/configs/wandboard_defconfig
+++ b/configs/wandboard_defconfig
@@ -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