narmstrong changed the topic of #linux-amlogic to: Amlogic mainline kernel development discussion - our wiki http://linux-meson.com/ - ml linux-amlogic@lists.infradead.org - official channel moved from Freenode - publicly logged on https://libera.irclog.whitequark.org/linux-amlogic
pulpoff has joined #linux-amlogic
<pulpoff> Greetings to all !
<pulpoff> trying to fix wifi drivers for armbian on GT King
<pulpoff> anyone managed to make it work ?
<pulpoff> AP6359SA
<pulpoff> this is what i get :
<pulpoff> dmsg log :
<pulpoff> [ 11.796609] brcmfmac: brcmf_sdiod_sgtable_alloc: !!!! WIFI DEBUG azw,gtking: host->max_segs: 1 host->max_seg_size: 3 host->max_blk_cou
<pulpoff> nt: 1536 sdiodev->max_request_size: 1536 sdiodev->max_segment_count: 1 max_blocks: 3 host->max_req_size: 1536
<pulpoff> [ 11.796825] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43752-sdio for chip BCM43752/2
<pulpoff> [ 11.827549] usbcore: registered new interface driver brcmfmac
<pulpoff> [ 11.835915] brcmfmac mmc2:0001:1: Direct firmware load for brcm/brcmfmac43752-sdio.azw,gtking.bin failed with error -2
<pulpoff> [ 11.835995] brcmfmac mmc2:0001:1: Direct firmware load for brcm/brcmfmac43752-sdio.bin failed with error -2
<steev> error -2 is no such file or directory
<steev> do you have the /lib/firmware/brcm/brcmfmac43752-sdio.bin file?
<pulpoff> steev : i cant find that file anywhere
<pulpoff> i know its missing files, i tried to replace with other files, but no luck
<pulpoff> i have latest revision of GT King, it might have smth to do with that
<steev> you might have to grab it from a factory image or whatever for the device
<pulpoff> well, i see these files :
<steev> you need the firmware that is listed
<pulpoff> where can i get it than ?
<steev> well
<steev> boot the vendor's image or whatever... look at what firmware file it loads
<pulpoff> do u mean android firmware?
<steev> well at a guess
<steev> https://github.com/khadas/fenix/commit/cf3732463ef9700b06d28b755e116bca078f22bd since this commit adds the 6359sa firmware, it's one of those 2 bin files
<steev> so i'd grab the non-apsta version, copy it to brcmfmac43752-sdio.bin in /lib/firmware/brcm/ and see if that works
<pulpoff> i tried just that
<pulpoff> module loads, but no devices
<pulpoff> it needs the .txt file
<pulpoff> properly built for the mmc1 hw
<pulpoff> does not work neither
<pulpoff> thats basically what should work :
<pulpoff> but alas, still no ifconfig/iwconfig devices
<pulpoff> not sure how to debug brcm module
<pulpoff> module is looking for these 2 files : brcm/brcmfmac43752-sdio.azw,gtking.bin, brcm/brcmfmac43752-sdio.azw,gtking.txt
chewitt has joined #linux-amlogic
<pulpoff> hi chewitt!
<pulpoff> actually i compiled your kernel for armbian to test the wifi driver :))
<pulpoff> it works quite well, even with default freq, GB5 shows 304/1000
<pulpoff> 5.15.0 tree
<pulpoff> from what i noticed it has missing : 2560x1440 support, 2.2Ghz freq support
<pulpoff> how do u load wifi driver for GT king with it ? can u help plz?
<chewitt> pulpoff the box is GT King (black) or GT King Pro (blue) ?
<pulpoff> black
<pulpoff> SN : 6B9XH1
<pulpoff> using gtking-oc dts
<chewitt> then I don't care about the lack of 2.2GHz
<chewitt> it's not using the RevC chip which uses the A311D cpu opp points
<pulpoff> root@King:~# dmesg | grep brcmf
<pulpoff> [ 10.618115] brcmfmac: brcmf_sdiod_sgtable_alloc: !!!! WIFI DEBUG azw,gtking:host->max_segs: 1host->max_seg_size: 3host->max_blk_count: 1536sdiodev->max_request_size: 1536sdiodev->max_segment_count: 1max_blocks: 3host->max_req_size: 1536
<pulpoff> [ 10.618492] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43752-sdio for chip BCM43752/2
<pulpoff> [ 10.642287] usbcore: registered new interface driver brcmfmac
<pulpoff> [ 11.810650] brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000): clkctl 0x50
<pulpoff> [ 12.873939] brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000): clkctl 0x50
<pulpoff> [ 168.748804] usbcore: deregistering interface driver brcmfmac
<chewitt> If you want to paste logs use pastebin
<pulpoff> its running fine with 2.2 speed, i compile kernel on it regularly
<pulpoff> sorry, ok
<chewitt> and pastebin the full dmesg log
<chewitt> last time I booted one of these boxes the wifi worked fine, it's just a standard broadcom chip
<chewitt> although BCM43752/2 doesn't look right
<chewitt> share the whole log
<pulpoff> ok sec
<pulpoff> chewitt : did u boot armbian on it?
<chewitt> never
<pulpoff> i am using armbian from vim3
<pulpoff> well, sorry, no
<pulpoff> armbian usb boot and kernel and vim3 gnome system
<pulpoff> with latest ubuntu 21.10 and mainline kernel
<pulpoff> there's no sound and no wifi, otherwise its quite ok
<pulpoff> i do agree that its weird that it calls the device brcmfmac43752
<pulpoff> there're no mentions of such device anywhere
<pulpoff> i see posts that there're a few different revisions of the device
<pulpoff> LPDDR4 and DDR4 memory, roms are not compatible between them
<pulpoff> i got the LPDDR4 new rev
<pulpoff> i will now test the same once again with your kernel ..
<chewitt> the device has AP6356S Wireless (802.11 a/b/g/n/ac, BT 4.1)
<chewitt> mine is an original Beelink box (their devs shipped it)
<pulpoff> thats correct i guess
<pulpoff> it is original Beelink box also
<chewitt> there are probably clones around, or perhaps they changed the chips between different production runs
<pulpoff> the box is original , its not a clone
<pulpoff> BT loads fine and works (tried with bt speaker)
<pulpoff> used BCM4362A2.hcd for BT
<chewitt> it's using some kind of fallback firmware file brcm/BCM.hcd
<chewitt> ahh
<pulpoff> yes, i renamed it to that
<pulpoff> i just booted kernel built from your src today
<pulpoff> here is the dmesg
<pulpoff> no errors, but also no devices for wifi
<pulpoff> i used bin and txt as suggested by steev above
<pulpoff> any idea why also this : [ 5.591789] No soundcards found. ?
<chewitt> there is no userspace config
<chewitt> it will work with my kernel, but prob. not the default armbian one
<pulpoff> it is not armbian
<pulpoff> it is your kernel
<pulpoff> i took your kernel tree and built armbian kernel from it
<chewitt> the first log shared was not from my tree, because it's missing patches
<pulpoff> yes,second
<pulpoff> first is 5.15.4
<pulpoff> from armbian tree
<chewitt> and second log looks similar
<chewitt> [ 0.000000] OF: fdt: Reserved memory: failed to reserve memory for node 'secmon@5000000': base 0x0000000005000000, size 3 MiB
<pulpoff> maybe because i used armbian .config ?
<pulpoff> sorry i am not sure what to do with src/conf/cards/axg-sound-card.conf
<chewitt> Beelink devs say "Sorry, we don't have this AP6275P module on GTKINGH and GTKINGPEO" (typos)
<pulpoff> rebuild with that ?
<pulpoff> or just use your kernel as it supposed to be in it ?
<chewitt> place in /usr/share/alsa/cards/
<chewitt> you also need mixer settings
<pulpoff> photo of my box
<pulpoff> where should i put the soundconf ?
<pulpoff> copied the axg-sound-card.conf to /usr/share/alsa/cards/
<pulpoff> and rebooted now
<pulpoff> [ 5.508284] ALSA device list:
<pulpoff> [ 5.512239] No soundcards found.
<chewitt> then I think you have the default arbmian kernel
<pulpoff> well
<pulpoff> let me try to compile it again than
<pulpoff> how can i show that its your tree before compilation ?
<chewitt> also [ 0.000000] Linux version 5.15.4-meson64-beta
<chewitt> and my tree is still at 5.15.0
<pulpoff>  i had to change to .4 manually
<chewitt> I don't build armbian and I forget how/where you change all their stuff and ignore their patchset
<pulpoff> otherwise armbian recompile script was downloading from kernel.org
<pulpoff> it was .0 there
<pulpoff> i am building now with -chwitt name
<pulpoff> chewitt
<pulpoff> the only thing from armbian is the .config file
<pulpoff> as there wasn't any in yours i think
<chewitt> but this is optimised for a different distro
<chewitt> (one that isn't a desktop OS)
<pulpoff> ok
<pulpoff> 2021-11-24 02:31:19 (1,97 MB/s) - ‘linux.aarch64.conf’ saved [184407/184407]
<pulpoff> root@mac:/usr/src/amlogic-s9xxx-armbian-main/compile-kernel/kernel/linux-5.15.4# cp linux.aarch64.conf .config
<pulpoff> root@mac:/usr/src/amlogic-s9xxx-armbian-main/compile-kernel/kernel/linux-5.15.4# cd ..
<pulpoff> root@mac:/usr/src/amlogic-s9xxx-armbian-main/compile-kernel/kernel# cd ..
<pulpoff> root@mac:/usr/src/amlogic-s9xxx-armbian-main/compile-kernel# cd ..
<pulpoff> root@mac:/usr/src/amlogic-s9xxx-armbian-main# ./recompile -k 5.15.4 -n -chewitt
<pulpoff> its building now
<chewitt> the other 55 people in this channel don't want to hear ping-ping-ping-ping etc. when you past log output
<pulpoff> sorry, ok
<pulpoff> compiled
<pulpoff> will test now
<chewitt> the main point is you need to check what sources are actually used
<chewitt> I rebase my branches constantly
<pulpoff> i am quite sure yours
<pulpoff> because before that, i had none of brcm output at all
<pulpoff> i downloaded today from your git
<pulpoff> ok just to be sure
<pulpoff> downloaded your master.zip again
<pulpoff> and will recompile it
<pulpoff> as that sound patch u pointed above was not there
<steev> mine was simply a suggestion for the firmware file it might be looking for/need.
<chewitt> beelink devs will share firmware for their latest cards in a minute
<chewitt> then I will push to the LE firmware repo and you can pick it
<pulpoff> oh
<pulpoff> thats very good to hear!
<chewitt> using ap6275s apparently
<pulpoff> so its not a clone afterall ? :)
<chewitt> and I should be able to get the u-boot sources to extract boot fips
<chewitt> although I assume you are booting from vendor u-boot?
<pulpoff> ehm, no i am booting with openwrt usb boot
<pulpoff> from usb drive, its much faster than emmc
<chewitt> no idea what that is .. I assume the box boots from emmc, then loads a kernel from usb
<pulpoff> correct
<pulpoff> it boots now from emmc/usb with usb prio1
<pulpoff> its easier to tinker with usb device than emmc in case it crashes :)
<pulpoff> chewitt, sorry to spam but ..
<pulpoff>         priv->card.owner = THIS_MODULE;
<pulpoff>         priv->card.dev = dev;
<pulpoff>         priv->match_data = data;
<pulpoff> this is from your master.zip tree
<pulpoff> there's no patch u sent link to
<pulpoff> priv->card.driver_name = dev->driver->name;
<chewitt> wrong branch
<pulpoff> aha
<pulpoff> so which one should it be?
<chewitt> amlogic-5.15.y
<chewitt> master is upstream torvalds/master
<pulpoff> i see, that explains!
<pulpoff> sec, will get that one
<steev> chewitt: what's the LEFT_RIGHT register about? if you don't mind me asking/derailing the conversation
<chewitt> @xdarklight and myself have been poking the AIU audio driver for GXBB/GXL/GXM to see if we can fix "the noise" that multichannel output can trigger
<chewitt> Kodi triggers it real easily :)
<steev> ahh
<chewitt> we resolved another issue with GXBB not handling 48KHz audio recently
<chewitt> there are a few other gremlins to find
<chewitt> "the noise" on AIU
<pulpoff> chewitt : now building the 5.15.y tree, i guess i can expect sound, but still no wifi ?
<chewitt> both AIU and AXG drivers also have 3-5 second dropouts occasionally
<chewitt> pulpoff the log spam is due to lack of mixer settings, the card conf should work once the driver-name patch is present
<chewitt> that patch is upstream for 5.16 I think
<pulpoff> ok, and about the wifi ?
<chewitt> should work once you have the right firmware and the latest workaround for the sdio silicon bug in all G12 chips
<pulpoff> and where to get the firmware?
<chewitt> my firmware repo, once I stop typing here and finish pushing it to github
<pulpoff> somehow cant build it
<pulpoff>   usr/gen_initramfs.sh: Cannot open '@INITRAMFS_SOURCE@'
<pulpoff> make[1]: *** [usr/Makefile:80: usr/initramfs_data.cpio] Error 1
<pulpoff> make: *** [Makefile:1868: usr] Error 2
<chewitt> stick with the armbian defconfig
<pulpoff> tried, its the same error unfortunately
<pulpoff> now patched armbian 5.15.4 with your sound patch and building
<pulpoff> is there some log of patches you have applied?
<chewitt> I have no idea what patches are in their patchset .. and I have low interest in debugging what's missing
<pulpoff> i understand that
<chewitt> the log of patches are in the git history.. there are currently 65 patches in my tree
<pulpoff> hence asking you where i can see list of your patches so i can port them myself maybe
<chewitt> github?
<pulpoff> yeah i am on it :)
vagrantc has joined #linux-amlogic
<pulpoff> oh wow, lots of HEVC decoder updates ..
<pulpoff> [ 5.559739] ALSA device list:
<pulpoff> [ 5.564068] No soundcards found.
<pulpoff> i patched the file and added axg-sound-card.conf
<chewitt> that's a current guess on the filenames required
<pulpoff> root@King:~# cat /proc/asound/cards
<pulpoff>  0 [GTKINGPRO ]: axg-sound-card - GTKING-PRO
<pulpoff>                       GTKING-PRO
<pulpoff> ok trying that
<chewitt> I'm going for my morning run in 5 .. else I don't get one
<pulpoff> but thats .txt config
<pulpoff> and the bin ?
<pulpoff> brcmfmac43752-sdio.bin ?
<chewitt> it's early here, I don't wake up until after the run :)
<pulpoff> well, we are almost there
<chewitt> the correct BT file is there too
<pulpoff> i am not sure what to do with these files
<chewitt> put them in /usr/lib/firmware/brcm/
<pulpoff> now i see it
<pulpoff> it wasnt there before
<pulpoff> well, unfortunately nothing has changed
<pulpoff> module loads, no wifi interface
<pulpoff> root@King:/lib/firmware/brcm# ls *43752* -la
<pulpoff> -rw-r--r-- 1 root root 8354 Nov 24 03:22 brcmfmac43752-sdio.azw,gtking.txt
<pulpoff> -rw-r--r-- 1 root root 757448 Nov 24 03:20 brcmfmac43752-sdio.bin
<pulpoff> -rw-r--r-- 1 root root 8354 Nov 24 03:21 brcmfmac43752-sdio.txt
<pulpoff> [ 778.665864] usbcore: deregistering interface driver brcmfmac
<pulpoff> [ 780.748512] usbcore: registered new interface driver brcmfmac
<pulpoff> no error
<chewitt> post the full dmeg somewhere
<pulpoff> ok sec
<chewitt> and .. go figure out how to use my full sources
<chewitt> because there are things in my tree that workaround issues with sdio
<pulpoff> do u have a working release somewhere?
<pulpoff> some img i can try?
<pulpoff> packaged kernel ?
<pulpoff> i will try to build natively on arm now
<chewitt> edit the dtb name to boot with in uEnv.ini
<chewitt> this will not have the wifi working
<chewitt> but we should at least see an attempt to load the firmware
<chewitt> you will not be able to take the KERNEL file and use it with armbian
<chewitt> but you can boot the image and we can see what works
<chewitt> then all you need to do is use the right sources and put files in the right places (and run mixer commands post-boot)
<pulpoff> i can't boot from SD card atm somehow
<pulpoff> the emmc loader does not support it
<pulpoff> so need to flash android first
<pulpoff> AAAAH!
<pulpoff> chewitt! :))
<pulpoff> we are getting somewhere ! :)
<pulpoff> it started to work after i replaced BT firmware file as well
<chewitt> rename to brcmfmac43752-sdio.azw,gtking.bin and you get fewer errors in the log
<chewitt> they are harmless, but..
<pulpoff> ok sec
<pulpoff> but it still does not work ..
<chewitt> upstream finally got with the idea that board specific bin and nvram files are needed
<pulpoff> hm
<pulpoff> now it stopped working again
<chewitt> use the right kernel source first
<chewitt> you can more from the right patchset on 5.15.0 than the wrong set on 5.15.4
<chewitt> s/ca/gain
<pulpoff> it is currently armbian 5.15.4 with your sound patch only
<pulpoff> and new brcm firmware
<chewitt> quite
<pulpoff> and now after unloading module, idont see device again
<chewitt> i'm off for a run .. back in an hour
<pulpoff> ok thanks!
<pulpoff> gnite
<pulpoff> it is almost working now
<pulpoff> [ 11.207161] brcmfmac mmc2:0001:1: Direct firmware load for brcm/brcmfmac43752-sdio.azw,gtking.bin failed with error -2
<pulpoff> [ 11.453917] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43752-sdio for chip BCM43752/2
<pulpoff> [ 11.454098] brcmfmac: brcmf_c_process_clm_blob: no clm_blob available (err=-2), device may have limited channels available
<pulpoff> [ 11.463148] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43752/2 wl0: Oct 23 2020 15:06:26 version 18.35.387.23.14 (70c9ec1@shgit) (wlan=r880297) FWID 01-217b144d
<pulpoff> [ 53.834002] Bluetooth: hci0: BCM4362A2 'brcm/BCM4362A2.hcd' Patch
<pulpoff> [ 67.043693] ieee80211 phy0: brcmf_p2p_create_p2pdev: timeout occurred
<pulpoff> [ 67.043704] ieee80211 phy0: brcmf_cfg80211_add_iface: add iface p2p-dev-wlan0 type 10 failed: err=-5
<pulpoff> will continue tomorrow, thanks again!
buzzmarshall has quit [Quit: Konversation terminated!]
Terry1373 has quit [Quit: Bye Bye]
Terry1373 has joined #linux-amlogic
vagrantc has quit [Quit: leaving]
<chewitt> btw, I'm never sure which file to pick when renaming the bsp/android files
<chewitt> the .bin file you have was fw_bcm43752a2_ag.bin
<chewitt> there is also an fw_bcm43752a2_ag_apsta.bin
<chewitt> the -2 errors are harmless, the first is solved by renaming the file to match and the clm blob is not mandatory
<chewitt> the -5 errors could be related to the wrong file
<chewitt> so perhaps try https://www.dropbox.com/s/bnrg8cpib020op5/fw_bcm43752a2_ag_apsta.bin?dl=1 renamed instead, see if that helps
Darkmatter66 has quit [Ping timeout: 260 seconds]
Darkmatter66 has joined #linux-amlogic
tdebrouw has joined #linux-amlogic
<steev> chewitt: apsta means it can run as an ap and station at the same time
<chewitt> steev: thanks, that's probably the better one to use then
<chewitt> although it appears the _ag.bin and _ag_apsta.bini are the same file
<chewitt> I copied the file to my git directory and renamed it .. git shows nothing happened (no diff)
<narmstrong> it's historical, broadcom distributed 3 fw (ap, sta, ap+sta) and 2 driver (ap, sta) that could work together with the ap+sta, but now the mainline driver handles ap+sta or whatever fw is loaded, but the vendor driver is still used and broadcom stil releases it with associated firmwares
<chewitt> maybe that helps somewhere (although I doubt it)
warpme__ has joined #linux-amlogic
<steev> the clm_blob is regulatory stuff for what channels it's allowed to use
sputnik_ has quit [Read error: Connection reset by peer]
sputnik_ has joined #linux-amlogic
GNUtoo has quit [Ping timeout: 276 seconds]
GNUtoo has joined #linux-amlogic
pulpoff has quit [Quit: Client closed]
tafa has quit [Quit: ZNC - https://znc.in]
tafa has joined #linux-amlogic
tafa has quit [Remote host closed the connection]
tafa has joined #linux-amlogic
Darkmatt- has joined #linux-amlogic
Darkmatter66 has quit [Ping timeout: 260 seconds]
tafa has quit [Quit: ZNC - https://znc.in]
tafa has joined #linux-amlogic
tafa has quit [Remote host closed the connection]
tafa has joined #linux-amlogic
tafa has joined #linux-amlogic
tafa has quit [Changing host]
Darkmatter66 has joined #linux-amlogic
Darkmatt- has quit [Ping timeout: 264 seconds]
tafa has quit [Quit: ZNC - https://znc.in]
tafa has joined #linux-amlogic
jernej has joined #linux-amlogic
tdebrouw has quit [Quit: Leaving.]
vagrantc has joined #linux-amlogic
camus1 has joined #linux-amlogic
sputnik__ has joined #linux-amlogic
Darkmatt- has joined #linux-amlogic
Darkmatter66 has quit [*.net *.split]
sputnik_ has quit [*.net *.split]
khilman has quit [*.net *.split]
camus has quit [*.net *.split]
Tartarus has quit [*.net *.split]
camus1 is now known as camus
arnd has quit [Ping timeout: 245 seconds]
arnd has joined #linux-amlogic
khilman has joined #linux-amlogic
Tartarus has joined #linux-amlogic
camus has quit [Ping timeout: 265 seconds]
camus has joined #linux-amlogic
GNUtoo has quit [Remote host closed the connection]
GNUtoo has joined #linux-amlogic
chewitt has quit [Quit: Zzz..]
wens has quit [Ping timeout: 260 seconds]
tdebrouw has joined #linux-amlogic
buzzmarshall has joined #linux-amlogic
camus has quit [Ping timeout: 250 seconds]
camus has joined #linux-amlogic
wens has joined #linux-amlogic
Darkmatt- is now known as Darkmatt-er66
Darkmatt-er66 is now known as Darkmatter66
tdebrouw has quit [Quit: Leaving.]
warpme__ has quit [Quit: Connection closed for inactivity]
warpme__ has joined #linux-amlogic
anessen97 has quit [Remote host closed the connection]
camus has quit [Ping timeout: 260 seconds]
camus has joined #linux-amlogic
jernej has quit [Ping timeout: 260 seconds]
warpme__ has quit [Quit: Connection closed for inactivity]