Skip to contentSkip to conversation

ARM: imx: Auto-detect PHY on Data Modul i.MX8M Mini/Plus eDM SBC

PATCH Applied Marek Vasut 2 participants 3 messages Jan 1, 2024 – Jan 8, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: imx: Auto-detect PHY on Data Modul i.MX8M Mini/Plus eDM SBC

Implement fdtdec_board_setup() auto-detection of ethernet PHY. This uses properties of the hardware and pull resistor placement.

If GPIO1_16 RGMII_MDC is HIGH, then R530 (MX8MM eDM SBC) or R390 (MX8MP eDM SBC) is populated. R530 or R390 is populated only on boards with AR8031 PHY.

If GPIO1_16 RGMII_MDC is LOW, then the in-SoM pull down is the dominant pull resistor. This is the case on boards with BCM54213PE PHY.

In case AR8031 PHY is populated, the PHY MDIO address is 0, in case BCM54213PE PHY is populated, the PHY MDIO address is 1, the fdtdec_board_setup() is used to patch the correct address into the U-Boot control DT.

Enable broadcom PHY support to support both PHYs.

---
Cc: "NXP i.MX U-Boot Team" <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: Stefano Babic <[email protected]>

---
 .../dts/imx8mp-data-modul-edm-sbc-u-boot.dtsi |  6 ---
 .../imx8mm_data_modul_edm_sbc.c               | 42 ++++++++++++++++
 .../imx8mp_data_modul_edm_sbc.c               | 50 +++++++++++++++++++
 configs/imx8mm_data_modul_edm_sbc_defconfig   |  1 +
 configs/imx8mp_data_modul_edm_sbc_defconfig   |  1 +
 5 files changed, 94 insertions(+), 6 deletions(-)
arch/arm/dts/imx8mp-data-modul-edm-sbc-u-boot.dtsi +0 -6
index a2b5976b6bd..cb6ea356fd7 100644
@@ -51,12 +51,6 @@
 	};
 };
 
-&eqos {
-	/delete-property/ assigned-clocks;
-	/delete-property/ assigned-clock-parents;
-	/delete-property/ assigned-clock-rates;
-};
-
 &gpio1 {
 	bootph-pre-ram;
 };
board/data_modul/imx8mm_edm_sbc/imx8mm_data_modul_edm_sbc.c +42 -0

54 lines not on this page · raw message

board/data_modul/imx8mp_edm_sbc/imx8mp_data_modul_edm_sbc.c +50 -0

64 lines not on this page · raw message

configs/imx8mm_data_modul_edm_sbc_defconfig +1 -0
index 6a4244e3084..3f3a79e55af 100644
@@ -197,6 +197,7 @@ CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_SPI_FLASH_MTD=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_ATHEROS=y
+CONFIG_PHY_BROADCOM=y
 CONFIG_DM_MDIO=y
 CONFIG_DM_ETH_PHY=y
 CONFIG_FEC_MXC=y
configs/imx8mp_data_modul_edm_sbc_defconfig +1 -0
index f5914ac2a80..c4e39ff9cb8 100644
@@ -209,6 +209,7 @@ CONFIG_SPI_FLASH_SFDP_SUPPORT=y
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_SPI_FLASH_MTD=y
 CONFIG_PHY_ATHEROS=y
+CONFIG_PHY_BROADCOM=y
 CONFIG_PHY_MICREL=y
 CONFIG_PHY_MICREL_KSZ90X1=y
 CONFIG_DM_MDIO=y
Signature · 1 line
2.43.0
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 12 lines · Marek Vasut

Implement fdtdec_board_setup() auto-detection of ethernet PHY. This uses properties of the hardware and pull resistor placement.

If GPIO1_16 RGMII_MDC is HIGH, then R530 (MX8MM eDM SBC) or R390 (MX8MP eDM SBC) is populated. R530 or R390 is populated only on boards with AR8031 PHY.

If GPIO1_16 RGMII_MDC is LOW, then the in-SoM pull down is the dominant pull resistor. This is the case on boards with BCM54213PE PHY.

Quoted 8 lines

In case AR8031 PHY is populated, the PHY MDIO address is 0, in case BCM54213PE PHY is populated, the PHY MDIO address is 1, the fdtdec_board_setup() is used to patch the correct address into the U-Boot control DT.

Enable broadcom PHY support to support both PHYs.

reviewer Applied
#2 lore raw
In reply to Marek Vasut
Quoted 12 lines · Marek Vasut

Implement fdtdec_board_setup() auto-detection of ethernet PHY. This uses properties of the hardware and pull resistor placement.

If GPIO1_16 RGMII_MDC is HIGH, then R530 (MX8MM eDM SBC) or R390 (MX8MP eDM SBC) is populated. R530 or R390 is populated only on boards with AR8031 PHY.

If GPIO1_16 RGMII_MDC is LOW, then the in-SoM pull down is the dominant pull resistor. This is the case on boards with BCM54213PE PHY.

Quoted 8 lines

In case AR8031 PHY is populated, the PHY MDIO address is 0, in case BCM54213PE PHY is populated, the PHY MDIO address is 1, the fdtdec_board_setup() is used to patch the correct address into the U-Boot control DT.

Enable broadcom PHY support to support both PHYs.

Applied, thanks.