linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Colin Foster <colin.foster@in-advantage.com>
To: Vladimir Oltean <vladimir.oltean@nxp.com>
Cc: "linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"linux-phy@lists.infradead.org" <linux-phy@lists.infradead.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Marc Zyngier <maz@kernel.org>, Hector Martin <marcan@marcan.st>,
	Angela Czubak <acz@semihalf.com>,
	Steen Hegelund <Steen.Hegelund@microchip.com>,
	Lars Povlsen <lars.povlsen@microchip.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Vinod Koul <vkoul@kernel.org>,
	Kishon Vijay Abraham I <kishon@ti.com>,
	Russell King <linux@armlinux.org.uk>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Jakub Kicinski <kuba@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Vivien Didelot <vivien.didelot@gmail.com>,
	Andrew Lunn <andrew@lunn.ch>,
	"UNGLinuxDriver@microchip.com" <UNGLinuxDriver@microchip.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Claudiu Manoil <claudiu.manoil@nxp.com>,
	Lee Jones <lee.jones@linaro.org>,
	"katie.morris@in-advantage.com" <katie.morris@in-advantage.com>
Subject: Re: [RFC v7 net-next 00/13] add support for VSC7512 control over SPI
Date: Tue, 8 Mar 2022 23:34:52 -0800	[thread overview]
Message-ID: <20220309073452.GA3124@COLIN-DESKTOP1.localdomain> (raw)
In-Reply-To: <20220308143956.jik5bvszvqmrukgb@skbuf>

