Skip to contentSkip to conversation

wandboard: Fix detection for mx6q/mx6dl revD1 revariants

PATCH New Fabio Estevam 1 participant 6 messages Apr 17, 2020

Subsystems (2)
lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

PATCH 1/5 wandboard: Fix detection for mx6q/mx6dl revD1 revariants

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.

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

---
Hi Heiko,

Could you please try this on your mx6dl wandboard revD1 board?

I recall you reported this issue sometime ago.

Derek tested this on his mx6q wandboard revD1 board and it worked fine.

I have also tested it on a revB1 and the version is properly detected.

Thanks

 arch/arm/dts/Makefile                                         | 4 ++--
 ...{imx6dl-wandboard-revb1.dts => imx6dl-wandboard-revd1.dts} | 4 ++--
 .../{imx6q-wandboard-revb1.dts => imx6q-wandboard-revd1.dts}  | 4 ++--
 configs/wandboard_defconfig                                   | 4 ++--
 4 files changed, 8 insertions(+), 8 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%)
arch/arm/dts/Makefile +2 -2
index 820ee9733a..2a71917c92 100644
@@ -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 \
arch/arm/dts/imx6dl-wandboard-revd1.dts renamed from arch/arm/dts/imx6dl-wandboard-revb1.dts +2 -2
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
@@ -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 {
arch/arm/dts/imx6q-wandboard-revd1.dts renamed from arch/arm/dts/imx6q-wandboard-revb1.dts +2 -2
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
@@ -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 {
configs/wandboard_defconfig +2 -2
index 82e517b90f..ee70758f3a 100644
@@ -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
Signature · 1 line
2.17.1
author reviewer
#3 lore raw

PATCH 2/5 pmic: pfuze100: Change error message level to debug

On systems that can run on multiple board variants, such as wandboard, which versions with and without the PMIC populated, it is not useful to get PMIC error on systems that do not have the PMIC populated.

Change error message level to debug instead.

---
 drivers/power/pmic/pfuze100.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/pmic/pfuze100.c +1 -1
index 6cf5f35f0f..db630f3ad0 100644
@@ -41,7 +41,7 @@ static int pfuze100_write(struct udevice *dev, uint reg, const uint8_t *buff,
 static int pfuze100_read(struct udevice *dev, uint reg, uint8_t *buff, int len)
 {
 	if (dm_i2c_read(dev, reg, buff, len)) {
-		pr_err("read error from device: %p register: %#x!\n", dev, reg);
+		debug("read error from device: %p register: %#x!\n", dev, reg);
 		return -EIO;
 	}
 
Signature · 1 line
2.17.1
author reviewer
#2 lore raw

PATCH v3 2/2 wandboard: Remove repeated PMIC string

In reply to Fabio Estevam

After the conversion to DM_PMIC the following output is seen:

PMIC: PMIC: PFUZE100 ID=0x10

Remove the unnecessary PMIC string from the board file to avoid the repetead string.

---
Changes since v2:
- None

 board/wandboard/wandboard.c | 2 --
 1 file changed, 2 deletions(-)
board/wandboard/wandboard.c +0 -2
index 7209cc8211..e386ad2cc1 100644
@@ -361,8 +361,6 @@ int power_init_board(void)
 	struct udevice *dev;
 	int reg, ret;
 
-	puts("PMIC:  ");
-
 	ret = pmic_get("pfuze100 at 8", &dev);
 	if (ret < 0) {
 		printf("pmic_get() ret %d\n", ret);
Signature · 1 line
2.17.1
author reviewer
#4 lore raw

PATCH 4/5 wandboard: Remove CONFIG_DISPLAY_BOARDINFO_LATE

In reply to Fabio Estevam

Since we are using revD1 device tree for all board revisions, the following can be seen on a revB1 board:

Model: Wandboard i.MX6 Quad Board revD1
Board: Wandboard rev B1

To avoid such confusing messages, disable CONFIG_DISPLAY_BOARDINFO_LATE.

---
 configs/wandboard_defconfig | 1 -
 1 file changed, 1 deletion(-)
configs/wandboard_defconfig +0 -1
index ee70758f3a..f9a5fe479b 100644
@@ -29,7 +29,6 @@ CONFIG_BOOTCOMMAND="run findfdt; run finduuid; run distro_bootcmd"
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
 # CONFIG_DISPLAY_BOARDINFO is not set
-CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_BOUNCE_BUFFER=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SPL_SEPARATE_BSS=y
Signature · 1 line
2.17.1
author reviewer
#5 lore raw

PATCH 5/5 wandboard: Remove checkboard()

In reply to Fabio Estevam

Since the variant revision is no longer show, simply get rid of checkboard().

Move the gpio_request() prior to its usage.

---
 board/wandboard/wandboard.c | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)
board/wandboard/wandboard.c +1 -14
index df454d8f17..bb1ffd87e1 100644
@@ -404,6 +404,7 @@ static const struct boot_mode board_boot_modes[] = {
 static bool is_revc1(void)
 {
 	SETUP_IOMUX_PADS(rev_detection_pad);
+	gpio_request(REV_DETECTION, "REV_DETECT");
 	gpio_direction_input(REV_DETECTION);
 
 	if (gpio_get_value(REV_DETECTION))
@@ -466,20 +467,6 @@ int board_init(void)
 	return 0;
 }
 
-int checkboard(void)
-{
-	gpio_request(REV_DETECTION, "REV_DETECT");
-
-	if (is_revd1())
-		puts("Board: Wandboard rev D1\n");
-	else if (is_revc1())
-		puts("Board: Wandboard rev C1\n");
-	else
-		puts("Board: Wandboard rev B1\n");
-
-	return 0;
-}
-
 #ifdef CONFIG_SPL_LOAD_FIT
 int board_fit_config_name_match(const char *name)
 {
Signature · 1 line
2.17.1
author reviewer
#1 lore raw

PATCH 1/5 wandboard: Fix detection for mx6q/mx6dl revD1 revariants

In reply to Fabio Estevam

Sorry for sending this twice.

The first submission had the wrong patch 3/5.

Quoted 117 lines · 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.

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

---
Hi Heiko,

Could you please try this on your mx6dl wandboard revD1 board?

I recall you reported this issue sometime ago.

Derek tested this on his mx6q wandboard revD1 board and it worked fine.

I have also tested it on a revB1 and the version is properly detected.

Thanks

 arch/arm/dts/Makefile                                         | 4 ++--
 ...{imx6dl-wandboard-revb1.dts => imx6dl-wandboard-revd1.dts} | 4 ++--
 .../{imx6q-wandboard-revb1.dts => imx6q-wandboard-revd1.dts}  | 4 ++--
 configs/wandboard_defconfig                                   | 4 ++--
 4 files changed, 8 insertions(+), 8 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%)
arch/arm/dts/Makefile +2 -2
index 820ee9733a..2a71917c92 100644
@@ -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 \
arch/arm/dts/imx6dl-wandboard-revd1.dts renamed from arch/arm/dts/imx6dl-wandboard-revb1.dts +2 -2
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
@@ -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 {
arch/arm/dts/imx6q-wandboard-revd1.dts renamed from arch/arm/dts/imx6q-wandboard-revb1.dts +2 -2
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
@@ -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 {
configs/wandboard_defconfig +2 -3
index 82e517b90f..ee70758f3a 100644
@@ -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