ophub / amlogic-s9xxx-armbian

Support for Armbian 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
6.28k stars 2.02k forks source link

Addition issue 850 and fix wifi #914

Closed HelferP closed 1 year ago

HelferP commented 1 year ago

In addition my issue https://github.com/ophub/amlogic-s9xxx-armbian/issues/850

I've been testing for several days on 5.15.86 with the changes made earlier and periodically getting the kernel panic again on reboot. I began to understand further and noticed that frequencies are registered in dtb, which are higher than those declared by the manufacturer. The maximum frequency declared by the manufacturer is -1.9 GHz. Therefore, I additionally turned off all the values ​​that are higher, and in two weeks I never had a kernel panic.


        opp-2016000000 {
            status = "disabled";
        };

        opp-2100000000 {
            status = "disabled";
        };

Now about Wi-Fi. I replaced the contents of /lib/firmware/brcm/brcmfmac 4339-sdio.amlogic,sm1.txt. I didn't get the max real speed, but it's still more than double what it was before. There may be errors here, but this works for me:

# 2017-03-16 update by broadcom jennifer
sromrev=11
boardrev=0x1400
boardtype=0x0697
boardflags=0x10401001
boardflags2=0x0
boardflags3=0x810c08c 
macaddr=00:90:4c:c5:12:38
ccode=XS
regrev=0
antswitch=0
pdgain5g=6
pdgain2g=1
tworangetssi2g=0
tworangetssi5g=0
femctrl=4
pcieingress_war=15
vendid=0x14e4
devid=0x43ae
manfid=0x2d0
#prodid=0x052e
nocrc=1
otpimagesize=502
xtalfreq=37400
extpagain2g=1
pdetrange2g=2
extpagain5g=1
pdetrange5g=2
rxgains2gelnagaina0=3
rxgains2gtrisoa0=7
rxgains2gtrelnabypa0=1
rxgains5gelnagaina0=3
rxgains5gtrisoa0=7
rxgains5gtrelnabypa0=1
rxchain=1
txchain=1
aa2g=1
aa5g=1
agbg0=0
aga0=0
tssipos5g=1
tssipos2g=1
pdoffset40ma0=0
pdoffset80ma0=0
pdoffsetcckma0=0
pdoffset40ma0=0x0000
pdoffset80ma0=0x0000
maxp2ga0=72

pa2ga0=0xFF37,0x164D,0xFD24
pa2gccka0=0xFF38,0x16CA,0xFD16
cckbw202gpo=0x4444
cckbw20ul2gpo=0x4444
dot11agofdmhrbw202gpo=0x8888
ofdmlrbw202gpo=0x6666
mcsbw202gpo=0x88888888

maxp5ga0=68,68,66,66

pa5ga0=0xFF6A,0x19C2,0xFCD8,0xFF50,0x16EF,0xFD2B,0xFF50,0x1734,0xFD16,0xFF59,0x17BF,0xFD0D
pa5gbw40a0=0xFF8F,0x1C5F,0xFC95,0xFF6F,0x198C,0xFCE1,0xFF7D,0x1B77,0xFC9C,0xFF64,0x18C4,0xFCE5
pa5gbw80a0=0xFF65,0x1921,0xFCE3,0xFF76,0x1A77,0xFCC5,0xFF70,0x197E,0xFCDB,0xFF58,0x1805,0xFCFA
mcslr5glpo=0
mcsbw205glpo=0x88866662
mcsbw405glpo=0xAAA88884
mcsbw805glpo=0xCCCAAAA6
mcslr5gmpo=0
mcsbw205gmpo=0x88866662
mcsbw405gmpo=0xAAA88884
mcsbw805gmpo=0xCCCAAAA6
mcslr5ghpo=0
mcsbw205ghpo=0x88866662
mcsbw405ghpo=0xAAA88884
mcsbw805ghpo=0xCCCAAAA6
sb20in40hrrpo=0x0
sb20in80and160hr5glpo=0x0
sb20in80and160hr5gmpo=0x0
sb20in80and160hr5ghpo=0x0
sb40and80hr5glpo=0x0
sb40and80hr5gmpo=0x0
sb40and80hr5ghpo=0x0
sb20in40lrpo=0x0
sb20in80and160lr5glpo=0x0
sb20in80and160lr5gmpo=0x0
sb20in80and160lr5ghpo=0x0
sb40and80lr5glpo=0x0
sb40and80lr5gmpo=0x0
sb40and80lr5ghpo=0x0
dot11agduphrpo=0x0
dot11agduplrpo=0x0
cckdigfilttype=2
phycal_tempdelta=25
rpcal2g=0x000F
rpcal5gb0=0x008F
rpcal5gb1=0x0000
rpcal5gb2=0x0000
rssicorrnorm_c0=-1,-1
rssicorrnorm5g_c0=0,1,2,-1,1,1,-2,0,0,-2,0,-1
tssifloor2g=245
tssifloor5g=220,213,218,228
txidxcap2g=0x10
txidxcap5g=0x10
paparambwver=1
muxenab=0x10