On Tue, Mar 08, 2022 at 02:39:57PM +0000, Vladimir Oltean wrote:
> On Sun, Mar 06, 2022 at 06:11:55PM -0800, Colin Foster wrote:
> > The patch set in general is to add support for the VSC7512, and
> > eventually the VSC7511, VSC7513 and VSC7514 devices controlled over
> > SPI. The driver is believed to be fully functional for the internal
> > phy ports (0-3)  on the VSC7512. It is not yet functional for SGMII,
> > QSGMII, and SerDes ports.
> > 
> > I have mentioned previously:
> > The hardware setup I'm using for development is a beaglebone black, with
> > jumpers from SPI0 to the microchip VSC7512 dev board. The microchip dev
> > board has been modified to not boot from flash, but wait for SPI. An
> > ethernet cable is connected from the beaglebone ethernet to port 0 of
> > the dev board.
> > 
> > The relevant sections of the device tree I'm using for the VSC7512 is
> > below. Notably the SGPIO LEDs follow link status and speed from network
> > triggers.
> > 
> > In order to make this work, I have modified the cpsw driver, and now the
> > cpsw_new driver, to allow for frames over 1500 bytes. Otherwise the
> > tagging protocol will not work between the beaglebone and the VSC7512. I
> > plan to eventually try to get those changes in mainline, but I don't
> > want to get distracted from my initial goal. I also had to change
> > bonecommon.dtsi to avoid using VLAN 0.
> > 
> > 
> > Of note: The Felix driver had the ability to register the internal MDIO
> > bus. I am no longer using that in the switch driver, it is now an
> > additional sub-device under the MFD.
> > 
> > I also made use of IORESOURCE_REG, which removed the "device_is_mfd"
> > requirement.
> > 
> > 
> > / {
> > 	vscleds {
> > 		compatible = "gpio-leds";
> > 		vscled@0 {
> > 			label = "port0led";
> > 			gpios = <&sgpio_out1 0 0 GPIO_ACTIVE_LOW>;
> > 			default-state = "off";
> > 			linux,default-trigger = "ocelot-miim0.2.auto-mii:00:link";
> > 		};
> > 		vscled@1 {
> > 			label = "port0led1";
> > 			gpios = <&sgpio_out1 0 1 GPIO_ACTIVE_LOW>;
> > 			default-state = "off";
> > 			linux,default-trigger = "ocelot-miim0.2.auto-mii:00:1Gbps";
> > 		};
> > [ ... ]
> > 		vscled@71 {
> > 			label = "port7led1";
> > 			gpios = <&sgpio_out1 7 1 GPIO_ACTIVE_LOW>;
> > 			default-state = "off";
> > 			linux,default-trigger = "ocelot-miim1-mii:07:1Gbps";
> > 		};
> > 	};
> > };
> > 
> > &spi0 {
> > 	#address-cells = <1>;
> > 	#size-cells = <0>;
> > 	status = "okay";
> > 
> > 	ocelot-chip@0 {
> > 		compatible = "mscc,vsc7512_mfd_spi";
> > 		spi-max-frequency = <2500000>;
> > 		reg = <0>;
> > 
> > 		ethernet-switch@0 {
> 
> I'm not exactly clear on what exactly does the bus address (@0)
> represent here and in other (but not all) sub-nodes.
> dtc probably warns that there shouldn't be any unit address, since
> #address-cells and #size-cells are both 0 for ocelot-chip@0.

They most likely shouldn't be there. There are some warnings (make W=1
...) but they're hidden inside all sorts of warnings from am33*.dtsi
warnings. I should have been looking for those.

You're right. A lot of "has a unit name, but no reg or ranges property"
Removing the @s and giving them all unique names resolves these
warnings.

> 
> > 			compatible = "mscc,vsc7512-ext-switch";
> > 			ports {
> > 				#address-cells = <1>;
> > 				#size-cells = <0>;
> > 
> > 				port@0 {
> > 					reg = <0>;
> > 					label = "cpu";
> > 					status = "okay";
> > 					ethernet = <&mac_sw>;
> > 					phy-handle = <&sw_phy0>;
> > 					phy-mode = "internal";
> > 				};
> > 
> > 				port@1 {
> > 					reg = <1>;
> > 					label = "swp1";
> > 					status = "okay";
> > 					phy-handle = <&sw_phy1>;
> > 					phy-mode = "internal";
> > 				};
> > 			};
> > 		};
> > 
> > 		mdio0: mdio0@0 {
> > 			compatible = "mscc,ocelot-miim";
> > 			#address-cells = <1>;
> > 			#size-cells = <0>;
> > 
> > 			sw_phy0: ethernet-phy@0 {
> > 				reg = <0x0>;
> > 			};
> > 
> > 			sw_phy1: ethernet-phy@1 {
> > 				reg = <0x1>;
> > 			};
> > 
> > 			sw_phy2: ethernet-phy@2 {
> > 				reg = <0x2>;
> > 			};
> > 
> > 			sw_phy3: ethernet-phy@3 {
> > 				reg = <0x3>;
> > 			};
> > 		};
> > 
> > 		mdio1: mdio1@1 {
> > 			compatible = "mscc,ocelot-miim";
> > 			pinctrl-names = "default";
> > 			pinctrl-0 = <&miim1>;
> > 			#address-cells = <1>;
> > 			#size-cells = <0>;
> > 
> > 			sw_phy4: ethernet-phy@4 {
> > 				reg = <0x4>;
> > 			};
> > 
> > 			sw_phy5: ethernet-phy@5 {
> > 				reg = <0x5>;
> > 			};
> > 
> > 			sw_phy6: ethernet-phy@6 {
> > 				reg = <0x6>;
> > 			};
> > 
> > 			sw_phy7: ethernet-phy@7 {
> > 				reg = <0x7>;
> > 			};
> > 
> > 		};
> > 
> > 		gpio: pinctrl@0 {
> > 			compatible = "mscc,ocelot-pinctrl";
> > 			gpio-controller;
> > 			#gpio_cells = <2>;
> > 			gpio-ranges = <&gpio 0 0 22>;
> > 
> > 			led_shift_reg_pins: led-shift-reg-pins {
> > 				pins = "GPIO_0", "GPIO_1", "GPIO_2", "GPIO_3";
> > 				function = "sg0";
> > 			};
> > 
> > 			miim1: miim1 {
> > 				pins = "GPIO_14", "GPIO_15";
> > 				function = "miim";
> > 			};
> > 		};
> > 
> > 		sgpio: sgpio {
> > 			compatible = "mscc,ocelot-sgpio";
> > 			#address-cells = <1>;
> > 			#size-cells = <0>;
> > 			bus-frequency=<12500000>;
> > 			clocks = <&ocelot_clock>;
> > 			microchip,sgpio-port-ranges = <0 15>;
> > 			pinctrl-names = "default";
> > 			pinctrl-0 = <&led_shift_reg_pins>;
> > 
> > 			sgpio_in0: sgpio@0 {
> > 				compatible = "microchip,sparx5-sgpio-bank";
> > 				reg = <0>;
> > 				gpio-controller;
> > 				#gpio-cells = <3>;
> > 				ngpios = <64>;
> > 			};
> > 
> > 			sgpio_out1: sgpio@1 {
> > 				compatible = "microchip,sparx5-sgpio-bank";
> > 				reg = <1>;
> > 				gpio-controller;
> > 				#gpio-cells = <3>;
> > 				ngpios = <64>;
> > 			};
> > 		};
> > 
> > 		hsio: syscon {
> > 			compatible = "mscc,ocelot-hsio", "syscon", "simple-mfd";
> > 
> > 			serdes: serdes {
> > 				compatible = "mscc,vsc7514-serdes";
> > 				#phy-cells = <2>;
> > 			};
> > 		};
> > 	};
> > };
> 
> The switch-related portion of this patch set looks good enough to me.
> I'll let somebody else with more knowledge provide feedback on the
> mfd/pinctrl/gpio/phylink/led integration aspects.

