AnsweredAssumed Answered

How to configure Ethernet (SGMII@MAC9) on LS1043A

Question asked by Andre Loddenkemper on Jan 18, 2017

Hello everybody,

 

I am here looking for help with the Ethernet configuration of our board. The CPU on our board is a QorIQ LS1043A ARMv8. Serdes Lane A is connected to a Broadcom Ethernet switch on the board via SGMII. There is no real PHY device involved here, the LS1043A Serdes is directly connected to the switch Serdes. The switch is capable of auto-negotiating with SGMII and 1000BaseX connections and by default set to SGMII.

 

We are using the Yocto Linux SDK 2.0. We are deploying an u-boot bootloader, a Linux kernel and a filesystem via SD card to our board. As a starting point I used the LS1043A-RDB BSP, from the NXP evaluation board.


Unfortunately the Ethernet interface in the Linux is still not working properly. In the Linux I can bring it up with "ifconfig" and I can also see an increasing "Tx counter" there, but that's it, nothing else. There seems to be no link and when I look at the interface with ethtool, I get the following:

Settings for fm1-mac9:
Supported ports: [ MII ]
Supported link modes: Not reported
Supported pause frame use: Symmetric Receive-only
Supports auto-negotiation: Yes
Advertised link modes: Not reported
Advertised pause frame use: Symmetric Receive-only
Advertised auto-negotiation: Yes
Speed: 10Mb/s
Duplex: Half
Port: MII
PHYAD: 0
Transceiver: external
Auto-negotiation: on
Supports Wake-on: d
Wake-on: d
Current message level: 0xffffffff (-1)
drv probe link timer ifdown ifup rx_err tx_err tx_queued intr tx_done rx_status pktdata hw wol 0xffff8000
Link detected: no


So here are my questions:

 

1. Is it correct that we have to configure it as an internal PHY, because of how the Ethernet interface is connected to the switch? I think in the reference manual of the LS1043a this is referred to as internal or PCS PHY.

 

2. The fman.txt document in the device tree binding documentation (http://lxr.free-electrons.com/source/Documentation/devicetree/bindings/powerpc/fsl/fman.txt?v=4.6), tells me that I have to use the "fsl,fman-internal-mdio;" parameter for my internal mdio bus as well as the "pcsphy-handle" parameter for my MAC. However, these device tree parameter only exist in newer kernels (4.6+), I think. Am I misunderstandn something here? Or is it really that new? We are at kernel 4.1x, because that is the most current kernel out of the Freescale git repository.

3. How do I need to configure my device tree? Currently I have set it up like this (only the relevant entries):

fman0: fman@1a00000 {
   #address-cells = <1>;
   #size-cells = <1>;
   cell-index = <0>;
   compatible = "fsl,fman", "simple-bus";
   ranges = <0x0 0x00 0x1a00000 0x100000>;
   reg = <0x00 0x1a00000 0x0 0x100000>;
   interrupts = <0 44 0x4>, <0 45 0x4>;
   clocks = <&clockgen 3 0>;
   clock-names = "fmanclk";

   fman0_10g_rx0: port@90000 {
      cell-index = <0>;
      compatible = "fsl,fman-port-10g-rx";
      reg = <0x90000 0x1000>;
   };

 

   fman0_10g_tx0: port@b0000 {
      cell-index = <0>;
      compatible = "fsl,fman-port-10g-tx";
      reg = <0xb0000 0x1000>;
      fsl,qman-channel-id = <0x800>;
   };

 

   fm1mac9: ethernet@f0000 {
      cell-index = <0>;
      compatible = "fsl,fman-memac";
      reg = <0xf0000 0x1000>;
      fsl,port-handles = <&fman0_10g_rx0 &fman0_10g_tx0>;
      /* FM1 mEMAC9: 1AF_000h, LS1043ARM_Rev2.pdf, p. 548 */
      /* SGMII 1000 @ MAC9 */
      ethernet@f0000 {
         phy-handle = <&sgmii_phy>;
         phy-connection-type = "sgmii";
      };
   };

 

      /* MDIO9 for EMAC9: 1AF_1000h, LS1043ADAARM.pdf, p. 500 */

   mdio9: mdio@f1000 {
      #address-cells = <1>;
      #size-cells = <0>;
      compatible = "fsl,fman-memac-mdio";
      reg = <0xf1000 0x1000>;
      fsl,fman-internal-mdio;
      sgmii_phy: ethernet-phy@0 {
         reg = <0x0>;
      };
   };

};

 

4. I also tried to set the ethernet interface up as a fixed link. It was nearly the same result. I could bring the interface up, but only TX counter increased, nothing else. It looked like this:

fm1mac9: ethernet@f0000 {
   cell-index = <0>;
   compatible = "fsl,fman-memac";
   reg = <0xf0000 0x1000>;
   fsl,port-handles = <&fman0_10g_rx0 &fman0_10g_tx0>;
   /* FM1 mEMAC9: 1AF_000h, LS1043ARM_Rev2.pdf, p. 548 */
   /* SGMII 1000 @ MAC9 */
   ethernet@f0000 {
      fixed-link {
         speed = <1000>;
         full-duplex;
      };
      phy-connection-type = "sgmii";
   };
};

 

5. We only have lane A connected to the switch, all other lanes are unconnected. For that I am using Serdes Protocol 3333, because it is one of the many, which provide SGMII on lane A. More specifically, it provides SGMII on all the lanes. It seems only mac9 can be used on this lane. Any concern regarding this? I think I should be fine here. My RCW is as follows:

00000000: 08100010 0a000000 00000000 00000000
00000010: 33330002 00004002 60025000 c1002000
00000020: 00000000 00000000 00000000 0003effc
00000030: 00000000 00001102 00000096 00000001


If anyone already has experience with the LS1043A or with the topic in general, I would be very glad to get some feedback on my issues. Am I on the wrong track? Or is just something misconfigured? Do I need to use the newer kernel version?

 

Attached to this post, you also find some more (hopefully useful) information regarding our board. See "dev_tree.dts" for my device tree. See "bootlog.txt" for a part of the bootlog, where the mdio bus and the mac is probed. Do you need anything else? I will gladly provide more information, if that helps.

 

Best regards,
Andre Loddenkemper

Original Attachment has been moved to: dev_tree.dts.zip

Original Attachment has been moved to: bootlog.txt.zip

Outcomes