Skip to contentSkip to conversation

net: phy: Add the Airoha EN8811H PHY driver

PATCH Superseded Lucien.Jheng 2 participants 5 messages Jun 15, 2025 – Jun 30, 2025

Subsystems (2)

v2 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 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.

Linux upstream AIROHA EN8811H driver commit:
71e79430117d56c409c5ea485a263bc0d8083390

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 v2:
air_en8811h.c:
* Fix: Indentation and coding style
* Fix: Invert conditionals in some APIs to reduce indent.
* Correct en8811h_read_fw(): Integrate malloc to allow other users to
fully override the loading process and return a buffer containing the firmware from its source.

 drivers/net/phy/Kconfig       |  43 ++
 drivers/net/phy/Makefile      |   1 +
 drivers/net/phy/air_en8811h.c | 857 ++++++++++++++++++++++++++++++++++
 3 files changed, 901 insertions(+)
 create mode 100644 drivers/net/phy/air_en8811h.c
drivers/net/phy/Kconfig +43 -0
index 3132718e4f8..f053f8196c2 100644
@@ -79,6 +79,49 @@ config PHY_ADIN
 	help
 		Add support for configuring RGMII on Analog Devices ADIN PHYs.
 
+menuconfig PHY_AIROHA
+	bool "Airoha Ethernet PHYs support"
+
+config PHY_AIROHA_EN8811H
+	bool "Airoha Ethernet EN8811H support"
+	depends on PHY_AIROHA
+	help
+	  AIROHA EN8811H supported.
+
+choice
+	prompt "Location of the Airoha PHY firmware"
+	default PHY_AIROHA_FW_IN_MMC
+	depends on PHY_AIROHA_EN8811H
+
+config PHY_AIROHA_FW_IN_MMC
+	bool "Airoha firmware in MMC partition"
+	help
+	  Airoha PHYs use firmware which can be loaded automatically
+	  from storage directly attached to the PHY, and then loaded
+	  via MDIO commands by the boot loader. The firmware is loaded
+	  from a file specified by the PHY_AIROHA_FW_PART,
+	  PHY_AIROHA_FW_DM_FILEPATH and PHY_AIROHA_FW_DSP_FILEPATH options.
+
+config PHY_AIROHA_FW_PART
+	string "Airoha firmware partition"
+	depends on PHY_AIROHA_FW_IN_MMC
+	help
+	  Partition containing the firmware file.
+
+config PHY_AIROHA_FW_DM_FILEPATH
+	string "Airoha firmware DM file path in the filesystem"
+	depends on PHY_AIROHA_FW_IN_MMC
+	help
+	  Specify Airoha firmware DM file path in the filesystem.
+
+config PHY_AIROHA_FW_DSP_FILEPATH
+	string "Airoha firmware DSP file path in the filesystem"
+	depends on PHY_AIROHA_FW_IN_MMC
+	help
+	  Specify Airoha firmware DSP file path in the filesystem.
+
+endchoice
+
 menuconfig PHY_AQUANTIA
 	bool "Aquantia Ethernet PHYs support"
 	select PHY_GIGE
drivers/net/phy/Makefile +1 -0
index 2487f366e1c..87dee3c15b9 100644
@@ -11,6 +11,7 @@ obj-$(CONFIG_MV88E6352_SWITCH) += mv88e6352.o
 obj-$(CONFIG_PHYLIB) += phy.o
 obj-$(CONFIG_PHYLIB_10G) += generic_10g.o
 obj-$(CONFIG_PHY_ADIN) += adin.o
+obj-$(CONFIG_PHY_AIROHA_EN8811H) += air_en8811h.o
 obj-$(CONFIG_PHY_AQUANTIA) += aquantia.o
 obj-$(CONFIG_PHY_ATHEROS) += atheros.o
 obj-$(CONFIG_PHY_BROADCOM) += broadcom.o
drivers/net/phy/air_en8811h.c new file +857 -0

857 lines not on this page · raw message

--
2.34.1

#1 lore raw
Quoted 53 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.

