From patchwork Wed May 17 17:47:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Connor Northway X-Patchwork-Id: 1782845 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=) 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=4dZk8yST; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=cnorthway.com header.i=@cnorthway.com header.a=rsa-sha256 header.s=gm1 header.b=RLSmHKNT; dkim-atps=neutral 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 (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QM0yK1b93z20KF for ; Thu, 18 May 2023 03:50:48 +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=aAUAea6yNs5gjkAdUU7eDrvBDdVwQi2pTRC7iNi8spk=; b=4dZk8ySTovRoJb rqUeUTVG8uxKTmhA7vyQwa28RzZehNqi5ZCM5MiAkkWH8imtyyB8kXArJs7lvMwMqDN/Pj4zFFqE1 1ImyFzD1SMVgSK/nlZLj9g6He1F6ewDfRG7QMzcoQ1m4CN3aXb+zn5VakknYWm/PTGB1u2+LaOsDI B9AsWHWyxFu8wLgLtwX7RB3LL0daXK1flJGehQwIhTXPqrkTvRji2NJLKMGfsqq9eygoct3kc0D/z ov0xogi6/XtcHwa3y1Dd6j4wh02RQU7VxmsRza9ZkydDIVj2I2fYGJyini4eC23mtP/La12WO5Mz9 fNHR8+NWW6oUo7YvlC2g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pzLGL-00Ae3W-0o; Wed, 17 May 2023 17:48:33 +0000 Received: from relay2-d.mail.gandi.net ([2001:4b98:dc4:8::222]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pzLGH-00Ae2a-2C for openwrt-devel@lists.openwrt.org; Wed, 17 May 2023 17:48:31 +0000 Received: (Authenticated sender: mail@cnorthway.com) by mail.gandi.net (Postfix) with ESMTPSA id 0203540007; Wed, 17 May 2023 17:48:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cnorthway.com; s=gm1; t=1684345702; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=b8Dl0kD476bWTMXZ3ECUo+6xgEG7XY198q2Iflh3iGo=; b=RLSmHKNToGsauyLnliS0xgrR0chjg0fAhf86x1kTJ38789f8J7NPFomN6kshxTBabvk2qX eS6LsavIHccEsQjPZzX4pnNu7IByM96jsdFirX9Ipd6QNnMMqvzr/k0dl2kraW1iD7oFT/ L1jW4kp8p/ubHpuPfFY49RZQFsaKm1AVvdpPQmaxvHTApoSlQvyRtsaIh39qoso6ocLNF5 JXaDTMCUnAbIO6smEU8n7ZxBYElewejCmZLu5Sae1lRzHYzw9NS89y0titi+LoeFLaCOu/ EdzSKkolBw3pXCh+boreDtPIKEzESbzSWnCzdEAtn6vU4xDwb2VHEx+QxS+jhA== From: Connor Northway To: openwrt-devel@lists.openwrt.org Cc: Connor Northway Subject: [PATCH 1/2] ipq-wifi: bump to latest git HEAD Date: Wed, 17 May 2023 13:47:00 -0400 Message-Id: <20230517174700.21083-1-contact@cnorthway.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230517_104830_293427_A28961D7 X-CRM114-Status: UNSURE ( 6.43 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.9 (/) 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: c888dd0 qca-wireless: ipq40xx: Add BDFs for Eero Cento Signed-off-by: Connor Northway --- package/firmware/ipq-wifi/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) Content analysis details: (-0.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [2001:4b98:dc4:8:0:0:0:222 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from 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 c888dd0 qca-wireless: ipq40xx: Add BDFs for Eero Cento Signed-off-by: Connor Northway --- package/firmware/ipq-wifi/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index 396a4c50b5..aeb690e913 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -6,9 +6,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware/qca-wireless.git -PKG_SOURCE_DATE:=2023-04-12 -PKG_SOURCE_VERSION:=b22487d729362feaff7d06354353d005a3a9d6b7 -PKG_MIRROR_HASH:=94eea9db636b2cbf6782ec17d8b8fe36770c61ff283702ec418df1a1b09f54ef +PKG_SOURCE_DATE:=2023-05-15 +PKG_SOURCE_VERSION:=c888dd02bd87988912963ff2d7bae39641bd5b8c +PKG_MIRROR_HASH:=98e705a40f2f982688be07a6e205cc1425c62fe9e013c53afe9094b5f855050f PKG_FLAGS:=nonshared From patchwork Wed May 17 17:47:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Connor Northway X-Patchwork-Id: 1782846 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=) 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=d7IXWotP; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=cnorthway.com header.i=@cnorthway.com header.a=rsa-sha256 header.s=gm1 header.b=IekK8CYg; dkim-atps=neutral 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 (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QM0yL4D6cz20dq for ; Thu, 18 May 2023 03:50: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:References:In-Reply-To: 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: List-Owner; bh=nUD3kkIdnq79QCOJRB62tC6Tu1UbF+QEMyfNZOp0yl8=; b=d7IXWotPPMjFGQ sFlcp4yYk2rJV+v0mp2VZr4brKGigNMwzJanMtLQhId2d0TW6mLgMrd6aUDwmM21sc+rs9DzsfK8m xKKzP5i5UtmhFi0ux7FJXenDBt0FO5BkOQBn+fdJjrk1FLHC025SaJtsB6Nmt0JeebKLNOUout+be wOJE+OHGnY80SibgabSARw53CDdzcLkp6s1XLEUz7YuZZ0MzlgeJaaSbglfsUag27LZr6tSu+HPW9 oeD9x7BVEnRubjjnocclYikGfN0w78lg+kAfey4T0XeoEhShAdW510un/UfMWcFqVVZwK5faNjgj2 tSoNQPsp4DO7V9oABJ2Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pzLGk-00Ae5t-0B; Wed, 17 May 2023 17:48:58 +0000 Received: from relay2-d.mail.gandi.net ([217.70.183.194]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pzLGf-00Ae4y-1q for openwrt-devel@lists.openwrt.org; Wed, 17 May 2023 17:48:56 +0000 Received: (Authenticated sender: mail@cnorthway.com) by mail.gandi.net (Postfix) with ESMTPSA id 9480740002; Wed, 17 May 2023 17:48:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cnorthway.com; s=gm1; t=1684345729; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EkZDnyeXkI1IgIZTbVI7JCxCA0vOX0XrIVUTVfLHzFc=; b=IekK8CYgq3Y30aNPn5fV6ygHglpTdDkbec38CC9qW7GrclrwJuIW0pcXhyX77QGFph3s4A SERbFElvfa6k7pu0gAmNwfKMmsQESp2GBRJL87Fn8/tCkk53O79vf7NGG8Db4fGg7Dh454 seiE8C3xykstHNxPnQ7OusaLjJcpKQBfRtsb8uJFI7gNZLQyzBvJSbODZyvgOVsbxvWBvI rI7E7a6tPOXzCbruuu7gmyZr3xXEjIfU1wCNZy5WLDBwMYthE9E5I6t8o1nLQksJOvxXer mLY5Kgh6wcAHFtlR7fx+H8VPE16i5W58PsWxQYb8UTTAJVid8LEHy2BGzrQHQw== From: Connor Northway To: openwrt-devel@lists.openwrt.org Cc: Connor Northway Subject: [PATCH 2/2] ipq40xx: add support for eero Cento (J010001) Date: Wed, 17 May 2023 13:47:02 -0400 Message-Id: <20230517174700.21083-2-contact@cnorthway.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230517174700.21083-1-contact@cnorthway.com> References: <20230517174700.21083-1-contact@cnorthway.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230517_104853_877861_19BCD530 X-CRM114-Status: GOOD ( 27.54 ) X-Spam-Score: 0.8 (/) 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: development/internal name: Cento public name: eero (2nd-gen) model number: J010001 Hardware Info: SoC : Qualcomm IPQ4019 RAM : 512 MB (Hynix NT5CC256M16ER-EK) SPI Flash : 8 MB (Winbond W25Q64JVSS) eMMC Flash : 4 GB (Kingston EMMC04G-M627) Wi-Fi : 2.4 Ghz 2x2 802.11n (IPQ4019) Wi-Fi : 5 Ghz 2x2 80 [...] Content analysis details: (0.8 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.7 URIBL_BLACK Contains an URL listed in the URIBL blacklist [URIs: system.sh] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [217.70.183.194 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [217.70.183.194 listed in wl.mailspike.net] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 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 development/internal name: Cento public name: eero (2nd-gen) model number: J010001 Hardware Info: SoC : Qualcomm IPQ4019 RAM : 512 MB (Hynix NT5CC256M16ER-EK) SPI Flash : 8 MB (Winbond W25Q64JVSS) eMMC Flash : 4 GB (Kingston EMMC04G-M627) Wi-Fi : 2.4 Ghz 2x2 802.11n (IPQ4019) Wi-Fi : 5 Ghz 2x2 802.11ac (IPQ4019) Ethernet : 2x 10/100/1000 Bluetooth : 5.0 / BLE (Cypress CYW20704) RGBW LED Controller : Texas Instruments LP5562 Buttons : 1x Reset (bottom of device) UART & SPI header : see below Power & USB 2 : USB Type-C, requires 15W 5V/3A Stock Firmware Layout: The SPI flash stores U-Boot, U-Boot environment, hardware calibration, and eero-specific information (keys, serial number, MAC address, etc). The eMMC is partitioned into an A/B layout with two sets of an ext2 kernel and ext4 rootfs partition, plus one cache partition. MAC Address assignment: One base MAC address is stored in SPI flash, with a space of 32 allocated. We follow stock layout, though stock FW also uses higher addresses for routing / mesh applications. Base / WAN : 48:dd:0c:**:**:xx LAN : 48:dd:0c:**:**:xx + 1 Bluetooth : 48:dd:0c:**:**:xx + 2 Wi-Fi 1 : 48:dd:0c:**:**:xx + 3 Wi-Fi 2 : 48:dd:0c:**:**:xx + 4 Other OpenWrt details: RGBW LED has been configured to the following: Red: Failsafe Green: Running Blue: Upgrade White: Boot Ethernet ports are not labeled. Default config when viewed from back: right port is WAN, left port is LAN. UART/SPI Header: 2x5 1.27mm unpopulated SMT header labeled "J2". Silkscreen dot marks pin 1; pins 2, 9, and 10 labeled with number. Layout: SPI cpu bypass --| 1 2 |-- SPI /CS SPI CLK --| 3 4 |-- SPI DI SPI DO --| 5 6 |-- GND ???? --| 7 8 |-- 3v3 UART RX --| 9 10 |-- UART TX To access the SPI flash chip, pull pin 1 high (connect to 3v3) before applying power through USB. This will disconnect the SPI lines from the CPU and allow accessing the SPI bus without contention. As always, do not connect external power to 3v3! UART settings: 115200 8n1 Logic levels for UART and SPI are 3.3V. OpenWrt Installation: Unfortunately, eero has configured U-Boot to autoboot with no delay and no way to abort boot. There does not appear to be any available method to boot from an external source without modifications. To change the bootdelay variable, editing the SPI flash contents directly is required: - Use an SPI programmer to make a backup of the flash - Locate the APPSBLENV partition and modify the environment to have a non-zero bootdelay value in both locations - Update the leading CRC32 checksums - Flash image back to the device and reboot Details of environment layout: APPSBLENV is at 0x210000. It contains two redundant copies of the following struct, each 0x10000 bytes long. struct env { uint32_t crc; // calculated only over data[] unsigned char flags; unsigned char data[0x10000-5]; }; Once access to the U-Boot shell is achieved: Use TFTP to load the initramfs image to memory: `tftpboot .itb` with a TFTP server at 192.168.1.1 or use USB: `fatload usb 0x84000000 .itb` with FAT32 USB drive connected through a powered hub (use `usb part` to view partitions) clear the bootargs variable: `setenv bootargs` then boot: `bootm` Make backups of SPI and eMMC flash! Use SSH/SCP to transfer the sysupgrade file and run sysupgrade. The upgrade script will determine which of the two dual-partition slots the device is currently booting from. It will install to the inactive slot if installing over stock FW, or the current slot if upgrading OpenWrt. This leaves the most recent stock FW untouched for easier restoration to stock. Don't rely on this as a backup! Restore Stock Firmware: If installed using sysupgrade and one stock partition set remains, replace the U-Boot environment variables `bootargs` and `bootcmd` with the contents of the `*_eero_backup` versions automatically created during install. Stock firmware should overwrite OpenWrt the next time it receives an update. Signed-off-by: Connor Northway --- package/boot/uboot-envtools/files/ipq40xx | 4 + package/firmware/ipq-wifi/Makefile | 2 + .../ipq40xx/base-files/etc/board.d/02_network | 5 + .../etc/hotplug.d/firmware/11-ath10k-caldata | 8 + .../etc/hotplug.d/usb/20-bluetooth-mac | 21 + .../ipq40xx/base-files/lib/upgrade/eero.sh | 94 +++++ .../base-files/lib/upgrade/platform.sh | 3 + .../arch/arm/boot/dts/qcom-ipq4019-cento.dts | 393 ++++++++++++++++++ target/linux/ipq40xx/image/generic.mk | 13 + 9 files changed, 543 insertions(+) create mode 100644 target/linux/ipq40xx/base-files/etc/hotplug.d/usb/20-bluetooth-mac create mode 100644 target/linux/ipq40xx/base-files/lib/upgrade/eero.sh create mode 100644 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-cento.dts diff --git a/package/boot/uboot-envtools/files/ipq40xx b/package/boot/uboot-envtools/files/ipq40xx index 8d993fae36..e8431048eb 100644 --- a/package/boot/uboot-envtools/files/ipq40xx +++ b/package/boot/uboot-envtools/files/ipq40xx @@ -56,6 +56,10 @@ aruba,ap-365) buffalo,wtr-m2133hp) ubootenv_add_uci_config "/dev/mtd8" "0x0" "0x40000" "0x20000" ;; +eero,cento) + ubootenv_add_uci_config "/dev/mtd9" "0x0" "0x10000" "0x10000" + ubootenv_add_uci_config "/dev/mtd9" "0x10000" "0x10000" "0x10000" + ;; linksys,ea6350v3) ubootenv_add_uci_config "/dev/mtd7" "0x0" "0x20000" "0x20000" ;; diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index aeb690e913..f2e670e65c 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -38,6 +38,7 @@ ALLWIFIBOARDS:= \ edgecore_ecw5410 \ edgecore_oap100 \ edimax_cax1800 \ + eero_cento\ extreme-networks_ws-ap3915i \ glinet_gl-a1300 \ glinet_gl-ap1300 \ @@ -143,6 +144,7 @@ $(eval $(call generate-ipq-wifi-package,edgecore_eap102,Edgecore EAP102)) $(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,eero_cento,Eero Cento)) $(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/target/linux/ipq40xx/base-files/etc/board.d/02_network b/target/linux/ipq40xx/base-files/etc/board.d/02_network index cb318d36a3..e5bd04a56e 100644 --- a/target/linux/ipq40xx/base-files/etc/board.d/02_network +++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network @@ -32,6 +32,7 @@ ipq40xx_setup_interfaces() asus,map-ac2200|\ cilab,meshpoint-one|\ edgecore,ecw5211|\ + eero,cento|\ glinet,gl-ap1300|\ glinet,gl-b2200|\ google,wifi|\ @@ -159,6 +160,10 @@ ipq40xx_setup_macs() lan_mac=$(mtd_get_mac_ascii bdcfg lanmac) label_mac=$lan_mac ;; + eero,cento) + wan_mac=$(mtd_get_mac_ascii 0:IDENTITY mac) + lan_mac=$(macaddr_add "$(mtd_get_mac_ascii 0:IDENTITY mac)" 1) + ;; engenius,eap2200|\ engenius,emd1) lan_mac=$(mtd_get_mac_ascii 0:APPSBLENV ethaddr) diff --git a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 7f41bdcfcc..4b6072f0fe 100644 --- a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -83,6 +83,10 @@ case "$FIRMWARE" in caldata_extract "ART" 0x1000 0x2f20 ath10k_patch_mac $(mtd_get_mac_ascii bdcfg wlanmac) ;; + eero,cento) + caldata_extract "0:ART" 0x1000 0x2f20 + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:IDENTITY mac) 3) + ;; engenius,emd1) caldata_extract "0:ART" 0x1000 0x2f20 ath10k_patch_mac $(mtd_get_mac_ascii 0:APPSBLENV wlanaddr) @@ -178,6 +182,10 @@ case "$FIRMWARE" in caldata_extract "ART" 0x5000 0x2f20 ath10k_patch_mac $(mtd_get_mac_ascii bdcfg wlanmac_a) ;; + eero,cento) + caldata_extract "0:ART" 0x5000 0x2f20 + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:IDENTITY mac) 4) + ;; engenius,emd1) caldata_extract "0:ART" 0x5000 0x2f20 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:APPSBLENV wlanaddr) 1) diff --git a/target/linux/ipq40xx/base-files/etc/hotplug.d/usb/20-bluetooth-mac b/target/linux/ipq40xx/base-files/etc/hotplug.d/usb/20-bluetooth-mac new file mode 100644 index 0000000000..eada210214 --- /dev/null +++ b/target/linux/ipq40xx/base-files/etc/hotplug.d/usb/20-bluetooth-mac @@ -0,0 +1,21 @@ +. /lib/functions/system.sh + +setup_bluetooth_mac() +{ + local board=$(board_name) + + case "$board" in + eero,cento) + hciconfig hci0 up + bdaddr "$(macaddr_add "$(mtd_get_mac_ascii 0:IDENTITY mac)" 2)" + hciconfig hci0 reset + hciconfig hci0 down + ;; + esac +} + +if [ "${DRIVER}" = "btusb" ]; then + if [ "${ACTION}" = "bind" ]; then + setup_bluetooth_mac + fi +fi diff --git a/target/linux/ipq40xx/base-files/lib/upgrade/eero.sh b/target/linux/ipq40xx/base-files/lib/upgrade/eero.sh new file mode 100644 index 0000000000..c27c4bfad7 --- /dev/null +++ b/target/linux/ipq40xx/base-files/lib/upgrade/eero.sh @@ -0,0 +1,94 @@ +# Flashes upgrade package using eero's A/B partition scheme +# will leave most recent eero installation alone as a backup +platform_do_upgrade_eero_cento() { + local tar_file="$1" + + local current_bootcmd + local current_bootargs + current_bootcmd=$(fw_printenv -n bootcmd) + current_bootargs=$(fw_printenv -n bootargs) + local first_install + first_install=$(echo "$current_bootcmd" | grep -c "eero_kernel") + if [ $first_install -eq 1 ]; then + echo "first installation! backing up important stock env variables" + fw_setenv -s - <<-EOF + bootcmd_eero_backup $current_bootcmd + bootargs_eero_backup $current_bootargs + EOF + fi + +### +# Determine partitions +### + local current_bootpart + local current_rootpart + current_bootpart=$(echo "$current_bootcmd" | sed -nr 's/.*ext2load mmc 0:([[:digit:]]).*/\1/p') + current_rootpart=$(echo "$current_bootargs" | sed -nr 's/.*root=\/dev\/mmcblk0p([[:digit:]]).*/\1/p') + + # validate that they're sane; determine inactive partitions + if [ "$current_bootpart" -eq 1 ] && [ "$current_rootpart" -eq 3 ]; then + local inactive_bootpart=2 + local inactive_rootpart=4 + echo "currently booting from slot A" + elif [ "$current_bootpart" -eq 2 ] && [ "$current_rootpart" -eq 4 ]; then + local inactive_bootpart=1 + local inactive_rootpart=3 + echo "currently booting from slot B" + else + echo "invalid boot or root partitions" + return 1 + fi + + # on the first install, we want to install to the inactive slot + # (easier to recover to known-good, configured stock OS). + # on subsequent installs, continue using the active slot to keep + # the stock install intact. + if $first_install; then + local install_bootpart=$inactive_bootpart + local install_rootpart=$inactive_rootpart + echo "installing to inactive slot;" + else + local install_bootpart=$current_bootpart + local install_rootpart=$current_rootpart + echo "installing to currently booted slot;" + fi + echo "boot: $install_bootpart" + echo "root: $install_rootpart" + +### +# Install kernel to ext2 part +### + local board_dir=$(tar tf $tar_file | grep -m 1 '^sysupgrade-.*/$') + board_dir=${board_dir%/} + + # mount boot partition + mkdir /mnt/bootpart && + mount -t ext2 /dev/mmcblk0p"$install_bootpart" /mnt/bootpart || + { echo "unable to mount boot partition" && return 1 ; } + + # clean it out and install new kernel image + rm -r /mnt/bootpart/* && + mkdir /mnt/bootpart/lost+found && + tar Oxf $tar_file ${board_dir}/kernel > /mnt/bootpart/kernel.itb || + { echo "unable to install kernel image" && return 1 ; } + + echo "installed kernel image to /dev/mmcblk0p$install_bootpart" + +### +# Install rootfs using emmc_do_upgrade +### + EMMC_ROOT_DEV=/dev/mmcblk0p"$install_rootpart" + emmc_do_upgrade $tar_file + + echo "done with emmc_do_upgrade, rootfs should be installed" + +### +# Finalize env vars +### + fw_setenv -s - <<-EOF + bootcmd ext2load mmc 0:$install_bootpart 0x84000000 kernel.itb && bootm; reset + bootargs root=/dev/mmcblk0p$install_rootpart rootwait + EOF + + echo "new boot cmd/args set, install complete!" +} diff --git a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh index 988921fa8c..74f425861b 100644 --- a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh @@ -156,6 +156,9 @@ platform_do_upgrade() { compex,wpj419) nand_do_upgrade "$1" ;; + eero,cento) + platform_do_upgrade_eero_cento "$1" + ;; google,wifi) export_bootdevice export_partdevice CI_ROOTDEV 0 diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-cento.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-cento.dts new file mode 100644 index 0000000000..5c646de918 --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-cento.dts @@ -0,0 +1,393 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qcom-ipq4019.dtsi" +#include +#include +#include +#include + +/ { + model = "Eero Cento (J010001)"; + compatible = "eero,cento"; + + chosen { + stdout-path = &blsp1_uart1; + }; + + aliases { + led-boot = &led_status_white; + led-failsafe = &led_status_red; + led-running = &led_status_green; + led-upgrade = &led_status_blue; + }; + + memory { + device_type = "memory"; + reg = <0x80000000 0x20000000>; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&tlmm 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + tcsr@1949000 { + compatible = "qcom,tcsr"; + reg = <0x1949000 0x100>; + qcom,wifi_glb_cfg = ; + }; + + tcsr@194b000 { + compatible = "qcom,tcsr"; + reg = <0x194b000 0x100>; + qcom,usb-hsphy-mode-select = ; + }; + + ess_tcsr@1953000 { + compatible = "qcom,tcsr"; + reg = <0x1953000 0x1000>; + qcom,ess-interface-select = ; + }; + + tcsr@1957000 { + compatible = "qcom,tcsr"; + reg = <0x1957000 0x100>; + qcom,wifi_noc_memtype_m0_m2 = ; + }; + +}; + +&tlmm { + serial_0_pins: serial0_pinmux { + mux { + pins = "gpio16", "gpio17"; + function = "blsp_uart0"; + bias-disable; + }; + }; + + spi_0_pins: spi_0_pinmux { + pinmux { + function = "blsp_spi0"; + pins = "gpio13", "gpio14", "gpio15"; + }; + + pinmux_cs { + function = "gpio"; + pins = "gpio12"; + }; + + pinconf { + pins = "gpio13", "gpio14", "gpio15"; + bias-disable; + }; + + pinconf_cs { + pins = "gpio12"; + bias-disable; + output-high; + }; + }; + + sd_0_pins: sd_0_pinmux { + sd0 { + function = "sdio"; + pins = "gpio23", "gpio24", "gpio25", "gpio26", "gpio29", + "gpio30", "gpio31", "gpio32"; + drive-strength = <4>; + bias-disable; + }; + + sdclk { + pins = "gpio27"; + function = "sdio"; + drive-strength = <4>; + bias-disable; + }; + + sdcmd { + pins = "gpio28"; + function = "sdio"; + drive-strength = <4>; + bias-disable; + }; + }; + + i2c_0_pins: i2c_0_pinmux { + mux { + pins = "gpio20", "gpio21"; + function = "blsp_i2c0"; + bias-disable; + }; + }; + + i2c_1_pins: i2c_1_pinmux { + mux { + pins = "gpio34", "gpio35"; + function = "blsp_i2c1"; + bias-disable; + }; + }; + + // cypress cyw20704 connected over usb + bluetooth-enable { + gpio-hog; + gpios = <48 GPIO_ACTIVE_HIGH>; + output-high; + }; +}; + +&usb3_ss_phy { + status = "ok"; +}; + +&usb3_hs_phy { + status = "ok"; +}; + +&usb3 { + status = "ok"; +}; + +&usb2_hs_phy { + status = "ok"; +}; + +&usb2 { + status = "ok"; +}; + +&blsp1_uart1 { + status = "ok"; + + pinctrl-0 = <&serial_0_pins>; + pinctrl-names = "default"; +}; + +&watchdog { + status = "ok"; +}; + +&prng { + status = "ok"; +}; + +&crypto { + status = "ok"; +}; + +&cryptobam { + status = "ok"; +}; + +&blsp_dma { + status = "ok"; +}; + +&blsp1_spi1 { + status = "ok"; + + pinctrl-0 = <&spi_0_pins>; + pinctrl-names = "default"; + cs-gpios = <&tlmm 12 GPIO_ACTIVE_HIGH>; + + flash@0 { + reg = <0>; + compatible = "jedec,spi-nor"; + spi-max-frequency = <24000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "0:SBL1"; + reg = <0x0 0x40000>; + read-only; + }; + + partition@40000 { + label = "0:MIBIB"; + reg = <0x40000 0x20000>; + read-only; + }; + + partition@60000 { + label = "0:QSEE"; + reg = <0x60000 0x60000>; + read-only; + }; + + partition@c0000 { + label = "0:CDT"; + reg = <0xc0000 0x10000>; + read-only; + }; + + partition@d0000 { + label = "0:DDRPARAMS"; + reg = <0xd0000 0x10000>; + read-only; + }; + + partition@e0000 { + label = "0:ART"; + reg = <0xe0000 0x10000>; + read-only; + }; + + partition@f0000 { + label = "0:APPSBL"; + reg = <0xf0000 0x100000>; + read-only; + }; + + partition@1f0000 { + label = "0:IDENTITY"; + reg = <0x1f0000 0x10000>; + read-only; + }; + + partition@200000 { + label = "0:PK"; + reg = <0x200000 0x10000>; + read-only; + }; + + partition@210000 { + label = "0:APPSBLENV"; + reg = <0x210000 0x20000>; + // r/w allowed because installation needs to modify u-boot env + }; + + partition@230000 { + label = "0:SYSVAR"; + reg = <0x230000 0x10000>; + read-only; + }; + }; + }; +}; + +&vqmmc { + status = "ok"; +}; + +&sdhci { + status = "ok"; + + pinctrl-0 = <&sd_0_pins>; + pinctrl-names = "default"; + vqmmc-supply = <&vqmmc>; + non-removable; + no-1-8-v; + #address-cells = <1>; + #size-cells = <0>; + + emmc@0 { + compatible = "mmc-card"; + reg = <0>; + }; +}; + +&blsp1_i2c3 { + status = "ok"; + + pinctrl-0 = <&i2c_0_pins>; + pinctrl-names = "default"; +}; + +&blsp1_i2c4 { + status = "ok"; + + pinctrl-0 = <&i2c_1_pins>; + pinctrl-names = "default"; + + led-controller@30 { + compatible = "ti,lp5562"; + reg = <0x30>; + clock-mode = /bits/ 8 <2>; + skip-reset; + + #address-cells = <1>; + #size-cells = <0>; + + // current limits from stock dt + + led_status_red: led@0 { + chan-name = "red:status"; + led-cur = /bits/ 8 <0xB4>; /* 18.0 mA */ + max-cur = /bits/ 8 <0xFF>; /* 25.5 mA */ + reg = <0>; + color = ; + }; + + led_status_green: led@1 { + chan-name = "green:status"; + led-cur = /bits/ 8 <0xB4>; /* 18.0 mA */ + max-cur = /bits/ 8 <0xC8>; /* 20.0 mA */ + reg = <1>; + color = ; + }; + + led_status_blue: led@2 { + chan-name = "blue:status"; + led-cur = /bits/ 8 <0xC8>; /* 20.0 mA */ + max-cur = /bits/ 8 <0xC8>; /* 20.0 mA */ + reg = <2>; + color = ; + }; + + led_status_white: led@3 { + chan-name = "white:status"; + led-cur = /bits/ 8 <0x96>; /* 15.0 mA */ + max-cur = /bits/ 8 <0x96>; /* 15.0 mA */ + reg = <3>; + color = ; + }; + }; +}; + +&gmac { + status = "ok"; +}; + +&mdio { + status = "ok"; +}; + +&switch { + status = "ok"; +}; + +&swport4 { + status = "ok"; + + label = "wan"; //arbitrary, no marking +}; + +&swport5 { + status = "ok"; + + label = "lan"; //arbitrary, no marking +}; + +&wifi0 { + status = "ok"; + + qcom,ath10k-calibration-variant = "Eero-Cento"; + qcom,coexist-support = <1>; + qcom,coexist-gpio-pin = <52>; +}; + +&wifi1 { + status = "ok"; + + qcom,ath10k-calibration-variant = "Eero-Cento"; +}; diff --git a/target/linux/ipq40xx/image/generic.mk b/target/linux/ipq40xx/image/generic.mk index adce4fe0f2..14e209fd2a 100644 --- a/target/linux/ipq40xx/image/generic.mk +++ b/target/linux/ipq40xx/image/generic.mk @@ -448,6 +448,19 @@ endef # Missing DSA Setup #TARGET_DEVICES += edgecore_oap100 +define Device/eero_cento + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := Eero + DEVICE_MODEL := Cento (J010001) + SOC := qcom-ipq4019 + DEVICE_PACKAGES := e2fsprogs kmod-fs-f2fs mkf2fs kmod-mmc kmod-fs-ext4 \ + ipq-wifi-eero_cento kmod-bluetooth bluez-libs bluez-utils + IMAGES := sysupgrade.bin + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata +endef +TARGET_DEVICES += eero_cento + define Device/engenius_eap1300 $(call Device/FitImage) DEVICE_VENDOR := EnGenius