Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BananaPi BPI-M4-Zero: Fixup U-Boot and Linux DTS/DTSI and add WiFi / BT overlay #7332

Merged
merged 7 commits into from
Oct 5, 2024

Conversation

pyavitz
Copy link
Collaborator

@pyavitz pyavitz commented Oct 4, 2024

This adds SDIO WiFi / BT support VIA overlay for the REV2 variant of the board.
BT is currently disabled

To enable overlay: /boot/armbianEnv.txt

overlays=bananapi-m4-sdio-wifi-bt

Or use armbian-config

Current issues:
Bluetooth for reasons unknown will not come up on Armbian and because of the intensive "ridiculous?" size of the patch set, it will take me sometime to figure out the whys.

The WiFi module uses the same firmware as the Pi5 and depending on the distro release used, the reg domain can sometimes be difficult to set. If not set properly it will produce the following dmesg spam.

https://lore.kernel.org/all/[email protected]/T/

[   17.661570] brcmfmac: brcmf_set_channel: set chanspec 0x100c fail, reason -52
[   17.661853] brcmfmac: brcmf_set_channel: set chanspec 0x100d fail, reason -52
[   17.662142] brcmfmac: brcmf_set_channel: set chanspec 0x100e fail, reason -52
[   17.662429] brcmfmac: brcmf_set_channel: set chanspec 0xd022 fail, reason -52
[   17.769419] brcmfmac: brcmf_set_channel: set chanspec 0xd026 fail, reason -52
[   17.873510] brcmfmac: brcmf_set_channel: set chanspec 0xd02a fail, reason -52
[   17.977319] brcmfmac: brcmf_set_channel: set chanspec 0xd02e fail, reason -52
[   18.081399] brcmfmac: brcmf_set_channel: set chanspec 0xd034 fail, reason -52
[   18.081681] brcmfmac: brcmf_set_channel: set chanspec 0xd038 fail, reason -52
[   18.081970] brcmfmac: brcmf_set_channel: set chanspec 0xd03c fail, reason -52

To resolve this one can add the following to the /boot/armbianEnv.txt file.

Example:

extraargs=cfg80211.ieee80211_regdom=US

This for whatever reason doesn't appear to work when using Debian Bookworm.


When I find the time, I'll come back to the BT issue and try to isolate the problem. In my own builds there is no issue here, but I'm also not using 400+ patches. I use 10 patches and the latest STABLE kernel.

I didn't add this to armbian/firmware as it might not play nice
with other peoples units.

Signed-off-by: Patrick Yavitz <[email protected]>
sun50i-h618-bananapi-m4-sdio-wifi-bt.dtso

Signed-off-by: Patrick Yavitz <[email protected]>
Reasons unknown it will not load using Armbian. Until figured
out, disable it.

Signed-off-by: Patrick Yavitz <[email protected]>
Make it Armbian compatible

Signed-off-by: Patrick Yavitz <[email protected]>
@github-actions github-actions bot added size/large PR with 250 lines or more Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... BSP Board Support Packages labels Oct 4, 2024
@igorpecovnik
Copy link
Member

@The-going in case you have an idea which patch could cause this to not work.

@igorpecovnik igorpecovnik added Ready to merge Reviewed, tested and ready for merge 11 Milestone: Fourth quarter release labels Oct 5, 2024
@igorpecovnik igorpecovnik merged commit 7663069 into armbian:main Oct 5, 2024
6 checks passed
@The-going
Copy link
Contributor

In my own builds there is no issue here, but I'm also not using 400+ patches. I use 10 patches and the latest STABLE kernel.

I think the problem may be a patch conflict.
More precisely, people add fixes to DTS files and do not take into account other patches that go (apply) before or after.
For the 6.10 kernel, I came across the presence of many duplicate nodes in the final DTS of the device.
If earlier the compiler ignored subsequent nodes of the same name, then starting from 6.10 this is considered an error.
I had to delete the duplicates in order for the compilation to be completed successfully,
focusing on the style of the DTS code of the base kernel.

Even if this option works well, there is no guarantee that a fix will not be added to the "*.dtsi" file tomorrow and your final DTS will not be as expected.

@The-going
Copy link
Contributor

@The-going in case you have an idea which patch could cause this to not work.

