Porting i.MX6 FEC ethernet device driver to L4Linux (l4re-snapshot-2014092821)

Mahdi Aichouch <[email protected]>
Newsgroups gmane.comp.micro-kernel.l4.devel
Message-ID <CAGBLRX7kujy-fU79u2yTgSUWnoH3FB6FF3YoXjYwXMw-uGCo6A@mail.gmail.com>
Hello,

Starting from a previous work [1] , I ported the i.MX6 FEC ethernet device
driver to L4Linux (l4re-snapshot-2014092821).

There is no compilation error, but when I tested on the Freescale i.MX6
Sabre SDB, it seems that L4Linux does not start the device. Below are the
boot messages of L4 Fiasco + L4Linux.

Does someone have an idea of what might be missing or wrong.

To reproduce the test case using l4re-snapshot-2014092821, all
configuration files and patches are given below.

Thank you very much in advance.

Best regards,
Mahdi

[1] http://os.inf.tu-dresden.de/pipermail/l4-hackers/2014/006462.html




L4 Bootstrapper
  Build: #10 Thu Oct 29 12:00:00 CET 2015, 4.8.3 20140320 (prerelease)
  Scanning up to 1024 MB RAM, starting at offset 32MB
  Memory size is 1024MB (10000000 - 4fffffff)
  RAM: 0000000010000000 - 000000004fffffff: 1048576kB
  Total RAM: 1024MB
  Scanning fiasco
  Scanning sigma0
  Scanning moe
  Moving up to 10 modules behind 11100000
  moving module 02 { 11928000-1196163f } -> { 11a18000-11a5163f } [235072]
  moving module 01 { 1191e000-1192738b } -> { 11a0e000-11a1738b } [37772]
  moving module 00 { 118b8000-1191d98b } -> { 119a8000-11a0d98b } [416140]
  moving module 09 { 115b8000-118b7fff } -> { 116a8000-119a7fff } [3145728]
  moving module 08 { 111d6000-115b7497 } -> { 112c6000-116a7497 } [4068504]
  moving module 07 { 111d5000-111d517b } -> { 112c5000-112c517b } [380]
  moving module 06 { 1107e000-111d446f } -> { 1116e000-112c446f } [1401968]
  moving module 05 { 1107d000-1107d35b } -> { 1116d000-1116d35b } [860]
  moving module 04 { 1102a000-1107cc1f } -> { 1111a000-1116cc1f } [338976]
  moving module 03 { 11010000-11029473 } -> { 11100000-11119473 } [103540]
  Loading fiasco
  Loading sigma0
  Loading moe
  find kernel info page...
  found kernel info page at 0x10002000
Regions of list 'regions'
    [ 10000000,  1000015f] {      160} Root   mbi_rt
    [ 10001000,  10001aff] {      b00} Kern   fiasco
    [ 10002000,  10072fff] {    71000} Kern   fiasco
    [ 10090000,  10096edf] {     6ee0} Sigma0 sigma0
    [ 10098000,  1009e177] {     6178} Sigma0 sigma0
    [ 10140000,  10171d77] {    31d78} Root   moe
    [ 10178000,  101934ab] {    1b4ac} Root   moe
    [ 11000000,  1100f58f] {     f590} Boot   bootstrap
    [ 11100000,  119a7fff] {   8a8000} Root   Module
  API Version: (87) experimental
  Sigma0 config    ip:10090100 sp:00000000
  Roottask config  ip:10140260 sp:00000000
  Starting kernel fiasco at 100012c8
Hello from Startup::stage2
Per_cpu_data_alloc: (orig: 0xf0062390-0xf0062d58)
Number of IRQs available at this GIC: 160
FPU0: Arch: VFPv3(3), Part: VFPv3(30), r: 4, v: 9, i: 41, t: hard, p:
dbl/sngl
L2: ID=410000c7 Type=9e340340 Aux=32070000 WMask=ffff S=0
L2: Type L2C-310 Size = 1024kB  Ways=16 Waysize=64
GIC: Switching IRQ 9 to secure
GIC: Switching IRQ 8 to secure
GIC: Switching IRQ 10 to secure
GIC: Switching IRQ 11 to secure
GIC: Switching IRQ 58 to secure
SERIAL ESC: allocated IRQ 58 for serial uart
Not using serial hack in slow timer handler.
Welcome to Fiasco.OC (arm)!
L4/Fiasco.OC arm microkernel (C) 1998-2013 TU Dresden
Rev: rexported compiled with gcc 4.8.3 for i.MX6    []
Build: #173 Thu Oct 29 11:16:01 CET 2015

Per_cpu_data_alloc: (orig: 0xf0062390-0xf0062d58)

