mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Juergen Borleis <jbe@pengutronix.de>, netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, kernel@pengutronix.de,
	andrew@lunn.ch, vivien.didelot@savoirfairelinux.com,
	davem@davemloft.net, devicetree@vger.kernel.org,
	robh+dt@kernel.org, mark.rutland@arm.com
Subject: Re: [PATCH v6 3/4] net: dsa: LAN9303: add I2C managed mode support
Date: Thu, 20 Apr 2017 10:38:46 -0700	[thread overview]
Message-ID: <e32156d3-1aa7-6dff-2087-73aa71356207@gmail.com> (raw)
In-Reply-To: <20170418084827.19613-4-jbe@pengutronix.de>

On 04/18/2017 01:48 AM, Juergen Borleis wrote:
> 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 <jbe@pengutronix.de>
> CC: devicetree@vger.kernel.org
> CC: robh+dt@kernel.org
> CC: mark.rutland@arm.com
> ---
>  .../devicetree/bindings/net/dsa/lan9303.txt        |  62 +++++++++++
>  drivers/net/dsa/Kconfig                            |  16 +++
>  drivers/net/dsa/Makefile                           |   2 +
>  drivers/net/dsa/lan9303_i2c.c                      | 113 +++++++++++++++++++++
>  4 files changed, 193 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/net/dsa/lan9303.txt
>  create mode 100644 drivers/net/dsa/lan9303_i2c.c
> 
> diff --git a/Documentation/devicetree/bindings/net/dsa/lan9303.txt b/Documentation/devicetree/bindings/net/dsa/lan9303.txt
> new file mode 100644
> index 0000000000000..2edc2561467a7
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/dsa/lan9303.txt
> @@ -0,0 +1,62 @@
> +SMSC/MicroChip LAN9303 three port ethernet switch
> +-------------------------------------------------
> +
> +Required properties:
> +
> +- compatible: should be "smsc,lan9303-i2c"
> +
> +Optional properties:
> +
> +- reset-gpios: GPIO to be used to reset the whole device
> +- reset-duration: reset duration in milliseconds, defaults to 200 ms
> +
> +Subnodes:
> +
> +The integrated switch subnode should be specified according to the binding
> +described in dsa/dsa.txt. The CPU port of this switch is always port 0.
> +
> +Note: always use 'reg = <0/1/2>;' for the three DSA ports, even if the device is
> +configured to use 1/2/3 instead. This hardware configuration will be
> +auto-detected and mapped accordingly.
> +
> +Example:
> +
> +I2C managed mode:
> +
> +	master: masterdevice@X {
> +		status = "okay";
> +
> +		fixed-link { /* RMII fixed link to LAN9303 */
> +			speed = <100>;
> +			full-duplex;
> +		};
> +	};
> +
> +	switch: switch@a {
> +		compatible = "smsc,lan9303-i2c";
> +		reg = <0xa>;
> +		status = "okay";
> +		reset-gpios = <&gpio7 6 GPIO_ACTIVE_LOW>;
> +		reset-duration = <200>;
> +
> +		ports {
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +
> +			port@0 { /* RMII fixed link to master */
> +				reg = <0>;
> +				label = "cpu";
> +				ethernet = <&master>;
> +			};
> +
> +			port@1 { /* external port 1 */
> +				reg = <1>;
> +				label = "lan1;
> +			};
> +
> +			port@2 { /* external port 2 */
> +				reg = <2>;
> +				label = "lan2";
> +			};
> +		};
> +	};
> diff --git a/drivers/net/dsa/Kconfig b/drivers/net/dsa/Kconfig
> index 31a2b229106dd..c56533bffc8ce 100644
> --- a/drivers/net/dsa/Kconfig
> +++ b/drivers/net/dsa/Kconfig
> @@ -50,4 +50,20 @@ config NET_DSA_MT7530
>  	  This enables support for the Mediatek MT7530 Ethernet switch
>  	  chip.
>  
> +config NET_DSA_SMSC_LAN9303
> +	tristate
> +	select NET_DSA_TAG_LAN9303
> +	---help---
> +	  This enables support for the SMSC/Microchip LAN9303 3 port ethernet
> +	  switch chips.
> +

Should not this hunk ^^^ be part of the previous patch (patch #2)? It's
not a big deal, but it would have been more natural and would allow
building the driver right away even in the absence of bus "glue" modules.

> +config NET_DSA_SMSC_LAN9303_I2C
> +	tristate "SMSC/Microchip LAN9303 3-ports 10/100 ethernet switch in I2C managed mode"
> +	depends on NET_DSA
> +	select NET_DSA_SMSC_LAN9303
> +	select REGMAP_I2C
> +	---help---
> +	  Enable access functions if the SMSC/Microchip LAN9303 is configured
> +	  for I2C managed mode.
> +
>  endmenu
> diff --git a/drivers/net/dsa/Makefile b/drivers/net/dsa/Makefile
> index 2ae07f4fbf635..c1981ba18963f 100644
> --- a/drivers/net/dsa/Makefile
> +++ b/drivers/net/dsa/Makefile
> @@ -3,6 +3,8 @@ obj-$(CONFIG_NET_DSA_BCM_SF2)	+= bcm-sf2.o
>  bcm-sf2-objs			:= bcm_sf2.o bcm_sf2_cfp.o
>  obj-$(CONFIG_NET_DSA_QCA8K)	+= qca8k.o
>  obj-$(CONFIG_NET_DSA_MT7530)	+= mt7530.o
> +obj-$(CONFIG_NET_DSA_SMSC_LAN9303) += lan9303-core.o

Same thing here.

Other than that:

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

  parent reply	other threads:[~2017-04-20 17:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-18  8:48 [PATCHv6] net: dsa: add SMSC/Microchip LAN9303 three port ethernet switch driver Juergen Borleis
2017-04-18  8:48 ` [PATCH v6 1/4] net: dsa: add support for the SMSC-LAN9303 tagging format Juergen Borleis
2017-04-20 17:23   ` Florian Fainelli
2017-04-18  8:48 ` [PATCH v6 2/4] net: dsa: add new DSA switch driver for the SMSC-LAN9303 Juergen Borleis
2017-04-20 17:41   ` Florian Fainelli
2017-04-18  8:48 ` [PATCH v6 3/4] net: dsa: LAN9303: add I2C managed mode support Juergen Borleis
2017-04-20 16:04   ` Rob Herring
2017-04-20 17:38   ` Florian Fainelli [this message]
2017-04-18  8:48 ` [PATCH v6 4/4] net: dsa: LAN9303: add MDIO " Juergen Borleis
2017-04-20 16:06   ` Rob Herring
2017-04-20 17:50 ` [PATCHv6] net: dsa: add SMSC/Microchip LAN9303 three port ethernet switch driver David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e32156d3-1aa7-6dff-2087-73aa71356207@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=jbe@pengutronix.de \
    --cc=kernel@pengutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=netdev@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=vivien.didelot@savoirfairelinux.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®