AnsweredAssumed Answered

Port T1040 uio-seville  L2 switch API to mainline kernel

Question asked by Jörg Hering on Jan 18, 2018

Has anyone experience to compile the L2-Switch UIO-driver for T1040 ?

I have successful compiled and running the mainline kernel 4.14 on my Board  from

GitHub - Freescale/linux-fslc at 4.14.x+fslc 

then i try to compile the switch part (

sdk/l2switch-uio.git - T1040 L2 switch API and examples 

with following results failed  see below

 

the l2 switch driver compiled and running successful with older linux kernel 4.1.41 from

sdk/linux.git - Freescale PowerPC Linux Tree 

 

its looks like the phy API between kernel was changed !?

any ideas or hints ?

 

Greetings from (snowy) island Rügen

 

Jörg

 

>>> fsl-l2switch-uio fsl-sdk-v2.0 Building
>>> fsl-l2switch-uio fsl-sdk-v2.0 Building kernel module(s)
PATH="/home/Public/br/Machine/mdp-t1040su/host/bin:/home/Public/br/Machine/mdp-t1040su/host/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/opt/qnx650/host/linux/x86/usr/bin:/etc/qnx/bin" BR_BINARIES_DIR=/home/Public/br/Machine/mdp-t1040su/images /usr/bin/make -j13 -C /home/Public/br/Machine/mdp-t1040su/build/linux-4.14.x+fslc HOSTCC="/usr/bin/gcc" HOSTCFLAGS="" ARCH=powerpc INSTALL_MOD_PATH=/home/Public/br/Machine/mdp-t1040su/target CROSS_COMPILE="/home/Public/br/Machine/mdp-t1040su/host/bin/powerpc64-buildroot-linux-gnu-" DEPMOD=/home/Public/br/Machine/mdp-t1040su/host/sbin/depmod INSTALL_MOD_STRIP=1  PWD=/home/Public/br/Machine/mdp-t1040su/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver M=/home/Public/br/Machine/mdp-t1040su/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver modules
make[1]: Entering directory '/home/Public/br/Machine/mdp-t1040su/build/linux-4.14.x+fslc'
  CC [M]  /home/Public/br/Machine/mdp-t1040su/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver/npi.o
  CC [M]  /home/Public/br/Machine/mdp-t1040su/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver/phy_seville.o
  CC [M]  /home/Public/br/Machine/mdp-t1040su/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver/uio_seville_main.o
/home/Public/br/Machine/mdp-t1040su/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver/uio_seville_main.c: In function ‘seville_phy_init’:
/home/Public/br/Machine/mdp-t1040su/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver/uio_seville_main.c:352:15: error: too few arguments to function ‘phy_driver_register’
     if ((rc = phy_driver_register(&phy_driver_stub))) {
               ^
In file included from ./include/linux/of_mdio.h:12:0,
                 from /home/Public/br/Machine/mdp-t1040su/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver/uio_seville_main.c:39:
./include/linux/phy.h:893:5: note: declared here
 int phy_driver_register(struct phy_driver *new_driver, struct module *owner);
     ^
In file included from ./include/linux/kernel.h:14:0,
                 from ./include/linux/list.h:9,
                 from ./include/linux/kobject.h:20,
                 from ./include/linux/device.h:17,
                 from /home/Public/br/Machine/mdp-t1040su/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver/phy_seville.c:14:
/home/Public/br/Machine/mdp-t1040su/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver/phy_seville.c: In function ‘phy_probe’:
/home/Public/br/Machine/mdp-t1040su/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver/phy_seville.c:226:43: error: ‘struct phy_device’ has no member named ‘addr’
                     dev->init_name, phydev->addr);
                                           ^
./include/linux/printk.h:304:37: note: in definition of macro ‘pr_warning’
  printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
                                     ^
/home/Public/br/Machine/mdp-t1040su/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver/phy_seville.c:225:13: note: in expansion of macro ‘pr_warn’
             pr_warn("%s: PHY %x error condition detected\n",
             ^
/home/Public/br/Machine/mdp-t1040su/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver/phy_seville.c: In function ‘bind_phy_device’:
/home/Public/br/Machine/mdp-t1040su/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver/phy_seville.c:298:39: error: ‘struct phy_device’ has no member named ‘dev’
         device_release_driver(&phy_dev->dev);
                                       ^
/home/Public/br/Machine/mdp-t1040su/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver/phy_seville.c:306:12: error: ‘struct phy_device’ has no member named ‘dev’
     phy_dev->dev.driver = &phy_driver_stub->driver;
            ^
/home/Public/br/Machine/mdp-t1040su/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver/phy_seville.c:306:43: error: ‘struct phy_driver’ has no member named ‘driver’
     phy_dev->dev.driver = &phy_driver_stub->driver;
                                           ^
/home/Public/br/Machine/mdp-t1040su/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver/phy_seville.c:313:36: error: ‘struct phy_device’ has no member named ‘dev’
     if (device_bind_driver(&phy_dev->dev)) {
                                    ^
/home/Public/br/Machine/mdp-t1040su/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver/phy_seville.c: In function ‘seville_phy_create’:
/home/Public/br/Machine/mdp-t1040su/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver/phy_seville.c:687:34: error: ‘struct phy_device’ has no member named ‘dev’
     phy_probe(&port_list->phy_dev->dev);
                                  ^
/home/Public/br/Machine/mdp-t1040su/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver/phy_seville.c:690:60: error: ‘struct phy_device’ has no member named ‘dev’
     if (sysfs_create_link(seville_kobj, &port_list->phy_dev->dev.kobj,
                                                            ^
/home/Public/br/Machine/mdp-t1040su/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver/phy_seville.c: In function ‘seville_phy_destroy’:
/home/Public/br/Machine/mdp-t1040su/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver/phy_seville.c:796:39: error: ‘struct phy_device’ has no member named ‘dev’
         phy_remove(&port_list->phy_dev->dev);
                                       ^
scripts/Makefile.build:314: recipe for target '/home/Public/br/Machine/mdp-t1040su/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver/uio_seville_main.o' failed
make[2]: *** [/home/Public/br/Machine/mdp-t1040su/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver/uio_seville_main.o] Error 1
make[2]: *** Waiting for unfinished jobs....

Outcomes