[openwrt/openwrt] ipq807x: add Edimax CAX1800

LEDE Commits lede-commits at lists.infradead.org
Mon Jan 16 03:53:02 PST 2023


ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/a36fc589fe7ac53ccb83f4503953bd6646477d0a

commit a36fc589fe7ac53ccb83f4503953bd6646477d0a
Author: Dirk Buchwalder <buchwalder at posteo.de>
AuthorDate: Sat Jan 1 23:17:51 2022 +0100

    ipq807x: add Edimax CAX1800
    
    Edimax CAX1800 is a 802.11 ax dual-band AP
    with PoE. AP can be ceiling or wall mount.
    
    Specifications:
    
        •     CPU: Qualcomm IPQ8070A Quad core Cortex-A53 1.4GHz
        •     RAM: 512MB of DDR3
        •     Storage: 128MB NAND (contains rootfs) / 8MB NOR (contains art and uboot-env)
        •     Ethernet: 1x 1G RJ45 port (QCA8072) PoE
        •     WLAN:
              2.4GHz: Qualcomm QCN5024 2x2 802.11b/g/n/ax 574 Mbps PHY rate
              5GHz: Qualcomm QCN5054 2x2 802.11a/b/g/n/ac/ax 1201 PHY rate
    
        •     LEDs:
              3 x GPIO-controlled System-LEDs
              (form one virtual RGB System-LED)
                black_small_square  Buttons: 1x soft reset
                black_small_square  Power: 12V DC jack or PoE (802.3af )
    
            An unpopulated serial header is onboard.
            RX/TX is working, bootwait is active, secure boot is not enabled.
    
            SSH can be activated in the stock firmware, but it drops only
            to a limited shell .
    
            Installation Instructions:
    
                black_small_square obtain serial access
                black_small_square stop auto boot
    
                black_small_square tftpboot the initramfs image (serverip is set to 192.168.99.8 in uboot)
                black_small_square bootm
    
                black_small_square copy openwrt-ipq807x-generic-edimax_cax1800-squashfs-nand-factory.ubi
                  to the device
                black_small_square write the image to the NAND:
                black_small_square cat /proc/mtd and look for rootfs partition (should be mtd0)
                black_small_square ubiformat /dev/mtd0 -f -y  openwrt-ipq807x-generic-edimax_cax1800-squashfs-
                  nand-factory.ubi
                black_small_square reboot
    
            Note: Device is not using dual partitioning (NAND contains other partitions
            with different manufacture data etc.)
            Draytek VigorAP 960C and Lancom LW-600 both look similar, but I haven't checked them.
    
    Signed-off-by: Dirk Buchwalder <buchwalder at posteo.de>
---
 package/boot/uboot-envtools/files/ipq807x          |   5 +
 package/firmware/ipq-wifi/Makefile                 |   2 +
 .../firmware/ipq-wifi/board-edimax_cax1800.ipq8074 | Bin 0 -> 131180 bytes
 .../ipq807x/base-files/etc/board.d/02_network      |   3 +
 .../etc/hotplug.d/firmware/11-ath11k-caldata       |   1 +
 .../ipq807x/base-files/lib/upgrade/platform.sh     |   3 +
 .../arch/arm64/boot/dts/qcom/ipq8070-cax1800.dts   | 322 +++++++++++++++++++++
 target/linux/ipq807x/image/generic.mk              |  13 +
 8 files changed, 349 insertions(+)

diff --git a/package/boot/uboot-envtools/files/ipq807x b/package/boot/uboot-envtools/files/ipq807x
index 44f2d8a0c2..636f334412 100644
--- a/package/boot/uboot-envtools/files/ipq807x
+++ b/package/boot/uboot-envtools/files/ipq807x
@@ -8,6 +8,11 @@ touch /etc/config/ubootenv
 board=$(board_name)
 
 case "$board" in
+edimax,cax1800)
+	idx="$(find_mtd_index 0:appsblenv)"
+	[ -n "$idx" ] && \
+		ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x20000"
+	;;
 redmi,ax6|\
 xiaomi,ax3600)
 	idx="$(find_mtd_index 0:appsblenv)"
diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile
index 1fa7482ddb..2767228080 100644
--- a/package/firmware/ipq-wifi/Makefile
+++ b/package/firmware/ipq-wifi/Makefile
@@ -29,6 +29,7 @@ ALLWIFIBOARDS:= \
 	devolo_magic-2-wifi-next \
 	edgecore_ecw5410 \
 	edgecore_oap100 \
+	edimax_cax1800 \
 	extreme-networks_ws-ap3915i \
 	glinet_gl-a1300 \
 	glinet_gl-ap1300 \
@@ -120,6 +121,7 @@ $(eval $(call generate-ipq-wifi-package,aruba_ap-365,Aruba AP-365))
 $(eval $(call generate-ipq-wifi-package,devolo_magic-2-wifi-next,devolo Magic 2 WiFi next))
 $(eval $(call generate-ipq-wifi-package,edgecore_ecw5410,Edgecore ECW5410))
 $(eval $(call generate-ipq-wifi-package,edgecore_oap100,Edgecore OAP100))
+$(eval $(call generate-ipq-wifi-package,edimax_cax1800,Edimax CAX1800))
 $(eval $(call generate-ipq-wifi-package,extreme-networks_ws-ap3915i,Edgecore OAP100))
 $(eval $(call generate-ipq-wifi-package,glinet_gl-a1300,GL.iNet GL-A1300))
 $(eval $(call generate-ipq-wifi-package,glinet_gl-ap1300,GL.iNet GL-AP1300))
diff --git a/package/firmware/ipq-wifi/board-edimax_cax1800.ipq8074 b/package/firmware/ipq-wifi/board-edimax_cax1800.ipq8074
new file mode 100644
index 0000000000..5c9f4700f4
Binary files /dev/null and b/package/firmware/ipq-wifi/board-edimax_cax1800.ipq8074 differ
diff --git a/target/linux/ipq807x/base-files/etc/board.d/02_network b/target/linux/ipq807x/base-files/etc/board.d/02_network
index cfe7580f8e..e3f4d4f576 100644
--- a/target/linux/ipq807x/base-files/etc/board.d/02_network
+++ b/target/linux/ipq807x/base-files/etc/board.d/02_network
@@ -11,6 +11,9 @@ ipq807x_setup_interfaces()
 	local board="$1"
 
 	case "$board" in
+	edimax,cax1800)
+		ucidef_set_interfaces_lan_wan "lan"
+		;;
 	redmi,ax6|\
 	xiaomi,ax3600)
 		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan"
diff --git a/target/linux/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata b/target/linux/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata
index 0a2908f13d..7f919bafc5 100644
--- a/target/linux/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata
+++ b/target/linux/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata
@@ -9,6 +9,7 @@ board=$(board_name)
 case "$FIRMWARE" in
 "ath11k/IPQ8074/hw2.0/cal-ahb-c000000.wifi.bin")
 	case "$board" in
+	edimax,cax1800|\
 	redmi,ax6|\
 	xiaomi,ax3600)
 		caldata_extract "0:art" 0x1000 0x20000
diff --git a/target/linux/ipq807x/base-files/lib/upgrade/platform.sh b/target/linux/ipq807x/base-files/lib/upgrade/platform.sh
index f9c28fad09..d6e5d04a31 100644
--- a/target/linux/ipq807x/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ipq807x/base-files/lib/upgrade/platform.sh
@@ -42,6 +42,9 @@ platform_pre_upgrade() {
 
 platform_do_upgrade() {
 	case "$(board_name)" in
+	edimax,cax1800)
+		nand_do_upgrade "$1"
+		;;
 	redmi,ax6|\
 	xiaomi,ax3600)
 		# Make sure that UART is enabled
