ipq807x: fix wrong define for LAN and WAN ess mask
authorChristian Marangi <ansuelsmth@gmail.com>
Fri, 10 Nov 2023 17:38:34 +0000 (18:38 +0100)
committerChristian Marangi <ansuelsmth@gmail.com>
Fri, 10 Nov 2023 19:19:45 +0000 (20:19 +0100)
switch_lan_bmp and switch_wan_bmp have wrong values and now cause
problems with the new version of the qca-ssdk.

Fix the wrong entry and drop the redundant switch_cpu_bmp.

Also introduce some convenient define to better understand values in
this map.

Fixes: eea264feadcf ("kernel: qca-ssdk: update to 12.4")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Tested-by: Robert Marko <robimarko@gmail.com> # Dynalink AX3600 and Qnap 301W
Reviewed by: Robert Marko <robimarko@gmail.com>

17 files changed:
target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8070-cax1800.dts
target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-ax3600.dtsi
target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-eap102.dts
target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-301w.dts
target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-ax880.dts
target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-ax9000.dts
target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-dl-wrx36.dts
target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-haze.dts
target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-wax218.dts
target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-wax620.dts
target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-wpq873.dts
target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-ess.dtsi
target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-nbg7815.dts
target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-rax120v2.dts
target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-wax630.dts
target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-wxr-5950ax12.dts
target/linux/qualcommax/files/include/dt-bindings/net/qcom-ipq-ess.h [new file with mode: 0644]

