[PATCH v4 2/3] lan78xx: Read LED states from Device Tree

2018-04-19 Thread Phil Elwell
available. Signed-off-by: Phil Elwell <p...@raspberrypi.org> Reviewed-by: Andrew Lunn <and...@lunn.ch> --- MAINTAINERS | 1 + drivers/net/phy/microchip.c | 25 ++ drivers/net/usb/lan78xx.c

[PATCH v4 0/3] lan78xx: Read configuration from Device Tree

2018-04-19 Thread Phil Elwell
. Phil Elwell (3): lan78xx: Read MAC address from DT if present lan78xx: Read LED states from Device Tree dt-bindings: Document the DT bindings for lan78xx .../devicetree/bindings/net/microchip,lan78xx.txt | 54 MAINTAINERS| 2

[PATCH v4 3/3] dt-bindings: Document the DT bindings for lan78xx

2018-04-19 Thread Phil Elwell
in a bindings file. Signed-off-by: Phil Elwell <p...@raspberrypi.org> Reviewed-by: Andrew Lunn <and...@lunn.ch> --- .../devicetree/bindings/net/microchip,lan78xx.txt | 54 ++ MAINTAINERS| 1 + 2 files changed, 55 insertion

[PATCH v4 1/3] lan78xx: Read MAC address from DT if present

2018-04-19 Thread Phil Elwell
There is a standard mechanism for locating and using a MAC address from the Device Tree. Use this facility in the lan78xx driver to support applications without programmed EEPROM or OTP. At the same time, regularise the handling of the different address sources. Signed-off-by: Phil Elwell &l

[PATCH resend v3 0/3] lan78xx: Read configuration from Device Tree

2018-04-19 Thread Phil Elwell
EEE support. Phil Elwell (3): lan78xx: Read MAC address from DT if present lan78xx: Read LED states from Device Tree dt-bindings: Document the DT bindings for lan78xx .../devicetree/bindings/net/microchip,lan78xx.txt | 54 MAINTAINERS

[PATCH resend v3 2/3] lan78xx: Read LED states from Device Tree

2018-04-19 Thread Phil Elwell
available. Signed-off-by: Phil Elwell <p...@raspberrypi.org> --- MAINTAINERS | 1 + drivers/net/phy/microchip.c | 25 ++ drivers/net/usb/lan78xx.c | 32 - include/dt-bindin

[PATCH resend v3 1/3] lan78xx: Read MAC address from DT if present

2018-04-19 Thread Phil Elwell
There is a standard mechanism for locating and using a MAC address from the Device Tree. Use this facility in the lan78xx driver to support applications without programmed EEPROM or OTP. At the same time, regularise the handling of the different address sources. Signed-off-by: Phil Elwell &l

[PATCH resend v3 3/3] dt-bindings: Document the DT bindings for lan78xx

2018-04-19 Thread Phil Elwell
in a bindings file. Signed-off-by: Phil Elwell <p...@raspberrypi.org> --- .../devicetree/bindings/net/microchip,lan78xx.txt | 54 ++ MAINTAINERS| 1 + 2 files changed, 55 insertions(+) create mode 100644 Documentation/devicetree/bi

[PATCH v3 0/3] lan78xx: Read configuration from Device Tree

2018-04-19 Thread Phil Elwell
for reading the MAC address and LED modes from Device Tree. v3: - Move LED setting into PHY driver. v2: - Use eth_platform_get_mac_address. - Support up to 4 LEDs, and move LED mode constants into dt-bindings header. - Improve bindings document. - Remove EEE support. Phil Elwell (3): lan78xx: Read MAC

[PATCH v3 1/3] lan78xx: Read MAC address from DT if present

2018-04-19 Thread Phil Elwell
There is a standard mechanism for locating and using a MAC address from the Device Tree. Use this facility in the lan78xx driver to support applications without programmed EEPROM or OTP. At the same time, regularise the handling of the different address sources. Signed-off-by: Phil Elwell &l

[PATCH v3 2/3] lan78xx: Read LED states from Device Tree

2018-04-19 Thread Phil Elwell
available. Signed-off-by: Phil Elwell <p...@raspberrypi.org> --- MAINTAINERS | 1 + drivers/net/phy/microchip.c | 25 ++ drivers/net/usb/lan78xx.c | 32 - include/dt-bindin

[PATCH v3 0/3] lan78xx: Read configuration from Device Tree