Linux upstream AIROHA EN8811H driver commit:
71e79430117d56c409c5ea485a263bc0d8083390

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 v2:
air_en8811h.c:
* Fix: Indentation and coding style
* Fix: Invert conditionals in some APIs to reduce indent.
* Correct en8811h_read_fw(): Integrate malloc to allow other users to
fully override the loading process and return a buffer containing the firmware from its source.

  drivers/net/phy/Kconfig       |  43 ++
  drivers/net/phy/Makefile      |   1 +
  drivers/net/phy/air_en8811h.c | 857 ++++++++++++++++++++++++++++++++++
  3 files changed, 901 insertions(+)

create mode 100644 drivers/net/phy/air_en8811h.c

drivers/net/phy/Kconfig +12 -0
index 3132718e4f8..f053f8196c2 100644
@@ -79,6 +79,49 @@ config PHY_ADIN
  	help
  		Add support for configuring RGMII on Analog Devices ADIN PHYs.
 
+menuconfig PHY_AIROHA
+	bool "Airoha Ethernet PHYs support"
+
+config PHY_AIROHA_EN8811H
+	bool "Airoha Ethernet EN8811H support"
+	depends on PHY_AIROHA
+	help
+	  AIROHA EN8811H supported.
+
+choice
+	prompt "Location of the Airoha PHY firmware"
+	default PHY_AIROHA_FW_IN_MMC

drivers/net/phy/Kconfig config PHY_ADIN · line 103

Quoted 10 lines
drivers/net/phy/Kconfig +10 -0
+	depends on PHY_AIROHA_EN8811H
+
+config PHY_AIROHA_FW_IN_MMC
+	bool "Airoha firmware in MMC partition"
+	help
+	  Airoha PHYs use firmware which can be loaded automatically
+	  from storage directly attached to the PHY, and then loaded
+	  via MDIO commands by the boot loader. The firmware is loaded
+	  from a file specified by the PHY_AIROHA_FW_PART,
+	  PHY_AIROHA_FW_DM_FILEPATH and PHY_AIROHA_FW_DSP_FILEPATH options.

I ran into the same firmware loading problem recently. I took a different approach, have a look at [1] and specifically function rcar_gen4_pcie_load_firmware() . This invokes U-Boot shell script , which has to be defined by the user, and which loads the firmware by whatever means necessary, from whatever storage or location . I think that might be the generic approach to U-Boot firmware loading . If the user needs to change the firmware loading location, they do not need to rebuild the U-Boot itself, they simply update their environment and the matching script. What do you think ?

[1] https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

#2 lore raw

Marek Vasut 於 2025/6/29 下午 10:31 寫道:

Quoted 66 lines · Lucien.Jheng
Quoted 53 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.

Linux upstream AIROHA EN8811H driver commit:
71e79430117d56c409c5ea485a263bc0d8083390

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 v2:
air_en8811h.c:
  * Fix: Indentation and coding style
  * Fix: Invert conditionals in some APIs to reduce indent.
  * Correct en8811h_read_fw(): Integrate malloc to allow other users to
    fully override the loading process and return a buffer containing the firmware from its source.

  drivers/net/phy/Kconfig       |  43 ++ drivers/net/phy/Makefile      |   1 + drivers/net/phy/air_en8811h.c | 857 ++++++++++++++++++++++++++++++++++

  3 files changed, 901 insertions(+)

  create mode 100644 drivers/net/phy/air_en8811h.c

drivers/net/phy/Kconfig +0 -0
index 3132718e4f8..f053f8196c2 100644
@@ -79,6 +79,49 @@ config PHY_ADIN

      help
          Add support for configuring RGMII on Analog Devices ADIN PHYs.

drivers/net/phy/Kconfig +12 -0
+menuconfig PHY_AIROHA
+    bool "Airoha Ethernet PHYs support"
+
+config PHY_AIROHA_EN8811H
+    bool "Airoha Ethernet EN8811H support"
+    depends on PHY_AIROHA
+    help
+      AIROHA EN8811H supported.
+
+choice
+    prompt "Location of the Airoha PHY firmware"
+    default PHY_AIROHA_FW_IN_MMC

