ipq806x: add support for Linksys e8350-v1
authorSergey Filippov <sergey.filippov@outlook.com>
Sat, 15 Jun 2024 19:36:43 +0000 (21:36 +0200)
committerChristian Marangi <ansuelsmth@gmail.com>
Tue, 25 Jun 2024 09:57:14 +0000 (11:57 +0200)
AC2400 Dual-Band Gigabit Wi-Fi Router base on ipq8064.
https://www.linksys.com/support-product?sku=E8350

Specification:
 - Qualcomm dual-core IPQ8064 @ 1.4 GHz
 - 512 MB of RAM
 - 4 MB of SPI NOR MX25U3235F
 - 128 MB of NAND S34MS01G2
 - Qualcomm QCA9880 2.4GHz 802.11bgn
 - Quantenna QSR1000 5GHz 802.11ac (no support)
 - 4 x 10/100/1000 Mbit/s w/ vlan support Ethernet
 - Qualcomm Atheros QCA8337 switch
 - 1 x 3.0 + 1 x 2.0 (combo with eSata port)
 - 115200, 8N1 internal serial console
 - Power, Reset, WPS and WLAN buttons
 - Power, WPS and WLAN leds
 - 12 VDC, 3 A power

Installation:
The installation must be done using web interface of the router.
To achive this new firmware-utils tool was added to set correct
magic headers for the factory images.

Installation from vendor firmware:
 1. Flash over the native Linksys WEB interface using factory image.

Installation using recovery mode:
 1. Power off the device and disconnect the WAN port.
    (Only LAN port to be connected)
 2. Press & hold the "Reset" button
 3. Power on the device & wait 10 seconds with pressed "Reset" button
 4. Set IP Internet Protocol on your PC from
    192.168.1.0/24 network (Router is on IP 192.168.1.1)
 5. Open the Firmware Recovery page in your browser:
    http://192.168.1.1/index.shtml
    Firmware Recovery -> File Name -> Recovery & Reboot

The device page in inbox:
https://openwrt.org/inbox/toh/linksys/linksys_ea8350_1

Signed-off-by: Sergey Filippov <sergey.filippov@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/15798
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
target/linux/ipq806x/base-files/etc/board.d/01_leds
target/linux/ipq806x/base-files/etc/board.d/02_network
target/linux/ipq806x/base-files/lib/upgrade/platform.sh
target/linux/ipq806x/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq8064-e8350-v1.dts [new file with mode: 0644]
target/linux/ipq806x/image/generic.mk

index 4aab3c9b2c7ca93b6198f1cc63e9601e38859090..c96d5e69c471d6b13d1ce94b274fecd5fe2d4eb0 100644 (file)
@@ -46,6 +46,9 @@ fortinet,fap-421e)
        ucidef_set_led_wlan "wlan5g" "5G" "yellow:5g" "phy0tpt"
        ucidef_set_led_usbport "usb" "USB" "amber:power" "usb1-port1" "usb2-port1"
        ;;
+linksys,e8350-v1)
+       ucidef_set_led_wlan "wlan" "WLAN" "green:wifi" "phy0tpt"
+       ;;
 meraki,mr52)
        ucidef_set_led_netdev "eth0" "eth0" "green:lan1" "eth0"
        ucidef_set_led_netdev "eth1" "eth1" "green:lan2" "eth1"
index a408fc14ac133803e7229d016727e0b6bfd421bf..77d47b8cd0d1cc53470844d034e847fe295165c0 100644 (file)
@@ -23,6 +23,7 @@ ipq806x_setup_interfaces()
        netgear,r7500 |\
        netgear,r7500v2 |\
        qcom,ipq8064-ap148 |\
+       linksys,e8350-v1 |\
        linksys,ea7500-v1 |\
        linksys,ea8500 |\
        nec,wg2600hp3 |\
@@ -87,6 +88,7 @@ ipq806x_setup_macs()
                        ucidef_set_interface_macaddr "lan" "$hw_mac_addr"
                        ucidef_set_interface_macaddr "wan" "$hw_mac_addr"
                ;;
