CYW4354 porting issue

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
DS_Lin
Level 5
Level 5
Distributor - Zenitron(GC)
First comment on blog 100 sign-ins 50 replies posted

Hi Sir

We porting cypress-fmac-v5.4.18-2020_0925 driver + i.mx6 pure linux 4.1.X

Snap1.jpg

insmod compat.ko
insmod cfg80211.ko
insmod brcmutil.ko
insmod brcmfmac.ko firmware_path=
cyfmac4354-sdio.bin nvram_path=cyfmac4354-sdio.txt clm_path=cyfmac4354-sdio.clm_blob

error log......

brcmfmac: unknown parameter 'firmware_path' ignored
brcmfmac: unknown parameter 'nvram_path' ignored
brcmfmac: unknown parameter 'clm_path' ignored
root@imx6ulevk:/# brcmfmac: brcmf_fw_alloc_request: using cypress/cyfmac4354-sdio for chip BCM4354/1
usbcore: registered new interface driver brcmfmac
brcmfmac mmc0:0001:1: Falling back to syfs fallback for: cypress/cyfmac4354-sdio.fsl,imx6ul-14x14-evk.txt
brcmfmac: brcmf_sdiod_ramrw: membytes transfer failed
brcmfmac: brcmf_sdio_download_code_file: error -84 on writing 614539 membytes at 0x00180000
brcmfmac: brcmf_sdio_download_firmware: dongle image file download failed
brcmfmac: brcmf_sdio_htclk: Failed access turning clock off: -5
brcmfmac: brcmf_sdio_htclk: HT Avail request error: -5

root@imx6ulevk:/# lsmod
Module                  Size  Used by
brcmfmac              258048  0
brcmutil               16384  1 brcmfmac
cfg80211              319488  1 brcmfmac
compat                 24576  2 brcmfmac,cfg80211
root@imx6ulevk:/#

root@imx6ulevk:/# ifconfig wlan0 up
ifconfig: SIOCGIFFLAGS: No such device

so put these 3 files

cyfmac4354-sdio.bin, cyfmac4354-sdio.txtcyfmac4354-sdio.clm_blob

in this location rootfs  /lib/firmware/cypress/ ? 

Br,
DS

 

0 Likes
1 Solution
DS_Lin
Level 5
Level 5
Distributor - Zenitron(GC)
First comment on blog 100 sign-ins 50 replies posted

Hi Raks,

We are thinking Error code 84 is "illegal byte sequence". Looks like sdio/wifi clock issues,
i.mx6 ul platform sdio/wifi  200M