drivers/net/phy/Kconfig config PHY_ADIN · line 103

Quoted 10 lines
drivers/net/phy/Kconfig +10 -0
+    depends on PHY_AIROHA_EN8811H
+
+config PHY_AIROHA_FW_IN_MMC
+    bool "Airoha firmware in MMC partition"
+    help
+      Airoha PHYs use firmware which can be loaded automatically
+      from storage directly attached to the PHY, and then loaded
+      via MDIO commands by the boot loader. The firmware is loaded
+      from a file specified by the PHY_AIROHA_FW_PART,
+      PHY_AIROHA_FW_DM_FILEPATH and PHY_AIROHA_FW_DSP_FILEPATH options.

I ran into the same firmware loading problem recently. I took a different approach, have a look at [1] and specifically function rcar_gen4_pcie_load_firmware() . This invokes U-Boot shell script , which has to be defined by the user, and which loads the firmware by whatever means necessary, from whatever storage or location . I think that might be the generic approach to U-Boot firmware loading . If the user needs to change the firmware loading location, they do not need to rebuild the U-Boot itself, they simply update their environment and the matching script. What do you think ?

Quoted 2 lines

[1] https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

Hi Marek

I've looked at the rcar_gen4_pcie_load_firmware API. As you mentioned, it allows users to set the storage and location from the U-Boot shell, meaning they don't need to recompile U-Boot.

However, I recently checked out FS_LOADER and realized it's essentially the same approach as how I'm currently placing firmware on eMMC, just with a unified API(request_firmware_into_buf).

I'm wondering if there's a future possibility to integrate U-Boot shell scripts into FS_LOADER?

Also, given that the Kernel has a built-in firmware mechanism where files are compiled directly into the Kernel image, I'm curious if U-Boot might adopt a similar approach in the future. I'm also considering if binman_sym could be a viable alternative.

For the short term, though, I'll go ahead and submit the EN8811H firmware loading method using the rcar_gen4_pcie_load_firmware approach. I'll then explore potential improvements later.

Thanks!

#3 lore raw

On 6/29/25 6:10 PM, Lucien.Jheng wrote:

Hi,

I'm sorry for my abysmally slow response.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

+config PHY_AIROHA_FW_IN_MMC
+    bool "Airoha firmware in MMC partition"
+    help
+      Airoha PHYs use firmware which can be loaded automatically +      from storage directly attached to the PHY, and then loaded +      via MDIO commands by the boot loader. The firmware is loaded +      from a file specified by the PHY_AIROHA_FW_PART,
+      PHY_AIROHA_FW_DM_FILEPATH and PHY_AIROHA_FW_DSP_FILEPATH options.

Quoted 7 lines
Quoted 3 lines

I ran into the same firmware loading problem recently. I took a different approach, have a look at [1] and specifically function rcar_gen4_pcie_load_firmware() . This invokes U-Boot shell script , which has to be defined by the user, and which loads the firmware by whatever means necessary, from whatever storage or location . I think that might be the generic approach to U-Boot firmware loading . If the user needs to change the firmware loading location, they do not need to rebuild the U-Boot itself, they simply update their environment and the matching script. What do you think ?

[1] https://patchwork.ozlabs.org/project/uboot/ patch/[email protected]/

Hi Marek

I've looked at the rcar_gen4_pcie_load_firmware API. As you mentioned, it allows users to set the storage and location from the U-Boot shell, meaning they don't need to recompile U-Boot.

Yes, that's the goal there.

Quoted 3 lines

However, I recently checked out FS_LOADER and realized it's essentially the same approach as how I'm currently placing firmware on eMMC, just with a unified API(request_firmware_into_buf).

I'm wondering if there's a future possibility to integrate U-Boot shell scripts into FS_LOADER?

I think it would be ideal to have one unified firmware loading code, so the answer to the "if" part of the question is "yes".

I have yet to think about the "how" part. If you want to give it a try, please do.