KERNEL: Warning: Buddy::alloc: Size mismatch: 9c8 v 1000
Allocate 2504 bytes (2KB) for CPU[4] local storage (offset=1187c70,
0xf11ea000-0xf11ea9c8)
GIC: Switching IRQ 29 to secure
Number of CPUs: 4
Calibrating timer loop... Per_cpu_data_alloc: (orig: 0xf0062390-0xf0062d58)
done.

KERNEL: Warning: Buddy::alloc: Size mismatch: 9c8 v 1000
Allocate 2504 bytes (2KB) for CPU[1] local storage (offset=1189c70,
0xf11ec000-0xf11ec9c8)
MDB: use page size: 20
MDB: use page size: 12
SIGMA0: Hello!
  KIP @ 10002000
  allocated 4KB for maintenance structures
SIGMA0: Dump of all resource maps
RAM:------------------------
[4:10000000;10000fff]
[0:10073000;1008ffff]
[0:10097000;10097fff]
[0:1009f000;1013ffff]
[4:10140000;10171fff]
[0:10172000;10177fff]
[4:10178000;10193fff]
[0:10194000;110fffff]
[4:11100000;119a7fff]
[0:119a8000;4effffff]
IOMEM:----------------------
[0:0;fffffff]
[0:50000000;ffffffff]
MOE: Hello world
FPU1: Arch: VFPv3(3), Part: VFPv3(30), r: 4, v: 9, i: 41, t: hard, p:
dbl/sngl
MGIC: Switching IRQ 29 to secure
OCache config: ON
EID_PFR[01]:  00001231 00000011: foPer_cpu_data_alloc: (orig:
0xf0062390-0xf0062d58)
und ID_[DA]FR0: 00010444 00000000
 ID_MMFR[04]: 00100103 20000000 01230000 00102111
1CPU[1]: goes to idle loop
0
KERNEL: Warning: Buddy::alloc: Size mismatch: 9c8 v 1000
2250Allocate 2504 bytes (2KB) for CPU[2] local storage (offset=113fc70,
0xf11a2000-0xf11a29c8)
0 KByte free memory
MOE: found RAM from 10000000 to 4f000000
MOE: allocated 1008 KByte for the page array @0x10194000
MOE: virtual user address space [0-bfffffff]
MOE: rom name space cap -> [C:501000]
  BOOTFS: [11100000-11119474] [C:503000] l4re
  BOOTFS: [1111a000-1116cc20] [C:504000] ned
  BOOTFS: [1116d000-1116d35c] [C:505000] l4lx.cfg
  BOOTFS: [1116e000-112c4470] [C:506000] io
  BOOTFS: [112c5000-112c517c] [C:507000] arm-imx6.io
  BOOTFS: [112c6000-116a7498] [C:50800FPU2: Arch: VFPv3(3), Part:
VFPv3(30), r: 4, v: 9, i: 41, t: hard, p: dbl/sngl
0GIC: Switching IRQ 29 to secure
] vmlinCache config: ON
Per_cpu_data_alloc: (orig: 0xf0062390-0xf0062d58)
uzID_PFR[01]:  00001231 00000011.ar
KERNEL: Warning: Buddy::alloc: Size mismatch: 9c8 v 1000
m
 ID_[DA]FR0: 00010444 00000000
Allocate 2504 bytes (2KB) for CPU[3] local storage (offset=1149c70,
0xf11ac000-0xf11ac9c8)
ID_MMFR[04]: 00100103 20000000 01230000 00102111
CPU[2]: goes to idle loop
  BOOTFS: [116a8000-119a8000] [C:509000] ramdisk-arm.rd
