Device tree settings for PFE node

cancel
Showing results for 
Search instead for 
Did you mean: 

Device tree settings for PFE node

Jump to solution
435 Views
kai_wu
Contributor III

Hi,

We am using ls1012a and ksz9897s, see below. We are connecting the GMAC 7 to mac 1(there are mac1 and mac2) on the ls1012a soc, so it's a MAC to MAC connection.

pastedImage_1.png

We are using SPI to manage this switch, not mdio. Also, only mac1 on ls1012a is used.  This is the PFE node in our device tree:

&pfe {
   status = "okay";
   #address-cells = <1>;
   #size-cells = <0>;
   fsl,pfe-num-interfaces = <0x1>; //we are only using SGMII(mac0)

   pfe_mac0: ethernet@0 {
      compatible = "fsl,pfe-gemac-port";
      #address-cells = <1>;
     #size-cells = <0>;
      reg = <0x0>; /* GEM_ID */
      fsl,gemac-bus-id = <0x0>; //not sure what this number should be
      //fsl,mdio-mux-val = <0x0>; //not sure what this number should be
      phy-mode = "sgmii"; //from the pfe device tree bingding, must include sgmii

      fixed-link {
         speed = <1000>;
         full-duplex;
      };
   };

   pfe_mac1: ethernet@1 {
      compatible = "fsl,pfe-gemac-port";
      #address-cells = <1>;
      #size-cells = <0>;
      reg = <0x1>; /* GEM_ID */
      status = "disabled";
      fsl,gemac-bus-id = <0x0>; //not sure what this number should be
      phy-mode = "rgmii-txid"; //from the pfe device tree bingding, must include sgmii

      fixed-link {
         speed = <1000>;
         full-duplex;
      };
   };
};

I deleted the mdio node, disabled the pfe_mac1, added the fixed-link for pfe_mac0. 

Because we are connecting port 7(port@6 in the device tree) of the switch to mac1 on the ls1012a soc. In port 7 I configured ethernet=<&pfe>, also, added fixed-link.  I tried to configure etherent=<&pfe_mac0>,  but when I was trying to load the switch driver, it failed at dsa registering.    

1. Is there any mistake in my pfe node, or the ethernet node. I deleted all mdio related configuration in the PFE node, is it right?    

2. Is the connection configuration between ls1012a and switch correct?

3. Should I configure the pfe_mac0 as the SGMII MAC side, and the port 7 on the switch to be the PHY side? But the switch is not only a PHY device.    

Any help? Than you!

This is the dspi node and its sub node(switch node) in our device tree.

&dspi {
   status = "okay";
   pinctrl-names = "default";
   spi-num-chipselects=<1>;
   bus-num = <1>;
   //checked the datasheet of ksz9897s, Figure 5.2. It is big-endian, but not sure
   big-endian;
   ksz9897: ksz9897@0 {
      compatible = "microchip,ksz9897";
      reg = <0>;
      vcc-supply = < 0x06 >;
      //phy-mode = "sgmii";
      spi-max-frequency = <44000000>;
      spi-cpol;
      spi-cpha;
      status = "okay";

      ports {
         #address-cells = <1>;
         #size-cells = <0>;
         port@0 {
            reg = <0>;
            label = "lan1";
         };

         port@1 {
            reg = <1>;
            label = "lan2";
         };

         port@2 {
            reg = <2>;
            label = "lan3";
         };

         port@3 {
            reg = <3>;
            label = "lan4";
         };

         port@4 {
            reg = <4>;
            label = "lan5";
         };

         port@5 {
            reg = <5>;
            label = "lan6";
         };

         port@6 {
            reg = <6>;
            label = "cpu";
            ethernet = <&pfe>; //not sure about here, pfe or pfe_mac0
            fixed-link {
            speed = <1000>;
            full-duplex;
            };
         };
     };
   };
};

Labels (2)
0 Kudos
1 Solution
250 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello Kai Wu, 

1. I reviewed the pfe device node, removing mdio related configuration is correct.

2. The MAC to MAC connection between between ls1012a and switch  is correct.

3. Please refer to Documentation/devicetree/bindings/net/dsa/ksz.txt, I consider ksz9897 configuration should be as the following.

ksz9897: ksz9897@0 {

    ...

             port@6 {
            reg = <6>;
            label = "cpu";
            ethernet = <&pfe_mac0>; //not sure about here, pfe or pfe_mac0
            fixed-link {
            speed = <1000>;
            full-duplex;
            };

... ...

Thanks,

Yiping

    

View solution in original post

0 Kudos
1 Reply
251 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello Kai Wu, 

1. I reviewed the pfe device node, removing mdio related configuration is correct.

2. The MAC to MAC connection between between ls1012a and switch  is correct.

3. Please refer to Documentation/devicetree/bindings/net/dsa/ksz.txt, I consider ksz9897 configuration should be as the following.

ksz9897: ksz9897@0 {

    ...

             port@6 {
            reg = <6>;
            label = "cpu";
            ethernet = <&pfe_mac0>; //not sure about here, pfe or pfe_mac0
            fixed-link {
            speed = <1000>;
            full-duplex;
            };

... ...

Thanks,

Yiping

    

View solution in original post

0 Kudos