ophub / amlogic-s9xxx-openwrt

Support for OpenWrt in Amlogic, Rockchip and Allwinner boxes. Support a311d, s922x, s905x3, s905x2, s912, s905d, s905x, s905w, s905, s905l, rk3588, rk3568, rk3399, rk3328, h6, etc.
GNU General Public License v2.0
1.71k stars 1.51k forks source link

A95X Wireless Support #260

Closed kodokskoprol closed 2 years ago

kodokskoprol commented 2 years ago

I have device branded as A95X, it has the same form factor and specification as Nexbox A1 How to enable wireless function?

the wireless module is Fn-Link 8223A-SR C07001 1727

Nexbox A1 https://www.gearbest.com/tv-box-mini-pc/pp_424843.html

A95X https://tokopedia.link/zQVlmUfgqqb IMG_20220529_153502 IMG_20220529_153715

ophub commented 2 years ago

I consulted flippy, this is the qca9377 chip, it is recommended to try the ath10k driver. I newly added this driver today, you download today's firmware and try

kodokskoprol commented 2 years ago

tried all s912 lastest firmware, wireless still not showing

bro

ophub commented 2 years ago

meson-gxm-a95x.dtb.zip

Download and decompress the meson-gxm-a95x.dtb file and upload it to the /boot/dtb/amlogic directory. Modify the name of the dtb file in /boot/uEnv.txt to meson-gxm-a95x.dtb, restart after the modification, try whether the wireless can be used, and report the result.

kodokskoprol commented 2 years ago

lastest firmware & a95x dtb unfortunately still not working ophub

ophub commented 2 years ago

image

image

image

GPIOX_17 corresponds to a pin on the cpu and needs to be measured with a multimeter, or you can find the official design schematic of this motherboard

meson-gxm-a95x.dts.zip

This is the source file of the dtb added for your device.

&uart_A {
        status = "okay";
        pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
        pinctrl-names = "default";
        uart-has-rtscts;

        bluetooth {
                compatible = "qcom,qca9377-bt";
                shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>;
                max-speed = <2000000>;
                clocks = <&wifi32k>;
                clock-names = "lpo";
        };
};

The value of GPIOX_17 needs to determine what your pin is.

ophub commented 2 years ago

Is the wired network available? Is the network port of this device Gigabit or 100m?

kodokskoprol commented 2 years ago

the wired ethernet is gigabitand working

kodokskoprol commented 2 years ago

i have multitester, but i didn't know how to measure the GPIO

ophub commented 2 years ago

Which u-boot file are you using in the firmware?

See system > TTYD Terminal (The username is root, and the password is the login password of your router.):

cat /etc/flippy-openwrt-release

Is it u-boot-zyxq.bin ?

Need to remove the cpu, it is more troublesome, stop measuring, use the wired network.

I also added this device to the known list, found the relevant instructions on the wireless network, and found it and added it. Modify the value of that parameter.

kodokskoprol commented 2 years ago

Flippy kernel does not have u-boot.ext.

Ophub kernel using u-boot.ext. file that work with this kernel is u-boot-p201.bin u-boot-p212.bin u-boot-s905.bin i have to manually rename those file into u-boot.ext , because u-boot.ext that came with firmware didn't work

but both kernel showing same result in the terminal ophub k flippy

ophub commented 2 years ago

u-boot-p212.bin This can be used normally under the 5.10 and 5.15 kernels? Then make sure it is this.

You try u-boot-s905x-s912.bin this can be used normally?

https://github.com/ophub/amlogic-s9xxx-openwrt/blob/50dead3c58edbe97022f4fcac8271a32035ffd47/amlogic-s9xxx/common-files/rootfs/etc/model_database.txt#L21

I added his configuration to the installation list, and the configuration file you tested will be used when writing emmc in the future

kodokskoprol commented 2 years ago

i already test all of the u-boot file available, only these three can succesfully boot into openwrt luci u-boot-p201.bin u-boot-p212.bin u-boot-s905.bin

im using u-boot-p212.bin on my daily firmware running without problem works both kernel.

for u-boot-s905x-s912.bin failed boot into openwrt luci, sorry i can't show u the log i don't have monitors available.

