ID of (former "National") TI's PHY DP83848

2018-04-27 Thread Juergen Borleis
the device itself has no interrupt line (and uses the same phy ID)? How to deal with the same Phy ID used for different devices and different features? Cheers, Juergen PS: please keep me on CC as I'm not subscribed to the netdev list. -- Pengutronix e.K.                           

Re: [PATCH v2 net-next 2/3] net: dsa: lan9303: define LAN9303_NUM_PORTS 3

2017-08-01 Thread Juergen Borleis
> /* 13.2 System Control and Status Registers > * Multiply register number by 4 to get address offset. > */ Maybe we should put this macro into a shared location because in "net/dsa/tag_lan9303.c" there is already a "#define LAN9303_MAX_PORTS 3". jb -- Pen

Re: [PATCH v2 net-next 0/4] net: dsa: lan9303: Fix MDIO issues.

2017-07-31 Thread Juergen Borleis
my setup still works. Tested-by: Juergen Borleis Cheers Juergen -- Pengutronix e.K.                             | Juergen Borleis             | Industrial Linux Solutions                   | http://www.pengutronix.de/  |

Re: [PATCH net-next] net: dsa: LAN9303: add i2c dependency

2017-04-24 Thread Juergen Borleis
depends on NET_DSA > + depends on NET_DSA && I2C > select NET_DSA_SMSC_LAN9303 > select REGMAP_I2C > ---help--- Thanks, but already found and fixed by Arnd Bergmann. jb -- Pengutronix e.K.                            | Juergen Borleis             | Industrial Linux Solutions                  | http://www.pengutronix.de/  |

Re: [PATCH net-next] net: dsa: Remove redundant NULL dst check

2017-04-21 Thread Juergen Borleis
e *dev, struct dsa_switch *ds; > unsigned int source_port; > > - if (unlikely(!dst)) { > - dev_warn_ratelimited(&dev->dev, "Dropping packet, due to > missing switch tree device\n"); > - return NULL; > - } > - >

Re: [PATCHv5] net: dsa: add SMSC/Microchip LAN9303 three port ethernet switch driver

2017-04-18 Thread Juergen Borleis
r SPI). I've now compile time tested all module and static variants (hopefully) and run-time tested the static variant and the I2C module variant. jb -- Pengutronix e.K.                            | Juergen Borleis             | Industrial Linux Solutions                  | http://www.pengutronix.de/  |

[PATCH v6 4/4] net: dsa: LAN9303: add MDIO managed mode support

2017-04-18 Thread Juergen Borleis
When the LAN9303 device is in MDIO manged mode, all register accesses must be done via MDIO. Please note: this code is compile time tested only due to the absence of such configured hardware. It is based on a patch from Stefan Roese from 2014. Signed-off-by: Juergen Borleis CC: devicet

[PATCH v6 3/4] net: dsa: LAN9303: add I2C managed mode support

2017-04-18 Thread Juergen Borleis
In this mode the switch device and the internal phys will be managed via I2C interface. The MDIO interface is still supported, but for the (emulated) CPU port only. Signed-off-by: Juergen Borleis CC: devicet...@vger.kernel.org CC: robh...@kernel.org CC: mark.rutl...@arm.com --- .../devicetree

[PATCHv6] net: dsa: add SMSC/Microchip LAN9303 three port ethernet switch driver

2017-04-18 Thread Juergen Borleis
The LAN9303 is a three port 10/100 ethernet switch with integrated phys for the two external ethernet ports. The third port is an RMII/MII interface to a host master network interface (e.g. fixed link). While the LAN9303 device itself supports offload packet processing, this driver does not make u

[PATCH v6 2/4] net: dsa: add new DSA switch driver for the SMSC-LAN9303

2017-04-18 Thread Juergen Borleis
The SMSC/Microchip LAN9303 is an ethernet switch device with one CPU port and two external ethernet ports with built-in phys. This driver uses the DSA framework, but is currently only capable of separating the two external ports. There is no offload support yet. Signed-off-by: Juergen Borleis

[PATCH v6 1/4] net: dsa: add support for the SMSC-LAN9303 tagging format