Thank you. But I won't be able to check anyway.

@pyavitz
Copy link
Collaborator Author

pyavitz commented Oct 5, 2024

@The-going in case you have an idea which patch could cause this to not work.

It may not be the patches. After powering down the unit and letting it cool down and dropping a heat sink on it, the Bluetooth started coming up under Armbian. Be it still not consistently.

Problem is I made edits to the defconfig and removed a bunch of BT / HCI UART modules from it. I need to run some tests with the default defconfig now and see what happens.

@The-going
Copy link
Contributor

After powering down the unit and letting it cool down and dropping a heat sink on it, the Bluetooth started coming up under Armbian.

It's hard for me to advise.
I have not come across this for bluetooth chips.
But maybe it's worth checking the specification and the actual voltage on the chip?

@The-going
Copy link
Contributor

@pyavitz Patrick, a possible overheating option may be an inconsistent output and antenna impedance.

@pyavitz
Copy link
Collaborator Author

pyavitz commented Oct 5, 2024

After powering down the unit and letting it cool down and dropping a heat sink on it, the Bluetooth started coming up under Armbian.

It's hard for me to advise. I have not come across this for bluetooth chips. But maybe it's worth checking the specification and the actual voltage on the chip?

The voltage looks correctly set to me.

I checked to see how Raspberry Pi was handling the bluetooth bit of the module and I noticed they don't appear to add the following to the node.

vbat-supply = <&reg_dldo1>; // 3v3
vddio-supply = <&reg_aldo1>; // 1v8

But they also load bluetooth VIA script when using the kernel in their REPO.

I'll touch base again after some testing.

@pyavitz
Copy link
Collaborator Author

pyavitz commented Oct 7, 2024

So I did a partial re-write of the DTS as I was still seeing some random baud rate errors in my builds. This appears to be fixed now, but when I drop these changes into Armbian it still doesn't work.

It is almost as if something is preventing it from loading? or the timing is off and it fails to load?

One test I ran was purging the kernel debs and installing my own and in that test bluetooth loaded as it should. I'm kind of at a loss of ideas at this point.

I could do a PR with the new DTS and U-Boot, but it's not gonna change anything on the bluetooth front, so it feels a bit pointless to bother doing so.

@The-going
Copy link
Contributor

One test I ran was purging the kernel debs and installing my own and in that test bluetooth loaded as it should. I'm kind of at a loss of ideas at this point.

Let's try to check the patches.
What files in the drivers folder can affect the situation?
Do these files change in your version of the kernel?
Do these files change in the Armbian version?

So I did a partial re-write of the DTS as I was still seeing some random baud rate errors in my builds. This appears to be fixed now, but when I drop these changes into Armbian it still doesn't work.

Try to take the DTS from a working device.
The variant with your core and the variant with the Armbian core can be compared.

dtc --sort -I fs -O dts  /sys/firmware/devicetree/base > dts-out.txt

If you don't find anything at all, maybe I should try to compare these different patch sets?

@pyavitz
Copy link
Collaborator Author

pyavitz commented Oct 7, 2024

armbian-boot.txt
armbian-dts-out.txt
pyavitz-boot.txt
pyavitz-dts-out.txt

The patches I use; https://github.com/pyavitz/debian-image-builder/tree/feature/patches/allwinner/6.11
Pretty sure Armbian is using the same ones or a variant of them.

Nothing is really standing out to me. I've disabled patches in Armbian that I thought might be impeding, but nothing has come from it. I've tried adjusting the defconfig when it comes to bluetooth related modules but that has also not achieved anything on a consistent level.

@The-going
Copy link
Contributor

The-going commented Oct 8, 2024

@pyavitz Stupid question: Which version is your own kernel 6.11 or 6.11.2

There are some changes that may affect the situation.
I'm rebasing the patches to the new version.
Then we'll figure it out if the situation doesn't change.

@pyavitz
Copy link
Collaborator Author

pyavitz commented Oct 8, 2024

@pyavitz Stupid question: Which version is your own kernel 6.11 or 6.11.2

Currently; 6.11.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
11 Milestone: Fourth quarter release BSP Board Support Packages Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... Ready to merge Reviewed, tested and ready for merge size/large PR with 250 lines or more
Development

Successfully merging this pull request may close these issues.

3 participants