Thanks for looking. As I mentioned - I don't have any intention to make
a .dts/.dtsi for this rather obscure dev environment. It seems like it
wouldn't be useful. But the feedback has really helped keep me on track,
and hopefully avoiding scenarios where two wrongs make a right.

      reply	other threads:[~2022-03-09  1:05 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-07  2:11 [RFC v7 net-next 00/13] add support for VSC7512 control over SPI Colin Foster
2022-03-07  2:11 ` [RFC v7 net-next 01/13] pinctrl: ocelot: allow pinctrl-ocelot to be loaded as a module Colin Foster
2022-03-07  2:11 ` [RFC v7 net-next 02/13] pinctrl: microchip-sgpio: allow sgpio driver to be used " Colin Foster
2022-03-07  2:11 ` [RFC v7 net-next 03/13] net: mdio: mscc-miim: add local dev variable to cleanup probe function Colin Foster
2022-03-07  2:11 ` [RFC v7 net-next 04/13] net: ocelot: add interface to get regmaps when exernally controlled Colin Foster
2022-03-07  2:12 ` [RFC v7 net-next 05/13] net: mdio: mscc-miim: add ability to be used in a non-mmio configuration Colin Foster
2022-03-07  2:12 ` [RFC v7 net-next 06/13] pinctrl: ocelot: " Colin Foster
2022-03-07  2:12 ` [RFC v7 net-next 07/13] pinctrl: microchip-sgpio: " Colin Foster
2022-03-07  2:12 ` [RFC v7 net-next 08/13] phy: ocelot-serdes: add ability to be used in mfd configuration Colin Foster
2022-03-07  2:12 ` [RFC v7 net-next 09/13] resource: add define macro for register address resources Colin Foster
2022-03-07  2:12 ` [RFC v7 net-next 10/13] mfd: ocelot: add support for the vsc7512 chip via spi Colin Foster
2022-03-08 14:37   ` Vladimir Oltean
2022-04-13  8:32   ` Lee Jones
2022-04-19  9:07     ` Lee Jones
2022-04-20  2:13       ` Colin Foster
2022-03-07  2:12 ` [RFC v7 net-next 11/13] net: mscc: ocelot: expose ocelot wm functions Colin Foster
2022-03-07  2:12 ` [RFC v7 net-next 12/13] net: dsa: felix: add configurable device quirks Colin Foster
2022-03-07  2:12 ` [RFC v7 net-next 13/13] net: dsa: ocelot: add external ocelot switch control Colin Foster
2022-03-08 14:14   ` Vladimir Oltean
2022-03-09  6:13     ` Colin Foster
2022-03-08 14:39 ` [RFC v7 net-next 00/13] add support for VSC7512 control over SPI Vladimir Oltean
2022-03-09  7:34   ` Colin Foster [this message]

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=20220309073452.GA3124@COLIN-DESKTOP1.localdomain \
    --to=colin.foster@in-advantage.com \
    --cc=Steen.Hegelund@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=acz@semihalf.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=andrew@lunn.ch \
    --cc=claudiu.manoil@nxp.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=katie.morris@in-advantage.com \
    --cc=kishon@ti.com \
    --cc=kuba@kernel.org \
    --cc=lars.povlsen@microchip.com \
    --cc=lee.jones@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    --cc=marcan@marcan.st \
    --cc=maz@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=vivien.didelot@gmail.com \
    --cc=vkoul@kernel.org \
    --cc=vladimir.oltean@nxp.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;
as well as URLs for NNTP newsgroup(s).