diff --git a/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8070-cax1800.dts b/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8070-cax1800.dts
new file mode 100644
index 0000000000..2c9cbd5b3c
--- /dev/null
+++ b/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8070-cax1800.dts
@@ -0,0 +1,322 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/* Copyright (c) 2021, Dirk Buchwalder <buchwalder at posteo.de> */
+
+/dts-v1/;
+
+#include "ipq8074-512m.dtsi"
+#include "ipq8074-ac-cpu.dtsi"
+#include "ipq8074-ess.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+	model = "Edimax CAX1800";
+	compatible = "edimax,cax1800", "qcom,ipq8074";
+
+	aliases {
+		serial0 = &blsp1_uart5;
+		led-boot = &led_system_red;
+		led-failsafe = &led_system_red;
+		led-running = &led_system_green;
+		led-upgrade = &led_system_red;
+		/* Aliases as required by u-boot to patch MAC addresses */
+		ethernet0 = &dp5;
+		label-mac-device = &dp5;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+		bootargs-append = " root=/dev/ubiblock0_1";
+	};
+
+	keys {
+		compatible = "gpio-keys";
+
+		reset {
+			label = "reset";
+			gpios = <&tlmm 32 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_RESTART>;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led_system_red: system-red {
+			label = "red:system";
+			gpios = <&tlmm 25 GPIO_ACTIVE_HIGH>;
+		};
+
+		led_system_green: system-green {
+			label = "green:system";
+			gpios = <&tlmm 26 GPIO_ACTIVE_HIGH>;
+		};
+
+		led_system_blue: system-blue {
+			label = "blue:system";
+			gpios = <&tlmm 27 GPIO_ACTIVE_HIGH>;
+		};
+	};
+};
+
+&tlmm {
+	mdio_pins: mdio-pins {
+		mdc {
+			pins = "gpio68";
+			function = "mdc";
+			drive-strength = <8>;
+			bias-pull-up;
+		};
+
+		mdio {
+			pins = "gpio69";
+			function = "mdio";
+			drive-strength = <8>;
+			bias-pull-up;
+		};
+	};
+};
+
+&blsp1_uart5 {
+	status = "okay";
+};
+
+&prng {
+	status = "okay";
+};
+
+&cryptobam {
+	status = "okay";
+};
+
+&crypto {
+	status = "okay";
+};
+
+&qpic_bam {
+	status = "okay";
+};
+
+&qpic_nand {
+	status = "okay";
+
+	nand at 0 {
+		reg = <0>;
+		nand-ecc-strength = <4>;
+		nand-ecc-step-size = <512>;
+		nand-bus-width = <8>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				label = "rootfs";
+				reg = <0x0000000 0x3400000>;
+			};
+		};
+	};
+};
+
+&blsp1_spi1 {
+	pinctrl-0 = <&spi_0_pins>;
+	pinctrl-names = "default";
+	cs-select = <0>;
+	status = "ok";
+
+	m25p80 at 0 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		reg = <0>;
+		compatible = "jedec,spi-nor";
+		spi-max-frequency = <50000000>;
+		use-default-sizes;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				label = "0:sbl1";
+				reg = <0x0 0x50000>;
+				read-only;
+			};
+
+			partition at 50000 {
+				label = "0:mibib";
+				reg = <0x50000 0x10000>;
+				read-only;
+			};
+
+			partition at 60000 {
+				label = "0:bootconfig";
+				reg = <0x60000 0x20000>;
+				read-only;
+			};
+
+			partition at 80000 {
+				label = "0:bootconfig1";
+				reg = <0x80000 0x20000>;
+				read-only;
+			};
+
+			partition at a0000 {
+				label = "0:qsee";
+				reg = <0xa0000 0x180000>;
+				read-only;
+			};
+
+			partition at 220000 {
+				label = "0:qsee_1";
+				reg = <0x220000 0x180000>;
+				read-only;
+			};
+
+			partition at 3a0000 {
+				label = "0:devcfg";
+				reg = <0x3a0000 0x10000>;
+				read-only;
+			};
+
+			partition at 3b0000 {
+				label = "0:devcfg_1";
+				reg = <0x3b0000 0x10000>;
+				read-only;
+			};
+
+			partition at 3c0000 {
+				label = "0:apdp";
+				reg = <0x3c0000 0x10000>;
+				read-only;
+			};
+
+			partition at 3d0000 {
+				label = "0:apdp_1";
+				reg = <0x3d0000 0x10000>;
+				read-only;
+			};
+
+			partition at 3e0000 {
+				label = "0:rpm";
+				reg = <0x3e0000 0x40000>;
+				read-only;
+			};
+
+			partition at 420000 {
+				label = "0:rpm_1";
+				reg = <0x420000 0x40000>;
+				read-only;
+			};
+
+			partition at 460000 {
+				label = "0:cdt";
+				reg = <0x460000 0x10000>;
+				read-only;
+			};
+
+			partition at 470000 {
+				label = "0:cdt_1";
+				reg = <0x470000 0x10000>;
+				read-only;
+			};
+
+			partition at 480000 {
+				label = "0:appsblenv";
+				reg = <0x480000 0x10000>;
+			};
+
+			partition at 490000 {
+				label = "0:appsbl";
+				reg = <0x490000 0xa0000>;
+				read-only;
+			};
+
+			partition at 530000 {
+				label = "0:appsbl_1";
+				reg = <0x530000 0xa0000>;
+				read-only;
+			};
+
+			partition at 5d0000 {
+				label = "0:art";
+				reg = <0x5d0000 0x40000>;
+				read-only;
+			};
+
+			partition at 610000 {
+				label = "0:ethphyfw";
+				reg = <0x610000 0x80000>;
+				read-only;
+			};
+		};
+	};
+};
+
+&mdio {
+	status = "okay";
+
+	pinctrl-0 = <&mdio_pins>;
+	pinctrl-names = "default";
+
+	reset-gpios = <&tlmm 37 GPIO_ACTIVE_LOW>;
+
+	qca8075: ethernet-phy at 4 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <4>;
+	};
+};
+
+&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_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*/
+	bm_tick_mode = <0>; /* bm tick mode */
+	tm_tick_mode = <0>; /* tm tick mode */
+
+	qcom,port_phyinfo {
+		port at 0 {
+			port_id = <1>;
+			phy_address = <0>;
+		};
+		port at 1 {
+			port_id = <2>;
+			phy_address = <1>;
+		};
+		port at 2 {
+			port_id = <3>;
+			phy_address = <2>;
+		};
+		port at 3 {
+			port_id = <4>;
+			phy_address = <3>;
+		};
+		port at 4 {
+			port_id = <5>;
+			phy_address = <4>;
+		};
+	};
+};
+
+&edma {
+	status = "okay";
+};
+
+&dp5 {
+	status = "okay";
+	phy-handle = <&qca8075>;
+	label = "lan";
+};
+
+&wifi {
+	status = "okay";
+
+	qcom,ath11k-calibration-variant = "Edimax-CAX1800";
+	qcom,ath11k-fw-memory-mode = <1>;
+};
diff --git a/target/linux/ipq807x/image/generic.mk b/target/linux/ipq807x/image/generic.mk
index 7fd0169a64..95937512a9 100644
--- a/target/linux/ipq807x/image/generic.mk
+++ b/target/linux/ipq807x/image/generic.mk
@@ -17,6 +17,19 @@ define Device/UbiFit
 	IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
 endef
 
+define Device/edimax_cax1800
+	$(call Device/FitImage)
+	$(call Device/UbiFit)
+	DEVICE_VENDOR := Edimax
+	DEVICE_MODEL := CAX1800
+	BLOCKSIZE := 128k
+	PAGESIZE := 2048
+	DEVICE_DTS_CONFIG := config at ac03
+	SOC := ipq8070
+	DEVICE_PACKAGES := ipq-wifi-edimax_cax1800
+endef
+TARGET_DEVICES += edimax_cax1800
+
 define Device/redmi_ax6
 	$(call Device/xiaomi_ax3600)
 	DEVICE_VENDOR := Redmi




More information about the lede-commits mailing list