root@imx6ulevk:/# cat /sys/kernel/debug/mmc0/ios
clock: 198000000 Hz
actual clock: 198000000 Hz
vdd: 21 (3.3 ~ 3.4 V)
bus mode: 2 (push-pull)
chip select: 0 (don't care)
power mode: 2 (on)
bus width: 2 (4 bits)
timing spec: 6 (sd uhs SDR104)
signal voltage: 1 (1.80 V)
driver type: 0 (driver type B)
root@imx6ulevk:/#

another i.mx6 QS sio/wifi 50M

i.mx6qs.png

so..we will try modify mmc clock speed ....

--- drivers/mmc/core/core.c.old
+++ drivers/mmc/core/core.c
@@ -931,6 +931,12 @@

if (hz > host->f_max)
hz = host->f_max;
+
+ if (host->index == 0) {
+ pr_err("%s: original hz = %d\n", mmc_hostname(host), hz);
+ hz = 50000000;
+ pr_err("%s: reset hz = %d\n", mmc_hostname(host), hz);
+ }

host->ios.clock = hz;
mmc_set_ios(host);

Br,
DS

 

View solution in original post

0 Likes
21 Replies
DS_Lin
Level 5
Level 5
Distributor - Zenitron(GC)
First comment on blog 100 sign-ins 50 replies posted

update......

 

cyfmac4354-sdio.bin, cyfmac4354-sdio.txt與cyfmac4354-sdio.clm_blob 3 files  /lib/firmware/cypress/

insmod log......

insmod compat.ko
insmod cfg80211.ko
insmod brcmutil.ko
insmod brcmfmac.ko firmware_path/lib/firmware/cypress/cyfmac4354-sdio.bin nvram_path=/lib/firmware/cypress/cyfmac4354-sdio.txt clm_path=/lib/firmware/cypress/cyfmac4354-sdio.clm_blob

 

error log.....

root@imx6ulevk:/# cd lib/firmware/cypress/
root@imx6ulevk:/lib/firmware/cypress# pwd
/lib/firmware/cypress
root@imx6ulevk:/lib/firmware/cypress# ls
cyfmac4354-sdio.bin       cyfmac4354-sdio.clm_blob  cyfmac4354-sdio.txt
root@imx6ulevk:/lib/firmware/cypress# cd /
root@imx6ulevk:/# ls
bin                       cyfmac4354-sdio.txt       mnt
boot                      data                      proc
brcmfmac.ko               dev                       run
brcmutil.ko               etc                       sbin
cfg80211.ko               home                      sys
compat.ko                 lib                       tmp
cyfmac4354-sdio.bin       lost+found                usr
cyfmac4354-sdio.clm_blob  media                     var
root@imx6ulevk:/# insmod compat.ko
compat: loading out-of-tree module taints kernel.
Loading modules backported from Linux version v5.4.18-2020_0925-0-gc25d4b7
Backport generated by backports.git v5.4.27-1-0-gf6e8852
root@imx6ulevk:/# insmod cfg80211.ko
cfg80211: Loading compiled-in X.509 certificates for regulatory database
cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
platform regulatory.0: Falling back to syfs fallback for: regulatory.db
cfg80211: failed to load regulatory.db

root@imx6ulevk:/# insmod brcmutil.ko

root@imx6ulevk:/# insmod brcmfmac.ko firmware_path/lib/firmware/cypress/cyfmac4354-sdio.bin nvram_path=/lib/firmware/cypress/cyfmac4354-sdio.txt clm_path=/lib/firmware/cypress/cyfmac4354-sdio.clm_blob
brcmfmac: unknown parameter 'firmware_path/lib/firmware/cypress/cyfmac4354-sdio.bin' ignored
brcmfmac: unknown parameter 'nvram_path' ignored
brcmfmac: unknown parameter 'clm_path' ignored
root@imx6ulevk:/# ------------[ cut here ]------------
WARNING: CPU: 0 PID: 93 at /home/george/workdir/v5.4.18-backports/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c:1206 brcmf_chip_get_chipcommon+0x30/0x70 [brcmfmac]
Modules linked in: brcmfmac(O) brcmutil(O) cfg80211(O) compat(O)
CPU: 0 PID: 93 Comm: kworker/0:4 Tainted: G           O      4.19.35-1.1.0+g8507afc3a397 #1
Hardware name: Freescale i.MX6 UltraLite (Device Tree)
Workqueue: events brcmf_driver_register [brcmfmac]
[<8010f7a0>] (unwind_backtrace) from [<8010b798>] (show_stack+0x10/0x14)
[<8010b798>] (show_stack) from [<809d54a8>] (dump_stack+0x78/0x8c)
[<809d54a8>] (dump_stack) from [<8012f24c>] (__warn+0xd4/0xf0)
[<8012f24c>] (__warn) from [<8012f2a8>] (warn_slowpath_null+0x40/0x48)
[<8012f2a8>] (warn_slowpath_null) from [<7f083410>] (brcmf_chip_get_chipcommon+0x30/0x70 [brcmfmac])
[<7f083410>] (brcmf_chip_get_chipcommon [brcmfmac]) from [<7f08345c>] (brcmf_chip_get_pmu+0xc/0x70 [brcmfmac])
[<7f08345c>] (brcmf_chip_get_pmu [brcmfmac]) from [<7f083c90>] (brcmf_chip_attach+0x494/0x838 [brcmfmac])
[<7f083c90>] (brcmf_chip_attach [brcmfmac]) from [<7f0974c8>] (brcmf_sdio_probe+0x134/0x8ac [brcmfmac])
[<7f0974c8>] (brcmf_sdio_probe [brcmfmac]) from [<7f099430>] (brcmf_sdiod_probe+0x190/0x240 [brcmfmac])
[<7f099430>] (brcmf_sdiod_probe [brcmfmac]) from [<7f099590>] (brcmf_ops_sdio_probe+0xb0/0x140 [brcmfmac])
[<7f099590>] (brcmf_ops_sdio_probe [brcmfmac]) from [<807390e4>] (sdio_bus_probe+0x98/0x114)
[<807390e4>] (sdio_bus_probe) from [<80535160>] (really_probe+0x1f4/0x2b8)
[<80535160>] (really_probe) from [<80535388>] (driver_probe_device+0x60/0x168)
[<80535388>] (driver_probe_device) from [<8053556c>] (__driver_attach+0xdc/0xe0)
[<8053556c>] (__driver_attach) from [<80533494>] (bus_for_each_dev+0x74/0xb4)
[<80533494>] (bus_for_each_dev) from [<8053462c>] (bus_add_driver+0x1bc/0x200)
[<8053462c>] (bus_add_driver) from [<80535e88>] (driver_register+0x74/0x108)
[<80535e88>] (driver_register) from [<7f099640>] (brcmf_sdio_register+0x10/0x44 [brcmfmac])
[<7f099640>] (brcmf_sdio_register [brcmfmac]) from [<7f089298>] (brcmf_driver_register+0x8/0x10 [brcmfmac])
[<7f089298>] (brcmf_driver_register [brcmfmac]) from [<80145f14>] (process_one_work+0x1f0/0x3fc)
[<80145f14>] (process_one_work) from [<80146c30>] (worker_thread+0x44/0x580)
[<80146c30>] (worker_thread) from [<8014bb1c>] (kthread+0x148/0x150)
[<8014bb1c>] (kthread) from [<801010e8>] (ret_from_fork+0x14/0x2c)
Exception stack(0x885a5fb0 to 0x885a5ff8)
5fa0:                                     00000000 00000000 00000000 00000000
5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
5fe0: 00000000 00000000 00000000 00000000 00000013 00000000
---[ end trace 135a6b04b025a655 ]---
Unable to handle kernel NULL pointer dereference at virtual address 00000002
pgd = 790884c9
[00000002] *pgd=00000000
Internal error: Oops: 17 [#1] PREEMPT SMP ARM
Modules linked in: brcmfmac(O) brcmutil(O) cfg80211(O) compat(O)
CPU: 0 PID: 93 Comm: kworker/0:4 Tainted: G        W  O      4.19.35-1.1.0+g8507afc3a397 #1
Hardware name: Freescale i.MX6 UltraLite (Device Tree)
Workqueue: events brcmf_driver_register [brcmfmac]
PC is at brcmf_chip_get_pmu+0xc/0x70 [brcmfmac]
LR is at warn_slowpath_null+0x40/0x48
pc : [<7f08345c>]    lr : [<8012f2a8>]    psr: 600b0013
sp : 885a5d90  ip : 00000000  fp : 889ead38
r10: 1810d194  r9 : 00000002  r8 : 00080201
r7 : 00000847  r6 : 0000080e  r5 : 18001000  r4 : 889ead00
r3 : 889ead38  r2 : 889ead38  r1 : 80fa7338  r0 : 00000000
Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
Control: 10c53c7d  Table: 8896806a  DAC: 00000051
Process kworker/0:4 (pid: 93, stack limit = 0x2f6165d5)
Stack: (0x885a5d90 to 0x885a6000)
5d80:                                     889ead00 7f083c90 00000001 00000000
5da0: 80f04d08 0000013d 889ead38 fffff000 ffffe000 88a0c400 88a0c000 000000e8
5dc0: 80f04d08 885a5dec 00000000 00000004 ffffe000 7f0974c8 80f03d00 7fa32c35
5de0: 88122288 88122210 0000000d 00000000 60010013 7fa32c35 00022ca0 88a0c000
5e00: 00000000 88749a00 7f0a5c30 00000000 7f0a5c30 00000004 ffffe000 7f099430
5e20: 88a0c000 88c4b400 88749a00 7f099590 88749a08 88749a00 00000000 7f0a5c30
5e40: 7f09e0a4 807390e4 810040f4 88749a08 810040f8 00000000 00000000 80535160
5e60: 88749a08 7f0a5c30 88749a3c 80535490 00000000 7f0a5c14 00000000 80535388
5e80: 88a46ab4 80533cb4 ffffe000 88749a08 7f0a5c30 88749a3c 80535490 00000000
5ea0: 7f0a5c14 00000000 ffffe000 8053556c 88a46bb4 80f04d08 7f0a5c30 80533494
5ec0: 80f4d578 881c0458 88a46bb4 7fa32c35 881c046c 7f0a5c30 88a46a00 80f4d578
5ee0: 00000000 8053462c 7f0a2d14 88596880 8bb39d80 7f0a5c30 88596880 8bb39d80
5f00: 8bb3cf00 80535e88 7f0a5c10 88596880 8bb39d80 7f099640 7f0a5c10 7f089298
5f20: 7f0a5c10 80145f14 00000008 80f03d00 88596880 88596894 8bb39d80 00000008
5f40: 80f03d00 8bb39d98 8bb39d80 80146c30 88312870 80fa6080 80c17eb8 885a4000
5f60: 88595bdc 88595bc0 88595600 00000000 885a4000 88596880 80146bec 885a3ea4
5f80: 88595bdc 8014bb1c 00000000 88595600 8014b9d4 00000000 00000000 00000000
5fa0: 00000000 00000000 00000000 801010e8 00000000 00000000 00000000 00000000
5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
5fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
[<7f08345c>] (brcmf_chip_get_pmu [brcmfmac]) from [<7f083c90>] (brcmf_chip_attach+0x494/0x838 [brcmfmac])
[<7f083c90>] (brcmf_chip_attach [brcmfmac]) from [<7f0974c8>] (brcmf_sdio_probe+0x134/0x8ac [brcmfmac])
[<7f0974c8>] (brcmf_sdio_probe [brcmfmac]) from [<7f099430>] (brcmf_sdiod_probe+0x190/0x240 [brcmfmac])
[<7f099430>] (brcmf_sdiod_probe [brcmfmac]) from [<7f099590>] (brcmf_ops_sdio_probe+0xb0/0x140 [brcmfmac])
[<7f099590>] (brcmf_ops_sdio_probe [brcmfmac]) from [<807390e4>] (sdio_bus_probe+0x98/0x114)
[<807390e4>] (sdio_bus_probe) from [<80535160>] (really_probe+0x1f4/0x2b8)
[<80535160>] (really_probe) from [<80535388>] (driver_probe_device+0x60/0x168)
[<80535388>] (driver_probe_device) from [<8053556c>] (__driver_attach+0xdc/0xe0)
[<8053556c>] (__driver_attach) from [<80533494>] (bus_for_each_dev+0x74/0xb4)
[<80533494>] (bus_for_each_dev) from [<8053462c>] (bus_add_driver+0x1bc/0x200)
[<8053462c>] (bus_add_driver) from [<80535e88>] (driver_register+0x74/0x108)
[<80535e88>] (driver_register) from [<7f099640>] (brcmf_sdio_register+0x10/0x44 [brcmfmac])
[<7f099640>] (brcmf_sdio_register [brcmfmac]) from [<7f089298>] (brcmf_driver_register+0x8/0x10 [brcmfmac])
[<7f089298>] (brcmf_driver_register [brcmfmac]) from [<80145f14>] (process_one_work+0x1f0/0x3fc)
[<80145f14>] (process_one_work) from [<80146c30>] (worker_thread+0x44/0x580)
[<80146c30>] (worker_thread) from [<8014bb1c>] (kthread+0x148/0x150)
[<8014bb1c>] (kthread) from [<801010e8>] (ret_from_fork+0x14/0x2c)
Exception stack(0x885a5fb0 to 0x885a5ff8)
5fa0:                                     00000000 00000000 00000000 00000000
5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
5fe0: 00000000 00000000 00000000 00000000 00000013 00000000
Code: e12fff1e e92d4010 e1a04000 ebffffe0 (e1d030b2)
---[ end trace 135a6b04b025a656 ]---

0 Likes
DS_Lin
Level 5
Level 5
Distributor - Zenitron(GC)
First comment on blog 100 sign-ins 50 replies posted

update.....ERROR LOG

root@imx6ulevk:/# insmod compat.ko
compat: loading out-of-tree module taints kernel.
Loading modules backported from Linux version v5.4.18-2020_0925-0-gc25d4b7
Backport generated by backports.git v5.4.27-1-0-gf6e8852
root@imx6ulevk:/# insmod cfg80211.ko
cfg80211: Loading compiled-in X.509 certificates for regulatory database
cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
platform regulatory.0: Falling back to syfs fallback for: regulatory.db
cfg80211: failed to load regulatory.db
root@imx6ulevk:/# insmod brcmutil.ko
root@imx6ulevk:/# insmod brcmfmac.ko
root@imx6ulevk:/# brcmfmac: brcmf_fw_alloc_request: using cypress/cyfmac4354-sdio for chip BCM4354/1
usbcore: registered new interface driver brcmfmac
brcmfmac mmc0:0001:1: Falling back to syfs fallback for: cypress/cyfmac4354-sdio.fsl,imx6ul-14x14-evk.txt
brcmfmac: brcmf_sdiod_ramrw: membytes transfer failed
brcmfmac: brcmf_sdio_download_code_file: error -84 on writing 601835 membytes at 0x00180000
brcmfmac: brcmf_sdio_download_firmware: dongle image file download failed
brcmfmac: brcmf_sdio_htclk: Failed access turning clock off: -5
brcmfmac: brcmf_sdio_htclk: HT Avail request error: -5

0 Likes
raks_99
Moderator
Moderator
Moderator
First question asked 250 replies posted 250 sign-ins

Hi, 

So I looked into this and found out some possible solutions, please try them out.

1) For the error 

"root@imx6ulevk:/# insmod cfg80211.ko
cfg80211: Loading compiled-in X.509 certificates for regulatory database
cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
platform regulatory.0: Falling back to syfs fallback for: regulatory.db
cfg80211: failed to load regulatory.db"

You can try disabling the macro CPTCFG_CFG80211_REQUIRE_SIGNED_REGDB by setting CPTCFG_CFG80211_REQUIRE_SIGNED_REGDB=n in the  file \cypress-fmac-v5.4.18-2021_0114\cypress-backports-v5.4.18-2021_0114-module-src.tar\cypress-backports-v5.4.18-2021_0114-module-src\v5.4.18-backports\defconfigs and recompiling the source files.

2) For the error

