Re: [PATCH 3/3] net-next: dsa: add new driver for qca8xxx family

From: John Crispin
Date: Tue Sep 13 2016 - 15:10:30 EST




On 13/09/2016 21:07, Andrew Lunn wrote:
>> Since the former alternative is prefered, we may want to remove the
>> latter soon from DSA. If this phy_port_map is needed for that case, it'd
>> be preferable not to add it.
>
> O.K, so maybe we should solve it the device tree way:
>
>
> &mdio0 {
> phy_port1: phy@0 {
> reg = <0>;
> };
>
> phy_port2: phy@1 {
> reg = <1>;
> };
>
> phy_port3: phy@2 {
> reg = <2>;
> };
>
> phy_port4: phy@3 {
> reg = <3>;
> };
>
> phy_port5: phy@4 {
> reg = <4>;
> };
>
> switch@0 {
> compatible = "qca,qca8337";
>
> #address-cells = <1>;
> #size-cells = <0>;
> reg = <30>;
>
> ports {
> port@11 {
> reg = <11>;
> label = "cpu";
> ethernet = <&gmac1>;
> phy-mode = "rgmii";
> };
>
> port@1 {
> reg = <1>;
> label = "lan1";
> phy-handle = <&phy_port1>;
> };
>
> port@2 {
> reg = <2>;
> label = "lan2";
> phy-handle = <&phy_port2>;
> };
>
> port@3 {
> reg = <3>;
> label = "lan3";
> phy-handle = <&phy_port3>;
> };
>
> port@4 {
> reg = <4>;
> label = "lan4";
> phy-handle = <&phy_port4>;
> };
> };
> };
> };
>
> and remove the phy_read() and phy_write() functions.
>
>
> Andrew
>

Hi Andrew

ok, will give it a spin in the morning and add a note to the binding doc
explaining this. thanks for taking the time !

John