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

Working dtb for X96 Max Plus Q2 and X96 Air Q1000 #366

Closed
danboid opened this issue Jun 5, 2022 · 44 comments
Closed

Working dtb for X96 Max Plus Q2 and X96 Air Q1000 #366

danboid opened this issue Jun 5, 2022 · 44 comments
Labels
documentation Improvements or additions to documentation new box Research Fills in the Blanks support This need is supported

Comments

@danboid
Copy link
Contributor

danboid commented Jun 5, 2022

Using the attached .dtb file I get working ethernet, wifi and bluetooth on both my X96 Max Plus Q2 and my X96 Air Q1000, which both use the Qualcomm qca9377 wifi chipset or a clone of it. I extracted this dtb from the Manjaro linux-odroid kernel then tweaked it to get bluetooth working.

meson-g12a-x96-max-plus-q2.dtb.zip

@danboid
Copy link
Contributor Author

danboid commented Jun 5, 2022

meson-g12a-x96-max-rmii.dtb gives me working wifi but no ethernet on these boxes whilst the meson-g12a-x96-max.dtb in Armbian doesn't boot at all on the X96 Max Plus Q2 / X96 Air Q1000.

It seems the X96 Air Q1000 is pretty much the same as a X96 Max Plus Q2 but with an extra USB 2.0 port.

@danboid
Copy link
Contributor Author

danboid commented Jun 5, 2022

What's interesting is that after I got bluetooth working with this dtb under Armbian, I tried the same dtb under Manjaro but X96 onboard bluetooth isn't working under Manjaro.

@danboid
Copy link
Contributor Author

danboid commented Jun 5, 2022

I've also uploaded this dtb to https://github.com/danboid/meson-sm1-sei610-qca9377-bt

@ophub
Copy link
Owner

ophub commented Jun 6, 2022

thank you for your sharing.

This dts file, can you find out the difference between it and the current meson-g12a-x96-max-plus.dts? This creates a separate dtb alone.
This decompilation is not conducive to maintenance, and cannot take into account the continuous upgrade of the kernel. The source code for this dtb should be in the Manjaro source/patch.

@ophub ophub added documentation Improvements or additions to documentation support This need is supported labels Jun 6, 2022
@danboid
Copy link
Contributor Author

danboid commented Jun 6, 2022

Here is the original meson-g12a-x96-max.dtb from the Manjaro linux-odroid kernel. This doesn't have working bluetooth,

The meson-g12a-x96-max.dtb included with Armbian doesn't boot at all on my X96 boxes. Also
worth noting is that linux-odroid doesn't include a meson-sm1-x96-max-plus.dtb which was the Armbian dtb that worked the best with these two TVBs.

I realise X96 Max is a different model and supposedly uses a different SoC to X96 Max Plus but the meson-g12a-x96-max.dtb from Manjaro is the dtb that currently works the best for these boxes.

meson-g12a-x96-max.dtb.zip

@danboid
Copy link
Contributor Author

danboid commented Jun 6, 2022

I have done a diff between meson-g12a-x96-max.dts from Manjaro and the meson-g12a-x96-max.dts from Armbian and they don't have much in common

X96-Max-dts-files.zip

@danboid
Copy link
Contributor Author

danboid commented Jun 6, 2022

Interesting!

I re-installed Armbian using the latest image ( Armbian_22.08.0_Aml_s905x3_jammy_5.10.120_server_2022.06.06.img ) and now wifi is working on my X96 boxes when using meson-sm1-x96-max-plus.dtb! This wasn't the case a few days ago so something has changed.

However, I've not been able to get bluetooth working by modifying meson-sm1-x96-max-plus.dtb yet.

@ophub
Copy link
Owner

ophub commented Jun 6, 2022

But the kernel configuration has not changed at all

18f2e30

@danboid
Copy link
Contributor Author

danboid commented Jun 6, 2022

@danboid
Copy link
Contributor Author

danboid commented Jun 6, 2022