2017-04-18 Thread Juergen Borleis
ontrol the destination and the source of an ethernet packet. Signed-off-by: Juergen Borleis --- include/net/dsa.h | 1 + net/dsa/Kconfig | 4 ++ net/dsa/Makefile | 1 + net/dsa/dsa.c | 3 ++ net/dsa/dsa_priv.h| 3 ++ net/dsa/tag_lan93

[PATCH v5 3/4] net: dsa: LAN9303: add I2C managed mode support

2017-04-13 Thread Juergen Borleis
In this mode the switch device and the internal phys will be managed via I2C interface. The MDIO interface is still supported, but for the (emulated) CPU port only. Signed-off-by: Juergen Borleis Reviewed-by: Andrew Lunn CC: devicet...@vger.kernel.org CC: robh...@kernel.org CC: mark.rutl

[PATCHv5] net: dsa: add SMSC/Microchip LAN9303 three port ethernet switch driver

2017-04-13 Thread Juergen Borleis
The LAN9303 is a three port 10/100 ethernet switch with integrated phys for the two external ethernet ports. The third port is an RMII/MII interface to a host master network interface (e.g. fixed link). While the LAN9303 device itself supports offload packet processing, this driver does not make u

[PATCH v5 4/4] net: dsa: LAN9303: add MDIO managed mode support

2017-04-13 Thread Juergen Borleis
When the LAN9303 device is in MDIO manged mode, all register accesses must be done via MDIO. Please note: this code is compile time tested only due to the absence of such configured hardware. It is based on a patch from Stefan Roese from 2014. Signed-off-by: Juergen Borleis Reviewed-by: Andrew

[PATCH v5 2/4] net: dsa: add new DSA switch driver for the SMSC-LAN9303

2017-04-13 Thread Juergen Borleis
The SMSC/Microchip LAN9303 is an ethernet switch device with one CPU port and two external ethernet ports with built-in phys. This driver uses the DSA framework, but is currently only capable of separating the two external ports. There is no offload support yet. Signed-off-by: Juergen Borleis

[PATCH v5 1/4] net: dsa: add support for the SMSC-LAN9303 tagging format

2017-04-13 Thread Juergen Borleis
ontrol the destination and the source of an ethernet packet. Signed-off-by: Juergen Borleis --- include/net/dsa.h | 1 + net/dsa/Kconfig | 4 ++ net/dsa/Makefile | 1 + net/dsa/dsa.c | 3 ++ net/dsa/dsa_priv.h| 3 ++ net/dsa/tag_lan93

Re: [PATCHv4] net: dsa: add SMSC/Microchip LAN9303 three port ethernet switch driver

2017-04-13 Thread Juergen Borleis
gt; > Actually, this doesn't even build. Please fix this and resubmit. Sorry, did a temporary fix in 'dsa_priv.h'a and so this missing #include slipped through. Fix in v5 is coming soon. Regards, Juergen -- Pengutronix e.K.                             | Ju

[PATCH v3 2/4] net: dsa: add new DSA switch driver for the SMSC-LAN9303

2017-04-12 Thread Juergen Borleis
The SMSC/Microchip LAN9303 is an ethernet switch device with one CPU port and two external ethernet ports with built-in phys. This driver uses the DSA framework, but is currently only capable of separating the two external ports. There is no offload support yet. Signed-off-by: Juergen Borleis

[PATCHv4] net: dsa: add SMSC/Microchip LAN9303 three port ethernet switch driver

2017-04-12 Thread Juergen Borleis
The LAN9303 is a three port 10/100 ethernet switch with integrated phys for the two external ethernet ports. The third port is an RMII/MII interface to a host master network interface (e.g. fixed link). While the LAN9303 device itself supports offload packet processing, this driver does not make u

[PATCH v3 4/4] net: dsa: LAN9303: add MDIO managed mode support

2017-04-12 Thread Juergen Borleis
When the LAN9303 device is in MDIO manged mode, all register accesses must be done via MDIO. Please note: this code is compile time tested only due to the absence of such configured hardware. It is based on a patch from Stefan Roese from 2014. Signed-off-by: Juergen Borleis Reviewed-by: Andrew

[PATCH v3 3/4] net: dsa: LAN9303: add I2C managed mode support

