From patchwork Sat Apr 13 14:05:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Maciej Nowak X-Patchwork-Id: 1923357 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=SorpjSi1; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=terefe.re header.i=@terefe.re header.a=rsa-sha256 header.s=default header.b=YvBjuLrw; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VGwHr52hgz1yYP for ; Sun, 14 Apr 2024 00:07:50 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=jP3CdG8UH6Ojaoia/wjPRkMnuRwT8CvFT0JgrhVHF08=; b=SorpjSi178GsOI TZu6NXF8aeEeKL8v5/rFp4hEwp4KDFZN76AcKH6snYDB9sLXf6L0ndnuTMQkGDy+8BF6L8SzMExLc 79vjF5RUA5oqzuDPXvufw/hZNxyPW0Wnmwq2i1XPQol011MvMjtiFEqM1EcI3VIRur4HWCD+/6rx+ yIwzmTTJ5PW6c6QOSI9y613zUkDSKMKNA1j/CymK+FIL0WO3h45doecw7PbjnmLC4qMpf/p8aVGL0 gVnEeM+YowHKxisTR371k44C5pPw40+29GRL9jxPfcd9w6djqE08KLoDYCq49YR3nozXDPkmy/DxC LjbmTNG4OpFX3HBFQBjw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rve0Z-00000003IRl-41wO; Sat, 13 Apr 2024 14:05:31 +0000 Received: from terefe.re ([2a04:52c0:101:a4a:0:ffff:5ff:60c8]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rve0U-00000003IQy-2I4V for openwrt-devel@lists.openwrt.org; Sat, 13 Apr 2024 14:05:28 +0000 Received: from localhost.localdomain (unknown [212.106.161.100]) by terefe.re (Postfix) with ESMTPSA id 9A73B1FFFC; Sat, 13 Apr 2024 16:05:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=terefe.re; s=default; t=1713017120; bh=wP0eVUmw9kyR1QgV3HJk9cwiD7QubJWbaQcwtsCuYgY=; h=From:To:Cc:Subject:Date:From; b=YvBjuLrws8ANz8HxeMH6Xz4jywiwfJCO5D2rSOdjV/RWvmm2eQI5Z9+JdarbteSo1 /Xilj+7NKynOEpDjCtaqeZbn4dtnaVsRHeJG3KJKy6iHNq+fkrypq6H2OxI2qiD6sK QhYsGpRhg8/5eMTBDDAaac5j9wRe9l1HdjxqhKnh7DJ6yOvrWXFPyHUxO8aLI81ZZB 7quu4e72Lb6+EJ10Ri0EVoRhpF/t4Eh+gy2MdBOriIbGXrAMzK479uY0T9t+Pnb74H zj3mQm+WTUDpNKU2/uyc+DxQHnc4vICmoo0+ZfunJXMzGtvPMCgdZ0NkiOrvXkc2y0 aROf4Ecm0y2/A== From: Tomasz Maciej Nowak To: openwrt-devel@lists.openwrt.org Cc: Tomasz Maciej Nowak Subject: [PATCH] ath79: add support for Dell SonicPoint ACe APL26-0AE Date: Sat, 13 Apr 2024 16:05:13 +0200 Message-ID: <20240413140513.114036-1-tmn505@terefe.re> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240413_070527_087418_14798989 X-CRM114-Status: GOOD ( 12.96 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Tomasz Maciej Nowak Dell/SonicWall APL26-0AE (marketed as SonicPoint ACe) is a dual band wireless access point. Specification SoC: QualcommAtheros QCA9550 RAM: 256 MB DDR2 Flash: 32 MB SPI NOR WIFI: 2.4 GHz 3T3R integrated 5 GHz 3T3R QCA9890 oversized Mini PCIe card Ethernet: 2x 10/100/1000 Mbps QCA8334 port la [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org From: Tomasz Maciej Nowak Dell/SonicWall APL26-0AE (marketed as SonicPoint ACe) is a dual band wireless access point. Specification SoC: QualcommAtheros QCA9550 RAM: 256 MB DDR2 Flash: 32 MB SPI NOR WIFI: 2.4 GHz 3T3R integrated 5 GHz 3T3R QCA9890 oversized Mini PCIe card Ethernet: 2x 10/100/1000 Mbps QCA8334 port labeled lan1 is PoE capable (802.3at) USB: 1x 2.0 LEDs: 3x GPIO controlled Buttons: 2x GPIO controlled Serial: RJ-45 port, SonicWall pinout baud: 115200, parity: none, flow control: none Before flashing, be sure to have a copy of factory firmware, in case You wish to revert to original firmware. All described procedures were done in following environment: ROM Version: SonicROM (U-Boot) 8.0.0.0-11o SafeMode Firmware Version: SonicOS 8.0.0.0-14o Firmware Version: SonicOS 9.0.1.0 In case of other versions, following installation instructions might be ineffective. Installation 1. Prepare TFTP server with OpenWrt sysupgrade image and rename that image to "sp_fw.bin". 2. Connect to one of LAN ports. 3. Connect to serial port. 4. Hold the reset button (small through hole on side of the unit), power on the device and when prompted to stop autoboot, hit any key. The held button can now be released. 5. Alter U-Boot environment with following commands: setenv bootcmd bootm 0x9F510000 saveenv 6. Adjust "ipaddr" (access point) and "serverip" (TFTP server) addresses in U-Boot environment, then run following command: run lf 7. After successful flashing, execute: boot 8. The access point will boot to OpenWrt. Wait few minutes, until the wrench LED will stop blinking, then it's ready for configuration. Known issues Initramfs image can't be bigger than specified kernel size, otherwise bootloader will throw LZMA decompressing error. Switching to lzma-loader should workaround that. This device has Winbond 25Q256FVFG and doesn't have reliable reset, which causes hang on reboot, thus broken-flash-reset needs to be added. This property addition causes dispaly of "scary" warning on each boot, take this warnig into consideration. Signed-off-by: Tomasz Maciej Nowak --- package/boot/uboot-envtools/files/ath79 | 3 + .../ath79/dts/qca9550_dell_apl26-0ae.dts | 246 ++++++++++++++++++ .../generic/base-files/etc/board.d/01_leds | 4 + .../generic/base-files/etc/board.d/02_network | 4 + target/linux/ath79/image/generic.mk | 16 ++ 5 files changed, 273 insertions(+) create mode 100644 target/linux/ath79/dts/qca9550_dell_apl26-0ae.dts diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index 567bf9824ddc..2c97e61498e9 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -117,6 +117,9 @@ buffalo,wzr-hp-g300nh-s|\ linksys,ea4500-v3) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000" ;; +dell,apl26-0ae) + ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x10000" + ;; domywifi,dw33d) ubootenv_add_uci_config "/dev/mtd4" "0x0" "0x10000" "0x10000" ;; diff --git a/target/linux/ath79/dts/qca9550_dell_apl26-0ae.dts b/target/linux/ath79/dts/qca9550_dell_apl26-0ae.dts new file mode 100644 index 000000000000..2f243e027471 --- /dev/null +++ b/target/linux/ath79/dts/qca9550_dell_apl26-0ae.dts @@ -0,0 +1,246 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include +#include +#include + +#include "qca955x.dtsi" + +/ { + model = "Dell SonicPoint ACe (APL26-0AE)"; + compatible = "dell,apl26-0ae", "qca,qca9550", "qca,qca9558"; + + aliases { + label-mac-device = ð0; + led-boot = &led_wrench; + led-failsafe = &led_wrench; + led-upgrade = &led_wrench; + }; + + keys { + compatible = "gpio-keys"; + + button-reset { + label = "reset"; + gpios = <&gpio 21 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + /* Accessible only after disassembling the casing */ + button-service { + label = "service"; + gpios = <&gpio 22 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + pinctrl-0 = <&jtag_disable_pins>; + + led-lan1-amber { + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <1>; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + led-lan1-green { + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <1>; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + + led-lan2-amber { + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <2>; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + + led-lan2-green { + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <2>; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + led-wlan2g { + color = ; + function = LED_FUNCTION_WLAN_2GHZ; + linux,default-trigger = "phy1tpt"; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + }; + + led-wlan5g { + color = ; + function = LED_FUNCTION_WLAN_5GHZ; + linux,default-trigger = "phy0tpt"; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + }; + + led_wrench: led-wrench { + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&gpio 0 GPIO_ACTIVE_LOW>; + }; + }; +}; + +ð0 { + status = "okay"; + + nvmem-cells = <&macaddr_sysinfo_50 0>; + nvmem-cell-names = "mac-address"; + phy-handle = <&phy0>; + pll-data = <0xa6000000 0x00000101 0x00001616>; +}; + +ð1 { + status = "okay"; + + nvmem-cells = <&macaddr_sysinfo_50 1>; + nvmem-cell-names = "mac-address"; + pll-data = <0x03000101 0x00000101 0x00001616>; + + fixed-link { + speed = <1000>; + full-duplex; + }; +}; + +&mdio0 { + status = "okay"; + + phy0: ethernet-phy@0 { + reg = <0>; + + qca,ar8327-initvals = < + 0x04 0x07680000 /* PORT0 PAD MODE CTRL */ + 0x0c 0x00000080 /* PORT6 PAD MODE CTRL */ + 0x10 0x40000000 /* POWER_ON_STRAP */ + 0x50 0xffb7c405 /* LED0 CTRL */ + 0x54 0xffb7c305 /* LED1 CTRL */ + 0x58 0xffb7c033 /* LED2 CTRL */ + 0x5c 0x03ffff00 /* LED3 CTRL */ + 0x7c 0x0000007e /* PORT0_STATUS */ + 0x94 0x0000007e /* PORT6_STATUS */ + >; + }; +}; + +&pcie0 { + status = "okay"; + + wifi@0,0 { + compatible = "qcom,ath10k"; + reg = <0x0000 0 0 0 0>; + + /* OEM overwrites EEPROM stored adress and so do we */ + nvmem-cells = <&macaddr_sysinfo_50 2>; + nvmem-cell-names = "mac-address"; + }; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + broken-flash-reset; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0000000 0x0080000>; + read-only; + }; + + partition@80000 { + label = "u-boot-env"; + reg = <0x0080000 0x0040000>; + }; + + partition@c0000 { + label = "sysinfo"; + reg = <0x00c0000 0x0040000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_sysinfo_50: macaddr@50 { + compatible = "mac-base"; + reg = <0x50 0x6>; + #nvmem-cell-cells = <1>; + }; + }; + }; + + partition@100000 { + label = "art"; + reg = <0x0100000 0x0010000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; + }; + }; + + partition@110000 { + label = "safemode"; + reg = <0x0110000 0x0400000>; + read-only; + }; + + partition@510000 { + label = "firmware"; + reg = <0x0510000 0x1400000>; + compatible = "denx,uimage"; + }; + + partition@1910000 { + label = "config"; + reg = <0x1910000 0x0600000>; + read-only; + }; + + partition@1f10000 { + label = "log"; + reg = <0x1f10000 0x00f0000>; + read-only; + }; + }; + }; +}; + +&usb_phy0 { + status = "okay"; +}; + +&usb0 { + status = "okay"; +}; + +&wmac { + status = "okay"; + + nvmem-cells = <&macaddr_sysinfo_50 10>, <&cal_art_1000>; + nvmem-cell-names = "mac-address", "calibration"; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/01_leds b/target/linux/ath79/generic/base-files/etc/board.d/01_leds index 297485587007..c7da56b780c6 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds @@ -227,6 +227,10 @@ compex,wpj531-16m) ucidef_set_led_rssi "sig3" "SIG3" "green:sig3" "wlan0" "65" "100" ucidef_set_led_rssi "sig4" "SIG4" "green:sig4" "wlan0" "50" "100" ;; +dell,apl26-0ae) + ucidef_set_led_switch "lan1" "LAN1" "amber:lan-1" "switch0" "0x04" + ucidef_set_led_switch "lan2" "LAN2" "amber:lan-2" "switch0" "0x08" + ;; devolo,dlan-pro-1200plus-ac|\ devolo,magic-2-wifi) ucidef_set_led_netdev "plcw" "dLAN" "white:dlan" "eth0.1" "rx" diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index 6823c333b6e3..2d2385a099ad 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -287,6 +287,10 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "1:wan" "5:lan" "6@eth0" ;; + dell,apl26-0ae) + ucidef_add_switch "switch0" \ + "0@eth0" "2:lan:1" "3:lan:2" "6@eth1" + ;; devolo,dlan-pro-1200plus-ac|\ devolo,magic-2-wifi) ucidef_add_switch "switch0" \ diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 502fdc2ed465..11e25e6afc3b 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -924,6 +924,22 @@ define Device/compex_wpj563 endef TARGET_DEVICES += compex_wpj563 +define Device/dell_apl26-0ae + SOC := qca9550 + DEVICE_VENDOR := Dell + DEVICE_MODEL := SonicPoint + DEVICE_VARIANT := ACe (APL26-0AE) + DEVICE_ALT0_VENDOR := SonicWall + DEVICE_ALT0_MODEL := SonicPoint + DEVICE_ALT0_VARIANT := ACe (APL26-0AE) + DEVICE_PACKAGES := ath10k-firmware-qca988x-ct kmod-ath10k-ct kmod-usb2 + KERNEL_SIZE := 5952k + IMAGE_SIZE := 20480k + IMAGE/sysupgrade.bin = append-kernel | pad-to $$$$(BLOCKSIZE) | \ + append-rootfs | pad-rootfs | check-size | append-metadata +endef +TARGET_DEVICES += dell_apl26-0ae + define Device/devolo_dlan-pro-1200plus-ac SOC := ar9344 DEVICE_VENDOR := devolo