Can't register rteth0 for FEC Ethernet card on SabreLite iMX6Q

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

Can't register rteth0 for FEC Ethernet card on SabreLite iMX6Q

1,457 Views
sonnguyen
Contributor I

Hi All,

 

I'm a new user on RTnet and try to make Rtnet work on Freescale Sabre Lite iMX6Q board. But I got an issue, RTnet can't use rt_fec.ko module driver to register rt_eth0 even though non real time driver is disable.

 

I'm using:

Linux kernel 3.0.43 download from Xenomai git: http://git.xenomai.org/ipipe-gch.git/?h=ipipe-3.0-imx6q

Xenomai 2.6 download from http://git.xenomai.org/xenomai-2.6.git/

RTnet 0.9.13 download from http://rtnet.org/download.html

 

Please see my kernel configuration and boot log in attached file.

Xenomai is loaded:

 

 

"I-pipe: Domain Xenomai registered.                                             

 

Xenomai: hal/arm started.                                                      

Xenomai: scheduling class idle registered.                                     

Xenomai: scheduling class rt registered.                                       

Xenomai: real-time nucleus v2.6.3 (Lies and Truths) loaded.                    

Xenomai: debug mode enabled.                                                   

Xenomai: starting native API services.                                         

Xenomai: starting POSIX services.                                              

Xenomai: starting RTDM services.  "

 

And FEC ethernet driver (non real-time driver) is loaded when kernel is booting

 

 

"FEC Ethernet Driver                                                            

 

fec_enet_mii_bus: probed  "

 

Xenomai is built following install guideline for ARM platform from Xenomai:

http://xenomai.org/installing-xenomai-2-x/

 

RTnet is built by below command, because SABRE Lite use FEC ethernet card with Micrel KSZ9021 Gigabit chip so I put "--enable-fec" in configure command to build real-time driver for FEC ethernet card:

 

"./configure --host=armv7l-timesys-linux-gnueabi --with-rtext-config=/home/sonnguyen/rtnet-xenomai-rootfs/usr/xenomai/bin/xeno-config --with-linux=/home/sonnguyen/build/rtnet-xenomai-ipipe-imx6q --enable-rtcfg-dbg --enable-rtwlan --enable-net-routing --enable-router --enable-nomac --enable-rtcap --enable-proxy --enable-checks --enable-fec "

 

Then

"make DESTDIR=/home/sonnguyen/rtnet-xenomai-rootfs install"

 

I also changed RT_DRIVER from default value to "rt_fec" in rtnet.conf.

After kernel is booted, I ran "./rtnet start" and got this:

 

                                                                                                    

 

"RTnet: initialising real-time networking                                                            

RT FEC Ethernet Driver                                                                              

./rtnet: line 385: can't create /sys/bus/pci/drivers/rt_fec/bind: nonexistent directory             

initializing loopback...                                                                            

RTnet: registered rtlo                                                                              

RTcap: real-time capturing interface                                                                

ifconfig: SIOCGIFFLAGS: No such device                                                              

ifconfig: SIOCGIFFLAGS: No such device                                                              

RTcfg: init real-time configuration distribution protocol                                           

RTmac: init realtime media access control                                                           

RTmac/TDMA: init time division multiple access control mechanism                                    

ioctl: No such device                                                                               

ioctl: No such device                                                                               

ioctl: No such device                                                                               

ioctl: No such device                                                                               

ioctl (add): No such device                                                                         

ioctl (add): No such device                                                                         

ioctl (add): No such device                                                                         

ifconfig: SIOCGIFFLAGS: No such device                                                              

Waiting for all slaves...ioctl: No such device                                                      

ioctl: No such device   "

 

Then I tried:

 

"# lspci                                                                                             

 

lspci: /sys/bus/pci/devices: No such file or directory

 

# ls /sys/bus/                                                                                      

 

ac97          hid           mdio_bus      platform      sdio          spi                           

event_source  i2c           mmc           scsi          serio         usb "

 