Are we not going to be able to include my custom dtb in Armbian then?

@danboid
Copy link
Contributor Author

danboid commented Jun 6, 2022

It seems meson-g12a-x96-max-plus-q2.dtb only fully works with your 5.15 kernels. Wifi and BT work on my X96 TVBs when I use it under 5.10.120 but ethernet does not. I have to use meson-g12a-x96-max-plus-q2.dtb with the Armbian 5.15 series kernels to get working ethernet, wifi and bluetooth.

@danboid
Copy link
Contributor Author

danboid commented Jun 6, 2022

I have updated the README of https://github.com/danboid/meson-sm1-sei610-qca9377-bt to include the kernel compatibility notes.

@danboid
Copy link
Contributor Author

danboid commented Jun 6, 2022

It seems meson-g12a-x96-max-plus-q2.dtb only fully works with your 5.15 kernels. Wifi and BT work on my X96 TVBs when I use it under 5.10.120 but ethernet does not. I have to use meson-g12a-x96-max-plus-q2.dtb with the Armbian 5.15 series kernels to get working ethernet, wifi and bluetooth.

@ophub
Copy link
Owner

ophub commented Jun 7, 2022

This dtb file is the result of kernel compilation. Different versions of the kernel are different, so some cannot be used universally. This dtb file can be used in the /boot/dtb/amlogic directory, but
This source code is decompiled code and cannot be well compatible with related patches and upgrades in the kernel. Need to find the difference between this and the existing file and add a compatibility source file.

@ophub
Copy link
Owner

ophub commented Jun 7, 2022

meson-g12a-x96-max-plus-qca9377.dtb.zip

Unzip it, add it to the /boot/dtb/amlogic directory, modify the name of the dtb in /boot/uEnv.txt to meson-g12a-x96-max-plus-qca9377.dtb and restart the test.

@tsgiannis
Copy link

Side question...I am pretty sure I have the Q2 variant of X96 Max Plus...curious...did you managed to have it working via MicroSD or USB 3.0...because from all my tests with various distros they all failed with microSD...while USB 3.0 at least for CoreElec it worked.

@danboid
Copy link
Contributor Author

danboid commented Jun 7, 2022

@ophub

meson-g12a-x96-max-plus-qca9377.dtb doesn't boot using 5.15.45. Its worth noting that the normal meson-g12a-x96-max.dtb included with flippy 5.15.x also doesn't boot on the X96 Air Q1000 or X96 Air Q2 but the meson-g12a-x96-max.dtb from linux-odroid does. I used that one as the base because it was the easiest one to get BT working with. Well, its the only one I've fluked a working config with.

tsgiannis:

Have you tried my custom dtb ( meson-g12a-x96-max-plus-q2.dtb ) with a 5.15.x kernel? Note that 4K/UHD HDMI output is broken for the Max Plus Q2 with the current 5.15 kernels. You can use my dtb with a 5.10 kernel if you are using a 4K monitor but the ethernet doesn't work with 5.10.x and that dtb.

@danboid
Copy link
Contributor Author

danboid commented Jun 7, 2022

tsgiannis:

I have had Manjaro Linux booting off USB 3.0 on my X96 Air Q1000 so you should also be able to do that with Armbian on the X96 Max Plus Q2 although I've not tested that.

@tsgiannis
Copy link

I will try it 1st chance I get...right now I have the system running happily CoreElec but I am planning to buy one more TV Box

@tsgiannis
Copy link

So its USB 3.0...this was my main question...if I was the only one who could boot only from USB 3.0...thanks

@danboid
Copy link
Contributor Author

danboid commented Jun 7, 2022

I've been testing Armbian using microSD cards.

@danboid
Copy link
Contributor Author

danboid commented Jun 7, 2022

@ophub

I haven't found a dtb with both working ethernet and wifi for these X96's out of the ones included with it. I am able to boot and use wifi with meson-sm1-sei610.dtb and meson-g12a-sei510.dtb but the ethernet doesn't work with both when using a 5.15 kernel.