index 2c9cbd5b3cd3caabaa1156b93b6774e65e4c8890..3f19e4fee9997e0f546e2a11325dea027c944bcf 100644 (file)
 &switch {
        status = "okay";
 
-       switch_cpu_bmp = <0x1>;  /* cpu port bitmap */
-       switch_lan_bmp = <0x1e>; /* lan port bitmap */
-       switch_wan_bmp = <0x20>; /* wan port bitmap */
+       switch_lan_bmp = <(ESS_PORT1 | ESS_PORT2 | ESS_PORT3 | ESS_PORT4)>; /* lan port bitmap */
+       switch_wan_bmp = <ESS_PORT5>; /* wan port bitmap */
        switch_mac_mode = <0x0>; /* mac mode for uniphy instance0*/
        switch_mac_mode1 = <0xff>; /* mac mode for uniphy instance1*/
        switch_mac_mode2 = <0xff>; /* mac mode for uniphy instance2*/
index c18cef52f39d8b0e9dbc5c4354eb192c3ba0a739..82a981b5faacfc61cec026b443e0059a48ef50d4 100644 (file)
 &switch {
        status = "okay";
 
-       switch_cpu_bmp = <0x1>;  /* cpu port bitmap */
-       switch_lan_bmp = <0x1e>; /* lan port bitmap */
-       switch_wan_bmp = <0x20>; /* wan port bitmap */
+       switch_lan_bmp = <(ESS_PORT2 | ESS_PORT3 | ESS_PORT4)>; /* lan port bitmap */
+       switch_wan_bmp = <ESS_PORT5>; /* wan port bitmap */
        switch_mac_mode = <0x0>; /* mac mode for uniphy instance0*/
        switch_mac_mode1 = <0xff>; /* mac mode for uniphy instance1*/
        switch_mac_mode2 = <0xff>; /* mac mode for uniphy instance2*/
        tm_tick_mode = <0>; /* tm tick mode */
 
        qcom,port_phyinfo {
-               port@0 {
-                       port_id = <1>;
-                       phy_address = <0>;
-               };
                port@1 {
                        port_id = <2>;
                        phy_address = <1>;
index 357b6368d9dc554a480d457739bca8f89ca52aec..e373af1ba8286275ef67ae7c52aa3b10ba47d17e 100644 (file)
 &switch {
        status = "okay";
 
-       switch_cpu_bmp = <0x1>;  /* cpu port bitmap */
-       switch_lan_bmp = <0x3e>; /* lan port bitmap */
-       switch_wan_bmp = <0x40>; /* wan port bitmap */
+       switch_lan_bmp = <ESS_PORT5>; /* lan port bitmap */
+       switch_wan_bmp = <ESS_PORT6>; /* wan port bitmap */
        switch_mac_mode = <0xff>; /* mac mode for uniphy instance0*/
        switch_mac_mode1 = <0xf>; /* mac mode for uniphy instance1*/
        switch_mac_mode2 = <0xf>; /* mac mode for uniphy instance2*/
index 5521a480b8a35e8461fc61ab07c908fb6aa40bad..ce82f24ae8ad7cc7fffaf0cda154cd6199688cc3 100644 (file)
 &switch {
        status = "okay";
 
-       switch_cpu_bmp = <0x1>;  /* cpu port bitmap */
-       switch_lan_bmp = <0x3e>; /* lan port bitmap */
-       switch_wan_bmp = <0xc0>; /* wan port bitmap */
+       switch_lan_bmp = <(ESS_PORT1 | ESS_PORT2 | ESS_PORT3 | ESS_PORT4 | ESS_PORT5)>; /* lan port bitmap */
+       switch_wan_bmp = <ESS_PORT6>; /* wan port bitmap */
        switch_mac_mode = <0xb>; /* mac mode for uniphy instance0*/
        switch_mac_mode1 = <0xd>; /* mac mode for uniphy instance1*/
        switch_mac_mode2 = <0xd>; /* mac mode for uniphy instance2*/
index 1aefa2c9243663b0942a2a60bb03dfbac330b435..4551e7b6b3cbc6587ef402a70745d01335ab5b33 100644 (file)
 &switch {
        status = "okay";
 
-       switch_cpu_bmp = <0x1>;  /* cpu port bitmap */
-       switch_lan_bmp = <0x3e>; /* lan port bitmap */
-       switch_wan_bmp = <0x40>; /* wan port bitmap */
+       switch_lan_bmp = <ESS_PORT5>; /* lan port bitmap */
+       switch_wan_bmp = <ESS_PORT6>; /* wan port bitmap */
        switch_mac_mode = <0xff>; /* mac mode for uniphy instance0*/
        switch_mac_mode1 = <0xf>; /* mac mode for uniphy instance1*/
        switch_mac_mode2 = <0xf>; /* mac mode for uniphy instance2*/
index 801aa056045f44606ef2ab1754fc14b3040dc5f1..338051ef48a3dc199bb0fbb8468c015ae607c82c 100644 (file)
 &switch {
        status = "okay";
 
-       switch_cpu_bmp = <0x1>;  /* cpu port bitmap */
-       switch_lan_bmp = <0x1e>; /* lan port bitmap */
-       switch_wan_bmp = <0x20>; /* wan port bitmap */
+       switch_lan_bmp = <(ESS_PORT1 | ESS_PORT2 | ESS_PORT3 | ESS_PORT4)>; /* lan port bitmap */
+       switch_wan_bmp = <ESS_PORT5>; /* wan port bitmap */
        switch_mac_mode = <0xb>; /* mac mode for uniphy instance0*/
        switch_mac_mode1 = <0xc>; /* mac mode for uniphy instance1*/
        switch_mac_mode2 = <0xff>; /* mac mode for uniphy instance2*/
index 5468e9e1fb83f5cb8fe4218f50cc4458968fcb9b..165d788a4f6781d1197bfea7c1b50d28f0be52ca 100644 (file)
 &switch {
        status = "okay";
 
-       switch_cpu_bmp = <0x1>;  /* cpu port bitmap */
-       switch_lan_bmp = <0x3e>; /* lan port bitmap */
-       switch_wan_bmp = <0x40>; /* wan port bitmap */
+       switch_lan_bmp = <(ESS_PORT1 | ESS_PORT2 | ESS_PORT3 | ESS_PORT4)>; /* lan port bitmap */
+       switch_wan_bmp = <ESS_PORT6>; /* wan port bitmap */
        switch_mac_mode = <0xb>; /* mac mode for uniphy instance0*/
        switch_mac_mode1 = <0xff>; /* mac mode for uniphy instance1*/
        switch_mac_mode2 = <0xc>; /* mac mode for uniphy instance2*/
index 8a5200b4ebf50ef1f86169cb15616b4a5f82bd26..81e647582ac30cc4691e4a22250c720a811c1d45 100644 (file)
 &switch {
        status = "okay";
 
-       switch_cpu_bmp = <0x1>;  /* cpu port bitmap */
-       switch_lan_bmp = <0x1e>; /* lan port bitmap */
-       switch_wan_bmp = <0x60>; /* wan port bitmap */
+       switch_lan_bmp = <(ESS_PORT1 | ESS_PORT2 | ESS_PORT3 | ESS_PORT4)>; /* lan port bitmap */
+       switch_wan_bmp = <ESS_PORT6>; /* wan port bitmap */
        switch_mac_mode = <0x0>; /* mac mode for uniphy instance0*/
        switch_mac_mode1 = <0xe>; /* mac mode for uniphy instance1*/
        switch_mac_mode2 = <0xd>; /* mac mode for uniphy instance2*/
index 5bfcdcc8ca3ad18a1bcc15813f0ba6e18c7d41d5..68be7b277835110cfd08af82682fa1aa48586fbd 100644 (file)
@@ -89,9 +89,7 @@
 &switch {
        status = "okay";
 
-       switch_cpu_bmp = <0x1>;
-       switch_lan_bmp = <0x3e>;
-       switch_wan_bmp = <0x40>;
+       switch_wan_bmp = <ESS_PORT6>;
        switch_mac_mode = <0x00>;
        switch_mac_mode1 = <0xff>;
        switch_mac_mode2 = <0x0f>;
index d1c3245c8baf0c7375e47795c2d553610b9a78fa..6adf39338838b380b4e9b92873ce82f06feeadd9 100644 (file)
 &switch {
        status = "okay";
 
-       switch_cpu_bmp = <0x01>;        
-       switch_lan_bmp = <0x3e>;
-       switch_wan_bmp = <0x40>;
+       switch_wan_bmp = <ESS_PORT6>;
        switch_mac_mode = <0x00>;
        switch_mac_mode1 = <0xff>;
        switch_mac_mode2 = <0x0f>;
index 9779070725b40eff647b7fb74e4824c8c038a150..8d1c3725a18a6a5102b13acc9d826cb66258060f 100644 (file)
 &switch {
        status = "okay";
 
-       switch_cpu_bmp = <0x1>;  /* cpu port bitmap */
-       switch_lan_bmp = <0x3e>; /* lan port bitmap */
-       switch_wan_bmp = <0x40>; /* wan port bitmap */
+       switch_lan_bmp = <(ESS_PORT2 | ESS_PORT3 | ESS_PORT4)>; /* lan port bitmap */
+       switch_wan_bmp = <ESS_PORT6>; /* wan port bitmap */
        switch_mac_mode = <0x0>; /* mac mode for uniphy instance0*/
        switch_mac_mode1 = <0x0f>; /* mac mode for uniphy instance1*/
        switch_mac_mode2 = <0x0f>; /* mac mode for uniphy instance2*/
index 129266c50d1d38e825e07498ba141487f5748393..597f7f1ff98cb749b322592e5065068098911ee3 100644 (file)
@@ -1,5 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-only
 
+#include <dt-bindings/net/qcom-ipq-ess.h>
+
 &clocks {
        bias_pll_cc_clk {
                compatible = "fixed-clock";
@@ -19,8 +21,8 @@
                compatible = "qcom,ess-switch-ipq807x";
                reg = <0x3a000000 0x1000000>;
                switch_access_mode = "local bus";
-               switch_cpu_bmp = <0x1>;  /* cpu port bitmap */
-               switch_inner_bmp = <0x80>; /*inner port bitmap*/
+               switch_cpu_bmp = <ESS_PORT0>;  /* cpu port bitmap */
+               switch_inner_bmp = <ESS_PORT7>; /*inner port bitmap*/
                clocks = <&gcc GCC_CMN_12GPLL_AHB_CLK>,
                         <&gcc GCC_CMN_12GPLL_SYS_CLK>,
                         <&gcc GCC_UNIPHY0_AHB_CLK>,
index d113b233ecf9706f5955d199b1ef66846dbb821d..62e256b4252bba415ea5918797d9a556f7884028 100644 (file)
 &switch {
        status = "okay";
 
-       switch_cpu_bmp = <0x1>;
-       switch_lan_bmp = <0x3e>;
-       switch_wan_bmp = <0x40>;
+       switch_lan_bmp = <(ESS_PORT1 | ESS_PORT2 | ESS_PORT3 | ESS_PORT4 | ESS_PORT5)>;
+       switch_wan_bmp = <ESS_PORT6>;
        switch_mac_mode = <0x0>;
        switch_mac_mode1 = <0xf>;
        switch_mac_mode2 = <0xd>;
index 188ad03fe04993c75645f30ea276347a52f8dd56..4e756867f298b408e093c916df0eac4df29fa52d 100644 (file)
 &switch {
        status = "okay";
 
-       switch_lan_bmp = <0x3e>; /* lan port bitmap */
-       switch_wan_bmp = <0x40>; /* wan port bitmap */
+       switch_lan_bmp = <(ESS_PORT1 | ESS_PORT2 | ESS_PORT3 | ESS_PORT4 | ESS_PORT5)>; /* lan port bitmap */
+       switch_wan_bmp = <ESS_PORT6>; /* wan port bitmap */
        switch_mac_mode = <0x0>; /* mac mode for uniphy instance0*/
        switch_mac_mode1 = <0xff>; /* mac mode for uniphy instance1*/
        switch_mac_mode2 = <0xd>; /* mac mode for uniphy instance2*/
index f2498837de59f734b14f069ec72e2778e0502ae0..e28810fa3dc12fef314196958f730910c87110df 100644 (file)
 
 &switch {
        status = "okay";
-
-       switch_cpu_bmp = <0x01>;        
-       switch_lan_bmp = <0x3e>;
-       switch_wan_bmp = <0x40>;
+       
+       switch_lan_bmp = <ESS_PORT4>;
+       switch_wan_bmp = <ESS_PORT6>;
        switch_mac_mode = <0x00>;
        switch_mac_mode1 = <0xff>;
        switch_mac_mode2 = <0x0d>;
index 32386dc93e0718aa34f0bead99ae98f5da011299..51af034c34459726953565a0f148edc8dd87aba3 100644 (file)
 &switch {
        status = "okay";
 
-       switch_cpu_bmp = <0x1>;
-       switch_lan_bmp = <0x3e>;
-       switch_wan_bmp = <0x40>;
+       switch_lan_bmp = <(ESS_PORT1 | ESS_PORT2 | ESS_PORT3 | ESS_PORT4 | ESS_PORT5)>;
+       switch_wan_bmp = <ESS_PORT6>;
        switch_mac_mode = <0xb>;
        switch_mac_mode1 = <0xd>;
        switch_mac_mode2 = <0xd>;
diff --git a/target/linux/qualcommax/files/include/dt-bindings/net/qcom-ipq-ess.h b/target/linux/qualcommax/files/include/dt-bindings/net/qcom-ipq-ess.h
new file mode 100644 (file)
index 0000000..0ecadb3
--- /dev/null
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0 */\r
+\r
+#ifndef _DT_BINDINGS_NET_QCOM_IPQ_ESS_H\r
+#define _DT_BINDINGS_NET_QCOM_IPQ_ESS_H\r
+\r
+#define ESS_PORT0      0x1\r
+#define ESS_PORT1      0x2\r
+#define ESS_PORT2      0x4\r
+#define ESS_PORT3      0x8\r
+#define ESS_PORT4      0x10\r
+#define ESS_PORT5      0x20\r
+#define ESS_PORT6      0x40\r
+#define ESS_PORT7      0x80\r
+\r
+#endif /* _DT_BINDINGS_NET_QCOM_IPQ_ESS_H */\r