From 19d7e73ecc28945581fb91cea20e1f3399f72268 Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Sat, 26 Dec 2020 20:31:23 +0100 Subject: [PATCH 01/26] ethtool: update to version 5.10 The ipkg sizes changes as follows for mips 24kc : 5.9 : ethtool_5.9-1_mips_24kc.ipk 35246 5.10 : ethtool_5.10-1_mips_24kc.ipk 35385 Signed-off-by: Hans Dedecker --- package/network/utils/ethtool/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/utils/ethtool/Makefile b/package/network/utils/ethtool/Makefile index df8d7ce119..3efc90490b 100644 --- a/package/network/utils/ethtool/Makefile +++ b/package/network/utils/ethtool/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ethtool -PKG_VERSION:=5.9 +PKG_VERSION:=5.10 PKG_RELEASE:=1 PKG_MAINTAINER:=Felix Fietkau PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/software/network/ethtool -PKG_HASH:=512932010af87bc3e09773c89baea44bca96c1da1151bbcf109fa0e055a88a6f +PKG_HASH:=817d5396a9307b4c637b435d4c558b8f5f964a1464a035ca3c0180f4cc93cfcf PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=COPYING From ccf65613daf155c78b38081dc3b8b5ca22a6f9ed Mon Sep 17 00:00:00 2001 From: Sungbo Eo Date: Fri, 25 Dec 2020 20:14:23 +0900 Subject: [PATCH 02/26] kernel: add disabled PROC_STRIPPED Otherwise the missing symbol is added to target config for every kernel config refresh. While at it, remove the disabled symbol from target configs. Fixes: 4943bc5cff47 ("kernel: only strip proc for small flash devices") Signed-off-by: Sungbo Eo --- target/linux/generic/config-5.4 | 1 + target/linux/ipq807x/config-default | 1 - target/linux/rockchip/armv8/config-5.4 | 1 - target/linux/zynq/config-5.4 | 1 - 4 files changed, 1 insertion(+), 3 deletions(-) diff --git a/target/linux/generic/config-5.4 b/target/linux/generic/config-5.4 index 8473817000..46bc731f04 100644 --- a/target/linux/generic/config-5.4 +++ b/target/linux/generic/config-5.4 @@ -4123,6 +4123,7 @@ CONFIG_PRINT_STACK_DEPTH=64 CONFIG_PROC_FS=y # CONFIG_PROC_KCORE is not set # CONFIG_PROC_PAGE_MONITOR is not set +# CONFIG_PROC_STRIPPED is not set CONFIG_PROC_SYSCTL=y # CONFIG_PROC_VMCORE_DEVICE_DUMP is not set # CONFIG_PROFILE_ALL_BRANCHES is not set diff --git a/target/linux/ipq807x/config-default b/target/linux/ipq807x/config-default index 337e660cdf..9ee84791a1 100644 --- a/target/linux/ipq807x/config-default +++ b/target/linux/ipq807x/config-default @@ -502,7 +502,6 @@ CONFIG_PREEMPT_COUNT=y CONFIG_PREEMPT_RCU=y CONFIG_PRINTK_TIME=y CONFIG_PROC_PAGE_MONITOR=y -# CONFIG_PROC_STRIPPED is not set CONFIG_PTP_1588_CLOCK=y CONFIG_PWM=y CONFIG_PWM_SYSFS=y diff --git a/target/linux/rockchip/armv8/config-5.4 b/target/linux/rockchip/armv8/config-5.4 index f11cb3e81f..763de6fa77 100644 --- a/target/linux/rockchip/armv8/config-5.4 +++ b/target/linux/rockchip/armv8/config-5.4 @@ -346,7 +346,6 @@ CONFIG_PREEMPT_RCU=y CONFIG_PRINTK_TIME=y # CONFIG_PRINT_QUOTA_WARNING is not set CONFIG_PROC_PAGE_MONITOR=y -# CONFIG_PROC_STRIPPED is not set CONFIG_PROC_VMCORE=y CONFIG_PWM=y CONFIG_PWM_ROCKCHIP=y diff --git a/target/linux/zynq/config-5.4 b/target/linux/zynq/config-5.4 index 04fde2add2..8d702a83b9 100644 --- a/target/linux/zynq/config-5.4 +++ b/target/linux/zynq/config-5.4 @@ -514,7 +514,6 @@ CONFIG_POWER_RESET_VEXPRESS=y CONFIG_POWER_SUPPLY=y CONFIG_PPS=y CONFIG_PROC_EVENTS=y -# CONFIG_PROC_STRIPPED is not set CONFIG_PTP_1588_CLOCK=y CONFIG_R8169=y CONFIG_RAS=y From 1fb40a72da115073b55ed1b92b443c1b80794c44 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Sun, 20 Dec 2020 01:03:36 +0100 Subject: [PATCH 03/26] treewide: use more descriptive names for concatenated partitions A few devices in ath79 and ramips use mtd-concat to concatenate individual partitions into a bigger "firmware" or "ubi" partition. However, the original partitions are still present and visible, and one can write to them directly although this might break the actual virtual, concatenated partition. As we cannot do much about the former, let's at least choose more descriptive names than just "firmwareX" in order to indicate the concatenation to the user. He might be less tempted into overwriting a "fwconcat1" than a "firmware1", which might be perceived as an alternate firmware for dual boot etc. This applies the new naming consistently for all relevant devices, i.e. fwconcatX for virtual "firmware" members and ubiconcatX for "ubi" members. While at it, use DT labels and label property consistently, and also use consistent zero-based indexing. Signed-off-by: Adrian Schmutzler --- .../linux/ath79/dts/ar7240_engenius_enh202-v1.dts | 10 +++++----- .../linux/ath79/dts/ar7242_engenius_eap350-v1.dts | 10 +++++----- .../linux/ath79/dts/ar7242_engenius_ecb350-v1.dts | 10 +++++----- .../linux/ath79/dts/ar9341_engenius_eap300-v2.dts | 10 +++++----- .../ath79/dts/ar9341_engenius_ens202ext-v1.dts | 10 +++++----- target/linux/ath79/dts/ar9341_pisen_wmb001n.dts | 10 +++++----- .../ath79/dts/ar9344_enterasys_ws-ap3705i.dts | 10 +++++----- target/linux/ath79/dts/ar9344_netgear_wndr.dtsi | 10 +++++----- target/linux/ath79/dts/qca9550_airtight_c-75.dts | 10 +++++----- .../ath79/dts/qca9557_engenius_enstationac-v1.dts | 10 +++++----- target/linux/ath79/dts/qca9558_belkin_f9x-v2.dtsi | 10 +++++----- .../ramips/dts/mt7620n_sunvalley_filehub.dtsi | 14 +++++++------- target/linux/ramips/dts/mt7621_hiwifi_hc5962.dts | 12 ++++++------ 13 files changed, 68 insertions(+), 68 deletions(-) diff --git a/target/linux/ath79/dts/ar7240_engenius_enh202-v1.dts b/target/linux/ath79/dts/ar7240_engenius_enh202-v1.dts index aeb1e9e424..77b2f3fa1a 100644 --- a/target/linux/ath79/dts/ar7240_engenius_enh202-v1.dts +++ b/target/linux/ath79/dts/ar7240_engenius_enh202-v1.dts @@ -72,7 +72,7 @@ virtual_flash { compatible = "mtd-concat"; - devices = <&firmware1 &firmware2>; + devices = <&fwconcat0 &fwconcat1>; partitions { compatible = "fixed-partitions"; @@ -128,8 +128,8 @@ read-only; }; - firmware2: partition@b0000 { - label = "firmware2"; + fwconcat1: partition@b0000 { + label = "fwconcat1"; reg = <0xb0000 0xf0000>; }; @@ -138,8 +138,8 @@ reg = <0x1a0000 0x10000>; }; - firmware1: partition@1b0000 { - label = "firmware1"; + fwconcat0: partition@1b0000 { + label = "fwconcat0"; reg = <0x1b0000 0x4c0000>; }; diff --git a/target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts b/target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts index b530f6aa8a..4001897adf 100644 --- a/target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts +++ b/target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts @@ -51,7 +51,7 @@ virtual_flash { compatible = "mtd-concat"; - devices = <&firmware1 &firmware2>; + devices = <&fwconcat0 &fwconcat1>; partitions { compatible = "fixed-partitions"; @@ -107,8 +107,8 @@ read-only; }; - firmware2: partition@b0000 { - label = "firmware2"; + fwconcat1: partition@b0000 { + label = "fwconcat1"; reg = <0xb0000 0xf0000>; }; @@ -118,8 +118,8 @@ read-only; }; - firmware1: partition@1b0000 { - label = "firmware1"; + fwconcat0: partition@1b0000 { + label = "fwconcat0"; reg = <0x1b0000 0x4c0000>; }; diff --git a/target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts b/target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts index 8931a206ba..e73082267c 100644 --- a/target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts +++ b/target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts @@ -51,7 +51,7 @@ virtual_flash { compatible = "mtd-concat"; - devices = <&firmware1 &firmware2>; + devices = <&fwconcat0 &fwconcat1>; partitions { compatible = "fixed-partitions"; @@ -107,8 +107,8 @@ read-only; }; - firmware2: partition@b0000 { - label = "firmware2"; + fwconcat1: partition@b0000 { + label = "fwconcat1"; reg = <0xb0000 0xf0000>; }; @@ -118,8 +118,8 @@ read-only; }; - firmware1: partition@1b0000 { - label = "firmware1"; + fwconcat0: partition@1b0000 { + label = "fwconcat0"; reg = <0x1b0000 0x4c0000>; }; diff --git a/target/linux/ath79/dts/ar9341_engenius_eap300-v2.dts b/target/linux/ath79/dts/ar9341_engenius_eap300-v2.dts index e299c8529d..3121ec0e01 100644 --- a/target/linux/ath79/dts/ar9341_engenius_eap300-v2.dts +++ b/target/linux/ath79/dts/ar9341_engenius_eap300-v2.dts @@ -52,7 +52,7 @@ virtual_flash { compatible = "mtd-concat"; - devices = <&firmware1 &firmware2>; + devices = <&fwconcat0 &fwconcat1>; partitions { compatible = "fixed-partitions"; @@ -112,8 +112,8 @@ read-only; }; - firmware2: partition@b0000 { - label = "firmware2"; + fwconcat1: partition@b0000 { + label = "fwconcat1"; reg = <0x0b0000 0x170000>; }; @@ -123,8 +123,8 @@ read-only; }; - firmware1: partition@230000 { - label = "firmware1"; + fwconcat0: partition@230000 { + label = "fwconcat0"; reg = <0x230000 0xbc0000>; }; diff --git a/target/linux/ath79/dts/ar9341_engenius_ens202ext-v1.dts b/target/linux/ath79/dts/ar9341_engenius_ens202ext-v1.dts index 94b079f94d..8b28d581b1 100644 --- a/target/linux/ath79/dts/ar9341_engenius_ens202ext-v1.dts +++ b/target/linux/ath79/dts/ar9341_engenius_ens202ext-v1.dts @@ -62,7 +62,7 @@ virtual_flash { compatible = "mtd-concat"; - devices = <&firmware1 &firmware2>; + devices = <&fwconcat0 &fwconcat1>; partitions { compatible = "fixed-partitions"; @@ -122,8 +122,8 @@ read-only; }; - firmware2: partition@b0000 { - label = "firmware2"; + fwconcat1: partition@b0000 { + label = "fwconcat1"; reg = <0x0b0000 0x170000>; }; @@ -132,8 +132,8 @@ reg = <0x220000 0x010000>; }; - firmware1: partition@230000 { - label = "firmware1"; + fwconcat0: partition@230000 { + label = "fwconcat0"; reg = <0x230000 0xbc0000>; }; diff --git a/target/linux/ath79/dts/ar9341_pisen_wmb001n.dts b/target/linux/ath79/dts/ar9341_pisen_wmb001n.dts index 3d9c6cb781..aaa4d1576b 100644 --- a/target/linux/ath79/dts/ar9341_pisen_wmb001n.dts +++ b/target/linux/ath79/dts/ar9341_pisen_wmb001n.dts @@ -96,7 +96,7 @@ virtual_flash { compatible = "mtd-concat"; - devices = <&fwpart1 &fwpart2>; + devices = <&fwconcat0 &fwconcat1>; partitions { compatible = "fixed-partitions"; @@ -158,8 +158,8 @@ read-only; }; - fwpart1: partition@20000 { - label = "fwpart1"; + fwconcat0: partition@20000 { + label = "fwconcat0"; reg = <0x20000 0xdc0000>; }; @@ -168,8 +168,8 @@ reg = <0xde0000 0x10000>; }; - fwpart2: partition@df0000 { - label = "fwpart2"; + fwconcat1: partition@df0000 { + label = "fwconcat1"; reg = <0xdf0000 0x1f0000>; }; diff --git a/target/linux/ath79/dts/ar9344_enterasys_ws-ap3705i.dts b/target/linux/ath79/dts/ar9344_enterasys_ws-ap3705i.dts index 7fb794f21c..a387cebefc 100644 --- a/target/linux/ath79/dts/ar9344_enterasys_ws-ap3705i.dts +++ b/target/linux/ath79/dts/ar9344_enterasys_ws-ap3705i.dts @@ -23,7 +23,7 @@ mtd-concat { compatible = "mtd-concat"; - devices = <&concat0 &concat1>; + devices = <&fwconcat0 &fwconcat1>; partitions { compatible = "fixed-partitions"; @@ -166,8 +166,8 @@ read-only; }; - concat0: partition@230000 { - label = "concat0"; + fwconcat0: partition@230000 { + label = "fwconcat0"; reg = <0x230000 0xdd0000>; }; }; @@ -183,8 +183,8 @@ #address-cells = <1>; #size-cells = <1>; - concat1: partition@0 { - label = "concat1"; + fwconcat1: partition@0 { + label = "fwconcat1"; reg = <0x0 0x1000000>; }; }; diff --git a/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi b/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi index 92b0beccd7..26f9db5924 100644 --- a/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi +++ b/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi @@ -82,7 +82,7 @@ ubi-concat { compatible = "mtd-concat"; - devices = <&ubipart0 &ubipart1>; + devices = <&ubiconcat0 &ubiconcat1>; partitions { compatible = "fixed-partitions"; @@ -153,8 +153,8 @@ reg = <0x6c0000 0x400000>; }; - ubipart0: partition@ac0000 { - label = "ubipart0"; + ubiconcat0: partition@ac0000 { + label = "ubiconcat0"; reg = <0xac0000 0x1500000>; }; @@ -170,8 +170,8 @@ read-only; }; - ubipart1: partition@2000000 { - label = "ubipart1"; + ubiconcat1: partition@2000000 { + label = "ubiconcat1"; reg = <0x2000000 0x6000000>; }; }; diff --git a/target/linux/ath79/dts/qca9550_airtight_c-75.dts b/target/linux/ath79/dts/qca9550_airtight_c-75.dts index 1bdbc86156..a766398971 100644 --- a/target/linux/ath79/dts/qca9550_airtight_c-75.dts +++ b/target/linux/ath79/dts/qca9550_airtight_c-75.dts @@ -44,7 +44,7 @@ virtual_flash { compatible = "mtd-concat"; - devices = <&concat0 &concat1>; + devices = <&fwconcat0 &fwconcat1>; partitions { compatible = "fixed-partitions"; @@ -135,8 +135,8 @@ read-only; }; - concat0: partition@60000 { - label = "reserved1"; + fwconcat0: partition@60000 { + label = "fwconcat0"; reg = <0x060000 0xf90000>; }; @@ -158,8 +158,8 @@ #address-cells = <1>; #size-cells = <1>; - concat1: partition@0 { - label = "reserved2"; + fwconcat1: partition@0 { + label = "fwconcat1"; reg = <0x0 0x1000000>; }; }; diff --git a/target/linux/ath79/dts/qca9557_engenius_enstationac-v1.dts b/target/linux/ath79/dts/qca9557_engenius_enstationac-v1.dts index 952747ade0..f9801693c5 100644 --- a/target/linux/ath79/dts/qca9557_engenius_enstationac-v1.dts +++ b/target/linux/ath79/dts/qca9557_engenius_enstationac-v1.dts @@ -62,7 +62,7 @@ virtual_flash { compatible = "mtd-concat"; - devices = <&firmware1 &firmware2>; + devices = <&fwconcat0 &fwconcat1>; partitions { compatible = "fixed-partitions"; @@ -118,8 +118,8 @@ read-only; }; - firmware2: partition@b0000 { - label = "firmware2"; + fwconcat1: partition@b0000 { + label = "fwconcat1"; reg = <0x0b0000 0x170000>; }; @@ -129,8 +129,8 @@ read-only; }; - firmware1: partition@230000 { - label = "firmware1"; + fwconcat0: partition@230000 { + label = "fwconcat0"; reg = <0x230000 0xb40000>; }; diff --git a/target/linux/ath79/dts/qca9558_belkin_f9x-v2.dtsi b/target/linux/ath79/dts/qca9558_belkin_f9x-v2.dtsi index c88e2b0ba6..af22f6681a 100644 --- a/target/linux/ath79/dts/qca9558_belkin_f9x-v2.dtsi +++ b/target/linux/ath79/dts/qca9558_belkin_f9x-v2.dtsi @@ -77,7 +77,7 @@ virtual_flash { compatible = "mtd-concat"; - devices = <&fwpart1 &fwpart2>; + devices = <&fwconcat0 &fwconcat1>; partitions { compatible = "fixed-partitions"; @@ -141,8 +141,8 @@ reg = <0x040000 0x010000>; }; - fwpart1: partition@50000 { - label = "fwpart1"; + fwconcat0: partition@50000 { + label = "fwconcat0"; reg = <0x050000 0xe20000>; }; @@ -152,8 +152,8 @@ read-only; }; - fwpart2: partition@e80000 { - label = "fwpart2"; + fwconcat1: partition@e80000 { + label = "fwconcat1"; reg = <0xe80000 0x170000>; }; diff --git a/target/linux/ramips/dts/mt7620n_sunvalley_filehub.dtsi b/target/linux/ramips/dts/mt7620n_sunvalley_filehub.dtsi index d94379a41f..beca2954dc 100644 --- a/target/linux/ramips/dts/mt7620n_sunvalley_filehub.dtsi +++ b/target/linux/ramips/dts/mt7620n_sunvalley_filehub.dtsi @@ -23,7 +23,7 @@ virtual_flash { compatible = "mtd-concat"; - devices = <&firmware1 &firmware2 &firmware3>; + devices = <&fwconcat0 &fwconcat1 &fwconcat2>; partitions { compatible = "fixed-partitions"; @@ -89,8 +89,8 @@ read-only; }; - firmware2: partition@60000 { - label = "firmware2"; + fwconcat1: partition@60000 { + label = "fwconcat1"; reg = <0x60000 0x170000>; }; @@ -99,13 +99,13 @@ reg = <0x1d0000 0x10000>; }; - firmware3: partition@1e0000 { - label = "firmware3"; + fwconcat2: partition@1e0000 { + label = "fwconcat2"; reg = <0x1e0000 0x20000>; }; - firmware1: partition@200000 { - label = "firmware1"; + fwconcat0: partition@200000 { + label = "fwconcat0"; reg = <0x200000 0x600000>; }; }; diff --git a/target/linux/ramips/dts/mt7621_hiwifi_hc5962.dts b/target/linux/ramips/dts/mt7621_hiwifi_hc5962.dts index 87b103f539..774fb93d9c 100644 --- a/target/linux/ramips/dts/mt7621_hiwifi_hc5962.dts +++ b/target/linux/ramips/dts/mt7621_hiwifi_hc5962.dts @@ -45,14 +45,14 @@ ubi-concat { compatible = "mtd-concat"; - devices = <&ubipart0 &ubipart1>; + devices = <&ubiconcat0 &ubiconcat1>; partitions { compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; - ubi@0 { + partition@0 { label = "ubi"; reg = <0x0 0x79c0000>; }; @@ -91,8 +91,8 @@ reg = <0x140000 0x400000>; }; - ubipart0: partition@540000 { - label = "ubipart0"; + ubiconcat0: partition@540000 { + label = "ubiconcat0"; reg = <0x540000 0x1c80000>; }; @@ -102,8 +102,8 @@ read-only; }; - ubipart1: partition@2240000 { - label = "ubipart1"; + ubiconcat1: partition@2240000 { + label = "ubiconcat1"; reg = <0x2240000 0x5d40000>; }; }; From 9d96b6fb720d9cecc7bd50b4f16dabe1b337f9f2 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Sun, 27 Dec 2020 20:33:57 +0100 Subject: [PATCH 04/26] ath79/mikrotik: disable building NAND images MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The current support for MikroTik NAND-based devices relies on a gross hack that packs the kernel into a static YAFFS stub, as the stock bootloader only supports booting a YAFFS-encapsulated kernel. The problem with this approach is that since the kernel partition is blindly overwritten without any kind of wear or badblock management (due to lack of proper support for YAFFS in OpenWRT), the NAND flash is not worn uniformly and eventually badblocks appear, leading to unbootable devices. This issue has been reported here [1] and discussed in more detail here [2]. [1] https://forum.openwrt.org/t/rb433-bad-sector-cannot-start-openwrt/71519 [2] https://github.com/openwrt/openwrt/pull/3026#issuecomment-673597461 Until a proper fix is found (or the stock bootloader supports other filesystems), we disable building these images to prevent unknowing users from risking their devices. Thanks to Thibaut Varène for summarizing the details above. Signed-off-by: Adrian Schmutzler --- target/linux/ath79/image/common-mikrotik.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/ath79/image/common-mikrotik.mk b/target/linux/ath79/image/common-mikrotik.mk index b0c3feda20..6e739f2d85 100644 --- a/target/linux/ath79/image/common-mikrotik.mk +++ b/target/linux/ath79/image/common-mikrotik.mk @@ -17,4 +17,5 @@ define Device/mikrotik_nand IMAGE/sysupgrade.bin = append-kernel | kernel2minor -s 2048 -e -c | \ sysupgrade-tar kernel=$$$$@ | append-metadata DEVICE_PACKAGES := nand-utils + DEFAULT := n endef From 2160a9d597b7bb7b14a65785117ff5891db518ef Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Mon, 28 Dec 2020 00:41:51 +0100 Subject: [PATCH 05/26] ath79: remove duplicate sysupgrade.bin for dlink_dap-2xxx sysupgrade.bin has been added to IMAGES twice, resulting in warnings like: Makefile:86: warning: overriding recipe for target '[...]/tmp/openwrt-ath79-generic-dlink_dap-2660-a1-squashfs-sysupgrade.bin' Makefile:86: warning: ignoring old recipe for target '[...]/tmp/openwrt-ath79-generic-dlink_dap-2660-a1-squashfs-sysupgrade.bin' Signed-off-by: Adrian Schmutzler --- target/linux/ath79/image/generic.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 870007f044..63a07a9d5c 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -740,7 +740,7 @@ endef TARGET_DEVICES += dlink_dap-1365-a1 define Device/dlink_dap-2xxx - IMAGES += factory.img sysupgrade.bin + IMAGES += factory.img IMAGE/factory.img := append-kernel | pad-offset 6144k 160 | \ append-rootfs | wrgg-pad-rootfs | mkwrggimg | check-size IMAGE/sysupgrade.bin := append-kernel | mkwrggimg | \ From 57e4cc8261ca6f0b32e4da6922a8f52ef82c4dc6 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Mon, 28 Dec 2020 15:17:57 +0100 Subject: [PATCH 06/26] ipq806x: disable CONFIG_CMDLINE_OVERRIDE and ASRock G10 After device support for ASRock G10 was added in [1], several people reported broken ipq806x devices, with one or several of the following symptoms: - Device does not boot - Sysupgrade does not work - Serial console is broken The issues appears to be caused by the introduction of the symbol CONFIG_CMDLINE_OVERRIDE=y in [1]. This patch disables the corresponding symbol again and marks the ASRock as BROKEN, as it probably won't work properly without it. Further references: https://bugs.openwrt.org/index.php?do=details&task_id=3540 https://github.com/openwrt/openwrt/commit/98b86296e67dd2b467212fe1a577656e6d3725da#commitcomment-45455875 [1] 98b86296e67d ("ipq806x: add support for ASRock G10") Signed-off-by: Adrian Schmutzler --- target/linux/ipq806x/config-5.4 | 2 +- target/linux/ipq806x/image/Makefile | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/target/linux/ipq806x/config-5.4 b/target/linux/ipq806x/config-5.4 index e6160bd455..43d2356316 100644 --- a/target/linux/ipq806x/config-5.4 +++ b/target/linux/ipq806x/config-5.4 @@ -78,7 +78,7 @@ CONFIG_CC_HAS_KASAN_GENERIC=y CONFIG_CLKDEV_LOOKUP=y CONFIG_CLKSRC_QCOM=y CONFIG_CLONE_BACKWARDS=y -CONFIG_CMDLINE_OVERRIDE=y +# CONFIG_CMDLINE_OVERRIDE is not set CONFIG_COMMON_CLK=y CONFIG_COMMON_CLK_QCOM=y CONFIG_COMPAT_32BIT_TIME=y diff --git a/target/linux/ipq806x/image/Makefile b/target/linux/ipq806x/image/Makefile index 80bfec5ad9..e1a50e752c 100644 --- a/target/linux/ipq806x/image/Makefile +++ b/target/linux/ipq806x/image/Makefile @@ -103,6 +103,7 @@ define Device/asrock_g10 KERNEL_SIZE := 5332k DEVICE_PACKAGES := kmod-i2c-gpio ath10k-firmware-qca99x0-ct IMAGE/nand-factory.bin := append-ubi | edimax-header RN67 + BROKEN := y endef TARGET_DEVICES += asrock_g10 From da9beb070d112469adeb30dd79dcde3176bfb290 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Mon, 28 Dec 2020 16:18:22 +0100 Subject: [PATCH 07/26] ath10k-ct: update to latest version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changelog: - ath10k-ct: Fix invalid use of ath-cb struct Runtime-tested on ath79 (TP-Link Archer C7 v2) and ipq806x (Netgear R7800). Signed-off-by: Álvaro Fernández Rojas --- package/kernel/ath10k-ct/Makefile | 8 ++++---- .../patches/164-ath10k-commit-rates-from-mac80211.patch | 6 +++--- ...nd-GPIO-controlling-support-for-various-chipsets.patch | 8 ++++---- .../patches/202-ath10k-use-tpt-trigger-by-default.patch | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/package/kernel/ath10k-ct/Makefile b/package/kernel/ath10k-ct/Makefile index b02c6389e7..d5b51e91d6 100644 --- a/package/kernel/ath10k-ct/Makefile +++ b/package/kernel/ath10k-ct/Makefile @@ -1,16 +1,16 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ath10k-ct -PKG_RELEASE=3 +PKG_RELEASE=1 PKG_LICENSE:=GPLv2 PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/greearb/ath10k-ct.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2020-10-08 -PKG_SOURCE_VERSION:=1d28d176e5b6e63a6583f497adf68e1d9c1dc962 -PKG_MIRROR_HASH:=f611762647822742f7c8f9da242e33d9bf6da0a14976b87408af28f280802ae0 +PKG_SOURCE_DATE:=2020-12-24 +PKG_SOURCE_VERSION:=b753e8bf22b94297acbaa370b4cb0be87e3da4b8 +PKG_MIRROR_HASH:=e026296208e0c20fd0775704c2167da5a447aef4080cedc5fba0797f0e180d8d # Build the 5.8 ath10k-ct driver version. # Probably this should match as closely as diff --git a/package/kernel/ath10k-ct/patches/164-ath10k-commit-rates-from-mac80211.patch b/package/kernel/ath10k-ct/patches/164-ath10k-commit-rates-from-mac80211.patch index 51cca227d5..1fe52b96b9 100644 --- a/package/kernel/ath10k-ct/patches/164-ath10k-commit-rates-from-mac80211.patch +++ b/package/kernel/ath10k-ct/patches/164-ath10k-commit-rates-from-mac80211.patch @@ -11,7 +11,7 @@ Signed-off-by: Sven Eckelmann --- a/ath10k-5.8/mac.c +++ b/ath10k-5.8/mac.c -@@ -6653,6 +6653,7 @@ static void ath10k_recalculate_mgmt_rate +@@ -6691,6 +6691,7 @@ static void ath10k_recalculate_mgmt_rate return; } @@ -19,7 +19,7 @@ Signed-off-by: Sven Eckelmann vdev_param = ar->wmi.vdev_param->mgmt_rate; ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param, hw_rate_code); -@@ -6879,6 +6880,7 @@ static void ath10k_bss_info_changed(stru +@@ -6917,6 +6918,7 @@ static void ath10k_bss_info_changed(stru "mac vdev %d mcast_rate %x\n", arvif->vdev_id, rate); @@ -27,7 +27,7 @@ Signed-off-by: Sven Eckelmann vdev_param = ar->wmi.vdev_param->mcast_data_rate; ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param, rate); -@@ -6887,6 +6889,7 @@ static void ath10k_bss_info_changed(stru +@@ -6925,6 +6927,7 @@ static void ath10k_bss_info_changed(stru "failed to set mcast rate on vdev %i: %d\n", arvif->vdev_id, ret); diff --git a/package/kernel/ath10k-ct/patches/201-ath10k-add-LED-and-GPIO-controlling-support-for-various-chipsets.patch b/package/kernel/ath10k-ct/patches/201-ath10k-add-LED-and-GPIO-controlling-support-for-various-chipsets.patch index 92f20cb4c0..e5a83ccb97 100644 --- a/package/kernel/ath10k-ct/patches/201-ath10k-add-LED-and-GPIO-controlling-support-for-various-chipsets.patch +++ b/package/kernel/ath10k-ct/patches/201-ath10k-add-LED-and-GPIO-controlling-support-for-various-chipsets.patch @@ -161,7 +161,7 @@ v13: .patch_load_addr = QCA9888_HW_2_0_PATCH_LOAD_ADDR, .uart_pin = 7, .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH, -@@ -3675,6 +3681,10 @@ int ath10k_core_start(struct ath10k *ar, +@@ -3688,6 +3694,10 @@ int ath10k_core_start(struct ath10k *ar, ath10k_wmi_check_apply_board_power_ctl_table(ar); } @@ -172,7 +172,7 @@ v13: return 0; err_hif_stop: -@@ -3933,9 +3943,18 @@ static void ath10k_core_register_work(st +@@ -3946,9 +3956,18 @@ static void ath10k_core_register_work(st goto err_spectral_destroy; } @@ -191,7 +191,7 @@ v13: err_spectral_destroy: ath10k_spectral_destroy(ar); err_debug_destroy: -@@ -3995,6 +4014,8 @@ void ath10k_core_unregister(struct ath10 +@@ -4008,6 +4027,8 @@ void ath10k_core_unregister(struct ath10 if (!test_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags)) return; @@ -210,7 +210,7 @@ v13: #include "htt.h" #include "htc.h" -@@ -1523,6 +1524,13 @@ struct ath10k { +@@ -1530,6 +1531,13 @@ struct ath10k { } testmode; struct { diff --git a/package/kernel/ath10k-ct/patches/202-ath10k-use-tpt-trigger-by-default.patch b/package/kernel/ath10k-ct/patches/202-ath10k-use-tpt-trigger-by-default.patch index cd3b7c5e6e..3f7c405efb 100644 --- a/package/kernel/ath10k-ct/patches/202-ath10k-use-tpt-trigger-by-default.patch +++ b/package/kernel/ath10k-ct/patches/202-ath10k-use-tpt-trigger-by-default.patch @@ -16,7 +16,7 @@ Signed-off-by: Mathias Kresin --- a/ath10k-5.8/core.h +++ b/ath10k-5.8/core.h -@@ -1631,6 +1631,10 @@ struct ath10k { +@@ -1638,6 +1638,10 @@ struct ath10k { u8 csi_data[4096]; u16 csi_data_len; @@ -42,7 +42,7 @@ Signed-off-by: Mathias Kresin if (ret) --- a/ath10k-5.8/mac.c +++ b/ath10k-5.8/mac.c -@@ -10680,7 +10680,7 @@ int ath10k_mac_register(struct ath10k *a +@@ -10718,7 +10718,7 @@ int ath10k_mac_register(struct ath10k *a ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER; #ifdef CPTCFG_MAC80211_LEDS From e1938d3397ba2bc40d27dc4f97f8532228de6112 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Mon, 23 Nov 2020 10:29:48 +0100 Subject: [PATCH 08/26] ath10k-ct-firmware: update to 022 (2020-11-08) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Runtime-tested on ath79 (TP-Link Archer C7 v2) and ipq806x (Netgear R7800). Signed-off-by: Álvaro Fernández Rojas --- package/firmware/ath10k-ct-firmware/Makefile | 68 ++++++++++---------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/package/firmware/ath10k-ct-firmware/Makefile b/package/firmware/ath10k-ct-firmware/Makefile index 83e5563e64..4fd7266f22 100644 --- a/package/firmware/ath10k-ct-firmware/Makefile +++ b/package/firmware/ath10k-ct-firmware/Makefile @@ -1,8 +1,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ath10k-ct-firmware -PKG_VERSION:=2020-07-02 -PKG_RELEASE:=3 +PKG_VERSION:=2020-11-08 +PKG_RELEASE:=1 include $(INCLUDE_DIR)/package.mk @@ -28,120 +28,120 @@ define Download/ct-firmware-htt URL_FILE:=$($(1)_FIRMWARE_FILE_CT_HTT) endef -QCA988X_FIRMWARE_FILE_CT:=firmware-2-ct-full-community-22.bin.lede.019 +QCA988X_FIRMWARE_FILE_CT:=firmware-2-ct-full-community-22.bin.lede.022 define Download/ath10k-firmware-qca988x-ct $(call Download/ct-firmware,QCA988X,) - HASH:=8b4c99253aa309d35f2e060c190091b8db1b84dbda06a6a15c83ac0f9a938126 + HASH:=398e4380e7e55105f3da0f78af29d1e437404ed3a82597aa4b6daaa7dce1a38e endef $(eval $(call Download,ath10k-firmware-qca988x-ct)) -QCA988X_FIRMWARE_FILE_CT_FULL_HTT:=firmware-2-ct-full-htt-mgt-community-22.bin.lede.019 +QCA988X_FIRMWARE_FILE_CT_FULL_HTT:=firmware-2-ct-full-htt-mgt-community-22.bin.lede.022 define Download/ath10k-firmware-qca988x-ct-full-htt $(call Download/ct-firmware-full-htt,QCA988X,) - HASH:=a7168916d6aa5e4d7858f8b620c0c980c76d03f390929db6f4077685ce2051e7 + HASH:=990d9cbf79dd81f141257a289f89808bd7726406c9ed845a7e49e5167002ffde endef $(eval $(call Download,ath10k-firmware-qca988x-ct-full-htt)) -QCA9887_FIRMWARE_FILE_CT:=firmware-2-ct-full-community-22.bin.lede.019 +QCA9887_FIRMWARE_FILE_CT:=firmware-2-ct-full-community-22.bin.lede.022 define Download/ath10k-firmware-qca9887-ct $(call Download/ct-firmware,QCA9887,ath10k-9887) - HASH:=459692deb186a63ab8eeddb7ad5d54779266e68ca686e7c46062554db6dca12b + HASH:=a526cb44560da569781e10bf608194b1eff29b250e9887dba6d4d9a15c921c1e endef $(eval $(call Download,ath10k-firmware-qca9887-ct)) -QCA9887_FIRMWARE_FILE_CT_FULL_HTT:=firmware-2-ct-full-htt-mgt-community-22.bin.lede.019 +QCA9887_FIRMWARE_FILE_CT_FULL_HTT:=firmware-2-ct-full-htt-mgt-community-22.bin.lede.022 define Download/ath10k-firmware-qca9887-ct-full-htt $(call Download/ct-firmware-full-htt,QCA9887,ath10k-9887) - HASH:=fd126a457d0927d0c8ea10d66ef5b67d5e1e0741f8692bb3016bb602d0af3098 + HASH:=0b60fc558b773e9cbd5c2df903c894a030872fdb96390b0cca4b23b7fc7b881f endef $(eval $(call Download,ath10k-firmware-qca9887-ct-full-htt)) -QCA99X0_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.019 +QCA99X0_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.022 define Download/ath10k-firmware-qca99x0-ct $(call Download/ct-firmware,QCA99X0,ath10k-10-4b) - HASH:=7dc934f934bc4973c9273a4f22cfead8e26ec6f579647af31b718a860eca0a4b + HASH:=578ad67976b61a393eb820a05e8eae70ec95f6b803bedbe952b8ff573eb09abe endef $(eval $(call Download,ath10k-firmware-qca99x0-ct)) -QCA99X0_FIRMWARE_FILE_CT_FULL_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.019 +QCA99X0_FIRMWARE_FILE_CT_FULL_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.022 define Download/ath10k-firmware-qca99x0-ct-full-htt $(call Download/ct-firmware-full-htt,QCA99X0,ath10k-10-4b) - HASH:=71a27b245a382fe009938d2826d5c97a90dceb10ddf638325268df91837ea302 + HASH:=8ea5c9f27c048796d406706a9c8471cd070f5aeb768622bb334a04853d557a4d endef $(eval $(call Download,ath10k-firmware-qca99x0-ct-full-htt)) -QCA99X0_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-htt-mgt-community-12.bin-lede.019 +QCA99X0_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-htt-mgt-community-12.bin-lede.022 define Download/ath10k-firmware-qca99x0-ct-htt $(call Download/ct-firmware-htt,QCA99X0,ath10k-10-4b) - HASH:=9ed4fe41e5b0f30172f71ae0fe382dc0aab8aa4f8a898417af4f7ee936575ef6 + HASH:=7b0b7545114e8dc0f2c70dc8a43a5a48d84d37f2a4673977a692c5f3361445c6 endef $(eval $(call Download,ath10k-firmware-qca99x0-ct-htt)) -QCA9984_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.019 +QCA9984_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.022 define Download/ath10k-firmware-qca9984-ct $(call Download/ct-firmware,QCA9984,ath10k-9984-10-4b) - HASH:=32d13f432691fe759ded7d027052e925233adb436cd8f729f85ec3d19ccd1dfd + HASH:=7bfe5bf7c38532fa57db62ebc56ec625583928d5d4736475d5dec4d4ae031154 endef $(eval $(call Download,ath10k-firmware-qca9984-ct)) -QCA9984_FIRMWARE_FILE_CT_FULL_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.019 +QCA9984_FIRMWARE_FILE_CT_FULL_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.022 define Download/ath10k-firmware-qca9984-ct-full-htt $(call Download/ct-firmware-full-htt,QCA9984,ath10k-9984-10-4b) - HASH:=e8ab69777bd00b5fc6b1b7acccb55b903553a99932a5b0351602b5f690106588 + HASH:=672be40c4d987d7e8e309341262a37cda7baf925416d1dc651284b6d2bd30969 endef $(eval $(call Download,ath10k-firmware-qca9984-ct-full-htt)) -QCA9984_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-htt-mgt-community-12.bin-lede.019 +QCA9984_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-htt-mgt-community-12.bin-lede.022 define Download/ath10k-firmware-qca9984-ct-htt $(call Download/ct-firmware-htt,QCA9984,ath10k-9984-10-4b) - HASH:=74449b303b626e0713b3fd4f2d6103d65859403b2dd7bdd8882aa772b69b59c7 + HASH:=a24e887f13aca4358ab2b6a42a7212d066e4d19e29b00bb26f9681b1dc8d0eb0 endef $(eval $(call Download,ath10k-firmware-qca9984-ct-htt)) -QCA4019_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.019 +QCA4019_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.022 define Download/ath10k-firmware-qca4019-ct $(call Download/ct-firmware,QCA4019,ath10k-4019-10-4b) - HASH:=4b89763087c7ed9b56046c4e621b7f045e452436d8d9b430a5d171179e313592 + HASH:=503956d9bf09d603e4cf36ac080fa5b5a22032166204e3c15ae898647bc50df3 endef $(eval $(call Download,ath10k-firmware-qca4019-ct)) -QCA4019_FIRMWARE_FILE_CT_FULL_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.019 +QCA4019_FIRMWARE_FILE_CT_FULL_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.022 define Download/ath10k-firmware-qca4019-ct-full-htt $(call Download/ct-firmware-full-htt,QCA4019,ath10k-4019-10-4b) - HASH:=fba591e5777c53b82542ba16cae69d9bb4684837f2fa4cee1b9b26f648096748 + HASH:=591bf9ed00fb540d7ba034453f17696e8dd91a4b7d81f7cc1ec41f447fa74831 endef $(eval $(call Download,ath10k-firmware-qca4019-ct-full-htt)) -QCA4019_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-htt-mgt-community-12.bin-lede.019 +QCA4019_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-htt-mgt-community-12.bin-lede.022 define Download/ath10k-firmware-qca4019-ct-htt $(call Download/ct-firmware-htt,QCA4019,ath10k-4019-10-4b) - HASH:=0d534c3c424184b8ec2773f15c8933bdab0d39b6f664d2578c6602b0eb7035d1 + HASH:=06e58a283ff90d021ff7cb58684cbf39750bd71cf91c56b32add64253133929c endef $(eval $(call Download,ath10k-firmware-qca4019-ct-htt)) -QCA9888_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.019 +QCA9888_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.022 define Download/ath10k-firmware-qca9888-ct $(call Download/ct-firmware,QCA9888,ath10k-9888-10-4b) - HASH:=048f4300725e6ebbf94a6bf4f3f4e4592c446fcdbe1d801aaac024b15e89e0c9 + HASH:=82ff5afcf0c9dcdb03b0b40c6eddc81e11b18e4f522f681935b5ec42537972ee endef $(eval $(call Download,ath10k-firmware-qca9888-ct)) -QCA9888_FIRMWARE_FILE_CT_FULL_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.019 +QCA9888_FIRMWARE_FILE_CT_FULL_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.022 define Download/ath10k-firmware-qca9888-ct-full-htt $(call Download/ct-firmware-full-htt,QCA9888,ath10k-9888-10-4b) - HASH:=d2a7e9fea6bd854721b3fc03a3a00d379d303b2bce339377ee87a1c14a60312d + HASH:=1a741f2cf43fbea24ed831b4e76cbb114b525d1ee9b917ce0000916cbcc42f92 endef $(eval $(call Download,ath10k-firmware-qca9888-ct-full-htt)) -QCA9888_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-htt-mgt-community-12.bin-lede.019 +QCA9888_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-htt-mgt-community-12.bin-lede.022 define Download/ath10k-firmware-qca9888-ct-htt $(call Download/ct-firmware-htt,QCA9888,ath10k-9888-10-4b) - HASH:=e52a6db33347c641ee791fd9a3a57a2503cdda1adc6b8d943e336431528b9d2a + HASH:=34bf07912a2f3fce4a5887c690848bb06d339bd1c86541b0b57b9c45eccc88e4 endef $(eval $(call Download,ath10k-firmware-qca9888-ct-htt)) From dd1d95cb0357278900d09fae3ad20e9e0b2d569a Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Mon, 23 Nov 2020 13:41:34 +0100 Subject: [PATCH 09/26] ath79: Add support for OpenMesh OM2P v4 Device specifications: ====================== * Qualcomm/Atheros QCA9533 v2 * 650/600/217 MHz (CPU/DDR/AHB) * 64 MB of RAM * 16 MB of SPI NOR flash - 2x 7 MB available; but one of the 7 MB regions is the recovery image * 2x 10/100 Mbps Ethernet * 1T1R 2.4 GHz Wi-Fi * 6x GPIO-LEDs (3x wifi, 2x ethernet, 1x power) * 1x GPIO-button (reset) * external h/w watchdog (enabled by default) * TTL pins are on board (arrow points to VCC, then follows: GND, TX, RX) * 2x fast ethernet - eth0 + Label: Ethernet 1 + 24V passive POE (mode B) - eth1 + Label: Ethernet 2 + 802.3af POE + builtin switch port 1 * 12-24V 1A DC * external antenna Flashing instructions: ====================== Various methods can be used to install the actual image on the flash. Two easy ones are: ap51-flash ---------- The tool ap51-flash (https://github.com/ap51-flash/ap51-flash) should be used to transfer the image to the u-boot when the device boots up. initramfs from TFTP ------------------- The serial console must be used to access the u-boot shell during bootup. It can then be used to first boot up the initramfs image from a TFTP server (here with the IP 192.168.1.21): setenv serverip 192.168.1.21 setenv ipaddr 192.168.1.1 tftpboot 0c00000 .bin && bootm $fileaddr The actual sysupgrade image can then be transferred (on the LAN port) to the device via scp .bin root@192.168.1.1:/tmp/ On the device, the sysupgrade must then be started using sysupgrade -n /tmp/.bin Signed-off-by: Sven Eckelmann [wrap two very long lines, fix typo in comment] Signed-off-by: Adrian Schmutzler --- package/boot/uboot-envtools/Makefile | 2 +- package/boot/uboot-envtools/files/ath79 | 1 + .../ath79/dts/qca9533_openmesh_om2p-v4.dts | 8 + .../ath79/dts/qca9533_openmesh_om2p-v4.dtsi | 157 ++++++++++++++++++ .../generic/base-files/etc/board.d/01_leds | 4 + .../generic/base-files/etc/board.d/02_network | 1 + .../base-files/lib/upgrade/openmesh.sh | 112 +++++++++++++ .../base-files/lib/upgrade/platform.sh | 4 + target/linux/ath79/image/generic.mk | 20 +++ 9 files changed, 308 insertions(+), 1 deletion(-) create mode 100644 target/linux/ath79/dts/qca9533_openmesh_om2p-v4.dts create mode 100644 target/linux/ath79/dts/qca9533_openmesh_om2p-v4.dtsi create mode 100644 target/linux/ath79/generic/base-files/lib/upgrade/openmesh.sh diff --git a/package/boot/uboot-envtools/Makefile b/package/boot/uboot-envtools/Makefile index 590e38d883..4d2b03e33c 100644 --- a/package/boot/uboot-envtools/Makefile +++ b/package/boot/uboot-envtools/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uboot-envtools PKG_DISTNAME:=u-boot PKG_VERSION:=2020.04 -PKG_RELEASE:=9 +PKG_RELEASE:=10 PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:= \ diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index 1eaaa06f0e..ba857e54ed 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -85,6 +85,7 @@ netgear,wndr4300tn|\ netgear,wndr4300sw) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x20000" ;; +openmesh,om2p-v4|\ plasmacloud,pa300|\ plasmacloud,pa300e) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x40000" diff --git a/target/linux/ath79/dts/qca9533_openmesh_om2p-v4.dts b/target/linux/ath79/dts/qca9533_openmesh_om2p-v4.dts new file mode 100644 index 0000000000..b738afad33 --- /dev/null +++ b/target/linux/ath79/dts/qca9533_openmesh_om2p-v4.dts @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca9533_openmesh_om2p-v4.dtsi" + +/ { + compatible = "openmesh,om2p-v4", "qca,qca9533"; + model = "OpenMesh OM2P v4"; +}; diff --git a/target/linux/ath79/dts/qca9533_openmesh_om2p-v4.dtsi b/target/linux/ath79/dts/qca9533_openmesh_om2p-v4.dtsi new file mode 100644 index 0000000000..74daba3f93 --- /dev/null +++ b/target/linux/ath79/dts/qca9533_openmesh_om2p-v4.dtsi @@ -0,0 +1,157 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca953x.dtsi" + +#include +#include + +/ { + chosen { + /delete-property/ bootargs; + }; + + aliases { + led-boot = &led_power_blue; + led-failsafe = &led_power_blue; + led-running = &led_power_blue; + led-upgrade = &led_power_blue; + label-mac-device = ð0; + }; + + keys { + compatible = "gpio-keys"; + + pinctrl-names = "default"; + pinctrl-0 = <&jtag_disable_pins>; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power_blue: power_blue { + label = "blue:power"; + gpios = <&gpio 0 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + wifi_green { + label = "green:wifi"; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + wifi_yellow { + label = "yellow:wifi"; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + + wifi_red { + label = "red:wifi"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + + wan_blue { + label = "blue:wan"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + lan_blue { + label = "blue:lan"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + }; + + watchdog { + compatible = "linux,wdt-gpio"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + hw_algo = "toggle"; + /* hw_margin_ms is actually 300s but driver limits it to 60s */ + hw_margin_ms = <60000>; + always-running; + }; +}; + +&uart { + status = "okay"; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + /* partitions are passed via bootloader */ + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x040000>; + }; + + partition@80000 { + label = "custom"; + reg = <0x080000 0x140000>; + read-only; + }; + + partition@1c0000 { + label = "inactive"; + reg = <0x1c0000 0x700000>; + }; + + partition@8c0000 { + label = "inactive2"; + reg = <0x8c0000 0x700000>; + }; + + art: partition@fc0000 { + label = "ART"; + reg = <0xfc0000 0x040000>; + read-only; + }; + }; + }; +}; + +ð0 { + status = "okay"; + + phy-handle = <&swphy4>; + + mtd-mac-address = <&art 0x0>; +}; + +ð1 { + /* Workaround: keep the Ethernet interfaces order/mapping correct + * (GMAC0 -> eth0, GMAC1 -> eth1, same as in old ar71xx target) + */ + compatible = "qca,qca9530-eth", "syscon", "simple-mfd"; + + mtd-mac-address = <&art 0x6>; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; + mtd-mac-address = <&art 0x0>; + mtd-mac-address-increment = <2>; +}; 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 443cccce81..8095712e88 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds @@ -230,6 +230,10 @@ netgear,wnr2200-16m) ucidef_set_led_switch "lan3amber" "LAN3 (amber)" "amber:lan3" "switch0" "0x08" "0x02" ucidef_set_led_switch "lan4amber" "LAN4 (amber)" "amber:lan4" "switch0" "0x10" "0x02" ;; +openmesh,om2p-v4) + ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth0" + ucidef_set_led_switch "lan" "LAN" "blue:lan" "switch0" "0x02" + ;; pcs,cr3000) ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth1" ucidef_set_led_switch "lan1" "LAN1" "blue:lan1" "switch0" "0x04" 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 14e858b8fa..fa98b18e59 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -152,6 +152,7 @@ ath79_setup_interfaces() comfast,cf-e120a-v3|\ comfast,cf-e314n-v2|\ compex,wpj531-16m|\ + openmesh,om2p-v4|\ plasmacloud,pa300|\ plasmacloud,pa300e|\ tplink,cpe210-v1|\ diff --git a/target/linux/ath79/generic/base-files/lib/upgrade/openmesh.sh b/target/linux/ath79/generic/base-files/lib/upgrade/openmesh.sh new file mode 100644 index 0000000000..35a4ccfbfe --- /dev/null +++ b/target/linux/ath79/generic/base-files/lib/upgrade/openmesh.sh @@ -0,0 +1,112 @@ +# The U-Boot loader of the OpenMesh devices requires image sizes and +# checksums to be provided in the U-Boot environment. +# The OpenMesh devices come with 2 main partitions - while one is active +# sysupgrade will flash the other. The boot order is changed to boot the +# newly flashed partition. If the new partition can't be booted due to +# upgrade failures the previously used partition is loaded. + +cfg_value_get() +{ + local cfg=$1 cfg_opt + local section=$2 our_section=0 + local param=$3 our_param= + + for cfg_opt in $cfg; do + [ "$cfg_opt" = "[$section]" ] && our_section=1 && continue + [ "$our_section" = "1" ] || continue + + our_param=${cfg_opt%%=*} + [ "$param" = "$our_param" ] && echo ${cfg_opt##*=} && break + done +} + +platform_do_upgrade_openmesh() +{ + local img_path="$1" + local restore_backup + + local setenv_script="/tmp/fw_env_upgrade" + + local inactive_mtd="$(find_mtd_index $PART_NAME)" + local inactive_offset="$(cat /sys/class/mtd/mtd${inactive_mtd}/offset)" + local total_size="$(cat /sys/class/mtd/mtd${inactive_mtd}/size)" + local flash_start_mem=0x9f000000 + local data_offset=$((64 * 1024)) + + # detect to which flash region the new image is written to. + # + # 1. check what is the mtd index for the first flash region on this + # device + # 2. check if the target partition ("inactive") has the mtd index of + # the first flash region + # + # - when it is: the new bootseq will be 1,2 and the first region is + # modified + # - when it isn't: bootseq will be 2,1 and the second region is + # modified + # + # The detection has to be done via the hardcoded mtd partition because + # the current boot might be done with the fallback region. Let us + # assume that the current bootseq is 1,2. The bootloader detected that + # the image in flash region 1 is corrupt and thus switches to flash + # region 2. The bootseq in the u-boot-env is now still the same and + # the sysupgrade code can now only rely on the actual mtd indexes and + # not the bootseq variable to detect the currently booted flash + # region/image. + # + # In the above example, an implementation which uses bootseq ("1,2") to + # detect the currently booted image would assume that region 1 is booted + # and then overwrite the variables for the wrong flash region (aka the + # one which isn't modified). This could result in a device which doesn't + # boot anymore to Linux until it was reflashed with ap51-flash. + local next_boot_part="1" + local primary_kernel_mtd="3" + [ "$inactive_mtd" = "$primary_kernel_mtd" ] || next_boot_part="2" + + local cfg_size=$(dd if="$img_path" bs=2 skip=35 count=4 2>/dev/null) + local cfg_length=$((0x$cfg_size)) + local cfg_content=$(dd if="$img_path" bs=1 skip=$data_offset count=$cfg_length 2>/dev/null) + + local kernel_size=$(dd if="$img_path" bs=2 skip=71 count=4 2>/dev/null) + local kernel_length=$((0x$kernel_size)) + local kernel_md5=$(cfg_value_get "$cfg_content" "vmlinux" "md5sum") + + local rootfs_size=$(dd if="$img_path" bs=2 skip=107 count=4 2>/dev/null) + local rootfs_length=$((0x$rootfs_size)) + local rootfs_md5=$(cfg_value_get "$cfg_content" "rootfs" "md5sum") + local rootfs_checksize=$(cfg_value_get "$cfg_content" "rootfs" "checksize") + + # take care of restoring a saved config + [ -n "$UPGRADE_BACKUP" ] && restore_backup="${MTD_CONFIG_ARGS} -j ${UPGRADE_BACKUP}" + + # write image parts + mtd -q erase inactive + dd if="$img_path" bs=1 skip=$((data_offset + cfg_length + kernel_length)) count=$rootfs_length 2>&- | \ + mtd -n -p $kernel_length $restore_backup write - $PART_NAME + dd if="$img_path" bs=1 skip=$((data_offset + cfg_length)) count=$kernel_length 2>&- | \ + mtd -n write - $PART_NAME + + # prepare new u-boot env + if [ "$next_boot_part" = "1" ]; then + echo "bootseq 1,2" > $setenv_script + else + echo "bootseq 2,1" > $setenv_script + fi + + printf "kernel_size_%i %i\n" $next_boot_part $((kernel_length / 1024)) >> $setenv_script + printf "vmlinux_start_addr 0x%08x\n" $((flash_start_mem + inactive_offset)) >> $setenv_script + printf "vmlinux_size 0x%08x\n" ${kernel_length} >> $setenv_script + printf "vmlinux_checksum %s\n" ${kernel_md5} >> $setenv_script + + printf "rootfs_size_%i %i\n" $next_boot_part $(((total_size-kernel_length) / 1024)) >> $setenv_script + printf "rootfs_start_addr 0x%08x\n" $((flash_start_mem+inactive_offset+kernel_length)) >> $setenv_script + printf "rootfs_size %s\n" $rootfs_checksize >> $setenv_script + printf "rootfs_checksum %s\n" ${rootfs_md5} >> $setenv_script + + # store u-boot env changes + mkdir -p /var/lock + fw_setenv -s $setenv_script || { + echo "failed to update U-Boot environment" + return 1 + } +} diff --git a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh index 98861685dc..88dac75301 100644 --- a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh +++ b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh @@ -50,6 +50,10 @@ platform_do_upgrade() { jjplus,ja76pf2) redboot_fis_do_upgrade "$1" linux ;; + openmesh,om2p-v4) + PART_NAME="inactive" + platform_do_upgrade_openmesh "$1" + ;; plasmacloud,pa300|\ plasmacloud,pa300e) PART_NAME="inactive" diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 63a07a9d5c..132bde73c4 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -1557,6 +1557,26 @@ define Device/ocedo_ursus endef TARGET_DEVICES += ocedo_ursus +define Device/openmesh_om2p-common + DEVICE_VENDOR := OpenMesh + DEVICE_PACKAGES := uboot-envtools + IMAGE_SIZE := 7168k + BLOCKSIZE := 256k + KERNEL := kernel-bin | append-dtb | lzma | uImage lzma | \ + pad-to $$(BLOCKSIZE) + IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | \ + openmesh-image ce_type=OM2P | append-metadata +endef + +define Device/openmesh_om2p-v4 + $(Device/openmesh_om2p-common) + SOC := qca9533 + DEVICE_MODEL := OM2P + DEVICE_VARIANT := v4 + SUPPORTED_DEVICES += om2pv4 +endef +TARGET_DEVICES += openmesh_om2p-v4 + define Device/openmesh_om5p-ac-v2 SOC := qca9558 DEVICE_VENDOR := OpenMesh From 5b37b52e69884c6c843738cc45ed8a1deba0eba3 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Mon, 23 Nov 2020 13:41:34 +0100 Subject: [PATCH 10/26] ath79: Add support for OpenMesh OM2P-HS v4 Device specifications: ====================== * Qualcomm/Atheros QCA9533 v2 * 650/600/217 MHz (CPU/DDR/AHB) * 64 MB of RAM * 16 MB of SPI NOR flash - 2x 7 MB available; but one of the 7 MB regions is the recovery image * 2x 10/100 Mbps Ethernet * 2T2R 2.4 GHz Wi-Fi * 6x GPIO-LEDs (3x wifi, 2x ethernet, 1x power) * 1x GPIO-button (reset) * external h/w watchdog (enabled by default) * TTL pins are on board (arrow points to VCC, then follows: GND, TX, RX) * 2x fast ethernet - eth0 + 24V passive POE (mode B) + used as WAN interface - eth1 + 802.3af POE + builtin switch port 1 + used as LAN interface * 12-24V 1A DC * internal antennas Flashing instructions: ====================== Various methods can be used to install the actual image on the flash. Two easy ones are: ap51-flash ---------- The tool ap51-flash (https://github.com/ap51-flash/ap51-flash) should be used to transfer the image to the u-boot when the device boots up. initramfs from TFTP ------------------- The serial console must be used to access the u-boot shell during bootup. It can then be used to first boot up the initramfs image from a TFTP server (here with the IP 192.168.1.21): setenv serverip 192.168.1.21 setenv ipaddr 192.168.1.1 tftpboot 0c00000 .bin && bootm $fileaddr The actual sysupgrade image can then be transferred (on the LAN port) to the device via scp .bin root@192.168.1.1:/tmp/ On the device, the sysupgrade must then be started using sysupgrade -n /tmp/.bin Signed-off-by: Sven Eckelmann --- package/boot/uboot-envtools/Makefile | 2 +- package/boot/uboot-envtools/files/ath79 | 1 + target/linux/ath79/dts/qca9533_openmesh_om2p-hs-v4.dts | 8 ++++++++ .../linux/ath79/generic/base-files/etc/board.d/01_leds | 3 ++- .../ath79/generic/base-files/etc/board.d/02_network | 1 + .../ath79/generic/base-files/lib/upgrade/platform.sh | 3 ++- target/linux/ath79/image/generic.mk | 9 +++++++++ 7 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 target/linux/ath79/dts/qca9533_openmesh_om2p-hs-v4.dts diff --git a/package/boot/uboot-envtools/Makefile b/package/boot/uboot-envtools/Makefile index 4d2b03e33c..539e65e762 100644 --- a/package/boot/uboot-envtools/Makefile +++ b/package/boot/uboot-envtools/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uboot-envtools PKG_DISTNAME:=u-boot PKG_VERSION:=2020.04 -PKG_RELEASE:=10 +PKG_RELEASE:=11 PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:= \ diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index ba857e54ed..a7564bc89e 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -86,6 +86,7 @@ netgear,wndr4300sw) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x20000" ;; openmesh,om2p-v4|\ +openmesh,om2p-hs-v4|\ plasmacloud,pa300|\ plasmacloud,pa300e) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x40000" diff --git a/target/linux/ath79/dts/qca9533_openmesh_om2p-hs-v4.dts b/target/linux/ath79/dts/qca9533_openmesh_om2p-hs-v4.dts new file mode 100644 index 0000000000..218117fd86 --- /dev/null +++ b/target/linux/ath79/dts/qca9533_openmesh_om2p-hs-v4.dts @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca9533_openmesh_om2p-v4.dtsi" + +/ { + compatible = "openmesh,om2p-hs-v4", "qca,qca9533"; + model = "OpenMesh OM2P-HS v4"; +}; 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 8095712e88..5795e2a0ae 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds @@ -230,7 +230,8 @@ netgear,wnr2200-16m) ucidef_set_led_switch "lan3amber" "LAN3 (amber)" "amber:lan3" "switch0" "0x08" "0x02" ucidef_set_led_switch "lan4amber" "LAN4 (amber)" "amber:lan4" "switch0" "0x10" "0x02" ;; -openmesh,om2p-v4) +openmesh,om2p-v4|\ +openmesh,om2p-hs-v4) ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth0" ucidef_set_led_switch "lan" "LAN" "blue:lan" "switch0" "0x02" ;; 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 fa98b18e59..f78fdeea9c 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -153,6 +153,7 @@ ath79_setup_interfaces() comfast,cf-e314n-v2|\ compex,wpj531-16m|\ openmesh,om2p-v4|\ + openmesh,om2p-hs-v4|\ plasmacloud,pa300|\ plasmacloud,pa300e|\ tplink,cpe210-v1|\ diff --git a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh index 88dac75301..6f0ab8f8a6 100644 --- a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh +++ b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh @@ -50,7 +50,8 @@ platform_do_upgrade() { jjplus,ja76pf2) redboot_fis_do_upgrade "$1" linux ;; - openmesh,om2p-v4) + openmesh,om2p-v4|\ + openmesh,om2p-hs-v4) PART_NAME="inactive" platform_do_upgrade_openmesh "$1" ;; diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 132bde73c4..66a39e06d2 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -1577,6 +1577,15 @@ define Device/openmesh_om2p-v4 endef TARGET_DEVICES += openmesh_om2p-v4 +define Device/openmesh_om2p-hs-v4 + $(Device/openmesh_om2p-common) + SOC := qca9533 + DEVICE_MODEL := OM2P-HS + DEVICE_VARIANT := v4 + SUPPORTED_DEVICES += om2p-hsv4 +endef +TARGET_DEVICES += openmesh_om2p-hs-v4 + define Device/openmesh_om5p-ac-v2 SOC := qca9558 DEVICE_VENDOR := OpenMesh From d0a9cf662ee0e5bbe49f6b443e1374e73b10a946 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Mon, 28 Dec 2020 16:59:13 +0100 Subject: [PATCH 11/26] ath79: increase openmesh sysupgrade copy block size The upgrade script for the openmesh sysupgrade procedure used always an 1 byte block size. This made it easier to seek the correct position in the CE image and to make sure the right amount of data was copied. But this also meant that the reading/writing of data required an excessive amount of syscalls and copy operations. A 5.4MB big sysupgrade image on an OM2P-HS v3 needed roughly 120s for the write operation (170s in total) during the sysupgrade. But it is possible to reduce this overhead slightly: * index access to read the file size can be done in single 8 byte chunk (while doing the seek with byte granularity) because each size entry is example 8 bytes long * the fwupgrade.cfg can be read as one block (while seeking to its position using its actual byte offset) because it should be rather small and fit into the RAM easily * the kernel can be read in 1KB blocks (while seking to its positions using its actual byte offset) because the the size of the kernel is always a multiple of the NOR flash block size (64KB and 256KB) This results in a sysupgrade write time of roughly 90s (140s in total). This could be reduced even further when also using larger chunks for the rootfs. But the squashfs rootfs image is at the moment always (256KB or 64KB) * block + 4 bytes long. It would be expected that the time for the sysupgrade write could be reduced to roughly 30s (80s in total) when busybox's dd would support the iflag count_bytes. Reported-by: Adrian Schmutzler Signed-off-by: Sven Eckelmann --- .../generic/base-files/lib/upgrade/openmesh.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/target/linux/ath79/generic/base-files/lib/upgrade/openmesh.sh b/target/linux/ath79/generic/base-files/lib/upgrade/openmesh.sh index 35a4ccfbfe..fdb57dbed9 100644 --- a/target/linux/ath79/generic/base-files/lib/upgrade/openmesh.sh +++ b/target/linux/ath79/generic/base-files/lib/upgrade/openmesh.sh @@ -30,6 +30,7 @@ platform_do_upgrade_openmesh() local inactive_mtd="$(find_mtd_index $PART_NAME)" local inactive_offset="$(cat /sys/class/mtd/mtd${inactive_mtd}/offset)" local total_size="$(cat /sys/class/mtd/mtd${inactive_mtd}/size)" + local total_kbs=$((total_size / 1024)) local flash_start_mem=0x9f000000 local data_offset=$((64 * 1024)) @@ -63,15 +64,16 @@ platform_do_upgrade_openmesh() local primary_kernel_mtd="3" [ "$inactive_mtd" = "$primary_kernel_mtd" ] || next_boot_part="2" - local cfg_size=$(dd if="$img_path" bs=2 skip=35 count=4 2>/dev/null) + local cfg_size=$(dd if="$img_path" bs=8 skip=70 count=1 iflag=skip_bytes 2>/dev/null) local cfg_length=$((0x$cfg_size)) - local cfg_content=$(dd if="$img_path" bs=1 skip=$data_offset count=$cfg_length 2>/dev/null) + local cfg_content=$(dd if="$img_path" bs=$cfg_length skip=$data_offset count=1 iflag=skip_bytes 2>/dev/null) - local kernel_size=$(dd if="$img_path" bs=2 skip=71 count=4 2>/dev/null) + local kernel_size=$(dd if="$img_path" bs=8 skip=142 count=1 iflag=skip_bytes 2>/dev/null) local kernel_length=$((0x$kernel_size)) + local kernel_kbs=$((kernel_length / 1024)) local kernel_md5=$(cfg_value_get "$cfg_content" "vmlinux" "md5sum") - local rootfs_size=$(dd if="$img_path" bs=2 skip=107 count=4 2>/dev/null) + local rootfs_size=$(dd if="$img_path" bs=8 skip=214 count=1 iflag=skip_bytes 2>/dev/null) local rootfs_length=$((0x$rootfs_size)) local rootfs_md5=$(cfg_value_get "$cfg_content" "rootfs" "md5sum") local rootfs_checksize=$(cfg_value_get "$cfg_content" "rootfs" "checksize") @@ -83,7 +85,7 @@ platform_do_upgrade_openmesh() mtd -q erase inactive dd if="$img_path" bs=1 skip=$((data_offset + cfg_length + kernel_length)) count=$rootfs_length 2>&- | \ mtd -n -p $kernel_length $restore_backup write - $PART_NAME - dd if="$img_path" bs=1 skip=$((data_offset + cfg_length)) count=$kernel_length 2>&- | \ + dd if="$img_path" bs=1024 skip=$((data_offset + cfg_length)) count=$kernel_kbs iflag=skip_bytes 2>&- | \ mtd -n write - $PART_NAME # prepare new u-boot env @@ -93,12 +95,12 @@ platform_do_upgrade_openmesh() echo "bootseq 2,1" > $setenv_script fi - printf "kernel_size_%i %i\n" $next_boot_part $((kernel_length / 1024)) >> $setenv_script + printf "kernel_size_%i %i\n" $next_boot_part $kernel_kbs >> $setenv_script printf "vmlinux_start_addr 0x%08x\n" $((flash_start_mem + inactive_offset)) >> $setenv_script printf "vmlinux_size 0x%08x\n" ${kernel_length} >> $setenv_script printf "vmlinux_checksum %s\n" ${kernel_md5} >> $setenv_script - printf "rootfs_size_%i %i\n" $next_boot_part $(((total_size-kernel_length) / 1024)) >> $setenv_script + printf "rootfs_size_%i %i\n" $next_boot_part $((total_kbs - kernel_kbs)) >> $setenv_script printf "rootfs_start_addr 0x%08x\n" $((flash_start_mem+inactive_offset+kernel_length)) >> $setenv_script printf "rootfs_size %s\n" $rootfs_checksize >> $setenv_script printf "rootfs_checksum %s\n" ${rootfs_md5} >> $setenv_script From dbb542f194023835d628944917a99cc469fff903 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Mon, 28 Dec 2020 23:08:56 +0100 Subject: [PATCH 12/26] bcm63xx-cfe: update to the latest master MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit c0b3691 netgear: r8000p: add cferam file ae870eb asus: gt-ac5300: add cferam file 424b57c sfr: neufbox-6v-foxconn-r0: update cferam file 81a2a8b sfr: neufbox-6v-foxconn-r0: add cferam file 2730361 sercomm: h500-s: add cferam file Signed-off-by: Rafał Miłecki --- package/kernel/bcm63xx-cfe/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/kernel/bcm63xx-cfe/Makefile b/package/kernel/bcm63xx-cfe/Makefile index 33616cc0d5..bdc8b2cc76 100644 --- a/package/kernel/bcm63xx-cfe/Makefile +++ b/package/kernel/bcm63xx-cfe/Makefile @@ -2,13 +2,13 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=bcm63xx-cfe -PKG_RELEASE:=2 +PKG_RELEASE:=1 PKG_SOURCE_URL:=https://github.com/openwrt/bcm63xx-cfe.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2020-05-18 -PKG_SOURCE_VERSION:=efe3b81121a84c0b8ba6a7d0d47cd5eeeb23808d -PKG_MIRROR_HASH:=299dcf6ef1ad034df26daee6446b574abcd7526a2fe90fb8115890e71bc0d58b +PKG_SOURCE_DATE:=2020-12-27 +PKG_SOURCE_VERSION:=c0b36917ea565c4ffac2e723f77c9d27d0691c33 +PKG_MIRROR_HASH:=75262534b1fbeba2299621ec3112d9d22b3e3de4cb73e8d7cac1e0b7e5eece77 PKG_FLAGS:=nonshared From a462412977cc25b79a7a3479527e754d85c23fd7 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Mon, 23 Nov 2020 13:41:34 +0100 Subject: [PATCH 13/26] ath79: add support for OpenMesh OM2P-HS v1 Device specifications: ====================== * Qualcomm/Atheros AR9341 rev 1 * 535/400/200 MHz (CPU/DDR/AHB) * 64 MB of RAM * 16 MB of SPI NOR flash - 2x 7 MB available; but one of the 7 MB regions is the recovery image * 2x 10/100 Mbps Ethernet * 2T2R 2.4 GHz Wi-Fi * 6x GPIO-LEDs (3x wifi, 2x ethernet, 1x power) * 1x GPIO-button (reset) * external h/w watchdog (enabled by default) * TTL pins are on board (arrow points to VCC, then follows: GND, TX, RX) * 2x fast ethernet - eth0 + 802.3af POE + builtin switch port 1 + used as LAN interface - eth1 + 18-24V passive POE (mode B) + used as WAN interface * 12-24V 1A DC * internal antennas Flashing instructions: ====================== Various methods can be used to install the actual image on the flash. Two easy ones are: ap51-flash ---------- The tool ap51-flash (https://github.com/ap51-flash/ap51-flash) should be used to transfer the image to the u-boot when the device boots up. initramfs from TFTP ------------------- The serial console must be used to access the u-boot shell during bootup. It can then be used to first boot up the initramfs image from a TFTP server (here with the IP 192.168.1.21): setenv serverip 192.168.1.21 setenv ipaddr 192.168.1.1 tftpboot 0c00000 .bin && bootm $fileaddr The actual sysupgrade image can then be transferred (on the LAN port) to the device via scp .bin root@192.168.1.1:/tmp/ On the device, the sysupgrade must then be started using sysupgrade -n /tmp/.bin Signed-off-by: Sven Eckelmann [drop redundant status from eth1] Signed-off-by: Adrian Schmutzler --- package/boot/uboot-envtools/Makefile | 2 +- package/boot/uboot-envtools/files/ath79 | 1 + .../ath79/dts/ar9341_openmesh_om2p-hs-v1.dts | 8 + .../ath79/dts/ar9341_openmesh_om2p-hs.dtsi | 161 ++++++++++++++++++ .../generic/base-files/etc/board.d/01_leds | 1 + .../base-files/lib/upgrade/platform.sh | 1 + target/linux/ath79/image/generic.mk | 9 + 7 files changed, 182 insertions(+), 1 deletion(-) create mode 100644 target/linux/ath79/dts/ar9341_openmesh_om2p-hs-v1.dts create mode 100644 target/linux/ath79/dts/ar9341_openmesh_om2p-hs.dtsi diff --git a/package/boot/uboot-envtools/Makefile b/package/boot/uboot-envtools/Makefile index 539e65e762..3493332cee 100644 --- a/package/boot/uboot-envtools/Makefile +++ b/package/boot/uboot-envtools/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uboot-envtools PKG_DISTNAME:=u-boot PKG_VERSION:=2020.04 -PKG_RELEASE:=11 +PKG_RELEASE:=12 PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:= \ diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index a7564bc89e..bc69d35c96 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -86,6 +86,7 @@ netgear,wndr4300sw) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x20000" ;; openmesh,om2p-v4|\ +openmesh,om2p-hs-v1|\ openmesh,om2p-hs-v4|\ plasmacloud,pa300|\ plasmacloud,pa300e) diff --git a/target/linux/ath79/dts/ar9341_openmesh_om2p-hs-v1.dts b/target/linux/ath79/dts/ar9341_openmesh_om2p-hs-v1.dts new file mode 100644 index 0000000000..e1f14cd5c2 --- /dev/null +++ b/target/linux/ath79/dts/ar9341_openmesh_om2p-hs-v1.dts @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9341_openmesh_om2p-hs.dtsi" + +/ { + compatible = "openmesh,om2p-hs-v1", "qca,ar9341"; + model = "OpenMesh OM2P-HS v1"; +}; diff --git a/target/linux/ath79/dts/ar9341_openmesh_om2p-hs.dtsi b/target/linux/ath79/dts/ar9341_openmesh_om2p-hs.dtsi new file mode 100644 index 0000000000..403ee940c1 --- /dev/null +++ b/target/linux/ath79/dts/ar9341_openmesh_om2p-hs.dtsi @@ -0,0 +1,161 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9341.dtsi" + +#include +#include + +/ { + chosen { + /delete-property/ bootargs; + }; + + aliases { + serial0 = &uart; + led-boot = &led_power_blue; + led-failsafe = &led_power_blue; + led-running = &led_power_blue; + led-upgrade = &led_power_blue; + label-mac-device = ð1; + }; + + keys { + compatible = "gpio-keys"; + + pinctrl-names = "default"; + pinctrl-0 = <&jtag_disable_pins &led_lan_wan_blue_pin>; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power_blue: power_blue { + label = "blue:power"; + gpios = <&gpio 0 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + wifi_green { + label = "green:wifi"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + wifi_red { + label = "red:wifi"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + wifi_yellow { + label = "yellow:wifi"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + lan_blue { + label = "blue:lan"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + + wan_blue { + label = "blue:wan"; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + }; + + watchdog { + compatible = "linux,wdt-gpio"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + hw_algo = "toggle"; + /* hw_margin_ms is actually 300s but driver limits it to 60s */ + hw_margin_ms = <60000>; + always-running; + }; +}; + +&ref { + clock-frequency = <40000000>; +}; + +&uart { + status = "okay"; +}; + +&pinmux { + led_lan_wan_blue_pin: pinmux_lan_wan_blue_pin { + pinctrl-single,bits = <0x10 0x0 0x0000ffff>; + }; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + + /* partitions are passed via bootloader */ + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x040000>; + }; + + partition@80000 { + label = "custom"; + reg = <0x080000 0x140000>; + read-only; + }; + + partition@1c0000 { + label = "inactive"; + reg = <0x1c0000 0x700000>; + }; + + partition@8c0000 { + label = "inactive2"; + reg = <0x8c0000 0x700000>; + }; + + art: partition@fc0000 { + label = "ART"; + reg = <0xfc0000 0x040000>; + read-only; + }; + }; + }; +}; + +ð0 { + status = "okay"; + + phy-handle = <&swphy4>; + + mtd-mac-address = <&art 0x6>; +}; + +ð1 { + mtd-mac-address = <&art 0x0>; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; 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 5795e2a0ae..057bec3bc8 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds @@ -145,6 +145,7 @@ comfast,cf-e560ac) ucidef_set_led_switch "lan4" "LAN4" "blue:lan4" "switch0" "0x10" ;; comfast,cf-ew72|\ +openmesh,om2p-hs-v1|\ telco,t1) ucidef_set_led_switch "lan" "LAN" "blue:lan" "switch0" "0x02" ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth1" diff --git a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh index 6f0ab8f8a6..e3298cfc13 100644 --- a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh +++ b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh @@ -51,6 +51,7 @@ platform_do_upgrade() { redboot_fis_do_upgrade "$1" linux ;; openmesh,om2p-v4|\ + openmesh,om2p-hs-v1|\ openmesh,om2p-hs-v4) PART_NAME="inactive" platform_do_upgrade_openmesh "$1" diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 66a39e06d2..1454c14e44 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -1577,6 +1577,15 @@ define Device/openmesh_om2p-v4 endef TARGET_DEVICES += openmesh_om2p-v4 +define Device/openmesh_om2p-hs-v1 + $(Device/openmesh_om2p-common) + SOC := ar9341 + DEVICE_MODEL := OM2P-HS + DEVICE_VARIANT := v1 + SUPPORTED_DEVICES += om2p-hs +endef +TARGET_DEVICES += openmesh_om2p-hs-v1 + define Device/openmesh_om2p-hs-v4 $(Device/openmesh_om2p-common) SOC := qca9533 From f096accce26bc46831e859ccd40b3f88e404cc7e Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Mon, 23 Nov 2020 13:41:34 +0100 Subject: [PATCH 14/26] ath79: add support for OpenMesh OM2P-HS v2 Device specifications: ====================== * Qualcomm/Atheros AR9341 rev 1 * 535/400/200 MHz (CPU/DDR/AHB) * 64 MB of RAM * 16 MB of SPI NOR flash - 2x 7 MB available; but one of the 7 MB regions is the recovery image * 2x 10/100 Mbps Ethernet * 2T2R 2.4 GHz Wi-Fi * 6x GPIO-LEDs (3x wifi, 2x ethernet, 1x power) * 1x GPIO-button (reset) * external h/w watchdog (enabled by default) * TTL pins are on board (arrow points to VCC, then follows: GND, TX, RX) * 2x fast ethernet - eth0 + 802.3af POE + builtin switch port 1 + used as LAN interface - eth1 + 18-24V passive POE (mode B) + used as WAN interface * 12-24V 1A DC * internal antennas Flashing instructions: ====================== Various methods can be used to install the actual image on the flash. Two easy ones are: ap51-flash ---------- The tool ap51-flash (https://github.com/ap51-flash/ap51-flash) should be used to transfer the image to the u-boot when the device boots up. initramfs from TFTP ------------------- The serial console must be used to access the u-boot shell during bootup. It can then be used to first boot up the initramfs image from a TFTP server (here with the IP 192.168.1.21): setenv serverip 192.168.1.21 setenv ipaddr 192.168.1.1 tftpboot 0c00000 .bin && bootm $fileaddr The actual sysupgrade image can then be transferred (on the LAN port) to the device via scp .bin root@192.168.1.1:/tmp/ On the device, the sysupgrade must then be started using sysupgrade -n /tmp/.bin Signed-off-by: Sven Eckelmann --- package/boot/uboot-envtools/Makefile | 2 +- package/boot/uboot-envtools/files/ath79 | 1 + target/linux/ath79/dts/ar9341_openmesh_om2p-hs-v2.dts | 8 ++++++++ .../linux/ath79/generic/base-files/etc/board.d/01_leds | 1 + .../ath79/generic/base-files/lib/upgrade/platform.sh | 1 + target/linux/ath79/image/generic.mk | 9 +++++++++ 6 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 target/linux/ath79/dts/ar9341_openmesh_om2p-hs-v2.dts diff --git a/package/boot/uboot-envtools/Makefile b/package/boot/uboot-envtools/Makefile index 3493332cee..85a67c1ac3 100644 --- a/package/boot/uboot-envtools/Makefile +++ b/package/boot/uboot-envtools/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uboot-envtools PKG_DISTNAME:=u-boot PKG_VERSION:=2020.04 -PKG_RELEASE:=12 +PKG_RELEASE:=13 PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:= \ diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index bc69d35c96..212143f49b 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -87,6 +87,7 @@ netgear,wndr4300sw) ;; openmesh,om2p-v4|\ openmesh,om2p-hs-v1|\ +openmesh,om2p-hs-v2|\ openmesh,om2p-hs-v4|\ plasmacloud,pa300|\ plasmacloud,pa300e) diff --git a/target/linux/ath79/dts/ar9341_openmesh_om2p-hs-v2.dts b/target/linux/ath79/dts/ar9341_openmesh_om2p-hs-v2.dts new file mode 100644 index 0000000000..819a6be97f --- /dev/null +++ b/target/linux/ath79/dts/ar9341_openmesh_om2p-hs-v2.dts @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9341_openmesh_om2p-hs.dtsi" + +/ { + compatible = "openmesh,om2p-hs-v2", "qca,ar9341"; + model = "OpenMesh OM2P-HS v2"; +}; 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 057bec3bc8..8926ffc0c8 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds @@ -146,6 +146,7 @@ comfast,cf-e560ac) ;; comfast,cf-ew72|\ openmesh,om2p-hs-v1|\ +openmesh,om2p-hs-v2|\ telco,t1) ucidef_set_led_switch "lan" "LAN" "blue:lan" "switch0" "0x02" ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth1" diff --git a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh index e3298cfc13..73c328173a 100644 --- a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh +++ b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh @@ -52,6 +52,7 @@ platform_do_upgrade() { ;; openmesh,om2p-v4|\ openmesh,om2p-hs-v1|\ + openmesh,om2p-hs-v2|\ openmesh,om2p-hs-v4) PART_NAME="inactive" platform_do_upgrade_openmesh "$1" diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 1454c14e44..4e80ac8402 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -1586,6 +1586,15 @@ define Device/openmesh_om2p-hs-v1 endef TARGET_DEVICES += openmesh_om2p-hs-v1 +define Device/openmesh_om2p-hs-v2 + $(Device/openmesh_om2p-common) + SOC := ar9341 + DEVICE_MODEL := OM2P-HS + DEVICE_VARIANT := v2 + SUPPORTED_DEVICES += om2p-hsv2 +endef +TARGET_DEVICES += openmesh_om2p-hs-v2 + define Device/openmesh_om2p-hs-v4 $(Device/openmesh_om2p-common) SOC := qca9533 From 75900a25ed2acd4201bcd9a5516bdf7cdb9a8e73 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Mon, 23 Nov 2020 13:41:34 +0100 Subject: [PATCH 15/26] ath79: add support for OpenMesh OM2P-HS v3 Device specifications: ====================== * Qualcomm/Atheros AR9341 rev 1 * 535/400/200 MHz (CPU/DDR/AHB) * 64 MB of RAM * 16 MB of SPI NOR flash - 2x 7 MB available; but one of the 7 MB regions is the recovery image * 2x 10/100 Mbps Ethernet * 2T2R 2.4 GHz Wi-Fi * 6x GPIO-LEDs (3x wifi, 2x ethernet, 1x power) * 1x GPIO-button (reset) * external h/w watchdog (enabled by default) * TTL pins are on board (arrow points to VCC, then follows: GND, TX, RX) * 2x fast ethernet - eth0 + 802.3af POE + builtin switch port 1 + used as LAN interface - eth1 + 18-24V passive POE (mode B) + used as WAN interface * 12-24V 1A DC * internal antennas Flashing instructions: ====================== Various methods can be used to install the actual image on the flash. Two easy ones are: ap51-flash ---------- The tool ap51-flash (https://github.com/ap51-flash/ap51-flash) should be used to transfer the image to the u-boot when the device boots up. initramfs from TFTP ------------------- The serial console must be used to access the u-boot shell during bootup. It can then be used to first boot up the initramfs image from a TFTP server (here with the IP 192.168.1.21): setenv serverip 192.168.1.21 setenv ipaddr 192.168.1.1 tftpboot 0c00000 .bin && bootm $fileaddr The actual sysupgrade image can then be transferred (on the LAN port) to the device via scp .bin root@192.168.1.1:/tmp/ On the device, the sysupgrade must then be started using sysupgrade -n /tmp/.bin Signed-off-by: Sven Eckelmann --- package/boot/uboot-envtools/Makefile | 2 +- package/boot/uboot-envtools/files/ath79 | 1 + target/linux/ath79/dts/ar9341_openmesh_om2p-hs-v3.dts | 8 ++++++++ .../linux/ath79/generic/base-files/etc/board.d/01_leds | 1 + .../ath79/generic/base-files/lib/upgrade/platform.sh | 1 + target/linux/ath79/image/generic.mk | 9 +++++++++ 6 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 target/linux/ath79/dts/ar9341_openmesh_om2p-hs-v3.dts diff --git a/package/boot/uboot-envtools/Makefile b/package/boot/uboot-envtools/Makefile index 85a67c1ac3..7557984595 100644 --- a/package/boot/uboot-envtools/Makefile +++ b/package/boot/uboot-envtools/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uboot-envtools PKG_DISTNAME:=u-boot PKG_VERSION:=2020.04 -PKG_RELEASE:=13 +PKG_RELEASE:=14 PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:= \ diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index 212143f49b..2865501f26 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -88,6 +88,7 @@ netgear,wndr4300sw) openmesh,om2p-v4|\ openmesh,om2p-hs-v1|\ openmesh,om2p-hs-v2|\ +openmesh,om2p-hs-v3|\ openmesh,om2p-hs-v4|\ plasmacloud,pa300|\ plasmacloud,pa300e) diff --git a/target/linux/ath79/dts/ar9341_openmesh_om2p-hs-v3.dts b/target/linux/ath79/dts/ar9341_openmesh_om2p-hs-v3.dts new file mode 100644 index 0000000000..e3b15b17f6 --- /dev/null +++ b/target/linux/ath79/dts/ar9341_openmesh_om2p-hs-v3.dts @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9341_openmesh_om2p-hs.dtsi" + +/ { + compatible = "openmesh,om2p-hs-v3", "qca,ar9341"; + model = "OpenMesh OM2P-HS v3"; +}; 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 8926ffc0c8..3889969ee5 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds @@ -147,6 +147,7 @@ comfast,cf-e560ac) comfast,cf-ew72|\ openmesh,om2p-hs-v1|\ openmesh,om2p-hs-v2|\ +openmesh,om2p-hs-v3|\ telco,t1) ucidef_set_led_switch "lan" "LAN" "blue:lan" "switch0" "0x02" ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth1" diff --git a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh index 73c328173a..9ff36f1bf5 100644 --- a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh +++ b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh @@ -53,6 +53,7 @@ platform_do_upgrade() { openmesh,om2p-v4|\ openmesh,om2p-hs-v1|\ openmesh,om2p-hs-v2|\ + openmesh,om2p-hs-v3|\ openmesh,om2p-hs-v4) PART_NAME="inactive" platform_do_upgrade_openmesh "$1" diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 4e80ac8402..631cc2fd6a 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -1595,6 +1595,15 @@ define Device/openmesh_om2p-hs-v2 endef TARGET_DEVICES += openmesh_om2p-hs-v2 +define Device/openmesh_om2p-hs-v3 + $(Device/openmesh_om2p-common) + SOC := ar9341 + DEVICE_MODEL := OM2P-HS + DEVICE_VARIANT := v3 + SUPPORTED_DEVICES += om2p-hsv3 +endef +TARGET_DEVICES += openmesh_om2p-hs-v3 + define Device/openmesh_om2p-hs-v4 $(Device/openmesh_om2p-common) SOC := qca9533 From 6a46615f372c02650f290614a8c5351bbadc80ed Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 29 Dec 2020 01:03:20 +0100 Subject: [PATCH 16/26] imagebuilder: invoke bundle-libraries.sh w/o buildroot dirs in $PATH Invoke bundle-libraries.sh with any buildroot related directory entries removed from $PATH to avoid picking up cross versions of utilities like ldd which will not properly work when used against host executables. This should fix executable bundling for glibc-target imagebuilders. Signed-off-by: Jo-Philipp Wich --- target/imagebuilder/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/target/imagebuilder/Makefile b/target/imagebuilder/Makefile index e7954e96a4..f9c08776a8 100644 --- a/target/imagebuilder/Makefile +++ b/target/imagebuilder/Makefile @@ -19,6 +19,9 @@ IB_LDIR:=$(patsubst $(TOPDIR)/%,$(PKG_BUILD_DIR)/%,$(LINUX_DIR)) IB_DTSDIR:=$(patsubst $(TOPDIR)/%,$(PKG_BUILD_DIR)/%,$(LINUX_DIR))/arch/$(LINUX_KARCH)/boot/dts/ IB_IDIR:=$(patsubst $(TOPDIR)/%,$(PKG_BUILD_DIR)/%,$(STAGING_DIR_IMAGE)) +BUNDLER_PATH := $(subst $(space),:,$(filter-out $(TOPDIR)/%,$(subst :,$(space),$(PATH)))) +BUNDLER_COMMAND := PATH=$(BUNDLER_PATH) $(XARGS) $(SCRIPT_DIR)/bundle-libraries.sh $(PKG_BUILD_DIR)/staging_dir/host + all: compile $(BIN_DIR)/$(IB_NAME).tar.xz: clean @@ -98,7 +101,7 @@ endif $(INSTALL_DIR) $(PKG_BUILD_DIR)/staging_dir/host/bin $(CP) $(STAGING_DIR_HOST)/bin/* $(PKG_BUILD_DIR)/staging_dir/host/bin/ (cd $(PKG_BUILD_DIR); find staging_dir/host/bin/ $(IB_LDIR)/scripts/dtc/ -type f | \ - $(XARGS) $(SCRIPT_DIR)/bundle-libraries.sh $(PKG_BUILD_DIR)/staging_dir/host) + $(BUNDLER_COMMAND)) $(CP) $(TOPDIR)/staging_dir/host/lib/libfakeroot* $(PKG_BUILD_DIR)/staging_dir/host/lib STRIP=$(STAGING_DIR_HOST)/bin/sstrip $(SCRIPT_DIR)/rstrip.sh $(PKG_BUILD_DIR)/staging_dir/host/bin/ (cd $(BUILD_DIR); \ From 7e4585e59362b581cedcbd852036789f713ae236 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 29 Dec 2020 01:06:43 +0100 Subject: [PATCH 17/26] sdk: invoke bundle-libraries.sh w/o buildroot dirs in $PATH Invoke bundle-libraries.sh with any buildroot related directory entries removed from $PATH to avoid picking up cross versions of utilities like ldd which will not properly work when used against host executables. This should fix executable bundling for glibc-target SDKs. Signed-off-by: Jo-Philipp Wich --- target/sdk/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/target/sdk/Makefile b/target/sdk/Makefile index caec7178e9..d7e10a9bd8 100644 --- a/target/sdk/Makefile +++ b/target/sdk/Makefile @@ -20,6 +20,9 @@ STAGING_SUBDIR_HOST := staging_dir/host STAGING_SUBDIR_TARGET := staging_dir/$(TARGET_DIR_NAME) STAGING_SUBDIR_TOOLCHAIN := staging_dir/toolchain-$(ARCH)$(ARCH_SUFFIX)_gcc-$(GCCV)_$(LIBC)$(if $(CONFIG_arm),_eabi) +BUNDLER_PATH := $(subst $(space),:,$(filter-out $(TOPDIR)/%,$(subst :,$(space),$(PATH)))) +BUNDLER_COMMAND := PATH=$(BUNDLER_PATH) $(XARGS) $(SCRIPT_DIR)/bundle-libraries.sh $(SDK_BUILD_DIR)/$(STAGING_SUBDIR_HOST) + EXCLUDE_DIRS:= \ */stamp \ */stampfiles \ @@ -104,7 +107,7 @@ $(BIN_DIR)/$(SDK_NAME).tar.xz: clean (cd $(SDK_BUILD_DIR); find $(STAGING_SUBDIR_HOST)/bin $(STAGING_SUBDIR_HOST)/usr/bin \ $(STAGING_SUBDIR_TOOLCHAIN)/bin $(STAGING_SUBDIR_TOOLCHAIN)/*/bin $(STAGING_SUBDIR_TOOLCHAIN)/libexec \ $(KDIR_BASE) \ - -type f | $(XARGS) $(SCRIPT_DIR)/bundle-libraries.sh $(SDK_BUILD_DIR)/$(STAGING_SUBDIR_HOST)) + -type f | $(BUNDLER_COMMAND)) @-( \ find \ From f17c30098356778f212f73b8ea0c2e238907b580 Mon Sep 17 00:00:00 2001 From: Maxim Storchak Date: Thu, 24 Dec 2020 00:58:01 +0200 Subject: [PATCH 18/26] busybox: define BUSYBOX_SYM before the first use Since PKG_FILE_MODES relies on BUSYBOX_SYM, it should be defined early enough Signed-off-by: Maxim Storchak --- package/utils/busybox/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/utils/busybox/Makefile b/package/utils/busybox/Makefile index 38ef4d33bd..e62cef0713 100644 --- a/package/utils/busybox/Makefile +++ b/package/utils/busybox/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=busybox PKG_VERSION:=1.31.1 -PKG_RELEASE:=7 +PKG_RELEASE:=8 PKG_FLAGS:=essential PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 @@ -28,6 +28,9 @@ PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=LICENSE archival/libarchive/bz/LICENSE PKG_CPE_ID:=cpe:/a:busybox:busybox +BUSYBOX_SYM=$(if $(CONFIG_BUSYBOX_CUSTOM),CONFIG,DEFAULT) +BUSYBOX_IF_ENABLED=$(if $(CONFIG_BUSYBOX_$(BUSYBOX_SYM)_$(1)),$(2)) + ifneq ($(CONFIG_BUSYBOX_$(BUSYBOX_SYM)_FEATURE_SUID),) PKG_FILE_MODES:=/bin/busybox:root:root:4755 endif @@ -38,9 +41,6 @@ ifeq ($(DUMP),) STAMP_CONFIGURED:=$(strip $(STAMP_CONFIGURED))_$(shell grep '^CONFIG_BUSYBOX_' $(TOPDIR)/.config | mkhash md5) endif -BUSYBOX_SYM=$(if $(CONFIG_BUSYBOX_CUSTOM),CONFIG,DEFAULT) -BUSYBOX_IF_ENABLED=$(if $(CONFIG_BUSYBOX_$(BUSYBOX_SYM)_$(1)),$(2)) - # All files provided by busybox will serve as fallback alternatives by opkg. # There should be no need to enumerate ALTERNATIVES entries here define Package/busybox/Default From 93b612221208c731da9b6c7100af636894405f75 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Fri, 10 Jul 2020 12:47:49 +0200 Subject: [PATCH 19/26] base-files: sysupgrade: add function for conffiles retrieval The find command to retrieve files from /etc/sysupgrade.conf and /lib/upgrade/keep.d/* is used twice in almost the same way. Move it into a function to consolidate, enhance readability and make future adjustments easier. Signed-off-by: Adrian Schmutzler Acked-by: Paul Spooren Reviewed-by: Philip Prindeville --- package/base-files/Makefile | 2 +- package/base-files/files/sbin/sysupgrade | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/package/base-files/Makefile b/package/base-files/Makefile index 47d4e73b42..35a07f2aad 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/version.mk include $(INCLUDE_DIR)/feeds.mk PKG_NAME:=base-files -PKG_RELEASE:=242 +PKG_RELEASE:=243 PKG_FLAGS:=nonshared PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/ diff --git a/package/base-files/files/sbin/sysupgrade b/package/base-files/files/sbin/sysupgrade index 3300d8e1ea..7977b06ef1 100755 --- a/package/base-files/files/sbin/sysupgrade +++ b/package/base-files/files/sbin/sysupgrade @@ -131,12 +131,19 @@ list_changed_conffiles() { done } +list_static_conffiles() { + local filter=$1 + + find $(sed -ne '/^[[:space:]]*$/d; /^#/d; p' \ + /etc/sysupgrade.conf /lib/upgrade/keep.d/* 2>/dev/null) \ + \( -type f -o -type l \) $filter 2>/dev/null +} + add_conffiles() { local file="$1" - ( find $(sed -ne '/^[[:space:]]*$/d; /^#/d; p' \ - /etc/sysupgrade.conf /lib/upgrade/keep.d/* 2>/dev/null) \ - \( -type f -o -type l \) $find_filter 2>/dev/null; - list_changed_conffiles ) | sort -u > "$file" + + ( list_static_conffiles "$find_filter"; list_changed_conffiles ) | + sort -u > "$file" return 0 } @@ -154,9 +161,7 @@ add_overlayfiles() { # backup files from /etc/sysupgrade.conf and /lib/upgrade/keep.d, but # ignore those aready controlled by opkg conffiles - find $(sed -ne '/^[[:space:]]*$/d; /^#/d; p' \ - /etc/sysupgrade.conf /lib/upgrade/keep.d/* 2>/dev/null) \ - \( -type f -o -type l \) 2>/dev/null | sort -u | + list_static_conffiles | sort -u | grep -h -v -x -F -f $conffiles > "$keepfiles" # backup conffiles, but only those changed if '-u' From 23fec971ca653709b063afbb8e598bad4c28c178 Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Wed, 30 Dec 2020 20:13:44 +0100 Subject: [PATCH 20/26] odhcp6c: update to git HEAD eac1961 dhcpv6: fix displaying IA info 0475e18 dhcpv6: display status code as a string Signed-off-by: Hans Dedecker --- package/network/ipv6/odhcp6c/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/network/ipv6/odhcp6c/Makefile b/package/network/ipv6/odhcp6c/Makefile index b1528ee2d1..a52d3a3504 100644 --- a/package/network/ipv6/odhcp6c/Makefile +++ b/package/network/ipv6/odhcp6c/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=16 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcp6c.git -PKG_SOURCE_DATE:=2020-12-08 -PKG_SOURCE_VERSION:=0ffa3a31f7146d320214f431291c1196070a010f -PKG_MIRROR_HASH:=16eab81663ad7bd7f650c62019b65ded21f08e797874041787543e2e8ed665e8 +PKG_SOURCE_DATE:=2020-12-26 +PKG_SOURCE_VERSION:=eac1961983b8e7a74c494feedcb878170b135072 +PKG_MIRROR_HASH:=3d026e66a57082d15a848357fdd94b8332d4916aa5a3251f72c3f83da3d6513e PKG_MAINTAINER:=Hans Dedecker PKG_LICENSE:=GPL-2.0 From 1910545ad6fd00cd9a534ea6e28db27535d70c8b Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Wed, 30 Dec 2020 20:34:12 +0100 Subject: [PATCH 21/26] glibc: update to latest 2.32 commit 1d49bede4d tests-mcheck: New variable to run tests with MALLOC_CHECK_=3 Signed-off-by: Hans Dedecker --- toolchain/glibc/common.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toolchain/glibc/common.mk b/toolchain/glibc/common.mk index faf749eea3..2977b9b58d 100644 --- a/toolchain/glibc/common.mk +++ b/toolchain/glibc/common.mk @@ -12,8 +12,8 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE_VERSION:=050022910be1d1f5c11cd5168f1685ad4f9580d2 -PKG_MIRROR_HASH:=b0a8c79acbb371badcc8477e840ab32bf796d5e7a0eab224bc8fd5aca6b1e631 +PKG_SOURCE_VERSION:=1d49bede4d8a5448067e8579b14fedf437e75aee +PKG_MIRROR_HASH:=1f8b04585eaf36b06783f36550fc24689224ffd35f8f650f3954797a7002481a PKG_SOURCE_URL:=https://sourceware.org/git/glibc.git PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz From eb3a5ddba0d4d0c4ab1f21ccbfbcf9aa0254bce9 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Mon, 23 Nov 2020 13:41:34 +0100 Subject: [PATCH 22/26] ath79: Add support for OpenMesh OM2P-LC Device specifications: ====================== * Qualcomm/Atheros AR9330 rev 1 * 400/400/200 MHz (CPU/DDR/AHB) * 64 MB of RAM * 16 MB of SPI NOR flash - 2x 7 MB available; but one of the 7 MB regions is the recovery image * 2x 10/100 Mbps Ethernet * 1T1R 2.4 GHz Wi-Fi * 6x GPIO-LEDs (3x wifi, 2x ethernet, 1x power) * 1x GPIO-button (reset) * external h/w watchdog (enabled by default) * TTL pins are on board (arrow points to VCC, then follows: GND, TX, RX) * 2x fast ethernet - eth0 + builtin switch port 1 + used as LAN interface - eth1 + 18-24V passive POE (mode B) + used as WAN interface * 12-24V 1A DC * internal antennas Flashing instructions: ====================== Various methods can be used to install the actual image on the flash. Two easy ones are: ap51-flash ---------- The tool ap51-flash (https://github.com/ap51-flash/ap51-flash) should be used to transfer the image to the u-boot when the device boots up. initramfs from TFTP ------------------- The serial console must be used to access the u-boot shell during bootup. It can then be used to first boot up the initramfs image from a TFTP server (here with the IP 192.168.1.21): setenv serverip 192.168.1.21 setenv ipaddr 192.168.1.1 tftpboot 0c00000 .bin && bootm $fileaddr The actual sysupgrade image can then be transferred (on the LAN port) to the device via scp .bin root@192.168.1.1:/tmp/ On the device, the sysupgrade must then be started using sysupgrade -n /tmp/.bin Signed-off-by: Sven Eckelmann --- package/boot/uboot-envtools/Makefile | 2 +- package/boot/uboot-envtools/files/ath79 | 1 + .../ath79/dts/ar9330_openmesh_om2p-lc.dts | 8 + .../linux/ath79/dts/ar9330_openmesh_om2p.dtsi | 151 ++++++++++++++++++ .../generic/base-files/etc/board.d/01_leds | 1 + .../base-files/lib/upgrade/platform.sh | 3 +- target/linux/ath79/image/generic.mk | 8 + 7 files changed, 172 insertions(+), 2 deletions(-) create mode 100644 target/linux/ath79/dts/ar9330_openmesh_om2p-lc.dts create mode 100644 target/linux/ath79/dts/ar9330_openmesh_om2p.dtsi diff --git a/package/boot/uboot-envtools/Makefile b/package/boot/uboot-envtools/Makefile index 7557984595..7dcc3ef428 100644 --- a/package/boot/uboot-envtools/Makefile +++ b/package/boot/uboot-envtools/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uboot-envtools PKG_DISTNAME:=u-boot PKG_VERSION:=2020.04 -PKG_RELEASE:=14 +PKG_RELEASE:=15 PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:= \ diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index 2865501f26..70331b694a 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -90,6 +90,7 @@ openmesh,om2p-hs-v1|\ openmesh,om2p-hs-v2|\ openmesh,om2p-hs-v3|\ openmesh,om2p-hs-v4|\ +openmesh,om2p-lc|\ plasmacloud,pa300|\ plasmacloud,pa300e) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x40000" diff --git a/target/linux/ath79/dts/ar9330_openmesh_om2p-lc.dts b/target/linux/ath79/dts/ar9330_openmesh_om2p-lc.dts new file mode 100644 index 0000000000..7383df50ab --- /dev/null +++ b/target/linux/ath79/dts/ar9330_openmesh_om2p-lc.dts @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9330_openmesh_om2p.dtsi" + +/ { + compatible = "openmesh,om2p-lc", "qca,ar9330"; + model = "OpenMesh OM2P-LC"; +}; diff --git a/target/linux/ath79/dts/ar9330_openmesh_om2p.dtsi b/target/linux/ath79/dts/ar9330_openmesh_om2p.dtsi new file mode 100644 index 0000000000..d9ca2c0f72 --- /dev/null +++ b/target/linux/ath79/dts/ar9330_openmesh_om2p.dtsi @@ -0,0 +1,151 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9330.dtsi" + +#include +#include + +/ { + chosen { + /delete-property/ bootargs; + }; + + aliases { + serial0 = &uart; + led-boot = &led_power_blue; + led-failsafe = &led_power_blue; + led-running = &led_power_blue; + led-upgrade = &led_power_blue; + label-mac-device = ð1; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + pinctrl-names = "default"; + pinctrl-0 = <&switch_led_disable_pins>; + + wifi_yellow { + label = "yellow:wifi"; + gpios = <&gpio 0 GPIO_ACTIVE_LOW>; + }; + + led_power_blue: power_blue { + label = "blue:power"; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + lan_blue { + label = "blue:lan"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + wifi_green { + label = "green:wifi"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + wifi_red { + label = "red:wifi"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + + wan_blue { + label = "blue:wan"; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + }; + + watchdog { + compatible = "linux,wdt-gpio"; + gpios = <&gpio 26 GPIO_ACTIVE_LOW>; + hw_algo = "toggle"; + /* hw_margin_ms is actually 300s but driver limits it to 60s */ + hw_margin_ms = <60000>; + always-running; + }; +}; + +&uart { + status = "okay"; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + /* partitions are passed via bootloader */ + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x040000>; + }; + + partition@80000 { + label = "custom"; + reg = <0x080000 0x140000>; + read-only; + }; + + partition@1c0000 { + label = "inactive"; + reg = <0x1c0000 0x700000>; + }; + + partition@8c0000 { + label = "inactive2"; + reg = <0x8c0000 0x700000>; + }; + + art: partition@fc0000 { + label = "ART"; + reg = <0xfc0000 0x040000>; + read-only; + }; + }; + }; +}; + +ð0 { + status = "okay"; + + mtd-mac-address = <&art 0x6>; +}; + +ð1 { + status = "okay"; + + mtd-mac-address = <&art 0x0>; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; 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 3889969ee5..b651432dca 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds @@ -148,6 +148,7 @@ comfast,cf-ew72|\ openmesh,om2p-hs-v1|\ openmesh,om2p-hs-v2|\ openmesh,om2p-hs-v3|\ +openmesh,om2p-lc|\ telco,t1) ucidef_set_led_switch "lan" "LAN" "blue:lan" "switch0" "0x02" ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth1" diff --git a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh index 9ff36f1bf5..ea3d9d6d84 100644 --- a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh +++ b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh @@ -54,7 +54,8 @@ platform_do_upgrade() { openmesh,om2p-hs-v1|\ openmesh,om2p-hs-v2|\ openmesh,om2p-hs-v3|\ - openmesh,om2p-hs-v4) + openmesh,om2p-hs-v4|\ + openmesh,om2p-lc) PART_NAME="inactive" platform_do_upgrade_openmesh "$1" ;; diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 631cc2fd6a..6f21db78d2 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -1613,6 +1613,14 @@ define Device/openmesh_om2p-hs-v4 endef TARGET_DEVICES += openmesh_om2p-hs-v4 +define Device/openmesh_om2p-lc + $(Device/openmesh_om2p-common) + SOC := ar9330 + DEVICE_MODEL := OM2P-LC + SUPPORTED_DEVICES += om2p-lc +endef +TARGET_DEVICES += openmesh_om2p-lc + define Device/openmesh_om5p-ac-v2 SOC := qca9558 DEVICE_VENDOR := OpenMesh From ff9e48e75c191e0d7e08a14791853559d509ca2e Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Mon, 23 Nov 2020 13:41:34 +0100 Subject: [PATCH 23/26] ath79: Add support for OpenMesh OM2P v2 Device specifications: ====================== * Qualcomm/Atheros AR9330 rev 1 * 400/400/200 MHz (CPU/DDR/AHB) * 64 MB of RAM * 16 MB of SPI NOR flash - 2x 7 MB available; but one of the 7 MB regions is the recovery image * 2x 10/100 Mbps Ethernet * 1T1R 2.4 GHz Wi-Fi * 6x GPIO-LEDs (3x wifi, 2x ethernet, 1x power) * 1x GPIO-button (reset) * external h/w watchdog (enabled by default) * TTL pins are on board (arrow points to VCC, then follows: GND, TX, RX) * 2x fast ethernet - eth0 + builtin switch port 1 + used as LAN interface - eth1 + 18-24V passive POE (mode B) + used as WAN interface * 12-24V 1A DC * external antenna Flashing instructions: ====================== Various methods can be used to install the actual image on the flash. Two easy ones are: ap51-flash ---------- The tool ap51-flash (https://github.com/ap51-flash/ap51-flash) should be used to transfer the image to the u-boot when the device boots up. initramfs from TFTP ------------------- The serial console must be used to access the u-boot shell during bootup. It can then be used to first boot up the initramfs image from a TFTP server (here with the IP 192.168.1.21): setenv serverip 192.168.1.21 setenv ipaddr 192.168.1.1 tftpboot 0c00000 .bin && bootm $fileaddr The actual sysupgrade image can then be transferred (on the LAN port) to the device via scp .bin root@192.168.1.1:/tmp/ On the device, the sysupgrade must then be started using sysupgrade -n /tmp/.bin Signed-off-by: Sven Eckelmann --- package/boot/uboot-envtools/Makefile | 2 +- package/boot/uboot-envtools/files/ath79 | 1 + target/linux/ath79/dts/ar9330_openmesh_om2p-v2.dts | 8 ++++++++ .../linux/ath79/generic/base-files/etc/board.d/01_leds | 1 + .../ath79/generic/base-files/lib/upgrade/platform.sh | 1 + target/linux/ath79/image/generic.mk | 9 +++++++++ 6 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 target/linux/ath79/dts/ar9330_openmesh_om2p-v2.dts diff --git a/package/boot/uboot-envtools/Makefile b/package/boot/uboot-envtools/Makefile index 7dcc3ef428..92caed4be7 100644 --- a/package/boot/uboot-envtools/Makefile +++ b/package/boot/uboot-envtools/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uboot-envtools PKG_DISTNAME:=u-boot PKG_VERSION:=2020.04 -PKG_RELEASE:=15 +PKG_RELEASE:=16 PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:= \ diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index 70331b694a..55c1ce8f63 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -85,6 +85,7 @@ netgear,wndr4300tn|\ netgear,wndr4300sw) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x20000" ;; +openmesh,om2p-v2|\ openmesh,om2p-v4|\ openmesh,om2p-hs-v1|\ openmesh,om2p-hs-v2|\ diff --git a/target/linux/ath79/dts/ar9330_openmesh_om2p-v2.dts b/target/linux/ath79/dts/ar9330_openmesh_om2p-v2.dts new file mode 100644 index 0000000000..659a1c71d9 --- /dev/null +++ b/target/linux/ath79/dts/ar9330_openmesh_om2p-v2.dts @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9330_openmesh_om2p.dtsi" + +/ { + compatible = "openmesh,om2p-v2", "qca,ar9330"; + model = "OpenMesh OM2P v2"; +}; 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 b651432dca..8f0e2f87a7 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds @@ -145,6 +145,7 @@ comfast,cf-e560ac) ucidef_set_led_switch "lan4" "LAN4" "blue:lan4" "switch0" "0x10" ;; comfast,cf-ew72|\ +openmesh,om2p-v2|\ openmesh,om2p-hs-v1|\ openmesh,om2p-hs-v2|\ openmesh,om2p-hs-v3|\ diff --git a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh index ea3d9d6d84..2c907ac101 100644 --- a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh +++ b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh @@ -50,6 +50,7 @@ platform_do_upgrade() { jjplus,ja76pf2) redboot_fis_do_upgrade "$1" linux ;; + openmesh,om2p-v2|\ openmesh,om2p-v4|\ openmesh,om2p-hs-v1|\ openmesh,om2p-hs-v2|\ diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 6f21db78d2..acb456ba44 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -1568,6 +1568,15 @@ define Device/openmesh_om2p-common openmesh-image ce_type=OM2P | append-metadata endef +define Device/openmesh_om2p-v2 + $(Device/openmesh_om2p-common) + SOC := ar9330 + DEVICE_MODEL := OM2P + DEVICE_VARIANT := v2 + SUPPORTED_DEVICES += om2pv2 +endef +TARGET_DEVICES += openmesh_om2p-v2 + define Device/openmesh_om2p-v4 $(Device/openmesh_om2p-common) SOC := qca9533 From 80713657b20d58c2fb7fa503e24cbf7db379550f Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Mon, 23 Nov 2020 13:41:34 +0100 Subject: [PATCH 24/26] ath79: Add support for OpenMesh OM5P Device specifications: ====================== * Qualcomm/Atheros AR9344 rev 2 * 560/450/225 MHz (CPU/DDR/AHB) * 64 MB of RAM * 16 MB of SPI NOR flash - 2x 7 MB available; but one of the 7 MB regions is the recovery image * 2x 10/100 Mbps Ethernet * 2T2R 5 GHz Wi-Fi * 6x GPIO-LEDs (3x wifi, 2x ethernet, 1x power) * 1x GPIO-button (reset) * external h/w watchdog (enabled by default) * TTL pins are on board (arrow points to VCC, then follows: GND, TX, RX) * 2x fast ethernet - eth0 + builtin switch port 1 + used as LAN interface - eth1 + 18-24V passive POE (mode B) + used as WAN interface * 12-24V 1A DC * internal antennas WAN/LAN LEDs appear to be wrong in ar71xx and have been swapped here. Flashing instructions: ====================== Various methods can be used to install the actual image on the flash. Two easy ones are: ap51-flash ---------- The tool ap51-flash (https://github.com/ap51-flash/ap51-flash) should be used to transfer the image to the u-boot when the device boots up. initramfs from TFTP ------------------- The serial console must be used to access the u-boot shell during bootup. It can then be used to first boot up the initramfs image from a TFTP server (here with the IP 192.168.1.21): setenv serverip 192.168.1.21 setenv ipaddr 192.168.1.1 tftpboot 0c00000 .bin && bootm $fileaddr The actual sysupgrade image can then be transferred (on the LAN port) to the device via scp .bin root@192.168.1.1:/tmp/ On the device, the sysupgrade must then be started using sysupgrade -n /tmp/.bin Signed-off-by: Sven Eckelmann [add LED swap comment] Signed-off-by: Adrian Schmutzler --- package/boot/uboot-envtools/Makefile | 2 +- package/boot/uboot-envtools/files/ath79 | 1 + .../linux/ath79/dts/ar9344_openmesh_om5p.dts | 166 ++++++++++++++++++ .../generic/base-files/etc/board.d/01_leds | 1 + .../base-files/lib/upgrade/platform.sh | 3 +- target/linux/ath79/image/generic.mk | 19 ++ 6 files changed, 190 insertions(+), 2 deletions(-) create mode 100644 target/linux/ath79/dts/ar9344_openmesh_om5p.dts diff --git a/package/boot/uboot-envtools/Makefile b/package/boot/uboot-envtools/Makefile index 92caed4be7..8bc2c00ba5 100644 --- a/package/boot/uboot-envtools/Makefile +++ b/package/boot/uboot-envtools/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uboot-envtools PKG_DISTNAME:=u-boot PKG_VERSION:=2020.04 -PKG_RELEASE:=16 +PKG_RELEASE:=17 PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:= \ diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index 55c1ce8f63..dedf7160f0 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -48,6 +48,7 @@ netgear,wnr2200-16m|\ netgear,wnr612-v2|\ ocedo,koala|\ ocedo,raccoon|\ +openmesh,om5p|\ openmesh,om5p-ac-v2|\ samsung,wam250|\ ubnt,nanostation-m|\ diff --git a/target/linux/ath79/dts/ar9344_openmesh_om5p.dts b/target/linux/ath79/dts/ar9344_openmesh_om5p.dts new file mode 100644 index 0000000000..a733a922e4 --- /dev/null +++ b/target/linux/ath79/dts/ar9344_openmesh_om5p.dts @@ -0,0 +1,166 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9344.dtsi" + +#include +#include + +/ { + compatible = "openmesh,om5p", "qca,ar9344"; + model = "OpenMesh OM5P"; + + chosen { + /delete-property/ bootargs; + }; + + aliases { + serial0 = &uart; + led-boot = &led_power_blue; + led-failsafe = &led_power_blue; + led-running = &led_power_blue; + led-upgrade = &led_power_blue; + label-mac-device = ð1; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + pinctrl-names = "default"; + pinctrl-0 = <&led_lan_wan_blue_pin>; + + led_power_blue: power_blue { + label = "blue:power"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + wan_blue { + label = "blue:wan"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + lan_blue { + label = "blue:lan"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + wifi_green { + label = "green:wifi"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + wifi_yellow { + label = "yellow:wifi"; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + + wifi_red { + label = "red:wifi"; + gpios = <&gpio 19 GPIO_ACTIVE_LOW>; + }; + }; + + watchdog { + compatible = "linux,wdt-gpio"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + hw_algo = "toggle"; + /* hw_margin_ms is actually 300s but driver limits it to 60s */ + hw_margin_ms = <60000>; + always-running; + }; +}; + +&ref { + clock-frequency = <40000000>; +}; + +&uart { + status = "okay"; +}; + +&pinmux { + led_lan_wan_blue_pin: pinmux_lan_wan_blue_pin { + pinctrl-single,bits = <0xc 0x0 0xffff0000>; + }; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + + /* partitions are passed via bootloader */ + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x010000>; + }; + + partition@50000 { + label = "custom"; + reg = <0x050000 0x060000>; + read-only; + }; + + partition@b0000 { + label = "inactive"; + reg = <0x0b0000 0x7a0000>; + }; + + partition@850000 { + label = "inactive2"; + reg = <0x850000 0x7a0000>; + }; + + art: partition@ff0000 { + label = "ART"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +ð0 { + status = "okay"; + + phy-handle = <&swphy4>; + + mtd-mac-address = <&art 0x6>; +}; + +ð1 { + status = "okay"; + + mtd-mac-address = <&art 0x0>; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; 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 8f0e2f87a7..b961e7d3e8 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds @@ -150,6 +150,7 @@ openmesh,om2p-hs-v1|\ openmesh,om2p-hs-v2|\ openmesh,om2p-hs-v3|\ openmesh,om2p-lc|\ +openmesh,om5p|\ telco,t1) ucidef_set_led_switch "lan" "LAN" "blue:lan" "switch0" "0x02" ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth1" diff --git a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh index 2c907ac101..79e023482b 100644 --- a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh +++ b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh @@ -56,7 +56,8 @@ platform_do_upgrade() { openmesh,om2p-hs-v2|\ openmesh,om2p-hs-v3|\ openmesh,om2p-hs-v4|\ - openmesh,om2p-lc) + openmesh,om2p-lc|\ + openmesh,om5p) PART_NAME="inactive" platform_do_upgrade_openmesh "$1" ;; diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index acb456ba44..ded8e29c2c 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -1630,6 +1630,25 @@ define Device/openmesh_om2p-lc endef TARGET_DEVICES += openmesh_om2p-lc +define Device/openmesh_om5p-common + SOC := ar9344 + DEVICE_VENDOR := OpenMesh + DEVICE_PACKAGES := uboot-envtools + IMAGE_SIZE := 7808k + BLOCKSIZE := 64k + KERNEL := kernel-bin | append-dtb | lzma | uImage lzma | \ + pad-to $$(BLOCKSIZE) + IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | \ + openmesh-image ce_type=OM5P | append-metadata +endef + +define Device/openmesh_om5p + $(Device/openmesh_om5p-common) + DEVICE_MODEL := OM5P + SUPPORTED_DEVICES += om5p +endef +TARGET_DEVICES += openmesh_om5p + define Device/openmesh_om5p-ac-v2 SOC := qca9558 DEVICE_VENDOR := OpenMesh From f3e45c45cba1a541693da840642b08226653dff4 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Sun, 27 Dec 2020 22:56:49 +0100 Subject: [PATCH 25/26] ipq40xx: remove non-existent ethernet PHY Since updating the MDIO driver, the probe will fail hard on any PHY not present on the bus, while this was not the case prior. Fixes commit 26b1f72381fb ("ipq40xx: net: phy: ar40xx: remove PHY handling") Signed-off-by: David Bauer --- .../arch/arm/boot/dts/qcom-ipq4019-fritzrepeater-1200.dts | 6 ++++++ .../arch/arm/boot/dts/qcom-ipq4029-aruba-glenmorangie.dtsi | 2 ++ 2 files changed, 8 insertions(+) diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-fritzrepeater-1200.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-fritzrepeater-1200.dts index 3d90fdc286..fd6c5d9aa0 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-fritzrepeater-1200.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-fritzrepeater-1200.dts @@ -26,6 +26,12 @@ status = "okay"; pinctrl-0 = <&mdio_pins>; pinctrl-names = "default"; + + /delete-node/ ethernet-phy@1; + /delete-node/ ethernet-phy@2; + /delete-node/ ethernet-phy@3; + /delete-node/ ethernet-phy@4; + /delete-node/ psgmii-phy@5; }; tcsr@1949000 { diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-aruba-glenmorangie.dtsi b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-aruba-glenmorangie.dtsi index 54ebb0b4b0..9d0823f3ef 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-aruba-glenmorangie.dtsi +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-aruba-glenmorangie.dtsi @@ -22,9 +22,11 @@ pinctrl-names = "default"; /delete-node/ ethernet-phy@0; + /delete-node/ ethernet-phy@1; /delete-node/ ethernet-phy@2; /delete-node/ ethernet-phy@3; /delete-node/ ethernet-phy@4; + /delete-node/ psgmii-phy@5; ethernet-phy@5 { reg = <0x5>; From 31554e50d2c3d0707a40f9ed08b0d6999f584ba2 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Wed, 23 Dec 2020 01:16:17 -0800 Subject: [PATCH 26/26] ccache: update to 4.1 Upstream switched to building with CMake. Adjust accordingly. Reapplied patch as upstream changed the file format. Added HOST_BUILD_PARALLEL for faster compilation. Added cmake tool dependency and removed circular dependencies as a result. Adjusted dependent tools to use NOCACHE as they are needed to build ccache. Signed-off-by: Rosen Penev --- tools/Makefile | 3 ++- tools/ccache/Makefile | 17 +++++++++-------- tools/ccache/patches/100-honour-copts.patch | 20 ++++++++++---------- tools/libressl/Makefile | 1 + tools/pkgconf/Makefile | 2 ++ tools/zstd/Makefile | 1 + 6 files changed, 25 insertions(+), 19 deletions(-) diff --git a/tools/Makefile b/tools/Makefile index c66d4fb991..4bef951c46 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -80,8 +80,9 @@ ifneq ($(HOST_OS),Linux) endif ifneq ($(CONFIG_CCACHE)$(CONFIG_SDK),) -$(foreach tool, $(filter-out xz patch,$(tools-y)), $(eval $(curdir)/$(tool)/compile += $(curdir)/ccache/compile)) +$(foreach tool, $(filter-out xz zstd patch pkgconf libressl cmake,$(tools-y)), $(eval $(curdir)/$(tool)/compile += $(curdir)/ccache/compile)) tools-y += ccache +$(curdir)/ccache/compile := $(curdir)/cmake/compile $(curdir)/zstd/compile endif # in case there is no patch tool on the host we need to make patch tool a diff --git a/tools/ccache/Makefile b/tools/ccache/Makefile index 6e55001fd5..e016e0beb3 100644 --- a/tools/ccache/Makefile +++ b/tools/ccache/Makefile @@ -1,4 +1,4 @@ -# +# # Copyright (C) 2006-2015 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. @@ -8,25 +8,26 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/target.mk PKG_NAME:=ccache -PKG_VERSION:=3.7.11 +PKG_VERSION:=4.1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://github.com/ccache/ccache/releases/download/v$(PKG_VERSION) -PKG_HASH:=8d450208099a4d202bd7df87caaec81baee20ce9dd62da91e9ea7b95a9072f68 +PKG_HASH:=5fdc804056632d722a1182e15386696f0ea6c59cb4ab4d65a54f0b269ae86f99 + +HOST_BUILD_PARALLEL:=1 include $(INCLUDE_DIR)/host-build.mk +include $(INCLUDE_DIR)/cmake.mk -HOST_CONFIGURE_VARS += CC="$(HOSTCC_NOCACHE)" +CMAKE_HOST_OPTIONS += \ + -DCMAKE_C_COMPILER_LAUNCHER="" \ + -DCMAKE_CXX_COMPILER_LAUNCHER="" define Host/Install/ccache $(INSTALL_DIR) $(STAGING_DIR_HOST)/bin/ $(CP) ./files/* $(STAGING_DIR_HOST)/bin/ endef -define Host/Clean - -$(MAKE) -C $(HOST_BUILD_DIR) uninstall - $(call Host/Clean/Default) -endef define Host/Install $(call Host/Install/Default) $(call Host/Install/ccache) diff --git a/tools/ccache/patches/100-honour-copts.patch b/tools/ccache/patches/100-honour-copts.patch index ccfa1c0247..e4045ef9be 100644 --- a/tools/ccache/patches/100-honour-copts.patch +++ b/tools/ccache/patches/100-honour-copts.patch @@ -1,10 +1,10 @@ ---- a/src/ccache.c -+++ b/src/ccache.c -@@ -2277,6 +2277,7 @@ calculate_object_hash(struct args *args, - "CPLUS_INCLUDE_PATH", - "OBJC_INCLUDE_PATH", - "OBJCPLUS_INCLUDE_PATH", // clang -+ "GCC_HONOUR_COPTS", - NULL - }; - for (const char **p = envvars; *p; ++p) { +--- a/src/ccache.cpp ++++ b/src/ccache.cpp +@@ -1654,6 +1654,7 @@ calculate_result_name(Context& ctx, + "CPLUS_INCLUDE_PATH", + "OBJC_INCLUDE_PATH", + "OBJCPLUS_INCLUDE_PATH", // clang ++ "GCC_HONOUR_COPTS", + nullptr}; + for (const char** p = envvars; *p; ++p) { + const char* v = getenv(*p); diff --git a/tools/libressl/Makefile b/tools/libressl/Makefile index dbd8ca4d1a..2b5a33450c 100644 --- a/tools/libressl/Makefile +++ b/tools/libressl/Makefile @@ -23,6 +23,7 @@ HOST_BUILD_PARALLEL:=1 include $(INCLUDE_DIR)/host-build.mk +HOSTCC := $(HOSTCC_NOCACHE) HOST_CONFIGURE_ARGS += --enable-static --disable-shared --disable-tests HOST_CFLAGS += $(FPIC) diff --git a/tools/pkgconf/Makefile b/tools/pkgconf/Makefile index 7d785aae39..0f56de0e29 100644 --- a/tools/pkgconf/Makefile +++ b/tools/pkgconf/Makefile @@ -19,6 +19,8 @@ include $(INCLUDE_DIR)/host-build.mk unexport PKG_CONFIG +HOSTCC := $(HOSTCC_NOCACHE) + define Host/Install $(MAKE) -C $(HOST_BUILD_DIR) install mv $(STAGING_DIR_HOST)/bin/pkgconf $(STAGING_DIR_HOST)/bin/pkg-config.real diff --git a/tools/zstd/Makefile b/tools/zstd/Makefile index 7459725e8e..ec85362544 100644 --- a/tools/zstd/Makefile +++ b/tools/zstd/Makefile @@ -15,6 +15,7 @@ HOST_BUILD_PARALLEL:=1 include $(INCLUDE_DIR)/host-build.mk +HOSTCC := $(HOSTCC_NOCACHE) HOST_MAKE_FLAGS = PREFIX=$(HOST_BUILD_PREFIX) HAVE_ZLIB=0 HAVE_LZMA=0 HAVE_LZ4=0 $(eval $(call HostBuild))