Skip to contentSkip to conversation

sunxi: a523: enable Ethernet

PATCH In review Andre Przywara 3 participants 6 messages Aug 1, 2025 – Aug 11, 2025

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

cover sunxi: a523: enable Ethernet

The first of the two Ethernet controllers in the Allwinner A527/T527 SoCs is compatible to the IP used in the A64 SoC, which our MAC driver already supports. Since the recent DT update brought us the DT description of the network interface, enable the driver and thus Ethernet functionality on the two boards that work.
Patch 1/2 fixes the function name for the RGMII pins in the pinctrl driver, while patch 2/2 just enables building the sun8i-emac driver.

Please have a look and test!

Cheers,
Andre

Andre Przywara (2):
pinctrl: sunxi: a523: change Ethernet pin function name
sunxi: a527: radxa/avaota: enable Ethernet

 configs/avaota-a1_defconfig           | 2 ++
 configs/radxa-cubie-a5e_defconfig     | 2 ++
 drivers/pinctrl/sunxi/pinctrl-sunxi.c | 2 +-
 3 files changed, 5 insertions(+), 1 deletion(-)
Signature · 1 line
2.46.3
#1 lore raw

PATCH 1/2 pinctrl: sunxi: a523: change Ethernet pin function name

The name of the pin function was changed last minute in the DT, from emac0 to gmac0.
Adjust the name we use in the pinctrl driver accordingly.

---
 drivers/pinctrl/sunxi/pinctrl-sunxi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/sunxi/pinctrl-sunxi.c +1 -1
index 03cfe23aaf8..fd357ab0d4e 100644
@@ -760,7 +760,7 @@ static const struct sunxi_pinctrl_desc __maybe_unused sun50i_h616_pinctrl_desc =
 };
 
 static const struct sunxi_pinctrl_function sun55i_a523_pinctrl_functions[] = {
-	{ "emac0",	5 },	/* PI0-PI16 */
+	{ "gmac0",	5 },	/* PI0-PI16 */
 	{ "gpio_in",	0 },
 	{ "gpio_out",	1 },
 	{ "mmc0",	2 },	/* PF0-PF5 */
Signature · 1 line
2.46.3
maintainer Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] pinctrl: sunxi: a523: change Ethernet pin function name

Dne petek, 1. avgust 2025 ob 02:27:25 Srednjeevropski poletni čas je Andre Przywara napisal(a):

Quoted 5 lines

The name of the pin function was changed last minute in the DT, from emac0 to gmac0.
Adjust the name we use in the pinctrl driver accordingly.

Best regards,
Jernej

Quoted 18 lines
---
 drivers/pinctrl/sunxi/pinctrl-sunxi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/sunxi/pinctrl-sunxi.c +1 -1
