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....
hello everyone,
has anyone try to build the uio-seville linux kernel driver for 5.4 ?
I can successful build this driver for 4.19 long-term qoriq-components/linux - Linux Tree for QorIQ support
but the build for 5.4 long-term failed qoriq-components/linux - Linux Tree for QorIQ support
it looks like , the phy api was changed.
the source comes from qoriq-yocto-sdk/l2switch-uio - T1040 L2 switch API and examples
and patched by me for working with kernel 4.19 .
----------------------------------------------------------------------------------------------------------------------------------------------
now comes the compiler errors
Applying 0001-uio-seville.patch using patch:
patching file uio-driver/phy_seville.c
patching file uio-driver/uio_seville_main.c
>>> fsl-l2switch-uio fsl-sdk-v2.0 Configuring
>>> fsl-l2switch-uio fsl-sdk-v2.0 Building
>>> fsl-l2switch-uio fsl-sdk-v2.0 Building kernel module(s)
PATH="/home/Public/BuildRoot/Machine/mdp-t1040s54/host/bin:/home/Public/BuildRoot/Machine/mdp-t1040s54/host/sbin:/home/Public/lsdk19.09:/home/Public/lsdk19.09/tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games" PKG_CONFIG="/home/Public/BuildRoot/Machine/mdp-t1040s54/host/bin/pkg-config" PKG_CONFIG_SYSROOT_DIR="/" PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG_LIBDIR="/home/Public/BuildRoot/Machine/mdp-t1040s54/host/lib/pkgconfig:/home/Public/BuildRoot/Machine/mdp-t1040s54/host/share/pkgconfig" BR_BINARIES_DIR=/home/Public/BuildRoot/Machine/mdp-t1040s54/images /usr/bin/make -j13 -C /home/Public/BuildRoot/Machine/mdp-t1040s54/build/linux-LSDK-20.04-V5.4-update-290520 HOSTCC="/usr/bin/gcc -O2 -I/home/Public/BuildRoot/Machine/mdp-t1040s54/host/include -L/home/Public/BuildRoot/Machine/mdp-t1040s54/host/lib -Wl,-rpath,/home/Public/BuildRoot/Machine/mdp-t1040s54/host/lib" ARCH=powerpc INSTALL_MOD_PATH=/home/Public/BuildRoot/Machine/mdp-t1040s54/target CROSS_COMPILE="/home/Public/BuildRoot/Machine/mdp-t1040s54/host/bin/powerpc64-linux-" DEPMOD=/home/Public/BuildRoot/Machine/mdp-t1040s54/host/sbin/depmod INSTALL_MOD_STRIP=1 PWD=/home/Public/BuildRoot/Machine/mdp-t1040s54/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver M=/home/Public/BuildRoot/Machine/mdp-t1040s54/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver modules
CC [M] /home/Public/BuildRoot/Machine/mdp-t1040s54/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver/npi.o
CC [M] /home/Public/BuildRoot/Machine/mdp-t1040s54/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver/phy_seville.o
CC [M] /home/Public/BuildRoot/Machine/mdp-t1040s54/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver/uio_seville_main.o
In file included from ./include/linux/ioport.h:13:0,
from ./include/linux/device.h:15,
from /home/Public/BuildRoot/Machine/mdp-t1040s54/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver/phy_seville.c:14:
/home/Public/BuildRoot/Machine/mdp-t1040s54/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver/phy_seville.c: In Funktion »seville_phy_change«:
./include/linux/kernel.h:994:51: Fehler: »struct phy_device« hat kein Element namens »phy_queue«
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
./include/linux/compiler.h:330:9: Anmerkung: in Definition des Makros »__compiletime_assert«
if (!(condition)) \
^~~~~~~~~
./include/linux/compiler.h:350:2: Anmerkung: bei Substitution des Makros »_compiletime_assert«
_compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
^~~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:39:37: Anmerkung: bei Substitution des Makros »compiletime_assert«
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
^~~~~~~~~~~~~~~~~~
./include/linux/kernel.h:994:2: Anmerkung: bei Substitution des Makros »BUILD_BUG_ON_MSG«
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^~~~~~~~~~~~~~~~
./include/linux/kernel.h:994:20: Anmerkung: bei Substitution des Makros »__same_type«
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^~~~~~~~~~~
/home/Public/BuildRoot/Machine/mdp-t1040s54/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver/phy_seville.c:433:14: Anmerkung: bei Substitution des Makros »container_of«
container_of(work, struct phy_device, phy_queue);
^~~~~~~~~~~~
In file included from <Kommandozeile>:0:0:
././include/linux/compiler_types.h:129:35: Fehler: »struct phy_device« hat kein Element namens »phy_queue«
#define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
^
./include/linux/stddef.h:17:32: Anmerkung: bei Substitution des Makros »__compiler_offsetof«
#define offsetof(TYPE, MEMBER) __compiler_offsetof(TYPE, MEMBER)
^~~~~~~~~~~~~~~~~~~
./include/linux/kernel.h:997:21: Anmerkung: bei Substitution des Makros »offsetof«
((type *)(__mptr - offsetof(type, member))); })
^~~~~~~~
/home/Public/BuildRoot/Machine/mdp-t1040s54/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver/phy_seville.c:433:14: Anmerkung: bei Substitution des Makros »container_of«
container_of(work, struct phy_device, phy_queue);
^~~~~~~~~~~~
/home/Public/BuildRoot/Machine/mdp-t1040s54/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver/phy_seville.c: In Funktion »seville_phy_cdev_handler«:
/home/Public/BuildRoot/Machine/mdp-t1040s54/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver/phy_seville.c:480:62: Fehler: »struct phy_device« hat kein Element namens »phy_queue«
queue_work(system_power_efficient_wq, &port_list->phy_dev->phy_queue);
^~
In file included from ./include/linux/srcu.h:21:0,
from ./include/linux/notifier.h:16,
from ./arch/powerpc/include/asm/uprobes.h:12,
from ./include/linux/uprobes.h:49,
from ./include/linux/mm_types.h:14,
from ./include/linux/mmzone.h:21,
from ./include/linux/gfp.h:6,
from ./include/linux/xarray.h:14,
from ./include/linux/radix-tree.h:18,
from ./include/linux/idr.h:15,
from ./include/linux/kernfs.h:13,
from ./include/linux/sysfs.h:16,
from ./include/linux/kobject.h:20,
from ./include/linux/device.h:16,
from /home/Public/BuildRoot/Machine/mdp-t1040s54/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver/phy_seville.c:14:
/home/Public/BuildRoot/Machine/mdp-t1040s54/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver/phy_seville.c: In Funktion »seville_phy_create«:
/home/Public/BuildRoot/Machine/mdp-t1040s54/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver/phy_seville.c:680:34: Fehler: »struct phy_device« hat kein Element namens »phy_queue«
INIT_WORK(&port_list->phy_dev->phy_queue, seville_phy_change);
^
./include/linux/workqueue.h:242:16: Anmerkung: in Definition des Makros »__INIT_WORK«
__init_work((_work), _onstack); \
^~~~~
/home/Public/BuildRoot/Machine/mdp-t1040s54/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver/phy_seville.c:680:5: Anmerkung: bei Substitution des Makros »INIT_WORK«
INIT_WORK(&port_list->phy_dev->phy_queue, seville_phy_change);
^~~~~~~~~
/home/Public/BuildRoot/Machine/mdp-t1040s54/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver/phy_seville.c:680:34: Fehler: »struct phy_device« hat kein Element namens »phy_queue«
INIT_WORK(&port_list->phy_dev->phy_queue, seville_phy_change);
^
./include/linux/workqueue.h:243:4: Anmerkung: in Definition des Makros »__INIT_WORK«
(_work)->data = (atomic_long_t) WORK_DATA_INIT(); \
^~~~~
/home/Public/BuildRoot/Machine/mdp-t1040s54/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver/phy_seville.c:680:5: Anmerkung: bei Substitution des Makros »INIT_WORK«
INIT_WORK(&port_list->phy_dev->phy_queue, seville_phy_change);
^~~~~~~~~
/home/Public/BuildRoot/Machine/mdp-t1040s54/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver/phy_seville.c:680:34: Fehler: »struct phy_device« hat kein Element namens »phy_queue«
INIT_WORK(&port_list->phy_dev->phy_queue, seville_phy_change);
^
./include/linux/workqueue.h:244:20: Anmerkung: in Definition des Makros »__INIT_WORK«
INIT_LIST_HEAD(&(_work)->entry); \
^~~~~
/home/Public/BuildRoot/Machine/mdp-t1040s54/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver/phy_seville.c:680:5: Anmerkung: bei Substitution des Makros »INIT_WORK«
INIT_WORK(&port_list->phy_dev->phy_queue, seville_phy_change);
^~~~~~~~~
/home/Public/BuildRoot/Machine/mdp-t1040s54/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver/phy_seville.c:680:34: Fehler: »struct phy_device« hat kein Element namens »phy_queue«
INIT_WORK(&port_list->phy_dev->phy_queue, seville_phy_change);
^
./include/linux/workqueue.h:245:4: Anmerkung: in Definition des Makros »__INIT_WORK«
(_work)->func = (_func); \
^~~~~
/home/Public/BuildRoot/Machine/mdp-t1040s54/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver/phy_seville.c:680:5: Anmerkung: bei Substitution des Makros »INIT_WORK«
INIT_WORK(&port_list->phy_dev->phy_queue, seville_phy_change);
^~~~~~~~~
/home/Public/BuildRoot/Machine/mdp-t1040s54/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver/phy_seville.c: In Funktion »seville_phy_destroy«:
/home/Public/BuildRoot/Machine/mdp-t1040s54/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver/phy_seville.c:774:39: Fehler: »struct phy_device« hat kein Element namens »phy_queue«
flush_work(&port_list->phy_dev->phy_queue);
^~
make[3]: *** [scripts/Makefile.build:266: /home/Public/BuildRoot/Machine/mdp-t1040s54/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver/phy_seville.o] Fehler 1
make[3]: *** Auf noch nicht beendete Prozesse wird gewartet …
/home/Public/BuildRoot/Machine/mdp-t1040s54/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver/uio_seville_main.c:338:13: Fehler: »PHY_HAS_INTERRUPT« ist hier (außerhalb einer Funktion) nicht deklariert; meinten Sie »H_INTERRUPT«?
.flags = PHY_HAS_INTERRUPT,
^~~~~~~~~~~~~~~~~
H_INTERRUPT
make[3]: *** [scripts/Makefile.build:266: /home/Public/BuildRoot/Machine/mdp-t1040s54/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver/uio_seville_main.o] Fehler 1
make[2]: *** [Makefile:1652: /home/Public/BuildRoot/Machine/mdp-t1040s54/build/fsl-l2switch-uio-fsl-sdk-v2.0/uio-driver] Fehler 2
make[1]: *** [package/pkg-generic.mk:256: /home/Public/BuildRoot/Machine/mdp-t1040s54/build/fsl-l2switch-uio-fsl-sdk-v2.0/.stamp_built] Fehler 2
make: *** [Makefile:84: _all] Fehler 2
----------------------------------------------------------------------------------------------------------------------------------------------
any hints or solution
Greetings from island Rügen
Jörg Hering
Hi @jhering_ruegen,
have you by any chance solved this issue? Any suggestions on how to approach the problem?
Regards,
Kris
I'll let myself respond to my question :).
In my case the solution was quite simple, luckily, instead of phy_queue I've used state_queue. This required using different functions, as the type is different, but in principle works fine on my platform. Switch seems to work fine.
Regards,
Kris
Why don't you use the driver from the mainline kernel?
https://github.com/torvalds/linux/blob/master/drivers/net/dsa/ocelot/seville_vsc9953.c