"root@imx6ulevk:/# insmod brcmfmac.ko
root@imx6ulevk:/# brcmfmac: brcmf_fw_alloc_request: using cypress/cyfmac4354-sdio for chip BCM4354/1
usbcore: registered new interface driver brcmfmac
brcmfmac mmc0:0001:1: Falling back to syfs fallback for: cypress/cyfmac4354-sdio.fsl,imx6ul-14x14-evk.txt
brcmfmac: brcmf_sdiod_ramrw: membytes transfer failed
brcmfmac: brcmf_sdio_download_code_file: error -84 on writing 601835 membytes at 0x00180000
brcmfmac: brcmf_sdio_download_firmware: dongle image file download failed
brcmfmac: brcmf_sdio_htclk: Failed access turning clock off: -5
brcmfmac: brcmf_sdio_htclk: HT Avail request error: -5"

Either the function brcmf_sdiod_skbuff_write or brcmf_sdiod_skbuff_read is failing. Error number -84 indicates illegal byte sequence according to https://kernel.googlesource.com/pub/scm/linux/kernel/git/nico/archive/+/v0.97/include/linux/errno.h

So maybe there is memory constraint happening in your device.

You can check these in your device and get back with your finds

Thanks and Best regards

DS_Lin
Level 5
Level 5
Distributor - Zenitron(GC)
First comment on blog 100 sign-ins 50 replies posted

