porting qca wifi sdio module got error after insmod ko file

Hi,

I am porting qca9377 sdio wifi module to kernel 4.9. there is error log as below.

if possible share any comment to fix this issue.

my kernel image is xipImage format

key log as below. entire log in attached file.

$ insmod wlan.ko
wlan: loading out-of-tree module taints kernel.
vmap allocation for size 438272 failed: use vmalloc=<size> to increase size
insmod: vmalloc: allocation failure: 431768 bytes, mode:0x24000c0(GFP_KERNEL)
CPU: 0 PID: 489 Comm: insmod Tainted: G O 4.9.154-g9aea9c9-dirty #18
Hardware name: Generic R7S72100 (Flattened Device Tree)
[<bf809669>] (unwind_backtrace) from [<bf80740b>] (show_stack+0xb/0xc)
[<bf80740b>] (show_stack) from [<bf845087>] (warn_alloc+0x89/0xba)
[<bf845087>] (warn_alloc) from [<bf85d955>] (__vmalloc_node_range+0x11d/0x138)
[<bf85d955>] (__vmalloc_node_range) from [<bf8081cf>] (module_alloc+0x2b/0x3c)
[<bf8081cf>] (module_alloc) from [<bf83bcad>] (load_module+0x4b7/0x122e)
[<bf83bcad>] (load_module) from [<bf83cb45>] (SyS_finit_module+0x4d/0x56)
[<bf83cb45>] (SyS_finit_module) from [<bf804f21>] (ret_fast_syscall+0x1/0x54)
Mem-Info:
active_anon:82 inactive_anon:3 isolated_anon:0
active_file:9 inactive_file:946 isolated_file:0
unevictable:0 dirty:0 writeback:0 unstable:0
slab_reclaimable:27 slab_unreclaimable:454
mapped:0 shmem:8 pagetables:56 bounce:0
free:4213 free_pcp:0 free_cma:0

 

 

 

qca9377.txt

U-Boot 2017.05-gf7ba111 (Mar 07 2019 - 05:20:28 -0800)

CPU: Renesas Electronics CPU rev 0.0
Board: RSKRZA1
I2C:   ready
DRAM:  10 MiB
MMC:   sh-sdhi: 0
SF: Detected s25fl512s_256k with page size 512 Bytes, erase size 256 KiB, total 64 MiB
In:    serial_sh
Out:   serial_sh
Err:   serial_sh
		      SPI Flash Memory Map
		------------------------------------
		         Start      Size     SPI
		u-boot:  0x00000000 0x080000 0
		   env:  0x00080000 0x040000 0
		    DT:  0x000C0000 0x040000 0
		Kernel:  0x00100000 0x280000 0+1 (size*=2)
		rootfs:  0x00400000 0x1C00000 0+1 (size*=2)
Net:   sh_eth
Hit any key to stop autoboot:  3  2  1  0 
SF: Detected s25fl512s_256k with page size 512 Bytes, erase size 256 KiB, total 64 MiB
device 0 offset 0xc0000, size 0x8000
SF: 32768 bytes @ 0xc0000 Read: OK
Current Mode: Read Mode (3-byte Addr) (RZ/A1 reset value)
SF: Dual SPI mode
SF: Detected s25fl512s_256k with page size 512 Bytes, erase size 256 KiB, total 64 MiB
New Mode: Quad I/O Read Mode (4-byte Addr)
Booting Linux...
Booting Linux on physical CPU 0x0
Linux version 4.9.154-g9aea9c9-dirty (jjsw@ubuntu) (gcc version 6.4.1 20170707 (Linaro GCC 6.4-2017.08) ) #18 Mon Apr 1 21:05:35 PDT 2019
CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=58c53c7d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
OF: fdt:Machine model: RSKRZA1
debug: ignoring loglevel setting.
bootconsole [earlycon0] enabled
Malformed early option 'earlycon'
Memory policy: Data cache writeback
On node 0 totalpages: 8192
free_area_init_node: node 0, pgdat c003df24, node_mem_map c1fb9000
  Normal zone: 64 pages used for memmap
  Normal zone: 0 pages reserved
  Normal zone: 8192 pages, LIFO batch:0