No pci directory under /sys/bus/. Then I thought because the script can't find the ethernet physical bus, it can't register rteth0.

Then I looked into rtnet script and did some minor change. In the script it requires physical ethernet device ID (mentioned in REBIND_RT_NICS), so I tried to find out what it is and got this when make eth0 up with non real-time driver:

 

"eth0: Freescale FEC PHY driver [Micrel KSZ9021 Gigabit PHY] (mii_bus:phy_addr=1:06, irq=-1)

 

PHY: 1:06 - Link is Up - 1000/Full "

 

I think 1:06 is my physical bus ID, then I change the code in rtnet from:

 

    for dev in $REBIND_RT_NICS; do

 

        if [ -d /sys/bus/pci/devices/$dev/driver ]; then

            echo $dev > /sys/bus/pci/devices/$dev/driver/unbind

        fi

        echo $dev > /sys/bus/pci/drivers/$RT_DRIVER/bind

    done

To

echo 1:06 > /sys/bus/mdio_bus/drivers/Micrel\ KSZ9021\ Gigabit\ PHY/unbind

echo 1:06 > /sys/bus/platform/drivers/rt_fec/bind

 

And I tried again with "./rtnet start", this time I got this:

 

RTnet: initialising real-time networking                                                            

 

RT FEC Ethernet Driver                                                                              

sh: write error: No such device                                                                     

initializing loopback...                                                                            

RTnet: registered rtlo                                                                              

RTcap: real-time capturing interface                                                                

ifconfig: SIOCGIFFLAGS: No such device                                                              

ifconfig: SIOCGIFFLAGS: No such device                                                              

RTcfg: init real-time configuration distribution protocol                                           

RTmac: init realtime media access control                                                           

RTmac/TDMA: init time division multiple access control mechanism                                    

ioctl: No such device                                                                               

ioctl: No such device                                                                               

ioctl: No such device                                                                               

ioctl: No such device                                                                               

ioctl (add): No such device                                                                         

ioctl (add): No such device                                                                         

ioctl (add): No such device                                                                         

ifconfig: SIOCGIFFLAGS: No such device                                                              

Waiting for all slaves...ioctl: No such device                                                      

ioctl: No such device

 

But it still said "No such device"

This is lsmod after I ran ./rtnet start

 

# lsmod                                                                                             

 

Module                  Size  Used by    Not tainted                                                

tdma                   25691  0                                                                     

rtmac                   9724  1 tdma                                                                

rtcfg                  58071  0                                                                     

rtcap                   7151  0                                                                     

rt_loopback             1279  2                                                                     

rtpacket                6365  0                                                                     

rtudp                  10738  0                                                                     

rt_fec                 12742  0                                                                     

rtipv4                 29987  2 rtcfg,rtudp                                                         

rtnet                  40746  9 tdma,rtmac,rtcfg,rtcap,rt_loopback,rtpacket,rtudp,rt_fec,rtipv4     

 

# ./rtifconfig                                                                                      

 

rtlo      Medium: Local Loopback                                                                    

          IP address: 127.0.0.1                                                                     

          UP LOOPBACK RUNNING  MTU: 1500                                                            

                                                                                                    

Only rtlo is registered.

 

I also tried with kernel linux without non real-time FEC driver (please refer in another config file attached in this email), but still the same issue happened.

 

Do you have any idea how to solve this issue? I did many search but still can not figure out how to fix it.

 

Best Regards,

Nguyen Hung Son

Original Attachment has been moved to: kernel_config.zip

Original Attachment has been moved to: kernel_config_without_FEC.zip

Original Attachment has been moved to: rtnet_config.status.zip

Original Attachment has been moved to: rtnet.conf.zip

0 Kudos
1 Reply

710 Views
sonnguyen
Contributor I

Hi everyone,

Does anyone have an ideal to solve this issue or to know where the issue come from?

Thanks,

Nguyen Hung Son.

0 Kudos