Hi Raks_99,

Do you know how to do it?
How can recheck these in my device and get back with my finds?

Br,
DS 03/16

0 Likes
raks_99
Moderator
Moderator
Moderator
First question asked 250 replies posted 250 sign-ins

Hi

Sure I'll try to help you with recompiling. I will get back to you.

Can you provide more info on your host setup?

 

DS_Lin
Level 5
Level 5
Distributor - Zenitron(GC)
First comment on blog 100 sign-ins 50 replies posted

Hi Raks_99,

Thank you in advance for any help you can provide.

My host i.mx6 yocto build setup as follows=========

1. yocto linux-imx-4.19.35-r0  <M> cfg80211 - wireless configuration API  / We try module cfg80211

2.compiling the source files cypress-fmac-v5.4.18-2020_0925/v5.4.18-backports

3.put  3 files cyfmac4354-sdio.bin, cyfmac4354-sdio.txt ,cyfmac4354-sdio.clm_blob  into /lib/firmware/cypress/

4.

insmod compat.ko
insmod cfg80211.ko
insmod brcmutil.ko
insmod brcmfmac.ko

Br,
DS 03/16

DS_Lin
Level 5
Level 5
Distributor - Zenitron(GC)
First comment on blog 100 sign-ins 50 replies posted

update...error log

