LS1012A SGMII MAC-to-MAC communication

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LS1012A SGMII MAC-to-MAC communication

4,002 Views
anu_parvathy
Contributor I

Hi Team

BlockDiag1.png

In the above block diagram, nic0 and nic1 are two SGMII interfaces where nic0 is externally connected to PHY and nic1 is a MAC to MAC interface without an external PHY.

nic0 is working fine while nic1 is not working with the below DTS configurations:

&pfe {

        status = "okay";

        #address-cells = <1>;

        #size-cells = <0>;

 

        ethernet@0 {

                compatible = "fsl,pfe-gemac-port";

                #address-cells = <1>;

                #size-cells = <0>;

                reg = <0x0>;    /* GEM_ID */

                fsl,gemac-bus-id = <0x0>;       /* BUS_ID */

                fsl,gemac-phy-id = <0x1>;       /* PHY_ID */

                fsl,mdio-mux-val = <0x0>;

                local-mac-address = [ 00 1A 2B 3C 4D 5E ];

                phy-mode = "sgmii";

                fsl,pfe-gemac-if-name = "nic1";

                fsl,pfe-phy-if-flags = <0x1>; /* GEMAC_NO_PHY */

                fsl,pfe-gemac-mode = <0x1B00>; /* GEMAC_SW_CONF | GEMAC_SW_FULL_DUPLEX | GEMAC_SW_SPEED_1G */

 

                mdio@0 {

                        reg = <0x0>; /* enabled/disabled */

                };

        }; 

        ethernet@1 {

                compatible = "fsl,pfe-gemac-port";

                #address-cells = <1>;

                #size-cells = <0>;

                reg = <0x1>;    /* GEM_ID */

                fsl,gemac-bus-id = <0x1>;       /* BUS_ID */

                fsl,gemac-phy-id = <0x2>;       /* PHY_ID */

                fsl,mdio-mux-val = <0x0>;

                local-mac-address = [ 00 AA BB CC DD EE ];

                phy-mode = "sgmii";

                fsl,pfe-gemac-if-name = "nic0";

                fsl,pfe-phy-if-flags = <0x0>;

                fsl,pfe-gemac-mode = <0x1B00>; /* GEMAC_SW_CONF | GEMAC_SW_FULL_DUPLEX | GEMAC_SW_SPEED_1G */

 

                mdio@0 {

                        reg = <0x1>; /* enabled/disabled */

                };

        };

};

nic0 and nic1 parameters from the target are captured as follows:

node-9e-b4-31-f0-73-96:~# ethtool nic0
Settings for nic0:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supported pause frame use: No
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised pause frame use: No
Advertised auto-negotiation: Yes
Link partner advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Link partner advertised pause frame use: Symmetric Receive-only
Link partner advertised auto-negotiation: Yes
Speed: 100Mb/s
Duplex: Full
Port: MII
PHYAD: 2
Transceiver: external
Auto-negotiation: on
Supports Wake-on: g
Wake-on: d
Current message level: 0x00000036 (54)
probe link ifdown ifup
Link detected: yes
node-9e-b4-31-f0-73-96:~# ethtool nic1
Settings for nic1:
Cannot get device settings: No such device
Supports Wake-on: g
Wake-on: d
Current message level: 0x00000036 (54)
probe link ifdown ifup
Link detected: yes
node-9e-b4-31-f0-73-96:~ 

We need to operate nic1 at full duplex fixed speed of 1000Mbps. Can you help us suggest what configuration changes needs to be done to make it work.

Thanks

Anu.

0 Kudos
5 Replies

3,069 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please remove "fsl,gemac-phy-id" and use "fixed-link" property to replace it.

fixed-link = <0 1 1000 0 0>;

* A 'fixed-link' property in the Ethernet MAC node, with 5 cells, of the
  form <a b c d e> with the following accepted values:
  - a: emulated PHY ID, choose any but but unique to the all specified
    fixed-links, from 0 to 31
  - b: duplex configuration: 0 for half duplex, 1 for full duplex
  - c: link speed in Mbits/sec, accepted values are: 10, 100 and 1000
  - d: pause configuration: 0 for no pause, 1 for pause
  - e: asymmetric pause configuration: 0 for no asymmetric pause, 1 for
    asymmetric pause

For details, please refer to Documentation/devicetree/bindings/net/fixed-link.txt in Linux Kernel source.

Thanks,

Yiping

0 Kudos

3,069 Views
daviddailey
Contributor I

Hi Yiping,

This works for the kernel.  Can you please also advise on what equivalent changes are needed to make the fixed link work in u-boot?

Thanks,

Dave

0 Kudos

3,069 Views
cyrilstrejc
Contributor III

Hi Anu,

year ago I've prepared configuration for SGMII connection between LS1043A and Marvell's 88E6390X, I consider it as very similar case. Important beginning is to know, that you must distinguish between SGMII MAC and SGMII PHY ends of the SGMII link. It's not obvious from your questions, that you recognize this difference and you've properly configured both ends of the link. Both LS1012A and 88E6321 are exteremely likely by default configured as SGMII MAC prepared to connect SGMII PHY.

C.

0 Kudos

3,068 Views
kai_wu
Contributor III

Hi Cyril Strejc,

We are using a processor LS1012a and a switch ksz9897s in our board, which is quite similar to your case. From your reply, 

you must distinguish between SGMII MAC and SGMII PHY ends

In our design, the switch is connected to the processor via SGMII (MAC to MAC), Could I ask how did you configure your switch to be SGMII PHY end? We are struggling with this.

Thank you.

Kai

0 Kudos

3,068 Views
cyrilstrejc
Contributor III

Hi Kai,

I can't share exact info about Marvell's 88E6390X, but I think it's not interesting for your case anyway. Regarding the KSZ9897S, I would use the procedure described in the KSZ datasheet: use SGMII AUTO-NEGOTIATION CONTROL REGISTER to set SGMII mode into "PHY side SGMII" then write to SGMII Auto-Negotiation Advertisement Register.

Moreover, you can try to disable SGMII auto-negotation and use plain 1000BASE-X on both sides of the link (LS and KSZ). In the end, I think, this is the best solution.

0 Kudos