From 0445caf2b8c975f7ea39556a24f51348be55ce9f Mon Sep 17 00:00:00 2001 From: John Crispin Date: Fri, 19 May 2023 09:15:22 +0200 Subject: [PATCH] ipa807x: various fixes for wf186 Fixes: WIFI-12616 Signed-off-by: John Crispin --- .../ipq807x/base-files/etc/board.d/02_network | 27 ++++++--- .../etc/hotplug.d/firmware/10-ath11k-caldata | 20 ++++++- .../boot/dts/qcom/qcom-ipq5018-cig-wf186w.dts | 55 ++++++++++--------- 3 files changed, 66 insertions(+), 36 deletions(-) diff --git a/feeds/ipq807x/ipq807x/base-files/etc/board.d/02_network b/feeds/ipq807x/ipq807x/base-files/etc/board.d/02_network index 791672a62..af529ba10 100755 --- a/feeds/ipq807x/ipq807x/base-files/etc/board.d/02_network +++ b/feeds/ipq807x/ipq807x/base-files/etc/board.d/02_network @@ -60,19 +60,19 @@ qcom_setup_interfaces() ucidef_set_interface_wan "eth0" ;; cig,wf660a) - ucidef_set_interface_wan "eth0" + ucidef_set_interface_wan "eth0" ;; cig,wf186w) - ucidef_set_interface_lan "eth1" + ucidef_set_interface_wan "eth0" ;; yuncore,fap650) ucidef_set_interface_lan "eth3 eth2 eth1 eth0" ucidef_set_interface_wan "eth4" ;; hfcl,ion4xi_wp) - ucidef_set_interface_lan "eth0 eth1 eth2 eth3" - ucidef_set_interface_wan "eth4" - ;; + ucidef_set_interface_lan "eth0 eth1 eth2 eth3" + ucidef_set_interface_wan "eth4" + ;; qcom,ipq807x-hk14) ucidef_set_interface_lan "eth0 eth1 eth2 eth3" ucidef_set_interface_wan "eth4" @@ -135,6 +135,19 @@ qcom_setup_macs() ip link set eth1 address $wan_mac ucidef_set_label_macaddr $wan_mac ;; + cig,wf186w) + mtd=$(find_mtd_chardev "0:APPSBLENV") + [ -z "$mtd" ] && return; + mac=$(grep BaseMacAddress= $mtd | cut -dx -f2) + [ -z "$mac" ] && return; + wan_mac=$(macaddr_canonicalize $mac) + #lan_mac=$(macaddr_add "$wan_mac" 1) + ucidef_set_network_device_mac eth0 $wan_mac + # ucidef_set_network_device_mac eth1 $wan_mac + ip link set eth0 address $wan_mac + # ip link set eth1 address $wan_mac + # ucidef_set_label_macaddr $wan_mac + ;; cybertan,eww631-a1|\ cybertan,eww631-b1) mac=$(grep -i -m 1 BaseMacAddress= /dev/`cat /proc/mtd | grep APPSBLENV | cut -d: -f1` | cut -d= -f2) @@ -166,8 +179,8 @@ qcom_setup_macs() ip link set eth0 address $wan_mac ;; cybertan,eww622-a1) - mac=$(grep -i -m 1 mac_addr_base= /dev/`cat /proc/mtd | grep devinfo | cut -d: -f1` | cut -d= -f2) - [ -z "$mac"] && mac="00:11:22:33:44:55" + mac=$(grep -i -m 1 mac_addr_base= /dev/`cat /proc/mtd | grep devinfo | cut -d: -f1` | cut -d= -f2) + [ -z "$mac"] && mac="00:11:22:33:44:55" wan_mac=$(macaddr_canonicalize $mac) lan_mac=$(macaddr_add "$wan_mac" 1) ucidef_set_network_device_mac eth0 $wan_mac diff --git a/feeds/ipq807x/ipq807x/base-files/etc/hotplug.d/firmware/10-ath11k-caldata b/feeds/ipq807x/ipq807x/base-files/etc/hotplug.d/firmware/10-ath11k-caldata index 61e207305..47f477b95 100755 --- a/feeds/ipq807x/ipq807x/base-files/etc/hotplug.d/firmware/10-ath11k-caldata +++ b/feeds/ipq807x/ipq807x/base-files/etc/hotplug.d/firmware/10-ath11k-caldata @@ -71,6 +71,20 @@ ath11k_generate_macs_wf660a() { echo -ne \\x${mac3//:/\\x} >> /lib/firmware/ath11k-macs } +ath11k_generate_macs_wf186w() { + touch /lib/firmware/ath11k-macs + local dev=$(find_mtd_chardev "0:APPSBLENV") + mac=$(grep BaseMacAddress= $dev | cut -dx -f2) + eth=$(macaddr_canonicalize $mac) + mac1=$(macaddr_add $eth 2) + mac2=$(macaddr_add $eth 3) + mac3=$(macaddr_add $eth 4) + echo -ne \\x${mac1//:/\\x} >> /lib/firmware/ath11k-macs + echo -ne \\x${mac2//:/\\x} >> /lib/firmware/ath11k-macs + echo -ne \\x${mac3//:/\\x} >> /lib/firmware/ath11k-macs +} + + caldata_die() { echo "caldata: " "$*" exit 1 @@ -218,7 +232,6 @@ ath11k-macs) indio,um-310ax-v1|\ indio,um-510axp-v1|\ indio,um-510axm-v1|\ - cig,wf186w|\ cig,wf188n) ath11k_generate_macs ;; @@ -226,7 +239,7 @@ ath11k-macs) cig,wf194c4|\ cig,wf196) ath11k_generate_macs_wf194 - ;; + ;; plasmacloud,pax1800-v1|\ plasmacloud,pax1800-v2) ath11k_generate_macs_pax1800 @@ -234,6 +247,9 @@ ath11k-macs) cig,wf660a) ath11k_generate_macs_wf660a ;; + cig,wf186w) + ath11k_generate_macs_wf186w + ;; esac ;; *) diff --git a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-cig-wf186w.dts b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-cig-wf186w.dts index cfe8f059d..8451bc901 100755 --- a/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-cig-wf186w.dts +++ b/feeds/ipq807x/ipq807x/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-cig-wf186w.dts @@ -531,34 +531,35 @@ status = "ok"; }; - dp1 { - device_type = "network"; - compatible = "qcom,nss-dp"; - clocks = <&gcc GCC_SNOC_GMAC0_AXI_CLK>; - clock-names = "nss-snoc-gmac-axi-clk"; - qcom,id = <1>; - reg = <0x39C00000 0x10000>; - interrupts = ; - qcom,mactype = <2>; - qcom,link-poll = <1>; - qcom,phy-mdio-addr = <7>; - mdio-bus = <&mdio0>; - local-mac-address = [000000000000]; - phy-mode = "sgmii"; - }; + dp1 { + device_type = "network"; + compatible = "qcom,nss-dp"; + clocks = <&gcc GCC_SNOC_GMAC1_AXI_CLK>; + clock-names = "nss-snoc-gmac-axi-clk"; + qcom,id = <2>; + reg = <0x39D00000 0x10000>; + interrupts = ; + qcom,mactype = <2>; + local-mac-address = [000000000000]; + phy-mode = "sgmii"; + }; + + dp2 { + device_type = "network"; + compatible = "qcom,nss-dp"; + clocks = <&gcc GCC_SNOC_GMAC0_AXI_CLK>; + clock-names = "nss-snoc-gmac-axi-clk"; + qcom,id = <1>; + reg = <0x39C00000 0x10000>; + interrupts = ; + qcom,mactype = <2>; + qcom,link-poll = <1>; + qcom,phy-mdio-addr = <7>; + mdio-bus = <&mdio0>; + local-mac-address = [000000000000]; + phy-mode = "sgmii"; + }; - dp2 { - device_type = "network"; - compatible = "qcom,nss-dp"; - clocks = <&gcc GCC_SNOC_GMAC1_AXI_CLK>; - clock-names = "nss-snoc-gmac-axi-clk"; - qcom,id = <2>; - reg = <0x39D00000 0x10000>; - interrupts = ; - qcom,mactype = <2>; - local-mac-address = [000000000000]; - phy-mode = "sgmii"; - }; qcom,test@0 { status = "ok";