Adding OpenWrt support for Xiaomi AX3600 (Part 1)

It would be great

ok will try to create a quick and dirty buildroot with 5.13

4 Likes

I am working on ath11k and for whatever reason once ath11k is started wired networking works no more.
Like, it does not see linkup at all

some clocks are shared and ath11k disables some of them ?

Should not be as ath11k is basically just an interface to the remoteproc.
It has no clocks assigned, but if I disable WLAN then networking works.

Now that I think of it, I have hit something similar on IPQ6018.
There networking would also work fine without AP started, once AP is started and clients start associating bridge will not have a working route and remoteproc would crash.
On the other hand using a USB to ethernet works just fine on IPQ6018.

1 Like

Mhhh i would compare the qsdk dtsi to check if we are missing some crucial driver. Wonder if this was the reason ethernet didn't work at times for me?

1 Like

Could be, I could have easily missed something.

1 Like

Some tscr or missing remote proc? I mean it's for sure the remote proc that does some thing. Did you tried insmod the ssdk after the ath11k init?

1 Like

Remoteproc is present as ath11k depends on that.

Good idea, I could try disabling autoload and then manually loading after eth11k

1 Like

If this doesn't work, i would try to do some test with the original firmware by removing the nss firmware... (just to make sure ath11k and ess doesn't require nss acceleration to work together, as ath11k now has full offload support) (i know it doesn't make sense but it would be a quick test for sure)

1 Like

It should not be clocks as the remoteproc only has a PRNG clock under its control, nothing else.

1 Like

check the other idea on the edited message

1 Like

Thats good idea

1 Like

Anyway, manually loaded SSDK after ath11k and:

root@OpenWrt:/# modprobe qca_nss_dp
[   27.145696] ssdk_switch_device_num_init[1159]:INFO:ess-switch dts node number: 1
[   27.145780] ssdk_dt_get_switch_node[970]:INFO:ess-switch DT exist!
[   27.152230] ssdk_dt_parse_access_mode[856]:INFO:switch_access_mode: local bus
[   27.158211] ssdk_dt_parse_access_mode[869]:INFO:switchreg_base_addr: 0x3a000000
[   27.165400] ssdk_dt_parse_access_mode[870]:INFO:switchreg_size: 0x1000000
[   27.172484] ssdk_dt_parse_mac_mode[295]:INFO:mac mode = 0x0
[   27.179456] ssdk_dt_parse_mac_mode[304]:INFO:mac mode1 = 0xff
[   27.184805] ssdk_dt_parse_mac_mode[313]:INFO:mac mode2 = 0xff
[   27.190811] ssdk_dt_parse_uniphy[332]:INFO:ess-uniphy DT exist!
[   27.196626] ssdk_dt_parse_intf_mac[801]:INFO:dp2 MAC 88:c3:97:c3:a8:33
[   27.202244] ssdk_dt_parse_intf_mac[801]:INFO:dp3 MAC 88:c3:97:16:5d:9f
[   27.208805] ssdk_dt_parse_intf_mac[801]:INFO:dp4 MAC 88:c3:97:c3:a8:33
[   27.215351] ssdk_dt_parse_intf_mac[801]:INFO:dp5 MAC 88:c3:97:c3:a8:33
[   27.221835] ssdk_plat_init start
[   27.284262] ------------[ cut here ]------------
[   27.284284] gcc_nss_port1_rx_clk status stuck at 'off'
[   27.284319] WARNING: CPU: 3 PID: 2406 at clk_branch_toggle+0x138/0x148
[   27.292885] Modules linked in: qca_ssdk(+) pppoe ppp_async iptable_nat ath11k_ahb ath11k ath10k_pci ath10k_core ath xt_state xt_nat xt_conntrack xt_REDIRECT xt_MASQUERADE xt_FLOWOFFLOAD pppox ppp_generic nf_nat nf_flow_table nf_conntrack mac80211 ipt_REJECT cfg80211 xt_time xt_tcpudp xt_multiport xt_mark xt_mac xg
[   27.335062] CPU: 3 PID: 2406 Comm: modprobe Tainted: G        W         5.10.35 #0
[   27.357297] Hardware name: Xiaomi AX3600 (DT)
[   27.364845] pstate: 80400085 (Nzcv daIf +PAN -UAO -TCO BTYPE=--)
[   27.369277] pc : clk_branch_toggle+0x138/0x148
[   27.375349] lr : clk_branch_toggle+0x138/0x148
[   27.379599] sp : ffffffc016363730
[   27.384025] x29: ffffffc016363730 x28: 0000000000000023 
[   27.387415] x27: ffffffc0100c36f8 x26: ffffffc008bde000 
[   27.392795] x25: 0000000000000001 x24: ffffffc0107da4c0 
[   27.398092] x23: 0000000000000000 x22: ffffffc01036d070 
[   27.403386] x21: ffffffc011f30b60 x20: 0000000000000001 
[   27.408681] x19: 0000000000000000 x18: 0000000000000000 
[   27.413976] x17: 0000000000000000 x16: 0000000000000000 
[   27.419271] x15: ffffffffffffffff x14: ffffffffffffffff 
[   27.424567] x13: 0000000000000018 x12: ffffffc011f17c40 
[   27.429862] x11: 0000000000000003 x10: ffffffc011effc00 
[   27.435158] x9 : ffffffc011effc58 x8 : 0000000000017fe8 
[   27.440453] x7 : c0000000ffffefff x6 : 0000000000000001 
[   27.445747] x5 : ffffff801f6fa6d8 x4 : 0000000000000000 
[   27.451042] x3 : 0000000000000027 x2 : 0000000000000027 
[   27.456337] x1 : 0000000000000023 x0 : 000000000000002a 
[   27.461634] Call trace:
[   27.466925]  clk_branch_toggle+0x138/0x148
[   27.469099]  clk_branch2_enable+0x1c/0x28
[   27.473266]  clk_core_enable+0x6c/0xc0
[   27.477345]  clk_core_enable_lock+0x24/0x48
[   27.480991]  clk_enable+0x18/0x30
[   27.485570]  get_devid+0x238/0x258 [qca_ssdk]
[   27.488951]  ssdk_uniphy_clock_enable+0x88/0x230 [qca_ssdk]
[   27.493246]  ssdk_uniphy_clock_enable+0x1f8/0x230 [qca_ssdk]
[   27.498616]  ssdk_gcc_clock_init+0xf0/0x218 [qca_ssdk]
[   27.504518]  ssdk_plat_init+0x340/0x3d0 [qca_ssdk]
[   27.509461]  init_module+0x1a4/0x1000 [qca_ssdk]
[   27.513895]  do_one_initcall+0x74/0x1d0
[   27.518667]  do_init_module+0x54/0x200
[   27.522222]  load_module+0x1dc4/0x2210
[   27.526041]  __do_sys_init_module+0x1c4/0x2e0
[   27.529775]  __arm64_sys_init_module+0x1c/0x28
[   27.534204]  el0_svc_common.constprop.3+0xac/0x170
[   27.538543]  do_el0_svc+0x70/0x90
[   27.543319]  el0_svc+0x18/0x28
[   27.546700]  el0_sync_handler+0x90/0xb8
[   27.549652]  el0_sync+0x17c/0x180
[   27.553384] ---[ end trace 0bbcfda67a598525 ]---
[   27.556961] ssdk_uniphy_clock_enable[162]:ERROR:clock enable fail!
[   27.561709] ssdk_gcc_clock_init[1033]:INFO:SSDK gcc clock init successfully!
[   27.568638] HPPE initializing...
[   27.575172] malibu_phy_api_ops_init[2848]:INFO:qca probe malibu phy driver succeeded!
[   27.583397] regi_init[3567]:INFO:Initializing HPPE!!
[   27.798515] ssdk_ppe_reset_init[1265]:INFO:ppe reset successfully!
[   27.801877] qca_hppe_tdm_hw_init[684]:INFO:tdm setup num=96
[   27.803929] qca_hppe_portctrl_hw_init[110]:INFO:Hawkeye PPE port initializing
[   28.024743] ssdk_switch_register[1718]:INFO:Chip version 0x1500
[   28.024772] qca_link_polling_select[1315]:INFO:link-polling-required node does not exist
[   28.029501] ssdk_switch_register[1744]:INFO:polling is selected
[   28.037803] regi_init[3571]:INFO:Initializing HPPE Done!!
[   28.043543] regi_init[3631]:INFO:qca-ssdk module init succeeded!
[   28.051998] EDMA ver 1 hw init
[   28.055296] EDMA HW Reset completed succesfully
[   28.057962] Num rings - TxDesc:1 (23-23) TxCmpl:1 (7-7)
[   28.062428] RxDesc:1 (15-15) RxFill:1 (7-7)
[   28.073138] **********************************************************
[   28.073173] * NSS Data Plane driver
[   28.078595] **********************************************************
[   28.079115] nss-dp 3a001200.dp2 eth0: nss_dp_edma: Registering netdev eth0(qcom-id:2) with EDMA
[   28.088613] nss-dp 3a001200.dp2 eth0: netif_napi_add() called with weight 100
[   28.100247] nss-dp 3a001400.dp3 eth1: nss_dp_edma: Registering netdev eth1(qcom-id:3) with EDMA
[   28.105385] br-lan: port 1(eth1) entered blocking state
[   28.112990] br-lan: port 1(eth1) entered disabled state
[   28.118555] device eth1 entered promiscuous mode
root@OpenWrt:/# [   28.128206] nss-dp 3a001600.dp4 eth2: nss_dp_edma: Registering netdev eth2(qcom-id:4) with EDMA
[   28.130293] br-lan: port 2(eth2) entered blocking state
[   28.138224] br-lan: port 2(eth2) entered disabled state
[   28.143520] device eth2 entered promiscuous mode
[   28.150040] nss-dp 3a001800.dp5 eth3: nss_dp_edma: Registering netdev eth3(qcom-id:5) with EDMA
[   28.154327] br-lan: port 3(eth3) entered blocking state
[   28.161848] br-lan: port 3(eth3) entered disabled state
[   28.167193] device eth3 entered promiscuous mode
[   31.710532] pmd9655_ldo11: disabling
2 Likes

It has worked?

Not really, you can see that clock setting failed

IMHO it's remoteproc doing some fun thing internally... At least we have some clue of what is happening... search in the qsdk source about that clock and check if they do some special thing with it?

doesn't seems like they do something special...

./drivers/clk/qcom/gcc-ipq807x.c:3051:static struct clk_branch gcc_nss_port1_rx_clk = {
./drivers/clk/qcom/gcc-ipq807x.c:3058:                  .name = "gcc_nss_port1_rx_clk",
./drivers/clk/qcom/gcc-ipq807x.c:5237:  [GCC_NSS_PORT1_RX_CLK] = &gcc_nss_port1_rx_clk.clkr,
./drivers/clk/qcom/gcc-ipq807x.c:5485:  [GCC_NSS_PORT1_RX_CLK] = DEFINE_DUMMY_CLK(gcc_nss_port1_rx_clk),
./drivers/clk/qcom/gcc-ipq6018.c:2666:static struct clk_branch gcc_nss_port1_rx_clk = {
./drivers/clk/qcom/gcc-ipq6018.c:2672:                  .name = "gcc_nss_port1_rx_clk",
./drivers/clk/qcom/gcc-ipq6018.c:4251:  [GCC_NSS_PORT1_RX_CLK] = &gcc_nss_port1_rx_clk.clkr,
./drivers/clk/qcom/gcc-ipq6018.c:4453:  [GCC_NSS_PORT1_RX_CLK] = DEFINE_DUMMY_CLK(gcc_nss_port1_rx_clk),

It should not do anything as they reuse the same ath11k/remoteproc firmware in QSDK as well, GCC core has controll over the networking clocks.

I am sure that we are missing some of QCA patches to RCG2 or stuff like that.

But I am sure that its gotta be clocks as TX works while RX does not.

Think they are both stuck off and the warning just report tx as it's the first one that try to enables (and then the init fails)

Probably, but its shitty code and it will error on the clocks but continue on with init.