net/fsl_pq_mdio: Allow explicit speficition of TBIPA address
Subsystems (4)
PATCH 1/2 net/fsl_pq_mdio: Allow explicit speficition of TBIPA address
From: Esben Haabendal <[email protected]>
This introduces a simpler and generic method for for finding (and mapping) the TBIPA register.
Instead of relying of complicated logic for finding the TBIPA register address based on the MDIO or MII register block base
address, which even in some cases relies on undocumented shadow registers, a second "reg" entry for the mdio bus devicetree node specifies the TBIPA register.
Backwards compatibility is kept, as the existing logic is applied when only a single "reg" mapping is specified.
--- .../devicetree/bindings/net/fsl-tsec-phy.txt | 6 ++- drivers/net/ethernet/freescale/fsl_pq_mdio.c | 50 +++++++++++++++------- 2 files changed, 39 insertions(+), 17 deletions(-)
Documentation/devicetree/bindings/net/fsl-tsec-phy.txt +5 -1
@@ -6,7 +6,11 @@ the definition of the PHY node in booting-without-of.txt for an example of how to define a PHY. Required properties: - - reg : Offset and length of the register set for the device + - reg : Offset and length of the register set for the device, and optionally + the offset and length of the TBIPA register (TBI PHY address + register). If TBIPA register is not specified, the driver will + attempt to infer it from the register set specified (your mileage may + vary). - compatible : Should define the compatible device type for the mdio. Currently supported strings/devices are: - "fsl,gianfar-tbi"
drivers/net/ethernet/freescale/fsl_pq_mdio.c +34 -16
68 lines not on this page · raw message
Signature · 1 line
2.16.3
From: Esben Haabendal <[email protected]>
Date: Fri, 6 Apr 2018 14:38:34 +0200
Quoted 11 lines
From: Esben Haabendal <[email protected]>
This introduces a simpler and generic method for for finding (and mapping) the TBIPA register.
Instead of relying of complicated logic for finding the TBIPA register address based on the MDIO or MII register block base
address, which even in some cases relies on undocumented shadow registers, a second "reg" entry for the mdio bus devicetree node specifies the TBIPA register.
Quoted 4 lines
Backwards compatibility is kept, as the existing logic is applied when only a single "reg" mapping is specified.
Signed-off-by Esben Haabendal <[email protected]>
Applied.