2017-04-12 Thread Juergen Borleis
In this mode the switch device and the internal phys will be managed via I2C interface. The MDIO interface is still supported, but for the (emulated) CPU port only. Signed-off-by: Juergen Borleis Reviewed-by: Andrew Lunn CC: devicet...@vger.kernel.org CC: robh...@kernel.org CC: mark.rutl

[PATCH v3 1/4] net: dsa: add support for the SMSC-LAN9303 tagging format

2017-04-12 Thread Juergen Borleis
ontrol the destination and the source of an ethernet packet. Signed-off-by: Juergen Borleis --- include/net/dsa.h | 1 + net/dsa/Kconfig | 4 ++ net/dsa/Makefile | 1 + net/dsa/dsa.c | 3 ++ net/dsa/dsa_priv.h| 3 ++ net/dsa/tag_lan93

[PATCH v3 2/4] net: dsa: add new DSA switch driver for the SMSC-LAN9303

2017-04-11 Thread Juergen Borleis
The SMSC/Microchip LAN9303 is an ethernet switch device with one CPU port and two external ethernet ports with built-in phys. This driver uses the DSA framework, but is currently only capable of separating the two external ports. There is no offload support yet. Signed-off-by: Juergen Borleis

[PATCH v3 1/4] net: dsa: add support for the SMSC-LAN9303 tagging format

2017-04-11 Thread Juergen Borleis
ontrol the destination and the source of an ethernet packet. Signed-off-by: Juergen Borleis --- include/net/dsa.h | 1 + net/dsa/Kconfig | 3 + net/dsa/Makefile | 1 + net/dsa/dsa.c | 3 + net/dsa/dsa_priv.h| 3 + net/dsa/tag_lan93

[PATCHv3] net: dsa: add SMSC/Microchip LAN9303 three port ethernet switch driver

2017-04-11 Thread Juergen Borleis
The LAN9303 is a three port 10/100 ethernet switch with integrated phys for the two external ethernet ports. The third port is an RMII/MII interface to a host master network interface (e.g. fixed link). While the LAN9303 device itself supports offload packet processing, this driver does not make u

[PATCH v3 3/4] net: dsa: LAN9303: add I2C managed mode support

2017-04-11 Thread Juergen Borleis
In this mode the switch device and the internal phys will be managed via I2C interface. The MDIO interface is still supported, but for the (emulated) CPU port only. Signed-off-by: Juergen Borleis CC: devicet...@vger.kernel.org CC: robh...@kernel.org CC: mark.rutl...@arm.com --- .../devicetree

[PATCH v3 4/4] net: dsa: LAN9303: add MDIO managed mode support

2017-04-11 Thread Juergen Borleis
When the LAN9303 device is in MDIO manged mode, all register accesses must be done via MDIO. Please note: this code is compile time tested only due to the absence of such configured hardware. It is based on a patch from Stefan Roese from 2014. Signed-off-by: Juergen Borleis CC: devicet

Re: [PATCH v2 3/4] net: dsa: LAN9303: add I2C managed mode support

2017-04-10 Thread Juergen Borleis
reg = <1>; > > + label = "lan1; > > + }; > > These are not PHY nodes, so does this compatible string do anything? I removed them and nothing changed. Regards, Juergen -- Pengutronix e.K.                             | Juergen Borleis             | Industrial Linux Solutions                  | http://www.pengutronix.de/  |

Re: [PATCH v2 2/4] net: dsa: add new DSA switch driver for the SMSC-LAN9303

2017-04-10 Thread Juergen Borleis
es (MDIO emulation case): Generic PHY 63fec000.etherne:00: attached PHY driver [Generic PHY] (mii_bus:phy_addr=63fec000.etherne:00, irq=-1) And for the fixed-link case: Generic PHY fixed-0:00: attached PHY driver [Generic PHY] (mii_bus:phy_addr=fixed-0:00, irq=-1) Regards, Juergen -- Pe

Re: [PATCH v2 1/4] net: dsa: add support for the SMSC-LAN9303 tagging format