Tests

Original brcmfmac 4339-sdio.amlogic,sm1.txt:

iwDef iperfDef

Edited brcmfmac 4339-sdio.amlogic,sm1.txt:

iwFix iperfFix

ophub commented 1 year ago

Regarding the CPU frequency, add 1900 and other lists, otherwise after deleting these two, there will only be one 750. You check the list of settings of the original dtb of the Android factory, and submit it to the upstream kernel source code repo( https://github.com/unifreq/linux-5.15.y/blob/main/arch/arm64/boot/dts/amlogic/meson-sm1-h96-max-x3.dts ) after testing.

Firmware configuration changes can be submitted to https://github.com/ophub/firmware/tree/main/firmware/brcm

HelferP commented 1 year ago

after deleting these two, there will only be one 750 But there are other frequencies in the compiled dtb, this is meson-sm1-h96-max-x3.dtb converted to dts. They are pulling up from somewhere else.

изображение

livelier commented 1 year ago

@HelferP 建议你在测试无线连接吞吐能力的时候,核对一下 修改前和修改后他们连接的频段是否在相同的频段,截图上看 433.3应该是5G单天线模式。117.0疑似连接到了2.4G,如果是2.4G单天线最大连接速率150Mbps。 可以通过指定ap的mac地址锁定 2.4G 或 5G频段。双频无线路由或AP他们2.4G和5G的mac地址是不同的。

修改前与修改后,处于相同的频段,测试的结果更为准确。

image

HelferP commented 1 year ago

@HelferP 建议你在测试无线连接吞吐能力的时候,核对一下 修改前和修改后他们连接的频段是否在相同的频段,截图上看 433.3应该是5G单天线模式。117.0疑似连接到了2.4G,如果是2.4G单天线最大连接速率150Mbps。 可以通过指定ap的mac地址锁定 2.4G 或 5G频段。双频无线路由或AP他们2.4G和5G的mac地址是不同的。

My 2.4g and 5g access points have different ssids, so the box was definitely connected to 5G. I didn’t even connect to 2.4g, boxing doesn’t know its password.

livelier commented 1 year ago

非常好,这样很准确。 我正在参考你的 #850 尝试解决我遇到的 unaligned sg offset 3587, disabling descriptor DMA for transfer 还不知道他对无线传输有多少影响。

image

HelferP commented 1 year ago

非常好,这样很准确。 我正在参考你的 #850 尝试解决我遇到的 unaligned sg offset 3587, disabling descriptor DMA for transfer 还不知道他对无线传输有多少影响。

Do you have the same box? Can you tell me more about "disabling descriptor DMA for transfer"

livelier commented 1 year ago

与你的盒子不同品牌,但SoC相同,无线部分不同。

我有两款S905X3的盒子,无线分别是 ap6255(bcm43455) 2.4G/150M, 5G/433M mt7661rsn(mt7663s) 2.4G/300M, 5G/867M

有关 disabling descriptor DMA for transfer 正准备尝试获得更多的相关内容。 待有一些进展,在分享上来。

HelferP commented 1 year ago

settings of the original dtb of the Android factory I did the same as the original. It also does not have frequencies above 1.908 GHz. изображение

HelferP commented 1 year ago

You check the list of settings of the original dtb of the Android factory, and submit it to the upstream kernel source code repo( https://github.com/unifreq/linux-5.15.y/blob/main/arch/arm64/boot/dts/amlogic/meson-sm1-h96-max-x3.dts ) after testing.

Firmware configuration changes can be submitted to https://github.com/ophub/firmware/tree/main/firmware/brcm

I created a PR's for all.

ophub commented 1 year ago

The kernel repositories of the other two LTS are also updated, 5.4.y, 5.10.y and 6.1.y

https://github.com/unifreq/linux-5.4.y https://github.com/unifreq/linux-5.10.y https://github.com/unifreq/linux-6.1.y

HelferP commented 1 year ago

Yes and for it I creates PRs

5.4.y, 5.10.y and 6.1.y

ophub commented 1 year ago

Thanks for sharing. Relevant modifications have been merged