MOE: cmdline: moe rom/l4lx.cfg
MOE: Starting: rom/ned rom/l4lx.cfg
MOE: loading 'rom/ned'
Ned says: Hi World!
Ned: loading file: 'rom/l4lx.cfg'
IO      | Io service
IO      | Verboseness level: 4
FPU3: Arch: VFPv3(3), Part: VFPv3(30), r: 4, v: 9, i: 41, t: hard, p:
dbl/sngl
IC: Switching IRQ 29 to secure
[Cache config: ON
3ID_PFR[01]:  00001231 000000113mIO    ID_[DA]FR0: 00010444 00000000
 ID_MMFR[04]: 00100103 20000000 01230000 00102111
 CPU[3]: goes to idle loop
 | unused physical memory space:
IO      |   [00000000000000-0000000fffffff]
IO      |   [00000050000000-000000ffffffff]
IO      | Loading: config 'rom/arm-imx6.io'
IO      | l4linux: [N12_GLOBAL__N_112Virtual_sbusE]
IO      |   Resources: ==== start ====
IO      |   Resources: ===== end =====
IO      |   L4ICU: [N2Vi6Sw_icuE]
IO      |     Resources: ==== start ====
IO      |     Resources: ===== end =====
IO      |   imx6q-fec.dev: [N2Vi9Proxy_devE]
IO      |     Resources: ==== start ====
IO      |     IOMEM   [00000002188000-0000000218bfff 4000] non-pref (32bit)
(align=3fff flags=2)
IO      |     IRQ     [00000000000096-00000000000096 1] none (32bit)
(align=0 flags=1)
IO      |     IRQ     [00000000000097-00000000000097 1] none (32bit)
(align=0 flags=1)
IO      |     Resources: ===== end =====
IO      |   dmamem: [N2Vi9Proxy_devE]
IO      |     Resources: ==== start ====
IO      |     IOMEM   [00000010430000-000000104affff 80000] non-pref
(32bit) (align=7ffff flags=2)
IO      |     Resources: ===== end =====
IO      | Real Hardware -----------------------------------
IO      | System Bus: hid=
IO      |   Resources: ==== start ====
IO      |   Resources: ===== end =====
IO      |   NIC: hid=imx6q-fec.0
IO      |     Clients: ===== start ====
IO      |       imx6q-fec.dev: [N2Vi9Proxy_devE]
IO      |     Clients: ===== end ====
IO      |     Resources: ==== start ====
IO      |     IOMEM   [00000002188000-0000000218bfff 4000] non-pref (32bit)
(align=3fff flags=2)
IO      |     IRQ     [00000000000096-00000000000096 1] none (32bit)
(align=0 flags=1)
IO      |     IRQ     [00000000000097-00000000000097 1] none (32bit)
(align=0 flags=1)
IO      |     Resources: ===== end =====
IO      |   DMAMEM: hid=dmamem
IO      |     Clients: ===== start ====
IO      |       dmamem: [N2Vi9Proxy_devE]
IO      |     Clients: ===== end ====
IO      |     Resources: ==== start ====
IO      |     IOMEM   [00000010430000-000000104affff 80000] non-pref
(32bit) (align=7ffff flags=2)
IO      |     Resources: ===== end =====
IO      | warning: could not register control interface at cap
'platform_ctl'
IO      | Ready. Waiting for request.
l4linux | PH  0 (t:        1) offs=00008000 vaddr=02000000 vend=02486494
l4linux |                     phys=02000000 ephys=02486494
l4linux |                     f_sz=003c339c memsz=00486494 flgs=rwx
l4linux | L4LINUX: Ma DBG: Virtual Address 02000000 End 02486494
l4linux |  Physical Address 02000000  End 02486494
l4linux | PH  1 (t:        4) offs=00373e1c vaddr=0236be1c vend=0236be40
l4linux |                     phys=0236be1c ephys=0236be40
l4linux |                     f_sz=00000024 memsz=00000024 flgs=r-x
l4linux | L4LINUX: Ma DBG: Virtual Address 0236be1c End 0236be40
l4linux |  Physical Address 0236be1c  End 0236be40
l4linux | PH  2 (t: 1685382481) offs=00000000 vaddr=00000000 vend=00000000
l4linux |                     phys=00000000 ephys=00000000
l4linux |                     f_sz=00000000 memsz=00000000 flgs=rwx
l4linux | L4LINUX: Ma DBG: Virtual Address 00000000 End 00000000
l4linux |  Physical Address 00000000  End 00000000
l4linux | L4LINUX: Ma DBG: Starting binary at 0x2000360, argc=13
argv=0xafff4f74 *argv=0xb1007ff0 argv0=rom/vmlinuz.arm
l4linux | External resolver is at 0xa800075c
l4linux | ======> L4Linux starting... <========
l4linux | Linux version 3.16.0-l4 (aichouch@aichouch-ThinkCentre-M90) (gcc
version 4.8.3 20140320 (prerelease) (Sourcery CodeBench Lite 2014.05-29) )
#41 SMP Thu Oct 29 11:59:28 CET 2015
l4linux | Binary name: rom/vmlinuz.arm
l4linux |    This is an AEABI build.
l4linux | Linux kernel command line (12 args): mem=64M console=ttyLv0
l4x_rd=rom/ramdisk-arm.rd root=1:0 ramdisk_size=4000 rw init=/linuxrc
earlyprintk=1 showpfexc=1 showghost=1 print-fatal-signals=1 ip=dhp
l4linux | CPU mapping (l:p)[1]: 0:0
l4linux | Image: 020000a0 - 02600000 [6143 KiB].
l4linux | Areas: Text:     020000a0 - 02396000 [3671kB] (a bit longer)
l4linux |        Data:     02396000 - 023be4a0 [161kB]
l4linux |        Initdata: 0236c000 - 02395900 [166kB]
l4linux |        BSS:      023c339c - 02486494 [780kB]
l4linux | Device scan:
l4linux |   Device: L4ICU
l4linux |   Device: imx6q-fec.dev
l4linux |     MEM: 02188000 - 0218bfff
l4linux |     IRQ: 00000096 - 00000096
l4linux |     IRQ: 00000097 - 00000097
l4linux |   Device: dmamem
l4linux |     MEM: 10430000 - 104affff
l4linux | Device scan done.
l4linux | L4LINUX: Ma DBG: l4lx_thread_create: Created thread 415 (cpu0)
(u:b3000e00, v:b3000c00, sp:02397fa4)
l4linux | main thread will be 415
l4linux | l4x_register_pointer_section: addr = 02000000 size = 4747264
l4linux | section-with-init: Virt: 0x2000000 to 0x2486493 [4633 KiB]
l4linux | section-with-init: Phys: 0x104bb000 to 0x10941493, [4633 KiB]
l4linux | Main thread running, waiting...
l4linux | Main thread running, waiting...
l4linux | stext virt 020000a0, phys 104bb0a0
l4linux | etext virt 02396000, phys 10851000
l4linux | L4x: Memory size: 64MB
l4linux | L4x: Setting superpages for main memory
l4linux | L4x: Adjusted memory start: 02000000
l4linux |     Main memory: Virt: 0x2600000 to 0x65fffff [65536 KiB]
l4linux |     Main memory: Phys: 0x11a00000 to 0x159fffff, [65536 KiB]
l4linux | l4x: vmalloc area: 06600000 - 0e600000
l4linux | l4x_register_pointer_section: addr = 02000000 size = 4747264
l4linux |            text: Virt: 0x2000000 to 0x2486493 [4633 KiB]
l4linux |            text: Phys: 0x104bb000 to 0x10941493, [4633 KiB]
l4linux | Booting Linux on physicl CPU 0x0
Linux version 3.16.0-l (aichouch@aichouch-ThinCentre-M90) (gcc versionm
4.8.3 20140320 (prerelease) (Sourcery CodeBenc Lite 2014.05-29) ) #41 MP
Thu Oct 29 11:59:28 CmET 2015
CPU: Fiasco [412fc09a]revision 10 (ARMv7), cr=0000000
CPU: PIPT / VIPT nonalasing data cache, VIPT nnaliasing instruction camche
Machine: L4
Ignoring unrecognised ag 0x00000000
bootconsole [earlykdb0 enabled
Forcing write-allocatecache policy for SMP
Forcing shared mapping for SMP
Memory policy: Data cahe writealloc
Page fault: addr = bffff003 pc = 0236fb80 (rw, T)
l4linux | Forward PF to our pager
l4linux | Loading: rom/ramdisk-arm.rd
l4linux | INITRD: Size of RAMdisk is 3072KiB
l4linux | INITRD: 00002000 - 0030000
l4x_virt_to_phys: Could not translate virt. address 0x2000
l4linux | v2p: 0: v:00000000-00001000 p:00000000-00001000 sz:00001000
l4linux | v2p: 1: v:02000000-02486494 p:104bb000-10941494 sz:00486494
l4linux | v2p: 2: v:02600000-06600000 p:11a00000-15a00000 sz:04000000
l4linux | v2p: 3: v:02000000-02486494 p:104bb000-10941494 sz:00486494
l4linux | ------------[ cut here ------------
WARNING: CPU: 0 PID: 0at
/home/aichouch/dev/l4e-snapshot-2014092821/srmc/l4linux/arch/l4/kernel/main.c:392
l4x_virt_tophys+0x7c/0xac()
Modules linked in:
CPU: 0 PID: 0 Comm: swpper Not tainted 3.16.0-4 #41
[<020109b4>] (unwind_bcktrace) from [<02007684] (show_stack+0x10/0x14)m
[<02007684>] (show_stak) from [<0228f2ec>] (dup_stack+0x84/0x94)
[<0228f2ec>] (dump_stak) from [<02020f5c>] (wan_slowpath_common+0x6c/0mx88)
[<02020f5c>] (warn_slopath_common) from [<0202014>]
(warn_slowpath_nulml+0x1c/0x24)
[<02021014>] (warn_slopath_null) from [<0200298>]
(l4x_virt_to_phys+0xm7c/0xac)
[<02002908>] (l4x_virtto_phys) from [<0236ef4c]
(l4x_load_initrd+0x208m/0x240)
[<0236ef4c>] (l4x_loadinitrd) from [<02370860> (setup_arch+0x89c/0x8d4m)
[<02370860>] (setup_arh) from [<0236c5c8>] (strt_kernel+0x8c/0x370)
[<0236c5c8>] (start_kenel) from [<00000000>] ( (null))
---[ end trace 3406ff2bd97382e ]---
l4x_virt_to_phys: Could not translate virt. address 0x302000
l4linux | v2p: 0: v:00000000-00001000 p:00000000-00001000 sz:00001000
l4linux | v2p: 1: v:02000000-02486494 p:104bb000-10941494 sz:00486494
l4linux | v2p: 2: v:02600000-06600000 p:11a00000-15a00000 sz:04000000
l4linux | v2p: 3: v:02000000-02486494 p:104bb000-10941494 sz:00486494
l4linux | ------------[ cut here ------------
WARNING: CPU: 0 PID: 0at
/home/aichouch/dev/l4e-snapshot-2014092821/srmc/l4linux/arch/l4/kernel/main.c:392
l4x_virt_tophys+0x7c/0xac()
Modules linked in:
CPU: 0 PID: 0 Comm: swpper Tainted: G        W    3.16.0-l4 #41
[<020109b4>] (unwind_bcktrace) from [<02007684] (show_stack+0x10/0x14)m
[<02007684>] (show_stak) from [<0228f2ec>] (dup_stack+0x84/0x94)
[<0228f2ec>] (dump_stak) from [<02020f5c>] (wan_slowpath_common+0x6c/0mx88)
[<02020f5c>] (warn_slopath_common) from [<0202014>]
(warn_slowpath_nulml+0x1c/0x24)
[<02021014>] (warn_slopath_null) from [<0200298>]
(l4x_virt_to_phys+0xm7c/0xac)
[<02002908>] (l4x_virtto_phys) from [<0236ef58]
(l4x_load_initrd+0x214m/0x240)
[<0236ef58>] (l4x_loadinitrd) from [<02370860> (setup_arch+0x89c/0x8d4m)
[<02370860>] (setup_arh) from [<0236c5c8>] (strt_kernel+0x8c/0x370)
[<0236c5c8>] (start_kenel) from [<00000000>] ( (null))
---[ end trace 3406ff2bd97382f ]---
RAMdisk from 00002000 (00002000) to 00302000 (00302000) [3072KiB]
l4linux | PERCPU: Embedded 7 page/cpu @06521000 s6400 r812 d14080 u32768
Built 1 zonelists in Zne order, mobility groupng on.  Total pages: 177m16
Kernel command line: mm=64M console=ttyLv0 l4xrd=rom/ramdisk-arm.rd
romot=1:0 ramdisk_size=4000 rw init=/linuxrc earlyrintk=1 showpfexc=1
showhost=1 print-fatal-signamls=1 ip=dhcp
L4LINUX CEA version
PID hash table entries 512 (order: -1, 2048 byes)
Dentry cache hash tabl entries: 16384 (order: , 65536 bytes)
Inode-cache hash tableentries: 8192 (order: 3,32768 bytes)
Memory: 64776K/71680K vailable (2739K kernel cde, 161K rwdata, 764K
romdata, 166K init, 780K bss, 6904K reserved)
Virtual kernel memory ayout:
    vector  : 0xbffff00 - 0xc0000000   (   4 k)
    fixmap  : 0xffc0000 - 0xffe00000   (2048 k)
    vmalloc : 0x0660000 - 0x0e600000   ( 128 M)
    lowmem  : 0x0000000 - 0x06600000   ( 102 M)
    modules : 0x0101000 - 0x02000000   (  15 M)
      .text : 0x0200000 - 0x0236be40   (3504 k)
      .init : 0x0236c00 - 0x02395900   ( 167 k)
      .data : 0x0239600 - 0x023be4a0   ( 162 k)
       .bss : 0x023c33c - 0x02486494   ( 781 k)
Hierarchical RCU impleentation.
l4linux RCU restricting CPUs rom NR_CPUS=4 to nr_cpu_ds=1.
RCU: Adjusting geometr for rcu_fanout_leaf=16,nr_cpu_ids=1
NR_IRQS:220
l4timer: Using IRQ210
L4LINUX: Ma DBG: l4lx_thread_create: Created thread 41b (timer0)
(u:b3000a00, v:00000000, sp:0241dfa0)
l4linux | sched_clock: 64 bits at1000kHz, resolution 1000s, wraps every
214748364m8000ns
Console: colour dummy evice 80x30
console [ttyLv0] enabled
console [ttyLv0] enabld
bootconsole [earlykdb0] disabled
bootconsole [earlykdb0 disabled
Calibrating delay loop... 1574.50 BogoMIPS (lpj=7872512)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
CPU: Testing write buffer coherency: ok
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
Setting up static identity map for 0x2294850 - 0x2294850
Brought up 1 CPUs
SMP: Total of 1 processors activated.
CPU: All CPU(s) started in SVC mode.
VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
Added static device 'L4ICU' with 0 resources.
Added static device 'imx6q-fec.dev' with 3 resources.
DMA mem phys at 10430000 - 104affff
DMA mem virt at 00302000 - 00381fff
pps_core: LinuxPPS API ver. 1 registered
pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <
[email protected]>
PTP clock support registered
Switched to clocksource l4kipclk
NET: Registered protocol family 2
TCP established hash table entries: 1024 (order: 0, 4096 bytes)
TCP bind hash table entries: 1024 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
TCP: reno registered
UDP hash table entries: 256 (order: 1, 8192 bytes)
UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
NET: Registered protocol family 1
Trying to unpack rootfs image as initramfs...
rootfs image is not initramfs (junk in compressed archive); looks like an
initrd
INITRD: Freeing memory.
l4x: Checks passed.
NetWinder Floating Point Emulator V0.97 (double precision)
futex hash table entries: 256 (order: 2, 16384 bytes)
msgmni has been set to 126
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
L4 serial driver
ttyLv0 at MMIO 0x1 (irq = 211, base_baud = 230400) is a L4
l4ser_shm: L4 shared mem serial driver
l4cdds: No name given, not starting.
brd: module loaded
l4bdds: No name given, not starting.
mousedev: PS/2 mouse device common for all mice
TCP: cubic registered
NET: Registered protocol family 17
RAMDISK: ext2 filesystem found at block 0
RAMDISK: Loading 3072KiB [1 disk] into ram disk... done.
EXT4-fs (ram0): couldn't mount as ext3 due to feature incompatibilities
EXT4-fs (ram0): mounting ext2 file system using the ext4 subsystem
EXT4-fs (ram0): mounted filesystem without journal. Opts: (null)
VFS: Mounted root (ext2 filesystem) on device 1:0.
Freeing unused kernel memory: 164K (0236c000 - 02395000)
mount: mounting proc on /proc failed: Device or resource busy
mount: mounting devtmpfs on /dev failed: No such device
ifconfig: SIOCSIFADDR: No such device

Please press Enter to activate this console.
#/



- Modification to L4Linux:

-------------------------------------------------------------------------------------------------------------------------------
1- mach_setup.c patch:
-------------------------------------------------------------------------------------------------------------------------------

---
/home/aichouch/l4re-snapshot-2014092821/src/l4linux/arch/l4/kernel/arch-arm/mach_setup.c
2014-09-28
21:51:04.000000000 +0200
+++ l4linux/arch/l4/kernel/arch-arm/mach_setup.c 2015-10-28
14:57:04.831851872 +0100
@@ -5,15 +5,84 @@
 #include <linux/platform_device.h>
 #include <linux/ata_platform.h>
 #include <linux/smsc911x.h>
+#include <linux/fec.h>
 #include <linux/slab.h>
 #include <linux/list.h>

+
 #include <asm/generic/devs.h>

 #ifdef CONFIG_L4_DMAPOOL
 #include <asm/l4x/dma.h>
 #endif

+#define PHY_ID_AR8031 0x004dd074
+
+static struct resource imx6q_fec_resources[] = {
+ {
+ .start = 0x02188000,
+ .end   = 0x0218BFFF,
+ .name  = "imx6q-fec mem",
+ .flags = IORESOURCE_MEM
+ },
+ {
+ .start = 150,
+ .end   = 151,
+ .name  = "imx6q-fec irq",
+ .flags = IORESOURCE_IRQ
+ }
+};
+
+static struct fec_platform_data imx6q_fec_pd = {
+ .phy = PHY_INTERFACE_MODE_RGMII
+};
+
+static struct platform_device imx6q_fec_dev = {
+ .name = "imx6q-fec",
+ .id   = 0,
+ .resource = imx6q_fec_resources,
+ .num_resources = ARRAY_SIZE(imx6q_fec_resources),
+ .dev = {
+ .platform_data = &imx6q_fec_pd,
+ },
+};
+
+static int ar8031_phy_fixup(struct phy_device *dev)
+{
+ u16 val;
+
+ /* to enable AR8031 output a 125Mhz clk from CLK_25M */
+ phy_write(dev, 0xd, 0x7);
+ phy_write(dev, 0xe, 0x8016);
+ phy_write(dev, 0xd, 0x4007);
+
+ val  = phy_read(dev, 0xe);
+ val &= 0xffe3;
+ val |= 0x18;
+ phy_write(dev, 0xe, val);
+
+ /* introduce tx clock delay */
+ phy_write(dev, 0x1d, 0x5);
+ val = phy_read(dev, 0x1e);
+ val |= 0x0100;
+ phy_write(dev, 0x1e, val);
+
+ return 0;
+}
+
+static void __init imx6q_enet_phy_init(void)
+{
+ if (IS_BUILTIN(CONFIG_PHYLIB)) {
+ phy_register_fixup_for_uid(PHY_ID_AR8031, 0xffffffff, ar8031_phy_fixup);
+ }
+}
+
+static L4X_DEVICE_CB(imx6q_device_cb_fec)
+{
+ platform_device_register(&imx6q_fec_dev);
+ imx6q_enet_phy_init();
+}
+

 static int dev_init_done;

@@ -238,6 +307,7 @@
  l4x_register_platform_device_callback("compactflash",
realview_device_cb_pata);
  l4x_register_platform_device_callback("smsc911x",
realview_device_cb_smsc);
  l4x_register_platform_device_callback("aaci",         aaci_cb);
+ l4x_register_platform_device_callback("imx6q-fec.dev",
imx6q_device_cb_fec);
 #endif
 }

-------------------------------------------------------------------------------------------------------------------------------
2- fec.h patch:
-------------------------------------------------------------------------------------------------------------------------------

---
/home/aichouch/l4re-snapshot-2014092821/src/l4linux/drivers/net/ethernet/freescale/fec.h
2014-09-28
21:51:04.000000000 +0200
+++ l4linux/drivers/net/ethernet/freescale/fec.h 2015-10-28
15:02:26.943851538 +0100
@@ -19,7 +19,7 @@

 #if defined(CONFIG_M523x) || defined(CONFIG_M527x) ||
defined(CONFIG_M528x) || \
     defined(CONFIG_M520x) || defined(CONFIG_M532x) || \
-    defined(CONFIG_ARCH_MXC) || defined(CONFIG_SOC_IMX28)
+    defined(CONFIG_ARCH_MXC) || defined(CONFIG_SOC_IMX28) || CONFIG_L4
 /*
  * Just figures, Motorola would have to change the offsets for
  * registers in the same peripheral device on different models
@@ -147,7 +147,7 @@
 /*
  * Define the buffer descriptor structure.
  */
-#if defined(CONFIG_ARCH_MXC) || defined(CONFIG_SOC_IMX28)
+#if defined(CONFIG_ARCH_MXC) || defined(CONFIG_SOC_IMX28) ||
defined(CONFIG_L4)
 struct bufdesc {
  unsigned short cbd_datlen; /* Data length */
  unsigned short cbd_sc; /* Control and status info */


-------------------------------------------------------------------------------------------------------------------------------
3- fec_main.c patch:
-------------------------------------------------------------------------------------------------------------------------------

---
/home/aichouch/l4re-snapshot-2014092821/src/l4linux/drivers/net/ethernet/freescale/fec_main.c
2014-09-28
21:51:04.000000000 +0200
+++ l4linux/drivers/net/ethernet/freescale/fec_main.c 2015-10-28
15:04:41.011851399 +0100
@@ -61,6 +61,12 @@

 #include "fec.h"

+#ifdef CONFIG_L4
+//ahb clock
+#define clk_get_rate(x) 132000000
+
+#endif
+
 static void set_multicast_list(struct net_device *ndev);

 #if defined(CONFIG_ARM)
@@ -2535,12 +2541,22 @@
  fep->phy_interface = ret;
  }

+#ifdef CONFIG_L4
+ //Do not setup Clocks or regulator
+ fep->clk_ahb = NULL;
+ fep->clk_ipg = NULL;
+ fep->clk_enet_out = NULL;
+ fep->clk_ptp = NULL;
+ fep->reg_phy = NULL;
+#else
+
  fep->clk_ipg = devm_clk_get(&pdev->dev, "ipg");
  if (IS_ERR(fep->clk_ipg)) {
  ret = PTR_ERR(fep->clk_ipg);
  goto failed_clk;
  }

+
  fep->clk_ahb = devm_clk_get(&pdev->dev, "ahb");
  if (IS_ERR(fep->clk_ahb)) {
  ret = PTR_ERR(fep->clk_ahb);
@@ -2576,6 +2592,8 @@
  fep->reg_phy = NULL;
  }

+#endif
+
  fec_reset_phy(pdev);

  if (fep->bufdesc_ex)

-------------------------------------------------------------------------------------------------------------------------------
4- fec_ptp.c patch:
-------------------------------------------------------------------------------------------------------------------------------

---
/home/aichouch/l4re-snapshot-2014092821/src/l4linux/drivers/net/ethernet/freescale/fec_ptp.c
2014-09-28
21:51:04.000000000 +0200
+++ l4linux/drivers/net/ethernet/freescale/fec_ptp.c 2015-10-28
14:39:23.863852973 +0100
@@ -48,6 +48,9 @@

 #include "fec.h"

+//ahb clock
+#define clk_get_rate(x) 132000000
+
 /* FEC 1588 register bits */
 #define FEC_T_CTRL_SLAVE                0x00002000
 #define FEC_T_CTRL_CAPTURE              0x00000800


-------------------------------------------------------------------------------------------------------------------------------
5- Freescale Kconfig patch:
-------------------------------------------------------------------------------------------------------------------------------

---
/home/aichouch/l4re-snapshot-2014092821/src/l4linux/drivers/net/ethernet/freescale/Kconfig
2014-09-28
21:51:04.000000000 +0200
+++ l4linux/drivers/net/ethernet/freescale/Kconfig 2015-10-28
14:34:45.955853261 +0100
@@ -7,7 +7,7 @@
  default y
  depends on FSL_SOC || QUICC_ENGINE || CPM1 || CPM2 || PPC_MPC512x || \
    M523x || M527x || M5272 || M528x || M520x || M532x || \
-   ARCH_MXC || ARCH_MXS || (PPC_MPC52xx && PPC_BESTCOMM)
+   ARCH_MXC || ARCH_MXS || (PPC_MPC52xx && PPC_BESTCOMM)  || L4
  ---help---
   If you have a network (Ethernet) card belonging to this class, say Y
   and read the Ethernet-HOWTO, available from
@@ -23,7 +23,7 @@
 config FEC
  tristate "FEC ethernet controller (of ColdFire and some i.MX CPUs)"
  depends on (M523x || M527x || M5272 || M528x || M520x || M532x || \
-   ARCH_MXC || SOC_IMX28)
+   ARCH_MXC || SOC_IMX28)  || L4
  default ARCH_MXC || SOC_IMX28 if ARM
  select PHYLIB
  select PTP_1588_CLOCK


-------------------------------------------------------------------------------------------------------------------------------
6- L4Linux KConfig patch:
-------------------------------------------------------------------------------------------------------------------------------

--- /home/aichouch/l4re-snapshot-2014092821/src/l4linux/arch/l4/Kconfig
2014-09-28
21:51:04.000000000 +0200
+++ l4linux/arch/l4/Kconfig 2015-10-28 14:39:21.515852975 +0100
@@ -63,16 +63,21 @@
  config L4_PLATFORM_GENERIC
  bool "Generic"
  select CLKDEV_LOOKUP
- select L4_CLK_NOOP
+ select HAVE_CLK_PREPARE
+ select HAVE_MACH_CLKDEV
+ select COMMON_CLK

  config L4_PLATFORM_REALVIEW
  bool "Realview"
  select CLKDEV_LOOKUP
  select OUTER_CACHE
- select L4_CLK_NOOP
+

 endchoice

+config L4_CLK_NOOP
+ bool "L4 Clock Noop"
+ depends on (L4_PLATFORM_GENERIC || L4_PLATFORM_REALVIEW)

 menu "Features"



- Note that the L4_CLK_NOOP option should be disabled otherwise a link
error occurs when compiling L4Linux.


-------------------------------------------------------------------------------------------------------------------------------
7- arm-imx6.io file:
-------------------------------------------------------------------------------------------------------------------------------



hw-root
{
  NIC => new Device()
  {
    .hid = "imx6q-fec.0";
    new-res Mmio(0x02188000 .. 0x0218BFFF);
    new-res Irq(150);
    new-res Irq(151);
  }

  DMAMEM => new Device()
  {
   .hid = "dmamem";
   new-res Mmio_ram(0x80000, 0);
  }
}

l4linux => new System_bus()
{
#NIC => wrap(hw-root.NIC);
  "imx6q-fec.dev" => wrap(hw-root.NIC);
  "dmamem" => wrap(hw-root.DMAMEM);
}

-------------------------------------------------------------------------------------------------------------------------------
8- l4lx.cfg file:
-------------------------------------------------------------------------------------------------------------------------------

-- vim:set ft=lua:

loader       = L4.default_loader;
vbus_l4linux = loader:new_channel();


local lxname = "vmlinuz";
if L4.Info.arch() == "arm" then
  lxname = "vmlinuz.arm";
end

loader:start(
{
  caps = {
           sigma0  = L4.cast(L4.Proto.Factory,
L4.Env.sigma0):create(L4.Proto.Sigma0);
           icu     = L4.Env.icu;
           l4linux = vbus_l4linux:svr();
         },

  log = { "IO", "y" },
  l4re_dbg = L4.Dbg.Warn,
}, "rom/io -vvv rom/arm-imx6.io");


L4.default_loader:start(
{
  caps = {
            vbus = vbus_l4linux;
            log  = L4.Env.log:m("rws"),
  },

  l4re_dbg = L4.Dbg.Warn,
  log = { "l4linux", "yellow" },
}, "rom/" .. lxname .. " mem=64M console=ttyLv0 l4x_rd=rom/ramdisk-" ..
L4.Info.arch() .. ".rd root=1:0 ramdisk_size=4000 rw init=/linuxrc
earlyprintk=1 showpfexc=1 showghost=1 print-fatal-signals=1 ip=dhc\
p");

_______________________________________________
l4-hackers mailing list
[email protected]
http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.