2017-04-10 Thread Juergen Borleis
Hi Andrew, On Friday 07 April 2017 15:06:10 Andrew Lunn wrote: > On Fri, Apr 07, 2017 at 10:14:59AM +0200, Juergen Borleis wrote: > > To define the outgoing port and to discover the incoming port a regular > > VLAN tag is used by the LAN9303. But its VID meaning is 'specia

[PATCH v2 2/4] net: dsa: add new DSA switch driver for the SMSC-LAN9303

2017-04-07 Thread Juergen Borleis
The SMSC/Microchip LAN9303 is an ethernet switch device with one CPU port and two external ethernet ports with built-in phys. This driver uses the DSA framework, but is currently only capable of separating the two external ports. There is no offload support yet. Signed-off-by: Juergen Borleis

[PATCH v2 3/4] net: dsa: LAN9303: add I2C managed mode support

2017-04-07 Thread Juergen Borleis
In this mode the switch device and the internal phys will be managed via I2C interface. The MDIO interface is still supported, but for the (emulated) CPU port only. Signed-off-by: Juergen Borleis --- .../devicetree/bindings/net/dsa/lan9303.txt| 64 drivers/net/dsa/Kconfig

[PATCH v2 4/4] net: dsa: LAN9303: add MDIO managed mode support

2017-04-07 Thread Juergen Borleis
When the LAN9303 device is in MDIO manged mode, all register accesses must be done via MDIO. Please note: this code is *untested* yet due to the absence of such configured hardware. It is based on a patch of Stefan Roese from 2014. Signed-off-by: Juergen Borleis --- .../devicetree/bindings/net

[PATCH v2 1/4] net: dsa: add support for the SMSC-LAN9303 tagging format

2017-04-07 Thread Juergen Borleis
ontrol the destination and the source of an ethernet packet. Signed-off-by: Juergen Borleis --- include/net/dsa.h | 1 + net/dsa/Kconfig | 3 + net/dsa/Makefile | 1 + net/dsa/dsa.c | 3 + net/dsa/dsa_priv.h| 3 + net/dsa/tag_lan93

[PATCHv2] net: dsa: add SMSC/Microchip LAN9303 three port ethernet switch driver

2017-04-07 Thread Juergen Borleis
The LAN9303 is a three port 10/100 ethernet switch with integrated phys for the two external ethernet ports. The third port is an RMII/MII interface to a host master network interface (e.g. fixed link). While the LAN9303 device itself supports offload packet processing, this driver does not make u

Re: [PATCH 3/4] net: dsa: LAN9303: add I2C managed mode support

2017-04-06 Thread Juergen Borleis
#address-cells = <1>; > > + #size-cells = <0>; > > + > > + port@0 { /* RMII fixed link to master */ > > + reg = <0>; > > + label = "cpu"; > > + ethernet = <&master>; > > + max-speed = <100>; > > max-speed does not do anything i think, since there is no adjust_link > function. Removed in v2. Thanks. Juergen -- Pengutronix e.K.                            | Juergen Borleis             | Industrial Linux Solutions                  | http://www.pengutronix.de/  |

Re: [PATCH 2/4] net: dsa: add new DSA switch driver for the SMSC-LAN9303

2017-04-06 Thread Juergen Borleis
em in conjunction with calling lan9303_port_disable(). In v2 I do not > > touch the phy anymore. > > So this is touching the BMCR_PDOWN bit? Using the #define would of > helped explain this. Okay. Juergen -- Pengutronix e.K.                            | Juergen Borleis             | Industrial Linux Solutions                   | http://www.pengutronix.de/  |

Re: [PATCH 1/4] net: dsa: add support for the SMSC-LAN9303 tagging format

2017-04-06 Thread Juergen Borleis
tween the MAC addresses > > +* and the current ethertype field. > > +*/ > > + skb_pull_rcsum(skb, 2 + 2); > > + memmove(skb->data - ETH_HLEN, skb->data - (ETH_HLEN + LAN9303_TAG_LEN), > > + 2 * ETH_ALEN); > > + skb_push(skb, ETH_HL

Re: [PATCH 2/4] net: dsa: add new DSA switch driver for the SMSC-LAN9303

2017-04-06 Thread Juergen Borleis
ilt-in PHYs :) Juergen -- Pengutronix e.K.                            | Juergen Borleis             | Industrial Linux Solutions                  | http://www.pengutronix.de/  |