index 03cfe23aaf8..fd357ab0d4e 100644
@@ -760,7 +760,7 @@ static const struct sunxi_pinctrl_desc __maybe_unused sun50i_h616_pinctrl_desc =
 };
 
 static const struct sunxi_pinctrl_function sun55i_a523_pinctrl_functions[] = {
-	{ "emac0",	5 },	/* PI0-PI16 */
+	{ "gmac0",	5 },	/* PI0-PI16 */
 	{ "gpio_in",	0 },
 	{ "gpio_out",	1 },
 	{ "mmc0",	2 },	/* PF0-PF5 */
#3 lore raw

PATCH 2/2 sunxi: a527: radxa/avaota: enable Ethernet

In reply to Andre Przywara

The first of the two Ethernet controllers in the Allwinner A527/T527 is compatible to the MAC from the previous SoCs. Consequently the recent DT update brought use the MAC node, using the A64 compatible string as the fallback, which works out of the box.

Enable the sun8i-emac Ethernet driver in the defconfig for the Radxa and the Avaota boards, so that kernels and other data can be loaded via TFTP. Please note that only one of the Ethernet sockets will work, the second MAC is not compatible, and needs a new U-Boot driver. The X96QPro+ TV box unfortunately uses only this second EMAC, so Ethernet cannot be used there at the moment.

---
 configs/avaota-a1_defconfig       | 2 ++
 configs/radxa-cubie-a5e_defconfig | 2 ++
 2 files changed, 4 insertions(+)
configs/avaota-a1_defconfig +2 -0
index 55457edd3b3..a4582c00d5b 100644
@@ -22,6 +22,8 @@ CONFIG_SYS_I2C_MVTWSI=y
 CONFIG_SYS_I2C_SLAVE=0x7f
 CONFIG_SYS_I2C_SPEED=400000
 CONFIG_SUPPORT_EMMC_BOOT=y
+CONFIG_PHY_REALTEK=y
+CONFIG_SUN8I_EMAC=y
 CONFIG_REGULATOR_AXP=y
 CONFIG_AXP717_POWER=y
 CONFIG_AXP_I2C_ADDRESS=0x35
configs/radxa-cubie-a5e_defconfig +2 -0
index 88019acf576..9d204ef5548 100644
@@ -22,6 +22,8 @@ CONFIG_SYS_I2C_MVTWSI=y
 CONFIG_SYS_I2C_SLAVE=0x7f
 CONFIG_SYS_I2C_SPEED=400000
 CONFIG_SUPPORT_EMMC_BOOT=y
+CONFIG_PHY_REALTEK=y
+CONFIG_SUN8I_EMAC=y
 CONFIG_REGULATOR_AXP=y
 CONFIG_AXP717_POWER=y
 CONFIG_AXP_DCDC2_VOLT=920
Signature · 1 line
2.46.3
maintainer Reviewed-by on v1 2/2
#4 lore raw

Re: [PATCH 2/2] sunxi: a527: radxa/avaota: enable Ethernet

Dne petek, 1. avgust 2025 ob 02:27:26 Srednjeevropski poletni čas je Andre Przywara napisal(a):

Quoted 5 lines

The first of the two Ethernet controllers in the Allwinner A527/T527 is compatible to the MAC from the previous SoCs. Consequently the recent DT update brought use the MAC node, using the A64 compatible string as the fallback, which works out of the box.

Quoted 8 lines

Enable the sun8i-emac Ethernet driver in the defconfig for the Radxa and the Avaota boards, so that kernels and other data can be loaded via TFTP. Please note that only one of the Ethernet sockets will work, the second MAC is not compatible, and needs a new U-Boot driver. The X96QPro+ TV box unfortunately uses only this second EMAC, so Ethernet cannot be used there at the moment.

Best regards,
Jernej

Quoted 32 lines
---
 configs/avaota-a1_defconfig       | 2 ++
 configs/radxa-cubie-a5e_defconfig | 2 ++
 2 files changed, 4 insertions(+)
configs/avaota-a1_defconfig +2 -0
index 55457edd3b3..a4582c00d5b 100644
@@ -22,6 +22,8 @@ CONFIG_SYS_I2C_MVTWSI=y
 CONFIG_SYS_I2C_SLAVE=0x7f
 CONFIG_SYS_I2C_SPEED=400000
 CONFIG_SUPPORT_EMMC_BOOT=y
+CONFIG_PHY_REALTEK=y
+CONFIG_SUN8I_EMAC=y
 CONFIG_REGULATOR_AXP=y
 CONFIG_AXP717_POWER=y
 CONFIG_AXP_I2C_ADDRESS=0x35
configs/radxa-cubie-a5e_defconfig +2 -0
index 88019acf576..9d204ef5548 100644
@@ -22,6 +22,8 @@ CONFIG_SYS_I2C_MVTWSI=y
 CONFIG_SYS_I2C_SLAVE=0x7f
 CONFIG_SYS_I2C_SPEED=400000
 CONFIG_SUPPORT_EMMC_BOOT=y
+CONFIG_PHY_REALTEK=y
+CONFIG_SUN8I_EMAC=y
 CONFIG_REGULATOR_AXP=y
 CONFIG_AXP717_POWER=y
 CONFIG_AXP_DCDC2_VOLT=920
Tested-by on the v1 series
#5 lore raw
In reply to Andre Przywara

Hi Andre,

Quoted 10 lines · Andre Przywara

The first of the two Ethernet controllers in the Allwinner A527/T527 SoCs is compatible to the IP used in the A64 SoC, which our MAC driver already supports. Since the recent DT update brought us the DT description of the network interface, enable the driver and thus Ethernet functionality on the two boards that work.
Patch 1/2 fixes the function name for the RGMII pins in the pinctrl driver, while patch 2/2 just enables building the sun8i-emac driver.

Please have a look and test!

Thanks for pushing this

Quoted 15 lines

Cheers,
Andre

Andre Przywara (2):
pinctrl: sunxi: a523: change Ethernet pin function name
sunxi: a527: radxa/avaota: enable Ethernet

 configs/avaota-a1_defconfig           | 2 ++
 configs/radxa-cubie-a5e_defconfig     | 2 ++
 drivers/pinctrl/sunxi/pinctrl-sunxi.c | 2 +-
 3 files changed, 5 insertions(+), 1 deletion(-)
Signature · 1 line
2.46.3
Signature · 1 line
Yixun Lan (dlan)