2018-04-19 Thread Phil Elwell
for reading the MAC address and LED modes from Device Tree. v3: - Move LED setting into PHY driver. v2: - Use eth_platform_get_mac_address. - Support up to 4 LEDs, and move LED mode constants into dt-bindings header. - Improve bindings document. - Remove EEE support. Phil Elwell (3): lan78xx: Read MAC

[PATCH v3 3/3] dt-bindings: Document the DT bindings for lan78xx

2018-04-19 Thread Phil Elwell
in a bindings file. Signed-off-by: Phil Elwell <p...@raspberrypi.org> --- .../devicetree/bindings/net/microchip,lan78xx.txt | 54 ++ MAINTAINERS| 1 + 2 files changed, 55 insertions(+) create mode 100644 Documentation/devicetree/bi

[PATCH v2 2/3] lan78xx: Read LED states from Device Tree

2018-04-18 Thread Phil Elwell
available. Signed-off-by: Phil Elwell <p...@raspberrypi.org> --- MAINTAINERS | 1 + drivers/net/usb/lan78xx.c| 35 include/dt-bindings/net/microchip-78xx.h | 21 +++ 3 files changed, 57 insertions

[PATCH v2 3/3] dt-bindings: Document the DT bindings for lan78xx

2018-04-18 Thread Phil Elwell
in a bindings file. Signed-off-by: Phil Elwell <p...@raspberrypi.org> --- .../devicetree/bindings/net/microchip,lan78xx.txt | 44 ++ MAINTAINERS| 1 + 2 files changed, 45 insertions(+) create mode 100644 Documentation/devicetree/bi

[PATCH v2 1/3] lan78xx: Read MAC address from DT if present

2018-04-18 Thread Phil Elwell
There is a standard mechanism for locating and using a MAC address from the Device Tree. Use this facility in the lan78xx driver to support applications without programmed EEPROM or OTP. At the same time, regularise the handling of the different address sources. Signed-off-by: Phil Elwell &l

[PATCH v2 0/3] lan78xx: Read configuration from Device Tree

2018-04-18 Thread Phil Elwell
for reading the MAC address and LED modes from Device Tree. v2: - Use eth_platform_get_mac_address. - Support up to 4 LEDs, and move LED mode constants into dt-bindings header. - Improve bindings document. - Remove EEE support. Phil Elwell (3): lan78xx: Read MAC address from DT if present lan78xx

Re: [PATCH 4/4] dt-bindings: Document the DT bindings for lan78xx

2018-04-17 Thread Phil Elwell
On 16/04/2018 20:22, Rob Herring wrote: > On Thu, Apr 12, 2018 at 02:55:36PM +0100, Phil Elwell wrote: >> The Microchip LAN78XX family of devices are Ethernet controllers with >> a USB interface. Despite being discoverable devices it can be useful to >> be able to configure

Re: [PATCH 2/4] lan78xx: Read initial EEE setting from Device Tree

2018-04-12 Thread Phil Elwell
Andrew, On 12/04/2018 15:16, Andrew Lunn wrote: > On Thu, Apr 12, 2018 at 02:55:34PM +0100, Phil Elwell wrote: >> Add two new Device Tree properties: >> * microchip,eee-enabled - a boolean to enable EEE >> * microchip,tx-lpi-timer - time in microseconds

Re: [PATCH 4/4] dt-bindings: Document the DT bindings for lan78xx

2018-04-12 Thread Phil Elwell
Hi Andrew, On 12/04/2018 15:30, Andrew Lunn wrote: > On Thu, Apr 12, 2018 at 02:55:36PM +0100, Phil Elwell wrote: >> The Microchip LAN78XX family of devices are Ethernet controllers with >> a USB interface. Despite being discoverable devices it can be useful to >> be able t

Re: [PATCH 3/4] lan78xx: Read LED modes from Device Tree

2018-04-12 Thread Phil Elwell
Hi Andrew, On 12/04/2018 15:26, Andrew Lunn wrote: > On Thu, Apr 12, 2018 at 02:55:35PM +0100, Phil Elwell wrote: >> Add support for DT property "microchip,led-modes", a vector of two >> cells (u32s) in the range 0-15, each of which sets the mode for one >> of the

Re: [PATCH 1/4] lan78xx: Read MAC address from DT if present

2018-04-12 Thread Phil Elwell
Hi Andrew, On 12/04/2018 15:06, Andrew Lunn wrote: > Hi Phil > >> -ret = lan78xx_write_reg(dev, RX_ADDRL, addr_lo); >> -ret = lan78xx_write_reg(dev, RX_ADDRH, addr_hi); >> +mac_addr = of_get_mac_address(dev->udev->dev.of_node); > > It might be

