Skip to contentSkip to conversation

net: phy: Add the Airoha EN8811H PHY driver

PATCH In review Lucien.Jheng 2 participants 3 messages Nov 11, 2025 – Nov 12, 2025

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

PATCH v6 1/1 net: phy: Add the Airoha EN8811H PHY driver

Add the driver for the Airoha EN8811H 2.5 Gigabit PHY. The PHY supports 100/1000/2500 Mbps with auto negotiation only.

The driver uses two firmware files, for which updated versions are added to linux-firmware already.

Locating the AIROHA FW within the filesystem at the designated partition and path will trigger its automatic loading and writing to the PHY via MDIO. If need board specific loading override,
please override the en8811h_read_fw function on board or architecture level.

Based on the Linux upstream AIROHA EN8811H driver code(air_en8811h.c), I have modified the relevant process to align with the U-Boot boot sequence. and have validated this on Banana Pi BPI-R3 Mini.

---
Change in PATCH v6:
air_en8811.c:
* Use dev_err() instead of printf() for error messages
* Use dev_info() instead of printf() for error messages
* Return actual error code in en8811h_wait_mcu_ready()
* Fix comment formatting for MII Registers Page 4

Change in PATCH v5:
air_en8811.c:
* Add read_page & write_page functions for page access.
* Change fs_loader to fw_loader.
* Remove unnecessary debug prints.

Change in PATCH v4:
air_en8811.c:
* Create the airoha folder to store all future airoha phy drivers.
* Use request_firmware_into_buf_via_script for firmware loading.

Change in PATCH v3:
air_en8811.c:
* Add U-Boot environment variable(en8811h_fw_part, en8811h_fw_dm_dir, en8811h_fw_dsp_dir) support for firmware loading.

Regarding the firmware loading mechanism,
Please refer to the following script example for guidance:
1. `env set en8811h_load_firmware 'env set en8811h_load_firmware_addr 0x46000000 && env set en8811h_load_firmware_size 0x24000 && mw.b ${en8811h_load_firmware_addr} 0 ${en8811h_load_firmware_size} && load mmc 0:3 0x46000000 /boot/EthMD32.dm.bin && if test ${filesize} -eq 4000; then load mmc 0:3 0x46004000 /boot/EthMD32.DSP.bin; else echo "loading MD32 FW failed"; env set en8811h_load_firmware_size 0; exit 1;fi'`

````Test Log````
Net:   16384 bytes read in 1 ms (15.6 MiB/s)
131072 bytes read in 9 ms (13.9 MiB/s)
addr: 0x46000000, size: 0x24000
Found Airoha Firmware.
MD32 firmware version: 24112802
````End of Test Log````

2. `env set en8811h_load_firmware 'env set en8811h_load_firmware_addr 0x46000000 && env set en8811h_load_firmware_size 0x24000 && mmc partconf 0 1 2 2 && mmc read $en8811h_load_firmware_addr 0x0 0x120 && mmc partconf 0 1 1 0'`

````Test Log````
Net:   MMC read: dev # 0, block # 0, count 288 ... 288 blocks read: OK
addr: 0x46000000, size: 0x24000
Found Airoha Firmware.
MD32 firmware version: 24112802
````End of Test Log````
 drivers/net/phy/Kconfig             |   2 +
 drivers/net/phy/Makefile            |   1 +
 drivers/net/phy/airoha/Kconfig      |  11 +
 drivers/net/phy/airoha/Makefile     |   3 +
 drivers/net/phy/airoha/air_en8811.c | 805 ++++++++++++++++++++++++++++
 5 files changed, 822 insertions(+)
 create mode 100644 drivers/net/phy/airoha/Kconfig
 create mode 100644 drivers/net/phy/airoha/Makefile
 create mode 100644 drivers/net/phy/airoha/air_en8811.c
drivers/net/phy/Kconfig +2 -0
index 018be98705a..b254a0f4591 100644
@@ -188,6 +188,8 @@ config PHY_MARVELL_10G
 
 source "drivers/net/phy/mediatek/Kconfig"
 
+source "drivers/net/phy/airoha/Kconfig"
+
 config PHY_MESON_GXL
 	bool "Amlogic Meson GXL Internal PHY support"
 
drivers/net/phy/Makefile +1 -0
index a339b8ac29d..83520de7f1f 100644
@@ -22,6 +22,7 @@ obj-$(CONFIG_PHY_LXT) += lxt.o
 obj-$(CONFIG_PHY_MARVELL) += marvell.o
 obj-$(CONFIG_PHY_MARVELL_10G) += marvell10g.o
 obj-y += mediatek/
+obj-y += airoha/
 obj-$(CONFIG_PHY_MICREL_KSZ8XXX) += micrel_ksz8xxx.o
 obj-$(CONFIG_PHY_MICREL_KSZ90X1) += micrel_ksz90x1.o
 obj-$(CONFIG_PHY_MESON_GXL) += meson-gxl.o
drivers/net/phy/airoha/Kconfig new file +11 -0
new file mode 100644
index 00000000000..999564e4848
@@ -0,0 +1,11 @@
+# SPDX-License-Identifier: GPL-2.0-only
+menuconfig PHY_AIROHA
+	bool "Airoha Ethernet PHYs support"
+
+config PHY_AIROHA_EN8811
+	bool "Airoha Ethernet EN8811H support"
+	depends on PHY_AIROHA
+	select FW_LOADER
+	help
+	  AIROHA EN8811H supported.
+
drivers/net/phy/airoha/Makefile new file +3 -0
new file mode 100644
index 00000000000..84d23b19ab0
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: GPL-2.0
+
+obj-$(CONFIG_PHY_AIROHA_EN8811) += air_en8811.o
drivers/net/phy/airoha/air_en8811.c new file +805 -0

805 lines not on this page · raw message

--
2.34.1

Reviewed-by on v6 1/1
#1 lore raw
Quoted 11 lines · Lucien.Jheng

Add the driver for the Airoha EN8811H 2.5 Gigabit PHY. The PHY supports 100/1000/2500 Mbps with auto negotiation only.

The driver uses two firmware files, for which updated versions are added to linux-firmware already.

Locating the AIROHA FW within the filesystem at the designated partition and path will trigger its automatic loading and writing to the PHY via MDIO. If need board specific loading override,
please override the en8811h_read_fw function on board or architecture level.

Quoted 5 lines

Based on the Linux upstream AIROHA EN8811H driver code(air_en8811h.c), I have modified the relevant process to align with the U-Boot boot sequence. and have validated this on Banana Pi BPI-R3 Mini.

Thank you !

#2 lore raw

Hi Marek

Marek Vasut 於 2025/11/11 上午 09:03 寫道:

Quoted 12 lines · Lucien.Jheng
Quoted 11 lines

Add the driver for the Airoha EN8811H 2.5 Gigabit PHY. The PHY supports 100/1000/2500 Mbps with auto negotiation only.

The driver uses two firmware files, for which updated versions are added to linux-firmware already.

Locating the AIROHA FW within the filesystem at the designated partition and path will trigger its automatic loading and writing to the PHY via MDIO. If need board specific loading override,
please override the en8811h_read_fw function on board or architecture level.

Quoted 8 lines
Quoted 5 lines

Based on the Linux upstream AIROHA EN8811H driver code(air_en8811h.c), I have modified the relevant process to align with the U-Boot boot sequence. and have validated this on Banana Pi BPI-R3 Mini.

Thank you !

Thank you for the detailed review !!!!