How to compile uio_seville driver in sdk 3.1 for T1040RDB

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

How to compile uio_seville driver in sdk 3.1 for T1040RDB

Jump to solution
4,915 Views
Suraj_Prakash
Contributor II

Hi,

      I have been working on T1040RDB and the SDK which i have been using is 3.1.

I want to uio_seville driver which works on internal L2 switch of T1040 processor.

Can you please suggest how to compile the driver in SDK 3.1?

0 Kudos
1 Solution
4,751 Views
yipingwang
NXP TechSupport
NXP TechSupport

I compiled your uio-seville source code in Yocto SDK 3.1 build environment, I encountered the attached compilation errors.

Please check your uio-seville source code again.

View solution in original post

0 Kudos
26 Replies
4,028 Views
yipingwang
NXP TechSupport
NXP TechSupport

PHY APIs between kernels were changed, compilation errors will be encountered when build uio-seville Linux kernel driver for SDK 3.1 Linux Kernel 5.4.3, you need to to the porting by yourself.

You could refer to the following procedure to deploy recipe and source code to Yocto 3.1, then do porting and compiling in Yocto 3.1.

Please copy QorIQ-SDK-V2.0-20160527-yocto/sources/meta-freescale/recipes-kernel/uio-seville/ folder to yocto-sdk_dunfell/sources/meta-freescale/recipes-kernel/ folder.

Please copy QorIQ-SDK-V2.0-20160527-yocto/downloads/git2/git.freescale.com.ppc.sdk.l2switch-uio.git* to folder yocto-sdk_dunfell/downloads/git2

Run the following command, you will encounter compiling error.

$ bitbake uio-seville

Please go to uio-seville source code folder build_t1042d4rdb/tmp/work/t1042d4rdb-fsl-linux/uio-seville/0.1-r0/git/ to do modification, then run "bitbake uio-seville" again.

For uio-seville porting, you could refer to the following topic.

to https://community.nxp.com/t5/T-Series/Port-T1040-uio-seville-L2-switch-API-to-mainline-kernel/m-p/73...

0 Kudos
4,022 Views
Suraj_Prakash
Contributor II

Do you have any patch available for compiling seville driver in SDK 3.1?

0 Kudos
4,015 Views
yipingwang
NXP TechSupport
NXP TechSupport

We don't have any patch to compile seville driver in SDK 3.1

0 Kudos
4,007 Views
Suraj_Prakash
Contributor II

Hi,

    Driver got compiled and i found the .ko in  the path /build_t1040d4rdb-64b/tmp/work/t1040d4rdb_64b-fsl-linux/uio-seville/0.1-r0/git/uio-driver

the driver info is given below

ls -lrth uio_seville.ko
-rw-r--r-- 1 suchita suchita 61K Nov 12 12:02 uio_seville.ko

file uio_seville.ko
uio_seville.ko: ELF 64-bit MSB relocatable, 64-bit PowerPC or cisco 7500, version 1 (SYSV), BuildID[sha1]=85d35a626d5108c50acf0e8e8e59b6f9f48f06de, not stripped

 

but When I try to insert the driver and run the l2switch application I have been getting the prompt that l2sw binary is not running. Please suggest a solution.

 

root@t1040d4rdb:~# insmod uio_seville.ko
root@t1040d4rdb:~# l2sw
l2sw_bin l2switch-cfg
root@t1040d4rdb:~# l2sw_bin
Unable to locate UIO device
: Success
root@t1040d4rdb:~# l2sw
l2sw_bin l2switch-cfg
root@t1040d4rdb:~# l2switch-cfg
l2sw_bin is not running
root@t1040d4rdb:~#
root@t1040d4rdb:~#
root@t1040d4rdb:~#
root@t1040d4rdb:~# rm /tmp/il2sw
rm: cannot remove '/tmp/il2sw': No such file or directory
root@t1040d4rdb:~# l2sw_bin -i /tmp/il2sw -o /tmp/ol2sw&
[1] 2485
fifo /tmp/il2sw is used for stdin
stdout is redirected to /tmp/ol2sw
Unable to locate UIO device
: Success
root@t1040d4rdb:~#
[1]+ Done l2sw_bin -i /tmp/il2sw -o /tmp/ol2sw
root@t1040d4rdb:~#
root@t1040d4rdb:~# l2switch-cfg
l2sw_bin is not running

