Re: [RFC net-next] of: mdio: Honor hints from MDIO bus drivers

From: Andrew Lunn
Date: Thu Apr 13 2017 - 17:51:24 EST


> The DT binding is in tree and provides an example of how the switch
> looks like, below is the example, but I am also adding the MDIO bus and
> the PHYs just so you can see how things wind up:
>
> switch_top@f0b00000 {
> compatible = "simple-bus";
> #size-cells = <1>;
> #address-cells = <1>;
> ranges = <0 0xf0b00000 0x40804>;
>
> ethernet_switch@0 {
> compatible = "brcm,bcm7445-switch-v4.0";
> #size-cells = <0>;
> #address-cells = <1>;
> reg = <0x0 0x40000
> 0x40000 0x110
> 0x40340 0x30
> 0x40380 0x30
> 0x40400 0x34
> 0x40600 0x208>;
> reg-names = "core", "reg", intrl2_0", "intrl2_1",
> "fcb, "acb";
> interrupts = <0 0x18 0
> 0 0x19 0>;
> brcm,num-gphy = <1>;
> brcm,num-rgmii-ports = <2>;
> brcm,fcb-pause-override;
> brcm,acb-packets-inflight;
>
> ports {
> #address-cells = <1>;
> #size-cells = <0>;
>
> port@0 {
> label = "gphy";
> reg = <0>;
> phy-handle = <&phy5>;
> };
>
> sw0port1: port@1 {
> label = "rgmii_1";
> reg = <1>;
> phy-mode = "rgmii";
> fixed-link {
> speed = <1000>;
> full-duplex;
> };
> }
> };
> };
>
> mdio@403c0 {
> reg = <0x403c0 0x8 0x40300 0x18>;
> #address-cells = <0x1>;
> #size-cells = <0x0>;
> compatible = "brcm,unimac-mdio";
> reg-names = "mdio", "mdio_indir_rw";
>
> switch: switch@0 {
> broken-turn-around;
> reg = <0x0>;
> compatible = "brcm,bcm53125";
> #address-cells = <1>;
> #size-cells = <0>;
>
> ports {
> ..
> port@8 {
> ethernet = <&sw0port1>;
> };
> ...
> };
> };
>
> phy5: ethernet-phy@5 {
> reg = <0x5>;
> compatible = "ethernet-phy-ieee802.3-c22";
> };
> };
> };

So phy5 is connected to the internal switch with a phy-handle. But
because of your double usage of this node, it also can be mapped into
the external switches port 5?

Is that your problem?

It seems like you should add an mdio node inside your switch node, and
list your external switch internal/external phys there if needed.

Andrew