Jump to content

Single Armbian image for RK + AML + AW (aarch64 ARMv8)


balbes150

Recommended Posts

2 minutes ago, dbsharpe said:

I'm prepared to be corrected but I've natively compiled the whole image including kernel under the most recent focal and bionic arm64 ubuntu distros from https://github.com/150balbes/Build-Armbian as per the authors post  so you should be able to build whatever driver needs includes & libs.

That is helpful, thank you.  But it would still be better if there was a simple headers .deb available in the usual debian/armbian way. 

Link to comment
Share on other sites

Armbian & Khadas are rewarding contributors

Well, using Armbian_20.02.0-rc1.037_Aml-s9xxx_bionic_current_5.5.0-rc6_desktop_20200205, on my H96 Pro H3, the wifi is not working. I took the output of dmesg on Android, it has this:

[  113.499310] dhd_os_open_image: /etc/wifi/40183/config.txt (102 bytes) open success
...
[  113.574510] Final fw_path=/etc/wifi/40183/fw_bcm4334b1_ag.bin
[  113.580529] Final nv_path=/etc/wifi/40183/nvram.txt
[  113.585309] Final clm_path=/etc/wifi/40183/clm_bcmdhd.blob
[  113.592102] Final conf_path=/etc/wifi/40183/config.txt
...
[  113.607107] dhd_os_open_image: /etc/wifi/40183/fw_bcm4334b1_ag.bin (451566 bytes) open success
[  113.739233] dhd_os_open_image: /etc/wifi/40183/nvram.txt (2019 bytes) open success
[  113.814711] dhdsdio_write_vars: Download, Upload and compare of NVRAM succeeded.


In Armbian dmesg, the important part of the output is this:

[    8.902412] brcmfmac: F1 signature read @0x18000000=0x16034334
[    8.908532] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac4334-sdio for chip BCM4334/3
[    8.909037] usbcore: registered new interface driver brcmfmac
[    8.916140] brcmfmac mmc2:0001:1: Direct firmware load for brcm/brcmfmac4334-sdio.bin failed with error -2
[    9.027835] Bluetooth: hci0: BCM: chip id 68
[    9.028441] Bluetooth: hci0: BCM: features 0x0f
[    9.030268] Bluetooth: hci0: BCM4334B0
[    9.030287] Bluetooth: hci0: BCM4334B0 (002.001.013) build 0000
[    9.030417] bluetooth hci0: Direct firmware load for brcm/BCM4334B0.hcd failed with error -2
[    9.030429] Bluetooth: hci0: BCM: Patch brcm/BCM4334B0.hcd not found

 

Someone knows what is error -2? Does anyone know how to solve?

Here are the complete dmesg outputs:
https://bit.ly/3hgFrfx

Link to comment
Share on other sites

Instead of generating useless messages, learn how to use search (information on headers has been discussed many times). All necessary packages have been placed in network repositories for a long time and are available by regular means.

 

apt update

Fetched 6,988 kB in 7s (984 kB/s)                                                                                                                                                                                 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
31 packages can be upgraded. Run 'apt list --upgradable' to see them.
 

apt-cache search linux-headers-current
linux-headers-current-arm-64 - Linux kernel headers for 5.7.0-rc7-arm-64 on arm64
linux-headers-current-meson64 - Linux kernel headers for 5.6.15-meson64 on arm64
linux-headers-current-rockchip64 - Linux kernel headers for 5.4.45-rockchip64 on arm64
linux-headers-current-sunxi64 - Linux kernel headers for 5.4.43-sunxi64 on arm64
linux-headers-current-imx6 - Linux kernel headers for 5.6.15-imx6 on armhf
linux-headers-current-meson - Linux kernel headers for 5.6.16-meson on armhf
linux-headers-current-mvebu - Linux kernel headers for 5.4.43-mvebu on armhf
linux-headers-current-odroidxu4 - Linux kernel headers for 5.4.41-odroidxu4 on armhf
linux-headers-current-rockchip - Linux kernel headers for 5.4.44-rockchip on armhf
linux-headers-current-sunxi - Linux kernel headers for 5.4.45-sunxi on armhf

 

Link to comment
Share on other sites

1 hour ago, Lexx said:

