From fb4d7a9680117a00721936c98ce41eeb2dea95c9 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Sat, 12 Dec 2020 14:34:00 +0100 Subject: [PATCH 01/18] ramips: add support for Ubiquiti UniFi 6 Lite Hardware -------- MediaTek MT7621AT 256M DDR3 32M SPI-NOR MediaTek MT7603 2T2R 802.11n 2.4GHz MediaTek MT7915 2T2R 802.11ax 5GHz Not Working ----------- - Bluetooth (connected to UART3) UART ---- UART is located in the lower left corner of the board. Pinout is 0 - 3V3 (don't connect) 1 - RX 2 - TX 3 - GND Console is 115200 8N1. Boot ---- 1. Connect to the serial console and connect power. 2. Double-press ESC when prompted 3. Set the fdt address $ fdt addr $(fdtcontroladdr) 4. Remove the signature node from the control FDT $ fdt rm /signature 5. Transfer and boot the OpenWrt initramfs image to the device. Make sure to name the file C0A80114.img and have it reachable at 192.168.1.1/24 $ tftpboot; bootm Installation ------------ 1. Connect to the booted device at 192.168.1.20 using username/password "ubnt". 2. Update the bootloader environment. $ fw_setenv devmode TRUE $ fw_setenv boot_openwrt "fdt addr \$(fdtcontroladdr); fdt rm /signature; bootubnt" $ fw_setenv bootcmd "run boot_openwrt" 3. Transfer the OpenWrt sysupgrade image to the device using SCP. 4. Check the mtd partition number for bs / kernel0 / kernel1 $ cat /proc/mtd 5. Set the bootselect flag to boot from kernel0 $ dd if=/dev/zero bs=1 count=1 of=/dev/mtdblock4 6. Write the OpenWrt sysupgrade image to both kernel0 as well as kernel1 $ dd if=openwrt.bin of=/dev/mtdblock6 $ dd if=openwrt.bin of=/dev/mtdblock7 7. Reboot the device. It should boot into OpenWrt. Below are the original installation instructions prior to the discovery of "devmode=TRUE". They are not required for installation and are documentation only. The bootloader employs signature verification on the FIT image configurations. This way, booting unauthorized image without patching the bootloader is not possible. Manually configuring the bootcmd in the U-Boot envronment won't work, as this is restored to the default value if modified. The bootloader is made up of three different parts. 1. The SPL performing early board initialization and providing a XModem recovery in case the PBL is missing 2. The PBL being the primary U-Boot application and containing the control FDT. It is LZMA packed with a uImage header. 3. A Ubiquiti standalone U-Boot application providing the main boot routine as well as their recovery mechanism. In a perfect world, we would only replace the PBL, as the SPL does not perform checks on the PBLs integrity. However, as the PBL is in the same eraseblock as the SPL, we need to at least rewrite both. The bootloader will only verify integrity in case it has a "signature" node in it's control device-tree. Renaming the signature node to something else will prevent this from happening. Warning: These instructions are based on the firmware intially shipped with the device and potentially brick your device in a way it can only be recovered using a SPI flasher. Only (!) proceed if you understand this! 1. Extract the bootloader from the U-Boot partition using the OpenWrt initramfs image. 2. Split the bootloader into it's 3 components: $ dd if=bootloader.bin of=spl.bin bs=1 skip=0 count=45056 $ dd if=bootloader.bin of=pbl.uimage bs=1 skip=45056 count=143360 $ dd if=bootloader.bin of=ubnt.uimage bs=1 skip=188416 3. Strip the uImage header from the PBL $ dd if=pbl.uimage of=pbl.lzma bs=64 skip=1 4. Decompress the PBL $ lzma -d pbl.lzma --single-stream The decompressed PBL sha256sum should be d8b406c65240d260cf15be5f97f40c1d6d1b6e61ec3abed37bb841c90fcc1235 5. Open the decompressed PBL using your favorite hexeditor. Locate the control FDT at offset 0x4CED0 (0xD00DFEED). At offset 0x4D5BC, the label for the signature node is located. Rename the "signature" string at this offset to "signaturr". The patched PBL sha256sum should be d028e374cdb40ba44b6e3cef2e4e8a8c16a3b85eb15d9544d24fdd10eed64c97 6. Compress the patched PBL $ lzma -z pbl --lzma1=dict=67108864 The resulting pbl.lzma file should have the sha256sum 7ae6118928fa0d0b3fe4ff81abd80ecfd9ba2944cb0f0a462b6ae65913088b42 7. Create the PBL uimage $ SOURCE_DATE_EPOCH=1607909492 mkimage -A mips -O u-boot -C lzma -n "U-Boot 2018.03 [UniFi,v1.1.40.71]" -a 84000000 -e 84000000 -T firmware -d pbl.lzma patched_pbl.uimage The resulting patched_pbl.uimage should have the sha256sum b90d7fa2dcc6814180d3943530d8d6b0d6a03636113c94e99af34f196d3cf2ce 8. Reassemble the complete bootloader $ dd if=patched_pbl.uimage of=aligned_pbl.uimage bs=143360 count=1 conv=sync $ cat spl.bin > patched_uboot.bin $ cat aligned_pbl.uimage >> patched_uboot.bin $ cat ubnt.uimage >> patched_uboot.bin The resulting patched_uboot.bin should have the sha256sum 3e1186f33b88a525687285c2a8b22e8786787b31d4648b8eee66c672222aa76b 9. Transfer your patched bootloader to the device. Also install the kmod-mtd-rw package using opkg and load it. $ insmod mtd-rw.ko i_want_a_brick=1 Write the patched bootloader to mtd0 $ mtd write patched_uboot.bin u-boot 10. Erase the kernel1 partition, as the bootloader might otherwise decide to boot from there. $ mtd erase kernel1 11. Transfer the OpenWrt sysupgrade image to the device and install using sysupgrade. FIT configurations ------------------ In the future, the MT7621 UniFi6 family can be supported by a single OpenWrt image. config@1: U6 Lite config@2: U6 IW config@3: U6 Mesh config@4: U6 Extender config@5: U6 LR-EA (Early Access - GA is MT7622) Signed-off-by: David Bauer --- .../ramips/dts/mt7621_ubnt_unifi-6-lite.dts | 83 ++++++++ .../ramips/dts/mt7621_ubnt_unifi-nanohd.dts | 79 +------ .../linux/ramips/dts/mt7621_ubnt_unifi.dtsi | 81 ++++++++ target/linux/ramips/image/mt7621.mk | 10 + .../mt7621/base-files/etc/board.d/02_network | 1 + target/linux/ramips/mt7621/config-5.4 | 1 + ...an-up-boot_command_line-initializati.patch | 192 ++++++++++++++++++ ...2-MIPS-Always-define-builtin_cmdline.patch | 44 ++++ ...-MIPS-add-bootargs-override-property.patch | 63 ++++++ 9 files changed, 478 insertions(+), 76 deletions(-) create mode 100644 target/linux/ramips/dts/mt7621_ubnt_unifi-6-lite.dts create mode 100644 target/linux/ramips/dts/mt7621_ubnt_unifi.dtsi create mode 100644 target/linux/ramips/patches-5.4/0001-MIPS-cmdline-Clean-up-boot_command_line-initializati.patch create mode 100644 target/linux/ramips/patches-5.4/0002-MIPS-Always-define-builtin_cmdline.patch create mode 100644 target/linux/ramips/patches-5.4/0010-MIPS-add-bootargs-override-property.patch diff --git a/target/linux/ramips/dts/mt7621_ubnt_unifi-6-lite.dts b/target/linux/ramips/dts/mt7621_ubnt_unifi-6-lite.dts new file mode 100644 index 0000000000..422d17673b --- /dev/null +++ b/target/linux/ramips/dts/mt7621_ubnt_unifi-6-lite.dts @@ -0,0 +1,83 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621_ubnt_unifi.dtsi" + +/ { + compatible = "ubnt,unifi-6-lite", "mediatek,mt7621-soc"; + model = "Ubiquiti UniFi 6 Lite"; + + chosen { + bootargs-override = "console=ttyS0,115200"; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "mx25l25635f", "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x60000>; + read-only; + }; + + partition@60000 { + label = "u-boot-env"; + reg = <0x60000 0x10000>; + read-only; + }; + + factory: partition@70000 { + label = "factory"; + reg = <0x70000 0x40000>; + read-only; + }; + + eeprom: partition@b0000 { + label = "eeprom"; + reg = <0xb0000 0x10000>; + read-only; + }; + + partition@c0000 { + label = "bs"; + reg = <0xc0000 0x10000>; + }; + + partition@d0000 { + label = "cfg"; + reg = <0xd0000 0x100000>; + read-only; + }; + + partition@1d0000 { + compatible = "denx,fit"; + label = "firmware"; + reg = <0x1d0000 0xf10000>; + }; + + partition@10e0000 { + label = "kernel1"; + reg = <0x10e0000 0xf10000>; + }; + }; + }; +}; + +&wlan_2g { + mtd-mac-address = <&eeprom 0x0>; +}; + +&wlan_5g { + mediatek,mtd-eeprom = <&factory 0x20000>; + mtd-mac-address = <&eeprom 0x6>; +}; diff --git a/target/linux/ramips/dts/mt7621_ubnt_unifi-nanohd.dts b/target/linux/ramips/dts/mt7621_ubnt_unifi-nanohd.dts index 4ba5f6a428..401868362e 100644 --- a/target/linux/ramips/dts/mt7621_ubnt_unifi-nanohd.dts +++ b/target/linux/ramips/dts/mt7621_ubnt_unifi-nanohd.dts @@ -1,49 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include "mt7621.dtsi" - -#include -#include +#include "mt7621_ubnt_unifi.dtsi" / { compatible = "ubnt,unifi-nanohd", "mediatek,mt7621-soc"; model = "Ubiquiti UniFi nanoHD"; - - aliases { - led-boot = &led_white; - led-failsafe = &led_white; - led-running = &led_blue; - led-upgrade = &led_blue; - label-mac-device = &gmac0; - }; - - chosen { - bootargs = "console=ttyS0,115200"; - }; - - leds { - compatible = "gpio-leds"; - - led_blue: dome_blue { - label = "blue:dome"; - gpios = <&gpio 3 GPIO_ACTIVE_HIGH>; - }; - - led_white: dome_white { - label = "white:dome"; - gpios = <&gpio 4 GPIO_ACTIVE_HIGH>; - }; - }; - - keys { - compatible = "gpio-keys"; - - reset { - label = "reset"; - gpios = <&gpio 12 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - }; }; &spi0 { @@ -109,40 +70,6 @@ }; }; -&pcie { - status = "okay"; -}; - -&pcie0 { - wifi@0,0 { - reg = <0x0 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; - }; -}; - -&pcie1 { - wifi@0,0 { - reg = <0x0 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; - }; -}; - -&gmac0 { - mtd-mac-address = <&eeprom 0x0>; -}; - -&switch0 { - ports { - port@0 { - status = "okay"; - label = "lan"; - }; - }; -}; - -&state_default { - gpio { - groups = "i2c", "uart2"; - function = "gpio"; - }; +&wlan_5g { + mediatek,mtd-eeprom = <&factory 0x8000>; }; diff --git a/target/linux/ramips/dts/mt7621_ubnt_unifi.dtsi b/target/linux/ramips/dts/mt7621_ubnt_unifi.dtsi new file mode 100644 index 0000000000..e0625ba500 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_ubnt_unifi.dtsi @@ -0,0 +1,81 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include + +/ { + aliases { + led-boot = &led_white; + led-failsafe = &led_white; + led-running = &led_blue; + led-upgrade = &led_blue; + label-mac-device = &gmac0; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + leds { + compatible = "gpio-leds"; + + led_blue: dome_blue { + label = "blue:dome"; + gpios = <&gpio 3 GPIO_ACTIVE_HIGH>; + }; + + led_white: dome_white { + label = "white:dome"; + gpios = <&gpio 4 GPIO_ACTIVE_HIGH>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wlan_2g: wifi@0,0 { + reg = <0x0 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0>; + }; +}; + +&pcie1 { + wlan_5g: wifi@0,0 { + reg = <0x0 0 0 0 0>; + }; +}; + +&gmac0 { + mtd-mac-address = <&eeprom 0x0>; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "lan"; + }; + }; +}; + +&state_default { + gpio { + groups = "i2c", "uart2"; + function = "gpio"; + }; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index f6b72a699d..720d435665 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -1130,6 +1130,16 @@ define Device/ubnt_edgerouter-x-sfp endef TARGET_DEVICES += ubnt_edgerouter-x-sfp +define Device/ubnt_unifi-6-lite + $(Device/dsa-migration) + DEVICE_VENDOR := Ubiquiti + DEVICE_MODEL := UniFi 6 Lite + DEVICE_PACKAGES += kmod-mt7603 kmod-mt7915e + KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb + IMAGE_SIZE := 15424k +endef +TARGET_DEVICES += ubnt_unifi-6-lite + define Device/ubnt_unifi-nanohd $(Device/dsa-migration) DEVICE_VENDOR := Ubiquiti diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network index bca4cc23dc..83c4162e2f 100755 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -29,6 +29,7 @@ ramips_setup_interfaces() tplink,re350-v1|\ tplink,re500-v1|\ tplink,re650-v1|\ + ubnt,unifi-6-lite|\ ubnt,unifi-nanohd) ucidef_set_interface_lan "lan" ;; diff --git a/target/linux/ramips/mt7621/config-5.4 b/target/linux/ramips/mt7621/config-5.4 index fbfb5b09f1..b2ad37510b 100644 --- a/target/linux/ramips/mt7621/config-5.4 +++ b/target/linux/ramips/mt7621/config-5.4 @@ -209,6 +209,7 @@ CONFIG_MTD_PHYSMAP=y CONFIG_MTD_RAW_NAND=y CONFIG_MTD_ROUTERBOOT_PARTS=y CONFIG_MTD_SPI_NOR=y +CONFIG_MTD_SPLIT_FIT_FW=y CONFIG_MTD_SPLIT_MINOR_FW=y CONFIG_MTD_SPLIT_SEAMA_FW=y CONFIG_MTD_SPLIT_TPLINK_FW=y diff --git a/target/linux/ramips/patches-5.4/0001-MIPS-cmdline-Clean-up-boot_command_line-initializati.patch b/target/linux/ramips/patches-5.4/0001-MIPS-cmdline-Clean-up-boot_command_line-initializati.patch new file mode 100644 index 0000000000..eedc7498be --- /dev/null +++ b/target/linux/ramips/patches-5.4/0001-MIPS-cmdline-Clean-up-boot_command_line-initializati.patch @@ -0,0 +1,192 @@ +From: Paul Burton +Date: Wed, 9 Oct 2019 23:09:45 +0000 +Subject: MIPS: cmdline: Clean up boot_command_line initialization + +Our current code to initialize boot_command_line is a mess. Some of this +is due to the addition of too many options over the years, and some of +this is due to workarounds for early_init_dt_scan_chosen() performing +actions specific to options from other architectures that probably +shouldn't be in generic code. + +Clean this up by introducing a new bootcmdline_init() function that +simplifies the initialization somewhat. The major changes are: + +- Because bootcmdline_init() is a function it can return early in the + CONFIG_CMDLINE_OVERRIDE case. + +- We clear boot_command_line rather than inheriting whatever + early_init_dt_scan_chosen() may have left us. This means we no longer + need to set boot_command_line to a space character in an attempt to + prevent early_init_dt_scan_chosen() from copying CONFIG_CMDLINE into + boot_command_line without us knowing about it. + +- Indirection via USE_PROM_CMDLINE, USE_DTB_CMDLINE, EXTEND_WITH_PROM & + BUILTIN_EXTEND_WITH_PROM macros is removed; they seemingly served only + to obfuscate the code. + +- The logic is cleaner, clearer & commented. + +Two minor drawbacks of this approach are: + +1) We call of_scan_flat_dt(), which means we scan through the DT again. + The overhead is fairly minimal & shouldn't be noticeable. + +2) cmdline_scan_chosen() duplicates a small amount of the logic from + early_init_dt_scan_chosen(). Alternatives might be to allow the + generic FDT code to keep & expose a copy of the arguments taken from + the /chosen node's bootargs property, or to introduce a function like + early_init_dt_scan_chosen() that retrieves them without modification + to handle CONFIG_CMDLINE. Neither of these sounds particularly + cleaner though, and this way we at least keep the extra work in + arch/mips. + +Origin: upstream, https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7784cac697351f0cc0a4bb619594c0c99348c5aa +Signed-off-by: Paul Burton +Cc: linux-mips@vger.kernel.org + +--- a/arch/mips/kernel/setup.c ++++ b/arch/mips/kernel/setup.c +@@ -538,11 +538,88 @@ static void __init check_kernel_sections + } + } + +-#define USE_PROM_CMDLINE IS_ENABLED(CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER) +-#define USE_DTB_CMDLINE IS_ENABLED(CONFIG_MIPS_CMDLINE_FROM_DTB) +-#define EXTEND_WITH_PROM IS_ENABLED(CONFIG_MIPS_CMDLINE_DTB_EXTEND) +-#define BUILTIN_EXTEND_WITH_PROM \ +- IS_ENABLED(CONFIG_MIPS_CMDLINE_BUILTIN_EXTEND) ++static void __init bootcmdline_append(const char *s, size_t max) ++{ ++ if (!s[0] || !max) ++ return; ++ ++ if (boot_command_line[0]) ++ strlcat(boot_command_line, " ", COMMAND_LINE_SIZE); ++ ++ strlcat(boot_command_line, s, max); ++} ++ ++static int __init bootcmdline_scan_chosen(unsigned long node, const char *uname, ++ int depth, void *data) ++{ ++ bool *dt_bootargs = data; ++ const char *p; ++ int l; ++ ++ if (depth != 1 || !data || ++ (strcmp(uname, "chosen") != 0 && strcmp(uname, "chosen@0") != 0)) ++ return 0; ++ ++ p = of_get_flat_dt_prop(node, "bootargs", &l); ++ if (p != NULL && l > 0) { ++ bootcmdline_append(p, min(l, COMMAND_LINE_SIZE)); ++ *dt_bootargs = true; ++ } ++ ++ return 1; ++} ++ ++static void __init bootcmdline_init(char **cmdline_p) ++{ ++ bool dt_bootargs = false; ++ ++ /* ++ * If CMDLINE_OVERRIDE is enabled then initializing the command line is ++ * trivial - we simply use the built-in command line unconditionally & ++ * unmodified. ++ */ ++ if (IS_ENABLED(CONFIG_CMDLINE_OVERRIDE)) { ++ strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE); ++ return; ++ } ++ ++ /* ++ * If the user specified a built-in command line & ++ * MIPS_CMDLINE_BUILTIN_EXTEND, then the built-in command line is ++ * prepended to arguments from the bootloader or DT so we'll copy them ++ * to the start of boot_command_line here. Otherwise, empty ++ * boot_command_line to undo anything early_init_dt_scan_chosen() did. ++ */ ++ if (IS_ENABLED(CONFIG_MIPS_CMDLINE_BUILTIN_EXTEND)) ++ strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE); ++ else ++ boot_command_line[0] = 0; ++ ++ /* ++ * If we're configured to take boot arguments from DT, look for those ++ * now. ++ */ ++ if (IS_ENABLED(CONFIG_MIPS_CMDLINE_FROM_DTB)) ++ of_scan_flat_dt(bootcmdline_scan_chosen, &dt_bootargs); ++ ++ /* ++ * If we didn't get any arguments from DT (regardless of whether that's ++ * because we weren't configured to look for them, or because we looked ++ * & found none) then we'll take arguments from the bootloader. ++ * plat_mem_setup() should have filled arcs_cmdline with arguments from ++ * the bootloader. ++ */ ++ if (IS_ENABLED(CONFIG_MIPS_CMDLINE_DTB_EXTEND) || !dt_bootargs) ++ bootcmdline_append(arcs_cmdline, COMMAND_LINE_SIZE); ++ ++ /* ++ * If the user specified a built-in command line & we didn't already ++ * prepend it, we append it to boot_command_line here. ++ */ ++ if (IS_ENABLED(CONFIG_CMDLINE_BOOL) && ++ !IS_ENABLED(CONFIG_MIPS_CMDLINE_BUILTIN_EXTEND)) ++ bootcmdline_append(builtin_cmdline, COMMAND_LINE_SIZE); ++} + + /* + * arch_mem_init - initialize memory management subsystem +@@ -570,48 +647,12 @@ static void __init arch_mem_init(char ** + { + extern void plat_mem_setup(void); + +- /* +- * Initialize boot_command_line to an innocuous but non-empty string in +- * order to prevent early_init_dt_scan_chosen() from copying +- * CONFIG_CMDLINE into it without our knowledge. We handle +- * CONFIG_CMDLINE ourselves below & don't want to duplicate its +- * content because repeating arguments can be problematic. +- */ +- strlcpy(boot_command_line, " ", COMMAND_LINE_SIZE); +- + /* call board setup routine */ + plat_mem_setup(); + memblock_set_bottom_up(true); + +-#if defined(CONFIG_CMDLINE_BOOL) && defined(CONFIG_CMDLINE_OVERRIDE) +- strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE); +-#else +- if ((USE_PROM_CMDLINE && arcs_cmdline[0]) || +- (USE_DTB_CMDLINE && !boot_command_line[0])) +- strlcpy(boot_command_line, arcs_cmdline, COMMAND_LINE_SIZE); +- +- if (EXTEND_WITH_PROM && arcs_cmdline[0]) { +- if (boot_command_line[0]) +- strlcat(boot_command_line, " ", COMMAND_LINE_SIZE); +- strlcat(boot_command_line, arcs_cmdline, COMMAND_LINE_SIZE); +- } +- +-#if defined(CONFIG_CMDLINE_BOOL) +- if (builtin_cmdline[0]) { +- if (boot_command_line[0]) +- strlcat(boot_command_line, " ", COMMAND_LINE_SIZE); +- strlcat(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE); +- } +- +- if (BUILTIN_EXTEND_WITH_PROM && arcs_cmdline[0]) { +- if (boot_command_line[0]) +- strlcat(boot_command_line, " ", COMMAND_LINE_SIZE); +- strlcat(boot_command_line, arcs_cmdline, COMMAND_LINE_SIZE); +- } +-#endif +-#endif ++ bootcmdline_init(cmdline_p); + strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE); +- + *cmdline_p = command_line; + + parse_early_param(); diff --git a/target/linux/ramips/patches-5.4/0002-MIPS-Always-define-builtin_cmdline.patch b/target/linux/ramips/patches-5.4/0002-MIPS-Always-define-builtin_cmdline.patch new file mode 100644 index 0000000000..03124d07d1 --- /dev/null +++ b/target/linux/ramips/patches-5.4/0002-MIPS-Always-define-builtin_cmdline.patch @@ -0,0 +1,44 @@ +From b7340422cc16c5deff100812f38114bb5ec81203 Mon Sep 17 00:00:00 2001 +From: Paul Burton +Date: Sat, 12 Oct 2019 20:43:36 +0000 +Subject: [PATCH] MIPS: Always define builtin_cmdline + +Commit 7784cac69735 ("MIPS: cmdline: Clean up boot_command_line +initialization") made use of builtin_cmdline conditional upon plain C if +statements rather than preprocessor #ifdef's. This caused build failures +for configurations with CONFIG_CMDLINE_BOOL=n where builtin_cmdline +wasn't defined, for example: + + arch/mips/kernel/setup.c: In function 'bootcmdline_init': +>> arch/mips/kernel/setup.c:582:30: error: 'builtin_cmdline' undeclared + (first use in this function); did you mean 'builtin_driver'? + strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE); + ^~~~~~~~~~~~~~~ + builtin_driver + arch/mips/kernel/setup.c:582:30: note: each undeclared identifier is + reported only once for each function it appears in + +Fix this by defining builtin_cmdline as an empty string in the affected +configurations. All of the paths that use it should be optimized out +anyway so the data itself gets optimized away too. + +Signed-off-by: Paul Burton +Fixes: 7784cac69735 ("MIPS: cmdline: Clean up boot_command_line initialization") +Reported-by: kbuild test robot +Reported-by: Nathan Chancellor +Cc: linux-mips@vger.kernel.org +--- + arch/mips/kernel/setup.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/arch/mips/kernel/setup.c ++++ b/arch/mips/kernel/setup.c +@@ -68,6 +68,8 @@ char __initdata arcs_cmdline[COMMAND_LIN + + #ifdef CONFIG_CMDLINE_BOOL + static char __initdata builtin_cmdline[COMMAND_LINE_SIZE] = CONFIG_CMDLINE; ++#else ++static const char builtin_cmdline[] __initconst = ""; + #endif + + /* diff --git a/target/linux/ramips/patches-5.4/0010-MIPS-add-bootargs-override-property.patch b/target/linux/ramips/patches-5.4/0010-MIPS-add-bootargs-override-property.patch new file mode 100644 index 0000000000..c19a0fb480 --- /dev/null +++ b/target/linux/ramips/patches-5.4/0010-MIPS-add-bootargs-override-property.patch @@ -0,0 +1,63 @@ +From f15d27f9c90ede4b16eb37f9ae573ef81c2b6996 Mon Sep 17 00:00:00 2001 +From: David Bauer +Date: Thu, 31 Dec 2020 18:49:12 +0100 +Subject: [PATCH] MIPS: add bootargs-override property + +Add support for the bootargs-override property to the chosen node +similar to the one used on ipq806x or mpc85xx. + +This is necessary, as the U-Boot used on some boards, notably the +Ubiquiti UniFi 6 Lite, overwrite the bootargs property of the chosen +node leading to a kernel panic when loading OpenWrt. + +Signed-off-by: David Bauer +--- + arch/mips/kernel/setup.c | 30 ++++++++++++++++++++++++++++++ + 1 file changed, 30 insertions(+) + +--- a/arch/mips/kernel/setup.c ++++ b/arch/mips/kernel/setup.c +@@ -571,8 +571,28 @@ static int __init bootcmdline_scan_chose + return 1; + } + ++static int __init bootcmdline_scan_chosen_override(unsigned long node, const char *uname, ++ int depth, void *data) ++{ ++ bool *dt_bootargs = data; ++ const char *p; ++ int l; ++ ++ if (depth != 1 || !data || strcmp(uname, "chosen") != 0) ++ return 0; ++ ++ p = of_get_flat_dt_prop(node, "bootargs-override", &l); ++ if (p != NULL && l > 0) { ++ strlcpy(boot_command_line, p, COMMAND_LINE_SIZE); ++ *dt_bootargs = true; ++ } ++ ++ return 1; ++} ++ + static void __init bootcmdline_init(char **cmdline_p) + { ++ bool dt_bootargs_override = false; + bool dt_bootargs = false; + + /* +@@ -586,6 +606,14 @@ static void __init bootcmdline_init(char + } + + /* ++ * If bootargs-override in the chosen node is set, use this as the ++ * command line ++ */ ++ of_scan_flat_dt(bootcmdline_scan_chosen_override, &dt_bootargs_override); ++ if (dt_bootargs_override) ++ return; ++ ++ /* + * If the user specified a built-in command line & + * MIPS_CMDLINE_BUILTIN_EXTEND, then the built-in command line is + * prepended to arguments from the bootloader or DT so we'll copy them From f4c64937cf3941f6c6ad6c882de02d1792f04812 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Tue, 5 Jan 2021 16:24:42 +0000 Subject: [PATCH 02/18] ipq806x: fix LED names of TP-Link Talon AD2700 While the underscore in the name of the USB LEDs was removed from DTS, /etc/board.d/01_leds also has to reflect that change. Fixes: 28fd279e5d ("ipq806x: some corrections for TP-Link Talon AD7200") Signed-off-by: Daniel Golle --- target/linux/ipq806x/base-files/etc/board.d/01_leds | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/ipq806x/base-files/etc/board.d/01_leds b/target/linux/ipq806x/base-files/etc/board.d/01_leds index a03a056d83..284f9e2c1d 100755 --- a/target/linux/ipq806x/base-files/etc/board.d/01_leds +++ b/target/linux/ipq806x/base-files/etc/board.d/01_leds @@ -40,8 +40,8 @@ netgear,r7800) ucidef_set_led_ide "esata" "eSATA" "white:esata" ;; tplink,ad7200) - ucidef_set_led_usbport "usb1" "USB 1" "blue:usb_1" "usb1-port1" "usb2-port1" - ucidef_set_led_usbport "usb2" "USB 2" "blue:usb_3" "usb3-port1" "usb4-port1" + ucidef_set_led_usbport "usb1" "USB 1" "blue:usb1" "usb1-port1" "usb2-port1" + ucidef_set_led_usbport "usb2" "USB 2" "blue:usb3" "usb3-port1" "usb4-port1" ucidef_set_led_switch "wan" "wan" "blue:wan" "switch0" "0x02" ucidef_set_led_switch "lan" "lan" "blue:lan" "switch0" "0x3c" ucidef_set_led_wlan "wlan2g" "wlan2g" "blue:wlan2g" "phy2tpt" From f34f4a6665a91571866de38f476554ed986eccf2 Mon Sep 17 00:00:00 2001 From: Syrone Wong Date: Fri, 1 Jan 2021 21:50:43 +0800 Subject: [PATCH 03/18] tools/fakeroot: update to 1.25.3 use PKG_FIXUP:=autoreconf to generate configure 200-hide-dlsym-error.patch deleted due to fixed upstream in another way other patches refreshed to reflect latest changes Signed-off-by: Syrone Wong --- tools/Makefile | 1 + tools/fakeroot/Makefile | 7 ++-- tools/fakeroot/patches/000-relocatable.patch | 6 ++-- tools/fakeroot/patches/100-portability.patch | 28 ++++++---------- tools/fakeroot/patches/200-disable-doc.patch | 10 ++++++ .../patches/200-hide-dlsym-error.patch | 32 ------------------- 6 files changed, 27 insertions(+), 57 deletions(-) create mode 100644 tools/fakeroot/patches/200-disable-doc.patch delete mode 100644 tools/fakeroot/patches/200-hide-dlsym-error.patch diff --git a/tools/Makefile b/tools/Makefile index 4bef951c46..3677023aee 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -47,6 +47,7 @@ $(curdir)/cbootimage/compile += $(curdir)/automake/compile $(curdir)/cmake/compile += $(curdir)/libressl/compile $(curdir)/dosfstools/compile := $(curdir)/autoconf/compile $(curdir)/automake/compile $(curdir)/e2fsprogs/compile := $(curdir)/libtool/compile +$(curdir)/fakeroot/compile := $(curdir)/libtool/compile $(curdir)/findutils/compile := $(curdir)/bison/compile $(curdir)/firmware-utils/compile += $(curdir)/libressl/compile $(curdir)/zlib/compile $(curdir)/flex/compile := $(curdir)/libtool/compile diff --git a/tools/fakeroot/Makefile b/tools/fakeroot/Makefile index 8c30ee71c3..e9daa4b6ad 100644 --- a/tools/fakeroot/Makefile +++ b/tools/fakeroot/Makefile @@ -5,14 +5,15 @@ include $(TOPDIR)/rules.mk PKG_NAME:=fakeroot -PKG_VERSION:=1.24 -PKG_RELEASE:=2 +PKG_VERSION:=1.25.3 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz PKG_SOURCE_URL:=http://deb.debian.org/debian/pool/main/f/fakeroot -PKG_HASH:=2e045b3160370b8ab4d44d1f8d267e5d1d555f1bb522d650e7167b09477266ed +PKG_HASH:=8e903683357f7f5bcc31b879fd743391ad47691d4be33d24a76be3b6c21e956c PKG_LICENSE:=GPL-3.0-or-later PKG_LICENSE_FILES:=COPYING +PKG_FIXUP:=autoreconf include $(INCLUDE_DIR)/host-build.mk diff --git a/tools/fakeroot/patches/000-relocatable.patch b/tools/fakeroot/patches/000-relocatable.patch index 0408acfa25..44897c5ab8 100644 --- a/tools/fakeroot/patches/000-relocatable.patch +++ b/tools/fakeroot/patches/000-relocatable.patch @@ -8,7 +8,7 @@ -FAKEROOT_BINDIR=@bindir@ +if [ -n "$STAGING_DIR_HOST" ]; then + USEABSLIBPATH=1 -+ LIB=${STAGING_DIR_HOST}/lib/lib@fakeroot_transformed@@DLSUFFIX@ ++ FAKEROOT_LIB=${STAGING_DIR_HOST}/lib/lib@fakeroot_transformed@@DLSUFFIX@ + FAKED=${STAGING_DIR_HOST}/bin/faked + PATHS= +else @@ -16,11 +16,11 @@ + FAKEROOT_BINDIR=@bindir@ -USEABSLIBPATH=@LDPRELOADABS@ --LIB=lib@fakeroot_transformed@@DLSUFFIX@ +-FAKEROOT_LIB=lib@fakeroot_transformed@@DLSUFFIX@ -PATHS=@libdir@:${FAKEROOT_PREFIX}/lib64/libfakeroot:${FAKEROOT_PREFIX}/lib32/libfakeroot -FAKED=${FAKEROOT_BINDIR}/@faked_transformed@ + USEABSLIBPATH=@LDPRELOADABS@ -+ LIB=lib@fakeroot_transformed@@DLSUFFIX@ ++ FAKEROOT_LIB=lib@fakeroot_transformed@@DLSUFFIX@ + PATHS=@libdir@:${FAKEROOT_PREFIX}/lib64/libfakeroot:${FAKEROOT_PREFIX}/lib32/libfakeroot + FAKED=${FAKEROOT_BINDIR}/@faked_transformed@ +fi diff --git a/tools/fakeroot/patches/100-portability.patch b/tools/fakeroot/patches/100-portability.patch index 5713c9e3fe..315a9e16bf 100644 --- a/tools/fakeroot/patches/100-portability.patch +++ b/tools/fakeroot/patches/100-portability.patch @@ -1,9 +1,9 @@ --- a/libfakeroot.c +++ b/libfakeroot.c -@@ -110,8 +110,16 @@ - #define INT_NEXT_FSTATAT(a,b,c,d) NEXT_FSTATAT(_STAT_VER,a,b,c,d) +@@ -112,8 +112,16 @@ #define INT_SEND_STAT(a,b) SEND_STAT(a,b,_STAT_VER) #define INT_SEND_GET_XATTR(a,b) SEND_GET_XATTR(a,b,_STAT_VER) + #define INT_SEND_GET_STAT(a,b) SEND_GET_STAT(a,b) + +/* 10.10 uses id_t in getpriority/setpriority calls, so pretend + id_t is used everywhere, just happens to be int on some OSes */ @@ -17,7 +17,7 @@ #include #include #include -@@ -123,7 +131,6 @@ +@@ -125,7 +133,6 @@ #include #include #include @@ -25,7 +25,7 @@ #ifdef HAVE_SYS_ACL_H #include #endif /* HAVE_SYS_ACL_H */ -@@ -1894,7 +1901,7 @@ ssize_t fremovexattr(int fd, const char +@@ -1911,7 +1918,7 @@ ssize_t fremovexattr(int fd, const char } #endif /* HAVE_FREMOVEXATTR */ @@ -34,7 +34,7 @@ if (fakeroot_disabled) return next_setpriority(which, who, prio); next_setpriority(which, who, prio); -@@ -2426,3 +2433,19 @@ int sysinfo(int command, char *buf, long +@@ -2520,3 +2527,19 @@ int sysinfo(int command, char *buf, long } } #endif @@ -56,16 +56,16 @@ +#endif --- a/wrapfunc.inp +++ b/wrapfunc.inp -@@ -145,7 +145,7 @@ setfsgid;gid_t;(gid_t fsgid);(fsgid) - #endif /* HAVE_SETFSGID */ +@@ -146,7 +146,7 @@ setfsgid;gid_t;(gid_t fsgid);(fsgid) initgroups;int;(const char *user, INITGROUPS_SECOND_ARG group);(user, group) + getgroups;int;(int size, gid_t list[]);(size, list) setgroups;int;(SETGROUPS_SIZE_TYPE size, const gid_t *list);(size, list) -setpriority;int;(int which, int who, int prio);(which, who, prio) +setpriority;int;(int which, id_t who, int prio);(which, who, prio) #ifdef HAVE_CAPSET capset;int;(cap_user_header_t hdrp, const cap_user_data_t datap);(hdrp, datap) #endif /* HAVE_CAPSET */ -@@ -197,7 +197,7 @@ fchownat;int;(int dir_fd, const char *pa +@@ -198,7 +198,7 @@ fchownat;int;(int dir_fd, const char *pa mkdirat;int;(int dir_fd, const char *pathname, mode_t mode);(dir_fd, pathname, mode) #endif /* HAVE_MKDIRAT */ #ifdef HAVE_OPENAT @@ -112,17 +112,7 @@ print "static __inline__ " ret " next_" name, argtype " {" > tmpffile; --- a/configure.ac +++ b/configure.ac -@@ -110,6 +110,7 @@ for first in size_t int; do - #include - #endif - #include -+#include - #ifdef HAVE_GRP_H - #include - #endif ---- a/configure -+++ b/configure -@@ -12847,6 +12847,7 @@ for first in size_t int; do +@@ -146,6 +146,7 @@ for first in size_t int; do #include #endif #include diff --git a/tools/fakeroot/patches/200-disable-doc.patch b/tools/fakeroot/patches/200-disable-doc.patch new file mode 100644 index 0000000000..29a3e39b2d --- /dev/null +++ b/tools/fakeroot/patches/200-disable-doc.patch @@ -0,0 +1,10 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -1,6 +1,6 @@ + AUTOMAKE_OPTIONS=foreign + ACLOCAL_AMFLAGS = -I build-aux +-SUBDIRS=doc scripts test ++SUBDIRS=scripts test + + noinst_LTLIBRARIES = libcommunicate.la libmacosx.la + libcommunicate_la_SOURCES = communicate.c diff --git a/tools/fakeroot/patches/200-hide-dlsym-error.patch b/tools/fakeroot/patches/200-hide-dlsym-error.patch deleted file mode 100644 index 3fd34c8778..0000000000 --- a/tools/fakeroot/patches/200-hide-dlsym-error.patch +++ /dev/null @@ -1,32 +0,0 @@ -Description: Hide error from dlsym() - dlsym(), starting in glibc 2.24 actually reports errors. In our case, - we try to get ACL functions which are not in the glibc. This causes - failures in test suites, so hide those messages for non-debugging - purposes for now. It also makes the build logs annoying to read. -Author: Julian Andres Klode -Origin: vendor -Bug-Debian: https://bugs.debian.org/830912 -Forwarded: no -Last-Update: 2016-08-12 - ---- a/libfakeroot.c -+++ b/libfakeroot.c -@@ -256,10 +256,16 @@ void load_library_symbols(void){ - /* clear dlerror() just in case dlsym() legitimately returns NULL */ - msg = dlerror(); - *(next_wrap[i].doit)=dlsym(get_libc(), next_wrap[i].name); -+ - if ( (msg = dlerror()) != NULL){ -- fprintf (stderr, "dlsym(%s): %s\n", next_wrap[i].name, msg); --/* abort ();*/ -+#ifdef LIBFAKEROOT_DEBUGGING -+ if (fakeroot_debug) { -+ fprintf (stderr, "dlsym(%s): %s\n", next_wrap[i].name, msg); -+/* abort ();*/ -+ } -+#endif - } -+ - } - } - From 89f71ebb355c624320c2b0ace8ae9488ff53cbeb Mon Sep 17 00:00:00 2001 From: Birger Koblitz Date: Tue, 5 Jan 2021 20:40:52 +0100 Subject: [PATCH 04/18] realtek: fix build issues This fixes the build problems for the REALTEK target by adding a proper configuration option for the phy module. Signed-off-by: Birger Koblitz --- target/linux/realtek/config-5.4 | 1 + .../realtek/patches-5.4/705-add-rtl-phy.patch | 22 +++++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/target/linux/realtek/config-5.4 b/target/linux/realtek/config-5.4 index 170bcb7632..2176a2cf50 100644 --- a/target/linux/realtek/config-5.4 +++ b/target/linux/realtek/config-5.4 @@ -71,6 +71,7 @@ CONFIG_GENERIC_TIME_VSYSCALL=y CONFIG_GPIOLIB=y CONFIG_GPIO_RTL8231=y CONFIG_GPIO_RTL838X=y +CONFIG_REALTEK_SOC_PHY=y CONFIG_GRO_CELLS=y CONFIG_HANDLE_DOMAIN_IRQ=y CONFIG_HARDWARE_WATCHPOINTS=y diff --git a/target/linux/realtek/patches-5.4/705-add-rtl-phy.patch b/target/linux/realtek/patches-5.4/705-add-rtl-phy.patch index 826891abe1..ea0d48861d 100644 --- a/target/linux/realtek/patches-5.4/705-add-rtl-phy.patch +++ b/target/linux/realtek/patches-5.4/705-add-rtl-phy.patch @@ -1,11 +1,25 @@ +--- a/drivers/net/phy/Kconfig ++++ b/drivers/net/phy/Kconfig +@@ -454,6 +454,12 @@ + ---help--- + Supports the Realtek 821x PHY. + ++config REALTEK_SOC_PHY ++ tristate "Realtek SoC PHYs" ++ depends on RTL838X ++ ---help--- ++ Supports the PHYs found in combination with Realtek Switch SoCs ++ + config RENESAS_PHY + tristate "Driver for Renesas PHYs" + ---help--- --- a/drivers/net/phy/Makefile +++ b/drivers/net/phy/Makefile -@@ -101,7 +101,7 @@ obj-$(CONFIG_MICROSEMI_PHY) += mscc.o - obj-$(CONFIG_NATIONAL_PHY) += national.o +@@ -87,6 +87,7 @@ obj-$(CONFIG_NXP_TJA11XX_PHY) += nxp-tja11xx.o obj-$(CONFIG_QSEMI_PHY) += qsemi.o --obj-$(CONFIG_REALTEK_PHY) += realtek.o -+obj-$(CONFIG_REALTEK_PHY) += realtek.o rtl83xx-phy.o + obj-$(CONFIG_REALTEK_PHY) += realtek.o ++obj-$(CONFIG_REALTEK_SOC_PHY) += rtl83xx-phy.o obj-$(CONFIG_RENESAS_PHY) += uPD60620.o obj-$(CONFIG_ROCKCHIP_PHY) += rockchip.o obj-$(CONFIG_SMSC_PHY) += smsc.o From f1620630e9f3407780ddc554361841f05c996c49 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Tue, 5 Jan 2021 20:04:22 +0000 Subject: [PATCH 05/18] iwinfo: update to git HEAD a17f561 iwinfo: detect QCA IPQ4019 WiSoC from FDT ea28dfb iwinfo: export ht and vht operation in scan results 4e22953 iwinfo: export center_chan info for local wifi 74d13fb cli: account for additional digit for frequencies above 10GHz 8bfd8d8 iwinfo: add support for GCMP cipher Signed-off-by: Daniel Golle --- package/network/utils/iwinfo/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/network/utils/iwinfo/Makefile b/package/network/utils/iwinfo/Makefile index fd2d836bdb..7e9d8e89c0 100644 --- a/package/network/utils/iwinfo/Makefile +++ b/package/network/utils/iwinfo/Makefile @@ -11,9 +11,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/iwinfo.git -PKG_SOURCE_DATE:=2020-06-03 -PKG_SOURCE_VERSION:=2faa20e5e9d107b97e393a4eb458370e80b4d720 -PKG_MIRROR_HASH:=c5094a1751cbc610a91d21b7ddbec85c4f80d51dddb249fdcabb327ab1e2523f +PKG_SOURCE_DATE:=2021-01-05 +PKG_SOURCE_VERSION:=8bfd8d88001e0d239d741c954c2421052b858fc1 +PKG_MIRROR_HASH:=02b92500bf2c697d27767024005fd90d35c91ab37a06db2226cef7cf3c80f4f6 PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=GPL-2.0 @@ -33,7 +33,7 @@ define Package/libiwinfo CATEGORY:=Libraries TITLE:=Generalized Wireless Information Library (iwinfo) DEPENDS:=+PACKAGE_kmod-cfg80211:libnl-tiny +libuci +libubus - ABI_VERSION:=20200105 + ABI_VERSION:=20210105 endef define Package/libiwinfo/description From 190e7939639846b86ab487c50169963382720e2b Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Tue, 5 Jan 2021 20:02:52 +0000 Subject: [PATCH 06/18] rpcd: update to git HEAD fd017ba iwinfo: add ht and vht operation info to wifi scan 4c66b31 iwinfo: export center channel for info ubus call e28d4a5 iwinfo: add support for 802.11ad and GCMP 5c15f57 iwinfo: return hwmode 'ad' on 802.11ad-only hardware Signed-off-by: Daniel Golle --- package/system/rpcd/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/system/rpcd/Makefile b/package/system/rpcd/Makefile index b8a974086f..ccedbed900 100644 --- a/package/system/rpcd/Makefile +++ b/package/system/rpcd/Makefile @@ -8,14 +8,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=rpcd -PKG_RELEASE:=3 +PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/rpcd.git -PKG_SOURCE_DATE:=2020-09-18 -PKG_SOURCE_VERSION:=3fea6559817a22de1b8375b9b1f3d818e6534591 +PKG_SOURCE_DATE:=2021-01-05 +PKG_SOURCE_VERSION:=5c15f5736de0c329bccd1a39264a7bd00299f728 PKG_MAINTAINER:=Jo-Philipp Wich -PKG_MIRROR_HASH:=d9284a23017c4393f210afb5bdc7f6d9e0b3ef46cc6e2cc2b2bcaa0199c942af +PKG_MIRROR_HASH:=fc97cb403490de0e17dddd7a722f04460aa1c2765a1c4fd54b8d629dc2e84aee PKG_LICENSE:=ISC PKG_LICENSE_FILES:= From b4c0d377f6bc13c555b69659ac001a25ab22bbd4 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Wed, 6 Jan 2021 00:00:01 +0100 Subject: [PATCH 07/18] ramips: limit 5GHz channels for UniFi 6 Lite The MT7915 radio currently advertises 2.4GHz channels while the antenna path only supports 5 GHz. Limit the radio to 5GHz channels to prevent users from configuring non-supported channels. Signed-off-by: David Bauer --- target/linux/ramips/dts/mt7621_ubnt_unifi-6-lite.dts | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/ramips/dts/mt7621_ubnt_unifi-6-lite.dts b/target/linux/ramips/dts/mt7621_ubnt_unifi-6-lite.dts index 422d17673b..f5425ccfee 100644 --- a/target/linux/ramips/dts/mt7621_ubnt_unifi-6-lite.dts +++ b/target/linux/ramips/dts/mt7621_ubnt_unifi-6-lite.dts @@ -80,4 +80,5 @@ &wlan_5g { mediatek,mtd-eeprom = <&factory 0x20000>; mtd-mac-address = <&eeprom 0x6>; + ieee80211-freq-limit = <5000000 6000000>; }; From 79fe06a7dc8541963bd63d34f5556a7ebefa0549 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 6 Jan 2021 13:38:24 +0100 Subject: [PATCH 08/18] Revert "rpcd: update to git HEAD" This reverts commit 190e7939639846b86ab487c50169963382720e2b. This update introduces a potential null-pointer deref with subsequent rpcd crash when querying wireless info for non-nl80211 wdevs. Additionally it wrongly includes ht frequency information for non-ht BSSes. Signed-off-by: Jo-Philipp Wich --- package/system/rpcd/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/system/rpcd/Makefile b/package/system/rpcd/Makefile index ccedbed900..b8a974086f 100644 --- a/package/system/rpcd/Makefile +++ b/package/system/rpcd/Makefile @@ -8,14 +8,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=rpcd -PKG_RELEASE:=1 +PKG_RELEASE:=3 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/rpcd.git -PKG_SOURCE_DATE:=2021-01-05 -PKG_SOURCE_VERSION:=5c15f5736de0c329bccd1a39264a7bd00299f728 +PKG_SOURCE_DATE:=2020-09-18 +PKG_SOURCE_VERSION:=3fea6559817a22de1b8375b9b1f3d818e6534591 PKG_MAINTAINER:=Jo-Philipp Wich -PKG_MIRROR_HASH:=fc97cb403490de0e17dddd7a722f04460aa1c2765a1c4fd54b8d629dc2e84aee +PKG_MIRROR_HASH:=d9284a23017c4393f210afb5bdc7f6d9e0b3ef46cc6e2cc2b2bcaa0199c942af PKG_LICENSE:=ISC PKG_LICENSE_FILES:= From c63bcb53e9b69d2b10db4a87ba407f669b02a85a Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 6 Jan 2021 13:41:51 +0100 Subject: [PATCH 09/18] Revert "iwinfo: update to git HEAD" This reverts commit f1620630e9f3407780ddc554361841f05c996c49. This update introduces potentially remote exploitable buffer overreads in IE parsing logic. It also breaks the ABI without introdcing SOVERSION library versioning. Furthermore, HT information is incorrectly added for non-HT BSSes. Signed-off-by: Jo-Philipp Wich --- package/network/utils/iwinfo/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/network/utils/iwinfo/Makefile b/package/network/utils/iwinfo/Makefile index 7e9d8e89c0..fd2d836bdb 100644 --- a/package/network/utils/iwinfo/Makefile +++ b/package/network/utils/iwinfo/Makefile @@ -11,9 +11,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/iwinfo.git -PKG_SOURCE_DATE:=2021-01-05 -PKG_SOURCE_VERSION:=8bfd8d88001e0d239d741c954c2421052b858fc1 -PKG_MIRROR_HASH:=02b92500bf2c697d27767024005fd90d35c91ab37a06db2226cef7cf3c80f4f6 +PKG_SOURCE_DATE:=2020-06-03 +PKG_SOURCE_VERSION:=2faa20e5e9d107b97e393a4eb458370e80b4d720 +PKG_MIRROR_HASH:=c5094a1751cbc610a91d21b7ddbec85c4f80d51dddb249fdcabb327ab1e2523f PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=GPL-2.0 @@ -33,7 +33,7 @@ define Package/libiwinfo CATEGORY:=Libraries TITLE:=Generalized Wireless Information Library (iwinfo) DEPENDS:=+PACKAGE_kmod-cfg80211:libnl-tiny +libuci +libubus - ABI_VERSION:=20210105 + ABI_VERSION:=20200105 endef define Package/libiwinfo/description From 8050b7051429c002e4664807d758a279d7eb93a2 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Wed, 6 Jan 2021 00:50:09 +0100 Subject: [PATCH 10/18] ipq806x: clean up DTS file for TP-Link AD7200 This does several cosmetic adjustments for AD7200's DTS: - Make node name, DT label and label property consistent - Drop wrong and unused spi4 label - Use generic flash@0 node name Signed-off-by: Adrian Schmutzler --- .../arch/arm/boot/dts/qcom-ipq8064-ad7200.dts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200.dts index 48dc116e99..bd50d2d0fc 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200.dts @@ -15,10 +15,10 @@ aliases { mdio-gpio0 = &mdio0; - led-boot = &power; - led-failsafe = &power; - led-running = &power; - led-upgrade = &power; + led-boot = &led_status; + led-failsafe = &led_status; + led-running = &led_status; + led-upgrade = &led_status; label-mac-device = &gmac2; }; @@ -45,7 +45,7 @@ linux,code = ; }; - ledgeneral { + led_enable { label = "led-enable"; gpios = <&qcom_pinmux 53 GPIO_ACTIVE_LOW>; linux,code = ; @@ -102,7 +102,7 @@ gpios = <&qcom_pinmux 56 GPIO_ACTIVE_HIGH>; }; - power: status { + led_status: status { label = "blue:status"; gpios = <&qcom_pinmux 66 GPIO_ACTIVE_HIGH>; }; @@ -179,7 +179,7 @@ qcom,mode = ; status = "okay"; - spi4: spi@1a280000 { + spi@1a280000 { status = "okay"; pinctrl-0 = <&spi_pins>; @@ -187,7 +187,7 @@ cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>; - m25p80@0 { + flash@0 { compatible = "jedec,spi-nor"; #address-cells = <1>; #size-cells = <1>; From 8ddaeaf6424e26cc12bd8412ef6955c506b0a657 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Wed, 6 Jan 2021 01:05:39 +0100 Subject: [PATCH 11/18] ipq806x: create DTSI for TP-Link AD7200 and C2600 Both devices share most of their setup except buttons and LEDs, so having a common DTSI removes a lot of duplicate code. In order to have a shared partitioning scheme, device-id and product-info from AD7200 have been merged into a single product-info partition like for C2600. Signed-off-by: Adrian Schmutzler --- .../boot/dts/qcom-ipq8064-ad7200-c2600.dtsi | 315 ++++++++++++++++++ .../arch/arm/boot/dts/qcom-ipq8064-ad7200.dts | 313 +---------------- .../arch/arm/boot/dts/qcom-ipq8064-c2600.dts | 308 +---------------- 3 files changed, 317 insertions(+), 619 deletions(-) create mode 100644 target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200-c2600.dtsi diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200-c2600.dtsi b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200-c2600.dtsi new file mode 100644 index 0000000000..a893225b1a --- /dev/null +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200-c2600.dtsi @@ -0,0 +1,315 @@ +//SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qcom-ipq8064-v2.0.dtsi" + +#include + +/ { + memory@0 { + reg = <0x42000000 0x1e000000>; + device_type = "memory"; + }; + + aliases { + mdio-gpio0 = &mdio0; + label-mac-device = &gmac2; + }; +}; + +&qcom_pinmux { + spi_pins: spi_pins { + mux { + pins = "gpio18", "gpio19", "gpio21"; + function = "gsbi5"; + bias-pull-down; + }; + + data { + pins = "gpio18", "gpio19"; + drive-strength = <10>; + }; + + cs { + pins = "gpio20"; + function = "gpio"; + drive-strength = <10>; + bias-pull-up; + }; + + clk { + pins = "gpio21"; + drive-strength = <12>; + }; + }; + + usb0_pwr_en_pin: usb0_pwr_en_pin { + mux { + pins = "gpio25"; + function = "gpio"; + drive-strength = <10>; + bias-pull-up; + output-high; + }; + }; + + usb1_pwr_en_pin: usb1_pwr_en_pin { + mux { + pins = "gpio23"; + function = "gpio"; + drive-strength = <10>; + bias-pull-up; + output-high; + }; + }; +}; + +&gsbi5 { + qcom,mode = ; + status = "okay"; + + spi@1a280000 { + status = "okay"; + + pinctrl-0 = <&spi_pins>; + pinctrl-names = "default"; + + cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>; + + flash@0 { + compatible = "jedec,spi-nor"; + #address-cells = <1>; + #size-cells = <1>; + spi-max-frequency = <50000000>; + reg = <0>; + + partition@0 { + label = "SBL1"; + reg = <0x0 0x20000>; + read-only; + }; + + partition@20000 { + label = "MIBIB"; + reg = <0x20000 0x20000>; + read-only; + }; + + partition@40000 { + label = "SBL2"; + reg = <0x40000 0x20000>; + read-only; + }; + + partition@60000 { + label = "SBL3"; + reg = <0x60000 0x30000>; + read-only; + }; + + partition@90000 { + label = "DDRCONFIG"; + reg = <0x90000 0x10000>; + read-only; + }; + + partition@a0000 { + label = "SSD"; + reg = <0xa0000 0x10000>; + read-only; + }; + + partition@b0000 { + label = "TZ"; + reg = <0xb0000 0x30000>; + read-only; + }; + + partition@e0000 { + label = "RPM"; + reg = <0xe0000 0x20000>; + read-only; + }; + + partition@100000 { + label = "fs-uboot"; + reg = <0x100000 0x70000>; + read-only; + }; + + partition@170000 { + label = "uboot-env"; + reg = <0x170000 0x40000>; + read-only; + }; + + partition@1b0000 { + label = "radio"; + reg = <0x1b0000 0x40000>; + read-only; + }; + + partition@1f0000 { + label = "os-image"; + reg = <0x1f0000 0x400000>; + }; + + partition@5f0000 { + label = "rootfs"; + reg = <0x5f0000 0x1900000>; + }; + + defaultmac: partition@1ef0000 { + label = "default-mac"; + reg = <0x1ef0000 0x00200>; + read-only; + }; + + partition@1ef0200 { + label = "pin"; + reg = <0x1ef0200 0x00200>; + read-only; + }; + + partition@1ef0400 { + label = "product-info"; + reg = <0x1ef0400 0x0fc00>; + read-only; + }; + + partition@1f00000 { + label = "partition-table"; + reg = <0x1f00000 0x10000>; + read-only; + }; + + partition@1f10000 { + label = "soft-version"; + reg = <0x1f10000 0x10000>; + read-only; + }; + + partition@1f20000 { + label = "support-list"; + reg = <0x1f20000 0x10000>; + read-only; + }; + + partition@1f30000 { + label = "profile"; + reg = <0x1f30000 0x10000>; + read-only; + }; + + partition@1f40000 { + label = "default-config"; + reg = <0x1f40000 0x10000>; + read-only; + }; + + partition@1f50000 { + label = "user-config"; + reg = <0x1f50000 0x40000>; + read-only; + }; + + partition@1f90000 { + label = "qos-db"; + reg = <0x1f90000 0x40000>; + read-only; + }; + + partition@1fd0000 { + label = "usb-config"; + reg = <0x1fd0000 0x10000>; + read-only; + }; + + partition@1fe0000 { + label = "log"; + reg = <0x1fe0000 0x20000>; + read-only; + }; + }; + }; +}; + +&usb3_0 { + status = "okay"; + + pinctrl-0 = <&usb0_pwr_en_pin>; + pinctrl-names = "default"; +}; + +&usb3_1 { + status = "okay"; + + pinctrl-0 = <&usb1_pwr_en_pin>; + pinctrl-names = "default"; +}; + +&pcie0 { + status = "okay"; +}; + +&pcie1 { + status = "okay"; + max-link-speed = <1>; +}; + +&mdio0 { + status = "okay"; + + pinctrl-0 = <&mdio0_pins>; + pinctrl-names = "default"; + + phy0: ethernet-phy@0 { + reg = <0>; + qca,ar8327-initvals = < + 0x00004 0x7600000 /* PAD0_MODE */ + 0x00008 0x1000000 /* PAD5_MODE */ + 0x0000c 0x80 /* PAD6_MODE */ + 0x000e4 0x6a545 /* MAC_POWER_SEL */ + 0x000e0 0xc74164de /* SGMII_CTRL */ + 0x0007c 0x4e /* PORT0_STATUS */ + 0x00094 0x4e /* PORT6_STATUS */ + >; + }; + + phy4: ethernet-phy@4 { + reg = <4>; + }; +}; + +&gmac1 { + status = "okay"; + phy-mode = "rgmii"; + qcom,id = <1>; + + pinctrl-0 = <&rgmii2_pins>; + pinctrl-names = "default"; + + mtd-mac-address = <&defaultmac 0x8>; + mtd-mac-address-increment = <1>; + + fixed-link { + speed = <1000>; + full-duplex; + }; +}; + +&gmac2 { + status = "okay"; + phy-mode = "sgmii"; + qcom,id = <2>; + + mtd-mac-address = <&defaultmac 0x8>; + + fixed-link { + speed = <1000>; + full-duplex; + }; +}; + +&adm_dma { + status = "okay"; +}; diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200.dts index bd50d2d0fc..d26aee910b 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200.dts @@ -1,25 +1,16 @@ //SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include "qcom-ipq8064-v2.0.dtsi" -#include +#include "qcom-ipq8064-ad7200-c2600.dtsi" / { model = "TP-Link Talon AD7200"; compatible = "tplink,ad7200", "qcom,ipq8064"; - memory@0 { - reg = <0x42000000 0x1e000000>; - device_type = "memory"; - }; - aliases { - mdio-gpio0 = &mdio0; - led-boot = &led_status; led-failsafe = &led_status; led-running = &led_status; led-upgrade = &led_status; - label-mac-device = &gmac2; }; keys { @@ -128,311 +119,9 @@ bias-pull-up; }; }; - - spi_pins: spi_pins { - mux { - pins = "gpio18", "gpio19", "gpio21"; - function = "gsbi5"; - bias-pull-down; - }; - - data { - pins = "gpio18", "gpio19"; - drive-strength = <10>; - }; - - cs { - pins = "gpio20"; - function = "gpio"; - drive-strength = <10>; - bias-pull-up; - }; - - clk { - pins = "gpio21"; - drive-strength = <12>; - }; - }; - - usb0_pwr_en_pin: usb0_pwr_en_pin { - mux { - pins = "gpio25"; - function = "gpio"; - drive-strength = <10>; - bias-pull-up; - output-high; - }; - }; - - usb1_pwr_en_pin: usb1_pwr_en_pin { - mux { - pins = "gpio23"; - function = "gpio"; - drive-strength = <10>; - bias-pull-up; - output-high; - }; - }; -}; - -&gsbi5 { - qcom,mode = ; - status = "okay"; - - spi@1a280000 { - status = "okay"; - - pinctrl-0 = <&spi_pins>; - pinctrl-names = "default"; - - cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>; - - flash@0 { - compatible = "jedec,spi-nor"; - #address-cells = <1>; - #size-cells = <1>; - spi-max-frequency = <50000000>; - reg = <0>; - - partition@0 { - label = "SBL1"; - reg = <0x0 0x20000>; - read-only; - }; - - partition@20000 { - label = "MIBIB"; - reg = <0x20000 0x20000>; - read-only; - }; - - partition@40000 { - label = "SBL2"; - reg = <0x40000 0x20000>; - read-only; - }; - - partition@60000 { - label = "SBL3"; - reg = <0x60000 0x30000>; - read-only; - }; - - partition@90000 { - label = "DDRCONFIG"; - reg = <0x90000 0x10000>; - read-only; - }; - - partition@a0000 { - label = "SSD"; - reg = <0xa0000 0x10000>; - read-only; - }; - - partition@b0000 { - label = "TZ"; - reg = <0xb0000 0x30000>; - read-only; - }; - - partition@e0000 { - label = "RPM"; - reg = <0xe0000 0x20000>; - read-only; - }; - - partition@100000 { - label = "fs-uboot"; - reg = <0x100000 0x70000>; - read-only; - }; - - partition@170000 { - label = "uboot-env"; - reg = <0x170000 0x40000>; - read-only; - }; - - partition@1b0000 { - label = "radio"; - reg = <0x1b0000 0x40000>; - read-only; - }; - - partition@1f0000 { - label = "os-image"; - reg = <0x1f0000 0x400000>; - }; - - partition@5f0000 { - label = "rootfs"; - reg = <0x5f0000 0x1900000>; - }; - - defaultmac: partition@1ef0000 { - label = "default-mac"; - reg = <0x1ef0000 0x00200>; - read-only; - }; - - partition@1ef0200 { - label = "pin"; - reg = <0x1ef0200 0x00200>; - read-only; - }; - - partition@1ef0400 { - label = "device-id"; - reg = <0x1ef0400 0x00200>; - read-only; - }; - - partition@1ef0600 { - label = "product-info"; - reg = <0x1ef0600 0x0fa00>; - read-only; - }; - - partition@1f00000 { - label = "partition-table"; - reg = <0x1f00000 0x10000>; - read-only; - }; - - partition@1f10000 { - label = "soft-version"; - reg = <0x1f10000 0x10000>; - read-only; - }; - - partition@1f20000 { - label = "support-list"; - reg = <0x1f20000 0x10000>; - read-only; - }; - - partition@1f30000 { - label = "profile"; - reg = <0x1f30000 0x10000>; - read-only; - }; - - partition@1f40000 { - label = "default-config"; - reg = <0x1f40000 0x10000>; - read-only; - }; - - partition@1f50000 { - label = "user-config"; - reg = <0x1f50000 0x40000>; - read-only; - }; - - partition@1f90000 { - label = "qos-db"; - reg = <0x1f90000 0x40000>; - read-only; - }; - - partition@1fd0000 { - label = "usb-config"; - reg = <0x1fd0000 0x10000>; - read-only; - }; - - partition@1fe0000 { - label = "log"; - reg = <0x1fe0000 0x20000>; - read-only; - }; - }; - }; -}; - -&usb3_0 { - status = "okay"; - - pinctrl-0 = <&usb0_pwr_en_pin>; - pinctrl-names = "default"; -}; - -&usb3_1 { - status = "okay"; - - pinctrl-0 = <&usb1_pwr_en_pin>; - pinctrl-names = "default"; -}; - -&pcie0 { - status = "okay"; -}; - -&pcie1 { - status = "okay"; - max-link-speed = <1>; }; &pcie2 { status = "okay"; max-link-speed = <1>; }; - -&mdio0 { - status = "okay"; - - pinctrl-0 = <&mdio0_pins>; - pinctrl-names = "default"; - - phy0: ethernet-phy@0 { - reg = <0>; - qca,ar8327-initvals = < - 0x00004 0x7600000 /* PAD0_MODE */ - 0x00008 0x1000000 /* PAD5_MODE */ - 0x0000c 0x80 /* PAD6_MODE */ - 0x000e4 0x6a545 /* MAC_POWER_SEL */ - 0x000e0 0xc74164de /* SGMII_CTRL */ - 0x0007c 0x4e /* PORT0_STATUS */ - 0x00094 0x4e /* PORT6_STATUS */ - >; - }; - - phy4: ethernet-phy@4 { - reg = <4>; - }; -}; - -&gmac1 { - status = "okay"; - phy-mode = "rgmii"; - qcom,id = <1>; - - pinctrl-0 = <&rgmii2_pins>; - pinctrl-names = "default"; - - mtd-mac-address = <&defaultmac 0x8>; - mtd-mac-address-increment = <1>; - - fixed-link { - speed = <1000>; - full-duplex; - }; -}; - -&gmac2 { - status = "okay"; - phy-mode = "sgmii"; - qcom,id = <2>; - - mtd-mac-address = <&defaultmac 0x8>; - - fixed-link { - speed = <1000>; - full-duplex; - }; -}; - -&adm_dma { - status = "okay"; -}; diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-c2600.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-c2600.dts index 4ae7de604b..3f2a90fdee 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-c2600.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-c2600.dts @@ -1,24 +1,14 @@ -#include "qcom-ipq8064-v2.0.dtsi" - -#include +#include "qcom-ipq8064-ad7200-c2600.dtsi" / { model = "TP-Link Archer C2600"; compatible = "tplink,c2600", "qcom,ipq8064"; - memory@0 { - reg = <0x42000000 0x1e000000>; - device_type = "memory"; - }; - aliases { - mdio-gpio0 = &mdio0; - led-boot = &power; led-failsafe = &general; led-running = &power; led-upgrade = &general; - label-mac-device = &gmac2; }; keys { @@ -118,300 +108,4 @@ bias-pull-up; }; }; - - spi_pins: spi_pins { - mux { - pins = "gpio18", "gpio19", "gpio21"; - function = "gsbi5"; - bias-pull-down; - }; - - data { - pins = "gpio18", "gpio19"; - drive-strength = <10>; - }; - - cs { - pins = "gpio20"; - function = "gpio"; - drive-strength = <10>; - bias-pull-up; - }; - - clk { - pins = "gpio21"; - drive-strength = <12>; - }; - }; - - usb0_pwr_en_pin: usb0_pwr_en_pin { - mux { - pins = "gpio25"; - function = "gpio"; - drive-strength = <10>; - bias-pull-up; - output-high; - }; - }; - - usb1_pwr_en_pin: usb1_pwr_en_pin { - mux { - pins = "gpio23"; - function = "gpio"; - drive-strength = <10>; - bias-pull-up; - output-high; - }; - }; -}; - -&gsbi5 { - qcom,mode = ; - status = "okay"; - - spi5: spi@1a280000 { - status = "okay"; - - pinctrl-0 = <&spi_pins>; - pinctrl-names = "default"; - - cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>; - - m25p80@0 { - compatible = "jedec,spi-nor"; - #address-cells = <1>; - #size-cells = <1>; - spi-max-frequency = <50000000>; - reg = <0>; - - SBL1@0 { - label = "SBL1"; - reg = <0x0 0x20000>; - read-only; - }; - - MIBIB@20000 { - label = "MIBIB"; - reg = <0x20000 0x20000>; - read-only; - }; - - SBL2@40000 { - label = "SBL2"; - reg = <0x40000 0x20000>; - read-only; - }; - - SBL3@60000 { - label = "SBL3"; - reg = <0x60000 0x30000>; - read-only; - }; - - DDRCONFIG@90000 { - label = "DDRCONFIG"; - reg = <0x90000 0x10000>; - read-only; - }; - - SSD@a0000 { - label = "SSD"; - reg = <0xa0000 0x10000>; - read-only; - }; - - TZ@b0000 { - label = "TZ"; - reg = <0xb0000 0x30000>; - read-only; - }; - - RPM@e0000 { - label = "RPM"; - reg = <0xe0000 0x20000>; - read-only; - }; - - fs-uboot@100000 { - label = "fs-uboot"; - reg = <0x100000 0x70000>; - read-only; - }; - - uboot-env@170000 { - label = "uboot-env"; - reg = <0x170000 0x40000>; - read-only; - }; - - radio@1b0000 { - label = "radio"; - reg = <0x1b0000 0x40000>; - read-only; - }; - - os-image@1f0000 { - label = "os-image"; - reg = <0x1f0000 0x400000>; - }; - - rootfs@5f0000 { - label = "rootfs"; - reg = <0x5f0000 0x1900000>; - }; - - defaultmac: default-mac@1ef0000 { - label = "default-mac"; - reg = <0x1ef0000 0x00200>; - read-only; - }; - - pin@1ef0200 { - label = "pin"; - reg = <0x1ef0200 0x00200>; - read-only; - }; - - product-info@1ef0400 { - label = "product-info"; - reg = <0x1ef0400 0x0fc00>; - read-only; - }; - - partition-table@1f00000 { - label = "partition-table"; - reg = <0x1f00000 0x10000>; - read-only; - }; - - soft-version@1f10000 { - label = "soft-version"; - reg = <0x1f10000 0x10000>; - read-only; - }; - - support-list@1f20000 { - label = "support-list"; - reg = <0x1f20000 0x10000>; - read-only; - }; - - profile@1f30000 { - label = "profile"; - reg = <0x1f30000 0x10000>; - read-only; - }; - - default-config@1f40000 { - label = "default-config"; - reg = <0x1f40000 0x10000>; - read-only; - }; - - user-config@1f50000 { - label = "user-config"; - reg = <0x1f50000 0x40000>; - read-only; - }; - - qos-db@1f90000 { - label = "qos-db"; - reg = <0x1f90000 0x40000>; - read-only; - }; - - usb-config@1fd0000 { - label = "usb-config"; - reg = <0x1fd0000 0x10000>; - read-only; - }; - - log@1fe0000 { - label = "log"; - reg = <0x1fe0000 0x20000>; - read-only; - }; - }; - }; -}; - -&usb3_0 { - status = "okay"; - - pinctrl-0 = <&usb0_pwr_en_pin>; - pinctrl-names = "default"; -}; - -&usb3_1 { - status = "okay"; - - pinctrl-0 = <&usb1_pwr_en_pin>; - pinctrl-names = "default"; -}; - -&pcie0 { - status = "okay"; -}; - -&pcie1 { - status = "okay"; - max-link-speed = <1>; -}; - -&mdio0 { - status = "okay"; - - pinctrl-0 = <&mdio0_pins>; - pinctrl-names = "default"; - - phy0: ethernet-phy@0 { - reg = <0>; - qca,ar8327-initvals = < - 0x00004 0x7600000 /* PAD0_MODE */ - 0x00008 0x1000000 /* PAD5_MODE */ - 0x0000c 0x80 /* PAD6_MODE */ - 0x000e4 0x6a545 /* MAC_POWER_SEL */ - 0x000e0 0xc74164de /* SGMII_CTRL */ - 0x0007c 0x4e /* PORT0_STATUS */ - 0x00094 0x4e /* PORT6_STATUS */ - >; - }; - - phy4: ethernet-phy@4 { - reg = <4>; - }; -}; - -&gmac1 { - status = "okay"; - phy-mode = "rgmii"; - qcom,id = <1>; - - pinctrl-0 = <&rgmii2_pins>; - pinctrl-names = "default"; - - mtd-mac-address = <&defaultmac 0x8>; - mtd-mac-address-increment = <1>; - - fixed-link { - speed = <1000>; - full-duplex; - }; -}; - -&gmac2 { - status = "okay"; - phy-mode = "sgmii"; - qcom,id = <2>; - - mtd-mac-address = <&defaultmac 0x8>; - - fixed-link { - speed = <1000>; - full-duplex; - }; -}; - -&adm_dma { - status = "okay"; }; From b039f76f35e0fbedc6d687efcc1ce62edbd2939b Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Wed, 6 Jan 2021 14:00:58 +0100 Subject: [PATCH 12/18] ipq806x: improve model name and revision for TP-Link AD7200 The TP-Link AD7200 appears with and without the "Talon" model name prefix. Let's use both variants for 'make menuconfig' so everybody can locate the device. Concerning the revision, the TP-Link page lists v1 and v2 with the device currently marked as "End of Life". However, the v2 and latest v1 firmware are byte-identical. Thus, we only need one image for this device and do not need to include the revision in the image name. While at it, remove the useless BOARD_NAME variable which only makes sense in combination with upgrade from legacy stable versions or when custom upgrade scripts are involved. Signed-off-by: Adrian Schmutzler --- target/linux/ipq806x/image/Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/target/linux/ipq806x/image/Makefile b/target/linux/ipq806x/image/Makefile index b006757478..b77c0a99c0 100644 --- a/target/linux/ipq806x/image/Makefile +++ b/target/linux/ipq806x/image/Makefile @@ -336,12 +336,14 @@ TARGET_DEVICES += qcom_ipq8064-db149 define Device/tplink_ad7200 $(call Device/TpSafeImage) DEVICE_VENDOR := TP-Link - DEVICE_MODEL := Talon AD7200 - DEVICE_VARIANT := v1 + DEVICE_MODEL := AD7200 + DEVICE_VARIANT := v1/v2 + DEVICE_ALT0_VENDOR := TP-Link + DEVICE_ALT0_MODEL := Talon AD7200 + DEVICE_ALT0_VARIANT := v1/v2 SOC := qcom-ipq8064 BLOCKSIZE := 128k PAGESIZE := 2048 - BOARD_NAME := ad7200 TPLINK_BOARD_ID := AD7200 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct kmod-wil6210 endef From 849d4b394000234687a41fe2d6e5b9d71131c84a Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Wed, 6 Jan 2021 23:53:25 +0100 Subject: [PATCH 13/18] ipq806x: add space before SPDX identifier (again) Strictly, an SPDX identifier requires a space between the comment marker and the identifier itself. This has been addressed in b69c21738e29 ("treewide: add space before SPDX identifier"), but some new malformatted identifiers were merged recently. This could have been prevented by using checkpatch.pl earlier. Fixes: 1a775a4fd033 ("ipq806x: add support for TP-Link Talon AD7200") Fixes: 8ddaeaf6424e ("ipq806x: create DTSI for TP-Link AD7200 and C2600") Signed-off-by: Adrian Schmutzler --- .../files/arch/arm/boot/dts/qcom-ipq8064-ad7200-c2600.dtsi | 2 +- .../ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200.dts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200-c2600.dtsi b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200-c2600.dtsi index a893225b1a..af0efb2565 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200-c2600.dtsi +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200-c2600.dtsi @@ -1,4 +1,4 @@ -//SPDX-License-Identifier: GPL-2.0-or-later OR MIT +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT #include "qcom-ipq8064-v2.0.dtsi" diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200.dts index d26aee910b..9ccf3d74ac 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200.dts @@ -1,4 +1,4 @@ -//SPDX-License-Identifier: GPL-2.0-or-later OR MIT +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT #include "qcom-ipq8064-ad7200-c2600.dtsi" From a323a653f0338474ce9f2044574d2adc67d527d7 Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Sun, 27 Dec 2020 11:26:37 -1000 Subject: [PATCH 14/18] scripts/feed: no warn on toolchain/linux overwrite The recent 7f285d "scripts/feeds: warn when skipping core package override" floods SDK output with warning of overwriting "linux" and "toolchain" core packages. This should be ignored as these are not regular packages added via feeds. While at it slightly improve the warning string. Signed-off-by: Paul Spooren --- scripts/feeds | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/feeds b/scripts/feeds index 122f8568cb..eee0a50717 100755 --- a/scripts/feeds +++ b/scripts/feeds @@ -537,7 +537,9 @@ sub install_src { my $override = 0; if (is_core_src($name)) { if (!$force) { - warn "Not overriding core package $name; use -f to force\n"; + if ($name ne "toolchain" && $name ne "linux") { + warn "WARNING: Not overriding core package '$name'; use -f to force\n"; + } return 0; } $override = 1; From 6e4ce14047c66ceea19f3b40b992119b25fda054 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 6 Jan 2021 23:26:15 +0100 Subject: [PATCH 15/18] iwinfo: improve ABI version handling and bump to git HEAD - Encode ABI version in compiled shared object file - Only ship versioned shared library a17f561 iwinfo: detect QCA IPQ4019 WiSoC from FDT ea28dfb iwinfo: export ht and vht operation in scan results 4e22953 iwinfo: export center_chan info for local wifi 74d13fb cli: account for additional digit for frequencies above 10GHz 8bfd8d8 iwinfo: add support for GCMP cipher 618c1e8 iwinfo: add hardware description for QCA MIPS WiSoCs 0702f32 iwinfo: improve center channel handling 51c1336 iwinfo: set center chan unsupported for not-nl80211 driver 23d2722 build: add ability to specify shared object version Signed-off-by: Jo-Philipp Wich Signed-off-by: Daniel Golle --- package/network/utils/iwinfo/Makefile | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/package/network/utils/iwinfo/Makefile b/package/network/utils/iwinfo/Makefile index fd2d836bdb..cb54fa3912 100644 --- a/package/network/utils/iwinfo/Makefile +++ b/package/network/utils/iwinfo/Makefile @@ -11,9 +11,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/iwinfo.git -PKG_SOURCE_DATE:=2020-06-03 -PKG_SOURCE_VERSION:=2faa20e5e9d107b97e393a4eb458370e80b4d720 -PKG_MIRROR_HASH:=c5094a1751cbc610a91d21b7ddbec85c4f80d51dddb249fdcabb327ab1e2523f +PKG_SOURCE_DATE:=2021-01-06 +PKG_SOURCE_VERSION:=23d2722b1251f1aba9355bba23e17596f93adb65 +PKG_MIRROR_HASH:=9e6fe4a206860c7ca73a70841bce2791b697197098efe86726ad4d5d1c3ce468 PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=GPL-2.0 @@ -25,6 +25,8 @@ PKG_CONFIG_DEPENDS := \ CONFIG_PACKAGE_kmod-brcm-wl-mimo \ CONFIG_PACKAGE_kmod-cfg80211 +IWINFO_ABI_VERSION:=20210106 + include $(INCLUDE_DIR)/package.mk @@ -33,7 +35,7 @@ define Package/libiwinfo CATEGORY:=Libraries TITLE:=Generalized Wireless Information Library (iwinfo) DEPENDS:=+PACKAGE_kmod-cfg80211:libnl-tiny +libuci +libubus - ABI_VERSION:=20200105 + ABI_VERSION:=$(IWINFO_ABI_VERSION) endef define Package/libiwinfo/description @@ -86,21 +88,22 @@ MAKE_FLAGS += \ FPIC="$(FPIC)" \ CFLAGS="$(TARGET_CFLAGS)" \ LDFLAGS="$(TARGET_LDFLAGS)" \ - BACKENDS="$(IWINFO_BACKENDS)" + BACKENDS="$(IWINFO_BACKENDS)" \ + SOVERSION="$(IWINFO_ABI_VERSION)" define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include/iwinfo $(CP) $(PKG_BUILD_DIR)/include/iwinfo.h $(1)/usr/include/ $(CP) $(PKG_BUILD_DIR)/include/iwinfo/* $(1)/usr/include/iwinfo/ $(INSTALL_DIR) $(1)/usr/lib - $(INSTALL_BIN) $(PKG_BUILD_DIR)/libiwinfo.so $(1)/usr/lib/libiwinfo.so + $(CP) $(PKG_BUILD_DIR)/libiwinfo.so* $(1)/usr/lib/ $(INSTALL_DIR) $(1)/usr/lib/lua $(INSTALL_BIN) $(PKG_BUILD_DIR)/iwinfo.so $(1)/usr/lib/lua/iwinfo.so endef define Package/libiwinfo/install $(INSTALL_DIR) $(1)/usr/lib - $(INSTALL_BIN) $(PKG_BUILD_DIR)/libiwinfo.so $(1)/usr/lib/libiwinfo.so + $(INSTALL_BIN) $(PKG_BUILD_DIR)/libiwinfo.so.$(IWINFO_ABI_VERSION) $(1)/usr/lib/libiwinfo.so.$(IWINFO_ABI_VERSION) $(INSTALL_DIR) $(1)/usr/share/libiwinfo $(INSTALL_DATA) $(PKG_BUILD_DIR)/hardware.txt $(1)/usr/share/libiwinfo/hardware.txt endef From e02a41f67db52726d3c2c9e4e50e51a5510e0a27 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Tue, 5 Jan 2021 20:02:52 +0000 Subject: [PATCH 16/18] rpcd: update to git HEAD fd017ba iwinfo: add ht and vht operation info to wifi scan 4c66b31 iwinfo: export center channel for info ubus call e28d4a5 iwinfo: add support for 802.11ad and GCMP 5c15f57 iwinfo: return hwmode 'ad' on 802.11ad-only hardware ea7f471 iwinfo: include ht_operation data only if available Signed-off-by: Daniel Golle --- package/system/rpcd/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/system/rpcd/Makefile b/package/system/rpcd/Makefile index b8a974086f..1493be117b 100644 --- a/package/system/rpcd/Makefile +++ b/package/system/rpcd/Makefile @@ -8,14 +8,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=rpcd -PKG_RELEASE:=3 +PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/rpcd.git -PKG_SOURCE_DATE:=2020-09-18 -PKG_SOURCE_VERSION:=3fea6559817a22de1b8375b9b1f3d818e6534591 +PKG_SOURCE_DATE:=2021-01-06 +PKG_SOURCE_VERSION:=ea7f4717f8b210a8fa491d288ff99ef74409dbff PKG_MAINTAINER:=Jo-Philipp Wich -PKG_MIRROR_HASH:=d9284a23017c4393f210afb5bdc7f6d9e0b3ef46cc6e2cc2b2bcaa0199c942af +PKG_MIRROR_HASH:=905deb3db4b222188d1c126f05428126d389b88d61d2dc1e22e81a617724c7a8 PKG_LICENSE:=ISC PKG_LICENSE_FILES:= From cd5f66652bd405872fc33ca6410dc8f9b51fee09 Mon Sep 17 00:00:00 2001 From: Sven Wegener Date: Fri, 1 Jan 2021 11:46:04 +0100 Subject: [PATCH 17/18] build: use ccache -C for cleaning the cache This keeps the configuration, like the size of the cache, and the statistics intact. Move the removal of the cache directory to the distclean target, but only delete the .ccache directory inside of our build tree, as we should not mess with a user-configured external ccache directory this destructively. Signed-off-by: Sven Wegener --- Makefile | 2 +- include/toplevel.mk | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index f1577ad4d1..0144b0c5ff 100644 --- a/Makefile +++ b/Makefile @@ -64,7 +64,7 @@ dirclean: clean cacheclean: ifneq ($(CONFIG_CCACHE),) - rm -rf $(CCACHE_DIR) + $(STAGING_DIR_HOST)/bin/ccache -C endif ifndef DUMP_TARGET_DB diff --git a/include/toplevel.mk b/include/toplevel.mk index d3500ef58f..23bae149d4 100644 --- a/include/toplevel.mk +++ b/include/toplevel.mk @@ -261,8 +261,8 @@ package/symlinks-clean: help: cat README.md -distclean: cacheclean - rm -rf bin build_dir .config* dl feeds key-build* logs package/feeds package/openwrt-packages staging_dir tmp +distclean: + rm -rf bin build_dir .ccache .config* dl feeds key-build* logs package/feeds package/openwrt-packages staging_dir tmp @$(_SINGLE)$(SUBMAKE) -C scripts/config clean ifeq ($(findstring v,$(DEBUG)),) From 980dca6b7f657846a74b2e069ee120014a4c4137 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 2 Jan 2021 15:56:25 -0800 Subject: [PATCH 18/18] lua: add -ldl for glibc builds For glibc, lua needs an explicit link to libdl as glibc has it separate Fixes the following error in at least collectd: ld: usr/lib/liblua.so: undefined reference to `dlopen' ld: usr/lib/liblua.so: undefined reference to `dlclose' ld: usr/lib/liblua.so: undefined reference to `dlerror' ld: usr/lib/liblua.so: undefined reference to `dlsym' Signed-off-by: Rosen Penev --- package/utils/lua/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/utils/lua/Makefile b/package/utils/lua/Makefile index 3cdb2bcdb6..a54ef7d25a 100644 --- a/package/utils/lua/Makefile +++ b/package/utils/lua/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=lua PKG_VERSION:=5.1.5 -PKG_RELEASE:=7 +PKG_RELEASE:=8 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://www.lua.org/ftp/ \ @@ -99,7 +99,7 @@ define Build/Compile RANLIB="$(TARGET_CROSS)ranlib" \ INSTALL_ROOT=/usr \ CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \ - MYLDFLAGS="$(TARGET_LDFLAGS) $(if $(CONFIG_USE_GLIBC),-lm)" \ + MYLDFLAGS="$(TARGET_LDFLAGS) $(if $(CONFIG_USE_GLIBC),-lm -ldl)" \ PKG_VERSION=$(PKG_VERSION) \ linux rm -rf $(PKG_INSTALL_DIR)