22 Replies Latest reply on Nov 3, 2014 10:38 AM by AdolfoS

    I210 detection issues under embedded linux  -- (i211)

    SStanly Green Belt

      Hi

       

      We are using I210 blank chip along with imx6 dual lite processor in embedded Linux environment. The device is detected in the U boot with device ID 1532.

      (So i assume HW wise the chip works and is connected properly) But when linux kernel loads it hangs in the screen "Loading kernel".. We have enabled the following in the menuconfig.

       

      Under bus

        PCI bus support and PCI debugging enabled

      Under Kernel LL debug

        early printk

      Under Device Drivers > Network device support > Ethernet driver support

        Intel(R) PRO/1000 PCI-Express Gigabit Ethernet support

      Bus support > PCI host controller drivers

        Freescale i.MX6 PCIe controller

        EP and EC mode are not selected

       

      If we don't enable PCI support then the Kernel and RFS boots up properly. Even though PCI and early printk are enabled i don't see any error dbg mssgs from the kernel nor failure dbg mssgs before the kernel hangs. Do i have to enable any more modules in the kernel. Am I missing some configuration in the kernel?? Only if the device is listed i can use the eeupdate tool and configure the iNVM.

        • Re: I210 detection issues under embedded linux
          gabriel.thomas Brown Belt

          Hello Sstanly

           

          Welcome to the Embedded Community.

          The PCI ID of 0X1532 is the hardware default for the i211 Controller. Probably you have somehow programmed the i210 controller with a device ID that it should never be programmed for, or it is actually an i211 that has simply not been programmed. None of our drivers will load on that device ID, since it is not a supported device ID.

          Our software tools will recognize it as an unprogrammed device, but since you are running an ARM processor none of our regular tools will work.

          I send you a tool that might be useful, please check your e-mail and  confirm if you received it, I hope this helps.

           

          Best Regards

           

          Gabriel Thomas

          • Re: I210 detection issues under embedded linux
            gabriel.thomas Brown Belt

             

             

            Hello SStanly.

             

            An unprogrammed i211 controller should show up in PCIe config space. If it doesn’t, there is something fundamentally wrong. This could be due to a PCIe bridge configuration issue, or some hardware issue. Even if the i211 crystal is not running, the PCIe clock would allow it to show up in PCIe config space, although as a non-functional device. This issue has to be resolved before we can continue to troubleshoot.

             

             

            Please double check the configuration and if you have a second controller you can try that too, just to discard damage on the device.

             

            Regards.

             

            Gabriel Thomas

             

            • Re: I210 detection issues under embedded linux
              AdolfoS Brown Belt

              Hello SStanley

               

              The i211 should show up in the PCIe configuration space. Even if the i211 crystal is not running, the PCIe clock would allow it to show up in the PCIe configuration space although as a non-functional device. This could be due to a PCIe bridge configuration issue, or some hardware issue.

               

              -Is this the only device that you have available? If not, have you tried with other controller?

               

              -I would suggest looking advices in the ARM® Community

               

              Also it could be a hardware problem with your ARM device, so you might want to contact your vendor.

               

              Hope this information is useful to you.

               

              Regards,

              Adolfo.

                • Re: I210 detection issues under embedded linux  -- (i211)
                  SStanly Green Belt

                  Hi Adolfo,

                   

                  Will check on the ARM community  as well as with the vendor to figure out if there are any configuration or hardware issues.

                   

                   

                  Best Regards,
                  Sixtus

                    • Re: I210 detection issues under embedded linux
                      SStanly Green Belt

                      Hi Adolfo

                       

                      We were able to resolve the device detection issue in the linux kernel. There was a conflict between U boot and Kernel and hence the device was detected properly in Uboot but not in Linux kernel. Now the device is properly listed under lspci tool all the time. When we run the arm eeprom update tool we get a bus error and it doesn't list the device. I have provided the issue details and the error screen shot below

                       

                      The tool is trying to mmap() the i211 registers, but the mmap() call fails with the error.

                      This is the code that does the mmap

                       

                      Mapped1Address = mmap(NULL, 4096*32, PROT_WRITE | PROT_READ, MAP_SHARED, FileDescriptor, (off_t)WordLocation );

                       

                      Where :

                      • FileDescriptor : is the result of  fopen("/dev/mem", O_RDWR |O_SYNC)
                      • WordLocation : is the physical address of the i211

                      eeupdate.jpg

                      We are using linux-imx kernel v3.10.17r2 with Yocto BSP for freescale ARM.

                        • Re: I210 detection issues under embedded linux  -- (i211)
                          AdolfoS Brown Belt

                          Hello SStanley

                           

                          Could you please add the line

                           

                          printf(“Error code: %d\n”,  Mapped1Address)

                           

                          to the PciEeprom.c file, this will allow us to see what error the mmap returns.

                           

                          Regards,

                          Adolfo

                          • Re: I210 detection issues under embedded linux  -- (i211)
                            AdolfoS Brown Belt

                            I got feedback from one of our experts; I think his advice could be useful to you or to other developers.

                             

                            One of the possibilities when this kind of this happens is that and Endian conflict, ARM processors allow mixed Endian modes, so it is possible that a  user is not really accessing what the memory addresses that he think he is accessing. The eepromARMtool documentation have useful info about this issue.

                             

                            Other possibility is that for certain hardware or Operative System, the Operative System locks the page after it was allocated.

                             

                            Regards,

                            Adolfo.

                              • Re: I210 detection issues under embedded linux  -- (i211)
                                SStanly Green Belt

                                HI Adolf

                                 

                                We have one more issue in getting the i211 controller up and running i have explained the issue below.

                                 

                                 

                                we were able to get the tool working and we downloaded the binary file to the PHY controller and the ethernet driver got loaded. But we are not able to get the ethernet stack working. The ethernet driver is not able to get the correct MAC address from the iNVM. The tool writes the MAC address at a particular offset whereas the ethernet driver looks for the MAC adds at a different offset. I have provided the problem details below.

                                 

                                From the eepromtool,  the offset value at which we are writing our hex data is 0x12120, The first data we write is the MAC address
                                code snippet of intel eeprom tool

                                #define INVM_DATA_REG(_n)          (0x12120 + 4 * (_n))   // Represent register offsets using this equation

                                 

                                In Intel igb driver we are reading the MAC adds from 0x54XX region

                                 

                                File e1000_nvm.c

                                 

                                 

                                /**
                                *  igb_read_mac_addr - Read device MAC address
                                *  @hw: pointer to the HW structure
                                *
                                *  Reads the device MAC address from the EEPROM and stores the value.
                                *  Since devices with two ports use the same EEPROM, we increment the
                                *  last bit in the MAC address for the second port.
                                **/
                                s32 igb_read_mac_addr(struct e1000_hw *hw)

                                {

                                  ….

                                  ….

                                    rar_high = rd32(E1000_RAH(0));

                                              rar_low = rd32(E1000_RAL(0));

                                  …..

                                  ….

                                      }

                                 

                                 

                                File e1000_reg.h

                                 


                                #define E1000_RAL(_i)  (((_i) <= 15) ? (0x05400 + ((_i) * 8)) : \
                                                                       (0x054E0 + ((_i - 16) * 8)))
                                #define E1000_RAH(_i)  (((_i) <= 15) ? (0x05404 + ((_i) * 8)) : \

                                                                      (0x054E4 + ((_i - 16) * 8)))


                                We are using driver v5.0.3-k that came with linux-imx kernel v3.10.17r2 as part of the Yocto build system from iMX. From Intel’s website where igb drivers are available for download, I am not able to locate a 5.0.3-k version.


                                I also see that the current version of igb driver in Intel’s website is 5.2.9.4. When we compare the source code of this version with the 5.0.3-k version we have, they are way too different. What is the correct version of the driver that we need to use to be compatible with the data written by the eeprom tool.


                                  • Re: I210 detection issues under embedded linux  -- (i211)
                                    LynnZ Brown Belt

                                    Hello SStanly,

                                    I appears that another person from your company is also working with Intel regarding this issue.  The response to your coworker was:


                                    I do not know about the driver v5.0.3-k that came with linux-imx kernel v3.10.17r2 or the Yocto kernel release details. I know Yocto is something some groups are working on within Intel in embedded space and need to do some internal consulting to get you a meaningful answer.
                                    My hunch though is this is an embedded driver and might need some work to port it into the ARM platform. But in the meantime as a step forward as I find out more about Yocto, is it possible to use a regular kernel with the latest driver on your system?

                                     

                                    I can give you some debugging tips on how to get the device and driver working if you run into a road block with the latest driver with a supported kernel. But remember, our drivers are for x86 architecture and you will most likely have to do some massaging to get it working in ARM.

                                      • Re: I210 detection issues under embedded linux  -- (i211)
                                        LynnZ Brown Belt

                                        Hi, SStanly!  I understand that we have good news and your issue is resolved once the MAC address was programmed properly.  Glad to see that working together drives resolution!  Have a great day and we look forward to seeing you again sometime in the Embedded Community!  LynnZ.  ...and thanks Sourav for your assistance, too!

                                          • Re: I210 detection issues under embedded linux  -- (i211)
                                            SStanly Green Belt

                                            Hi LynnZ , Adolfo,

                                             

                                            Sorry about being late to update you guys on the developments. Yes , we were able to get the ETH interface up and running on our ARM platform. We will give the details of our findings / changes shorlty. Thanks for all your support on this. !

                                             

                                            ********

                                            We are now working on making some tweaks on the Phy configurations. For some cost reduced version of our platform, we would want to keep  a 10/100 eth connector with the I211 instead of a GbE connector.

                                             

                                            When we connect it to a 10/100 magnetics, it doesn't work on a network, that is GbE capable, even though the switch supports auto negotiation.( it works fine on 10 ?100 )  This we understand is due to the fact that the I211 still negotiates itself with the switch as a GbE capable device, whereas the connection is only 10/100. Is there some settings in I211 that could disable GbE interface and still be able to do auto negotiations for 10/100.

                                             

                                            Pls find below a snap shot of the connections between the I211 and the magnetics.

                                             

                                            I211 to 10_100 magnetics.jpg

                                             

                                            Best Regards,
                                            Sixtus

                                              • Re: I210 detection issues under embedded linux  -- (i211)
                                                AdolfoS Brown Belt

                                                Hello SStanly

                                                 

                                                Sorry for the delay

                                                 

                                                Regarding your question about disabling GbE interface, you need to check IPCNFG register, bit 3 EEE_1G_AN (i211 datasheet page 382):


                                                Report EEE 1 GbE Capability in Auto-negotiation.

                                                0b = Do not report EEE 1 GbE capability in auto-negotiation.

                                                1b = Report EEE 1 GbE capability in auto-negotiation.


                                                But before changing anything in the  Auto negotiation process my first suggestion would  be to check  section 11.5 Ethernet Interface of the i211 Datasheet, and make sure that you are complying with the recommendations, as this is what might be causing the communication problems. You might one to check this (especially if you are using discrete magnetics):


                                                When using discrete magnetics it is necessary to use Bob Smith termination: Use four 75Ω resistors for cable-side center taps and unused pins. This method terminates pair-to-pair common mode impedance of the CAT5 cable.

                                                 

                                                Regards,

                                                Adolfo