ARM: imx: Add support for iMX6QDL DHCOM DRC02 and DH picoITX
cover ARM: imx: Add support for iMX6QDL DHCOM DRC02 and DH picoITX
This patch series adds support for the DHCOM DRC02 and DH picoITX baseboards by DH electronics.
The two boards can be equipped with different SoMs. The STM32MP15xx based versions are already mainlined. This patch adds support for the iMX6QDL based variants.
Philip Oberfichtner (8):
ARM: imx6: Fix broken DT path in DH board file
ARM: dts: imx: Migrate iMX6QDL DRC02 DTs from Linux
ARM: dts: imx: Migrate iMX6QDL picoITX DTs from Linux
ARM: imx6: Remove CONFIG_FEC_MXC_PHYADDR from DH header
ARM: dts: imx: Simplify fec node for iMX6QDL DHCOM boards
ARM: dts: imx: Configure FEC for iMX6QDL picoITX
ARM: dts: imx: Configure FEC for iMX6QDL DRC02
ARM: imx6: Adapt device tree selection in DH board file
arch/arm/dts/Makefile | 2 + arch/arm/dts/imx6dl-dhcom-picoitx-u-boot.dtsi | 10 ++ arch/arm/dts/imx6dl-dhcom-picoitx.dts | 20 +++ arch/arm/dts/imx6qdl-dhcom-drc02.dtsi | 143 ++++++++++++++++++ arch/arm/dts/imx6qdl-dhcom-pdk2-u-boot.dtsi | 13 -- arch/arm/dts/imx6qdl-dhcom-picoitx.dtsi | 69 +++++++++ arch/arm/dts/imx6qdl-dhcom-u-boot.dtsi | 18 +++ arch/arm/dts/imx6s-dhcom-drc02-u-boot.dtsi | 10 ++ arch/arm/dts/imx6s-dhcom-drc02.dts | 30 ++++ board/dhelectronics/dh_imx6/dh_imx6.c | 26 ++-- configs/dh_imx6_defconfig | 2 +- include/configs/dh_imx6.h | 3 - 12 files changed, 319 insertions(+), 27 deletions(-) create mode 100644 arch/arm/dts/imx6dl-dhcom-picoitx-u-boot.dtsi create mode 100644 arch/arm/dts/imx6dl-dhcom-picoitx.dts create mode 100644 arch/arm/dts/imx6qdl-dhcom-drc02.dtsi create mode 100644 arch/arm/dts/imx6qdl-dhcom-picoitx.dtsi create mode 100644 arch/arm/dts/imx6s-dhcom-drc02-u-boot.dtsi create mode 100644 arch/arm/dts/imx6s-dhcom-drc02.dts
Signature · 1 line
2.34.1
PATCH 1/8 ARM: imx6: Fix broken DT path in DH board file
In the dhelectronics iMX6 board file fix the outdated eeprom path by using a DT label instead.
The label has been newly created for all iMX6QDL DHCOM boards.
---
arch/arm/dts/imx6qdl-dhcom-u-boot.dtsi | 11 +++++++++++ board/dhelectronics/dh_imx6/dh_imx6.c | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-)
arch/arm/dts/imx6qdl-dhcom-u-boot.dtsi +11 -0
@@ -3,6 +3,17 @@ * Copyright (C) 2020 Harald Seiler <[email protected]> */ +/ { + aliases { + eeprom0 = &eeprom0; + }; +}; + +&i2c3 { + eeprom0: eeprom@50 { + }; +}; + ®_usb_otg_vbus { gpio = <&gpio3 31 GPIO_ACTIVE_HIGH>; enable-active-high;
board/dhelectronics/dh_imx6/dh_imx6.c +2 -2
@@ -100,9 +100,9 @@ static int setup_dhcom_mac_from_fuse(void)return 0 ; } - eeprom =ofnode_path ("/soc/aips-bus@2100000/i2c@21a8000/eeprom@50" ); + eeprom =ofnode_get_aliases_node ("eeprom0" );if (!ofnode_valid (eeprom)) { -printf ("Invalid hardware path to EEPROM!\n" ); +printf ("Can't find eeprom0 alias!\n" );return -ENODEV ; }
Signature · 1 line
2.34.1
Re: [PATCH 1/8] ARM: imx6: Fix broken DT path in DH board file
Quoted 1 line · Philip Oberfichtner
In the dhelectronics iMX6 board file fix the outdated eeprom path by
nit: DH electronics
Quoted 5 lines
using a DT label instead.
The label has been newly created for all iMX6QDL DHCOM boards.
Signed-off-by Philip Oberfichtner <[email protected]>
PATCH 2/8 ARM: dts: imx: Migrate iMX6QDL DRC02 DTs from Linux
In reply to Philip OberfichtnerMigrate DH DRC02 device trees from Linux commit 42226c989789 (tag v5.18-rc7). No changes have been made, the DTs are exact copies. Furthermore add the DTB to dh_imx6_defconfig.
---
arch/arm/dts/Makefile | 1 + arch/arm/dts/imx6qdl-dhcom-drc02.dtsi | 143 ++++++++++++++++++++++++++ arch/arm/dts/imx6s-dhcom-drc02.dts | 30 ++++++ configs/dh_imx6_defconfig | 2 +- 4 files changed, 175 insertions(+), 1 deletion(-) create mode 100644 arch/arm/dts/imx6qdl-dhcom-drc02.dtsi create mode 100644 arch/arm/dts/imx6s-dhcom-drc02.dts
arch/arm/dts/Makefile +1 -0
@@ -771,6 +771,7 @@ dtb-y += \ imx6dl-sabreauto.dtb \ imx6dl-sabresd.dtb \ imx6dl-wandboard-revd1.dtb \ + imx6s-dhcom-drc02.dtb endif
arch/arm/dts/imx6qdl-dhcom-drc02.dtsi new file +143 -0
143 lines not on this page · raw message
arch/arm/dts/imx6s-dhcom-drc02.dts new file +30 -0
@@ -0,0 +1,30 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2021 DH electronics GmbH + * + * DHCOM iMX6 variant: + * DHCM-iMX6S-C0800-R102-F0409-E-CAN2-RTC-I-01D2 + * DHCOM PCB number: 493-400 or newer + * DRC02 PCB number: 568-100 or newer + */ +/dts-v1/; + +/* + * The kernel only distinguishes between i.MX6 Quad and DualLite, + * but the Solo is actually a DualLite with only one CPU. So use + * DualLite for the Solo and disable one CPU node. + */ + +#include "imx6dl.dtsi" +#include "imx6qdl-dhcom-som.dtsi" +#include "imx6qdl-dhcom-drc02.dtsi" + +/ { + model = "DH electronics i.MX6S DHCOM on DRC02"; + compatible = "dh,imx6s-dhcom-drc02", "dh,imx6s-dhcom-som", + "fsl,imx6dl"; + + cpus { + /delete-node/ cpu@1; + }; +};
configs/dh_imx6_defconfig +1 -1
@@ -53,7 +53,7 @@ CONFIG_CMD_CACHE=y CONFIG_CMD_TIME=y CONFIG_CMD_EXT4_WRITE=y CONFIG_OF_CONTROL=y -CONFIG_OF_LIST="imx6q-dhcom-pdk2 imx6dl-dhcom-pdk2" +CONFIG_OF_LIST="imx6q-dhcom-pdk2 imx6dl-dhcom-pdk2 imx6s-dhcom-drc02" CONFIG_MULTI_DTB_FIT=y CONFIG_ENV_OVERWRITE=y CONFIG_ENV_IS_IN_SPI_FLASH=y
Signature · 1 line
2.34.1
PATCH 3/8 ARM: dts: imx: Migrate iMX6QDL picoITX DTs from Linux
In reply to Philip OberfichtnerMigrate DH picoITX device trees from Linux commit 42226c989789 (tag v5.18-rc7). No changes have been made, the DTs are exact copies. Furthermore add the DTB to dh_imx6_defconfig.
---
arch/arm/dts/Makefile | 1 + arch/arm/dts/imx6dl-dhcom-picoitx.dts | 20 +++++++ arch/arm/dts/imx6qdl-dhcom-picoitx.dtsi | 69 +++++++++++++++++++++++++ configs/dh_imx6_defconfig | 2 +- 4 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 arch/arm/dts/imx6dl-dhcom-picoitx.dts create mode 100644 arch/arm/dts/imx6qdl-dhcom-picoitx.dtsi
arch/arm/dts/Makefile +1 -0
@@ -738,6 +738,7 @@ dtb-y += \ imx6dl-cubox-i-emmc-som-v15.dtb \ imx6dl-cubox-i-som-v15.dtb \ imx6dl-dhcom-pdk2.dtb \ + imx6dl-dhcom-picoitx.dts \ imx6dl-gw51xx.dtb \ imx6dl-gw52xx.dtb \ imx6dl-gw53xx.dtb \
arch/arm/dts/imx6dl-dhcom-picoitx.dts new file +20 -0
@@ -0,0 +1,20 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2021 DH electronics GmbH + * + * DHCOM iMX6 variant: + * DHCM-iMX6DL-C0800-R102-F0819-E-SD-RTC-T-HS-I-01D2 + * DHCOM PCB number: 493-300 or newer + * PicoITX PCB number: 487-600 or newer + */ +/dts-v1/; + +#include "imx6dl.dtsi" +#include "imx6qdl-dhcom-som.dtsi" +#include "imx6qdl-dhcom-picoitx.dtsi" + +/ { + model = "DH electronics i.MX6DL DHCOM on PicoITX"; + compatible = "dh,imx6dl-dhcom-picoitx", "dh,imx6dl-dhcom-som", + "fsl,imx6dl"; +};
arch/arm/dts/imx6qdl-dhcom-picoitx.dtsi new file +69 -0
69 lines not on this page · raw message
configs/dh_imx6_defconfig +1 -1
@@ -53,7 +53,7 @@ CONFIG_CMD_CACHE=y CONFIG_CMD_TIME=y CONFIG_CMD_EXT4_WRITE=y CONFIG_OF_CONTROL=y -CONFIG_OF_LIST="imx6q-dhcom-pdk2 imx6dl-dhcom-pdk2 imx6s-dhcom-drc02" +CONFIG_OF_LIST="imx6q-dhcom-pdk2 imx6dl-dhcom-pdk2 imx6s-dhcom-drc02 imx6dl-dhcom-picoitx" CONFIG_MULTI_DTB_FIT=y CONFIG_ENV_OVERWRITE=y CONFIG_ENV_IS_IN_SPI_FLASH=y
Signature · 1 line
2.34.1
PATCH 4/8 ARM: imx6: Remove CONFIG_FEC_MXC_PHYADDR from DH header
In reply to Philip OberfichtnerUse phy address from device tree instead of CONFIG_FEC_MXC_PHYADDR from board header. This is required, because the DH picoITX and DRC02 boards require different settings than PDK2. The corresponding 'phy-handle' device tree properties are already there.
I tested this change on picoITX and DRC02, but on PDK2 it is untested.
---
include/configs/dh_imx6.h | 3 --- 1 file changed, 3 deletions(-)
include/configs/dh_imx6.h +0 -3
@@ -30,9 +30,6 @@/* Bootcounter */ #define CONFIG_SYS_BOOTCOUNT_BE -/* FEC ethernet */ -#define CONFIG_FEC_MXC_PHYADDR 7 -/* MMC Configs */ #define CONFIG_SYS_FSL_ESDHC_ADDR 0#define CONFIG_SYS_FSL_USDHC_NUM 3
Signature · 1 line
2.34.1
PATCH 5/8 ARM: dts: imx: Simplify fec node for iMX6QDL DHCOM boards
In reply to Philip OberfichtnerFirstly the fec can now use the regulator reg_eth_vio from imx6qdl-dhcom-som.dtsi instead of defining its own.
Secondly the &fec node is moved to the more generic SoM device tree file, because it can be used by multiple boards.
---
arch/arm/dts/imx6qdl-dhcom-pdk2-u-boot.dtsi | 13 ------------- arch/arm/dts/imx6qdl-dhcom-u-boot.dtsi | 7 +++++++ 2 files changed, 7 insertions(+), 13 deletions(-)
arch/arm/dts/imx6qdl-dhcom-pdk2-u-boot.dtsi +0 -13
@@ -5,19 +5,6 @@ #include "imx6qdl-dhcom-u-boot.dtsi" -/ { - fec_vio: regulator-fec { - compatible = "regulator-fixed"; - - regulator-name = "fec-vio"; - gpio = <&gpio1 7 GPIO_ACTIVE_LOW>; - }; -}; - &fec { phy-reset-gpios = <&gpio3 29 GPIO_ACTIVE_LOW>; - phy-reset-duration = <1>; - phy-reset-post-delay = <10>; - - phy-supply = <&fec_vio>; };
arch/arm/dts/imx6qdl-dhcom-u-boot.dtsi +7 -0
@@ -1,6 +1,7 @@ // SPDX-License-Identifier: (GPL-2.0+) /* * Copyright (C) 2020 Harald Seiler <[email protected]> + * Copyright (C) 2022 Philip Oberfichtner <[email protected]> */ / {
@@ -9,6 +10,12 @@ }; }; +&fec { + phy-reset-duration = <1>; + phy-reset-post-delay = <10>; + phy-supply = <®_eth_vio>; +}; + &i2c3 { eeprom0: eeprom@50 { };
Signature · 1 line
2.34.1
Re: [PATCH 5/8] ARM: dts: imx: Simplify fec node for iMX6QDL DHCOM boards
Quoted 5 lines · Philip Oberfichtner
Firstly the fec can now use the regulator
reg_eth_viofromimx6qdl-dhcom-som.dtsiinstead of defining its own.Secondly the &fec node is moved to the more generic SoM device tree file, because it can be used by multiple boards.
PATCH 6/8 ARM: dts: imx: Configure FEC for iMX6QDL picoITX
In reply to Philip OberfichtnerAdd a u-boot dtsi for configuring the fec node of the DH picoITX.
---
arch/arm/dts/imx6dl-dhcom-picoitx-u-boot.dtsi | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 arch/arm/dts/imx6dl-dhcom-picoitx-u-boot.dtsi
arch/arm/dts/imx6dl-dhcom-picoitx-u-boot.dtsi new file +10 -0
@@ -0,0 +1,10 @@ +// SPDX-License-Identifier: (GPL-2.0+) +/* + * Copyright (C) 2022 Philip Oberfichtner <[email protected]> + */ + +#include "imx6qdl-dhcom-u-boot.dtsi" + +&fec { + phy-reset-gpios = <&gpio5 0 GPIO_ACTIVE_LOW>; +};
Signature · 1 line
2.34.1
Re: [PATCH 6/8] ARM: dts: imx: Configure FEC for iMX6QDL picoITX
Quoted 1 line · Philip Oberfichtner
Add a u-boot dtsi for configuring the fec node of the DH picoITX.
PATCH 7/8 ARM: dts: imx: Configure FEC for iMX6QDL DRC02
In reply to Philip OberfichtnerAdd a u-boot dtsi for configuring the fec node of the DH DRC02.
---
arch/arm/dts/imx6s-dhcom-drc02-u-boot.dtsi | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 arch/arm/dts/imx6s-dhcom-drc02-u-boot.dtsi
arch/arm/dts/imx6s-dhcom-drc02-u-boot.dtsi new file +10 -0
@@ -0,0 +1,10 @@ +// SPDX-License-Identifier: (GPL-2.0+) +/* + * Copyright (C) 2022 Philip Oberfichtner <[email protected]> + */ + +#include "imx6qdl-dhcom-u-boot.dtsi" + +&fec { + phy-reset-gpios = <&gpio5 0 GPIO_ACTIVE_LOW>; +};
Signature · 1 line
2.34.1
Re: [PATCH 7/8] ARM: dts: imx: Configure FEC for iMX6QDL DRC02
Quoted 1 line · Philip Oberfichtner
Add a u-boot dtsi for configuring the fec node of the DH DRC02.
nit: FEC (in caps), means Freescale Ethernet Controller or some such.
PATCH 8/8 ARM: imx6: Adapt device tree selection in DH board file
In reply to Philip OberfichtnerBefore this commit device tree selection could rely solely on differentiating the iMX6 processor variant Q and DL. After adding two new carrier boards, the DRC02 and the picoITX, the interchangeability of SoMs makes this approach infeasible.
It is now required to specify the carrier board (dhcom-drc02, dhcom-picoitx or dhcom-pdk2) at compile time using CONFIG_DEFAULT_DEVICETREE. The SoM is determined at runtime as before.
---
board/dhelectronics/dh_imx6/dh_imx6.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-)
board/dhelectronics/dh_imx6/dh_imx6.c +14 -8
@@ -227,14 +227,20 @@ int checkboard(void)#ifdef CONFIG_MULTI_DTB_FIT int board_fit_config_name_match (const char *name) { -if (is_mx6dq ()) { -if (!strcmp (name,"imx6q-dhcom-pdk2" )) -return 0 ; - }else if (is_mx6sdl ()) { -if (!strcmp (name,"imx6dl-dhcom-pdk2" )) -return 0 ; - } +/* Determine carrier board at compile time and SoM at runtime */ +const size_t size =32 ; +char *car, *som, dt[size]; + + car =strchr (CONFIG_DEFAULT_DEVICE_TREE ,'-' );/* i.e. -dhcom-drc02 */ + + som =is_mx6dq () ?"imx6q" : +is_mx6dl () ?"imx6dl" : +is_mx6solo () ?"imx6s" :NULL ; + +if (!(car && som)) +return -1 ; -return -1 ; +snprintf (dt, size,"%s%s" , som, car); +return strcmp (name, dt); }#endif
Signature · 1 line
2.34.1
Re: [PATCH 8/8] ARM: imx6: Adapt device tree selection in DH board file
On 19/05/2022 08:08, Philip Oberfichtner wrote:
return 0;
Quoted 7 lines
board/dhelectronics/dh_imx6/dh_imx6.c +5
-1- } +/* Determine carrier board at compile time and SoM at runtime */ +const size_t size =32 ; +char *car, *som, dt[size]; + + car =strchr (CONFIG_DEFAULT_DEVICE_TREE ,'-' );/* i.e. -dhcom-drc02 */
board/dhelectronics/dh_imx6/dh_imx6.c int checkboard(void) · line 241
Quoted 7 lines
board/dhelectronics/dh_imx6/dh_imx6.c +7
-0+ + som =is_mx6dq () ?"imx6q" : +is_mx6dl () ?"imx6dl" : +is_mx6solo () ?"imx6s" :NULL ; + +if (!(car && som)) +return -1 ;
Nit: can you return -EINVAL instead of -1?
Re: [PATCH 8/8] ARM: imx6: Adapt device tree selection in DH board file
In reply to Philip OberfichtnerQuoted 20 lines · Philip Oberfichtner
Before this commit device tree selection could rely solely on differentiating the iMX6 processor variant Q and DL. After adding two new carrier boards, the DRC02 and the picoITX, the interchangeability of SoMs makes this approach infeasible.
It is now required to specify the carrier board (dhcom-drc02, dhcom-picoitx or dhcom-pdk2) at compile time using
CONFIG_DEFAULT_DEVICETREE. The SoM is determined at runtime as before.Signed-off-by Philip Oberfichtner <[email protected]>---
board/dhelectronics/dh_imx6/dh_imx6.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-)board/dhelectronics/dh_imx6/dh_imx6.c +0
-0
board/dhelectronics/dh_imx6/dh_imx6.c int checkboard(void) · line 233
Quoted 7 lines
board/dhelectronics/dh_imx6/dh_imx6.c +0
-4@@ -227,14 +227,20 @@ int checkboard(void)#ifdef CONFIG_MULTI_DTB_FIT int board_fit_config_name_match (const char *name) { -if (is_mx6dq ()) { -if (!strcmp (name,"imx6q-dhcom-pdk2" )) -return 0 ; - }else if (is_mx6sdl ()) {
Careful here ^ is_mx6sdl() matches on Solo and DualLite.
Quoted 9 lines
board/dhelectronics/dh_imx6/dh_imx6.c +6
-3-if (!strcmp (name,"imx6dl-dhcom-pdk2" )) -return 0 ; - } +/* Determine carrier board at compile time and SoM at runtime */ +const size_t size =32 ; +char *car, *som, dt[size]; + + car =strchr (CONFIG_DEFAULT_DEVICE_TREE ,'-' );/* i.e. -dhcom-drc02 */ +
board/dhelectronics/dh_imx6/dh_imx6.c int checkboard(void) · line 244
Quoted 10 lines
board/dhelectronics/dh_imx6/dh_imx6.c +8
-1+ som =is_mx6dq () ?"imx6q" : +is_mx6dl () ?"imx6dl" : +is_mx6solo () ?"imx6s" :NULL ; + +if (!(car && som)) +return -1 ; -return -1 ; +snprintf (dt, size,"%s%s" , som, car); +return strcmp (name, dt);
This will break imx6s-dhcom-pdk2 , which used the imx6dl-dhcom-pdk2 DT which was fine, because U-Boot is single core anyway.
Try something like this:
/* Test SoC prefix */
if (is_mx6dq()) {
if (strncmp(name, "imx6q-"))
return -1;
} else if (is_mx6sdl()) {
if (strncmp(name, "imx6s-") && strncmp(name, "imx6dl-"))
return -1;
}/* Test board suffix */
a = strchr(CONFIG_DEFAULT_DEVICE_TREE, '-'); /* i.e. -dhcom-drc02 */ b = strchr(name, '-'); /* i.e. -dhcom-drc02 */
return strcmp(a, b) ? -1 : 0;
I _think_ that should work and cover all combinations. (and of course, pick better variable names than a,b)