+               linksys,e8350-v1 |\
                zyxel,nbg6817)
                        hw_mac_addr=$(mtd_get_mac_ascii 0:appsblenv ethaddr)
                        ucidef_set_interface_macaddr "lan" "$(macaddr_add $hw_mac_addr 2)"
index b3a615a511b6bb0ad1f7bdc4ed34cb66c14f6a3e..f26f118d548077c7d2192fee29f1b8ebd453b854 100644 (file)
@@ -14,6 +14,7 @@ platform_do_upgrade() {
        askey,rt4230w-rev6 |\
        compex,wpq864|\
        fortinet,fap-421e|\
+       linksys,e8350-v1|\
        netgear,d7800 |\
        netgear,r7500 |\
        netgear,r7500v2 |\
diff --git a/target/linux/ipq806x/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq8064-e8350-v1.dts b/target/linux/ipq806x/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq8064-e8350-v1.dts
new file mode 100644 (file)
index 0000000..2bd34c3
--- /dev/null
@@ -0,0 +1,428 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT\r
+#include "qcom-ipq8064-v2.0-smb208.dtsi"\r
+\r
+#include <dt-bindings/input/input.h>\r
+#include <dt-bindings/soc/qcom,tcsr.h>\r
+\r
+/ {\r
+       model = "Linksys E8350 V1 WiFi Router";\r
+       compatible = "linksys,e8350-v1", "qcom,ipq8064";\r
+       \r
+       memory@0 {\r
+               reg = <0x42000000 0x1e000000>;\r
+               device_type = "memory";\r
+       };\r
+       \r
+       aliases {\r
+               serial0 = &gsbi4_serial;\r
+               \r
+               led-boot = &led_power;\r
+               led-failsafe = &led_power;\r
+               led-running = &led_power;\r
+               led-upgrade = &led_power;\r
+       };\r
+       \r
+       keys {\r
+               compatible = "gpio-keys";\r
+               pinctrl-0 = <&button_pins>;\r
+               pinctrl-names = "default";\r
+               \r
+               reset {\r
+                       label = "reset";\r
+                       gpios = <&qcom_pinmux 68 GPIO_ACTIVE_LOW>;\r
+                       linux,code = <KEY_RESTART>;\r
+                       debounce-interval = <60>;\r
+                       wakeup-source;\r
+               };\r
+               \r
+               wps {\r
+                       label = "wps";\r
+                       gpios = <&qcom_pinmux 65 GPIO_ACTIVE_LOW>;\r
+                       linux,code = <KEY_WPS_BUTTON>;\r
+                       debounce-interval = <60>;\r
+                       wakeup-source;\r
+               };\r
+               \r
+               wifi {\r
+                       label = "wifi";\r
+                       gpios = <&qcom_pinmux 67 GPIO_ACTIVE_LOW>;\r
+                       linux,code = <KEY_RFKILL>;\r
+                       debounce-interval = <60>;\r
+                       wakeup-source;\r
+               };\r
+       };\r
+       \r
+       leds {\r
+               compatible = "gpio-leds";\r
+               pinctrl-0 = <&led_pins>;\r
+               pinctrl-names = "default";\r
+               \r
+               led_power: power {\r
+                       label = "green:power";\r
+                       gpios = <&qcom_pinmux 26 GPIO_ACTIVE_HIGH>;\r
+                       default-state = "keep";\r
+               };\r
+               \r
+               wps {\r
+                       label = "green:wps";\r
+                       gpios = <&qcom_pinmux 53 GPIO_ACTIVE_HIGH>;\r
+               };\r
+               \r
+               wifi {\r
+                       label = "green:wifi";\r
+                       gpios = <&qcom_pinmux 54 GPIO_ACTIVE_HIGH>;\r
+               };\r
+       };\r
+};\r
+\r
+&nand {\r
+       status = "okay";\r
+\r
+       #address-cells = <1>;\r
+       #size-cells = <1>;\r
+       \r
+       nand@0 {\r
+               reg = <0>;\r
+               \r
+               nand-ecc-strength = <4>;\r
+               nand-bus-width = <8>;\r
+               \r
+               partitions {\r
+                       compatible = "fixed-partitions";\r
+                       \r
+                       partition@0 {\r
+                               label = "ubi";\r
+                               reg = <0 0x4000000>;\r
+                       };\r
+                       partition@4000000 {\r
+                               label = "extra";\r
+                               reg = <0x4000000 0x4000000>;\r
+                       };\r
+               };\r
+       };\r
+};\r
+\r
+&qcom_pinmux {\r
+       button_pins: button_pins {\r
+               mux {\r
+                       pins = "gpio68","gpio65", "gpio67";\r
+                       function = "gpio";\r
+                       drive-strength = <2>;\r
+                       bias-pull-up;\r
+               };\r
+       };\r
+       \r
+       led_pins: led_pins {\r
+               mux {\r
+                       pins = "gpio26","gpio53", "gpio54";\r
+                       function = "gpio";\r
+                       drive-strength = <2>;\r
+                       bias-pull-up;\r
+               };\r
+       };\r
+       \r
+       switch_reset: switch_reset_pins {\r
+               mux {\r
+                       pins = "gpio63";\r
+                       function = "gpio";\r
+                       drive-strength = <12>;\r
+                       bias-pull-up;\r
+               };\r
+       };\r
+};\r
+\r
+&gsbi5 {\r
+       qcom,mode = <GSBI_PROT_SPI>;\r
+       status = "okay";\r
+       \r
+       spi5: spi@1a280000 {\r
+               status = "okay";\r
+               \r
+               pinctrl-0 = <&spi_pins>;\r
+               pinctrl-names = "default";\r
+               \r
+               cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>;\r
+               \r
+               m25p80@0 {\r
+                       compatible = "jedec,spi-nor";\r
+                       spi-max-frequency = <51200000>;\r
+                       reg = <0>;\r
+                       \r
+                       partitions {\r
+                               compatible = "fixed-partitions";\r
+                               #address-cells = <1>;\r
+                               #size-cells = <1>;\r
+                               \r
+                               partition@0 {\r
+                                       label = "0:sbl1";\r
+                                       reg = <0x0000000 0x0010000>;\r
+                                       read-only;\r
+                               };\r
+                               \r
+                               partition@10000 {\r
+                                       label = "0:mibib";\r
+                                       reg = <0x0010000 0x0020000>;\r
+                                       read-only;\r
+                               };\r
+                               \r
+                               partition@30000 {\r
+                                       label = "0:sbl2";\r
+                                       reg = <0x0030000 0x0020000>;\r
+                                       read-only;\r
+                               };\r
+                               \r
+                               partition@50000 {\r
+                                       label = "0:sbl3";\r
+                                       reg = <0x0050000 0x0030000>;\r
+                                       read-only;\r
+                               };\r
+                               \r
+                               partition@80000 {\r
+                                       label = "0:ddrconfig";\r
+                                       reg = <0x0080000 0x0010000>;\r
+                                       read-only;\r
+                               };\r
+                               \r
+                               partition@90000 {\r
+                                       label = "0:ssd";\r
+                                       reg = <0x0090000 0x0010000>;\r
+                                       read-only;\r
+                               };\r
+                               \r
+                               partition@a0000 {\r
+                                       label = "0:tz";\r
+                                       reg = <0x00a0000 0x0030000>;\r
+                                       read-only;\r
+                               };\r
+                               \r
+                               partition@d0000 {\r
+                                       label = "0:rpm";\r
+                                       reg = <0x00d0000 0x0020000>;\r
+                                       read-only;\r
+                               };\r
+                               \r
+                               partition@f0000 {\r
+                                       label = "0:oldappsbl";\r
+                                       reg = <0x00f0000 0x0040000>;\r
+                                       read-only;\r
+                               };\r
+                               \r
+                               partition@130000 {\r
+                                       label = "0:appsblenv";\r
+                                       reg = <0x0130000 0x0040000>;\r
+                                       read-only;\r
+                               };\r
+                               \r
+                               art: partition@170000 {\r
+                                       label = "0:ART";\r
+                                       reg = <0x0170000 0x0020000>;\r
+                                       read-only;\r
+                               };\r
+                               \r
+                               partition@190000 {\r
+                                       label = "0:uboot";\r
+                                       reg = <0x0190000 0x0050000>;\r
+                                       read-only;\r
+                               };\r
+                               \r
+                               partition@1e0000 {\r
+                                       label = "0:oldnss1";\r
+                                       reg = <0x01e0000 0x0020000>;\r
+                                       read-only;\r
+                               };\r
+                               \r
+                               partition@200000 {\r
+                                       label = "0:nvram";\r
+                                       reg = <0x0200000 0x0020000>;\r
+                                       read-only;\r
+                               };\r
+                               \r
+                               partition@220000 {\r
+                                       label = "0:oldkernel";\r
+                                       reg = <0x0220000 0x01e0000>;\r
+                                       read-only;\r
+                               };\r
+                       };\r
+               };\r
+       };\r
+};\r
+\r
+&hs_phy_0 {\r
+       status = "okay";\r
+};\r
+\r
+&ss_phy_0 {\r
+       status = "okay";\r
+};\r
+\r
+&usb3_0 {\r
+       status = "okay";\r
+};\r
+\r
+&hs_phy_1 {\r
+       status = "okay";\r
+};\r
+\r
+&ss_phy_1 {\r
+       status = "okay";\r
+};\r
+\r
+&usb3_1 {\r
+       status = "okay";\r
+};\r
+\r
+&pcie0 {\r
+       status = "okay";\r
+       \r
+       max-link-speed = <1>;\r
+};\r
+\r
+&pcie1 {\r
+       status = "okay";\r
+};\r
+\r
+&mdio0 {\r
+       status = "okay";\r
+       \r
+       pinctrl-0 = <&mdio0_pins>;\r
+       pinctrl-names = "default";\r
+       \r
+       /* Switch from documentation require at least 12ms for reset */\r
+       reset-gpios = <&qcom_pinmux 63 GPIO_ACTIVE_HIGH>;\r
+       reset-post-delay-us = <12000>;\r
+       \r
+       switch@10 {\r
+               compatible = "qca,qca8337";\r
+               #address-cells = <1>;\r
+               #size-cells = <0>;\r
+               reg = <0x10>;\r
+               \r
+               ports {\r
+                       #address-cells = <1>;\r
+                       #size-cells = <0>;\r
+                       \r
+                       port@0 {\r
+                               reg = <0>;\r
+                               label = "cpu";\r
+                               ethernet = <&gmac1>;\r
+                               phy-mode = "rgmii";\r
+                               tx-internal-delay-ps = <1000>;\r
+                               rx-internal-delay-ps = <1000>;\r
+                               \r
+                               fixed-link {\r
+                                       speed = <1000>;\r
+                                       full-duplex;\r
+                               };\r
+                       };\r
+                       \r
+                       port@1 {\r
+                               reg = <1>;\r
+                               label = "lan1";\r
+                               phy-mode = "internal";\r
+                               phy-handle = <&phy_port1>;\r
+                       };\r
+                       \r
+                       port@2 {\r
+                               reg = <2>;\r
+                               label = "lan2";\r
+                               phy-mode = "internal";\r
+                               phy-handle = <&phy_port2>;\r
+                       };\r
+                       \r
+                       port@3 {\r
+                               reg = <3>;\r
+                               label = "lan3";\r
+                               phy-mode = "internal";\r
+                               phy-handle = <&phy_port3>;\r
+                       };\r
+                       \r
+                       port@4 {\r
+                               reg = <4>;\r
+                               label = "lan4";\r
+                               phy-mode = "internal";\r
+                               phy-handle = <&phy_port4>;\r
+                       };\r
+                       \r
+                       port@5 {\r
+                               reg = <5>;\r
+                               label = "wan";\r
+                               phy-mode = "internal";\r
+                               phy-handle = <&phy_port5>;\r
+                       };\r
+                       \r
+                       port@6 {\r
+                               reg = <6>;\r
+                               label = "cpu";\r
+                               ethernet = <&gmac2>;\r
+                               phy-mode = "sgmii";\r
+                               qca,sgmii-enable-pll;\r
+                               \r
+                               fixed-link {\r
+                                       speed = <1000>;\r
+                                       full-duplex;\r
+                               };\r
+                       };\r
+               };\r
+               \r
+               mdio {\r
+                       #address-cells = <1>;\r
+                       #size-cells = <0>;\r
+                       \r
+                       phy_port1: phy@0 {\r
+                               reg = <0>;\r
+                       };\r
+                       \r
+                       phy_port2: phy@1 {\r
+                               reg = <1>;\r
+                       };\r
+                       \r
+                       phy_port3: phy@2 {\r
+                               reg = <2>;\r
+                       };\r
+                       \r
+                       phy_port4: phy@3 {\r
+                               reg = <3>;\r
+                       };\r
+                       \r
+                       phy_port5: phy@4 {\r
+                               reg = <4>;\r
+                       };\r
+               };\r
+       };\r
+};\r
+\r
+&gmac1 {\r
+       status = "okay";\r
+       \r
+       phy-mode = "rgmii";\r
+       qcom,id = <1>;\r
+       \r
+       pinctrl-0 = <&rgmii2_pins>;\r
+       pinctrl-names = "default";\r
+       \r
+       fixed-link {\r
+               speed = <1000>;\r
+               full-duplex;\r
+       };\r
+};\r
+\r
+&gmac2 {\r
+       status = "okay";\r
+       \r
+       phy-mode = "sgmii";\r
+       qcom,id = <2>;\r
+       \r
+       fixed-link {\r
+               speed = <1000>;\r
+               full-duplex;\r
+       };\r
+};\r
+\r
+&tcsr {\r
+       qcom,usb-ctrl-select = <TCSR_USB_SELECT_USB3_DUAL>;\r
+       compatible = "qcom,tcsr", "syscon";\r
+};\r
+\r
+&adm_dma {\r
+       status = "okay";\r
+};\r
index 98e74e5b114c2267424be49a1ddb699f7d4af9d2..b5bf8898ab4ef1de35c228e26097991907c23d93 100644 (file)
@@ -35,6 +35,18 @@ define Build/edimax-header
        @mv $@.new $@
 endef
 
+# tune addpattern for Linksys E8350-V1 fw pattern generation
+define Build/linksys-bin
+        $(STAGING_DIR_HOST)/bin/addpattern -p $(FW_DEVICE_ID) -v $(FW_VERSION) $(if $(SERIAL),-s $(SERIAL)) -i $@ -o $@.new
+        mv $@.new $@
+endef
+
+# Use Linksys fw header generator to upgrade openwrt factory image over the native Linksys WEB interface
+define Build/linksys-addfwhdr
+        -$(STAGING_DIR_HOST)/bin/linksys-addfwhdr -i $@ -o $@.new \
+               ;mv "$@.new" "$@"
+endef
+
 define Device/DniImage
        KERNEL_SUFFIX := -uImage
        KERNEL = kernel-bin | append-dtb | uImage none
@@ -189,6 +201,23 @@ define Device/fortinet_fap-421e
 endef
 TARGET_DEVICES += fortinet_fap-421e
 
+define Device/linksys_e8350-v1
+       $(call Device/LegacyImage)
+       DEVICE_VENDOR := Linksys
+       DEVICE_MODEL := E8350
+       DEVICE_VARIANT := v1
+       SOC := qcom-ipq8064
+       FW_VERSION := v1.0.03.003
+       FW_DEVICE_ID := 8350
+       PAGESIZE := 2048
+       BLOCKSIZE := 128k
+       KERNEL_IN_UBI := 1
+       IMAGES = factory.bin sysupgrade.bin
+       IMAGE/factory.bin := append-ubi | check-size 0x04000000 | linksys-addfwhdr | linksys-bin
+       DEVICE_PACKAGES := ath10k-firmware-qca988x-ct
+endef
+TARGET_DEVICES += linksys_e8350-v1
+
 define Device/linksys_ea7500-v1
        $(call Device/LegacyImage)
        $(Device/kernel-size-migration)