CPU: All CPU(s) started in SVC mode.
pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
pcpu-alloc: [0] 0 
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
Kernel command line: ignore_loglevel earlyprintk earlycon rootfstype=axfs rootflags=physaddr=0x18800000
PID hash table entries: 128 (order: -3, 512 bytes)
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 31888K/32768K available (2578K kernel code, 172K rwdata, 1228K rodata, 129K init, 231K bss, 880K reserved, 0K cma-reserved)
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    vmalloc : 0xc2800000 - 0xff800000   ( 976 MB)
    lowmem  : 0xc0000000 - 0xc2000000   (  32 MB)
    modules : 0xbf800000 - 0xc0000000   (   8 MB)
      .text : 0xbf800000 - 0xbfbb7b80   (3807 kB)
      .init : 0xc000a000 - 0xc0016000   (  48 kB)
      .data : 0xc0008000 - 0xc003f1c0   ( 221 kB)
       .bss : 0xc003f1c0 - 0xc0078dd0   ( 232 kB)
NR_IRQS:16 nr_irqs:16 16
L2C-310 dynamic clock gating enabled, standby mode enabled
L2C-310 cache controller enabled, 8 ways, 128 kB
L2C-310: CACHE_ID 0x410000c8, AUX_CTRL 0x06020000
clocksource: ostm: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 57352151442 ns
sched_clock: 32 bits at 33MHz, resolution 30ns, wraps every 64440619504ns
ostm: used for clocksource
ostm: used for clock events
Console: colour dummy device 80x30
console [tty0] enabled
bootconsole [earlycon0] disabled
��Booting Linux on physical CPU 0x0
Linux version 4.9.154-g9aea9c9-dirty (jjsw@ubuntu) (gcc version 6.4.1 20170707 (Linaro GCC 6.4-2017.08) ) #18 Mon Apr 1 21:05:35 PDT 2019
CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=58c53c7d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
OF: fdt:Machine model: RSKRZA1
debug: ignoring loglevel setting.
bootconsole [earlycon0] enabled
Malformed early option 'earlycon'
Memory policy: Data cache writeback
On node 0 totalpages: 8192
free_area_init_node: node 0, pgdat c003df24, node_mem_map c1fb9000
  Normal zone: 64 pages used for memmap
  Normal zone: 0 pages reserved
  Normal zone: 8192 pages, LIFO batch:0
CPU: All CPU(s) started in SVC mode.
pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
pcpu-alloc: [0] 0 
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
Kernel command line: ignore_loglevel earlyprintk earlycon rootfstype=axfs rootflags=physaddr=0x18800000
PID hash table entries: 128 (order: -3, 512 bytes)
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 31888K/32768K available (2578K kernel code, 172K rwdata, 1228K rodata, 129K init, 231K bss, 880K reserved, 0K cma-reserved)
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    vmalloc : 0xc2800000 - 0xff800000   ( 976 MB)
    lowmem  : 0xc0000000 - 0xc2000000   (  32 MB)
    modules : 0xbf800000 - 0xc0000000   (   8 MB)
      .text : 0xbf800000 - 0xbfbb7b80   (3807 kB)
      .init : 0xc000a000 - 0xc0016000   (  48 kB)
      .data : 0xc0008000 - 0xc003f1c0   ( 221 kB)
       .bss : 0xc003f1c0 - 0xc0078dd0   ( 232 kB)
