Skip to content

RFC acpi: Add acpi mdio support code

Wang Dongsheng linux-acpi linux-devicetree netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest3 patches 10 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3acpi: Add acpi mdio support codedrivers/acpi/Kconfig drivers/acpi/Makefile drivers/acpi/acpi_mdio.c +2 more+259 -04 replies
2/3net: qcom/emac: split phy_config to mdio bus create and get phy devicedrivers/net/ethernet/qualcomm/emac/emac-phy.c+56 -400 replies
3/3net: qcom/emac: add phy-handle support for ACPIdrivers/net/ethernet/qualcomm/emac/emac-mac.c drivers/net/ethernet/qualcomm/emac/emac-phy.c+70 -270 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/3] acpi: Add acpi mdio support code

Originally I just push "phy-handle" support for ACPI on the QCOM QDF2400 platform. After some discussion and following Andrew's advice, I send out with a generic version of ACPI.

Current there is no clear documentation about MDIO/PHY for ACPI, so when I reading some documents about ACPI [1], I think we just need to reuse the DT binding in the ACPI.[2]. However, this series of patches are not fully compatible with all contents specified in DT binding.

The most important thing about this iseries is link the phy device and fwnode of acpi. Besides, we need to carry out bus scan at the mdio register. Therefore, I am not compatible with more DT binding properties in this series of patches. More support will be in the follow-up patches support, or some people do the support.

Example:
Based on ACPI doc:
Documentation/acpi/dsd/data-node-references.txt Documentation/acpi/dsd/graph.txt
With _DSD device properties we can finally do this:

    Device (MDIO) {
        Name (_DSD, Package () {
            ToUUID("dbb8e3e6-5886-4ba6-8795-1319f52a966b"),
            Package () { Package () { "ethernet-phy@0", PHY0 }, }
        })
        Name (PHY0, Package() {
            ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
            Package () { Package () { "reg", 0x0 }, }
        })
    }

    Device (MACO) {
        Name (_DSD, Package () {
            ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
            Package () { Package () { "phy-handle", \_SB.MDIO, "ethernet-phy@0" }, }
        })
    }

Tested: QDF2400 (ACPI), buildin/insmod/rmmod

[1]:
Documentation/acpi/dsd/data-node-references.txt
Documentation/acpi/dsd/graph.txt

[2]:
Documentation/devicetree/bindings/phy/phy-bindings.txt
https://lore.kernel.org/patchwork/patch/597296/

Wang Dongsheng (3):
acpi: Add acpi mdio support code
net: qcom/emac: split phy_config to mdio bus create and get phy device
net: qcom/emac: add phy-handle support for ACPI

 drivers/acpi/Kconfig                          |   6 +
 drivers/acpi/Makefile                         |   1 +
 drivers/acpi/acpi_mdio.c                      | 167 ++++++++++++++++++
 drivers/net/ethernet/qualcomm/emac/emac-mac.c |  19 +-
 drivers/net/ethernet/qualcomm/emac/emac-phy.c | 142 ++++++++++-----
 drivers/net/phy/mdio_bus.c                    |   3 +
 include/linux/acpi_mdio.h                     |  82 +++++++++
 7 files changed, 369 insertions(+), 51 deletions(-)
 create mode 100644 drivers/acpi/acpi_mdio.c
 create mode 100644 include/linux/acpi_mdio.h
Signature · 1 line
2.18.0