Re: [PATCH 4/4] dt-bindings: Document the DT bindings for lan78xx

2018-04-12 Thread Phil Elwell
Hi Andrew, On 12/04/2018 15:04, Andrew Lunn wrote: > On Thu, Apr 12, 2018 at 02:55:36PM +0100, Phil Elwell wrote: >> The Microchip LAN78XX family of devices are Ethernet controllers with >> a USB interface. Despite being discoverable devices it can be useful to >> be able t

[PATCH 0/4] lan78xx: Read configuration from Device Tree

2018-04-12 Thread Phil Elwell
for reading the MAC address, EEE setting and LED modes from Device Tree. Phil Elwell (4): lan78xx: Read MAC address from DT if present lan78xx: Read initial EEE setting from Device Tree lan78xx: Read LED modes from Device Tree dt-bindings: Document the DT bindings for lan78xx .../devicetree

[PATCH 1/4] lan78xx: Read MAC address from DT if present

2018-04-12 Thread Phil Elwell
There is a standard mechanism for locating and using a MAC address from the Device Tree. Use this facility in the lan78xx driver to support applications without programmed EEPROM or OTP. At the same time, regularise the handling of the different address sources. Signed-off-by: Phil Elwell &l

[PATCH 2/4] lan78xx: Read initial EEE setting from Device Tree

2018-04-12 Thread Phil Elwell
Add two new Device Tree properties: * microchip,eee-enabled - a boolean to enable EEE * microchip,tx-lpi-timer - time in microseconds to wait after TX goes idle before entering the low power state (default 600) Signed-off-by: Phil Elwell &l

[PATCH 3/4] lan78xx: Read LED modes from Device Tree

2018-04-12 Thread Phil Elwell
nk100/1000/activity 5=link10/1000/activity 6=link10/100/activity14=off15=on Also use the presence of the DT property to indicate that the LEDs should be enabled - necessary in the event that no valid OTP or EEPROM is available. Signed-off-by: Phil Elwell <p...@raspberrypi.org> ---

[PATCH 4/4] dt-bindings: Document the DT bindings for lan78xx

2018-04-12 Thread Phil Elwell
in a bindings file, adding it to MAINTAINERS at the same time. Signed-off-by: Phil Elwell <p...@raspberrypi.org> --- .../devicetree/bindings/net/microchip,lan78xx.txt | 44 ++ MAINTAINERS| 1 + 2 files changed, 45 insertions(+)

Re: [PATCH] lan78xx: Correctly indicate invalid OTP

2018-04-11 Thread Phil Elwell
Hi Andrew. On 11/04/2018 13:57, Andrew Lunn wrote: > On Wed, Apr 11, 2018 at 10:59:17AM +0100, Phil Elwell wrote: >> lan78xx_read_otp tries to return -EINVAL in the event of invalid OTP >> content, but the value gets overwritten before it is returned and the >> read go

[PATCH] lan78xx: Avoid spurious kevent 4 "error"

2018-04-11 Thread Phil Elwell
events directly, relying on the subsequent deferral of the EVENT_LINK_RESET call to schedule the work. Take the same precaution with EVENT_STAT_UPDATE to avoid a totally unnecessary error message. Signed-off-by: Phil Elwell <p...@raspberrypi.org> --- drivers/net/usb/lan78xx.c | 2 +-

[PATCH] lan78xx: Correctly indicate invalid OTP

2018-04-11 Thread Phil Elwell
lan78xx_read_otp tries to return -EINVAL in the event of invalid OTP content, but the value gets overwritten before it is returned and the read goes ahead anyway. Make the read conditional as it should be and preserve the error code. Signed-off-by: Phil Elwell <p...@raspberrypi.org> --- d

Re: [PATCH] lan78xx: Don't reset the interface on open

2018-04-10 Thread Phil Elwell
Hi Nisar, On 10/04/2018 15:16, nisar.sa...@microchip.com wrote: > Thanks Phil, for identifying the issues. > >> -ret = lan78xx_reset(dev); >> -if (ret < 0) >> -goto done; >> - >> phy_start(net->phydev); >> >> netif_dbg(dev, ifup, dev->net, "phy initialised

[PATCH] lan78xx: Don't reset the interface on open

2018-04-10 Thread Phil Elwell
h the link is up), rendering the interface unusable. Fix this issue by removing the lan78xx_reset call from lan78xx_open. Fixes: 92571a1aae40 ("lan78xx: Connect phy early") Signed-off-by: Phil Elwell <p...@raspberrypi.org> --- drivers/net/usb/lan78xx.c | 4 1 file changed,