@ophub
Copy link
Owner

ophub commented Jun 7, 2022

Can the wifi of meson-sm1-sei610.dtb be used? it is: https://github.com/unifreq/linux-5.15.y/blob/131c58e5e1ce69345cd844d1c2f6d18f1568e9d8/arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts#L591

Which of the default dtb in the kernel package can use wired network?

@danboid
Copy link
Contributor Author

danboid commented Jun 7, 2022

I have now tested all of the meson-sm1 dtbs that come with 5.15.45 on my X96 Air Q1000 and the following all boot and have working ethernet and wifi:

meson-sm1-a95xf3-air-gbit.dtb
meson-sm1-h96-max.dtb
meson-sm1-ugoos-x3.dtb
meson-sm1-x96-air-gbit.dtb

Its very likely the X96 Max+ Q2 will have the same compatibility.

Non of them currently have working onboard bluetooth but I'm going to see if I can add that to one of them.

@danboid
Copy link
Contributor Author

danboid commented Jun 7, 2022

Done it!

meson-sm1-h96-max-qca9377-bt.dtb.zip

This dtb gives me working bluetooth, ethernet and wifi on a X96 Air Q1000 with 5.15.45-flippy and its based off the meson-sm1-h96-max.dtb included with the current 5.15 kernel.

Instead of calling it meson-sm1-h96-max-qca9377-bt.dtb we might want to call it meson-sm1-x96-air-q1000.dtb or meson-sm1-x96-max-plus-q2.dtb?

@ophub
Copy link
Owner

ophub commented Jun 7, 2022

Did you rename meson-sm1-h96-max.dtb to meson-sm1-x96-air-q1000.dtb? Did you modify the source code?

@danboid
Copy link
Contributor Author

danboid commented Jun 7, 2022 via email

@danboid
Copy link
Contributor Author

danboid commented Jun 7, 2022