Quoted 1 line

Also, given that the Kernel has a built-in firmware mechanism where files are compiled directly into the Kernel image, I'm curious if U-Boot might adopt a similar approach in the future. I'm also considering if binman_sym could be a viable alternative.

I'm not a lawyer. My understanding of this firmware bundling is, that this is a legal minefield which is better avoided, and also causes redistribution problems with prebuilt U-boot binaries. You end up bundling together GPL code (U-Boot) and non-GPL code (firmware blobs), and the final license of the result is unclear to me.

+CC Vagrant, since they have insight into this from Debian side.

Quoted 1 line

For the short term, though, I'll go ahead and submit the EN8811H firmware loading method using the rcar_gen4_pcie_load_firmware approach. I'll then explore potential improvements later.

Please wait a bit for input from the others. Also keep in mind, that rcar_gen4_pcie_load_firmware() is non-generic interface specific to that one driver, you would have to implement something similar in this driver , with different variable names .

#4 lore raw

Marek Vasut 於 2025/6/30 上午 06:49 寫道:

Quoted 6 lines · Lucien.Jheng

Hi,

I'm sorry for my abysmally slow response.

Thank you very much for your reply and sharing; I've learned a lot.

Quoted 27 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

+config PHY_AIROHA_FW_IN_MMC
+    bool "Airoha firmware in MMC partition"
+    help
+      Airoha PHYs use firmware which can be loaded automatically +      from storage directly attached to the PHY, and then loaded +      via MDIO commands by the boot loader. The firmware is loaded +      from a file specified by the PHY_AIROHA_FW_PART, +      PHY_AIROHA_FW_DM_FILEPATH and PHY_AIROHA_FW_DSP_FILEPATH options.

Quoted 7 lines
Quoted 3 lines

I ran into the same firmware loading problem recently. I took a different approach, have a look at [1] and specifically function rcar_gen4_pcie_load_firmware() . This invokes U-Boot shell script , which has to be defined by the user, and which loads the firmware by whatever means necessary, from whatever storage or location . I think that might be the generic approach to U-Boot firmware loading . If the user needs to change the firmware loading location, they do not need to rebuild the U-Boot itself, they simply update their environment and the matching script. What do you think ?

[1] https://patchwork.ozlabs.org/project/uboot/ patch/[email protected]/

Hi Marek

I've looked at the rcar_gen4_pcie_load_firmware API. As you mentioned, it allows users to set the storage and location from the U-Boot shell, meaning they don't need to recompile U-Boot.

Yes, that's the goal there.

Quoted 3 lines

However, I recently checked out FS_LOADER and realized it's essentially the same approach as how I'm currently placing firmware on eMMC, just with a unified API(request_firmware_into_buf).

I'm wondering if there's a future possibility to integrate U-Boot shell scripts into FS_LOADER?

I think it would be ideal to have one unified firmware loading code, so the answer to the "if" part of the question is "yes".

I have yet to think about the "how" part. If you want to give it a try, please do.

Quoted 8 lines
Quoted 1 line

Also, given that the Kernel has a built-in firmware mechanism where files are compiled directly into the Kernel image, I'm curious if U-Boot might adopt a similar approach in the future. I'm also considering if binman_sym could be a viable alternative.

I'm not a lawyer. My understanding of this firmware bundling is, that this is a legal minefield which is better avoided, and also causes redistribution problems with prebuilt U-boot binaries. You end up bundling together GPL code (U-Boot) and non-GPL code (firmware blobs), and the final license of the result is unclear to me.

+CC Vagrant, since they have insight into this from Debian side.

Quoted 1 line

For the short term, though, I'll go ahead and submit the EN8811H firmware loading method using the rcar_gen4_pcie_load_firmware approach. I'll then explore potential improvements later.

Please wait a bit for input from the others. Also keep in mind, that rcar_gen4_pcie_load_firmware() is non-generic interface specific to that one driver, you would have to implement something similar in this driver , with different variable names .

Okay, I'll wait a bit for feedback from others. Thanks!