ophub commented 2 years ago

https://github.com/unifreq/linux-5.10.y/blob/efde4bfba2724ae4c2e2afdbb53813f45f4c8829/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-sml5442tw.dts#L74

I found one in the dtb directory that uses the same chip as your qca9377, and its pin is also GPIOX_17. This value is also the setting in the file I sent you before.

Where can I find the correct value for this.

ophub commented 2 years ago

meson-gxm-a95x-a.dtb.zip meson-gxm-a95x-b.dtb.zip

Can you try these 2 dtbs to use wireless again? Upload to the /boot/dtb/amlogic directory Then vi /boot/uEnv.txt modify the dtb name inside

kodokskoprol commented 2 years ago

tested dtb unfortunately the wireless still not working

danboid commented 2 years ago

Those dtbs don't boot at all on my X96 Air Q1000 and my X96 Max+ 64 GB, which wasn't surprising as these are sm1 not gxm chipsets.

danboid commented 2 years ago

Today I have been testing Manjaro ARM on my X96 Max+ 64 GB with the same wifi chip.

If I use the meson-sm1-sei610.dtb with the default khadas (5.17) kernel use by Manjaro for the AM6, my wifi doesn't work but it does work if I install the the linux-aml (5.13) kernel and use its meson-sm1-sei610.dtb instead. It would seem that dtb is added to the kernel as a patch.

https://gitlab.manjaro.org/manjaro-arm/packages/core/linux-aml

danboid commented 2 years ago

My guide to installing Manjaro on AMLogic TV boxes, if anyone needs it, is here:

https://wiki.manjaro.org/index.php/Amlogic_TV_boxes

danboid commented 2 years ago

The latest Manjaro linux-aml kernel package is at 5.13. Wifi works with 5.13 but it has HDMI issues. I would recommend any X96 users using Manjaro use my 5.12 kernel packages instead because they have working HDMI

https://github.com/danboid/meson-sm1-sei610-qca9377-bt/releases/tag/kernel

danboid commented 2 years ago

@ophub

I'm sorry, I gave you the old manjaro ARM amlogic kernel repo address earlier. The current one is:

https://gitlab.manjaro.org/manjaro-arm/packages/core/linux-odroid

I have tested Manjaros 5.17 odroid kernel on my X96 Max+ 64 GB and my X96 Air with their meson-g12a-x96-max.dtb and both the onboard wifi and gigabit ethernet works on both dtbs.

ophub commented 2 years ago

@danboid What is the name of your device? soc? NIC chip?

I don't understand, is this a patch?

https://gitlab.manjaro.org/manjaro-arm/packages/core/linux-odroid/-/blob/master/s912-dmip-mhz.patch

danboid commented 2 years ago
X96 Max Plus with 4 GB RAM, 64 GB eMMC, Cdtech 4761743 wifi with BT

X96 Air with 4 GB RAM, 32 GB eMMC, Cdtech 4761743 wifi with BT
ophub commented 2 years ago

Are you s905x2 soc?

In the address you sent, no modification was found for meson-g12a-x96-max.dtb or related include files. Do you know which patch he used?

danboid commented 2 years ago

s905x3.

What about the kernel network config options? Are they identical? Do both kernels include the same firmware for Qualcomm wifi?

I'll try and have a look later but I'm busy most of the day today.

I updated the Manjaro ARM TV box wiki page yesterday page to mention the the linux-odroid kernel instead of linux-aml.

danboid commented 2 years ago

@ophub

If you send me your address I'll send you my spare X96 Air Q1000. I'd like to see s9xxx Armbian have working wifi and bluetooth for these boxes.

You do such an amazing job supporting this project. Thanks!

ophub commented 2 years ago

This is the default setting for the mainline kernel:

https://github.com/unifreq/linux-5.15.y/blob/main/arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts

Know which value to change, create a new dtb like this. Just modify those few lines:

https://github.com/unifreq/linux-5.15.y/blob/main/arch/arm64/boot/dts/amlogic/meson-g12a-x96-max-rmii.dts

I can't find it in the URL you posted today. You can look for it. Or decompile the dtb you can use, and compare it with the mainline to see what has been adjusted.