root@imx6ulevk:/#
root@imx6ulevk:/#
root@imx6ulevk:/#
root@imx6ulevk:/# mmc0: queuing unknown CIS tuple 0x80 (2 bytes)
mmc0: queuing unknown CIS tuple 0x80 (3 bytes)
mmc0: queuing unknown CIS tuple 0x80 (3 bytes)
mmc0: queuing unknown CIS tuple 0x80 (7 bytes)
mmc0: new ultra high speed SDR104 SDIO card at address 0001

root@imx6ulevk:/# insmod compat.ko
compat: loading out-of-tree module taints kernel.
Loading modules backported from Linux version v5.4.18-2020_0925-0-gc25d4b7
Backport generated by backports.git v5.4.27-1-0-gf6e8852
root@imx6ulevk:/#
root@imx6ulevk:/#
root@imx6ulevk:/#
root@imx6ulevk:/# insmod cfg80211.ko
cfg80211: Loading compiled-in X.509 certificates for regulatory database
cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
platform regulatory.0: Falling back to syfs fallback for: regulatory.db
cfg80211: failed to load regulatory.db
root@imx6ulevk:/# insmod brcmutil.ko
root@imx6ulevk:/# insmod brcmfmac.ko
root@imx6ulevk:/# brcmfmac: brcmf_fw_alloc_request: using cypress/cyfmac4354-sdio for chip BCM4354/1
usbcore: registered new interface driver brcmfmac
brcmfmac mmc0:0001:1: loading /lib/firmware/cypress/cyfmac4354-sdio.bin failed with error -22
brcmfmac mmc0:0001:1: Falling back to syfs fallback for: cypress/cyfmac4354-sdio.bin
EXT4-fs (mmcblk1p2): error count since last fsck: 1
EXT4-fs (mmcblk1p2): initial error at time 1614848292: ext4_validate_block_bitmap:376
EXT4-fs (mmcblk1p2): last error at time 1614848292: ext4_validate_block_bitmap:376