$ diff -u meson-sm1-h96-max.dts meson-sm1-h96-max-qca9377-bt.dts
--- meson-sm1-h96-max.dts	2022-06-07 21:25:42.738173128 +0100
+++ meson-sm1-h96-max-qca9377-bt.dts	2022-06-07 21:28:43.254229509 +0100
@@ -2894,8 +2894,8 @@
 				phandle = <0x121>;
 
 				bluetooth {
-					compatible = "brcm,bcm43438-bt";
-					shutdown-gpios = <0x1d 0x52 0x00>;
+					compatible = "qcom,qca9377-bt";
+					enable-gpios = <0x1d 0x52 0x00>;
 					max-speed = <0x1e8480>;
 					clocks = <0x31>;
 					clock-names = "lpo";

@ophub
Copy link
Owner

ophub commented Jun 7, 2022

Your change was tested on both X96 Air Q1000 and X96 Max+ Q2 Can it work with wired, wireless, bluetooth?
Are these two devices gigabit wired network cards?

@ophub
Copy link
Owner

ophub commented Jun 7, 2022

https://github.com/unifreq/linux-5.15.y/blob/main/arch/arm64/boot/dts/amlogic/meson-sm1-h96-max.dts#L139-L140

This is the standard source code, use this modification. Explain which lines have been changed. After modifying this file, send me the dts file. I will compile it in the kernel and you will test it again.

@danboid
Copy link
Contributor Author

danboid commented Jun 7, 2022

Yes x3! It enables all 3 features w/ gigabit ethernet for both models.

@danboid
Copy link
Contributor Author

danboid commented Jun 7, 2022

@ophub
Copy link
Owner

ophub commented Jun 7, 2022

Wait 5 minutes, I will compile it in the kernel according to your modification, you can test it again

@ophub
Copy link
Owner

ophub commented Jun 7, 2022

meson-sm1-x96-max-plus-q2.dtb.zip

This is the dtb running in the 5.15 kernel, you can test whether it is normal under both devices

Unzip it into a dtb file, put it in the /boot/dtb/amlogic directory, and modify the dtb file name in /boot/uEnv.txt. Restart the test after modification.

@danboid
Copy link
Contributor Author

danboid commented Jun 7, 2022

I have tested your meson-sm1-x96-max-plus-q2.dtb and it works fine - wifi, gbit ethernet and BT all work.

@ophub
Copy link
Owner

ophub commented Jun 7, 2022

Ok, I submitted it to unifreq today in several kernel repositories, which will be automatically included when the kernel is compiled in the future.
thank you very much for sharing

@danboid
Copy link
Contributor Author

danboid commented Jun 7, 2022

Thanks @ophub !

@ophub
Copy link
Owner

ophub commented Jun 8, 2022

1920aa6

unifreq/linux-5.15.y@5ed890a

Your results have been added to the kernel source repository, thank you for sharing

504:X96 Max+ Q2:s905x3:meson-sm1-x96-max-plus-q2.dtb:u-boot-x96maxplus.bin:/usr/lib/u-boot/x96maxplus-u-boot.bin.sd.bin:/usr/lib/u-boot/hk1box-bootloader.img

517:X96 Air Q1000:s905x3:meson-sm1-x96-max-plus-q2.dtb:u-boot-x96maxplus.bin:/usr/lib/u-boot/x96maxplus-u-boot.bin.sd.bin:NA

@hillz2
Copy link

hillz2 commented Jan 8, 2023

Done it!

meson-sm1-h96-max-qca9377-bt.dtb.zip

This dtb gives me working bluetooth, ethernet and wifi on a X96 Air Q1000 with 5.15.45-flippy and its based off the meson-sm1-h96-max.dtb included with the current 5.15 kernel.

Instead of calling it meson-sm1-h96-max-qca9377-bt.dtb we might want to call it meson-sm1-x96-air-q1000.dtb or meson-sm1-x96-max-plus-q2.dtb?

I'll try this, sorry for bumping up an old thread, @danboid can I use meson-sm1-h96-max-qca9377-bt.dtb.zip for OpenWrt instead of armbian ? and do I have to use kernel 5.15.45-flippy to get it to work ? I have X96 Air with ophub openwrt and ethernet not working right now.

@yaleh
Copy link

yaleh commented Jan 19, 2023

I have tested your meson-sm1-x96-max-plus-q2.dtb and it works fine - wifi, gbit ethernet and BT all work.

Are the dd operations mentioned in https://www.5288z.com/2989.html still necessary?

dd if=/tmp/hk1box-bootloader.img of=/dev/mmcblk2 bs=1 count=442
dd if=/tmp/hk1box-bootloader.img of=/dev/mmcblk2 bs=512 skip=1 seek=1
sync
reboot

@ophub ophub added the new box Research Fills in the Blanks label Aug 17, 2023
@citral23
Copy link

FYI, I received a scam X96 max+, sticker says 4G/64G but inside it's this model:

X96Max Plus 5
Memory 2/16, Amlogic W150S1 WiFi chip, one antenna, board without BT antenna track.

The X96 Air dtb works mostly fine apart from a minor graphical issue on boot that disappears once kernel properly kicks in, maybe related to panfrost ffe40000.gpu: dev_pm_opp_set_regulators: no regulator (mali) found: -19

Cf dmesg: https://pastebin.com/c2LZiRCR

As one can see, internal storage install went fine, and ETH works as well.

No wifi, but I don't think there's even a linux driver for the Amlogic W150S1 so this can't be solved I suppose.

Thanks for your work ophub

@myallten
Copy link

你好,这款X96 air 4+64的配置,WiFi是这个型号的,识别不出来
862fd4a3834ee1240ebc9c52ce660b4c

@myallten
Copy link

使用的是506安装 有线可以

@myallten
Copy link

506

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation new box Research Fills in the Blanks support This need is supported
Projects
None yet
Development

No branches or pull requests

7 participants