0 Kudos
3,993 Views
yipingwang
NXP TechSupport
NXP TechSupport

After executing the command "l2sw_bin -i /tmp/il2sw -o /tmp/ol2sw&", you could find the error message "Unable to locate UIO device".

After inserting module "uio_seville.ko", please check whether "/dev/uio0" exists, if no, there is problem with module "uio_seville.ko".

0 Kudos
3,988 Views
Suraj_Prakash
Contributor II

Hi, 

     Like you suggested i have checked for /dev/uio0 and it exists. What could be the issue now?

 

root@t1040d4rdb:~# insmod uio_seville.ko
root@t1040d4rdb:~# ls /dev/uio
uio0 uio1 uio10 uio11 uio12 uio13 uio14 uio15 uio2 uio3 uio4 uio5 uio6 uio7 uio8 uio9
root@t1040d4rdb:~# ls /dev/uio0
/dev/uio0
root@t1040d4rdb:~#
root@t1040d4rdb:~# l2sw_bin -i /tmp/il2sw -o /tmp/ol2sw&
[1] 2508
fifo /tmp/il2sw is used for stdin
stdout is redirected to /tmp/ol2sw
Unable to locate UIO device
: Success
root@t1040d4rdb:~# l2switch-cfg port all config show
l2sw_bin is not running
[1]+ Done l2sw_bin -i /tmp/il2sw -o /tmp/ol2sw
root@t1040d4rdb:~#

 

0 Kudos
3,983 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please go to l2switch package folder build_t1040d4rdb/tmp/work/ppce5500-fsl-linux/l2switch/0.1-r0/git/src, in ./board_init/board_init.c you will find the following.