source /etc/network/interfaces/* . without .d

 

Without the colon and without the .d, still the same problem!

I tried with

- nano /etc/network/interfaces

- armbian-config ; network ; edit .....

Can you show me your file?

Link to comment
Share on other sites

Checked the transition from Bionic to Focal with the command (do-release-upgrade). The system was updated from the beginning to Eoan and then upgraded to Focal. Please note that this is a potentially dangerous procedure and you must first save all your valuable data.

Link to comment
Share on other sites

1 hour ago, almotra said:

 

Without the colon and without the .d, still the same problem!

I tried with

- nano /etc/network/interfaces

 

Wifi, BT & ethernet mac address have always been problematic with arm systems.
Just google 00:15:18:01:81:31. I'd be interested to know where the aforementioned mac address comes from as I can't find it in the .dts or kernel source .h files.

If your just using ethernet, you could use a custom boot script:

systemctl stop NetworkManager.service
pkill dhclient
ifconfig eth0 down
ifconfig eth0 hw ether 00:15:18:01:81:32
sleep 2s
ifconfig eth0 up
systemctl restart NetworkManager.service
ifdown eth0 ; ifup eth0

may also need:

ip rule flush
ip rule add lookup main
ip rule add lookup default

before or after the code as run.

Link to comment
Share on other sites

3 hours ago, dual3zw said:

Well, using Armbian_20.02.0-rc1.037_Aml-s9xxx_bionic_current_5.5.0-rc6_desktop_20200205, on my H96 Pro H3, the wifi is not working. I took the output of dmesg on Android, it has this:

 

Obvious question is does the file /lib/firmware/brcm/brcmfmac4334-sdio.bin exist which are part of the package linux-firmware? I don't have experience of that specific chip so can't say if the android firmware files would work in place of the armbian ones.

Link to comment
Share on other sites

4 hours ago, almotra said:

Can you show me your file?

source /etc/network/interfaces.d/*

# Wired adapter #1
allow-hotplug eth0
no-auto-down eth0
iface eth0 inet dhcp
#iface eth0 inet static
#address 192.168.1.100
#netmask 255.255.255.0
#gateway 192.168.1.1
#dns-nameservers 192.168.1.1
pre-up ifconfig eth0 hw ether xxxxxxxxxxxx
#    hwaddress ether # if you want to set MAC manually
#    pre-up /sbin/ifconfig eth0 mtu 3838 # setting MTU for DHCP, static just: mtu 3838


auto lo
iface lo inet loopback

Link to comment
Share on other sites

On 6/10/2020 at 4:34 PM, dbsharpe said:

Assuming eth0 is working with a internet connation, try these commands in order under armbian as root (su -):

cd /lib/firmware/brcm/
mv /lib/firmware/brcm/brcmfmac4330-sdio.bin /lib/firmware/brcm/brcmfmac4330-sdio.bin.backup
mv /lib/firmware/brcm/brcmfmac4330-sdio.txt /lib/firmware/brcm/brcmfmac4330-sdio.txt.backup

wget -O brcmfmac4330-sdio.bin "https://github.com/armbian/firmware/raw/master/brcm/brcmfmac-ap6330-sdio.bin"
wget -O brcmfmac4330-sdio.txt "https://github.com/armbian/firmware/raw/master/brcm/brcmfmac-ap6330-sdio.txt"
rmmod   brcmfmac brcmutil
sleep 3s ;  modprobe brcmfmac

dmesg | grep -i ": Firmware: "

The system should now report the following wifi firmware loaded:
Jan 23 2013 17:46:35 version 5.90.195.114


If this does not work, I'll describe how to determine the wifi firmware used by android but if they have the same digital file signatures, it will be no help to you.

 

Finally wifi worked broadcom 4330can scan the network, step everything below, described by the great friend dbsharpe. It was just a firmware update.  

Without help it would be very difficult to know. I need to learn to think in order to solve other similar things. 

 

I really appreciate everyone's help. Because the latest 5.7.0-rc7 kernel does not have compatible firmware, it would be really nice to have a script to update them automatically. I believe that there is otherwise I could make one to collaborate.

 

root@arm-64:/home/fenix# cd /lib/firmware/brcm/
root@arm-64:/lib/firmware/brcm# mv /lib/firmware/brcm/brcmfmac4330-sdio.bin /lib/firmware/brcm/brcmfmac4330-sdio.bin.backup
root@arm-64:/lib/firmware/brcm# mv /lib/firmware/brcm/brcmfmac4330-sdio.txt /lib/firmware/brcm/brcmfmac4330-sdio.txt.backup
root@arm-64:/lib/firmware/brcm# wget -O brcmfmac4330-sdio.bin "https://github.com/armbian/firmware/raw/master/brcm/brcmfmac-ap6330-sdio.bin"
--2020-06-11 17:52:07-- https://github.com/armbian/firmware/raw/master/brcm/brcmfmac-ap6330-sdio.bin
Resolving github.com (github.com)... 18.231.5.6
Connecting to github.com (github.com)|18.231.5.6|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://raw.githubusercontent.com/armbian/firmware/master/brcm/brcmfmac-ap6330-sdio.bin [following]
--2020-06-11 17:52:07-- https://raw.githubusercontent.com/armbian/firmware/master/brcm/brcmfmac-ap6330-sdio.bin
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.92.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.92.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 223581 (218K) [application/octet-stream]
Saving to: ‘brcmfmac4330-sdio.bin’

brcmfmac4330-sdio.b 100%[===================>] 218,34K  --.-KB/s    in 0,1s    

2020-06-11 17:52:08 (1,45 MB/s) - ‘brcmfmac4330-sdio.bin’ saved [223581/223581]

root@arm-64:/lib/firmware/brcm# wget -O brcmfmac4330-sdio.txt "https://github.com/armbian/firmware/raw/master/brcm/brcmfmac-ap6330-sdio.txt"
--2020-06-11 17:52:23-- https://github.com/armbian/firmware/raw/master/brcm/brcmfmac-ap6330-sdio.txt
Resolving github.com (github.com)... 18.228.52.138
Connecting to github.com (github.com)|18.228.52.138|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://raw.githubusercontent.com/armbian/firmware/master/brcm/brcmfmac-ap6330-sdio.txt [following]
--2020-06-11 17:52:24-- https://raw.githubusercontent.com/armbian/firmware/master/brcm/brcmfmac-ap6330-sdio.txt
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.92.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.92.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1522 (1,5K) [text/plain]
Saving to: ‘brcmfmac4330-sdio.txt’

brcmfmac4330-sdio.t 100%[===================>]   1,49K  --.-KB/s    in 0s      

2020-06-11 17:52:24 (3,13 MB/s) - ‘brcmfmac4330-sdio.txt’ saved [1522/1522]

root@arm-64:/lib/firmware/brcm# rmmod   brcmfmac brcmutil
root@arm-64:/lib/firmware/brcm# modprobe brcmfmac
root@arm-64:/lib/firmware/brcm# dmesg | grep -i ": Firmware: "
[   10.408669] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4330/4 wl0: Oct 25 2011 19:34:12 version 5.90.125.104
[  496.387721] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4330/4 wl0: Jan 23 2013 17:46:35 version 5.90.195.114 FWID 01-cafa6b3e
root@arm-64:/lib/firmware/brcm# 

 

https://raw.githubusercontent.com/armbian/firmware/master

Link to comment
Share on other sites

On 6/10/2020 at 3:37 PM, usual user said:

Devicetree is setup for BCM4330 so your kernel is pulling brcmfmac4330-sdio.bin, do you have a proper brcmfmac4330-sdio.txt in place?

This is the current linux-firmware version, hence a proper one for BCM4330.

 

 

thanks for the guidance I managed to make it work just below the topic ...

Link to comment
Share on other sites

7 hours ago, dual3zw said:

Well, using Armbian_20.02.0-rc1.037_Aml-s9xxx_bionic_current_5.5.0-rc6_desktop_20200205, on my H96 Pro H3, the wifi is not working. I took the output of dmesg on Android, it has this:

[  113.499310] dhd_os_open_image: /etc/wifi/40183/config.txt (102 bytes) open success
...
[  113.574510] Final fw_path=/etc/wifi/40183/fw_bcm4334b1_ag.bin
[  113.580529] Final nv_path=/etc/wifi/40183/nvram.txt
[  113.585309] Final clm_path=/etc/wifi/40183/clm_bcmdhd.blob
[  113.592102] Final conf_path=/etc/wifi/40183/config.txt
...
[  113.607107] dhd_os_open_image: /etc/wifi/40183/fw_bcm4334b1_ag.bin (451566 bytes) open success
[  113.739233] dhd_os_open_image: /etc/wifi/40183/nvram.txt (2019 bytes) open success
[  113.814711] dhdsdio_write_vars: Download, Upload and compare of NVRAM succeeded.


In Armbian dmesg, the important part of the output is this:

[    8.902412] brcmfmac: F1 signature read @0x18000000=0x16034334
[    8.908532] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac4334-sdio for chip BCM4334/3
[    8.909037] usbcore: registered new interface driver brcmfmac
[    8.916140] brcmfmac mmc2:0001:1: Direct firmware load for brcm/brcmfmac4334-sdio.bin failed with error -2
[    9.027835] Bluetooth: hci0: BCM: chip id 68
[    9.028441] Bluetooth: hci0: BCM: features 0x0f
[    9.030268] Bluetooth: hci0: BCM4334B0
[    9.030287] Bluetooth: hci0: BCM4334B0 (002.001.013) build 0000
[    9.030417] bluetooth hci0: Direct firmware load for brcm/BCM4334B0.hcd failed with error -2
[    9.030429] Bluetooth: hci0: BCM: Patch brcm/BCM4334B0.hcd not found

 

Someone knows what is error -2? Does anyone know how to solve?

Here are the complete dmesg outputs:
https://bit.ly/3hgFrfx

the solution is further down this forum, I am Gilberto and staff helped me solve this problem .....

Link to comment
Share on other sites

10 hours ago, gilberto said:

Because the latest 5.7.0-rc7 kernel does not have compatible firmware

Either your device is not equipped with a BCM4430 (maybe AP6330) or you had not the proper calibration parameters (brcmfmac4330-sdio.txt) in place. And yes, they are different for each board and even the location (various regulatory restrictions) where you operate the wifi.
Since you now have a calibration set that works for you, restore the current linux-firmware (brcmfmac4330-sdio.bin version 5.90.125.104 ) and report if wifi is still working.
Depending on the result it can be decided what the proper fix wold be.

Link to comment
Share on other sites

6 hours ago, usual user said:

Either your device is not equipped with a BCM4430 (maybe AP6330) or you had not the proper calibration parameters (brcmfmac4330-sdio.txt) in place. And yes, they are different for each board and even the location (various regulatory restrictions) where you operate the wifi.
Since you now have a calibration set that works for you, restore the current linux-firmware (brcmfmac4330-sdio.bin version 5.90.125.104 ) and report if wifi is still working.
Depending on the result it can be decided what the proper fix wold be.

 

I did as you said, I restored the default firmware, it stopped working again, only the master version in development works. Thank you.

[  496.387721] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4330/4 wl0: Jan 23 2013 17:46:35 version 5.90.195.114 FWID 01-cafa6b3e

 

including i upgraded apt-get update , apt-get upgrade and upgraded the fimware full package and it didn't work! 

Edited by gilberto
Link to comment
Share on other sites

23 hours ago, balbes150 said:

Instead of generating useless messages, learn how to use search (information on headers has been discussed many times). All necessary packages have been placed in network repositories for a long time and are available by regular means.

 

apt update

Fetched 6,988 kB in 7s (984 kB/s)                                                                                                                                                                                 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
31 packages can be upgraded. Run 'apt list --upgradable' to see them.
 

apt-cache search linux-headers-current
linux-headers-current-arm-64 - Linux kernel headers for 5.7.0-rc7-arm-64 on arm64
linux-headers-current-meson64 - Linux kernel headers for 5.6.15-meson64 on arm64
linux-headers-current-rockchip64 - Linux kernel headers for 5.4.45-rockchip64 on arm64
linux-headers-current-sunxi64 - Linux kernel headers for 5.4.43-sunxi64 on arm64
linux-headers-current-imx6 - Linux kernel headers for 5.6.15-imx6 on armhf
linux-headers-current-meson - Linux kernel headers for 5.6.16-meson on armhf
linux-headers-current-mvebu - Linux kernel headers for 5.4.43-mvebu on armhf
linux-headers-current-odroidxu4 - Linux kernel headers for 5.4.41-odroidxu4 on armhf
linux-headers-current-rockchip - Linux kernel headers for 5.4.44-rockchip on armhf
linux-headers-current-sunxi - Linux kernel headers for 5.4.45-sunxi on armhf

 

I'm sorry you feel my posts are useless, but the headers for the armbian version I'm running are not in that list. I used your build, linked to from your first post

$uname -a
Linux aml 5.5.0-rc6-aml-s9xxx.

 

$ apt search linux-image-current

Sorting... Done
Full Text Search... Done
linux-image-current-aml-s9xxx/now 20.02.0-rc1.038 arm64 [installed,local]
  Linux kernel, version 5.5.0-rc6-aml-s9xxx

 

etc.  (there is no other aml version available on a fully up to date system on which apt update has just run.

 

$ apt search linux-headers-current
Sorting... Done
Full Text Search... Done
linux-headers-current-imx6/bullseye 20.05.0-trunk.148 armhf
  Linux kernel headers for 5.6.15-imx6 on armhf

linux-headers-current-meson/bullseye 20.05.0-trunk.148 armhf
  Linux kernel headers for 5.6.15-meson on armhf

linux-headers-current-meson64/bullseye 20.05.0-trunk.148 arm64
  Linux kernel headers for 5.6.15-meson64 on arm64

linux-headers-current-mvebu/bullseye 20.05.0-trunk.148 armhf
  Linux kernel headers for 5.4.43-mvebu on armhf

linux-headers-current-mvebu64/bullseye 20.05.0-trunk.148 arm64
  Linux kernel headers for 4.19.125-mvebu64 on arm64

linux-headers-current-odroidxu4/bullseye 20.05.0-trunk.148 armhf
  Linux kernel headers for 5.4.41-odroidxu4 on armhf

linux-headers-current-rockchip/bullseye 20.05.0-trunk.148 armhf
  Linux kernel headers for 5.4.43-rockchip on armhf

linux-headers-current-rockchip64/bullseye 20.05.0-trunk.148 arm64
  Linux kernel headers for 5.4.43-rockchip64 on arm64

linux-headers-current-sunxi/bullseye 20.05.0-trunk.148 armhf
  Linux kernel headers for 5.4.42-sunxi on armhf

linux-headers-current-sunxi64/bullseye 20.05.0-trunk.148 arm64
  Linux kernel headers for 5.4.42-sunxi64 on arm64

 

So I have no upgrade path to a newer aml kernel with headers, and no headers package for the current aml kernel.

 

I'm sorry if this is wasting your time but I've only been running debian for 13 years so I may have missed something ;-)

 

 

Edited by julian67
clarity
Link to comment
Share on other sites

1 hour ago, julian67 said:

I'm sorry you feel my posts are useless, but the headers for the armbian version I'm running are not in that list. I used your build, linked to from your first post

$uname -a
Linux aml 5.5.0-rc6-aml-s9xxx.

 

$ apt search linux-image-current

Sorting... Done
Full Text Search... Done
linux-image-current-aml-s9xxx/now 20.02.0-rc1.038 arm64 [installed,local]
  Linux kernel, version 5.5.0-rc6-aml-s9xxx

 

etc.  (there is no other aml version available on a fully up to date system on which apt update has just run.

 

Let me take a stab at answering/clarifying.  You are using a build and set of builds that is no longer maintained.  The "aml-s9xxx" builds ended with the version you have.  After which balbes150 moved to the "arm-64" builds.  The "arm-64" builds (the topic of this forum thread) support more than just the Amlogic cpus that the previous 'aml-x9xxx' based builds supported.  In addition balbes150 has worked to incorporate apt updates of kernel packages which really didn't exist in the 'aml-s9xxx' builds as well as other features as he continues to make improvements. 

So what you have installed is essentially end of the line for getting any new versions, and you would need to move to a 'arm-64' build to pick up new features and any newer kernel versions.  I can't recall if you can simply upgrade the kernel package and easily move from the 'aml-s9xxx' line to the 'arm-64' builds.  I have done it, but I don't remember how easy it was or wasn't.  The reason it may be more or less difficult is if there are changes to the boot scripts that also occurred between what you are running and current versions that might require additional tweeking.

Also a general comment overall to set expectations, the tv box builds are not official armbian builds and therefore are not supported.  The work balbes150 does is a fork of official armbian, and the armbian team allows him to utilize many armbian resources (like the armbian apt repository, these forums, etc), but there shouldn't be the same level of expectation of support as there are for officially supported armbian builds.  Balbes150 is one person trying to move the set of functionality he is releasing in his builds forward.  Some of the rest of us on the forum try to help others, but the bulk of questions tend to get answered by balbes150 as he is the developer creating these builds.  And english isn't his native language so sometimes his posts come across more harsh than they are likely intended to be.

 

Link to comment
Share on other sites

3 hours ago, julian67 said:

So I have no upgrade path to a newer aml kernel with headers, and no headers package for the current aml kernel.

 

I'm sorry if this is wasting your time but I've only been running debian for 13 years so I may have missed something ;-)

If you have been using Debian for a long time , then you know the command "dpkg -i", which allows you to install any new version of the kernel (and any package). I regularly upload new versions of kernel packages and headers to the site along with images. This information has been published many times in different topics, but each user believes that the developers should answer it personally (to a repeatedly repeated question).

 

Link to comment
Share on other sites

15 minutes ago, balbes150 said:

If you have been using Debian for a long time , then you know the command "dpkg -i", which allows you to install any new version of the kernel (and any package). I regularly upload new versions of kernel packages and headers to the site along with images. This information has been published many times in different topics, but each user believes that the developers should answer it personally (to a repeatedly repeated question).

 

 

 

Fine, but if you depart so radically from the usual way of offering linux-image and linux-headers then simply *document* it in the very first post where it can be easily found.  It is a BIG change from normal debian and from normal armbian too.

Two of the best things about Debian are its predictable packaging and well structured bug reporting.  When both are absent it's odd to blame the users for not finding the exact thing they look for and then scolding them for asking perfectly well phrased factual questions. Anyway it's up to you how you offer your work but I somehow doubt I'll be the last person who didn't find an answer by searching 30+ pages of often oddly formatted and spelled forum posts.

Thanks again.

 

Additionally the resources you link to on page one, Yandex and Mega, have different contents!

Most people outside the Russia centric world don't use Yandex but might use Mega, yet all this stuff I'm supposed to automatically find is *not* in the Mega directories.  There is zero indication that they might be different on page 1!

15 minutes ago, balbes150 said:

 

 

 

 

 

 

 

Link to comment
Share on other sites

4 hours ago, gilberto said:

I restored the default firmware, it stopped working again, only the master version in development works

OK, this confirms at least the wifi devicetree configuration is not proper.
I'm not even convinced that a real BCM4330 chip is installed on your board, possibly a compatible AP6330. But this can only be confirmed by optical inspection.

Quote

[   10.990333] brcmfmac mmc2:0001:1: Direct firmware load for brcm/brcmfmac4330-sdio.khadas,vim.txt failed with error -2

I have extracted this from one of your posted log. If you are not using a Kadas board this is also evidence for improper devicetree configuration for your board. It asked for brcmfmac4330-sdio.khadas,vim.txt as calibration parameters in the first attempt, but should have asked for one for your specific board. The kernel has a framework to manage various calibration parameter files (*.txt) in parallel. It is derived from the devicetree.

Through your previous efforts you know that the kernel supports your wifi chip, so "only" a correct devivetree configuration for your board is missing.
The right solution for everyone without regressions for others is to create a proper device tree configuration for your board and not replace fallback firmware. With this the required firmware and the calibration parameters can stay alongside with the already existing ones and other users can keep using what already worked for them.

Link to comment
Share on other sites

20 hours ago, gilberto said:

the solution is further down this forum, I am Gilberto and staff helped me solve this problem .....

The problem is almost completely solved. I analyzed and searched the forum for some posts from dbshape, balbes150 and gilberto (are you also a Brazilian?)
The steps were as follows:

1- I mounted the Android image and in the /etc folder I copied the /wifi and /bluetooth folders;

 

2- I checked in the kernel output that Armbian was looking for the files brcm/brcmfmac4334-sdio and brcm/BCM4334B0.hcd.

 

3- Inside the /wifi folder there is the file fw_bcm4334b1_ag.bin. I copied it to the /lib/firmware/brcm/folder, renaming it brcmfmac4334-sdio.bin. This file is also present in the Armbian itself in /lib/firmware/rkwifi/, but I preferred to use the original Android.
sudo cp -av fw_bcm4334b1_ag.bin /lib/firmware/brcm/brcmfmac4334-sdio.bin
'fw_bcm4334b1_ag.bin' -> '/lib/firmware/brcm/brcmfmac4334-sdio.bin'

 

4- Inside the /bluetooth folder there is the file bcm4334.hcd. I copied it to the /lib/firmware/brcm/ folder, renaming it BCM4334B0.hcd.
sudo cp -av bcm4334.hcd /lib/firmware/brcm/BCM4334B0.hcd
'bcm4334.hcd' -> '/lib/firmware/brcm/BCM4334B0.hcd'

 

5- Então fiz o reboot. Após o reboot, bluetooth funcionando mas wifi não. Na saída do kernel:
brcmfmac mmc2:0001:1: Direct firmware load for brcm/brcmfmac4334-sdio.amlogic,p212.txt failed with error -2
brcmfmac mmc2:0001:1: Direct firmware load for brcm/brcmfmac4334-sdio.txt failed with error -2

 

6- Dentro da pasta /wifi do Android está o arquivo nvram.txt. Copiei este arquivo para /lib/firmware/brcm/ renomeando como brcmfmac4334-sdio.amlogic,p212.txt.
sudo cp -av nvram.txt /lib/firmware/brcm/brcmfmac4334-sdio.amlogic,p212.txt
'nvram.txt' -> '/lib/firmware/brcm/brcmfmac4334-sdio.amlogic,p212.txt'

 

5- Then I rebooted. After the reboot, bluetooth working but wifi not.
In the kernel output:
brcmfmac mmc2: 0001: 1: Direct firmware load for brcm/brcmfmac4334-sdio.amlogic,p212.txt failed with error -2
brcmfmac mmc2: 0001: 1: Direct firmware load for brcm/brcmfmac4334-sdio.txt failed with error -2

 

6- Inside the Android /wifi folder is the nvram.txt file. I copied this file to /lib/firmware/brcm/ renaming it to brcmfmac4334-sdio.amlogic,p212.txt.
sudo cp -av nvram.txt /lib/firmware/brcm/brcmfmac4334-sdio.amlogic,p212.txt
'nvram.txt' -> '/lib/firmware/brcm/brcmfmac4334-sdio.amlogic,p212.txt'

 

7- Então reiniciei mais uma vez. Após o reboot, wifi funcionando mas somente 2.4 Ghz. 5 Ghz ainda não. Na saída do kernel tem:
brcmfmac: brcmf_c_process_clm_blob: no clm_blob available (err=-2), device may have limited channels available
I looked over this file, but for the 4334 driver it doesn't exist.

 

There are other files in the /wifi folder, but I still don't know how important they are. I leave the link for her below and I wait if anyone has a suggestion to give from now on:
https://bit.ly/3hgFrfx

Link to comment
Share on other sites

1 hour ago, usual user said:

OK, this confirms at least the wifi devicetree configuration is not proper.
I'm not even convinced that a real BCM4330 chip is installed on your board, possibly a compatible AP6330. But this can only be confirmed by optical inspection.

I have extracted this from one of your posted log. If you are not using a Kadas board this is also evidence for improper devicetree configuration for your board. It asked for brcmfmac4330-sdio.khadas,vim.txt as calibration parameters in the first attempt, but should have asked for one for your specific board. The kernel has a framework to manage various calibration parameter files (*.txt) in parallel. It is derived from the devicetree.

Through your previous efforts you know that the kernel supports your wifi chip, so "only" a correct devivetree configuration for your board is missing.
The right solution for everyone without regressions for others is to create a proper device tree configuration for your board and not replace fallback firmware. With this the required firmware and the calibration parameters can stay alongside with the already existing ones and other users can keep using what already worked for them.

Yes. You are absolutely correct. My device tree is shown below. the dtb file can be transformed into dts and edited and recompiled, but unfortunately I don't know how to do this, I would love to learn. This would be the correct way to do it. Because my dtb file is wrong and we changed the firmware because of this. Do you have any idea how to do this...........

my file .dtb used

 

dtb_name=/dtb/meson-gxl-s905x-khadas-vim.dtb

 

 

 

I will convert it to dts and pass the file to try to fix and make a new dtb in the correct way to help other users. I will send the text of the file to analyze together and ask for help from the forum staff.

Link to comment
Share on other sites

 

Yes, I'm Brazilian from Curitiba. I was surprised to see someone from Brazil here ... How did you access the data on Android. I try to mount the partitions and it is not possible. And installing shell as root on my boxs905's Android, I don't have access to the kernel folders or firmware. I thought about using the dd command and creating an image and mounting with mount -o loop android.img / mnt. Can you describe how you did it ...... I'm interested and get the Android firmware, just like you did......

 

root@fenix:/home/fenix# cd /
root@fenix:/# mount /dev/mmcblk1 /mnt/
NTFS signature is missing.
Failed to mount '/dev/mmcblk1': Argumento inválido
The device '/dev/mmcblk1' doesn't seem to have a valid NTFS.
Maybe the wrong device is used? Or the whole disk instead of a
partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?
root@fenix:/# gparted
======================
libparted : 3.2
======================
/dev/mmcblk1: unrecognised disk label
 

Link to comment
Share on other sites

Hi Balbes, Always thanks for the build, it is reassuring of your dedication to the LE after several years of continuous supports

I wonder if you can assist with how to upgrade to the new build since it has been a long time since I upgrade and a lot have changed as was reading your threads in this forum, LE and FreakTab.

My Box is Tronsmart 905s Meta

LE build is one of  yours 

 

CPU AArch64 Processor rev 4 (aarch64)

Build: Kodi 17.6 Git:a9a&a20

Compiled: Jan 24 2018

 

Appreciate if you provide a simple guide to follow to

 

Thanks again.

Link to comment
Share on other sites

Good day. I have got same trouble - wifi and bt does not work. I copy wifi and BT folders from android. Armbian  searchin for brcm4330/4 driver but in android drivers folder there is no any 4330... Help me please - how I can know what firmware loaded in android. I can boot to android and to armbian, device is H96 Max2 (s905x2) 2G/16G. Thanks

Edited by Rail Kuramshin
orf error
Link to comment
Share on other sites

14 hours ago, julian67 said:

Fine, but if you depart so radically from the usual way of offering linux-image and linux-headers then simply *document* it in the very first post where it can be easily found.  It is a BIG change from normal debian and from normal armbian too.

Two of the best things about Debian are its predictable packaging and well structured bug reporting.  When both are absent it's odd to blame the users for not finding the exact thing they look for and then scolding them for asking perfectly well phrased factual questions. Anyway it's up to you how you offer your work but I somehow doubt I'll be the last person who didn't find an answer by searching 30+ pages of often oddly formatted and spelled forum posts.

Thanks again.

 

14 hours ago, julian67 said:

Additionally the resources you link to on page one, Yandex and Mega, have different contents!

Most people outside the Russia centric world don't use Yandex but might use Mega, yet all this stuff I'm supposed to automatically find is *not* in the Mega directories.  There is zero indication that they might be different on page 1!

1. I don't owe anything.

2. if you Want to get detailed documentation and dedicated resources for posting materials for download, pay 5000 to donate Armbian.

3. I have a very negative attitude to those who use someone else's development for free (in which a lot of work\money\time of different people is invested), absolutely do not help this project in any way and at the same time make claims.

Link to comment
Share on other sites

8 hours ago, e123enitan said:

I wonder if you can assist with how to upgrade to the new build since it has been a long time since I upgrade and a lot have changed as was reading your threads in this forum, LE and FreakTab.

My Box is Tronsmart 905s Meta

LE build is one of  yours 

I do not understand the question, please clarify what the problem is. There are several ways to upgrade to new versions of LE.

Link to comment
Share on other sites

A devicetree is basically a standardized representation of the schematic of a board design. It provides parameters about the components used that drivers need to operate, or tell the kernel which driver to use in the first place. You can only recycle a DT if your device is a exact clone of an original device. Otherwise non matching components won't function properly.

16 hours ago, gilberto said:

My device tree is shown below. the dtb file can be transformed into dts and edited and recompiled, but unfortunately I don't know how to do this, I would love to learn.

This is not the right way to proceed. This is as if you are using a disassembly of a binary program to rewrite the entire program. When compiling the original sources, information has been lost that cannot be reproduced during disassembly.

The proper way is:
You are the board designer with access to the reference documentation of all used components.
You learn the syntax of DTS files.
You write a board specific DTS with mainline binding documentation as reference.

If your board design is based on e.g. a reference design from an SOC provider, you may be able to use his DTS as a template where you have only to adopt your modifications.
When this is done, contribute it to mainline and it will work for all your customers out of the box. Of course, the kernel build must have enabled all required drivers.
                             
But I guess you are not in this situation ;) So you have to do reverse engineering:
Collect as many board details as possible.
Learn the syntax of DTS files.
Write a board specific DTS with mainline binding documentation as reference.
You can use the original sources of meson-gxl-s905x-khadas-vim.dtb as a template and customize the differences (board model, compatible, Wi-Fi bindings, ...).
Android DTs can only be used for hints, the bindings used are most likely proprietary and do not match those of the mainline kernel. Copying them over will not magically insert code into the kernel drivers to make use them.
When this is done, contribute it to mainline and it will work for all. Armbian will probably pull it for early adoption if you provide a PR, as bringing it to mainline may take some time.

Link to comment
Share on other sites

Still can't get Tanix TX6 to boot from SD.

SD+USB boots USB fine, so it seems that u-boot works.

 

UPD: On kernel 5.7.2 integrated wlan started working, that's a win.

No hdmi sound, though:  `ALSA device list: No soundcards found.` in dmesg. However, `aplay -l` gives `card 0: allwinnerhdmi ...`

Is it my TV or is it not supposed to work yet?

Link to comment
Share on other sites

I posted the file with translation problems, so here is the correct translation:

The problem is almost completely solved. I analyzed and searched the forum for some posts from dbshape, balbes150 and gilberto (are you also a Brazilian?)
The steps were as follows:

 

1- I mounted the Android image and in the /etc folder I copied the /wifi and /bluetooth folders;

 

2- I checked in the kernel output that Armbian was looking for the files brcm/brcmfmac4334-sdio and brcm/BCM4334B0.hcd.

 

3- Inside the /wifi folder there is the file fw_bcm4334b1_ag.bin. I copied it to the /lib/firmware/brcm/folder, renaming it brcmfmac4334-sdio.bin. This file is also present in the Armbian itself in /lib/firmware/rkwifi/, but I preferred to use the original Android.
sudo cp -av fw_bcm4334b1_ag.bin /lib/firmware/brcm/brcmfmac4334-sdio.bin
'fw_bcm4334b1_ag.bin' -> '/lib/firmware/brcm/brcmfmac4334-sdio.bin'

 

4- Inside the /bluetooth folder there is the file bcm4334.hcd. I copied it to the /lib/firmware/brcm/ folder, renaming it BCM4334B0.hcd.
sudo cp -av bcm4334.hcd /lib/firmware/brcm/BCM4334B0.hcd
'bcm4334.hcd' -> '/lib/firmware/brcm/BCM4334B0.hcd'

 

5- Then I rebooted. After the reboot, bluetooth working but wifi not.
In the kernel output:
brcmfmac mmc2: 0001: 1: Direct firmware load for brcm/brcmfmac4334-sdio.amlogic,p212.txt failed with error -2
brcmfmac mmc2: 0001: 1: Direct firmware load for brcm/brcmfmac4334-sdio.txt failed with error -2

 

6- Inside the Android /wifi folder is the nvram.txt file. I copied this file to /lib/firmware/brcm/ renaming it to brcmfmac4334-sdio.amlogic,p212.txt.
sudo cp -av nvram.txt /lib/firmware/brcm/brcmfmac4334-sdio.amlogic,p212.txt
'nvram.txt' -> '/lib/firmware/brcm/brcmfmac4334-sdio.amlogic,p212.txt'

 

7- Then I restarted again. After reboot, wifi working but only 2.4 Ghz. 5 Ghz not yet.
In the kernel output it has:
brcmfmac: brcmf_c_process_clm_blob: no clm_blob available (err=-2), device may have limited channels available

I looked over this file, but for the 4334 driver it doesn't exist.

 

There are other files in the /wifi folder, but I still don't know how important they are. I leave the link for her below and I wait if anyone has a suggestion to give from now on:
https://bit.ly/3hgFrfx

 

--------------------------------------------------

I read some posts from @usual user and @dbsharpe and researched other things, so here are the results:

 

@gilberto, I created my own Android builds, for my board using linux-amlogic-toolkit-master. It has a Windows version, but it had a bug when I tried to use it. With this tool, I mount the Android image and edit it easily.

 

To edit the .dtb files I installed dtc with the command:
sudo apt install device-tree-compiler

 

To convert .dtb to .dts:
dtc -I dtb -O dts -f meson-gxl-s905x-p212.dtb -o meson-gxl-s905x-p212.dts

 

But I was confused because I only found this reference to wifi in the Armbian dts file:

wifi32k {
        compatible = "pwm-clock";
        #clock-cells = <0x0>;
        clock-frequency = <0x8000>;
        pwms = <0x38 0x0 0x7736 0x0>;
        phandle = <0x13>;

 

On Android I managed to extract the .dtb files from the system image. I used the linux-amlogic-toolkit-master tool to extract the _aml_dtb.PARTITION file. I renamed the file to dtb.img and used the tool https://github.com/PabloCastellano/extract-dtb to extract the .dtb files. I extracted two files: 01_dtbdump_Amlogic.dtb and 02_dtbdump_Amlogic.dtb. Then I converted the two files to dts using dtc. Now I have two .dts that are huge. The first file is for the version with 1 GB of RAM and the second is for the version of 2 GB, mine. I also extracted the file directly from Android running, using the command dd if = /dev/dtb > /storage/downloads/droid.dtb and after converting to dts I realized that the files are identical. When I have time I will analyze that file because has more than 2000 lines of code. I tried to use the dtb file extracted directly from Android on Armbian, but of course, it didn't work.

 

I leave attached the two dts files, from Android and Armbian:

02_dtbdump_Amlogic-dts.txt

meson-gxl-s905x-p212-dts.txt

 

Thanks to @balbes150: Armbian's usability is better than Android for my uses. I will install Home Assistant in my box and use it as a server or use it in my classes. Thankful.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines