net: phy: Add the Airoha EN8811H PHY driver
Subsystems (2)
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
@@ -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
@@ -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
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 theen8811h_read_fwfunction on board or architecture level.Linux upstream AIROHA EN8811H driver commit:
71e79430117d56c409c5ea485a263bc0d8083390Based 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.Signed-off-by Lucien.Jheng <[email protected]>---
Change in PATCH v2:air_en8811h.c:
* Fix: Indentation and coding style
* Fix: Invert conditionals in some APIs to reduce indent.
* Correcten8811h_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.cdrivers/net/phy/Kconfig +12
-0@@ -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]/
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 theen8811h_read_fwfunction on board or architecture level.Linux upstream AIROHA EN8811H driver commit:
71e79430117d56c409c5ea485a263bc0d8083390Based 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.Signed-off-by Lucien.Jheng <[email protected]>---
Change in PATCH v2:air_en8811h.c:
* Fix: Indentation and coding style
* Fix: Invert conditionals in some APIs to reduce indent.
* Correcten8811h_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.cdrivers/net/phy/Kconfig +0
-0@@ -79,6 +79,49 @@ config PHY_ADINhelp
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_MMCdrivers/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!
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 thePHY_AIROHA_FW_PART,
+PHY_AIROHA_FW_DM_FILEPATHandPHY_AIROHA_FW_DSP_FILEPATHoptions.
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_firmwareAPI. 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_LOADERand realized it's essentially the same approach as how I'm currently placing firmware on eMMC, just with a unifiedAPI(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_symcould 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_firmwareapproach. 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 .
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 thePHY_AIROHA_FW_PART, +PHY_AIROHA_FW_DM_FILEPATHandPHY_AIROHA_FW_DSP_FILEPATHoptions.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_firmwareAPI. 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_LOADERand realized it's essentially the same approach as how I'm currently placing firmware on eMMC, just with a unifiedAPI(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_symcould 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_firmwareapproach. 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!