1
0
Fork 0
Commit Graph

9 Commits (b1a17513a2d60f9e933016bed04d0eeb8651a915)

Author SHA1 Message Date
Andrew Lunn dc9d38cec7 net: phy: mdio-gpio: Add phy_ignore_ta_mask to platform data
The Marvell 6390 Ethernet switch family does not perform MDIO
turnaround correctly. Many hardware MDIO bus masters don't care about
this, but the bitbangging implementation in Linux does by default. Add
phy_ignore_ta_mask to the platform data so that the bitbangging code
can be told which devices are known to get TA wrong.

v2
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>

Signed-off-by: David S. Miller <davem@davemloft.net>
2018-12-08 21:33:30 -08:00
Andrew Lunn 04fa26bab0 net: phy: mdio-gpio: Add platform_data support for phy_mask
It is sometimes necessary to instantiate a bit-banging MDIO bus as a
platform device, without the aid of device tree.

When device tree is being used, the bus is not scanned for devices,
only those devices which are in device tree are probed. Without device
tree, by default, all addresses on the bus are scanned. This may then
find a device which is not a PHY, e.g. a switch. And the switch may
have registers containing values which look like a PHY. So during the
scan, a PHY device is wrongly created.

After the bus has been registered, a search is made for
mdio_board_info structures which indicates devices on the bus, and the
driver which should be used for them. This is typically used to
instantiate Ethernet switches from platform drivers.  However, if the
scanning of the bus has created a PHY device at the same location as
indicated into the board info for a switch, the switch device is not
created, since the address is already busy.

This can be avoided by setting the phy_mask of the mdio bus. This mask
prevents addresses on the bus being scanned.

v2
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>

Signed-off-by: David S. Miller <davem@davemloft.net>
2018-12-08 21:33:30 -08:00
Andrew Lunn 0207dd1173 net: phy: mdio-gpio: Remove redundant platform data header
The platform data header file is now unused. Remove it, but add
an extra include which it brought in.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-04-19 15:59:11 -04:00
Andrew Lunn c82fc4814a net: phy: mdio-gpio: Swap to using gpio descriptors
This simplifies the code, removing the need to handle active low
flags, etc.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-04-19 15:59:11 -04:00
Andrew Lunn 68abb4f25d net: phy: mdio-gpio: Remove support for IRQs in platform data
No current devices use IRQs in platform data, so remove support for
it. The MDIO core will also initialise the new bus such that all
addresses are polled, so remove the unneeded re-initialisation.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-04-19 15:59:11 -04:00
Andrew Lunn 185a16b60a net: phy: mdio-gpio: remove support for phy mask
This is not needed any more by devices using platform data, so remove
it.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-04-19 15:59:11 -04:00
Andrew Lunn c1b3eb0468 net: phy: mdio-gpio: remove support for ignoring turn around
This is not needed any more by devices using platform data, so remove
it.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-04-19 15:59:10 -04:00
Andrew Lunn 9e4d60938a net: phy: mdio-gpio: Remove reset function
The platform data can contain a function to call to reset
the bit banging interface. It is not used, so remove it.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-04-19 15:59:10 -04:00
Vivien Didelot e2aacd963a net: mdio-gpio: move platform data header
This header file only contains the platform data structure definition,
so move it to the include/linux/platform_data/ directory.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-10-21 19:50:44 -07:00