int board_io_init(void)
{
u32 value;
const int enable = 1;
char iodev_path[64]; /* iodev path */

if (!uio_device_exists(iodev_path, sizeof(iodev_path))) {
perror("Unable to locate UIO device\n");
return -1;
}

Please check function uio_device_exists in ./fsl_utils/fsl_utils.c

 

0 Kudos
3,981 Views
Suraj_Prakash
Contributor II

There is no directory named  "l2switch" in my build

0 Kudos
3,978 Views
Suraj_Prakash
Contributor II

Please suggest how to get l2switch code into  build_t1040d4rdb/tmp/work/ppce5500-fsl-linux/ and compile?

 

0 Kudos
3,971 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please execute the following command first to fetch l2switch source code.

$ bitbake l2switch -c patch -f

0 Kudos
3,967 Views
Suraj_Prakash
Contributor II

Hi,

   Getting the following error

suchita@linux:~/yocto-sdk/build_t1040d4rdb-64b$ bitbake l2switch -c patch -f
Loading cache: 100% |##########################################################################################################| Time: 0:00:00
Loaded 6739 entries from dependency cache.
ERROR: Nothing PROVIDES 'l2switch'

Summary: There was 1 ERROR message shown, returning a non-zero exit code.

0 Kudos
3,964 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please fetch the source code in SDK 2.0 build environment.

0 Kudos
3,961 Views
Suraj_Prakash
Contributor II

even after doing so i am getting the error

suchita@linux:~/yocto-sdk/build_t1040d4rdb-64b$ bitbake l2switch -c patch -f
Loading cache: 100% |##########################################################################################################| Time: 0:00:00
Loaded 6739 entries from dependency cache.
ERROR: Nothing PROVIDES 'l2switch'

Summary: There was 1 ERROR message shown, returning a non-zero exit code.

 

0 Kudos
3,954 Views
Suraj_Prakash
Contributor II

I could able to resolve the previous error but now getting the below given error. Kindly please suggest

 

suchita@linux:~/yocto-sdk/build_t1040d4rdb-64b$ bitbake l2switch -c patch -f
Loading cache: 100% |##########################################################################################################| Time: 0:00:00
Loaded 6741 entries from dependency cache.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION = "1.46.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "universal"
TARGET_SYS = "powerpc64-fsl-linux"
MACHINE = "t1040d4rdb-64b"
DISTRO = "fsl-qoriq"
DISTRO_VERSION = "3.1.1"
TUNE_FEATURES = "m64 fpu-hard e5500 bigendian"
TARGET_FPU = "hard"
meta
meta-poky
meta-yocto-bsp = "HEAD:c253fd28ad26b4996666b0794dfee1d59c14e3ca"
meta-oe
meta-multimedia
meta-python
meta-networking
meta-gnome
meta-filesystems
meta-webserver
meta-perl = "HEAD:cc155826b0b4f202a8fa4ac103b7c38368d32734"
meta-virtualization = "HEAD:5c2de3daedd3f65171b9debf938683ce6e7746ea"
meta-cloud-services = "HEAD:ba99cce99d248b383871db562d694be5b3d52c77"
meta-security = "HEAD:d83f7cb0c90666fedd127d5173e6c8b972755c32"
meta-selinux = "HEAD:f677a09992413f32e6b2c4c607ae44fb42de72c2"
meta-freescale = "HEAD:682c00566aa3cf0deeff0cfd349494f078f38a04"
meta-freescale-distro = "HEAD:fbd12ff7e5f80a0e1fd71fa217d52a3c96659d16"
meta-qoriq = "HEAD:760e52a9a4c05729689595d4a884ebf97cba81ad"

NOTE: Tainting hash to force rebuild of task /home/suchita/yocto-sdk/sources/meta-freescale/recipes-extended/l2switch/l2switch_0.1.bb, do_patch
WARNING: /home/suchita/yocto-sdk/sources/meta-freescale/recipes-extended/l2switch/l2switch_0.1.bb:do_patch is tainted from a forced run0:00:00
Initialising tasks: 100% |#####################################################################################################| Time: 0:00:00
Sstate summary: Wanted 0 Found 0 Missed 0 Current 20 (0% match, 100% complete)
NOTE: Executing Tasks
WARNING: l2switch-0.1-r0 do_fetch: Failed to fetch URL git://sw-stash.freescale.net/scm/sdk/l2switch-util.git;branch=master;protocol=http, attempting MIRRORS if available
ERROR: l2switch-0.1-r0 do_fetch: Fetcher failure: Fetch command export PSEUDO_DISABLED=1; unset _PYTHON_SYSCONFIGDATA_NAME; export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus"; export ftp_proxy="ftp://pnc:9qdeESR6@webcache.cdotb.ernet.in:8080/"; export https_proxy="http://pnc:9qdeESR6@webcache.cdotb.ernet.in:8080/"; export http_proxy="http://pnc:9qdeESR6@webcache.cdotb.ernet.in:8080/"; export PATH="/home/suchita/yocto-sdk/build_t1040d4rdb-64b/tmp/sysroots-uninative/x86_64-linux/usr/bin:/home/suchita/yocto-sdk/sources/poky/scripts:/home/suchita/yocto-sdk/build_t1040d4rdb-64b/tmp/work/ppc64e5500-fsl-linux/l2switch/0.1-r0/recipe-sysroot-native/usr/bin/powerpc64-fsl-linux:/home/suchita/yocto-sdk/build_t1040d4rdb-64b/tmp/work/ppc64e5500-fsl-linux/l2switch/0.1-r0/recipe-sysroot/usr/bin/crossscripts:/home/suchita/yocto-sdk/build_t1040d4rdb-64b/tmp/work/ppc64e5500-fsl-linux/l2switch/0.1-r0/recipe-sysroot-native/usr/sbin:/home/suchita/yocto-sdk/build_t1040d4rdb-64b/tmp/work/ppc64e5500-fsl-linux/l2switch/0.1-r0/recipe-sysroot-native/usr/bin:/home/suchita/yocto-sdk/build_t1040d4rdb-64b/tmp/work/ppc64e5500-fsl-linux/l2switch/0.1-r0/recipe-sysroot-native/sbin:/home/suchita/yocto-sdk/build_t1040d4rdb-64b/tmp/work/ppc64e5500-fsl-linux/l2switch/0.1-r0/recipe-sysroot-native/bin:/home/suchita/yocto-sdk/sources/poky/bitbake/bin:/home/suchita/yocto-sdk/build_t1040d4rdb-64b/tmp/hosttools"; export HOME="/home/suchita"; LANG=C git -c core.fsyncobjectfiles=0 clone --bare --mirror http://sw-stash.freescale.net/scm/sdk/l2switch-util.git /home/suchita/yocto-sdk/downloads/git2/sw-stash.freescale.net.scm.sdk.l2switch-util.git --progress failed with exit code 128, output:
Cloning into bare repository '/home/suchita/yocto-sdk/downloads/git2/sw-stash.freescale.net.scm.sdk.l2switch-util.git'...
fatal: unable to access 'http://sw-stash.freescale.net/scm/sdk/l2switch-util.git/': The requested URL returned error: 503

ERROR: l2switch-0.1-r0 do_fetch: Fetcher failure for URL: 'git://sw-stash.freescale.net/scm/sdk/l2switch-util.git;branch=master;protocol=http'. Unable to fetch URL from any source.
ERROR: Logfile of failure stored in: /home/suchita/yocto-sdk/build_t1040d4rdb-64b/tmp/work/ppc64e5500-fsl-linux/l2switch/0.1-r0/temp/log.do_fetch.10691
ERROR: Task (/home/suchita/yocto-sdk/sources/meta-freescale/recipes-extended/l2switch/l2switch_0.1.bb:do_fetch) failed with exit code '1'
NOTE: Tasks Summary: Attempted 91 tasks of which 90 didn't need to be rerun and 1 failed.

Summary: 1 task failed:
/home/suchita/yocto-sdk/sources/meta-freescale/recipes-extended/l2switch/l2switch_0.1.bb:do_fetch
Summary: There were 2 WARNING messages shown.
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.

 

0 Kudos
3,937 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please refer to the attached l2switch source code.

0 Kudos
3,928 Views
Suraj_Prakash
Contributor II

Hi,

      my issue is that i am not getting the /sys/bus/platform/devices/ffe800000.l2switch/ interface created in the linux  which i doubt l2switch compilation is not happened properly . Therefore i am getting the following error

root@t1040d4rdb:~# fifo /tmp/il2sw is used for stdin
stdout is redirected to /tmp/ol2sw
Unable to locate UIO device
: Success

[1]+ Done l2sw_bin -i /tmp/il2sw -o /tmp/ol2sw

Please suggest how to successfully compile l2switch source code so that it gets incorporated to the linux. Thank you

Tags (1)
0 Kudos
3,921 Views
yipingwang
NXP TechSupport
NXP TechSupport

T1040D4RDB dts file in SDK 3.1 doesn't include "l2switch@800000" device node definition.

Please go to SDK 3.1 Linux Kernel source code folder build_t1040d4rdb/tmp/work/t1040d4rdb-fsl-linux/linux-qoriq/5.4.3+gitAUTOINC+134788b164-r0/git/arch/powerpc/boot/dts/fsl, please modify t1040d4rdb.dts and t1040si-post.dtsi to add "l2switch@800000" definition.

In your SDK 2.0 build environment, please run "bitbake virtual/kernel -c patch -f", go to Linux Kernel source code folder ~/QorIQ-SDK-V2.0-<date>-yocto/build_t1040d4rdb/tmp/work/t1040d4rdb-fsl-linux/linux-qoriq/<version>-r0/git, please refer to arch/powerpc/boot/dts/t1040d4rdb.dts and arch/powerpc/boot/dts/fsl/t1040si-post.dtsi.

0 Kudos
3,913 Views
Suraj_Prakash
Contributor II

Hi,

      I was able to compile l2switch but upon inserting the seville driver getting the following errors

 

root@t1040d4rdb:~# insmod uio_seville.ko
uio_seville: loading out-of-tree module taints kernel.
seville ffe800000.l2switch: Found Seville Switch, UIO device - IRQ 26, id 0x099530e9.
BUG: Unable to handle kernel data access at 0x18800000564
Faulting instruction address: 0xc0000000002da3b0
Oops: Kernel access of bad area, sig: 11 [#1]
BE PAGE_SIZE=4K SMP NR_CPUS=24 CoreNet Generic
Modules linked in: uio_seville(O+)
CPU: 2 PID: 1395 Comm: insmod Tainted: G O 5.4.3+g134788b16485 #1
**bleep**: c0000000002da3b0 LR: c0000000002dd34c CTR: 00000000ffffffef
REGS: c0000000763d67a0 TRAP: 0300 Tainted: G O (5.4.3+g134788b16485)
MSR: 000000008002b002 <CE,EE,FP,ME> CR: 28008424 XER: 00000000
DEAR: 0000018800000564 ESR: 0000000000000000 IRQMASK: 0
GPR00: c0000000002dd34c c0000000763d6a30 c00000000117a900 000001880000055c
GPR04: c000000073326d80 000000000000a1ff 0000000000000000 0000000000000000
GPR08: 0000000000000004 0000000000000000 0000000000000000 0000000037860bc8
GPR12: 0000000088002424 c00000003ffff140 0000000000000000 8000000000279000
GPR16: c0000000763d7d70 8000000000275fb0 800000000027704c 0000000000000063
GPR20: 8000000000275e18 c0000000763d7c20 c0000000010b7808 0000000000000000
GPR24: c00000006526ae60 c0000000732b1010 0000000000000003 0000000000000001
GPR28: c000000073326d80 000001880000055c 000001880000055c 000001880000055c
**bleep** [c0000000002da3b0] .kernfs_new_node+0x18/0x70
LR [c0000000002dd34c] .kernfs_create_link+0xf8/0x12c
Call Trace:
[c0000000763d6a30] [c0000000763d6b40] 0xc0000000763d6b40 (unreliable)
[c0000000763d6ab0] [c0000000002dd34c] .kernfs_create_link+0xf8/0x12c
[c0000000763d6b40] [c0000000002de91c] .sysfs_do_create_link_sd.isra.0+0xac/0x180
[c0000000763d6be0] [c000000000667ba0] .module_add_driver+0xb0/0x170
[c0000000763d6c70] [c0000000006466d4] .bus_add_driver+0x150/0x290
[c0000000763d6d10] [c000000000649140] .driver_register+0x88/0x18c
[c0000000763d6d90] [c000000000761ca0] .phy_driver_register+0x94/0xd8
[c0000000763d6e10] [80000000002710b8] .seville_phy_init.constprop.0+0x48/0x160 [uio_seville]
[c0000000763d7270] [80000000002716a4] .seville_probe+0x310/0x808 [uio_seville]
[c0000000763d7380] [c00000000064ab0c] .platform_drv_probe+0x78/0x104
[c0000000763d7410] [c00000000064786c] .really_probe+0x138/0x410
[c0000000763d74b0] [c000000000647d28] .driver_probe_device+0x78/0x160
[c0000000763d7540] [c00000000064812c] .device_driver_attach+0xc0/0xf0
[c0000000763d75d0] [c0000000006481d4] .__driver_attach+0x78/0x134
[c0000000763d7660] [c000000000644b20] .bus_for_each_dev+0x9c/0x114
[c0000000763d7710] [c000000000646fec] .driver_attach+0x24/0x38
[c0000000763d7780] [c000000000646748] .bus_add_driver+0x1c4/0x290
[c0000000763d7820] [c000000000649140] .driver_register+0x88/0x18c
[c0000000763d78a0] [c00000000064aa08] .__platform_driver_register+0x48/0x5c
[c0000000763d7910] [8000000000271d14] .seville_init_module+0x28/0x78 [uio_seville]
[c0000000763d7990] [c00000000000222c] .do_one_initcall+0x6c/0x2d4
[c0000000763d7a70] [c00000000010f724] .do_init_module+0x6c/0x2b4
[c0000000763d7b00] [c000000000111cd4] .load_module+0x226c/0x29cc
[c0000000763d7cf0] [c0000000001126b0] .__do_sys_finit_module+0xec/0x11c
[c0000000763d7e20] [c0000000000006a0] system_call+0x60/0x6c
Instruction dump:
4dc20020 e8630210 4e800020 60000000 38600000 4e800020 7c0802a6 fbc1fff0
7c7e1b78 f8010010 fbe1fff8 f821ff81 <e9230008> 2c290000 41c20048 e8690050
---[ end trace 566a20db648d02d6 ]---

 

0 Kudos
3,914 Views
yipingwang
NXP TechSupport
NXP TechSupport

How did you modify uio-seville source code?

Would you please send your patch to me to do more investigation?

0 Kudos
4,752 Views
yipingwang
NXP TechSupport
NXP TechSupport

I compiled your uio-seville source code in Yocto SDK 3.1 build environment, I encountered the attached compilation errors.

Please check your uio-seville source code again.

0 Kudos