NR_IRQS:16 nr_irqs:16 16
L2C-310 dynamic clock gating enabled, standby mode enabled
L2C-310 cache controller enabled, 8 ways, 128 kB
L2C-310: CACHE_ID 0x410000c8, AUX_CTRL 0x06020000
clocksource: ostm: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 57352151442 ns
sched_clock: 32 bits at 33MHz, resolution 30ns, wraps every 64440619504ns
ostm: used for clocksource
ostm: used for clock events
Console: colour dummy device 80x30
console [tty0] enabled
bootconsole [earlycon0] disabled
Calibrating delay loop (skipped) preset value.. 800.00 BogoMIPS (lpj=4000000)
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: Spectre v2: using BPIALL workaround
Setting up static identity map for 0x7800200 - 0x780024c
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
futex hash table entries: 256 (order: -1, 3072 bytes)
pinctrl core: initialized pinctrl subsystem
Detected Renesas RZ/A r7s72100 
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
No ATAGs?
pinctrl-rza1 fcfe3000.pin-controller: Parsed gpiochip gpio-0 with 6 pins
pinctrl-rza1 fcfe3000.pin-controller: Parsed gpiochip gpio-1 with 16 pins
pinctrl-rza1 fcfe3000.pin-controller: Parsed gpiochip gpio-2 with 16 pins
pinctrl-rza1 fcfe3000.pin-controller: Parsed gpiochip gpio-3 with 16 pins
pinctrl-rza1 fcfe3000.pin-controller: Parsed gpiochip gpio-4 with 16 pins
pinctrl-rza1 fcfe3000.pin-controller: Parsed gpiochip gpio-5 with 11 pins
pinctrl-rza1 fcfe3000.pin-controller: Parsed gpiochip gpio-6 with 16 pins
pinctrl-rza1 fcfe3000.pin-controller: Parsed gpiochip gpio-7 with 16 pins
pinctrl-rza1 fcfe3000.pin-controller: Parsed gpiochip gpio-8 with 16 pins
pinctrl-rza1 fcfe3000.pin-controller: Parsed gpiochip gpio-9 with 8 pins
pinctrl-rza1 fcfe3000.pin-controller: Parsed gpiochip gpio-10 with 16 pins
pinctrl-rza1 fcfe3000.pin-controller: Parsed gpiochip gpio-11 with 16 pins
pinctrl-rza1 fcfe3000.pin-controller: Registered 12 gpio controllers
pinctrl-rza1 fcfe3000.pin-controller: RZ/A1 pin controller and gpio successfully registered
vgaarb: loaded
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
sh_mtu2 fcff0000.timer: ch0: used for clock events
clocksource: Switched to clocksource ostm
NET: Registered protocol family 2
TCP established hash table entries: 1024 (order: 0, 4096 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
PCI: CLS 0 bytes, default 64
workingset: timestamp_bits=30 max_order=13 bucket_order=0
squashfs: version 4.0 (2009/01/31) Phillip Lougher
jffs2: version 2.2. (NAND) c 2001-2006 Red Hat, Inc.
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
pinctrl-rza1 fcfe3000.pin-controller: Parsed function and group vdc50 with 28 pins
vdc5fb fcff7400.display: fcff7400.display: [gwp0700cnwv04] dotclock 33.325 MHz, dcdr 2
vdc5fb: Layer 2 Enabled (800x480 @ 0x60000000)
Console: switching to colour frame buffer device 100x30
graphics fb0: registered fcff7400.display as 800x480 @ 60 Hz, 32 bpp.
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
SuperH (H)SCI(F) driver initialized
pinctrl-rza1 fcfe3000.pin-controller: Parsed function and group serial2 with 2 pins
e8008000.serial: ttySC0 at MMIO 0xe8008000 (irq = 19, base_baud = 0) is a scif
console [ttySC0] enabled
1 ofpart partitions found on MTD device 18000000.qspi
Creating 1 MTD partitions on "18000000.qspi":
0x000000800000-0x000001000000 : "user"
libphy: Fixed MDIO Bus: probed
pinctrl-rza1 fcfe3000.pin-controller: Parsed function and group ether with 18 pins
libphy: sh_mii: probed
sh-eth e8203000.ethernet eth0: Base address at 0xe8203000, 02:03:04:05:06:07, IRQ 58.
r8a66597_hcd r8a66597_hcd.0: USB Host Controller
r8a66597_hcd r8a66597_hcd.0: new USB bus registered, assigned bus number 1
r8a66597_hcd r8a66597_hcd.0: irq 65, io base 0xe8010000
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
r8a66597_hcd r8a66597_hcd.1: USB Host Controller
r8a66597_hcd r8a66597_hcd.1: new USB bus registered, assigned bus number 2
r8a66597_hcd r8a66597_hcd.1: irq 66, io base 0xe8207000
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 1 port detected
usbcore: registered new interface driver usb-storage
rtc rtc0: invalid alarm value: 1970-1-1 255:255:255
sh-rtc fcff1000.rtc: rtc core: registered sh as rtc0
i2c /dev entries driver
pinctrl-rza1 fcfe3000.pin-controller: Parsed function and group i2c0 with 2 pins
pinctrl-rza1 fcfe3000.pin-controller: Parsed function and group irq1 with 1 pins
ft5x06-ts 0-0038: ft5x06_init_panel: could not detect ft5x06
ft5x06-ts 0-0038: could not init touch panel
ft5x06-ts: probe of 0-0038 failed with error -5
i2c-riic fcfee000.i2c: registered with 400000Hz bus speed
pinctrl-rza1 fcfe3000.pin-controller: Parsed function and group i2c3 with 2 pins
i2c-riic fcfeec00.i2c: registered with 100000Hz bus speed
cpu cpu0: failed to get clock: -2
cpufreq-dt: probe of cpufreq-dt failed with error -2
pinctrl-rza1 fcfe3000.pin-controller: Parsed function and group sdhi1 with 8 pins
sh_mobile_sdhi e804e800.sd: mmc0 base at 0xe804e800 max clock rate 66 MHz
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
NET: Registered protocol family 10
random: fast init done
sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
NET: Registered protocol family 17
Key type dns_resolver registered
�VFS: Mounted root (axfs filesystem) readonly on device 0:11.
devtmpfs: mounted
Freeing unused kernel memory: 48K
This architecture does not have kernel memory protection.
�mmc0: queuing unknown CIS tuple 0x01 (3 bytes)
mmc0: queuing unknown CIS tuple 0x1a (5 bytes)
mmc0: queuing unknown CIS tuple 0x1b (8 bytes)
mmc0: queuing unknown CIS tuple 0x14 (0 bytes)
Starting logging: OK
mmc0: queuing unknown CIS tuple 0x80 (1 bytes)
mmc0: queuing unknown CIS tuple 0x81 (1 bytes)
mmc0: queuing unknown CIS tuple 0x82 (1 bytes)
mmc0: new high speed SDIO card at address 0001
read-only file system detected...done
Starting network: OK
Wed Nov  1 09:00:00 UTC 2017
Console: switching to colour dummy device 80x30

Welcome to Buildroot
buildroot login: root
$ cd /lib/fir$ cd /lib/firmware/
$ ls
bdwlan30.bin  qwlan30.bin   wlan
otp30.bin     utf30.bin     wlan.ko
$ insmod wlan.ko
wlan: loading out-of-tree module taints kernel.
vmap allocation for size 438272 failed: use vmalloc=<size> to increase size
insmod: vmalloc: allocation failure: 431768 bytes, mode:0x24000c0(GFP_KERNEL)
CPU: 0 PID: 489 Comm: insmod Tainted: G           O    4.9.154-g9aea9c9-dirty #18
Hardware name: Generic R7S72100 (Flattened Device Tree)
[<bf809669>] (unwind_backtrace) from [<bf80740b>] (show_stack+0xb/0xc)
[<bf80740b>] (show_stack) from [<bf845087>] (warn_alloc+0x89/0xba)
[<bf845087>] (warn_alloc) from [<bf85d955>] (__vmalloc_node_range+0x11d/0x138)
[<bf85d955>] (__vmalloc_node_range) from [<bf8081cf>] (module_alloc+0x2b/0x3c)
[<bf8081cf>] (module_alloc) from [<bf83bcad>] (load_module+0x4b7/0x122e)
[<bf83bcad>] (load_module) from [<bf83cb45>] (SyS_finit_module+0x4d/0x56)
[<bf83cb45>] (SyS_finit_module) from [<bf804f21>] (ret_fast_syscall+0x1/0x54)
Mem-Info:
active_anon:82 inactive_anon:3 isolated_anon:0
 active_file:9 inactive_file:946 isolated_file:0
 unevictable:0 dirty:0 writeback:0 unstable:0
 slab_reclaimable:27 slab_unreclaimable:454
 mapped:0 shmem:8 pagetables:56 bounce:0
 free:4213 free_pcp:0 free_cma:0
Node 0 active_anon:328kB inactive_anon:12kB active_file:36kB inactive_file:3784kB unevictable:0kB isolated(anon):0kB isolated(file):0kB mapped:0kB dirty:0kB writeback:0kB shmem:32kB writeback_tmp:0kB unstable:0kB pages_scanned:0 all_unreclaimable? no
Normal free:16852kB min:712kB low:888kB high:1064kB active_anon:328kB inactive_anon:12kB active_file:36kB inactive_file:3784kB unevictable:0kB writepending:0kB present:32768kB managed:31936kB mlocked:0kB slab_reclaimable:108kB slab_unreclaimable:1816kB kernel_stack:360kB pagetables:224kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB
lowmem_reserve[]: 0 0
Normal: 3*4kB (UME) 1*8kB (U) 2*16kB (ME) 1*32kB (U) 2*64kB (UM) 2*128kB (ME) 2*256kB (UE) 1*512kB (E) 3*1024kB (UME) 4*2048kB (ME) 1*4096kB (M) = 16852kB
971 total pagecache pages
0 pages in swap cache
Swap cache stats: add 0, delete 0, find 0/0
Free swap  = 0kB
Total swap = 0kB
8192 pages RAM
0 pages HighMem/MovableOnly
208 pages reserved
vmap allocation for size 438272 failed: use vmalloc=<size> to increase size
insmod: vmalloc: allocation failure: 431768 bytes, mode:0x24000c0(GFP_KERNEL)
CPU: 0 PID: 489 Comm: insmod Tainted: G           O    4.9.154-g9aea9c9-dirty #18
Hardware name: Generic R7S72100 (Flattened Device Tree)
[<bf809669>] (unwind_backtrace) from [<bf80740b>] (show_stack+0xb/0xc)
[<bf80740b>] (show_stack) from [<bf845087>] (warn_alloc+0x89/0xba)
[<bf845087>] (warn_alloc) from [<bf85d955>] (__vmalloc_node_range+0x11d/0x138)
[<bf85d955>] (__vmalloc_node_range) from [<bf8081cf>] (module_alloc+0x2b/0x3c)
[<bf8081cf>] (module_alloc) from [<bf83bcad>] (load_module+0x4b7/0x122e)
[<bf83bcad>] (load_module) from [<bf83caef>] (SyS_init_module+0xcb/0xd4)
[<bf83caef>] (SyS_init_module) from [<bf804f21>] (ret_fast_syscall+0x1/0x54)
Mem-Info:
active_anon:984 inactive_anon:3 isolated_anon:0
 active_file:922 inactive_file:41 isolated_file:0
 unevictable:0 dirty:0 writeback:0 unstable:0
 slab_reclaimable:27 slab_unreclaimable:454
 mapped:0 shmem:9 pagetables:58 bounce:0
 free:3295 free_pcp:0 free_cma:0
Node 0 active_anon:3936kB inactive_anon:12kB active_file:3688kB inactive_file:164kB unevictable:0kB isolated(anon):0kB isolated(file):0kB mapped:0kB dirty:0kB writeback:0kB shmem:36kB writeback_tmp:0kB unstable:0kB pages_scanned:0 all_unreclaimable? no
Normal free:13180kB min:712kB low:888kB high:1064kB active_anon:3936kB inactive_anon:12kB active_file:3688kB inactive_file:164kB unevictable:0kB writepending:0kB present:32768kB managed:31936kB mlocked:0kB slab_reclaimable:108kB slab_unreclaimable:1816kB kernel_stack:360kB pagetables:232kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB
lowmem_reserve[]: 0 0
Normal: 3*4kB (UME) 2*8kB (UM) 2*16kB (UE) 0*32kB 1*64kB (U) 2*128kB (ME) 2*256kB (UE) 2*512kB (ME) 3*1024kB (UME) 2*2048kB (ME) 1*4096kB (M) = 13180kB
972 total pagecache pages
0 pages in swap cache
Swap cache stats: add 0, delete 0, find 0/0
Free swap  = 0kB
Total swap = 0kB
8192 pages RAM
0 pages HighMem/MovableOnly
208 pages reserved
insmod: can't insert 'wlan.ko': Cannot allocate memory
$ random: crng init done

 

Austin

  • By default, when you build a driver module, it will include a lot of debug and extra data. So, the module file (.ko) will be big. Since it is a 'kernel' module, memory has to be allocated special and not fragmented, so you might not have enough space to do that.

    However, if you simply remove ('strip') all the extra data from your wlan.ko file, it might be fine. I have seen .ko files shrink down from 1MB in size down to 100KB in size. Then, XIP Linux can load them without an issue.

    From your BSP directory, first set up the environment (so that the environment variable "BUILDROOT_DIR" will be set)

    $ cd rza_linux-4.9_bsp
    $ ./build.sh env
    $ export ROOTDIR=$(pwd) ; source ./setup_env.sh

    Then use 'arm-linux-gnueabihf-strip' that comes with the toolchain to strip your driver.

    (rza1_bsp)$ $BUILDROOT_DIR/output/host/bin/arm-linux-gnueabihf-strip --strip-debug /x/x/x/wlan.ko

    Then check the size of wlan.ko.
  • In reply to Chris:

    hi Chris:

    Thank you for comments.

    the KO file with 3.8MB is striped .

    Can I modify this "modules : 0xbf800000 - 0xc0000000 ( 8 MB)" for this issue??

    Or try to use different kernel image format??

    Thanks.
    Austin
  • In reply to Austin Huang:

    3.8MB seems very big for a kernel module. That is almost as big as the entire Linux kernel (4MB).

    Something is wrong with the way you are building your kernel module.
  • In reply to Chris:

    Hi Chris:

    the KO size in Ubuntu OS and iMX6 yocto BSP(kernel 4.9) both are around 5MB and KO is functional.

    root@imx6qsabresd:~# ls -al
    drwx------ 2 root root 1024 Jun 12 2018 .
    drwxr-xr-x 3 root root 1024 Jan 12 04:22 ..
    -rwxr-xr-x 1 root root 137568 Jun 12 2018 myftm
    -rw-r--r-- 1 root root 5184352 Apr 26 2018 wlan.ko


    if possible to modify this in "Virtual kernel memory layout"
    "modules : 0xbf800000 - 0xc0000000 ( 8 MB)"

    Austin
  • In reply to Austin Huang:

    There should be no reason for a wireless driver to be that big (after it has been stripped). Something seems wrong.

    There is no point in using an XIP kernel to save RAM if you are just going to load a 4MB kernel module into RAM at run-time anyway. So you might as well change to using a normal (non-XIP) kernel with external SDRAM.

    Or, integrate the driver build into the kernel build itself instead trying to build it separately and load it at run time. Then that module code will be in QSPI flash along with the rest of the kernel. Then it would make sense to use a XIP kernel.

    Just FYI,

    The virtual address of the module area is different depending on if THUMB2 is set or not.
    github.com/.../memory.h
    By default, it is enabled in the RZ/A1 kernels (in order to reduce code size).
    You could disable THUMB2 in your kernel and try that.

    The virtual address of the kernel itself is determined by the location of the module address.
    github.com/.../memory.h

    I have never tried to modify the default values of the module areas in the kernel.
  • In reply to Chris:

    Hi Chris:

    I disable THUMB2. There is no memory allocated issue after insmod.

    I got this error now. But seems HW issue. I will keep to debug it and Thanks.

    AR6000: configuration opcode 3 is not used for Linux SDIO stack
    sh_mobile_sdhi e804e800.sd: timeout waiting for hardware interrupt (CMD53)
    AR6000: SDIO bus operation failed! MMC stack returned : -110

    Austin
  • In reply to Austin Huang:

    Hello Austin,

    Please do not use DMA when using SDIO.

    There is a known issue for the CMD53 command that the driver does not correctly change from DMA to PIO(interrupt) mode and the response gets lost (error -110 is timeout). Therefore, in the device tree, do not enable DMA for the SDIO channel that you are using.
  • In reply to Chris:

    hi Chris:

    Thank you for remind this.

    Is check this file r7s72100.dtsi in kernel 4.9/arc/arm/boot/dts???

    code as below

    sdhi0: sd@e804e000 {
    compatible = "renesas,sdhi-r7s72100";
    reg = <0xe804e000 0x100>;
    interrupts = <GIC_SPI 270 IRQ_TYPE_LEVEL_HIGH
    GIC_SPI 271 IRQ_TYPE_LEVEL_HIGH
    GIC_SPI 272 IRQ_TYPE_LEVEL_HIGH>;

    clocks = <&mstp12_clks R7S72100_CLK_SDHI00>,
    <&mstp12_clks R7S72100_CLK_SDHI01>;
    clock-names = "core", "cd";
    power-domains = <&cpg_clocks>;
    cap-sd-highspeed;
    cap-sdio-irq;
    status = "disabled";
    };

    sdhi1: sd@e804e800 {
    compatible = "renesas,sdhi-r7s72100";
    reg = <0xe804e800 0x100>;
    interrupts = <GIC_SPI 273 IRQ_TYPE_LEVEL_HIGH
    GIC_SPI 274 IRQ_TYPE_LEVEL_HIGH
    GIC_SPI 275 IRQ_TYPE_LEVEL_HIGH>;

    clocks = <&mstp12_clks R7S72100_CLK_SDHI10>,
    <&mstp12_clks R7S72100_CLK_SDHI11>;
    clock-names = "core", "cd";
    power-domains = <&cpg_clocks>;
    cap-sd-highspeed;
    cap-sdio-irq;
    status = "disabled";
    };

     

    Austin

  • In reply to Austin Huang:

    Hello Austin,

    Not the r7s72100.dtsi file. You change your board's Device Tree.

    For example, in r7s72100-rskrza1.dst, remove the lines below in RED

    &sdhi1 {
            pinctrl-names = "default";
            pinctrl-0 = <&sdhi1_pins>;
            bus-width = <4>;
            status = "okay";
            dmas = <&dma0 RZA1DMA_SLAVE_SDHI1_TX>, <&dma0 RZA1DMA_SLAVE_SDHI1_RX>;
            dma-names = "tx", "rx";
    };
  • In reply to JB:

    hi JB:

    Yes.

    Austin