root@imx6ulevk:/# lsmod
Module Size Used by
brcmfmac 258048 0
brcmutil 16384 1 brcmfmac
cfg80211 319488 1 brcmfmac
compat 24576 2 brcmfmac,cfg80211
root@imx6ulevk:/#
root@imx6ulevk:/# dmesg | grep mmc
Kernel command line: console=ttymxc0,115200 root=/dev/mmcblk1p2 rootwait rw
mmc0: SDHCI controller on 2190000.usdhc [2190000.usdhc] using ADMA
mmc1: SDHCI controller on 2194000.usdhc [2194000.usdhc] using ADMA
mmc1: host does not support reading read-only switch, assuming write-enable
mmc1: new high speed SDHC card at address 1234
mmcblk1: mmc1:1234 SA04G 3.64 GiB
mmcblk1: p1 p2
EXT4-fs (mmcblk1p2): warning: mounting fs with errors, running e2fsck is recommended
EXT4-fs (mmcblk1p2): recovery complete
EXT4-fs (mmcblk1p2): mounted filesystem with ordered data mode. Opts: (null)
EXT4-fs (mmcblk1p2): re-mounted. Opts: (null)
mmc0: queuing unknown CIS tuple 0x80 (2 bytes)
mmc0: queuing unknown CIS tuple 0x80 (3 bytes)
mmc0: queuing unknown CIS tuple 0x80 (3 bytes)
mmc0: queuing unknown CIS tuple 0x80 (7 bytes)
mmc0: new ultra high speed SDR104 SDIO card at address 0001
brcmfmac mmc0:0001:1: loading /lib/firmware/cypress/cyfmac4354-sdio.bin failed with error -22
brcmfmac mmc0:0001:1: Falling back to syfs fallback for: cypress/cyfmac4354-sdio.bin
EXT4-fs (mmcblk1p2): error count since last fsck: 1
EXT4-fs (mmcblk1p2): initial error at time 1614848292: ext4_validate_block_bitmap:376
EXT4-fs (mmcblk1p2): last error at time 1614848292: ext4_validate_block_bitmap:376
root@imx6ulevk:/#
root@imx6ulevk:/# cat /sys/kernel/debug/mmc0/ios
clock: 198000000 Hz
actual clock: 198000000 Hz
vdd: 21 (3.3 ~ 3.4 V)
bus mode: 2 (push-pull)
chip select: 0 (don't care)
power mode: 2 (on)
bus width: 2 (4 bits)
timing spec: 6 (sd uhs SDR104)
signal voltage: 1 (1.80 V)
driver type: 0 (driver type B)
root@imx6ulevk:/#

 

0 Likes
DS_Lin
Level 5
Level 5
Distributor - Zenitron(GC)
First comment on blog 100 sign-ins 50 replies posted

Hi Raks_99,

We want to replace the another microSD™ card for testing..I believe there is another way to tackle the problem,TKS!

EXT4-fs (mmcblk1p2): error count since last fsck: 1
EXT4-fs (mmcblk1p2): initial error at time 1614848292: ext4_validate_block_bitmap:376
EXT4-fs (mmcblk1p2): last error at time 1614848292: ext4_validate_block_bitmap:376

 

Br,
DS

0 Likes
raks_99
Moderator
Moderator
Moderator
First question asked 250 replies posted 250 sign-ins

Hi,

Thanks for all the info, I'm taking a look at it.

Best Regards

DS_Lin
Level 5
Level 5
Distributor - Zenitron(GC)
First comment on blog 100 sign-ins 50 replies posted

Hi Raks_99,

The following error occurred previously in insmod cfg80211.ko
platform regulatory.0: Falling back to syfs fallback for: regulatory.db
cfg80211: failed to load regulatory.db
After searching for solutions on the google search, put regulatory.db in /lib//firmware/, and can be solved
=============================================================================
update log

imx6ulevk login: root
root@imx6ulevk:~# cd /
root@imx6ulevk:/# mmc0: queuing unknown CIS tuple 0x80 (2 bytes)
mmc0: queuing unknown CIS tuple 0x80 (3 bytes)
mmc0: queuing unknown CIS tuple 0x80 (3 bytes)
mmc0: queuing unknown CIS tuple 0x80 (7 bytes)
mmc0: new ultra high speed SDR104 SDIO card at address 0001

root@imx6ulevk:/#
root@imx6ulevk:/# insmod compat.ko
compat: loading out-of-tree module taints kernel.
Loading modules backported from Linux version v5.4.18-2020_0925-0-gc25d4b7
Backport generated by backports.git v5.4.27-1-0-gf6e8852
root@imx6ulevk:/# insmod cfg80211.ko
cfg80211: Loading compiled-in X.509 certificates for regulatory database
cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
root@imx6ulevk:/# insmod brcmutil.ko
root@imx6ulevk:/#
root@imx6ulevk:/#
root@imx6ulevk:/#
root@imx6ulevk:/#
root@imx6ulevk:/# insmod brcmfmac.ko
root@imx6ulevk:/# brcmfmac: brcmf_fw_alloc_request: using cypress/cyfmac4354-sdio for chip BCM4354/1
usbcore: registered new interface driver brcmfmac
brcmfmac mmc0:0001:1: Falling back to syfs fallback for: cypress/cyfmac4354-sdio.fsl,imx6ul-14x14-evk.txt
brcmfmac: brcmf_sdiod_ramrw: membytes transfer failed
brcmfmac: brcmf_sdio_download_code_file: error -84 on writing 601835 membytes at 0x00180000
brcmfmac: brcmf_sdio_download_firmware: dongle image file download failed
brcmfmac: brcmf_sdio_htclk: Failed access turning clock off: -5
brcmfmac: brcmf_sdio_htclk: HT Avail request error: -5

Br,
DS 03/17

raks_99
Moderator
Moderator
Moderator
First question asked 250 replies posted 250 sign-ins

Hi,

From the error mmcblk1: mmc1:1234 SA04G 3.64 GiB , it
Looks like you are using a 4GB card? Can you try by using 8GB or more and see if error persists?  

And steps to compile as given in the README file is as follows. But since you fixed regulatory.db error, this can be skipped but I will post it anyways as it might help others.

#### Build the cypress driver/backports modules
```bash
#1. Untar the Cypress backports package
tar zxvf cypress-backports-*.tar.gz
cd v5.4.18-backports
#2. (Native) compile local tools and generate .config (in a new terminal
# without sourcing Yoctol toolchain settings)
bash
MY_KERNEL=<the 4.14.78 kernel path>
make KLIB=$MY_KERNEL KLIB_BUILD=$MY_KERNEL defconfig-brcmfmac
#3. (Cross) compile kernel modules
source /opt/poky/1.8/environment-setup-cortexa7hf-vfp-neon-poky-linux-gnueabi
make KLIB=$MY_KERNEL KLIB_BUILD=$MY_KERNEL modules
#4. The kernel modules are available here
# compat/compat.ko
# net/wireless/cfg80211.ko
# drivers/net/wireless/broadcom/brcm80211/brcmutil/brcmutil.ko
# drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko

Add the lines CPTCFG_CFG80211_REQUIRE_SIGNED_REGDB=n to the .config file since you are native compiling. 

Error code 84 is "illegal byte sequence". Looks like RAM memory issues. I will check and get back to you in 24hours.

 

 

DS_Lin
Level 5
Level 5
Distributor - Zenitron(GC)
First comment on blog 100 sign-ins 50 replies posted

Hi Raks,

We are thinking Error code 84 is "illegal byte sequence". Looks like sdio/wifi clock issues,
i.mx6 ul platform sdio/wifi  200M

root@imx6ulevk:/# cat /sys/kernel/debug/mmc0/ios
clock: 198000000 Hz
actual clock: 198000000 Hz
vdd: 21 (3.3 ~ 3.4 V)
bus mode: 2 (push-pull)
chip select: 0 (don't care)
power mode: 2 (on)
bus width: 2 (4 bits)
timing spec: 6 (sd uhs SDR104)
signal voltage: 1 (1.80 V)
driver type: 0 (driver type B)
root@imx6ulevk:/#

another i.mx6 QS sio/wifi 50M

i.mx6qs.png

so..we will try modify mmc clock speed ....

--- drivers/mmc/core/core.c.old
+++ drivers/mmc/core/core.c
@@ -931,6 +931,12 @@

if (hz > host->f_max)
hz = host->f_max;
+
+ if (host->index == 0) {
+ pr_err("%s: original hz = %d\n", mmc_hostname(host), hz);
+ hz = 50000000;
+ pr_err("%s: reset hz = %d\n", mmc_hostname(host), hz);
+ }

host->ios.clock = hz;
mmc_set_ios(host);

Br,
DS

 

0 Likes
raks_99
Moderator
Moderator
Moderator
First question asked 250 replies posted 250 sign-ins

Hello,

Yes could be a clock synchronization issue Are you using any modules provided by module vendors? Also, are you using external crystal for frequency reference? In the datasheet, it is mentioned that for SDIO, HSIC, and PCIe WLAN host applications, the recommended default frequency reference is a 37.4 MHz crystal.

Thanks and Regards

DS_Lin
Level 5
Level 5
Distributor - Zenitron(GC)
First comment on blog 100 sign-ins 50 replies posted

Hi Raks,
Yes .. we usung module AZUREWAVE/ AW-CM235NF
235NF using internal crystal , SDIO interface and commended default frequency reference is a 37.4 MHz crystal,TKS!

Br,
DS

 

0 Likes
DS_Lin
Level 5
Level 5
Distributor - Zenitron(GC)
First comment on blog 100 sign-ins 50 replies posted

Hi Raks,

Below are the main points/ test items

 

1.swap imx6ul yocto files-system /lib/firmware/brcm/fw & clm_blob ==>  /lib/firmware/brcm/cypress/

 

2.swap dhd firmware ==>  /lib/firmware/brcm/cypress/ fw & clm_blob

 

3.swap fmac driver cypress-fmac-v5.4.18-2021_0114 ==> cypress-fmac-v5.4.18-2020_0925

 

4.swap AW-CM235NF EVB ==> imx6ul EVB

 

5.modify imx6ul sdio default clock speed  200Mz ==> 50Mz

 

Summary:

always appear -84 on writing 601835 membytes at 0x00180000 error log

brcmfmac: brcmf_sdiod_ramrw: membytes transfer failed

brcmfmac: brcmf_sdio_download_code_file: error -84 on writing 601835 membytes at 0x00180000

brcmfmac: brcmf_sdio_download_firmware: dongle image file download failed

brcmfmac: brcmf_sdio_htclk: Failed access turning clock off: -5

brcmfmac: brcmf_sdio_htclk: HT Avail request error: -5

Br,
DS

lock attach
Attachments are accessible only for community members.
DS_Lin
Level 5
Level 5
Distributor - Zenitron(GC)
First comment on blog 100 sign-ins 50 replies posted

Hi Raks,

We try modify driver sdio clock 50Mz = > 40 Mz

But the wlan0 still doesn't show up.

So I retry the network status using command 'ifconfig' again and then the wlan0 show up such as following figure.

0319.png

Although the wlan0 appeared, there are still error messages during the installation process, I still hope to find root cause and analysis issue.

 

 

 

raks_99
Moderator
Moderator
Moderator
First question asked 250 replies posted 250 sign-ins

HelloDS,

brcmfmac: brcmf_sdio_htclk: HT Avail request error: -5

The HT Avail error could because of not using a 32.768Khz LPO. Also, could you share the NVram file for this? Thanks

Regards,

DS_Lin
Level 5
Level 5
Distributor - Zenitron(GC)
First comment on blog 100 sign-ins 50 replies posted

Hi Raks,

We only modify driver sdio clock 50Mz = > 40 Mz
root@imx6ulevk:/# brcmfmac: brcmf_fw_alloc_request: using cypress/cyfmac4354-sdio for chip BCM4354/1
usbcore: registered new interface driver brcmfmac
brcmfmac: brcmf_fw_request_firmware: no board-specific nvram available (err=-11), device will use cypress/cyfmac4354-sdio.txt
brcmfmac: brcmf_fw_alloc_request: using cypress/cyfmac4354-sdio for chip BCM4354/1
brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4354/1 wl0: Jun 11 2020 10:07:38 version 7.35.349.92 (r726098 CY) FWID 01-41dfccda

We rechek nvram default frequency reference is a 37.4 MHz crystal
xtalfreq=37400

Br,
DS

raks_99
Moderator
Moderator
Moderator
First question asked 250 replies posted 250 sign-ins

Hello, 

Have you performed any sort of tuning for the external crystal?

Regards,

DS_Lin
Level 5
Level 5
Distributor - Zenitron(GC)
First comment on blog 100 sign-ins 50 replies posted

Hi Raks,

We only modify driver sdio clock 50Mz = > 40 Mz

Br,
DS

0 Likes
DS_Lin
Level 5
Level 5
Distributor - Zenitron(GC)
First comment on blog 100 sign-ins 50 replies posted

Hi Raks,

Thank you for your help during this period ^^...

Br,
DS