Re: [PATCH 2/4] net: dsa: add new DSA switch driver for the SMSC-LAN9303

2017-04-06 Thread Juergen Borleis
return -ENODEV; > > + } > > + > > + return rc; > > +} > > + > > +static void lan9303_port_disable(struct dsa_switch *ds, int port, > > +struct phy_device *phy) > > +{ > > + struct lan9303 *chip = ds_to_lan9303(ds); > > + int rc; > > + > > + /* disable internal data handling */ > > + switch (port) { > > + case 1: > > + rc = lan9303_phy_reg_write(chip, chip->phy_addr_sel_strap + 1, > > + 0, BIT(14) | BIT(11)); > > + rc += lan9303_write_switch_reg(chip, LAN9303_MAC_RX_CFG_1, > > + 0x02); > > + rc += lan9303_write_switch_reg(chip, LAN9303_MAC_TX_CFG_1, > > + 0x56); > > It seems odd that port_enable does not touch the PHY, but port_disable > does. What is this doing? My experience is, the framework powers up the phys by its own in conjunction with calling lan9303_port_enable(), but do not power down them in conjunction with calling lan9303_port_disable(). In v2 I do not touch the phy anymore. > [...] > > +static int lan9303_register_phys(struct lan9303 *chip) > > This one place where the switch is being called a phy. Renamed in v2. > [...] > > +static void lan9303_probe_reset_gpio(struct lan9303 *chip, > > +struct device_node *np) > > +{ > > + chip->reset_gpio = devm_gpiod_get_optional(chip->dev, "phy-reset", > > This is a reset for the switch, not a PHY in the switch i think. We > have established a bit of a standard in DSA drivers to just call this > "reset". Renamed in v2. Thanks Juergen -- Pengutronix e.K.                            | Juergen Borleis             | Linux Solutions for Science and Industry    | Phone: +49-5121-206917-5128 | Peiner Str. 6-8, 31137 Hildesheim, Germany  | Fax:   +49-5121-206917- | Amtsgericht Hildesheim, HRA 2686            | http://www.pengutronix.de/  |

[PATCH 2/4] net: dsa: add new DSA switch driver for the SMSC-LAN9303

2017-04-05 Thread Juergen Borleis
The SMSC/Microchip LAN9303 is an ethernet switch device with one CPU port and two external ethernet ports with built-in phys. This driver uses the DSA framework, but is currently only capable of separating the two external ports. There is no offload support yet. Signed-off-by: Juergen Borleis

[PATCH 3/4] net: dsa: LAN9303: add I2C managed mode support

2017-04-05 Thread Juergen Borleis
In this mode the switch device and the internal phys will be managed via I2C interface. The MDIO interface is still supported, but for the (emulated) CPU port only. Signed-off-by: Juergen Borleis --- .../devicetree/bindings/net/dsa/lan9303.txt| 74 ++ drivers/net/phy

[PATCH 4/4] net: dsa: LAN9303: add MDIO managed mode support

2017-04-05 Thread Juergen Borleis
When the LAN9303 device is in MDIO manged mode, all register accesse must be done via MDIO. Please note: this code is *untested* yet due to the absence of such configured hardware. It is based on a patch of Stefan Roese from 2014. Signed-off-by: Juergen Borleis --- .../devicetree/bindings/net

net: dsa: add SMSC/Microchip LAN9303 three port ethernet switch driver

2017-04-05 Thread Juergen Borleis
The LAN9303 is a three port 10/100 ethernet switch with integrated phys for the two external ethernet ports. The third port is an RMII/MII interface to a host master network interface (e.g. fixed link). While the LAN9303 device itself supports offload packet processing, this driver does not make u

[PATCH 1/4] net: dsa: add support for the SMSC-LAN9303 tagging format

2017-04-05 Thread Juergen Borleis
ontrol the destination and the source of an ethernet packet. Signed-off-by: Juergen Borleis --- include/net/dsa.h | 1 + net/dsa/Kconfig | 3 + net/dsa/Makefile | 1 + net/dsa/dsa.c | 3 + net/dsa/dsa_priv.h| 3 + net/dsa/tag_lan93