From 342524895c1636734f79f4901ac8a4c3f5f9849a Mon Sep 17 00:00:00 2001 From: Sieng Piaw Liew Date: Fri, 13 Nov 2020 02:20:30 +0800 Subject: [PATCH 01/65] bcm63xx: add BQL support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add Byte Queue Limits support to reduce/remove bufferbloat in bcm63xx target. Signed-off-by: Sieng Piaw Liew [Amend commit description] Signed-off-by: Álvaro Fernández Rojas --- .../442-bcm63xx_enet-add_bql_support.patch | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 target/linux/bcm63xx/patches-5.4/442-bcm63xx_enet-add_bql_support.patch diff --git a/target/linux/bcm63xx/patches-5.4/442-bcm63xx_enet-add_bql_support.patch b/target/linux/bcm63xx/patches-5.4/442-bcm63xx_enet-add_bql_support.patch new file mode 100644 index 0000000000..7955b7134f --- /dev/null +++ b/target/linux/bcm63xx/patches-5.4/442-bcm63xx_enet-add_bql_support.patch @@ -0,0 +1,67 @@ +From 3c0e8e1259d223a1493c47f7e277d05b93909b6b Mon Sep 17 00:00:00 2001 +From: Sieng Piaw Liew +Date: Mon, 2 Nov 2020 11:34:06 +0800 +Subject: [PATCH 1/2] bcm63xx: add BQL support + +Add Byte Queue Limits support to reduce/remove bufferbloat in bcm63xx target. + +Signed-off-by: Sieng Piaw Liew +--- + bcm63xx_enet.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c ++++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c +@@ -423,9 +423,11 @@ static int bcm_enet_tx_reclaim(struct ne + { + struct bcm_enet_priv *priv; + int released; ++ unsigned int bytes; + + priv = netdev_priv(dev); + released = 0; ++ bytes = 0; + + while (priv->tx_desc_count < priv->tx_ring_size) { + struct bcm_enet_desc *desc; +@@ -461,10 +463,13 @@ static int bcm_enet_tx_reclaim(struct ne + if (desc->len_stat & DMADESC_UNDER_MASK) + dev->stats.tx_errors++; + ++ bytes += skb->len; + dev_kfree_skb(skb); + released++; + } + ++ netdev_completed_queue(dev, released, bytes); ++ + if (netif_queue_stopped(dev) && released) + netif_wake_queue(dev); + +@@ -631,6 +636,8 @@ bcm_enet_start_xmit(struct sk_buff *skb, + desc->len_stat = len_stat; + wmb(); + ++ netdev_sent_queue(dev, skb->len); ++ + /* kick tx dma */ + enet_dmac_writel(priv, priv->dma_chan_en_mask, + ENETDMAC_CHANCFG, priv->tx_chan); +@@ -1051,6 +1058,8 @@ static int bcm_enet_open(struct net_devi + else + bcm_enet_adjust_link(dev); + ++ netdev_reset_queue(dev); ++ + netif_start_queue(dev); + return 0; + +@@ -2281,6 +2290,8 @@ static int bcm_enetsw_open(struct net_de + enet_dmac_writel(priv, ENETDMAC_IR_PKTDONE_MASK, + ENETDMAC_IRMASK, priv->tx_chan); + ++ netdev_reset_queue(dev); ++ + netif_carrier_on(dev); + netif_start_queue(dev); + From 36334b2d4b41527e9d0c682441a77aba6449228d Mon Sep 17 00:00:00 2001 From: Sieng Piaw Liew Date: Fri, 13 Nov 2020 02:21:07 +0800 Subject: [PATCH 02/65] bcm63xx: support xmit_more in BQL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Support bulking hardware TX queue by using xmit_more. Signed-off-by: Sieng Piaw Liew [Amend commit description, fix kernel xmit_more exceptions] Signed-off-by: Álvaro Fernández Rojas --- ...cm63xx_enet-support_xmit_more_in_bql.patch | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 target/linux/bcm63xx/patches-5.4/443-bcm63xx_enet-support_xmit_more_in_bql.patch diff --git a/target/linux/bcm63xx/patches-5.4/443-bcm63xx_enet-support_xmit_more_in_bql.patch b/target/linux/bcm63xx/patches-5.4/443-bcm63xx_enet-support_xmit_more_in_bql.patch new file mode 100644 index 0000000000..122cbf1138 --- /dev/null +++ b/target/linux/bcm63xx/patches-5.4/443-bcm63xx_enet-support_xmit_more_in_bql.patch @@ -0,0 +1,54 @@ +From 79bfb73319098bc4cb701139a6677dcdec99182f Mon Sep 17 00:00:00 2001 +From: Sieng Piaw Liew +Date: Tue, 3 Nov 2020 08:14:35 +0800 +Subject: [PATCH 2/2] bcm63xx: support xmit_more in BQL + +Support bulking hardware TX queue by using xmit_more. + +Signed-off-by: Sieng Piaw Liew +--- + bcm63xx_enet.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c ++++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c +@@ -638,14 +638,16 @@ bcm_enet_start_xmit(struct sk_buff *skb, + + netdev_sent_queue(dev, skb->len); + +- /* kick tx dma */ +- enet_dmac_writel(priv, priv->dma_chan_en_mask, +- ENETDMAC_CHANCFG, priv->tx_chan); +- + /* stop queue if no more desc available */ + if (!priv->tx_desc_count) + netif_stop_queue(dev); + ++ /* kick tx dma */ ++ if(!netdev_xmit_more() || !priv->tx_desc_count) ++ enet_dmac_writel(priv, priv->dma_chan_en_mask, ++ ENETDMAC_CHANCFG, priv->tx_chan); ++ ++ + dev->stats.tx_bytes += skb->len; + dev->stats.tx_packets++; + ret = NETDEV_TX_OK; +@@ -2713,7 +2715,7 @@ static int bcm_enetsw_probe(struct platf + priv->irq_rx = irq_rx; + priv->irq_tx = irq_tx; + priv->rx_ring_size = BCMENET_DEF_RX_DESC; +- priv->tx_ring_size = BCMENET_DEF_TX_DESC; ++ priv->tx_ring_size = BCMENETSW_DEF_TX_DESC; + priv->dma_maxburst = BCMENETSW_DMA_MAXBURST; + + pd = dev_get_platdata(&pdev->dev); +--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.h ++++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.h +@@ -15,6 +15,7 @@ + /* default number of descriptor */ + #define BCMENET_DEF_RX_DESC 64 + #define BCMENET_DEF_TX_DESC 32 ++#define BCMENETSW_DEF_TX_DESC 48 + + /* maximum burst len for dma (4 bytes unit) */ + #define BCMENET_DMA_MAXBURST 16 From 0efbfef4f68a796c2214b5222a1f044d2bcc158b Mon Sep 17 00:00:00 2001 From: Daniele Castro Date: Sat, 5 Sep 2020 17:33:23 +0200 Subject: [PATCH 03/65] bcm63xx: A4001N A-000-1A1-AX: remove PSI (nvram) partition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ADB P.DG A4001N A-000-1A1-AX a.k.a. Telecom Italia ADSL2+ Wi-Fi N (AGPWI) is a Telecom Italia braded router and it seems that there are no public available unbranded versions of this router. The stock Telecom Italia braded firmware has many partitions and the partition layout changes with every firmware relase. The PSI nvram partition is present in the stock firmware under the "UNKNOWN" name but it's empty, full of FFs. Since removing partitions does not cause problems with the stock firmware reflashing procedure, I removed from the dts the PSI nvram partition from OpenWrt, expanded the rootfs one and added the NVRAM partition contained in the cfe bootloader. Furthermore this router's flash needs to be entirely reprogrammed and a new generic bcm6328 cfe must be flashed to boot OpenWrt. The same process takes place when reflashing the stock firmware. Here follows the original flash layout for AGPWI_1.1.0_013, the last stock Telecom Italia braded firmware for which we have root credentials (admin/riattizzati). Flash layout: Section 00 Type BOOT Range 0x00000000-0x00020000 MaxSize 0x00020000 No more information. Section 01 Type IMAGE Range 0x00020000-0x007C0000 MaxSize 0x0079FF6C Uninitialized. Section 02 Type IMAGE Range 0x00800000-0x00FA0000 MaxSize 0x0079FF6C Uninitialized. Section 03 Type CONF Range 0x00FA0000-0x00FC0000 MaxSize 0x0001FF6C Size 0x0000841E Name 'rg_conf' Checksum 0x0041E03B Counter 0x0000051F Start Offset 0x00000000 Section 04 Type CONF Range 0x00FC0000-0x00FE0000 MaxSize 0x0001FF6C Size 0x0000838E Name 'rg_conf' Checksum 0x00419A5A Counter 0x00000522 Start Offset 0x00000000 Section 05 Type FACTORY Range 0x00FE0000-0x00FF0000 MaxSize 0x0000FF6C Size 0x00000554 Name 'rg_factory' Checksum 0x0001255E Counter 0x000004D3 Start Offset 0x00000000 Section 06 Type UNKNOWN Range 0x00FF0000-0x01000000 MaxSize 0x00010000 No more information. Total 7 sections found. The last AGPWI firmware relase should be AGPWI_4.0.6 and it has much more partitions than AGPWI_1.1.0_013. The cfe partition in the stock firmware is 0x00020000 bytes long unlike the OpenWrt dts in wich it's 0x00010000 bytes long because from 0x00010000 to 0x00020000 in the stock cfe there are only 00s and also because the cfe must anyway be reflashed with a generic bcm6328 cfe 0x00010000 bytes long to run OpenWrt. Signed-off-by: Daniele Castro [Amend commit, remove unneeded cfe_nvram partition] Signed-off-by: Álvaro Fernández Rojas --- .../bcm63xx/dts/bcm6328-adb-pdg-a4001n-a-000-1a1-ax.dts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/target/linux/bcm63xx/dts/bcm6328-adb-pdg-a4001n-a-000-1a1-ax.dts b/target/linux/bcm63xx/dts/bcm6328-adb-pdg-a4001n-a-000-1a1-ax.dts index 7b8c03f890..f42b970c46 100644 --- a/target/linux/bcm63xx/dts/bcm6328-adb-pdg-a4001n-a-000-1a1-ax.dts +++ b/target/linux/bcm63xx/dts/bcm6328-adb-pdg-a4001n-a-000-1a1-ax.dts @@ -135,15 +135,10 @@ }; partition@10000 { - reg = <0x010000 0xfe0000>; + reg = <0x010000 0xff0000>; label = "linux"; compatible = "brcm,bcm963xx-imagetag"; }; - - partition@ff0000 { - reg = <0xff0000 0x010000>; - label = "nvram"; - }; }; }; }; From 8eeb57acb75f9d89abed59595de052dba9fed7b8 Mon Sep 17 00:00:00 2001 From: Ahmed Naseef Date: Tue, 18 Aug 2020 17:52:20 +0530 Subject: [PATCH 04/65] bcm63xx: Add support for D-Link DSL-2750u rev C1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This adds support for the D-Link DSL-2750u rev C1. (https://deviwiki.com/wiki/D-Link_DSL-2750U_rev_C1) It uses the same hardware as ADB P.DG A4001N. CPU: Broadcom BCM63281 (320 MHz) RAM: 32M (Winbond W9725G6JB) Flash: 8M (MXIC MX25L6445E) Ethernet: 4x 100 Mbps Wireless: 802.11b/g/n: BCM43225 USB: 1x 2.0 Flash instructions: 1. Assign static IP 192.168.1.100 to PC 2. Unplug the power source 3. Press the RESET button at the router, don't release it yet! 4. Plug the power source.Wait some seconds 5. Release the RESET button 6. Browse to http://192.168.1.1 7. Send the openwrt-bcm63xx-generic-DSL2750U-C1-squashfs-cfe.bin and wait some minutes until the firmware upgrade finish. Signed-off-by: Ahmed Naseef [DTS improvements, proper board patch, refresh patches] Signed-off-by: Álvaro Fernández Rojas --- .../bcm63xx/base-files/etc/board.d/01_leds | 1 + .../bcm63xx/base-files/etc/board.d/02_network | 1 + .../dts/bcm6328-d-link-dsl-2750u-c1.dts | 146 ++++++++++++++++++ target/linux/bcm63xx/image/bcm63xx.mk | 13 ++ .../patches-5.4/512-board_bcm6328.patch | 3 +- .../patches-5.4/513-board-bcm6338.patch | 2 +- .../patches-5.4/514-board_bcm6345.patch | 2 +- .../patches-5.4/515-board-bcm6348.patch | 2 +- .../patches-5.4/516-board-bcm6358.patch | 2 +- .../patches-5.4/517-board_bcm6362.patch | 2 +- .../patches-5.4/518-board_bcm6368.patch | 2 +- .../patches-5.4/519-board_bcm63268.patch | 2 +- ...31-board_bcm6348-bt-voyager-2500v-bb.patch | 2 +- 13 files changed, 171 insertions(+), 9 deletions(-) create mode 100644 target/linux/bcm63xx/dts/bcm6328-d-link-dsl-2750u-c1.dts diff --git a/target/linux/bcm63xx/base-files/etc/board.d/01_leds b/target/linux/bcm63xx/base-files/etc/board.d/01_leds index cfd4cf3c31..bdd6934023 100755 --- a/target/linux/bcm63xx/base-files/etc/board.d/01_leds +++ b/target/linux/bcm63xx/base-files/etc/board.d/01_leds @@ -16,6 +16,7 @@ actiontec,r1000h) adb,a4001n|\ comtrend,ar-5315u|\ comtrend,vr-3032u|\ +d-link,dsl-2750u-c1|\ huawei,hg253s-v2|\ nucom,r5010un-v2|\ sagem,fast-2704-v2) diff --git a/target/linux/bcm63xx/base-files/etc/board.d/02_network b/target/linux/bcm63xx/base-files/etc/board.d/02_network index f02eabe68f..711b8f8c00 100755 --- a/target/linux/bcm63xx/base-files/etc/board.d/02_network +++ b/target/linux/bcm63xx/base-files/etc/board.d/02_network @@ -31,6 +31,7 @@ comtrend,vr-3025u|\ comtrend,vr-3025un|\ comtrend,vr-3026e|\ d-link,dsl-274xb-f1|\ +d-link,dsl-2750u-c1|\ d-link,dsl-275xb-d1|\ huawei,echolife-hg622|\ huawei,echolife-hg655b|\ diff --git a/target/linux/bcm63xx/dts/bcm6328-d-link-dsl-2750u-c1.dts b/target/linux/bcm63xx/dts/bcm6328-d-link-dsl-2750u-c1.dts new file mode 100644 index 0000000000..0915215039 --- /dev/null +++ b/target/linux/bcm63xx/dts/bcm6328-d-link-dsl-2750u-c1.dts @@ -0,0 +1,146 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "bcm6328.dtsi" + +#include + +/ { + model = "D-Link DSL-2750U rev C1"; + compatible = "d-link,dsl-2750u-c1", "brcm,bcm6328"; + + aliases { + led-boot = &led_power_green; + led-failsafe = &led_power_green; + led-running = &led_power_green; + led-upgrade = &led_power_green; + }; + + chosen { + bootargs = "rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; + }; + + keys { + compatible = "gpio-keys-polled"; + poll-interval = <20>; + + wifi { + label = "wifi"; + gpios = <&pinctrl 12 1>; + linux,code = ; + debounce-interval = <60>; + }; + + reset { + label = "reset"; + gpios = <&pinctrl 23 1>; + linux,code = ; + debounce-interval = <60>; + }; + + wps { + label = "wps"; + gpios = <&pinctrl 24 1>; + linux,code = ; + debounce-interval = <60>; + }; + }; +}; + +&hsspi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + spi-max-frequency = <16666667>; + spi-tx-bus-width = <2>; + spi-rx-bus-width = <2>; + reg = <0>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + cfe@0 { + reg = <0x000000 0x010000>; + label = "cfe"; + read-only; + }; + + linux@10000 { + reg = <0x010000 0x7e0000>; + label = "linux"; + compatible = "brcm,bcm963xx-imagetag"; + }; + + nvram@7f0000 { + reg = <0x7f0000 0x010000>; + label = "nvram"; + }; + }; + }; +}; + +&leds { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_leds>; + + led@1 { + reg = <1>; + active-low; + label = "green:inet"; + }; + + led_power_green: led@4 { + reg = <4>; + active-low; + label = "green:power"; + default-state = "on"; + }; + + led@7 { + reg = <7>; + active-low; + label = "red:inet"; + }; + + led@8 { + reg = <8>; + active-low; + label = "red:power"; + }; + + led@9 { + reg = <9>; + active-low; + label = "green:wps"; + }; + + led@10 { + reg = <10>; + active-low; + label = "green:usb"; + }; + + led@11 { + reg = <11>; + active-low; + label = "green:dsl"; + }; +}; + +&pinctrl { + pinctrl_leds: leds { + function = "led"; + pins = "gpio1", "gpio4", "gpio7", + "gpio8", "gpio9", "gpio10", + "gpio11"; + }; +}; + +&uart0 { + status = "okay"; +}; diff --git a/target/linux/bcm63xx/image/bcm63xx.mk b/target/linux/bcm63xx/image/bcm63xx.mk index 15cc549ec4..d3356040d0 100644 --- a/target/linux/bcm63xx/image/bcm63xx.mk +++ b/target/linux/bcm63xx/image/bcm63xx.mk @@ -571,6 +571,19 @@ define Device/d-link_dsl-274xb-f1 endef TARGET_DEVICES += d-link_dsl-274xb-f1 +define Device/d-link_dsl-2750u-c1 + $(Device/bcm63xx) + DEVICE_VENDOR := D-Link + DEVICE_MODEL := DSL-2750U + DEVICE_VARIANT := C1 + IMAGES += sysupgrade.bin + CFE_BOARD_ID := 963281TAVNG + CHIP_ID := 6328 + FLASH_MB := 8 + DEVICE_PACKAGES := $(USB2_PACKAGES) $(B43_PACKAGES) +endef +TARGET_DEVICES += d-link_dsl-2750u-c1 + define Device/d-link_dsl-275xb-d1 $(Device/bcm63xx) DEVICE_VENDOR := D-Link diff --git a/target/linux/bcm63xx/patches-5.4/512-board_bcm6328.patch b/target/linux/bcm63xx/patches-5.4/512-board_bcm6328.patch index abab912092..5a2dbdcf85 100644 --- a/target/linux/bcm63xx/patches-5.4/512-board_bcm6328.patch +++ b/target/linux/bcm63xx/patches-5.4/512-board_bcm6328.patch @@ -500,7 +500,7 @@ #endif /* CONFIG_BCM63XX_CPU_6328 */ #ifdef CONFIG_BCM63XX_CPU_6338 &board_96338gw, -@@ -742,7 +1228,18 @@ static struct of_device_id const bcm963x +@@ -742,7 +1228,19 @@ static struct of_device_id const bcm963x { .compatible = "sagem,fast-2704n", .data = &board_FAST2704N, }, #endif /* CONFIG_BCM63XX_CPU_6318 */ #ifdef CONFIG_BCM63XX_CPU_6328 @@ -512,6 +512,7 @@ + { .compatible = "comtrend,ar-5381u", .data = &board_AR5381u, }, + { .compatible = "comtrend,ar-5387un", .data = &board_AR5387un, }, + { .compatible = "d-link,dsl-274xb-f1", .data = &board_dsl_274xb_f1, }, ++ { .compatible = "d-link,dsl-2750u-c1", .data = &board_A4001N, }, + { .compatible = "nucom,r5010un-v2", .data = &board_R5010UNV2, }, + { .compatible = "sagem,fast-2704-v2", .data = &board_FAST2704V2, }, + { .compatible = "sercomm,ad1018", .data = &board_AD1018, }, diff --git a/target/linux/bcm63xx/patches-5.4/513-board-bcm6338.patch b/target/linux/bcm63xx/patches-5.4/513-board-bcm6338.patch index 85c8e6c390..8ff2a69707 100644 --- a/target/linux/bcm63xx/patches-5.4/513-board-bcm6338.patch +++ b/target/linux/bcm63xx/patches-5.4/513-board-bcm6338.patch @@ -42,7 +42,7 @@ #endif /* CONFIG_BCM63XX_CPU_6338 */ #ifdef CONFIG_BCM63XX_CPU_6345 &board_96345gw2, -@@ -1244,6 +1272,8 @@ static struct of_device_id const bcm963x +@@ -1245,6 +1273,8 @@ static struct of_device_id const bcm963x #ifdef CONFIG_BCM63XX_CPU_6338 { .compatible = "brcm,bcm96338gw", .data = &board_96338gw, }, { .compatible = "brcm,bcm96338w", .data = &board_96338w, }, diff --git a/target/linux/bcm63xx/patches-5.4/514-board_bcm6345.patch b/target/linux/bcm63xx/patches-5.4/514-board_bcm6345.patch index d881555853..ca200024c2 100644 --- a/target/linux/bcm63xx/patches-5.4/514-board_bcm6345.patch +++ b/target/linux/bcm63xx/patches-5.4/514-board_bcm6345.patch @@ -28,7 +28,7 @@ #endif /* CONFIG_BCM63XX_CPU_6345 */ #ifdef CONFIG_BCM63XX_CPU_6348 &board_96348r, -@@ -1277,6 +1291,8 @@ static struct of_device_id const bcm963x +@@ -1278,6 +1292,8 @@ static struct of_device_id const bcm963x #endif /* CONFIG_BCM63XX_CPU_6338 */ #ifdef CONFIG_BCM63XX_CPU_6345 { .compatible = "brcm,bcm96345gw2", .data = &board_96345gw2, }, diff --git a/target/linux/bcm63xx/patches-5.4/515-board-bcm6348.patch b/target/linux/bcm63xx/patches-5.4/515-board-bcm6348.patch index 1e93c5e443..eab83113f7 100644 --- a/target/linux/bcm63xx/patches-5.4/515-board-bcm6348.patch +++ b/target/linux/bcm63xx/patches-5.4/515-board-bcm6348.patch @@ -296,7 +296,7 @@ #endif /* CONFIG_BCM63XX_CPU_6348 */ #ifdef CONFIG_BCM63XX_CPU_6358 &board_96358vw, -@@ -1295,15 +1577,29 @@ static struct of_device_id const bcm963x +@@ -1296,15 +1578,29 @@ static struct of_device_id const bcm963x { .compatible = "dynalink,rta770w", .data = &board_rta770w, }, #endif /* CONFIG_BCM63XX_CPU_6345 */ #ifdef CONFIG_BCM63XX_CPU_6348 diff --git a/target/linux/bcm63xx/patches-5.4/516-board-bcm6358.patch b/target/linux/bcm63xx/patches-5.4/516-board-bcm6358.patch index 18f813b9b8..4279b0bb13 100644 --- a/target/linux/bcm63xx/patches-5.4/516-board-bcm6358.patch +++ b/target/linux/bcm63xx/patches-5.4/516-board-bcm6358.patch @@ -357,7 +357,7 @@ #endif /* CONFIG_BCM63XX_CPU_6358 */ }; -@@ -1607,11 +1935,24 @@ static struct of_device_id const bcm963x +@@ -1608,11 +1936,24 @@ static struct of_device_id const bcm963x { .compatible = "alcatel,rg100a", .data = &board_96358vw2, }, { .compatible = "brcm,bcm96358vw", .data = &board_96358vw, }, { .compatible = "brcm,bcm96358vw2", .data = &board_96358vw2, }, diff --git a/target/linux/bcm63xx/patches-5.4/517-board_bcm6362.patch b/target/linux/bcm63xx/patches-5.4/517-board_bcm6362.patch index 8e87c0cc55..ac9d76a52f 100644 --- a/target/linux/bcm63xx/patches-5.4/517-board_bcm6362.patch +++ b/target/linux/bcm63xx/patches-5.4/517-board_bcm6362.patch @@ -131,7 +131,7 @@ }; static struct of_device_id const bcm963xx_boards_dt[] = { -@@ -1955,6 +2072,10 @@ static struct of_device_id const bcm963x +@@ -1956,6 +2073,10 @@ static struct of_device_id const bcm963x { .compatible = "telsey,cpva642", .data = &board_CPVA642, }, #endif /* CONFIG_BCM63XX_CPU_6358 */ #ifdef CONFIG_BCM63XX_CPU_6362 diff --git a/target/linux/bcm63xx/patches-5.4/518-board_bcm6368.patch b/target/linux/bcm63xx/patches-5.4/518-board_bcm6368.patch index e745bf0848..1ba6d5ecd8 100644 --- a/target/linux/bcm63xx/patches-5.4/518-board_bcm6368.patch +++ b/target/linux/bcm63xx/patches-5.4/518-board_bcm6368.patch @@ -681,7 +681,7 @@ }; static struct of_device_id const bcm963xx_boards_dt[] = { -@@ -2078,6 +2738,20 @@ static struct of_device_id const bcm963x +@@ -2079,6 +2739,20 @@ static struct of_device_id const bcm963x { .compatible = "sfr,neufbox-6-sercomm-r0", .data = &board_nb6, }, #endif /* CONFIG_BCM63XX_CPU_6362 */ #ifdef CONFIG_BCM63XX_CPU_6368 diff --git a/target/linux/bcm63xx/patches-5.4/519-board_bcm63268.patch b/target/linux/bcm63xx/patches-5.4/519-board_bcm63268.patch index 2718bbdd36..139f6ad085 100644 --- a/target/linux/bcm63xx/patches-5.4/519-board_bcm63268.patch +++ b/target/linux/bcm63xx/patches-5.4/519-board_bcm63268.patch @@ -290,7 +290,7 @@ }; static struct of_device_id const bcm963xx_boards_dt[] = { -@@ -2754,6 +3030,14 @@ static struct of_device_id const bcm963x +@@ -2755,6 +3031,14 @@ static struct of_device_id const bcm963x { .compatible = "zyxel,p870hw-51a-v2", .data = &board_P870HW51A_V2, }, #endif /* CONFIG_BCM63XX_CPU_6368 */ #ifdef CONFIG_BCM63XX_CPU_63268 diff --git a/target/linux/bcm63xx/patches-5.4/531-board_bcm6348-bt-voyager-2500v-bb.patch b/target/linux/bcm63xx/patches-5.4/531-board_bcm6348-bt-voyager-2500v-bb.patch index 750deb6da0..9264becf3e 100644 --- a/target/linux/bcm63xx/patches-5.4/531-board_bcm6348-bt-voyager-2500v-bb.patch +++ b/target/linux/bcm63xx/patches-5.4/531-board_bcm6348-bt-voyager-2500v-bb.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -3066,6 +3066,22 @@ void __init board_bcm963xx_init(void) +@@ -3067,6 +3067,22 @@ void __init board_bcm963xx_init(void) val &= MPI_CSBASE_BASE_MASK; } boot_addr = (u8 *)KSEG1ADDR(val); From 1d5ad1b85365a4376f8560bbadffc5fe7fb131a3 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 26 Nov 2020 17:29:11 +0100 Subject: [PATCH 05/65] kernel: remove an unused callback from the ip17xx switch driver Also remove the leftover kernel hack that adds support for it Signed-off-by: Felix Fietkau --- .../generic/files/drivers/net/phy/ip17xx.c | 7 ----- .../702-phy_add_aneg_done_function.patch | 27 ------------------- 2 files changed, 34 deletions(-) delete mode 100644 target/linux/generic/hack-5.4/702-phy_add_aneg_done_function.patch diff --git a/target/linux/generic/files/drivers/net/phy/ip17xx.c b/target/linux/generic/files/drivers/net/phy/ip17xx.c index 88bdc29cb7..c369803395 100644 --- a/target/linux/generic/files/drivers/net/phy/ip17xx.c +++ b/target/linux/generic/files/drivers/net/phy/ip17xx.c @@ -1337,12 +1337,6 @@ static int ip17xx_aneg_done(struct phy_device *pdev) return 1; /* Return any positive value */ } -static int ip17xx_update_link(struct phy_device *pdev) -{ - pdev->link = 1; - return 0; -} - static int ip17xx_read_status(struct phy_device *pdev) { pdev->speed = SPEED_100; @@ -1364,7 +1358,6 @@ static struct phy_driver ip17xx_driver[] = { .config_init = ip17xx_config_init, .config_aneg = ip17xx_config_aneg, .aneg_done = ip17xx_aneg_done, - .update_link = ip17xx_update_link, .read_status = ip17xx_read_status, } }; diff --git a/target/linux/generic/hack-5.4/702-phy_add_aneg_done_function.patch b/target/linux/generic/hack-5.4/702-phy_add_aneg_done_function.patch deleted file mode 100644 index 0e292f5b6f..0000000000 --- a/target/linux/generic/hack-5.4/702-phy_add_aneg_done_function.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- a/include/linux/phy.h -+++ b/include/linux/phy.h -@@ -524,6 +524,12 @@ struct phy_driver { - /* Determines the negotiated speed and duplex */ - int (*read_status)(struct phy_device *phydev); - -+ /* -+ * Update the value in phydev->link to reflect the -+ * current link value -+ */ -+ int (*update_link)(struct phy_device *phydev); -+ - /* Clears any pending interrupts */ - int (*ack_interrupt)(struct phy_device *phydev); - ---- a/drivers/net/phy/phy_device.c -+++ b/drivers/net/phy/phy_device.c -@@ -1912,6 +1912,9 @@ int genphy_update_link(struct phy_device - if (bmcr & BMCR_ANRESTART) - goto done; - -+ if (phydev->drv && phydev->drv->update_link) -+ return phydev->drv->update_link(phydev); -+ - /* The link state is latched low so that momentary link - * drops can be detected. Do not double-read the status - * in polling mode to detect such short link drops. From ef11309c22fae2fb27e8c32163b5ca274468e82e Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 26 Nov 2020 16:12:12 +0100 Subject: [PATCH 06/65] build: make testing kernel decompression more portable On non-GNU systems, zcat often does not handle gzip decompression. Use gzip -dc like the regular unpack command Signed-off-by: Felix Fietkau --- include/kernel-defaults.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk index db93a53d71..863c180e48 100644 --- a/include/kernel-defaults.mk +++ b/include/kernel-defaults.mk @@ -24,7 +24,7 @@ Kernel/Patch:=$(Kernel/Patch/Default) ifneq (,$(findstring .xz,$(LINUX_SOURCE))) LINUX_CAT:=xzcat else - LINUX_CAT:=zcat + LINUX_CAT:=gzip -dc endif ifeq ($(strip $(CONFIG_EXTERNAL_KERNEL_TREE)),"") From 13734075d256bd42a45a4db175187e06401bbb80 Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Sat, 5 Dec 2020 20:45:29 +0100 Subject: [PATCH 07/65] odhcp6c: update to git HEAD faed29a dhcpv6: only refresh timers when reconfigure is valid 9c50975 dhcpv6: fix printing identity association id a7b2221 dhcpv6: avoid sending continuous renew/rebind messages d7afa2b dhcpv6: add extra syslog info traces f5728e4 odhcp6c_find_entry: exclude priority from the list of fields that must match 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 15800b678b..1cf0950076 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-03-28 -PKG_SOURCE_VERSION:=f575351cbb3defc0bf52680c9082912a6c264374 -PKG_MIRROR_HASH:=3a0df503be81d25da44a83ae36d5fbeaabae1b7c99f6eb8ffe6f62311e254d06 +PKG_SOURCE_DATE:=2020-12-03 +PKG_SOURCE_VERSION:=faed29aa733cd3e7c0269d5dc2fc6a8e1d35f1ce +PKG_MIRROR_HASH:=7b47aeacfc381e81e570a00733aeafd229e45f576134d5b8548eeb01d56f1073 PKG_MAINTAINER:=Hans Dedecker PKG_LICENSE:=GPL-2.0 From 8c0a6aaa26a24a4d29dc7afddc513395327b5f7a Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Sat, 5 Dec 2020 20:52:27 +0100 Subject: [PATCH 08/65] glibc: update to latest 2.32 commit (BZ# 26224) 050022910b iconv: Accept redundant shift sequences in IBM1364 [BZ #26224] ac0a6929c5 sh: Add sh4 fpu Implies folder 3ea24955bf struct _Unwind_Exception alignment should not depend on compiler flags 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 fbaad9d3ac..faf749eea3 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:=5c36293f067d2af16e4eb9f9465be36f346ea6d0 -PKG_MIRROR_HASH:=f01b467843af97fe29dd67d0dc52e8f2effc968258ae806af37be085239a3e4c +PKG_SOURCE_VERSION:=050022910be1d1f5c11cd5168f1685ad4f9580d2 +PKG_MIRROR_HASH:=b0a8c79acbb371badcc8477e840ab32bf796d5e7a0eab224bc8fd5aca6b1e631 PKG_SOURCE_URL:=https://sourceware.org/git/glibc.git PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz From 57a8028949681baac133d4526ec189d1992fc565 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Tue, 1 Dec 2020 12:37:01 -0800 Subject: [PATCH 09/65] openvpn-easy-rsa: remove This will be moved to packages. Signed-off-by: Rosen Penev --- .../services/openvpn-easy-rsa/Makefile | 69 ------------------- .../files/openvpn-easy-rsa.upgrade | 1 - .../patches/101-static_EASYRSA.patch | 22 ------ 3 files changed, 92 deletions(-) delete mode 100644 package/network/services/openvpn-easy-rsa/Makefile delete mode 100644 package/network/services/openvpn-easy-rsa/files/openvpn-easy-rsa.upgrade delete mode 100644 package/network/services/openvpn-easy-rsa/patches/101-static_EASYRSA.patch diff --git a/package/network/services/openvpn-easy-rsa/Makefile b/package/network/services/openvpn-easy-rsa/Makefile deleted file mode 100644 index 0cf73950a6..0000000000 --- a/package/network/services/openvpn-easy-rsa/Makefile +++ /dev/null @@ -1,69 +0,0 @@ -# -# Copyright (C) 2010-2013 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=openvpn-easy-rsa - -PKG_VERSION:=3.0.4 -PKG_RELEASE:=1 -PKG_SOURCE_URL:=https://github.com/OpenVPN/easy-rsa/releases/download/v$(PKG_VERSION)/ -PKG_SOURCE:=EasyRSA-$(PKG_VERSION).tgz -PKG_HASH:=472167f976c6cb7c860cec6150a5616e163ae20365c81f179811d6ee0779ec5a -PKG_LICENSE:=GPL-2.0 -PKG_BUILD_DIR:=$(BUILD_DIR)/EasyRSA-$(PKG_VERSION) -PKGARCH:=all - -include $(INCLUDE_DIR)/package.mk - -define Package/openvpn-easy-rsa - TITLE:=CLI utility to build and manage a PKI CA. - SECTION:=net - CATEGORY:=Network - URL:=http://openvpn.net - SUBMENU:=VPN - DEPENDS:=+openssl-util -endef - -define Package/openvpn-easy-rsa/conffiles -/etc/easy-rsa/vars -/etc/easy-rsa/openssl-1.0.cnf -/etc/easy-rsa/openssl-easyrsa.cnf -endef - -define Build/Configure - -endef - -define Build/Compile - -endef - -define Package/openvpn-easy-rsa/install - $(INSTALL_DIR) $(1)/usr/bin - - $(INSTALL_BIN) $(PKG_BUILD_DIR)/easyrsa $(1)/usr/bin/ - $(INSTALL_DIR) $(1)/etc/easy-rsa - $(INSTALL_DATA) $(PKG_BUILD_DIR)/openssl-easyrsa.cnf $(1)/etc/easy-rsa/openssl-1.0.cnf - $(LN) /etc/easy-rsa/openssl-1.0.cnf $(1)/etc/easy-rsa/openssl-easyrsa.cnf - $(INSTALL_DATA) $(PKG_BUILD_DIR)/vars.example $(1)/etc/easy-rsa/vars - - $(INSTALL_DIR) $(1)/etc/easy-rsa/pki - chmod 700 $(1)/etc/easy-rsa/pki - $(INSTALL_DIR) $(1)/etc/easy-rsa/pki/private - chmod 700 $(1)/etc/easy-rsa/pki/private - $(INSTALL_DIR) $(1)/etc/easy-rsa/pki/reqs - chmod 700 $(1)/etc/easy-rsa/pki/reqs - - $(INSTALL_DIR) $(1)/etc/easy-rsa/x509-types - $(INSTALL_DATA) $(PKG_BUILD_DIR)/x509-types/* $(1)/etc/easy-rsa/x509-types/ - - $(INSTALL_DIR) $(1)/lib/upgrade/keep.d - $(INSTALL_DATA) files/openvpn-easy-rsa.upgrade $(1)/lib/upgrade/keep.d/$(PKG_NAME) -endef - -$(eval $(call BuildPackage,openvpn-easy-rsa)) diff --git a/package/network/services/openvpn-easy-rsa/files/openvpn-easy-rsa.upgrade b/package/network/services/openvpn-easy-rsa/files/openvpn-easy-rsa.upgrade deleted file mode 100644 index 8110b81a46..0000000000 --- a/package/network/services/openvpn-easy-rsa/files/openvpn-easy-rsa.upgrade +++ /dev/null @@ -1 +0,0 @@ -/etc/easy-rsa/pki/ diff --git a/package/network/services/openvpn-easy-rsa/patches/101-static_EASYRSA.patch b/package/network/services/openvpn-easy-rsa/patches/101-static_EASYRSA.patch deleted file mode 100644 index b81366c60b..0000000000 --- a/package/network/services/openvpn-easy-rsa/patches/101-static_EASYRSA.patch +++ /dev/null @@ -1,22 +0,0 @@ -Index: EasyRSA-3.0.4/easyrsa -=================================================================== ---- EasyRSA-3.0.4.orig/easyrsa -+++ EasyRSA-3.0.4/easyrsa -@@ -1033,7 +1033,7 @@ vars_setup() { - vars= - - # set up program path -- prog_vars="${0%/*}/vars" -+ prog_vars="/etc/easy-rsa/vars" - # set up PKI path - pki_vars="${EASYRSA_PKI:-$PWD/pki}/vars" - -@@ -1060,7 +1060,7 @@ Note: using Easy-RSA configuration from: - fi - - # Set defaults, preferring existing env-vars if present -- set_var EASYRSA "${0%/*}" -+ set_var EASYRSA "/etc/easy-rsa" - set_var EASYRSA_OPENSSL openssl - set_var EASYRSA_PKI "$PWD/pki" - set_var EASYRSA_DN cn_only From 28a9ac74ccd5af67c033f86665fd2aad87778efa Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Tue, 1 Dec 2020 12:37:02 -0800 Subject: [PATCH 10/65] openvpn: remove This will be moved to packages. Signed-off-by: Rosen Penev Acked-by: Paul Spooren --- .../services/openvpn/Config-mbedtls.in | 58 --- .../network/services/openvpn/Config-nossl.in | 50 -- .../services/openvpn/Config-openssl.in | 62 --- package/network/services/openvpn/Makefile | 158 ------ .../files/etc/hotplug.d/openvpn/01-user | 22 - .../services/openvpn/files/etc/openvpn.user | 11 - .../openvpn/files/lib/functions/openvpn.sh | 16 - .../services/openvpn/files/openvpn.config | 474 ------------------ .../services/openvpn/files/openvpn.init | 209 -------- .../services/openvpn/files/openvpn.options | 194 ------- .../services/openvpn/files/openvpn.upgrade | 1 - .../openvpn/files/usr/libexec/openvpn-hotplug | 10 - .../001-reproducible-remove_DATE.patch | 10 - ...bedtls-disable-runtime-version-check.patch | 11 - ...l-dont-use-deprecated-ssleay-symbols.patch | 58 --- ...enssl-add-missing-include-statements.patch | 65 --- .../210-build_always_use_internal_lz4.patch | 74 --- .../openvpn/patches/220-disable_des.patch | 81 --- 18 files changed, 1564 deletions(-) delete mode 100644 package/network/services/openvpn/Config-mbedtls.in delete mode 100644 package/network/services/openvpn/Config-nossl.in delete mode 100644 package/network/services/openvpn/Config-openssl.in delete mode 100644 package/network/services/openvpn/Makefile delete mode 100644 package/network/services/openvpn/files/etc/hotplug.d/openvpn/01-user delete mode 100644 package/network/services/openvpn/files/etc/openvpn.user delete mode 100644 package/network/services/openvpn/files/lib/functions/openvpn.sh delete mode 100644 package/network/services/openvpn/files/openvpn.config delete mode 100644 package/network/services/openvpn/files/openvpn.init delete mode 100644 package/network/services/openvpn/files/openvpn.options delete mode 100644 package/network/services/openvpn/files/openvpn.upgrade delete mode 100644 package/network/services/openvpn/files/usr/libexec/openvpn-hotplug delete mode 100644 package/network/services/openvpn/patches/001-reproducible-remove_DATE.patch delete mode 100644 package/network/services/openvpn/patches/100-mbedtls-disable-runtime-version-check.patch delete mode 100644 package/network/services/openvpn/patches/110-openssl-dont-use-deprecated-ssleay-symbols.patch delete mode 100644 package/network/services/openvpn/patches/111-openssl-add-missing-include-statements.patch delete mode 100644 package/network/services/openvpn/patches/210-build_always_use_internal_lz4.patch delete mode 100644 package/network/services/openvpn/patches/220-disable_des.patch diff --git a/package/network/services/openvpn/Config-mbedtls.in b/package/network/services/openvpn/Config-mbedtls.in deleted file mode 100644 index beac492022..0000000000 --- a/package/network/services/openvpn/Config-mbedtls.in +++ /dev/null @@ -1,58 +0,0 @@ -if PACKAGE_openvpn-mbedtls - -config OPENVPN_mbedtls_ENABLE_LZO - bool "Enable LZO compression support" - default y - -config OPENVPN_mbedtls_ENABLE_LZ4 - bool "Enable LZ4 compression support" - default y - -config OPENVPN_mbedtls_ENABLE_SERVER - bool "Enable server support (otherwise only client mode is support)" - default y - -#config OPENVPN_mbedtls_ENABLE_EUREPHIA -# bool "Enable support for the eurephia plug-in" -# default n - -config OPENVPN_mbedtls_ENABLE_MANAGEMENT - bool "Enable management server support" - default n - -#config OPENVPN_mbedtls_ENABLE_PKCS11 -# bool "Enable pkcs11 support" -# default n - -config OPENVPN_mbedtls_ENABLE_FRAGMENT - bool "Enable internal fragmentation support (--fragment)" - default y - -config OPENVPN_mbedtls_ENABLE_MULTIHOME - bool "Enable multi-homed UDP server support (--multihome)" - default y - -config OPENVPN_mbedtls_ENABLE_PORT_SHARE - bool "Enable TCP server port-share support (--port-share)" - default y - -config OPENVPN_mbedtls_ENABLE_DEF_AUTH - bool "Enable deferred authentication" - default y - -config OPENVPN_mbedtls_ENABLE_PF - bool "Enable internal packet filter" - default y - -config OPENVPN_mbedtls_ENABLE_IPROUTE2 - bool "Enable support for iproute2" - default n - -config OPENVPN_mbedtls_ENABLE_SMALL - bool "Enable size optimization" - default y - help - enable smaller executable size (disable OCC, usage - message, and verb 4 parm list) - -endif diff --git a/package/network/services/openvpn/Config-nossl.in b/package/network/services/openvpn/Config-nossl.in deleted file mode 100644 index 79140ad5d1..0000000000 --- a/package/network/services/openvpn/Config-nossl.in +++ /dev/null @@ -1,50 +0,0 @@ -if PACKAGE_openvpn-nossl - -config OPENVPN_nossl_ENABLE_LZO - bool "Enable LZO compression support" - default y - -config OPENVPN_nossl_ENABLE_LZ4 - bool "Enable LZ4 compression support" - default y - -config OPENVPN_nossl_ENABLE_SERVER - bool "Enable server support (otherwise only client mode is support)" - default y - -config OPENVPN_nossl_ENABLE_MANAGEMENT - bool "Enable management server support" - default n - -config OPENVPN_nossl_ENABLE_FRAGMENT - bool "Enable internal fragmentation support (--fragment)" - default y - -config OPENVPN_nossl_ENABLE_MULTIHOME - bool "Enable multi-homed UDP server support (--multihome)" - default y - -config OPENVPN_nossl_ENABLE_PORT_SHARE - bool "Enable TCP server port-share support (--port-share)" - default y - -config OPENVPN_nossl_ENABLE_DEF_AUTH - bool "Enable deferred authentication" - default y - -config OPENVPN_nossl_ENABLE_PF - bool "Enable internal packet filter" - default y - -config OPENVPN_nossl_ENABLE_IPROUTE2 - bool "Enable support for iproute2" - default n - -config OPENVPN_nossl_ENABLE_SMALL - bool "Enable size optimization" - default y - help - enable smaller executable size (disable OCC, usage - message, and verb 4 parm list) - -endif diff --git a/package/network/services/openvpn/Config-openssl.in b/package/network/services/openvpn/Config-openssl.in deleted file mode 100644 index f2b618eff1..0000000000 --- a/package/network/services/openvpn/Config-openssl.in +++ /dev/null @@ -1,62 +0,0 @@ -if PACKAGE_openvpn-openssl - -config OPENVPN_openssl_ENABLE_LZO - bool "Enable LZO compression support" - default y - -config OPENVPN_openssl_ENABLE_LZ4 - bool "Enable LZ4 compression support" - default y - -config OPENVPN_openssl_ENABLE_X509_ALT_USERNAME - bool "Enable the --x509-username-field feature" - default n - -config OPENVPN_openssl_ENABLE_SERVER - bool "Enable server support (otherwise only client mode is support)" - default y - -#config OPENVPN_openssl_ENABLE_EUREPHIA -# bool "Enable support for the eurephia plug-in" -# default n - -config OPENVPN_openssl_ENABLE_MANAGEMENT - bool "Enable management server support" - default n - -#config OPENVPN_openssl_ENABLE_PKCS11 -# bool "Enable pkcs11 support" -# default n - -config OPENVPN_openssl_ENABLE_FRAGMENT - bool "Enable internal fragmentation support (--fragment)" - default y - -config OPENVPN_openssl_ENABLE_MULTIHOME - bool "Enable multi-homed UDP server support (--multihome)" - default y - -config OPENVPN_openssl_ENABLE_PORT_SHARE - bool "Enable TCP server port-share support (--port-share)" - default y - -config OPENVPN_openssl_ENABLE_DEF_AUTH - bool "Enable deferred authentication" - default y - -config OPENVPN_openssl_ENABLE_PF - bool "Enable internal packet filter" - default y - -config OPENVPN_openssl_ENABLE_IPROUTE2 - bool "Enable support for iproute2" - default n - -config OPENVPN_openssl_ENABLE_SMALL - bool "Enable size optimization" - default y - help - enable smaller executable size (disable OCC, usage - message, and verb 4 parm list) - -endif diff --git a/package/network/services/openvpn/Makefile b/package/network/services/openvpn/Makefile deleted file mode 100644 index 40570fbdb6..0000000000 --- a/package/network/services/openvpn/Makefile +++ /dev/null @@ -1,158 +0,0 @@ -# -# Copyright (C) 2010-2015 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=openvpn - -PKG_VERSION:=2.4.9 -PKG_RELEASE:=5 - -PKG_SOURCE_URL:=\ - https://build.openvpn.net/downloads/releases/ \ - https://swupdate.openvpn.net/community/releases/ -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz -PKG_HASH:=641f3add8694b2ccc39fd4fd92554e4f089ad16a8db6d2b473ec284839a5ebe2 - -PKG_MAINTAINER:=Felix Fietkau - -PKG_INSTALL:=1 -PKG_FIXUP:=autoreconf -PKG_BUILD_PARALLEL:=1 -PKG_LICENSE:=GPL-2.0 -PKG_CPE_ID:=cpe:/a:openvpn:openvpn - -include $(INCLUDE_DIR)/package.mk - -define Package/openvpn/Default - TITLE:=Open source VPN solution using $(2) - SECTION:=net - CATEGORY:=Network - URL:=http://openvpn.net - SUBMENU:=VPN - MENU:=1 - DEPENDS:=+kmod-tun +OPENVPN_$(1)_ENABLE_LZO:liblzo +OPENVPN_$(1)_ENABLE_IPROUTE2:ip $(3) - VARIANT:=$(1) -ifeq ($(1),nossl) - PROVIDES:=openvpn -else - PROVIDES:=openvpn openvpn-crypto -endif -endef - -Package/openvpn-openssl=$(call Package/openvpn/Default,openssl,OpenSSL,+PACKAGE_openvpn-openssl:libopenssl) -Package/openvpn-mbedtls=$(call Package/openvpn/Default,mbedtls,mbedTLS,+PACKAGE_openvpn-mbedtls:libmbedtls) -Package/openvpn-nossl=$(call Package/openvpn/Default,nossl,plaintext (no SSL)) - -define Package/openvpn/config/Default - source "$(SOURCE)/Config-$(1).in" -endef - -Package/openvpn-openssl/config=$(call Package/openvpn/config/Default,openssl) -Package/openvpn-mbedtls/config=$(call Package/openvpn/config/Default,mbedtls) -Package/openvpn-nossl/config=$(call Package/openvpn/config/Default,nossl) - -ifeq ($(BUILD_VARIANT),mbedtls) -CONFIG_OPENVPN_MBEDTLS:=y -endif -ifeq ($(BUILD_VARIANT),openssl) -CONFIG_OPENVPN_OPENSSL:=y -endif -ifeq ($(BUILD_VARIANT),nossl) -CONFIG_OPENVPN_NOSSL:=y -endif - -CONFIGURE_VARS += \ - IFCONFIG=/sbin/ifconfig \ - ROUTE=/sbin/route \ - IPROUTE=/sbin/ip \ - NETSTAT=/sbin/netstat - -TARGET_CFLAGS += -ffunction-sections -fdata-sections -TARGET_LDFLAGS += -Wl,--gc-sections - -define Build/Configure - $(call Build/Configure/Default, \ - $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_SMALL),--enable-small) \ - --disable-selinux \ - --disable-systemd \ - --disable-plugins \ - --disable-debug \ - --disable-pkcs11 \ - $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_LZO),--enable,--disable)-lzo \ - $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_LZ4),--enable,--disable)-lz4 \ - $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_X509_ALT_USERNAME),--enable,--disable)-x509-alt-username \ - $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_SERVER),--enable,--disable)-server \ - $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_MANAGEMENT),--enable,--disable)-management \ - $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_FRAGMENT),--enable,--disable)-fragment \ - $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_MULTIHOME),--enable,--disable)-multihome \ - $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_IPROUTE2),--enable,--disable)-iproute2 \ - $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_DEF_AUTH),--enable,--disable)-def-auth \ - $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_PF),--enable,--disable)-pf \ - $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_PORT_SHARE),--enable,--disable)-port-share \ - $(if $(CONFIG_OPENVPN_NOSSL),--disable-crypto,--enable-crypto) \ - $(if $(CONFIG_OPENVPN_OPENSSL),--with-crypto-library=openssl) \ - $(if $(CONFIG_OPENVPN_MBEDTLS),--with-crypto-library=mbedtls) \ - ) -endef - -define Package/openvpn-$(BUILD_VARIANT)/conffiles -/etc/config/openvpn -/etc/openvpn.user -endef - -define Package/openvpn-$(BUILD_VARIANT)/install - $(INSTALL_DIR) \ - $(1)/usr/sbin \ - $(1)/usr/share/openvpn \ - $(1)/etc/init.d \ - $(1)/etc/config \ - $(1)/etc/openvpn \ - $(1)/lib/functions \ - $(1)/lib/upgrade/keep.d \ - $(1)/usr/libexec \ - $(1)/etc/hotplug.d/openvpn - - $(INSTALL_BIN) \ - $(PKG_INSTALL_DIR)/usr/sbin/openvpn \ - $(1)/usr/sbin/ - - $(INSTALL_BIN) \ - files/openvpn.init \ - $(1)/etc/init.d/openvpn - - $(INSTALL_BIN) \ - files/usr/libexec/openvpn-hotplug \ - $(1)/usr/libexec/openvpn-hotplug - - $(INSTALL_DATA) \ - files/lib/functions/openvpn.sh \ - $(1)/lib/functions/openvpn.sh - - $(INSTALL_DATA) \ - files/etc/hotplug.d/openvpn/01-user \ - $(1)/etc/hotplug.d/openvpn/01-user - - $(INSTALL_DATA) \ - files/etc/openvpn.user \ - $(1)/etc/openvpn.user - - $(INSTALL_DATA) \ - files/openvpn.options \ - $(1)/usr/share/openvpn/openvpn.options - - $(INSTALL_CONF) files/openvpn.config \ - $(1)/etc/config/openvpn - - $(INSTALL_DATA) \ - files/openvpn.upgrade \ - $(1)/lib/upgrade/keep.d/openvpn -endef - -$(eval $(call BuildPackage,openvpn-openssl)) -$(eval $(call BuildPackage,openvpn-mbedtls)) -$(eval $(call BuildPackage,openvpn-nossl)) diff --git a/package/network/services/openvpn/files/etc/hotplug.d/openvpn/01-user b/package/network/services/openvpn/files/etc/hotplug.d/openvpn/01-user deleted file mode 100644 index f93823e5c5..0000000000 --- a/package/network/services/openvpn/files/etc/hotplug.d/openvpn/01-user +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -. /lib/functions/openvpn.sh - -[ -e "/etc/openvpn.user" ] && { - env -i ACTION="$ACTION" INSTANCE="$INSTANCE" \ - /bin/sh \ - /etc/openvpn.user \ - $* -} - -# Wrap user defined scripts on up/down events -case "$ACTION" in - up|down) - if get_openvpn_option "$config" command "$ACTION"; then - shift - exec /bin/sh -c "$command $*" - fi - ;; -esac - -exit 0 diff --git a/package/network/services/openvpn/files/etc/openvpn.user b/package/network/services/openvpn/files/etc/openvpn.user deleted file mode 100644 index a77566556a..0000000000 --- a/package/network/services/openvpn/files/etc/openvpn.user +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# -# This file is interpreted as shell script. -# Put your custom openvpn action here, they will -# be executed with each opevnp event. -# -# $ACTION -# down action is generated after the TUN/TAP device is closed -# up action is generated after the TUN/TAP device is opened -# $INSTANCE Name of the openvpn instance which went up or down - diff --git a/package/network/services/openvpn/files/lib/functions/openvpn.sh b/package/network/services/openvpn/files/lib/functions/openvpn.sh deleted file mode 100644 index 83fb1bb453..0000000000 --- a/package/network/services/openvpn/files/lib/functions/openvpn.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -get_openvpn_option() { - local config="$1" - local variable="$2" - local option="$3" - - local value="$(sed -rne 's/^[ \t]*'"$option"'[ \t]+(([^ \t\\]|\\.)+)[ \t]*$/\1/p' "$config" | tail -n1 | sed -re 's/\\(.)/\1/g')" - [ -n "$value" ] || value="$(sed -rne 's/^[ \t]*'"$option"'[ \t]+'"'([^']+)'"'[ \t]*$/\1/p' "$config" | tail -n1)" - [ -n "$value" ] || value="$(sed -rne 's/^[ \t]*'"$option"'[ \t]+"(([^"\\]|\\.)+)"[ \t]*$/\1/p' "$config" | tail -n1 | sed -re 's/\\(.)/\1/g')" - [ -n "$value" ] || return 1 - - export -n "$variable=$value" - return 0 -} - diff --git a/package/network/services/openvpn/files/openvpn.config b/package/network/services/openvpn/files/openvpn.config deleted file mode 100644 index 3de1881e35..0000000000 --- a/package/network/services/openvpn/files/openvpn.config +++ /dev/null @@ -1,474 +0,0 @@ -package openvpn - -################################################# -# Sample to include a custom config file. # -################################################# - -config openvpn custom_config - - # Set to 1 to enable this instance: - option enabled 0 - - # Include OpenVPN configuration - option config /etc/openvpn/my-vpn.conf - - -################################################# -# Sample OpenVPN 2.0 uci config for # -# multi-client server. # -################################################# - -config openvpn sample_server - - # Set to 1 to enable this instance: - option enabled 0 - - # Which local IP address should OpenVPN - # listen on? (optional) -# option local 0.0.0.0 - - # Which TCP/UDP port should OpenVPN listen on? - # If you want to run multiple OpenVPN instances - # on the same machine, use a different port - # number for each one. You will need to - # open up this port on your firewall. - option port 1194 - - # TCP or UDP server? -# option proto tcp - option proto udp - - # "dev tun" will create a routed IP tunnel, - # "dev tap" will create an ethernet tunnel. - # Use "dev tap0" if you are ethernet bridging - # and have precreated a tap0 virtual interface - # and bridged it with your ethernet interface. - # If you want to control access policies - # over the VPN, you must create firewall - # rules for the the TUN/TAP interface. - # On non-Windows systems, you can give - # an explicit unit number, such as tun0. - # On Windows, use "dev-node" for this. - # On most systems, the VPN will not function - # unless you partially or fully disable - # the firewall for the TUN/TAP interface. -# option dev tap - option dev tun - - # SSL/TLS root certificate (ca), certificate - # (cert), and private key (key). Each client - # and the server must have their own cert and - # key file. The server and all clients will - # use the same ca file. - # - # See the "easy-rsa" directory for a series - # of scripts for generating RSA certificates - # and private keys. Remember to use - # a unique Common Name for the server - # and each of the client certificates. - # - # Any X509 key management system can be used. - # OpenVPN can also use a PKCS #12 formatted key file - # (see "pkcs12" directive in man page). - option ca /etc/openvpn/ca.crt - option cert /etc/openvpn/server.crt - # This file should be kept secret: - option key /etc/openvpn/server.key - - # Diffie hellman parameters. - # Generate your own with: - # openssl dhparam -out dh2048.pem 2048 - # Substitute 2048 for 1024 if you are using - # 1024 bit keys. - option dh /etc/openvpn/dh2048.pem - - # Configure server mode and supply a VPN subnet - # for OpenVPN to draw client addresses from. - # The server will take 10.8.0.1 for itself, - # the rest will be made available to clients. - # Each client will be able to reach the server - # on 10.8.0.1. Comment this line out if you are - # ethernet bridging. See the man page for more info. - option server "10.8.0.0 255.255.255.0" - - # Maintain a record of client <-> virtual IP address - # associations in this file. If OpenVPN goes down or - # is restarted, reconnecting clients can be assigned - # the same virtual IP address from the pool that was - # previously assigned. - option ifconfig_pool_persist /tmp/ipp.txt - - # Configure server mode for ethernet bridging. - # You must first use your OS's bridging capability - # to bridge the TAP interface with the ethernet - # NIC interface. Then you must manually set the - # IP/netmask on the bridge interface, here we - # assume 10.8.0.4/255.255.255.0. Finally we - # must set aside an IP range in this subnet - # (start=10.8.0.50 end=10.8.0.100) to allocate - # to connecting clients. Leave this line commented - # out unless you are ethernet bridging. -# option server_bridge "10.8.0.4 255.255.255.0 10.8.0.50 10.8.0.100" - - # Push routes to the client to allow it - # to reach other private subnets behind - # the server. Remember that these - # private subnets will also need - # to know to route the OpenVPN client - # address pool (10.8.0.0/255.255.255.0) - # back to the OpenVPN server. -# list push "route 192.168.10.0 255.255.255.0" -# list push "route 192.168.20.0 255.255.255.0" - - # To assign specific IP addresses to specific - # clients or if a connecting client has a private - # subnet behind it that should also have VPN access, - # use the subdirectory "ccd" for client-specific - # configuration files (see man page for more info). - - # EXAMPLE: Suppose the client - # having the certificate common name "Thelonious" - # also has a small subnet behind his connecting - # machine, such as 192.168.40.128/255.255.255.248. - # First, uncomment out these lines: -# option client_config_dir /etc/openvpn/ccd -# list route "192.168.40.128 255.255.255.248" - # Then create a file ccd/Thelonious with this line: - # iroute 192.168.40.128 255.255.255.248 - # This will allow Thelonious' private subnet to - # access the VPN. This example will only work - # if you are routing, not bridging, i.e. you are - # using "dev tun" and "server" directives. - - # EXAMPLE: Suppose you want to give - # Thelonious a fixed VPN IP address of 10.9.0.1. - # First uncomment out these lines: -# option client_config_dir /etc/openvpn/ccd -# list route "10.9.0.0 255.255.255.252" -# list route "192.168.100.0 255.255.255.0" - # Then add this line to ccd/Thelonious: - # ifconfig-push "10.9.0.1 10.9.0.2" - - # Suppose that you want to enable different - # firewall access policies for different groups - # of clients. There are two methods: - # (1) Run multiple OpenVPN daemons, one for each - # group, and firewall the TUN/TAP interface - # for each group/daemon appropriately. - # (2) (Advanced) Create a script to dynamically - # modify the firewall in response to access - # from different clients. See man - # page for more info on learn-address script. -# option learn_address /etc/openvpn/script - - # If enabled, this directive will configure - # all clients to redirect their default - # network gateway through the VPN, causing - # all IP traffic such as web browsing and - # and DNS lookups to go through the VPN - # (The OpenVPN server machine may need to NAT - # the TUN/TAP interface to the internet in - # order for this to work properly). - # CAVEAT: May break client's network config if - # client's local DHCP server packets get routed - # through the tunnel. Solution: make sure - # client's local DHCP server is reachable via - # a more specific route than the default route - # of 0.0.0.0/0.0.0.0. -# list push "redirect-gateway" - - # Certain Windows-specific network settings - # can be pushed to clients, such as DNS - # or WINS server addresses. CAVEAT: - # http://openvpn.net/faq.html#dhcpcaveats -# list push "dhcp-option DNS 10.8.0.1" -# list push "dhcp-option WINS 10.8.0.1" - - # Uncomment this directive to allow different - # clients to be able to "see" each other. - # By default, clients will only see the server. - # To force clients to only see the server, you - # will also need to appropriately firewall the - # server's TUN/TAP interface. -# option client_to_client 1 - - # Uncomment this directive if multiple clients - # might connect with the same certificate/key - # files or common names. This is recommended - # only for testing purposes. For production use, - # each client should have its own certificate/key - # pair. - # - # IF YOU HAVE NOT GENERATED INDIVIDUAL - # CERTIFICATE/KEY PAIRS FOR EACH CLIENT, - # EACH HAVING ITS OWN UNIQUE "COMMON NAME", - # UNCOMMENT THIS LINE OUT. -# option duplicate_cn 1 - - # The keepalive directive causes ping-like - # messages to be sent back and forth over - # the link so that each side knows when - # the other side has gone down. - # Ping every 10 seconds, assume that remote - # peer is down if no ping received during - # a 120 second time period. - option keepalive "10 120" - - # For extra security beyond that provided - # by SSL/TLS, create an "HMAC firewall" - # to help block DoS attacks and UDP port flooding. - # - # Generate with: - # openvpn --genkey --secret ta.key - # - # The server and each client must have - # a copy of this key. - # The second parameter should be '0' - # on the server and '1' on the clients. - # This file is secret: -# option tls_auth "/etc/openvpn/ta.key 0" - - # For additional privacy, a shared secret key - # can be used for both authentication (as in tls_auth) - # and encryption of the TLS control channel. - # - # Generate a shared secret with: - # openvpn --genkey --secret ta.key - # - # The server and each client must have - # a copy of this key. - # - # tls_auth and tls_crypt should NOT - # be combined, as tls_crypt implies tls_auth. - # Use EITHER tls_crypt, tls_auth, or neither option. -# option tls_crypt "/etc/openvpn/ta.key" - - # Set the minimum required TLS protocol version - # for all connections. - # - # Require at least TLS 1.1 -# option tls_version_min "1.1" - # Require at least TLS 1.2 -# option tls_version_min "1.2" - # Require TLS 1.2, or the highest version supported - # on the system -# option tls_version_min "1.2 'or-highest'" - - # OpenVPN versions 2.4 and later will attempt to - # automatically negotiate the most secure cipher - # between the client and server, regardless of a - # configured "option cipher" (see below). - # Automatic negotiation is recommended. - # - # Uncomment this option to disable this behavior, - # and force all OpenVPN peers to use the configured - # cipher option instead (not recommended). -# option ncp_disable - - # Select a cryptographic cipher. - # This config item must be copied to - # the client config file as well. - # - # To see all supported ciphers, run: - # openvpn --show-ciphers - # - # Blowfish (default for backwards compatibility, - # but not recommended due to weaknesses): -# option cipher BF-CBC - # AES: -# option cipher AES-128-CBC - # Triple-DES: -# option cipher DES-EDE3-CBC - - # Enable compression on the VPN link. - # If you enable it here, you must also - # enable it in the client config file. - # - # Compression is not recommended, as compression and - # encryption in combination can weaken the security - # of the connection. - # - # LZ4 requires OpenVPN 2.4+ client and server -# option compress lz4 - # LZO is compatible with most OpenVPN versions - # (set "compress lzo" on 2.4+ clients, and "comp-lzo yes" on older clients) -# option compress lzo - - # The maximum number of concurrently connected - # clients we want to allow. -# option max_clients 100 - - # The persist options will try to avoid - # accessing certain resources on restart - # that may no longer be accessible because - # of the privilege downgrade. - option persist_key 1 - option persist_tun 1 - option user nobody - - # Output a short status file showing - # current connections, truncated - # and rewritten every minute. - option status /tmp/openvpn-status.log - - # By default, log messages will go to the syslog (or - # on Windows, if running as a service, they will go to - # the "\Program Files\OpenVPN\log" directory). - # Use log or log-append to override this default. - # "log" will truncate the log file on OpenVPN startup, - # while "log-append" will append to it. Use one - # or the other (but not both). -# option log /tmp/openvpn.log -# option log_append /tmp/openvpn.log - - # Set the appropriate level of log - # file verbosity. - # - # 0 is silent, except for fatal errors - # 4 is reasonable for general usage - # 5 and 6 can help to debug connection problems - # 9 is extremely verbose - option verb 3 - - # Silence repeating messages. At most 20 - # sequential messages of the same message - # category will be output to the log. -# option mute 20 - - -############################################## -# Sample client-side OpenVPN 2.0 uci config # -# for connecting to multi-client server. # -############################################## - -config openvpn sample_client - - # Set to 1 to enable this instance: - option enabled 0 - - # Specify that we are a client and that we - # will be pulling certain config file directives - # from the server. - option client 1 - - # Use the same setting as you are using on - # the server. - # On most systems, the VPN will not function - # unless you partially or fully disable - # the firewall for the TUN/TAP interface. -# option dev tap - option dev tun - - # Are we connecting to a TCP or - # UDP server? Use the same setting as - # on the server. -# option proto tcp - option proto udp - - # The hostname/IP and port of the server. - # You can have multiple remote entries - # to load balance between the servers. - list remote "my_server_1 1194" -# list remote "my_server_2 1194" - - # Choose a random host from the remote - # list for load_balancing. Otherwise - # try hosts in the order specified. -# option remote_random 1 - - # Keep trying indefinitely to resolve the - # host name of the OpenVPN server. Very useful - # on machines which are not permanently connected - # to the internet such as laptops. - option resolv_retry infinite - - # Most clients don't need to bind to - # a specific local port number. - option nobind 1 - - # Try to preserve some state across restarts. - option persist_key 1 - option persist_tun 1 - option user nobody - - # If you are connecting through an - # HTTP proxy to reach the actual OpenVPN - # server, put the proxy server/IP and - # port number here. See the man page - # if your proxy server requires - # authentication. - # retry on connection failures: -# option http_proxy_retry 1 - # specify http proxy address and port: -# option http_proxy "192.168.1.100 8080" - - # Wireless networks often produce a lot - # of duplicate packets. Set this flag - # to silence duplicate packet warnings. -# option mute_replay_warnings 1 - - # SSL/TLS parms. - # See the server config file for more - # description. It's best to use - # a separate .crt/.key file pair - # for each client. A single ca - # file can be used for all clients. - option ca /etc/openvpn/ca.crt - option cert /etc/openvpn/client.crt - option key /etc/openvpn/client.key - - # Verify server certificate by checking - # that the certicate has the key usage - # field set to "server". This is an - # important precaution to protect against - # a potential attack discussed here: - # http://openvpn.net/howto.html#mitm - # - # To use this feature, you will need to generate - # your server certificates with the nsCertType - # field set to "server". The build_key_server - # script in the easy_rsa folder will do this. -# option remote_cert_tls server - - # If a tls_auth key is used on the server - # then every client must also have the key. -# option tls_auth "/etc/openvpn/ta.key 1" - - # If a tls_crypt key is used on the server - # every client must also have the key. -# option tls_crypt "/etc/openvpn/ta.key" - - # Set the minimum required TLS protocol version - # for all connections. - # - # Require at least TLS 1.1 -# option tls_version_min "1.1" - # Require at least TLS 1.2 -# option tls_version_min "1.2" - # Require TLS 1.2, or the highest version supported - # on the system -# option tls_version_min "1.2 'or-highest'" - - # Select a cryptographic cipher. - # If the cipher option is used on the server - # then you must also specify it here. -# option cipher x - - # Enable compression on the VPN link. - # Don't enable this unless it is also - # enabled in the server config file. - # - # Compression is not recommended, as compression and - # encryption in combination can weaken the security - # of the connection. - # - # LZ4 requires OpenVPN 2.4+ on server and client -# option compress lz4 - # LZO is compatible with most OpenVPN versions -# option compress lzo - - # Set log file verbosity. - option verb 3 - - # Silence repeating messages -# option mute 20 diff --git a/package/network/services/openvpn/files/openvpn.init b/package/network/services/openvpn/files/openvpn.init deleted file mode 100644 index 487a2269e2..0000000000 --- a/package/network/services/openvpn/files/openvpn.init +++ /dev/null @@ -1,209 +0,0 @@ -#!/bin/sh /etc/rc.common -# Copyright (C) 2008-2013 OpenWrt.org -# Copyright (C) 2008 Jo-Philipp Wich -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. - -START=90 -STOP=10 - -USE_PROCD=1 -PROG=/usr/sbin/openvpn - -LIST_SEP=" -" - -UCI_STARTED= -UCI_DISABLED= - -append_param() { - local s="$1" - local v="$2" - case "$v" in - *_*_*_*) v=${v%%_*}-${v#*_}; v=${v%%_*}-${v#*_}; v=${v%%_*}-${v#*_} ;; - *_*_*) v=${v%%_*}-${v#*_}; v=${v%%_*}-${v#*_} ;; - *_*) v=${v%%_*}-${v#*_} ;; - esac - echo -n "$v" >> "/var/etc/openvpn-$s.conf" - return 0 -} - -append_bools() { - local p; local v; local s="$1"; shift - for p in $*; do - config_get_bool v "$s" "$p" - [ "$v" = 1 ] && append_param "$s" "$p" && echo >> "/var/etc/openvpn-$s.conf" - done -} - -append_params() { - local p; local v; local s="$1"; shift - for p in $*; do - config_get v "$s" "$p" - IFS="$LIST_SEP" - for v in $v; do - [ -n "$v" ] && [ "$p" != "push" ] && append_param "$s" "$p" && echo " $v" >> "/var/etc/openvpn-$s.conf" - [ -n "$v" ] && [ "$p" = "push" ] && append_param "$s" "$p" && echo " \"$v\"" >> "/var/etc/openvpn-$s.conf" - done - unset IFS - done -} - -append_list() { - local p; local v; local s="$1"; shift - - list_cb_append() { - v="${v}:$1" - } - - for p in $*; do - unset v - config_list_foreach "$s" "$p" list_cb_append - [ -n "$v" ] && append_param "$s" "$p" && echo " ${v:1}" >> "/var/etc/openvpn-$s.conf" - done -} - -section_enabled() { - config_get_bool enable "$1" 'enable' 0 - config_get_bool enabled "$1" 'enabled' 0 - [ $enable -gt 0 ] || [ $enabled -gt 0 ] -} - -openvpn_get_dev() { - local dev dev_type - local name="$1" - local conf="$2" - - # Do override only for configurations with config_file - config_get config_file "$name" config - [ -n "$config_file" ] || return - - # Check there is someething to override - config_get dev "$name" dev - config_get dev_type "$name" dev_type - [ -n "$dev" ] || return - - # If there is a no dev_type, try to guess it - if [ -z "$dev_type" ]; then - . /lib/functions/openvpn.sh - - local odev odev_type - get_openvpn_option "$conf" odev dev - get_openvpn_option "$conf" odev_type dev-type - [ -n "$odev_type" ] || odev_type="$odev" - - case "$odev_type" in - tun*) dev_type="tun" ;; - tap*) dev_type="tap" ;; - *) return;; - esac - fi - - # Return overrides - echo "--dev-type $dev_type --dev $dev" -} - -openvpn_add_instance() { - local name="$1" - local dir="$2" - local conf="$3" - local security="$4" - - procd_open_instance "$name" - procd_set_param command "$PROG" \ - --syslog "openvpn($name)" \ - --status "/var/run/openvpn.$name.status" \ - --cd "$dir" \ - --config "$conf" \ - --up "/usr/libexec/openvpn-hotplug up $name" \ - --down "/usr/libexec/openvpn-hotplug down $name" \ - --script-security "${security:-2}" \ - $(openvpn_get_dev "$name" "$conf") - procd_set_param file "$dir/$conf" - procd_set_param term_timeout 15 - procd_set_param respawn - procd_append_param respawn 3600 - procd_append_param respawn 5 - procd_append_param respawn -1 - procd_close_instance -} - -start_instance() { - local s="$1" - - config_get config "$s" config - config="${config:+$(readlink -f "$config")}" - - section_enabled "$s" || { - append UCI_DISABLED "$config" "$LIST_SEP" - return 1 - } - - local script_security - config_get script_security "$s" script_security - - [ ! -d "/var/run" ] && mkdir -p "/var/run" - - if [ ! -z "$config" ]; then - append UCI_STARTED "$config" "$LIST_SEP" - openvpn_add_instance "$s" "${config%/*}" "$config" "$script_security" - return - fi - - [ ! -d "/var/etc" ] && mkdir -p "/var/etc" - [ -f "/var/etc/openvpn-$s.conf" ] && rm "/var/etc/openvpn-$s.conf" - - append_bools "$s" $OPENVPN_BOOLS - append_params "$s" $OPENVPN_PARAMS - append_list "$s" $OPENVPN_LIST - - openvpn_add_instance "$s" "/var/etc" "openvpn-$s.conf" "$script_security" -} - -start_service() { - local instance="$1" - local instance_found=0 - - config_cb() { - local type="$1" - local name="$2" - if [ "$type" = "openvpn" ]; then - if [ -n "$instance" -a "$instance" = "$name" ]; then - instance_found=1 - fi - fi - } - - . /usr/share/openvpn/openvpn.options - config_load 'openvpn' - - if [ -n "$instance" ]; then - [ "$instance_found" -gt 0 ] || return - start_instance "$instance" - else - config_foreach start_instance 'openvpn' - - local path name - for path in /etc/openvpn/*.conf; do - if [ -f "$path" ]; then - name="${path##*/}"; name="${name%.conf}" - - # don't start configs again that are already started by uci - if echo "$UCI_STARTED" | grep -qxF "$path"; then - continue - - # don't start configs which are set to disabled in uci - elif echo "$UCI_DISABLED" | grep -qxF "$path"; then - logger -t openvpn "$name.conf is disabled in /etc/config/openvpn" - continue - fi - - openvpn_add_instance "$name" "${path%/*}" "$path" - fi - done - fi -} - -service_triggers() { - procd_add_reload_trigger openvpn -} diff --git a/package/network/services/openvpn/files/openvpn.options b/package/network/services/openvpn/files/openvpn.options deleted file mode 100644 index 5d7a387cd3..0000000000 --- a/package/network/services/openvpn/files/openvpn.options +++ /dev/null @@ -1,194 +0,0 @@ -OPENVPN_PARAMS=' -askpass -auth -auth_retry -auth_user_pass -auth_user_pass_verify -bcast_buffers -ca -capath -cd -cert -chroot -cipher -client_config_dir -client_connect -client_disconnect -comp_lzo -compress -connect_freq -connect_retry -connect_retry_max -connect_timeout -crl_verify -dev -dev_node -dev_type -dh -ecdh_curve -echo -engine -explicit_exit_notify -extra_certs -fragment -group -hand_window -hash_size -http_proxy -http_proxy_option -http_proxy_timeout -ifconfig -ifconfig_ipv6 -ifconfig_ipv6_pool -ifconfig_ipv6_push -ifconfig_pool -ifconfig_pool_persist -ifconfig_push -inactive -ipchange -iroute -iroute_ipv6 -keepalive -key -key_direction -key_method -keysize -learn_address -link_mtu -lladdr -local -log -log_append -lport -management -management_log_cache -max_clients -max_routes_per_client -mode -mssfix -mtu_disc -mute -nice -ns_cert_type -ping -ping_exit -ping_restart -pkcs12 -plugin -port -port_share -prng -proto -pull_filter -push -rcvbuf -redirect_gateway -remap_usr1 -remote -remote_cert_eku -remote_cert_ku -remote_cert_tls -reneg_bytes -reneg_pkts -reneg_sec -replay_persist -replay_window -resolv_retry -route -route_delay -route_gateway -route_ipv6 -route_metric -route_pre_down -route_up -rport -secret -server -server_bridge -server_ipv6 -setenv -shaper -sndbuf -socks_proxy -status -status_version -syslog -tcp_queue_limit -tls_auth -tls_crypt -tls_timeout -tls_verify -tls_version_min -tmp_dir -topology -tran_window -tun_mtu -tun_mtu_extra -txqueuelen -user -verb -verify_client_cert -verify_x509_name -x509_username_field -' - -OPENVPN_BOOLS=' -allow_recursive_routing -auth_nocache -auth_user_pass_optional -bind -ccd_exclusive -client -client_to_client -comp_noadapt -disable -disable_occ -down_pre -duplicate_cn -fast_io -float -http_proxy_retry -ifconfig_noexec -ifconfig_nowarn -management_forget_disconnect -management_hold -management_query_passwords -management_signal -mktun -mlock -mtu_test -multihome -mute_replay_warnings -ncp_disable -nobind -opt_verify -passtos -persist_key -persist_local_ip -persist_remote_ip -persist_tun -ping_timer_rem -pull -push_reset -remote_random -rmtun -route_noexec -route_nopull -single_session -socks_proxy_retry -suppress_timestamps -tcp_nodelay -test_crypto -tls_client -tls_exit -tls_server -up_delay -up_restart -username_as_common_name -' - -OPENVPN_LIST=' -ncp_ciphers -tls_cipher -tls_ciphersuites -' diff --git a/package/network/services/openvpn/files/openvpn.upgrade b/package/network/services/openvpn/files/openvpn.upgrade deleted file mode 100644 index 6ae49d22d0..0000000000 --- a/package/network/services/openvpn/files/openvpn.upgrade +++ /dev/null @@ -1 +0,0 @@ -/etc/openvpn/ diff --git a/package/network/services/openvpn/files/usr/libexec/openvpn-hotplug b/package/network/services/openvpn/files/usr/libexec/openvpn-hotplug deleted file mode 100644 index 9235fbacfe..0000000000 --- a/package/network/services/openvpn/files/usr/libexec/openvpn-hotplug +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -ACTION=$1 -shift -INSTANCE=$1 -shift - -export ACTION=$ACTION -export INSTANCE=$INSTANCE -exec /sbin/hotplug-call openvpn "$@" diff --git a/package/network/services/openvpn/patches/001-reproducible-remove_DATE.patch b/package/network/services/openvpn/patches/001-reproducible-remove_DATE.patch deleted file mode 100644 index 101fa12ba2..0000000000 --- a/package/network/services/openvpn/patches/001-reproducible-remove_DATE.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/src/openvpn/options.c -+++ b/src/openvpn/options.c -@@ -106,7 +106,6 @@ const char title_string[] = - #ifdef HAVE_AEAD_CIPHER_MODES - " [AEAD]" - #endif -- " built on " __DATE__ - ; - - #ifndef ENABLE_SMALL diff --git a/package/network/services/openvpn/patches/100-mbedtls-disable-runtime-version-check.patch b/package/network/services/openvpn/patches/100-mbedtls-disable-runtime-version-check.patch deleted file mode 100644 index cb16a906fe..0000000000 --- a/package/network/services/openvpn/patches/100-mbedtls-disable-runtime-version-check.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/src/openvpn/ssl_mbedtls.c -+++ b/src/openvpn/ssl_mbedtls.c -@@ -1415,7 +1415,7 @@ const char * - get_ssl_library_version(void) - { - static char mbedtls_version[30]; -- unsigned int pv = mbedtls_version_get_number(); -+ unsigned int pv = MBEDTLS_VERSION_NUMBER; - sprintf( mbedtls_version, "mbed TLS %d.%d.%d", - (pv>>24)&0xff, (pv>>16)&0xff, (pv>>8)&0xff ); - return mbedtls_version; diff --git a/package/network/services/openvpn/patches/110-openssl-dont-use-deprecated-ssleay-symbols.patch b/package/network/services/openvpn/patches/110-openssl-dont-use-deprecated-ssleay-symbols.patch deleted file mode 100644 index c7faf7c0c0..0000000000 --- a/package/network/services/openvpn/patches/110-openssl-dont-use-deprecated-ssleay-symbols.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 17a476fd5c8cc49f1d103a50199e87ede76b1b67 Mon Sep 17 00:00:00 2001 -From: Steffan Karger -Date: Sun, 26 Nov 2017 16:04:00 +0100 -Subject: [PATCH] openssl: don't use deprecated SSLEAY/SSLeay symbols - -Compiling our current master against OpenSSL 1.1 with --DOPENSSL_API_COMPAT=0x10100000L screams bloody murder. This patch fixes -the errors about the deprecated SSLEAY/SSLeay symbols and defines. - -Signed-off-by: Steffan Karger -Acked-by: Gert Doering -Message-Id: <20171126150401.28565-1-steffan@karger.me> -URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15934.html -Signed-off-by: Gert Doering ---- - configure.ac | 1 + - src/openvpn/openssl_compat.h | 8 ++++++++ - src/openvpn/ssl_openssl.c | 2 +- - 3 files changed, 10 insertions(+), 1 deletion(-) - ---- a/configure.ac -+++ b/configure.ac -@@ -904,6 +904,7 @@ if test "${enable_crypto}" = "yes" -a "$ - EVP_MD_CTX_free \ - EVP_MD_CTX_reset \ - EVP_CIPHER_CTX_reset \ -+ OpenSSL_version \ - SSL_CTX_get_default_passwd_cb \ - SSL_CTX_get_default_passwd_cb_userdata \ - SSL_CTX_set_security_level \ ---- a/src/openvpn/openssl_compat.h -+++ b/src/openvpn/openssl_compat.h -@@ -689,6 +689,14 @@ EC_GROUP_order_bits(const EC_GROUP *grou - #endif - - /* SSLeay symbols have been renamed in OpenSSL 1.1 */ -+#ifndef OPENSSL_VERSION -+#define OPENSSL_VERSION SSLEAY_VERSION -+#endif -+ -+#ifndef HAVE_OPENSSL_VERSION -+#define OpenSSL_version SSLeay_version -+#endif -+ - #if !defined(RSA_F_RSA_OSSL_PRIVATE_ENCRYPT) - #define RSA_F_RSA_OSSL_PRIVATE_ENCRYPT RSA_F_RSA_EAY_PRIVATE_ENCRYPT - #endif ---- a/src/openvpn/ssl_openssl.c -+++ b/src/openvpn/ssl_openssl.c -@@ -2008,7 +2008,7 @@ get_highest_preference_tls_cipher(char * - const char * - get_ssl_library_version(void) - { -- return SSLeay_version(SSLEAY_VERSION); -+ return OpenSSL_version(OPENSSL_VERSION); - } - - #endif /* defined(ENABLE_CRYPTO) && defined(ENABLE_CRYPTO_OPENSSL) */ diff --git a/package/network/services/openvpn/patches/111-openssl-add-missing-include-statements.patch b/package/network/services/openvpn/patches/111-openssl-add-missing-include-statements.patch deleted file mode 100644 index 6a62b16500..0000000000 --- a/package/network/services/openvpn/patches/111-openssl-add-missing-include-statements.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 1987498271abadf042d8bb3feee1fe0d877a9d55 Mon Sep 17 00:00:00 2001 -From: Steffan Karger -Date: Sun, 26 Nov 2017 16:49:12 +0100 -Subject: [PATCH] openssl: add missing #include statements - -Compiling our current master against OpenSSL 1.1 with --DOPENSSL_API_COMPAT=0x10100000L screams bloody murder. This patch fixes -the errors caused by missing includes. Previous openssl versions would -usually include 'the rest of the world', but they're fixing that. So we -should no longer rely on it. - -(And sneaking in alphabetic ordering of the includes while touching them.) - -Signed-off-by: Steffan Karger -Acked-by: Gert Doering -Message-Id: <20171126154912.13283-1-steffan@karger.me> -URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15936.html -Signed-off-by: Gert Doering ---- - src/openvpn/openssl_compat.h | 1 + - src/openvpn/ssl_openssl.c | 6 +++++- - src/openvpn/ssl_verify_openssl.c | 3 ++- - 3 files changed, 8 insertions(+), 2 deletions(-) - ---- a/src/openvpn/openssl_compat.h -+++ b/src/openvpn/openssl_compat.h -@@ -42,6 +42,7 @@ - - #include "buffer.h" - -+#include - #include - #include - ---- a/src/openvpn/ssl_openssl.c -+++ b/src/openvpn/ssl_openssl.c -@@ -52,10 +52,14 @@ - - #include "ssl_verify_openssl.h" - -+#include -+#include -+#include -+#include - #include - #include -+#include - #include --#include - #ifndef OPENSSL_NO_EC - #include - #endif ---- a/src/openvpn/ssl_verify_openssl.c -+++ b/src/openvpn/ssl_verify_openssl.c -@@ -44,8 +44,9 @@ - #include "ssl_verify_backend.h" - #include "openssl_compat.h" - --#include -+#include - #include -+#include - - int - verify_callback(int preverify_ok, X509_STORE_CTX *ctx) diff --git a/package/network/services/openvpn/patches/210-build_always_use_internal_lz4.patch b/package/network/services/openvpn/patches/210-build_always_use_internal_lz4.patch deleted file mode 100644 index 5cf5174a9d..0000000000 --- a/package/network/services/openvpn/patches/210-build_always_use_internal_lz4.patch +++ /dev/null @@ -1,74 +0,0 @@ ---- a/configure.ac -+++ b/configure.ac -@@ -1080,68 +1080,15 @@ dnl - AC_ARG_VAR([LZ4_CFLAGS], [C compiler flags for lz4]) - AC_ARG_VAR([LZ4_LIBS], [linker flags for lz4]) - if test "$enable_lz4" = "yes" && test "$enable_comp_stub" = "no"; then -- if test -z "${LZ4_CFLAGS}" -a -z "${LZ4_LIBS}"; then -- # if the user did not explicitly specify flags, try to autodetect -- PKG_CHECK_MODULES([LZ4], -- [liblz4 >= 1.7.1 liblz4 < 100], -- [have_lz4="yes"], -- [LZ4_LIBS="-llz4"] # If this fails, we will do another test next. -- # We also add set LZ4_LIBS otherwise the -- # linker will not know about the lz4 library -- ) -- fi - - saved_CFLAGS="${CFLAGS}" - saved_LIBS="${LIBS}" - CFLAGS="${CFLAGS} ${LZ4_CFLAGS}" - LIBS="${LIBS} ${LZ4_LIBS}" - -- # If pkgconfig check failed or LZ4_CFLAGS/LZ4_LIBS env vars -- # are used, check the version directly in the LZ4 include file -- if test "${have_lz4}" != "yes"; then -- AC_CHECK_HEADERS([lz4.h], -- [have_lz4h="yes"], -- []) -- -- if test "${have_lz4h}" = "yes" ; then -- AC_MSG_CHECKING([additionally if system LZ4 version >= 1.7.1]) -- AC_COMPILE_IFELSE( -- [AC_LANG_PROGRAM([[ --#include -- ]], -- [[ --/* Version encoding: MMNNPP (Major miNor Patch) - see lz4.h for details */ --#if LZ4_VERSION_NUMBER < 10701L --#error LZ4 is too old --#endif -- ]] -- )], -- [ -- AC_MSG_RESULT([ok]) -- have_lz4="yes" -- ], -- [AC_MSG_RESULT([system LZ4 library is too old])] -- ) -- fi -- fi -- -- # Double check we have a few needed functions -- if test "${have_lz4}" = "yes" ; then -- AC_CHECK_LIB([lz4], -- [LZ4_compress_default], -- [], -- [have_lz4="no"]) -- AC_CHECK_LIB([lz4], -- [LZ4_decompress_safe], -- [], -- [have_lz4="no"]) -- fi -- -- if test "${have_lz4}" != "yes" ; then -- AC_MSG_RESULT([ usable LZ4 library or header not found, using version in src/compat/compat-lz4.*]) -- AC_DEFINE([NEED_COMPAT_LZ4], [1], [use copy of LZ4 source in compat/]) -- LZ4_LIBS="" -- fi -+ AC_MSG_RESULT([ usable LZ4 library or header not found, using version in src/compat/compat-lz4.*]) -+ AC_DEFINE([NEED_COMPAT_LZ4], [1], [use copy of LZ4 source in compat/]) -+ LZ4_LIBS="" - OPTIONAL_LZ4_CFLAGS="${LZ4_CFLAGS}" - OPTIONAL_LZ4_LIBS="${LZ4_LIBS}" - AC_DEFINE(ENABLE_LZ4, [1], [Enable LZ4 compression library]) diff --git a/package/network/services/openvpn/patches/220-disable_des.patch b/package/network/services/openvpn/patches/220-disable_des.patch deleted file mode 100644 index 2b8f47a802..0000000000 --- a/package/network/services/openvpn/patches/220-disable_des.patch +++ /dev/null @@ -1,81 +0,0 @@ ---- a/src/openvpn/syshead.h -+++ b/src/openvpn/syshead.h -@@ -597,11 +597,11 @@ socket_defined(const socket_descriptor_t - /* - * Should we include NTLM proxy functionality - */ --#if defined(ENABLE_CRYPTO) --#define NTLM 1 --#else -+//#if defined(ENABLE_CRYPTO) -+//#define NTLM 1 -+//#else - #define NTLM 0 --#endif -+//#endif - - /* - * Should we include proxy digest auth functionality ---- a/src/openvpn/crypto_mbedtls.c -+++ b/src/openvpn/crypto_mbedtls.c -@@ -319,6 +319,7 @@ int - key_des_num_cblocks(const mbedtls_cipher_info_t *kt) - { - int ret = 0; -+#ifdef MBEDTLS_DES_C - if (kt->type == MBEDTLS_CIPHER_DES_CBC) - { - ret = 1; -@@ -331,6 +332,7 @@ key_des_num_cblocks(const mbedtls_cipher - { - ret = 3; - } -+#endif - - dmsg(D_CRYPTO_DEBUG, "CRYPTO INFO: n_DES_cblocks=%d", ret); - return ret; -@@ -339,6 +341,7 @@ key_des_num_cblocks(const mbedtls_cipher - bool - key_des_check(uint8_t *key, int key_len, int ndc) - { -+#ifdef MBEDTLS_DES_C - int i; - struct buffer b; - -@@ -367,11 +370,15 @@ key_des_check(uint8_t *key, int key_len, - - err: - return false; -+#else -+ return true; -+#endif - } - - void - key_des_fixup(uint8_t *key, int key_len, int ndc) - { -+#ifdef MBEDTLS_DES_C - int i; - struct buffer b; - -@@ -386,6 +393,7 @@ key_des_fixup(uint8_t *key, int key_len, - } - mbedtls_des_key_set_parity(key); - } -+#endif - } - - /* -@@ -705,10 +713,12 @@ cipher_des_encrypt_ecb(const unsigned ch - unsigned char *src, - unsigned char *dst) - { -+#ifdef MBEDTLS_DES_C - mbedtls_des_context ctx; - - ASSERT(mbed_ok(mbedtls_des_setkey_enc(&ctx, key))); - ASSERT(mbed_ok(mbedtls_des_crypt_ecb(&ctx, src, dst))); -+#endif - } - - From 173ea745abd27d2d8eb1b0f571069ddfd7f24641 Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Mon, 21 Sep 2020 12:43:43 -1000 Subject: [PATCH 11/65] build: reduce cleanup binary calls in rootfs.mk Both `find` and `rm` only need to be called once for folders and files. Signed-off-by: Paul Spooren --- include/rootfs.mk | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/include/rootfs.mk b/include/rootfs.mk index 18ada3cd43..f2ed648d2f 100644 --- a/include/rootfs.mk +++ b/include/rootfs.mk @@ -47,7 +47,7 @@ TARGET_DIR_ORIG := $(TARGET_ROOTFS_DIR)/root.orig-$(BOARD) ifdef CONFIG_CLEAN_IPKG define clean_ipkg - -find $(1)/usr/lib/opkg/info -type f -and -not -name '*.control' | $(XARGS) rm -rf + -find $(1)/usr/lib/opkg/info -type f -and -not -name '*.control' -delete -sed -i -ne '/^Require-User: /p' $(1)/usr/lib/opkg/info/*.control awk ' \ BEGIN { conffiles = 0; print "Conffiles:" } \ @@ -56,7 +56,7 @@ ifdef CONFIG_CLEAN_IPKG conffiles == 1 { print } \ ' $(1)/usr/lib/opkg/status >$(1)/usr/lib/opkg/status.new mv $(1)/usr/lib/opkg/status.new $(1)/usr/lib/opkg/status - -find $(1)/usr/lib/opkg -empty | $(XARGS) rm -rf + -find $(1)/usr/lib/opkg -empty -delete endef endif @@ -88,15 +88,13 @@ define prepare_rootfs done || true \ ) $(if $(SOURCE_DATE_EPOCH),sed -i "s/Installed-Time: .*/Installed-Time: $(SOURCE_DATE_EPOCH)/" $(1)/usr/lib/opkg/status) - @-find $(1) -name CVS | $(XARGS) rm -rf - @-find $(1) -name .svn | $(XARGS) rm -rf - @-find $(1) -name .git | $(XARGS) rm -rf - @-find $(1) -name '.#*' | $(XARGS) rm -f - rm -rf $(1)/tmp/* - rm -f $(1)/usr/lib/opkg/lists/* - rm -f $(1)/usr/lib/opkg/info/*.postinst* - rm -f $(1)/var/lock/*.lock - rm -rf $(1)/boot + @-find $(1) -name CVS -o -name .svn -o -name .git -o -name '.#*' | $(XARGS) rm -rf + rm -rf \ + $(1)/boot \ + $(1)/tmp/* \ + $(1)/usr/lib/opkg/info/*.postinst* \ + $(1)/usr/lib/opkg/lists/* \ + $(1)/var/lock/*.lock $(call clean_ipkg,$(1)) $(call mklibs,$(1)) $(if $(SOURCE_DATE_EPOCH),find $(1)/ -mindepth 1 -execdir touch -hcd "@$(SOURCE_DATE_EPOCH)" "{}" +) From 13961da6ceeb23879e96726d7bfbf498915064b6 Mon Sep 17 00:00:00 2001 From: Sven Roederer Date: Sat, 5 Dec 2020 23:15:53 +0100 Subject: [PATCH 12/65] procd: also depend on jshn fixes "file no found" error on stripped down images, caused by prod.sh:43. Signed-off-by: Sven Roederer --- package/system/procd/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile index a0e6285ca1..ed73587056 100644 --- a/package/system/procd/Makefile +++ b/package/system/procd/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=procd -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/procd.git @@ -45,7 +45,7 @@ define Package/procd/Default SECTION:=base CATEGORY:=Base system DEPENDS:=+ubusd +ubus +libjson-script +ubox +USE_GLIBC:librt +libubox \ - +libubus +libblobmsg-json +libjson-c + +libubus +libblobmsg-json +libjson-c +jshn TITLE:=OpenWrt system process manager USERID:=:dialout=20 :audio=29 endef From 61ef5940f2eafa2a883d35af3bbf4622722c2fbc Mon Sep 17 00:00:00 2001 From: Daniele Castro Date: Wed, 9 Sep 2020 03:21:14 +0200 Subject: [PATCH 13/65] bcm63xx: add support for ADB P.DG A4101N A-000-1A1-AE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ADB P.DG A4101N A-000-1A1-AE has a similar PCB as the OpenWrt's ADB P.DG A4001N1 with LEDs connected to different GPIO PINs in active low configuration. Hardware: * Board ID: 96328avngv * SoC: Broadcom BCM6328 (rev b0) @ 320MHz, CPU BMIPS4350 * RAM DDR2: 64 Mbyte - Winbond W9751G6KB-25 * Serial flash: 16 Mbyte - Winbond 25Q128BVFG * Ethernet: 4x Ethernet 10/100 baseT * Wifi 2.4GHz: Broadcom Corporation BCM43225 Wireless Network Adapter (rev 23) * LEDs: 1x Power, 1x DSL, 1x Internet, 4x ETH, 1x USB, 1x WLAN, 1x WPS, 1x TEL * Buttons: 1x Reset, 1x WPS, 1x unnamed * UART: 1x TTL 115200n8, VCC RX TX GND, on J502 connector Installation via CFE: * Stock CFE has to be overwritten with a generic 6328 one that can upload .bin images with no signature check (cfe6328_configured.bin) * Connect a serial port to the board * Stop the cfe boot process after power on by pressing enter * Set static IP 192.168.2.10 and subnet mask 255.255.255.0 * Navigate to http://192.168.2.50/ * Upload the OpenWrt image file A4101N GPIO LAYOUT: Power always on DSL GPIO483(03) Internet GPIO491(11) ETH1 GPIO505(25) ETH2 GPIO506(26) ETH3 GPIO507(27) ETH4 GPIO508(28) USB GPIO490(10) WLAN controlled by BCM43225 WPS GPIO489(09) TEL GPIO511(31) Key RESET GPIO503(23) Key WPS GPIO504(24) Key unnamed GPIO492(12) Signed-off-by: Daniele Castro [Amend commit description, DTS improvements, refresh patches] Signed-off-by: Álvaro Fernández Rojas --- .../bcm63xx/base-files/etc/board.d/01_leds | 1 + .../bcm63xx/base-files/etc/board.d/02_network | 1 + .../base-files/etc/uci-defaults/09_fix_crc | 1 + .../bcm6328-adb-pdg-a4101n-a-000-1a1-ae.dts | 141 ++++++++++++++++++ target/linux/bcm63xx/image/bcm63xx.mk | 12 ++ .../patches-5.4/512-board_bcm6328.patch | 51 ++++++- .../patches-5.4/513-board-bcm6338.patch | 6 +- .../patches-5.4/514-board_bcm6345.patch | 6 +- .../patches-5.4/515-board-bcm6348.patch | 6 +- .../patches-5.4/516-board-bcm6358.patch | 8 +- .../patches-5.4/517-board_bcm6362.patch | 6 +- .../patches-5.4/518-board_bcm6368.patch | 6 +- .../patches-5.4/519-board_bcm63268.patch | 6 +- ...31-board_bcm6348-bt-voyager-2500v-bb.patch | 2 +- 14 files changed, 227 insertions(+), 26 deletions(-) create mode 100644 target/linux/bcm63xx/dts/bcm6328-adb-pdg-a4101n-a-000-1a1-ae.dts diff --git a/target/linux/bcm63xx/base-files/etc/board.d/01_leds b/target/linux/bcm63xx/base-files/etc/board.d/01_leds index bdd6934023..cee71aac47 100755 --- a/target/linux/bcm63xx/base-files/etc/board.d/01_leds +++ b/target/linux/bcm63xx/base-files/etc/board.d/01_leds @@ -14,6 +14,7 @@ actiontec,r1000h) ucidef_set_led_usbport "usb" "USB" "green:usb" "usb1-port1" "usb2-port1" ;; adb,a4001n|\ +adb,pdg-a4101n-a-000-1a1-ae|\ comtrend,ar-5315u|\ comtrend,vr-3032u|\ d-link,dsl-2750u-c1|\ diff --git a/target/linux/bcm63xx/base-files/etc/board.d/02_network b/target/linux/bcm63xx/base-files/etc/board.d/02_network index 711b8f8c00..440a7059e2 100755 --- a/target/linux/bcm63xx/base-files/etc/board.d/02_network +++ b/target/linux/bcm63xx/base-files/etc/board.d/02_network @@ -21,6 +21,7 @@ t-com,speedport-w-500v) adb,a4001n1|\ adb,a4001n|\ adb,pdg-a4001n-a-000-1a1-ax|\ +adb,pdg-a4101n-a-000-1a1-ae|\ adb,av4202n|\ brcm,bcm963281tan|\ brcm,bcm96328avng|\ diff --git a/target/linux/bcm63xx/base-files/etc/uci-defaults/09_fix_crc b/target/linux/bcm63xx/base-files/etc/uci-defaults/09_fix_crc index 6c61f7d38c..89c917839e 100644 --- a/target/linux/bcm63xx/base-files/etc/uci-defaults/09_fix_crc +++ b/target/linux/bcm63xx/base-files/etc/uci-defaults/09_fix_crc @@ -13,6 +13,7 @@ case "$(board_name)" in adb,a4001n|\ adb,a4001n1|\ adb,pdg-a4001n-a-000-1a1-ax|\ + adb,pdg-a4101n-a-000-1a1-ae|\ brcm,bcm96328avng|\ brcm,bcm963281tan|\ bt,voyager-2110|\ diff --git a/target/linux/bcm63xx/dts/bcm6328-adb-pdg-a4101n-a-000-1a1-ae.dts b/target/linux/bcm63xx/dts/bcm6328-adb-pdg-a4101n-a-000-1a1-ae.dts new file mode 100644 index 0000000000..7ffff4e223 --- /dev/null +++ b/target/linux/bcm63xx/dts/bcm6328-adb-pdg-a4101n-a-000-1a1-ae.dts @@ -0,0 +1,141 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "bcm6328.dtsi" + +#include + +/ { + model = "ADB P.DG A4101N A-000-1A1-AE"; + compatible = "adb,pdg-a4101n-a-000-1a1-ae", "brcm,bcm6328"; + + aliases { + led-boot = &led_dsl_green; + led-failsafe = &led_dsl_green; + led-upgrade = &led_dsl_green; + }; + + chosen { + bootargs = "rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; + }; + + keys { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + + wifi { + label = "wifi"; + gpios = <&pinctrl 12 1>; + linux,code = ; + debounce-interval = <60>; + }; + + reset { + label = "reset"; + gpios = <&pinctrl 23 1>; + linux,code = ; + debounce-interval = <60>; + }; + + wps { + label = "wps"; + gpios = <&pinctrl 24 1>; + linux,code = ; + debounce-interval = <60>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led@31 { + label = "green:tel"; + gpios = <&pinctrl 31 1>; + }; + }; +}; + +&leds { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_leds>; + + led_dsl_green: led@3 { + reg = <3>; + active-low; + label = "green:dsl"; + }; + + led@9 { + reg = <9>; + active-low; + label = "green:wps"; + }; + + led@10 { + reg = <10>; + active-low; + label = "green:usb"; + }; + + led@11 { + reg = <11>; + active-low; + label = "green:internet"; + }; +}; + +&hsspi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + spi-max-frequency = <16666667>; + spi-tx-bus-width = <2>; + spi-rx-bus-width = <2>; + reg = <0>; + + #address-cells = <1>; + #size-cells = <1>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + reg = <0x000000 0x010000>; + label = "cfe"; + read-only; + }; + + partition@10000 { + reg = <0x010000 0xff0000>; + label = "linux"; + compatible = "brcm,bcm963xx-imagetag"; + }; + }; + }; +}; + +&pinctrl { + pinctrl_leds: leds { + function = "led"; + pins = "gpio3", "gpio9", "gpio10", + "gpio11"; + }; + + green_internet_switch { + gpio-hog; + gpios = <2 1>; + output-low; + line-name = "green:internet-switch"; + }; +}; + +&uart0 { + status = "okay"; +}; diff --git a/target/linux/bcm63xx/image/bcm63xx.mk b/target/linux/bcm63xx/image/bcm63xx.mk index d3356040d0..c9aacd5ebd 100644 --- a/target/linux/bcm63xx/image/bcm63xx.mk +++ b/target/linux/bcm63xx/image/bcm63xx.mk @@ -237,6 +237,18 @@ define Device/adb_pdg-a4001n-a-000-1a1-ax endef TARGET_DEVICES += adb_pdg-a4001n-a-000-1a1-ax +define Device/adb_pdg-a4101n-a-000-1a1-ae + $(Device/bcm63xx) + DEVICE_VENDOR := ADB + DEVICE_MODEL := P.DG A4101N A-000-1A1-AE + IMAGES += sysupgrade.bin + CFE_BOARD_ID := 96328avngv + CHIP_ID := 6328 + FLASH_MB := 16 + DEVICE_PACKAGES := $(USB2_PACKAGES) $(B43_PACKAGES) +endef +TARGET_DEVICES += adb_pdg-a4101n-a-000-1a1-ae + define Device/adb_av4202n $(Device/bcm63xx) DEVICE_VENDOR := ADB diff --git a/target/linux/bcm63xx/patches-5.4/512-board_bcm6328.patch b/target/linux/bcm63xx/patches-5.4/512-board_bcm6328.patch index 5a2dbdcf85..a8c13dedd9 100644 --- a/target/linux/bcm63xx/patches-5.4/512-board_bcm6328.patch +++ b/target/linux/bcm63xx/patches-5.4/512-board_bcm6328.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -348,6 +348,482 @@ static struct board_info __initdata boar +@@ -348,6 +348,525 @@ static struct board_info __initdata boar }, }, }; @@ -438,6 +438,49 @@ + }, +}; + ++static struct board_info __initdata board_PDG_A4101N_A_000_1A1_AE = { ++ .name = "96328avngv", ++ .expected_cpu_id = 0x6328, ++ ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 1, ++ ++ .has_enetsw = 1, ++ .enetsw = { ++ .used_ports = { ++ [0] = { ++ .used = 1, ++ .phy_id = 1, ++ .name = "Port 1", ++ }, ++ [1] = { ++ .used = 1, ++ .phy_id = 2, ++ .name = "Port 2", ++ }, ++ [2] = { ++ .used = 1, ++ .phy_id = 3, ++ .name = "Port 3", ++ }, ++ [3] = { ++ .used = 1, ++ .phy_id = 4, ++ .name = "Port 4", ++ }, ++ }, ++ }, ++ ++ .use_fallback_sprom = 1, ++ .fallback_sprom = { ++ .type = SPROM_BCM43225, ++ .pci_bus = 1, ++ .pci_dev = 0, ++ }, ++}; ++ +static struct board_info __initdata board_R5010UNV2 = { + .name = "96328ang", + .expected_cpu_id = 0x6328, @@ -483,7 +526,7 @@ #endif /* CONFIG_BCM63XX_CPU_6328 */ /* -@@ -703,6 +1179,16 @@ static const struct board_info __initcon +@@ -703,6 +1222,17 @@ static const struct board_info __initcon #endif /* CONFIG_BCM63XX_CPU_6318 */ #ifdef CONFIG_BCM63XX_CPU_6328 &board_96328avng, @@ -496,17 +539,19 @@ + &board_dsl_274xb_f1, + &board_FAST2704V2, + &board_PDG_A4001N_A_000_1A1_AX, ++ &board_PDG_A4101N_A_000_1A1_AE, + &board_R5010UNV2, #endif /* CONFIG_BCM63XX_CPU_6328 */ #ifdef CONFIG_BCM63XX_CPU_6338 &board_96338gw, -@@ -742,7 +1228,19 @@ static struct of_device_id const bcm963x +@@ -742,7 +1272,20 @@ static struct of_device_id const bcm963x { .compatible = "sagem,fast-2704n", .data = &board_FAST2704N, }, #endif /* CONFIG_BCM63XX_CPU_6318 */ #ifdef CONFIG_BCM63XX_CPU_6328 + { .compatible = "adb,a4001n", .data = &board_A4001N, }, + { .compatible = "adb,a4001n1", .data = &board_A4001N1, }, + { .compatible = "adb,pdg-a4001n-a-000-1a1-ax", .data = &board_PDG_A4001N_A_000_1A1_AX, }, ++ { .compatible = "adb,pdg-a4101n-a-000-1a1-ae", .data = &board_PDG_A4101N_A_000_1A1_AE, }, { .compatible = "brcm,bcm96328avng", .data = &board_96328avng, }, + { .compatible = "brcm,bcm963281tan", .data = &board_963281TAN, }, + { .compatible = "comtrend,ar-5381u", .data = &board_AR5381u, }, diff --git a/target/linux/bcm63xx/patches-5.4/513-board-bcm6338.patch b/target/linux/bcm63xx/patches-5.4/513-board-bcm6338.patch index 8ff2a69707..d8336ee202 100644 --- a/target/linux/bcm63xx/patches-5.4/513-board-bcm6338.patch +++ b/target/linux/bcm63xx/patches-5.4/513-board-bcm6338.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -857,6 +857,32 @@ static struct board_info __initdata boar +@@ -900,6 +900,32 @@ static struct board_info __initdata boar .force_duplex_full = 1, }, }; @@ -33,7 +33,7 @@ #endif /* CONFIG_BCM63XX_CPU_6338 */ /* -@@ -1193,6 +1219,8 @@ static const struct board_info __initcon +@@ -1237,6 +1263,8 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6338 &board_96338gw, &board_96338w, @@ -42,7 +42,7 @@ #endif /* CONFIG_BCM63XX_CPU_6338 */ #ifdef CONFIG_BCM63XX_CPU_6345 &board_96345gw2, -@@ -1245,6 +1273,8 @@ static struct of_device_id const bcm963x +@@ -1290,6 +1318,8 @@ static struct of_device_id const bcm963x #ifdef CONFIG_BCM63XX_CPU_6338 { .compatible = "brcm,bcm96338gw", .data = &board_96338gw, }, { .compatible = "brcm,bcm96338w", .data = &board_96338w, }, diff --git a/target/linux/bcm63xx/patches-5.4/514-board_bcm6345.patch b/target/linux/bcm63xx/patches-5.4/514-board_bcm6345.patch index ca200024c2..e403689375 100644 --- a/target/linux/bcm63xx/patches-5.4/514-board_bcm6345.patch +++ b/target/linux/bcm63xx/patches-5.4/514-board_bcm6345.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -893,6 +893,19 @@ static struct board_info __initdata boar +@@ -936,6 +936,19 @@ static struct board_info __initdata boar .name = "96345GW2", .expected_cpu_id = 0x6345, }; @@ -20,7 +20,7 @@ #endif /* CONFIG_BCM63XX_CPU_6345 */ /* -@@ -1224,6 +1237,7 @@ static const struct board_info __initcon +@@ -1268,6 +1281,7 @@ static const struct board_info __initcon #endif /* CONFIG_BCM63XX_CPU_6338 */ #ifdef CONFIG_BCM63XX_CPU_6345 &board_96345gw2, @@ -28,7 +28,7 @@ #endif /* CONFIG_BCM63XX_CPU_6345 */ #ifdef CONFIG_BCM63XX_CPU_6348 &board_96348r, -@@ -1278,6 +1292,8 @@ static struct of_device_id const bcm963x +@@ -1323,6 +1337,8 @@ static struct of_device_id const bcm963x #endif /* CONFIG_BCM63XX_CPU_6338 */ #ifdef CONFIG_BCM63XX_CPU_6345 { .compatible = "brcm,bcm96345gw2", .data = &board_96345gw2, }, diff --git a/target/linux/bcm63xx/patches-5.4/515-board-bcm6348.patch b/target/linux/bcm63xx/patches-5.4/515-board-bcm6348.patch index eab83113f7..b2b1082b49 100644 --- a/target/linux/bcm63xx/patches-5.4/515-board-bcm6348.patch +++ b/target/linux/bcm63xx/patches-5.4/515-board-bcm6348.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1092,6 +1092,275 @@ static struct board_info __initdata boar +@@ -1135,6 +1135,275 @@ static struct board_info __initdata boar .has_ohci0 = 1, }; @@ -276,7 +276,7 @@ #endif /* CONFIG_BCM63XX_CPU_6348 */ /* -@@ -1248,6 +1517,19 @@ static const struct board_info __initcon +@@ -1292,6 +1561,19 @@ static const struct board_info __initcon &board_DV201AMR, &board_96348gw_a, &board_rta1025w_16, @@ -296,7 +296,7 @@ #endif /* CONFIG_BCM63XX_CPU_6348 */ #ifdef CONFIG_BCM63XX_CPU_6358 &board_96358vw, -@@ -1296,15 +1578,29 @@ static struct of_device_id const bcm963x +@@ -1341,15 +1623,29 @@ static struct of_device_id const bcm963x { .compatible = "dynalink,rta770w", .data = &board_rta770w, }, #endif /* CONFIG_BCM63XX_CPU_6345 */ #ifdef CONFIG_BCM63XX_CPU_6348 diff --git a/target/linux/bcm63xx/patches-5.4/516-board-bcm6358.patch b/target/linux/bcm63xx/patches-5.4/516-board-bcm6358.patch index 4279b0bb13..cb5717f301 100644 --- a/target/linux/bcm63xx/patches-5.4/516-board-bcm6358.patch +++ b/target/linux/bcm63xx/patches-5.4/516-board-bcm6358.patch @@ -8,7 +8,7 @@ #include #include #include -@@ -1445,6 +1446,88 @@ static struct board_info __initdata boar +@@ -1488,6 +1489,88 @@ static struct board_info __initdata boar .has_ehci0 = 1, }; @@ -97,7 +97,7 @@ static struct board_info __initdata board_DWVS0 = { .name = "DWV-S0", .expected_cpu_id = 0x6358, -@@ -1469,6 +1552,238 @@ static struct board_info __initdata boar +@@ -1512,6 +1595,238 @@ static struct board_info __initdata boar .has_ohci0 = 1, .has_ehci0 = 1, }; @@ -336,7 +336,7 @@ #endif /* CONFIG_BCM63XX_CPU_6358 */ /* -@@ -1535,7 +1850,20 @@ static const struct board_info __initcon +@@ -1579,7 +1894,20 @@ static const struct board_info __initcon &board_96358vw, &board_96358vw2, &board_AGPFS0, @@ -357,7 +357,7 @@ #endif /* CONFIG_BCM63XX_CPU_6358 */ }; -@@ -1608,11 +1936,24 @@ static struct of_device_id const bcm963x +@@ -1653,11 +1981,24 @@ static struct of_device_id const bcm963x { .compatible = "alcatel,rg100a", .data = &board_96358vw2, }, { .compatible = "brcm,bcm96358vw", .data = &board_96358vw, }, { .compatible = "brcm,bcm96358vw2", .data = &board_96358vw2, }, diff --git a/target/linux/bcm63xx/patches-5.4/517-board_bcm6362.patch b/target/linux/bcm63xx/patches-5.4/517-board_bcm6362.patch index ac9d76a52f..be59ca14d0 100644 --- a/target/linux/bcm63xx/patches-5.4/517-board_bcm6362.patch +++ b/target/linux/bcm63xx/patches-5.4/517-board_bcm6362.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1786,6 +1786,117 @@ static struct board_info __initdata boar +@@ -1829,6 +1829,117 @@ static struct board_info __initdata boar }; #endif /* CONFIG_BCM63XX_CPU_6358 */ @@ -118,7 +118,7 @@ /* * all boards */ -@@ -1865,6 +1976,12 @@ static const struct board_info __initcon +@@ -1909,6 +2020,12 @@ static const struct board_info __initcon &board_nb4_fxc_r1, &board_spw303v, #endif /* CONFIG_BCM63XX_CPU_6358 */ @@ -131,7 +131,7 @@ }; static struct of_device_id const bcm963xx_boards_dt[] = { -@@ -1956,6 +2073,10 @@ static struct of_device_id const bcm963x +@@ -2001,6 +2118,10 @@ static struct of_device_id const bcm963x { .compatible = "telsey,cpva642", .data = &board_CPVA642, }, #endif /* CONFIG_BCM63XX_CPU_6358 */ #ifdef CONFIG_BCM63XX_CPU_6362 diff --git a/target/linux/bcm63xx/patches-5.4/518-board_bcm6368.patch b/target/linux/bcm63xx/patches-5.4/518-board_bcm6368.patch index 1ba6d5ecd8..dedbf71978 100644 --- a/target/linux/bcm63xx/patches-5.4/518-board_bcm6368.patch +++ b/target/linux/bcm63xx/patches-5.4/518-board_bcm6368.patch @@ -9,7 +9,7 @@ #include #include #include -@@ -1898,6 +1900,648 @@ static struct board_info __initdata boar +@@ -1941,6 +1943,648 @@ static struct board_info __initdata boar #endif /* CONFIG_BCM63XX_CPU_6362 */ /* @@ -658,7 +658,7 @@ * all boards */ static const struct board_info __initconst *bcm963xx_boards[] = { -@@ -1982,6 +2626,22 @@ static const struct board_info __initcon +@@ -2026,6 +2670,22 @@ static const struct board_info __initcon &board_hg253s_v2, &board_nb6, #endif /* CONFIG_BCM63XX_CPU_6362 */ @@ -681,7 +681,7 @@ }; static struct of_device_id const bcm963xx_boards_dt[] = { -@@ -2079,6 +2739,20 @@ static struct of_device_id const bcm963x +@@ -2124,6 +2784,20 @@ static struct of_device_id const bcm963x { .compatible = "sfr,neufbox-6-sercomm-r0", .data = &board_nb6, }, #endif /* CONFIG_BCM63XX_CPU_6362 */ #ifdef CONFIG_BCM63XX_CPU_6368 diff --git a/target/linux/bcm63xx/patches-5.4/519-board_bcm63268.patch b/target/linux/bcm63xx/patches-5.4/519-board_bcm63268.patch index 139f6ad085..30410476b5 100644 --- a/target/linux/bcm63xx/patches-5.4/519-board_bcm63268.patch +++ b/target/linux/bcm63xx/patches-5.4/519-board_bcm63268.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -2542,6 +2542,273 @@ static struct board_info __initdata boar +@@ -2585,6 +2585,273 @@ static struct board_info __initdata boar #endif /* CONFIG_BCM63XX_CPU_6368 */ /* @@ -274,7 +274,7 @@ * all boards */ static const struct board_info __initconst *bcm963xx_boards[] = { -@@ -2642,6 +2909,15 @@ static const struct board_info __initcon +@@ -2686,6 +2953,15 @@ static const struct board_info __initcon &board_VR3026e, &board_WAP5813n, #endif /* CONFIG_BCM63XX_CPU_6368 */ @@ -290,7 +290,7 @@ }; static struct of_device_id const bcm963xx_boards_dt[] = { -@@ -2755,6 +3031,14 @@ static struct of_device_id const bcm963x +@@ -2800,6 +3076,14 @@ static struct of_device_id const bcm963x { .compatible = "zyxel,p870hw-51a-v2", .data = &board_P870HW51A_V2, }, #endif /* CONFIG_BCM63XX_CPU_6368 */ #ifdef CONFIG_BCM63XX_CPU_63268 diff --git a/target/linux/bcm63xx/patches-5.4/531-board_bcm6348-bt-voyager-2500v-bb.patch b/target/linux/bcm63xx/patches-5.4/531-board_bcm6348-bt-voyager-2500v-bb.patch index 9264becf3e..fba3766c74 100644 --- a/target/linux/bcm63xx/patches-5.4/531-board_bcm6348-bt-voyager-2500v-bb.patch +++ b/target/linux/bcm63xx/patches-5.4/531-board_bcm6348-bt-voyager-2500v-bb.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -3067,6 +3067,22 @@ void __init board_bcm963xx_init(void) +@@ -3112,6 +3112,22 @@ void __init board_bcm963xx_init(void) val &= MPI_CSBASE_BASE_MASK; } boot_addr = (u8 *)KSEG1ADDR(val); From 2f75348923e564f1b73fbc32f7cabc355cd6e2b9 Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Sat, 28 Nov 2020 18:06:33 -0300 Subject: [PATCH 14/65] openssl: use --cross-compile-prefix in Configure This sets the --cross-compile-prefix option when running Configure, so that that it will not use the host gcc to figure out, among other things, compiler defines. It avoids errors, if the host 'gcc' is handled by clang: mips-openwrt-linux-musl-gcc: error: unrecognized command-line option '-Qunused-arguments' Signed-off-by: Eneas U de Queiroz Tested-by: Rosen Penev --- package/libs/openssl/Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile index 9696748106..77c6d41cec 100644 --- a/package/libs/openssl/Makefile +++ b/package/libs/openssl/Makefile @@ -11,7 +11,7 @@ PKG_NAME:=openssl PKG_BASE:=1.1.1 PKG_BUGFIX:=h PKG_VERSION:=$(PKG_BASE)$(PKG_BUGFIX) -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_USE_MIPS16:=0 ENGINES_DIR=engines-1.1 @@ -333,6 +333,7 @@ define Build/Configure --prefix=/usr \ --libdir=lib \ --openssldir=/etc/ssl \ + --cross-compile-prefix="$(TARGET_CROSS)" \ $(TARGET_CPPFLAGS) \ $(TARGET_LDFLAGS) \ $(OPENSSL_OPTIONS) && \ @@ -345,14 +346,12 @@ TARGET_LDFLAGS += -Wl,--gc-sections define Build/Compile +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ - CROSS_COMPILE="$(TARGET_CROSS)" \ CC="$(TARGET_CC)" \ SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH) \ OPENWRT_OPTIMIZATION_FLAGS="$(TARGET_CFLAGS)" \ $(OPENSSL_MAKEFLAGS) \ all $(MAKE) -C $(PKG_BUILD_DIR) \ - CROSS_COMPILE="$(TARGET_CROSS)" \ CC="$(TARGET_CC)" \ DESTDIR="$(PKG_INSTALL_DIR)" \ $(OPENSSL_MAKEFLAGS) \ From c143fbc5f1a505f7c108f9b0c7f71517fb5cee50 Mon Sep 17 00:00:00 2001 From: Daniele Castro Date: Tue, 8 Sep 2020 17:16:06 +0200 Subject: [PATCH 15/65] bcm63xx: add support for Technicolor TG582n Telecom Italia branded MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Technicolor TG582n Telecom Italia branded a.k.a. Telecom Italia ADSL2+ Wi-Fi N (AGTWI) has the same PCB as the unbranded Technicolor TG582n with LEDs connected to different GPIO PINs in active low configuration and different LED names. It has a PCB similar to the OpenWrt's ADB P.DG A4001N1 one. Hardware: * Board ID: DANT-V * SoC: Broadcom BCM6328 (rev b0) @ 320MHz, CPU BMIPS4350 * RAM DDR2: 64 Mbyte - EtronTech EM68B16CWQD-25H * Serial flash: 16 Mbyte - Spansion FL 128SAIF00 * Ethernet: 4x Ethernet 10/100 baseT * Wifi 2.4GHz: Broadcom Corporation BCM43227 Wireless Network Adapter (rev 30) * LEDs: 2x Power, 1x ADSL, 2x Internet, 2x Wi-Fi, 2x Service, 4x ethernet * Buttons: 1x Reset, 1x WPS (named WiFi/LED) * UART: 1x TTL 115200n8, VCC GND TX RX, on J3 connector (short R62 and R63) Installation via CFE: * Stock CFE has to be overwritten with a generic 6328 one that can upload .bin images with no signature check (cfe6328_configured.bin) * Connect a serial port to the board * Stop the CFE boot process after power on by pressing enter * Set static IP 192.168.2.10 and subnet mask 255.255.255.0 * Navigate to http://192.168.2.50/ * Upload the OpenWrt image file PCB: |GPIO: |TG582n: |AGTWI: LED2R |488(08) |red Power |red Power LED2G |484(04) |green Power |green Power LED10R |486(06) | |missing R85 end LED LED13G |485(05) |green Ethernet |green ADSL LED11R |494(14) | |red Internet LED14G |491(11) |green Broadband |green Internet LED5R |487(07) |red Internet |red Wi-Fi LED5G |481(01) |green Internet |green Wi-Fi LED12R |498(18) | |red Service LED12G |499(19) | |green Service LED6R |482(02) |red Wi-Fi |missing R108 end LED LED6G |483(03) |green Wi-Fi |missing R107 end LED LED7R |490(10) |red WPS |missing R91 end LED LED7G |489(09) |green WPS |missing R92 end LED LED4 |508(28) |ethernet port 4 |ethernet port 4 LED3 |507(27) |ethernet port 3 |ethernet port 3 LED9 |506(26) |ethernet port 2 |ethernet port 2 LED8 |505(25) |ethernet port 1 |ethernet port 1 SW3 |503(23) |key Reset |key Reset SW5 |504(24) |key WPS |key Wi-Fi/LED SW4 |495(15) |key Wi-Fi |missing R127 end key SW6 |493(13) | |missing R171 end key SW1 |492(12) | |missing R1 end key Signed-off-by: Daniele Castro [DT fixes, base-files fixes and device variant] Signed-off-by: Álvaro Fernández Rojas --- .../bcm63xx/base-files/etc/board.d/01_leds | 5 + .../bcm63xx/base-files/etc/board.d/02_network | 1 + .../base-files/etc/uci-defaults/09_fix_crc | 1 + ...6328-technicolor-tg582n-telecom-italia.dts | 153 ++++++++++++++++++ target/linux/bcm63xx/image/bcm63xx.mk | 14 ++ .../patches-5.4/512-board_bcm6328.patch | 51 +++++- .../patches-5.4/513-board-bcm6338.patch | 6 +- .../patches-5.4/514-board_bcm6345.patch | 6 +- .../patches-5.4/515-board-bcm6348.patch | 6 +- .../patches-5.4/516-board-bcm6358.patch | 8 +- .../patches-5.4/517-board_bcm6362.patch | 6 +- .../patches-5.4/518-board_bcm6368.patch | 6 +- .../patches-5.4/519-board_bcm63268.patch | 6 +- ...31-board_bcm6348-bt-voyager-2500v-bb.patch | 2 +- 14 files changed, 245 insertions(+), 26 deletions(-) create mode 100644 target/linux/bcm63xx/dts/bcm6328-technicolor-tg582n-telecom-italia.dts diff --git a/target/linux/bcm63xx/base-files/etc/board.d/01_leds b/target/linux/bcm63xx/base-files/etc/board.d/01_leds index cee71aac47..5a2a933b0c 100755 --- a/target/linux/bcm63xx/base-files/etc/board.d/01_leds +++ b/target/linux/bcm63xx/base-files/etc/board.d/01_leds @@ -94,6 +94,11 @@ sercomm,h500-s-lowi|\ sercomm,h500-s-vfes) ucidef_set_led_netdev "wan" "WAN" "green:internet" "eth0.2" ;; +technicolor,tg582n-telecom-italia) + ucidef_set_led_netdev "wlan0" "WIFI" "green:wifi" "wlan0" + ucidef_set_led_usbdev "usb1" "USB1" "green:service" "1-1" + ucidef_set_led_usbdev "usb2" "USB2" "red:service" "2-1" + ;; telsey,cpva502plus) ucidef_set_led_netdev "lan" "LAN" "amber:link" "eth0" ;; diff --git a/target/linux/bcm63xx/base-files/etc/board.d/02_network b/target/linux/bcm63xx/base-files/etc/board.d/02_network index 440a7059e2..9c9047b2fb 100755 --- a/target/linux/bcm63xx/base-files/etc/board.d/02_network +++ b/target/linux/bcm63xx/base-files/etc/board.d/02_network @@ -39,6 +39,7 @@ huawei,echolife-hg655b|\ nucom,r5010un-v2|\ sagem,fast-2504n|\ sagem,fast-2704-v2|\ +technicolor,tg582n-telecom-italia|\ zyxel,p870hw-51a-v2) ucidef_add_switch "switch0" \ "0:lan:1" "1:lan:2" "2:lan:3" "3:lan:4" "8t@eth0" diff --git a/target/linux/bcm63xx/base-files/etc/uci-defaults/09_fix_crc b/target/linux/bcm63xx/base-files/etc/uci-defaults/09_fix_crc index 89c917839e..9b94a23eaf 100644 --- a/target/linux/bcm63xx/base-files/etc/uci-defaults/09_fix_crc +++ b/target/linux/bcm63xx/base-files/etc/uci-defaults/09_fix_crc @@ -34,6 +34,7 @@ case "$(board_name)" in nucom,r5010un-v2|\ observa,vh4032n|\ t-com,speedport-w-303v|\ + technicolor,tg582n-telecom-italia|\ telsey,cpva502plus|\ telsey,cpva642|\ telsey,magic|\ diff --git a/target/linux/bcm63xx/dts/bcm6328-technicolor-tg582n-telecom-italia.dts b/target/linux/bcm63xx/dts/bcm6328-technicolor-tg582n-telecom-italia.dts new file mode 100644 index 0000000000..0dfa38e474 --- /dev/null +++ b/target/linux/bcm63xx/dts/bcm6328-technicolor-tg582n-telecom-italia.dts @@ -0,0 +1,153 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "bcm6328.dtsi" + +#include + +/ { + model = "Technicolor TG582n Telecom Italia"; + compatible = "technicolor,tg582n-telecom-italia", "brcm,bcm6328"; + + aliases { + led-boot = &led_power_green; + led-failsafe = &led_power_green; + led-running = &led_power_green; + led-upgrade = &led_power_green; + }; + + chosen { + bootargs = "rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; + }; + + keys { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + + reset { + label = "reset"; + gpios = <&pinctrl 23 1>; + linux,code = ; + debounce-interval = <60>; + }; + + wps { + label = "wps"; + gpios = <&pinctrl 24 1>; + linux,code = ; + debounce-interval = <60>; + }; + }; +}; + +&leds { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_leds>; + + led@1 { + reg = <1>; + active-low; + label = "green:wifi"; + }; + + led_power_green: led@4 { + reg = <4>; + active-low; + label = "green:power"; + default-state = "on"; + }; + + led@5 { + reg = <5>; + active-low; + label = "green:adsl"; + }; + + led@7 { + reg = <7>; + active-low; + label = "red:wifi"; + }; + + led@8 { + reg = <8>; + active-low; + label = "red:power"; + }; + + led@11 { + reg = <11>; + active-low; + label = "green:internet"; + }; + + led@14 { + reg = <14>; + active-low; + label = "red:internet"; + }; + + led@18 { + reg = <18>; + active-low; + label = "red:service"; + }; + + led@19 { + reg = <19>; + active-low; + label = "green:service"; + }; +}; + +&hsspi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + spi-max-frequency = <16666667>; + spi-tx-bus-width = <2>; + spi-rx-bus-width = <2>; + reg = <0>; + + #address-cells = <1>; + #size-cells = <1>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + reg = <0x000000 0x010000>; + label = "cfe"; + read-only; + }; + + partition@10000 { + reg = <0x010000 0xff0000>; + label = "linux"; + compatible = "brcm,bcm963xx-imagetag"; + }; + }; + }; +}; + +&pinctrl { + pinctrl_leds: leds { + function = "led"; + pins = "gpio1", "gpio4", + "gpio5", "gpio7", + "gpio8", "gpio11", + "gpio14", "gpio18", + "gpio19"; + }; +}; + +&uart0 { + status = "okay"; +}; diff --git a/target/linux/bcm63xx/image/bcm63xx.mk b/target/linux/bcm63xx/image/bcm63xx.mk index c9aacd5ebd..81cf98b44b 100644 --- a/target/linux/bcm63xx/image/bcm63xx.mk +++ b/target/linux/bcm63xx/image/bcm63xx.mk @@ -1098,6 +1098,20 @@ define Device/t-com_speedport-w-500v endef TARGET_DEVICES += t-com_speedport-w-500v +### Technicolor ### +define Device/technicolor_tg582n-telecom-italia + $(Device/bcm63xx) + DEVICE_VENDOR := Technicolor + DEVICE_MODEL := TG582n + DEVICE_VARIANT := Telecom Italia + IMAGES += sysupgrade.bin + CFE_BOARD_ID := DANT-V + CHIP_ID := 6328 + FLASH_MB := 16 + DEVICE_PACKAGES := $(USB2_PACKAGES) $(B43_PACKAGES) +endef +TARGET_DEVICES += technicolor_tg582n-telecom-italia + ### Tecom ### define Device/tecom_gw6000 $(Device/bcm63xx-legacy) diff --git a/target/linux/bcm63xx/patches-5.4/512-board_bcm6328.patch b/target/linux/bcm63xx/patches-5.4/512-board_bcm6328.patch index a8c13dedd9..ebe1ac4d94 100644 --- a/target/linux/bcm63xx/patches-5.4/512-board_bcm6328.patch +++ b/target/linux/bcm63xx/patches-5.4/512-board_bcm6328.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -348,6 +348,525 @@ static struct board_info __initdata boar +@@ -348,6 +348,568 @@ static struct board_info __initdata boar }, }, }; @@ -522,11 +522,54 @@ + .pci_bus = 1, + .pci_dev = 0, + }, ++}; ++ ++static struct board_info __initdata board_TG582N_TELECOM_ITALIA = { ++ .name = "DANT-V", ++ .expected_cpu_id = 0x6328, ++ ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 1, ++ ++ .has_enetsw = 1, ++ .enetsw = { ++ .used_ports = { ++ [0] = { ++ .used = 1, ++ .phy_id = 1, ++ .name = "Port 1", ++ }, ++ [1] = { ++ .used = 1, ++ .phy_id = 2, ++ .name = "Port 2", ++ }, ++ [2] = { ++ .used = 1, ++ .phy_id = 3, ++ .name = "Port 3", ++ }, ++ [3] = { ++ .used = 1, ++ .phy_id = 4, ++ .name = "Port 4", ++ }, ++ }, ++ }, ++ ++ .use_fallback_sprom = 1, ++ .fallback_sprom = { ++ .type = SPROM_BCM43225, ++ .pci_bus = 1, ++ .pci_dev = 0, ++ }, +}; #endif /* CONFIG_BCM63XX_CPU_6328 */ /* -@@ -703,6 +1222,17 @@ static const struct board_info __initcon +@@ -703,6 +1265,18 @@ static const struct board_info __initcon #endif /* CONFIG_BCM63XX_CPU_6318 */ #ifdef CONFIG_BCM63XX_CPU_6328 &board_96328avng, @@ -540,11 +583,12 @@ + &board_FAST2704V2, + &board_PDG_A4001N_A_000_1A1_AX, + &board_PDG_A4101N_A_000_1A1_AE, ++ &board_TG582N_TELECOM_ITALIA, + &board_R5010UNV2, #endif /* CONFIG_BCM63XX_CPU_6328 */ #ifdef CONFIG_BCM63XX_CPU_6338 &board_96338gw, -@@ -742,7 +1272,20 @@ static struct of_device_id const bcm963x +@@ -742,7 +1316,21 @@ static struct of_device_id const bcm963x { .compatible = "sagem,fast-2704n", .data = &board_FAST2704N, }, #endif /* CONFIG_BCM63XX_CPU_6318 */ #ifdef CONFIG_BCM63XX_CPU_6328 @@ -562,6 +606,7 @@ + { .compatible = "sagem,fast-2704-v2", .data = &board_FAST2704V2, }, + { .compatible = "sercomm,ad1018", .data = &board_AD1018, }, + { .compatible = "sercomm,ad1018-nor", .data = &board_AD1018, }, ++ { .compatible = "technicolor,tg582n-telecom-italia", .data = &board_TG582N_TELECOM_ITALIA, }, #endif /* CONFIG_BCM63XX_CPU_6328 */ #ifdef CONFIG_BCM63XX_CPU_6338 { .compatible = "brcm,bcm96338gw", .data = &board_96338gw, }, diff --git a/target/linux/bcm63xx/patches-5.4/513-board-bcm6338.patch b/target/linux/bcm63xx/patches-5.4/513-board-bcm6338.patch index d8336ee202..1b3110a2ae 100644 --- a/target/linux/bcm63xx/patches-5.4/513-board-bcm6338.patch +++ b/target/linux/bcm63xx/patches-5.4/513-board-bcm6338.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -900,6 +900,32 @@ static struct board_info __initdata boar +@@ -943,6 +943,32 @@ static struct board_info __initdata boar .force_duplex_full = 1, }, }; @@ -33,7 +33,7 @@ #endif /* CONFIG_BCM63XX_CPU_6338 */ /* -@@ -1237,6 +1263,8 @@ static const struct board_info __initcon +@@ -1281,6 +1307,8 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6338 &board_96338gw, &board_96338w, @@ -42,7 +42,7 @@ #endif /* CONFIG_BCM63XX_CPU_6338 */ #ifdef CONFIG_BCM63XX_CPU_6345 &board_96345gw2, -@@ -1290,6 +1318,8 @@ static struct of_device_id const bcm963x +@@ -1335,6 +1363,8 @@ static struct of_device_id const bcm963x #ifdef CONFIG_BCM63XX_CPU_6338 { .compatible = "brcm,bcm96338gw", .data = &board_96338gw, }, { .compatible = "brcm,bcm96338w", .data = &board_96338w, }, diff --git a/target/linux/bcm63xx/patches-5.4/514-board_bcm6345.patch b/target/linux/bcm63xx/patches-5.4/514-board_bcm6345.patch index e403689375..e037b321ac 100644 --- a/target/linux/bcm63xx/patches-5.4/514-board_bcm6345.patch +++ b/target/linux/bcm63xx/patches-5.4/514-board_bcm6345.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -936,6 +936,19 @@ static struct board_info __initdata boar +@@ -979,6 +979,19 @@ static struct board_info __initdata boar .name = "96345GW2", .expected_cpu_id = 0x6345, }; @@ -20,7 +20,7 @@ #endif /* CONFIG_BCM63XX_CPU_6345 */ /* -@@ -1268,6 +1281,7 @@ static const struct board_info __initcon +@@ -1312,6 +1325,7 @@ static const struct board_info __initcon #endif /* CONFIG_BCM63XX_CPU_6338 */ #ifdef CONFIG_BCM63XX_CPU_6345 &board_96345gw2, @@ -28,7 +28,7 @@ #endif /* CONFIG_BCM63XX_CPU_6345 */ #ifdef CONFIG_BCM63XX_CPU_6348 &board_96348r, -@@ -1323,6 +1337,8 @@ static struct of_device_id const bcm963x +@@ -1368,6 +1382,8 @@ static struct of_device_id const bcm963x #endif /* CONFIG_BCM63XX_CPU_6338 */ #ifdef CONFIG_BCM63XX_CPU_6345 { .compatible = "brcm,bcm96345gw2", .data = &board_96345gw2, }, diff --git a/target/linux/bcm63xx/patches-5.4/515-board-bcm6348.patch b/target/linux/bcm63xx/patches-5.4/515-board-bcm6348.patch index b2b1082b49..c4fe0da97b 100644 --- a/target/linux/bcm63xx/patches-5.4/515-board-bcm6348.patch +++ b/target/linux/bcm63xx/patches-5.4/515-board-bcm6348.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1135,6 +1135,275 @@ static struct board_info __initdata boar +@@ -1178,6 +1178,275 @@ static struct board_info __initdata boar .has_ohci0 = 1, }; @@ -276,7 +276,7 @@ #endif /* CONFIG_BCM63XX_CPU_6348 */ /* -@@ -1292,6 +1561,19 @@ static const struct board_info __initcon +@@ -1336,6 +1605,19 @@ static const struct board_info __initcon &board_DV201AMR, &board_96348gw_a, &board_rta1025w_16, @@ -296,7 +296,7 @@ #endif /* CONFIG_BCM63XX_CPU_6348 */ #ifdef CONFIG_BCM63XX_CPU_6358 &board_96358vw, -@@ -1341,15 +1623,29 @@ static struct of_device_id const bcm963x +@@ -1386,15 +1668,29 @@ static struct of_device_id const bcm963x { .compatible = "dynalink,rta770w", .data = &board_rta770w, }, #endif /* CONFIG_BCM63XX_CPU_6345 */ #ifdef CONFIG_BCM63XX_CPU_6348 diff --git a/target/linux/bcm63xx/patches-5.4/516-board-bcm6358.patch b/target/linux/bcm63xx/patches-5.4/516-board-bcm6358.patch index cb5717f301..4e33123f5a 100644 --- a/target/linux/bcm63xx/patches-5.4/516-board-bcm6358.patch +++ b/target/linux/bcm63xx/patches-5.4/516-board-bcm6358.patch @@ -8,7 +8,7 @@ #include #include #include -@@ -1488,6 +1489,88 @@ static struct board_info __initdata boar +@@ -1531,6 +1532,88 @@ static struct board_info __initdata boar .has_ehci0 = 1, }; @@ -97,7 +97,7 @@ static struct board_info __initdata board_DWVS0 = { .name = "DWV-S0", .expected_cpu_id = 0x6358, -@@ -1512,6 +1595,238 @@ static struct board_info __initdata boar +@@ -1555,6 +1638,238 @@ static struct board_info __initdata boar .has_ohci0 = 1, .has_ehci0 = 1, }; @@ -336,7 +336,7 @@ #endif /* CONFIG_BCM63XX_CPU_6358 */ /* -@@ -1579,7 +1894,20 @@ static const struct board_info __initcon +@@ -1623,7 +1938,20 @@ static const struct board_info __initcon &board_96358vw, &board_96358vw2, &board_AGPFS0, @@ -357,7 +357,7 @@ #endif /* CONFIG_BCM63XX_CPU_6358 */ }; -@@ -1653,11 +1981,24 @@ static struct of_device_id const bcm963x +@@ -1698,11 +2026,24 @@ static struct of_device_id const bcm963x { .compatible = "alcatel,rg100a", .data = &board_96358vw2, }, { .compatible = "brcm,bcm96358vw", .data = &board_96358vw, }, { .compatible = "brcm,bcm96358vw2", .data = &board_96358vw2, }, diff --git a/target/linux/bcm63xx/patches-5.4/517-board_bcm6362.patch b/target/linux/bcm63xx/patches-5.4/517-board_bcm6362.patch index be59ca14d0..18f571c061 100644 --- a/target/linux/bcm63xx/patches-5.4/517-board_bcm6362.patch +++ b/target/linux/bcm63xx/patches-5.4/517-board_bcm6362.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1829,6 +1829,117 @@ static struct board_info __initdata boar +@@ -1872,6 +1872,117 @@ static struct board_info __initdata boar }; #endif /* CONFIG_BCM63XX_CPU_6358 */ @@ -118,7 +118,7 @@ /* * all boards */ -@@ -1909,6 +2020,12 @@ static const struct board_info __initcon +@@ -1953,6 +2064,12 @@ static const struct board_info __initcon &board_nb4_fxc_r1, &board_spw303v, #endif /* CONFIG_BCM63XX_CPU_6358 */ @@ -131,7 +131,7 @@ }; static struct of_device_id const bcm963xx_boards_dt[] = { -@@ -2001,6 +2118,10 @@ static struct of_device_id const bcm963x +@@ -2046,6 +2163,10 @@ static struct of_device_id const bcm963x { .compatible = "telsey,cpva642", .data = &board_CPVA642, }, #endif /* CONFIG_BCM63XX_CPU_6358 */ #ifdef CONFIG_BCM63XX_CPU_6362 diff --git a/target/linux/bcm63xx/patches-5.4/518-board_bcm6368.patch b/target/linux/bcm63xx/patches-5.4/518-board_bcm6368.patch index dedbf71978..181c8fe466 100644 --- a/target/linux/bcm63xx/patches-5.4/518-board_bcm6368.patch +++ b/target/linux/bcm63xx/patches-5.4/518-board_bcm6368.patch @@ -9,7 +9,7 @@ #include #include #include -@@ -1941,6 +1943,648 @@ static struct board_info __initdata boar +@@ -1984,6 +1986,648 @@ static struct board_info __initdata boar #endif /* CONFIG_BCM63XX_CPU_6362 */ /* @@ -658,7 +658,7 @@ * all boards */ static const struct board_info __initconst *bcm963xx_boards[] = { -@@ -2026,6 +2670,22 @@ static const struct board_info __initcon +@@ -2070,6 +2714,22 @@ static const struct board_info __initcon &board_hg253s_v2, &board_nb6, #endif /* CONFIG_BCM63XX_CPU_6362 */ @@ -681,7 +681,7 @@ }; static struct of_device_id const bcm963xx_boards_dt[] = { -@@ -2124,6 +2784,20 @@ static struct of_device_id const bcm963x +@@ -2169,6 +2829,20 @@ static struct of_device_id const bcm963x { .compatible = "sfr,neufbox-6-sercomm-r0", .data = &board_nb6, }, #endif /* CONFIG_BCM63XX_CPU_6362 */ #ifdef CONFIG_BCM63XX_CPU_6368 diff --git a/target/linux/bcm63xx/patches-5.4/519-board_bcm63268.patch b/target/linux/bcm63xx/patches-5.4/519-board_bcm63268.patch index 30410476b5..5737bee24d 100644 --- a/target/linux/bcm63xx/patches-5.4/519-board_bcm63268.patch +++ b/target/linux/bcm63xx/patches-5.4/519-board_bcm63268.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -2585,6 +2585,273 @@ static struct board_info __initdata boar +@@ -2628,6 +2628,273 @@ static struct board_info __initdata boar #endif /* CONFIG_BCM63XX_CPU_6368 */ /* @@ -274,7 +274,7 @@ * all boards */ static const struct board_info __initconst *bcm963xx_boards[] = { -@@ -2686,6 +2953,15 @@ static const struct board_info __initcon +@@ -2730,6 +2997,15 @@ static const struct board_info __initcon &board_VR3026e, &board_WAP5813n, #endif /* CONFIG_BCM63XX_CPU_6368 */ @@ -290,7 +290,7 @@ }; static struct of_device_id const bcm963xx_boards_dt[] = { -@@ -2800,6 +3076,14 @@ static struct of_device_id const bcm963x +@@ -2845,6 +3121,14 @@ static struct of_device_id const bcm963x { .compatible = "zyxel,p870hw-51a-v2", .data = &board_P870HW51A_V2, }, #endif /* CONFIG_BCM63XX_CPU_6368 */ #ifdef CONFIG_BCM63XX_CPU_63268 diff --git a/target/linux/bcm63xx/patches-5.4/531-board_bcm6348-bt-voyager-2500v-bb.patch b/target/linux/bcm63xx/patches-5.4/531-board_bcm6348-bt-voyager-2500v-bb.patch index fba3766c74..ba47e209ac 100644 --- a/target/linux/bcm63xx/patches-5.4/531-board_bcm6348-bt-voyager-2500v-bb.patch +++ b/target/linux/bcm63xx/patches-5.4/531-board_bcm6348-bt-voyager-2500v-bb.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -3112,6 +3112,22 @@ void __init board_bcm963xx_init(void) +@@ -3157,6 +3157,22 @@ void __init board_bcm963xx_init(void) val &= MPI_CSBASE_BASE_MASK; } boot_addr = (u8 *)KSEG1ADDR(val); From 59c2f9eaad5688af523ff60d2f83d5d81447009b Mon Sep 17 00:00:00 2001 From: Daniele Castro Date: Thu, 10 Sep 2020 21:14:11 +0200 Subject: [PATCH 16/65] bcm63xx: add support for Technicolor TG582n MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Technicolor TG582n has a similar PCB as the OpenWrt's ADB P.DG A4001N1 with LEDs connected to different GPIO PINs in active low configuration. Hardware: * Board ID: DANT-1 * SoC: Broadcom BCM6328 (rev b0) @ 320MHz, CPU BMIPS4350 * RAM DDR2: 64 Mbyte - Winbond W9751G6KB-25 * Serial flash: 16 Mbyte - MXIC MX25L6445EMI * Ethernet: 4x Ethernet 10/100 baseT * Wifi 2.4GHz: Broadcom Corporation BCM43227 Wireless Network Adapter (rev 30) * LEDs: 2x Power, 1x Ethernet, 1x Broadband, 2x Wi-Fi, 2x WPS, 4x ethernet * Buttons: 1x Reset, 1x WPS, 1x WiFi * UART: 1x TTL 115200n8, VCC GND TX RX, on J3 connector (short R62 and R63) Installation via CFE: * Stock CFE has to be overwritten with a generic 6328 one that can upload .bin images with no signature check (cfe6328_configured.bin) * Connect a serial port to the board * Stop the CFE boot process after power on by pressing enter * Set static IP 192.168.2.10 and subnet mask 255.255.255.0 * Navigate to http://192.168.2.50/ * Upload the OpenWrt image file PCB: |GPIO: |TG582n: LED2R |488(08) |red Power LED2G |484(04) |green Power LED10R |486(06) | LED13G |485(05) |green Ethernet LED11R |494(14) | LED14G |491(11) |green Broadband LED5R |487(07) |red Internet LED5G |481(01) |green Internet LED12R |498(18) | LED12G |499(19) | LED6R |482(02) |red Wi-Fi LED6G |483(03) |green Wi-Fi LED7R |490(10) |red WPS LED7G |489(09) |green WPS LED4 |508(28) |ethernet port 4 LED3 |507(27) |ethernet port 3 LED9 |506(26) |ethernet port 2 LED8 |505(25) |ethernet port 1 SW3 |503(23) |key Reset SW5 |504(24) |key WPS SW4 |495(15) |key Wi-Fi SW6 |493(13) | SW1 |492(12) | Signed-off-by: Daniele Castro [Fix base-files, refresh patch] Signed-off-by: Álvaro Fernández Rojas --- .../bcm63xx/base-files/etc/board.d/01_leds | 4 + .../bcm63xx/base-files/etc/board.d/02_network | 1 + .../base-files/etc/uci-defaults/09_fix_crc | 1 + .../dts/bcm6328-technicolor-tg582n.dts | 166 ++++++++++++++++++ target/linux/bcm63xx/image/bcm63xx.mk | 12 ++ .../patches-5.4/512-board_bcm6328.patch | 51 +++++- .../patches-5.4/513-board-bcm6338.patch | 6 +- .../patches-5.4/514-board_bcm6345.patch | 6 +- .../patches-5.4/515-board-bcm6348.patch | 6 +- .../patches-5.4/516-board-bcm6358.patch | 8 +- .../patches-5.4/517-board_bcm6362.patch | 6 +- .../patches-5.4/518-board_bcm6368.patch | 6 +- .../patches-5.4/519-board_bcm63268.patch | 6 +- ...31-board_bcm6348-bt-voyager-2500v-bb.patch | 2 +- 14 files changed, 255 insertions(+), 26 deletions(-) create mode 100644 target/linux/bcm63xx/dts/bcm6328-technicolor-tg582n.dts diff --git a/target/linux/bcm63xx/base-files/etc/board.d/01_leds b/target/linux/bcm63xx/base-files/etc/board.d/01_leds index 5a2a933b0c..299bb117e9 100755 --- a/target/linux/bcm63xx/base-files/etc/board.d/01_leds +++ b/target/linux/bcm63xx/base-files/etc/board.d/01_leds @@ -94,6 +94,10 @@ sercomm,h500-s-lowi|\ sercomm,h500-s-vfes) ucidef_set_led_netdev "wan" "WAN" "green:internet" "eth0.2" ;; +technicolor,tg582n) + ucidef_set_led_netdev "wlan0" "WIFI" "green:wifi" "wlan0" + ucidef_set_led_usbdev "usb" "USB" "red:power" "1-1" + ;; technicolor,tg582n-telecom-italia) ucidef_set_led_netdev "wlan0" "WIFI" "green:wifi" "wlan0" ucidef_set_led_usbdev "usb1" "USB1" "green:service" "1-1" diff --git a/target/linux/bcm63xx/base-files/etc/board.d/02_network b/target/linux/bcm63xx/base-files/etc/board.d/02_network index 9c9047b2fb..700439ec36 100755 --- a/target/linux/bcm63xx/base-files/etc/board.d/02_network +++ b/target/linux/bcm63xx/base-files/etc/board.d/02_network @@ -39,6 +39,7 @@ huawei,echolife-hg655b|\ nucom,r5010un-v2|\ sagem,fast-2504n|\ sagem,fast-2704-v2|\ +technicolor,tg582n|\ technicolor,tg582n-telecom-italia|\ zyxel,p870hw-51a-v2) ucidef_add_switch "switch0" \ diff --git a/target/linux/bcm63xx/base-files/etc/uci-defaults/09_fix_crc b/target/linux/bcm63xx/base-files/etc/uci-defaults/09_fix_crc index 9b94a23eaf..a176eb1735 100644 --- a/target/linux/bcm63xx/base-files/etc/uci-defaults/09_fix_crc +++ b/target/linux/bcm63xx/base-files/etc/uci-defaults/09_fix_crc @@ -34,6 +34,7 @@ case "$(board_name)" in nucom,r5010un-v2|\ observa,vh4032n|\ t-com,speedport-w-303v|\ + technicolor,tg582n|\ technicolor,tg582n-telecom-italia|\ telsey,cpva502plus|\ telsey,cpva642|\ diff --git a/target/linux/bcm63xx/dts/bcm6328-technicolor-tg582n.dts b/target/linux/bcm63xx/dts/bcm6328-technicolor-tg582n.dts new file mode 100644 index 0000000000..6ec20048cd --- /dev/null +++ b/target/linux/bcm63xx/dts/bcm6328-technicolor-tg582n.dts @@ -0,0 +1,166 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "bcm6328.dtsi" + +#include + +/ { + model = "Technicolor TG582n"; + compatible = "technicolor,tg582n", "brcm,bcm6328"; + + aliases { + led-boot = &led_power_green; + led-failsafe = &led_power_green; + led-running = &led_power_green; + led-upgrade = &led_power_green; + }; + + chosen { + bootargs = "rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; + }; + + keys { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + + wifi { + label = "wifi"; + gpios = <&pinctrl 15 1>; + linux,code = ; + debounce-interval = <60>; + }; + + reset { + label = "reset"; + gpios = <&pinctrl 23 1>; + linux,code = ; + debounce-interval = <60>; + }; + + wps { + label = "wps"; + gpios = <&pinctrl 24 1>; + linux,code = ; + debounce-interval = <60>; + }; + }; +}; + +&leds { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_leds>; + + led@1 { + reg = <1>; + active-low; + label = "green:internet"; + }; + + led@2 { + reg = <2>; + active-low; + label = "red:wifi"; + }; + + led@3 { + reg = <3>; + active-low; + label = "green:wifi"; + }; + + led_power_green: led@4 { + reg = <4>; + active-low; + label = "green:power"; + default-state = "on"; + }; + + led@5 { + reg = <5>; + active-low; + label = "green:ethernet"; + }; + + led@7 { + reg = <7>; + active-low; + label = "red:internet"; + }; + + led@8 { + reg = <8>; + active-low; + label = "red:power"; + }; + + led@9 { + reg = <9>; + active-low; + label = "green:wps"; + }; + + led@10 { + reg = <10>; + active-low; + label = "red:wps"; + }; + + led@11 { + reg = <11>; + active-low; + label = "green:broadband"; + }; +}; + +&hsspi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + spi-max-frequency = <16666667>; + spi-tx-bus-width = <2>; + spi-rx-bus-width = <2>; + reg = <0>; + + #address-cells = <1>; + #size-cells = <1>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + reg = <0x000000 0x010000>; + label = "cfe"; + read-only; + }; + + partition@10000 { + reg = <0x010000 0xff0000>; + label = "linux"; + compatible = "brcm,bcm963xx-imagetag"; + }; + }; + }; +}; + +&pinctrl { + pinctrl_leds: leds { + function = "led"; + pins = "gpio1", "gpio2", + "gpio3", "gpio4", + "gpio5", "gpio7", + "gpio8", "gpio9", + "gpio10", "gpio11"; + }; +}; + +&uart0 { + status = "okay"; +}; diff --git a/target/linux/bcm63xx/image/bcm63xx.mk b/target/linux/bcm63xx/image/bcm63xx.mk index 81cf98b44b..773f098dea 100644 --- a/target/linux/bcm63xx/image/bcm63xx.mk +++ b/target/linux/bcm63xx/image/bcm63xx.mk @@ -1099,6 +1099,18 @@ endef TARGET_DEVICES += t-com_speedport-w-500v ### Technicolor ### +define Device/technicolor_tg582n + $(Device/bcm63xx) + DEVICE_VENDOR := Technicolor + DEVICE_MODEL := TG582n + IMAGES += sysupgrade.bin + CFE_BOARD_ID := DANT-1 + CHIP_ID := 6328 + FLASH_MB := 16 + DEVICE_PACKAGES := $(USB2_PACKAGES) $(B43_PACKAGES) +endef +TARGET_DEVICES += technicolor_tg582n + define Device/technicolor_tg582n-telecom-italia $(Device/bcm63xx) DEVICE_VENDOR := Technicolor diff --git a/target/linux/bcm63xx/patches-5.4/512-board_bcm6328.patch b/target/linux/bcm63xx/patches-5.4/512-board_bcm6328.patch index ebe1ac4d94..ae0c538660 100644 --- a/target/linux/bcm63xx/patches-5.4/512-board_bcm6328.patch +++ b/target/linux/bcm63xx/patches-5.4/512-board_bcm6328.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -348,6 +348,568 @@ static struct board_info __initdata boar +@@ -348,6 +348,611 @@ static struct board_info __initdata boar }, }, }; @@ -524,6 +524,49 @@ + }, +}; + ++static struct board_info __initdata board_TG582N = { ++ .name = "DANT-1", ++ .expected_cpu_id = 0x6328, ++ ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 1, ++ ++ .has_enetsw = 1, ++ .enetsw = { ++ .used_ports = { ++ [0] = { ++ .used = 1, ++ .phy_id = 1, ++ .name = "Port 1", ++ }, ++ [1] = { ++ .used = 1, ++ .phy_id = 2, ++ .name = "Port 2", ++ }, ++ [2] = { ++ .used = 1, ++ .phy_id = 3, ++ .name = "Port 3", ++ }, ++ [3] = { ++ .used = 1, ++ .phy_id = 4, ++ .name = "Port 4", ++ }, ++ }, ++ }, ++ ++ .use_fallback_sprom = 1, ++ .fallback_sprom = { ++ .type = SPROM_BCM43225, ++ .pci_bus = 1, ++ .pci_dev = 0, ++ }, ++}; ++ +static struct board_info __initdata board_TG582N_TELECOM_ITALIA = { + .name = "DANT-V", + .expected_cpu_id = 0x6328, @@ -569,7 +612,7 @@ #endif /* CONFIG_BCM63XX_CPU_6328 */ /* -@@ -703,6 +1265,18 @@ static const struct board_info __initcon +@@ -703,6 +1308,19 @@ static const struct board_info __initcon #endif /* CONFIG_BCM63XX_CPU_6318 */ #ifdef CONFIG_BCM63XX_CPU_6328 &board_96328avng, @@ -583,12 +626,13 @@ + &board_FAST2704V2, + &board_PDG_A4001N_A_000_1A1_AX, + &board_PDG_A4101N_A_000_1A1_AE, ++ &board_TG582N, + &board_TG582N_TELECOM_ITALIA, + &board_R5010UNV2, #endif /* CONFIG_BCM63XX_CPU_6328 */ #ifdef CONFIG_BCM63XX_CPU_6338 &board_96338gw, -@@ -742,7 +1316,21 @@ static struct of_device_id const bcm963x +@@ -742,7 +1360,22 @@ static struct of_device_id const bcm963x { .compatible = "sagem,fast-2704n", .data = &board_FAST2704N, }, #endif /* CONFIG_BCM63XX_CPU_6318 */ #ifdef CONFIG_BCM63XX_CPU_6328 @@ -606,6 +650,7 @@ + { .compatible = "sagem,fast-2704-v2", .data = &board_FAST2704V2, }, + { .compatible = "sercomm,ad1018", .data = &board_AD1018, }, + { .compatible = "sercomm,ad1018-nor", .data = &board_AD1018, }, ++ { .compatible = "technicolor,tg582n", .data = &board_TG582N, }, + { .compatible = "technicolor,tg582n-telecom-italia", .data = &board_TG582N_TELECOM_ITALIA, }, #endif /* CONFIG_BCM63XX_CPU_6328 */ #ifdef CONFIG_BCM63XX_CPU_6338 diff --git a/target/linux/bcm63xx/patches-5.4/513-board-bcm6338.patch b/target/linux/bcm63xx/patches-5.4/513-board-bcm6338.patch index 1b3110a2ae..9319f974ac 100644 --- a/target/linux/bcm63xx/patches-5.4/513-board-bcm6338.patch +++ b/target/linux/bcm63xx/patches-5.4/513-board-bcm6338.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -943,6 +943,32 @@ static struct board_info __initdata boar +@@ -986,6 +986,32 @@ static struct board_info __initdata boar .force_duplex_full = 1, }, }; @@ -33,7 +33,7 @@ #endif /* CONFIG_BCM63XX_CPU_6338 */ /* -@@ -1281,6 +1307,8 @@ static const struct board_info __initcon +@@ -1325,6 +1351,8 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6338 &board_96338gw, &board_96338w, @@ -42,7 +42,7 @@ #endif /* CONFIG_BCM63XX_CPU_6338 */ #ifdef CONFIG_BCM63XX_CPU_6345 &board_96345gw2, -@@ -1335,6 +1363,8 @@ static struct of_device_id const bcm963x +@@ -1380,6 +1408,8 @@ static struct of_device_id const bcm963x #ifdef CONFIG_BCM63XX_CPU_6338 { .compatible = "brcm,bcm96338gw", .data = &board_96338gw, }, { .compatible = "brcm,bcm96338w", .data = &board_96338w, }, diff --git a/target/linux/bcm63xx/patches-5.4/514-board_bcm6345.patch b/target/linux/bcm63xx/patches-5.4/514-board_bcm6345.patch index e037b321ac..3b1f2842b5 100644 --- a/target/linux/bcm63xx/patches-5.4/514-board_bcm6345.patch +++ b/target/linux/bcm63xx/patches-5.4/514-board_bcm6345.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -979,6 +979,19 @@ static struct board_info __initdata boar +@@ -1022,6 +1022,19 @@ static struct board_info __initdata boar .name = "96345GW2", .expected_cpu_id = 0x6345, }; @@ -20,7 +20,7 @@ #endif /* CONFIG_BCM63XX_CPU_6345 */ /* -@@ -1312,6 +1325,7 @@ static const struct board_info __initcon +@@ -1356,6 +1369,7 @@ static const struct board_info __initcon #endif /* CONFIG_BCM63XX_CPU_6338 */ #ifdef CONFIG_BCM63XX_CPU_6345 &board_96345gw2, @@ -28,7 +28,7 @@ #endif /* CONFIG_BCM63XX_CPU_6345 */ #ifdef CONFIG_BCM63XX_CPU_6348 &board_96348r, -@@ -1368,6 +1382,8 @@ static struct of_device_id const bcm963x +@@ -1413,6 +1427,8 @@ static struct of_device_id const bcm963x #endif /* CONFIG_BCM63XX_CPU_6338 */ #ifdef CONFIG_BCM63XX_CPU_6345 { .compatible = "brcm,bcm96345gw2", .data = &board_96345gw2, }, diff --git a/target/linux/bcm63xx/patches-5.4/515-board-bcm6348.patch b/target/linux/bcm63xx/patches-5.4/515-board-bcm6348.patch index c4fe0da97b..eb3eb26dd0 100644 --- a/target/linux/bcm63xx/patches-5.4/515-board-bcm6348.patch +++ b/target/linux/bcm63xx/patches-5.4/515-board-bcm6348.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1178,6 +1178,275 @@ static struct board_info __initdata boar +@@ -1221,6 +1221,275 @@ static struct board_info __initdata boar .has_ohci0 = 1, }; @@ -276,7 +276,7 @@ #endif /* CONFIG_BCM63XX_CPU_6348 */ /* -@@ -1336,6 +1605,19 @@ static const struct board_info __initcon +@@ -1380,6 +1649,19 @@ static const struct board_info __initcon &board_DV201AMR, &board_96348gw_a, &board_rta1025w_16, @@ -296,7 +296,7 @@ #endif /* CONFIG_BCM63XX_CPU_6348 */ #ifdef CONFIG_BCM63XX_CPU_6358 &board_96358vw, -@@ -1386,15 +1668,29 @@ static struct of_device_id const bcm963x +@@ -1431,15 +1713,29 @@ static struct of_device_id const bcm963x { .compatible = "dynalink,rta770w", .data = &board_rta770w, }, #endif /* CONFIG_BCM63XX_CPU_6345 */ #ifdef CONFIG_BCM63XX_CPU_6348 diff --git a/target/linux/bcm63xx/patches-5.4/516-board-bcm6358.patch b/target/linux/bcm63xx/patches-5.4/516-board-bcm6358.patch index 4e33123f5a..6af94bdbe0 100644 --- a/target/linux/bcm63xx/patches-5.4/516-board-bcm6358.patch +++ b/target/linux/bcm63xx/patches-5.4/516-board-bcm6358.patch @@ -8,7 +8,7 @@ #include #include #include -@@ -1531,6 +1532,88 @@ static struct board_info __initdata boar +@@ -1574,6 +1575,88 @@ static struct board_info __initdata boar .has_ehci0 = 1, }; @@ -97,7 +97,7 @@ static struct board_info __initdata board_DWVS0 = { .name = "DWV-S0", .expected_cpu_id = 0x6358, -@@ -1555,6 +1638,238 @@ static struct board_info __initdata boar +@@ -1598,6 +1681,238 @@ static struct board_info __initdata boar .has_ohci0 = 1, .has_ehci0 = 1, }; @@ -336,7 +336,7 @@ #endif /* CONFIG_BCM63XX_CPU_6358 */ /* -@@ -1623,7 +1938,20 @@ static const struct board_info __initcon +@@ -1667,7 +1982,20 @@ static const struct board_info __initcon &board_96358vw, &board_96358vw2, &board_AGPFS0, @@ -357,7 +357,7 @@ #endif /* CONFIG_BCM63XX_CPU_6358 */ }; -@@ -1698,11 +2026,24 @@ static struct of_device_id const bcm963x +@@ -1743,11 +2071,24 @@ static struct of_device_id const bcm963x { .compatible = "alcatel,rg100a", .data = &board_96358vw2, }, { .compatible = "brcm,bcm96358vw", .data = &board_96358vw, }, { .compatible = "brcm,bcm96358vw2", .data = &board_96358vw2, }, diff --git a/target/linux/bcm63xx/patches-5.4/517-board_bcm6362.patch b/target/linux/bcm63xx/patches-5.4/517-board_bcm6362.patch index 18f571c061..c917914dd1 100644 --- a/target/linux/bcm63xx/patches-5.4/517-board_bcm6362.patch +++ b/target/linux/bcm63xx/patches-5.4/517-board_bcm6362.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1872,6 +1872,117 @@ static struct board_info __initdata boar +@@ -1915,6 +1915,117 @@ static struct board_info __initdata boar }; #endif /* CONFIG_BCM63XX_CPU_6358 */ @@ -118,7 +118,7 @@ /* * all boards */ -@@ -1953,6 +2064,12 @@ static const struct board_info __initcon +@@ -1997,6 +2108,12 @@ static const struct board_info __initcon &board_nb4_fxc_r1, &board_spw303v, #endif /* CONFIG_BCM63XX_CPU_6358 */ @@ -131,7 +131,7 @@ }; static struct of_device_id const bcm963xx_boards_dt[] = { -@@ -2046,6 +2163,10 @@ static struct of_device_id const bcm963x +@@ -2091,6 +2208,10 @@ static struct of_device_id const bcm963x { .compatible = "telsey,cpva642", .data = &board_CPVA642, }, #endif /* CONFIG_BCM63XX_CPU_6358 */ #ifdef CONFIG_BCM63XX_CPU_6362 diff --git a/target/linux/bcm63xx/patches-5.4/518-board_bcm6368.patch b/target/linux/bcm63xx/patches-5.4/518-board_bcm6368.patch index 181c8fe466..31d724ca24 100644 --- a/target/linux/bcm63xx/patches-5.4/518-board_bcm6368.patch +++ b/target/linux/bcm63xx/patches-5.4/518-board_bcm6368.patch @@ -9,7 +9,7 @@ #include #include #include -@@ -1984,6 +1986,648 @@ static struct board_info __initdata boar +@@ -2027,6 +2029,648 @@ static struct board_info __initdata boar #endif /* CONFIG_BCM63XX_CPU_6362 */ /* @@ -658,7 +658,7 @@ * all boards */ static const struct board_info __initconst *bcm963xx_boards[] = { -@@ -2070,6 +2714,22 @@ static const struct board_info __initcon +@@ -2114,6 +2758,22 @@ static const struct board_info __initcon &board_hg253s_v2, &board_nb6, #endif /* CONFIG_BCM63XX_CPU_6362 */ @@ -681,7 +681,7 @@ }; static struct of_device_id const bcm963xx_boards_dt[] = { -@@ -2169,6 +2829,20 @@ static struct of_device_id const bcm963x +@@ -2214,6 +2874,20 @@ static struct of_device_id const bcm963x { .compatible = "sfr,neufbox-6-sercomm-r0", .data = &board_nb6, }, #endif /* CONFIG_BCM63XX_CPU_6362 */ #ifdef CONFIG_BCM63XX_CPU_6368 diff --git a/target/linux/bcm63xx/patches-5.4/519-board_bcm63268.patch b/target/linux/bcm63xx/patches-5.4/519-board_bcm63268.patch index 5737bee24d..20fbf5e68e 100644 --- a/target/linux/bcm63xx/patches-5.4/519-board_bcm63268.patch +++ b/target/linux/bcm63xx/patches-5.4/519-board_bcm63268.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -2628,6 +2628,273 @@ static struct board_info __initdata boar +@@ -2671,6 +2671,273 @@ static struct board_info __initdata boar #endif /* CONFIG_BCM63XX_CPU_6368 */ /* @@ -274,7 +274,7 @@ * all boards */ static const struct board_info __initconst *bcm963xx_boards[] = { -@@ -2730,6 +2997,15 @@ static const struct board_info __initcon +@@ -2774,6 +3041,15 @@ static const struct board_info __initcon &board_VR3026e, &board_WAP5813n, #endif /* CONFIG_BCM63XX_CPU_6368 */ @@ -290,7 +290,7 @@ }; static struct of_device_id const bcm963xx_boards_dt[] = { -@@ -2845,6 +3121,14 @@ static struct of_device_id const bcm963x +@@ -2890,6 +3166,14 @@ static struct of_device_id const bcm963x { .compatible = "zyxel,p870hw-51a-v2", .data = &board_P870HW51A_V2, }, #endif /* CONFIG_BCM63XX_CPU_6368 */ #ifdef CONFIG_BCM63XX_CPU_63268 diff --git a/target/linux/bcm63xx/patches-5.4/531-board_bcm6348-bt-voyager-2500v-bb.patch b/target/linux/bcm63xx/patches-5.4/531-board_bcm6348-bt-voyager-2500v-bb.patch index ba47e209ac..23fefee97a 100644 --- a/target/linux/bcm63xx/patches-5.4/531-board_bcm6348-bt-voyager-2500v-bb.patch +++ b/target/linux/bcm63xx/patches-5.4/531-board_bcm6348-bt-voyager-2500v-bb.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -3157,6 +3157,22 @@ void __init board_bcm963xx_init(void) +@@ -3202,6 +3202,22 @@ void __init board_bcm963xx_init(void) val &= MPI_CSBASE_BASE_MASK; } boot_addr = (u8 *)KSEG1ADDR(val); From 3d8cb2300e578d50f86a758a5e8bb74ebf25afa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Sun, 6 Dec 2020 19:20:04 +0100 Subject: [PATCH 17/65] bcm63xx: fix ADB P.DG A4001N A-000-1A1-AX LEDs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There's no eth0.2 since all ethernet ports as configured as LAN. LAN LED is unneeded since all ethernet ports have their own LED. Signed-off-by: Álvaro Fernández Rojas --- target/linux/bcm63xx/base-files/etc/board.d/01_leds | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/target/linux/bcm63xx/base-files/etc/board.d/01_leds b/target/linux/bcm63xx/base-files/etc/board.d/01_leds index 299bb117e9..fe8a54f5d8 100755 --- a/target/linux/bcm63xx/base-files/etc/board.d/01_leds +++ b/target/linux/bcm63xx/base-files/etc/board.d/01_leds @@ -27,9 +27,8 @@ adb,a4001n1) ucidef_set_led_netdev "lan" "LAN" "green:eth" "eth0" ucidef_set_led_usbdev "usb" "USB" "green:3g" "1-1" ;; -adb,pdg-a4001n-a-000-1a1-ax) - ucidef_set_led_netdev "lan" "LAN" "green:internet" "eth0.1" - ucidef_set_led_netdev "wan" "WAN" "green:adsl" "eth0.2" +adb,pdg-a4001n-a-000-1a1-ax|\ +technicolor,tg582n-telecom-italia) ucidef_set_led_netdev "wlan0" "WIFI" "green:wifi" "wlan0" ucidef_set_led_usbdev "usb1" "USB1" "green:service" "1-1" ucidef_set_led_usbdev "usb2" "USB2" "red:service" "2-1" @@ -98,11 +97,6 @@ technicolor,tg582n) ucidef_set_led_netdev "wlan0" "WIFI" "green:wifi" "wlan0" ucidef_set_led_usbdev "usb" "USB" "red:power" "1-1" ;; -technicolor,tg582n-telecom-italia) - ucidef_set_led_netdev "wlan0" "WIFI" "green:wifi" "wlan0" - ucidef_set_led_usbdev "usb1" "USB1" "green:service" "1-1" - ucidef_set_led_usbdev "usb2" "USB2" "red:service" "2-1" - ;; telsey,cpva502plus) ucidef_set_led_netdev "lan" "LAN" "amber:link" "eth0" ;; From ce5bcff304e474d604ac0e25de7b6b124f764351 Mon Sep 17 00:00:00 2001 From: Nick Lowe Date: Fri, 4 Dec 2020 17:47:47 +0000 Subject: [PATCH 18/65] hostapd: Disable 802.11b data rates by default Set legacy_rates to 0 by default to disable 802.11b data rates by default. The time has long come where 802.11b DSSS/CCK data rates should be disabled by default in OpenWRT. Users in need of 802.11b client support can reasonably enable these where they are needed. The balance of equities has significantly, and for a long time, tipped such that dropping backwards compatibility by default with 802.11b devices is appropriate, proportionate and justified. By doing so, management and control traffic is moved by default to a 20 MHz wide 6 Mb/s OFDM data rate instead of a 22 MHz wide 1 Mb/s DSSS data rate. This is significantly more airtime efficient. Signed-off-by: Nick Lowe --- package/network/services/hostapd/Makefile | 2 +- package/network/services/hostapd/files/hostapd.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index 1e20b56200..61b2a548ef 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hostapd -PKG_RELEASE:=17 +PKG_RELEASE:=18 PKG_SOURCE_URL:=http://w1.fi/hostap.git PKG_SOURCE_PROTO:=git diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index a41254d6db..41b04e6029 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -123,7 +123,7 @@ hostapd_prepare_device_config() { set_default country_ie 1 set_default spectrum_mgmt_required 0 set_default doth 1 - set_default legacy_rates 1 + set_default legacy_rates 0 set_default airtime_mode 0 set_default cell_density 0 From e273c1715baacca25262d8b997258098e02a616d Mon Sep 17 00:00:00 2001 From: Rui Salvaterra Date: Tue, 27 Oct 2020 09:42:31 +0000 Subject: [PATCH 19/65] kernel: kmod-lib-zstd: enable crypto API support Zstd is supported by the crypto API since Linux 4.18. Enable this feature and reveal the package in the configuration section, so the user can select it. This allows zstd to be used as a compression algorithm in zram, for example. Signed-off-by: Rui Salvaterra --- package/kernel/linux/modules/lib.mk | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/package/kernel/linux/modules/lib.mk b/package/kernel/linux/modules/lib.mk index 43d3ca5538..9a341932bd 100644 --- a/package/kernel/linux/modules/lib.mk +++ b/package/kernel/linux/modules/lib.mk @@ -124,16 +124,18 @@ $(eval $(call KernelPackage,lib-lzo)) define KernelPackage/lib-zstd SUBMENU:=$(LIB_MENU) TITLE:=ZSTD support + DEPENDS:=+kmod-crypto-acompress KCONFIG:= \ + CONFIG_CRYPTO_ZSTD \ CONFIG_ZSTD_COMPRESS \ CONFIG_ZSTD_DECOMPRESS \ CONFIG_XXHASH - HIDDEN:=1 FILES:= \ + $(LINUX_DIR)/crypto/zstd.ko \ $(LINUX_DIR)/lib/xxhash.ko \ $(LINUX_DIR)/lib/zstd/zstd_compress.ko \ $(LINUX_DIR)/lib/zstd/zstd_decompress.ko - AUTOLOAD:=$(call AutoProbe,xxhash zstd_compress zstd_decompress) + AUTOLOAD:=$(call AutoProbe,xxhash zstd zstd_compress zstd_decompress) endef define KernelPackage/lib-zstd/description From 0afc629c831d2867bc289a666bd624139d17eacc Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 6 Dec 2020 00:36:05 -0800 Subject: [PATCH 20/65] mtd-utils: remove lzo build dependency The build option `--withouth-lzo` is added in the Makefile which makes the existence of lzo obsolete. To remove the lzo package from openwrt.git entirely, remove the legacy dependency. Signed-off-by: Rosen Penev [improved commit message] Signed-off-by: Paul Spooren --- package/utils/mtd-utils/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/utils/mtd-utils/Makefile b/package/utils/mtd-utils/Makefile index 6e5e72783f..5a4b03da96 100644 --- a/package/utils/mtd-utils/Makefile +++ b/package/utils/mtd-utils/Makefile @@ -20,7 +20,7 @@ PKG_FIXUP:=autoreconf PKG_FLAGS:=nonshared -PKG_BUILD_DEPENDS:=util-linux lzo zlib +PKG_BUILD_DEPENDS:=util-linux PKG_LICENSE:=GPLv2 PKG_LICENSE_FILES:= From 588933ae9a7651b53dc5fbc51b84218b6b8004fc Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 4 Dec 2020 19:20:14 -0800 Subject: [PATCH 21/65] lzo: remove This is not used by any package in base. It will be moved to packages. Signed-off-by: Rosen Penev --- package/libs/lzo/Makefile | 61 --------------------------------------- 1 file changed, 61 deletions(-) delete mode 100644 package/libs/lzo/Makefile diff --git a/package/libs/lzo/Makefile b/package/libs/lzo/Makefile deleted file mode 100644 index 09885e8d9b..0000000000 --- a/package/libs/lzo/Makefile +++ /dev/null @@ -1,61 +0,0 @@ -# -# Copyright (C) 2006-2016 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=lzo -PKG_VERSION:=2.10 -PKG_RELEASE:=4 - -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=http://www.oberhumer.com/opensource/lzo/download/ -PKG_HASH:=c0f892943208266f9b6543b3ae308fab6284c5c90e627931446fb49b4221a072 - -PKG_LICENSE:=GPL-2.0-or-later -PKG_LICENSE_FILES:=COPYING - -PKG_BUILD_PARALLEL:=1 -CMAKE_BINARY_SUBDIR:=openwrt-build - -include $(INCLUDE_DIR)/package.mk -include $(INCLUDE_DIR)/cmake.mk - -define Package/liblzo - SECTION:=libs - CATEGORY:=Libraries - TITLE:=A real-time data compression library - URL:=http://www.oberhumer.com/opensource/lzo/ - ABI_VERSION:=2 -endef - -define Package/liblzo/description - LZO is a data compression library which is suitable for data de-/compression - in real-time. This means it favours speed over compression ratio. -endef - -CMAKE_OPTIONS += \ - -DENABLE_SHARED=ON \ - -DENABLE_STATIC=ON \ - \ - -DBUILD_TESTING=OFF \ - -DCMAKE_SKIP_INSTALL_RPATH=ON - -define Build/InstallDev - $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib $(1)/usr/lib/pkgconfig - $(CP) $(PKG_INSTALL_DIR)/usr/include/lzo $(1)/usr/include/ - $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblzo2.{a,so*} $(1)/usr/lib/ - $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lzo2.pc $(1)/usr/lib/pkgconfig - $(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/lzo2.pc - $(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/lzo2.pc -endef - -define Package/liblzo/install - $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblzo2.so.* $(1)/usr/lib/ -endef - -$(eval $(call BuildPackage,liblzo)) From 1a211af2cb3be415a2c3454dea6fdc9a59bba334 Mon Sep 17 00:00:00 2001 From: Sander Vanheule Date: Wed, 5 Aug 2020 20:49:44 +0200 Subject: [PATCH 22/65] firmware-utils: tplink-safeloader: refactor meta-partition generation TP-Link safeloader firmware images contain a number of (small) partitions with information about the device. These consist of: * The data length as a 32-bit integer * A 32-bit zero padding * The partition data, with its length set in the first field The OpenWrt factory image partitions that follow this structure are soft-version, support-list, and extra-para. Refactor the code to put all common logic into one allocation call, and let the rest of the data be filled in by the original functions. Due to the extra-para changes, this patch results in factory images that change by 2 bytes (not counting the checksum) for three devices: * ARCHER-A7-V5 * ARCHER-C7-V4 * ARCHER-C7-V5 These were the devices where the extra-para blob didn't match the common format. The hardcoded data also didn't correspond to TP-Link's (recent) upgrade images, which actually matches the meta-partition format. A padding byte is also added to the extra-para partition for EAP245-V3. Signed-off-by: Sander Vanheule --- tools/firmware-utils/Makefile | 2 +- tools/firmware-utils/src/tplink-safeloader.c | 173 ++++++++++--------- 2 files changed, 91 insertions(+), 84 deletions(-) diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile index 81c62d977a..9c9a0ba40f 100644 --- a/tools/firmware-utils/Makefile +++ b/tools/firmware-utils/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME := firmware-utils -PKG_RELEASE := 5 +PKG_RELEASE := 6 include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/kernel.mk diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c index cb3cf69948..41b3b8aff9 100644 --- a/tools/firmware-utils/src/tplink-safeloader.c +++ b/tools/firmware-utils/src/tplink-safeloader.c @@ -83,10 +83,13 @@ struct device_info { const char *last_sysupgrade_partition; }; +struct __attribute__((__packed__)) meta_header { + uint32_t length; + uint32_t zero; +}; + /** The content of the soft-version structure */ struct __attribute__((__packed__)) soft_version { - uint32_t data_len; - uint32_t zero; uint8_t pad1; uint8_t version_major; uint8_t version_minor; @@ -96,6 +99,7 @@ struct __attribute__((__packed__)) soft_version { uint8_t month; uint8_t day; uint32_t rev; + uint32_t compat_level; }; @@ -2299,6 +2303,35 @@ static inline void put32(uint8_t *buf, uint32_t val) { buf[3] = val; } +/** Allocate a padded meta partition with a correctly initialised header + * If the `data` pointer is NULL, then the required space is only allocated, + * otherwise `data_len` bytes will be copied from `data` into the partition + * entry. */ +static struct image_partition_entry init_meta_partition_entry( + const char *name, const void *data, uint32_t data_len, + uint8_t pad_value) +{ + uint32_t total_len = sizeof(struct meta_header) + data_len + 1; + struct image_partition_entry entry = { + .name = name, + .size = total_len, + .data = malloc(total_len) + }; + if (!entry.data) + error(1, errno, "failed to allocate meta partition entry"); + + struct meta_header *header = (struct meta_header *)entry.data; + header->length = htonl(data_len); + header->zero = 0; + + if (data) + memcpy(entry.data+sizeof(*header), data, data_len); + + entry.data[total_len - 1] = pad_value; + + return entry; +} + /** Allocates a new image partition */ static struct image_partition_entry alloc_image_partition(const char *name, size_t len) { struct image_partition_entry entry = {name, len, malloc(len)}; @@ -2364,14 +2397,16 @@ static inline uint8_t bcd(uint8_t v) { /** Generates the soft-version partition */ -static struct image_partition_entry make_soft_version(struct device_info *info, uint32_t rev) { - size_t part_len = sizeof(struct soft_version); - if (info->soft_ver_compat_level > 0) - part_len += sizeof(uint32_t); - - struct image_partition_entry entry = - alloc_image_partition("soft-version", part_len+1); - struct soft_version *s = (struct soft_version *)entry.data; +static struct image_partition_entry make_soft_version( + const struct device_info *info, uint32_t rev) +{ + /** If an info string is provided, use this instead of + * the structured data, and include the null-termination */ + if (info->soft_ver) { + uint32_t len = strlen(info->soft_ver) + 1; + return init_meta_partition_entry("soft-version", + info->soft_ver, len, 0); + } time_t t; @@ -2382,58 +2417,43 @@ static struct image_partition_entry make_soft_version(struct device_info *info, struct tm *tm = gmtime(&t); - /* Partition contents size, minus 8 byte header and trailing byte */ - s->data_len = htonl(entry.size-9); - s->zero = 0; - s->pad1 = 0xff; + struct soft_version s = { + .pad1 = 0xff, - s->version_major = 0; - s->version_minor = 0; - s->version_patch = 0; + .version_major = 0, + .version_minor = 0, + .version_patch = 0, - s->year_hi = bcd((1900+tm->tm_year)/100); - s->year_lo = bcd(tm->tm_year%100); - s->month = bcd(tm->tm_mon+1); - s->day = bcd(tm->tm_mday); - s->rev = htonl(rev); + .year_hi = bcd((1900+tm->tm_year)/100), + .year_lo = bcd(tm->tm_year%100), + .month = bcd(tm->tm_mon+1), + .day = bcd(tm->tm_mday), - if (info->soft_ver_compat_level > 0) - *(uint32_t *)(entry.data + sizeof(struct soft_version)) = - htonl(info->soft_ver_compat_level); + .compat_level = htonl(info->soft_ver_compat_level) + }; - entry.data[entry.size-1] = 0xff; - - return entry; -} - -static struct image_partition_entry make_soft_version_from_string(const char *soft_ver) { - /** String length _including_ the terminating zero byte */ - uint32_t ver_len = strlen(soft_ver) + 1; - /** Partition contains 64 bit header, the version string, and one additional null byte */ - size_t partition_len = 2*sizeof(uint32_t) + ver_len + 1; - struct image_partition_entry entry = alloc_image_partition("soft-version", partition_len); - - uint32_t *len = (uint32_t *)entry.data; - len[0] = htonl(ver_len); - len[1] = 0; - memcpy(&len[2], soft_ver, ver_len); - - entry.data[partition_len - 1] = 0; - - return entry; + if (info->soft_ver_compat_level == 0) + return init_meta_partition_entry("soft-version", &s, + (uint8_t *)(&s.compat_level) - (uint8_t *)(&s), 0xff); + else + return init_meta_partition_entry("soft-version", &s, + sizeof(s), 0xff); } /** Generates the support-list partition */ -static struct image_partition_entry make_support_list(struct device_info *info) { - size_t len = strlen(info->support_list); - struct image_partition_entry entry = alloc_image_partition("support-list", len + 9); +static struct image_partition_entry make_support_list( + const struct device_info *info) +{ + uint32_t len = strlen(info->support_list); + return init_meta_partition_entry("support-list", info->support_list, + len, info->support_trail); +} - put32(entry.data, len); - memset(entry.data+4, 0, 4); - memcpy(entry.data+8, info->support_list, len); - entry.data[len+8] = info->support_trail; - - return entry; +/** Partition with extra-para data */ +static struct image_partition_entry make_extra_para( + const struct device_info *info, const uint8_t *extra_para, size_t len) +{ + return init_meta_partition_entry("extra-para", extra_para, len, 0x00); } /** Creates a new image partition with an arbitrary name from a file */ @@ -2473,16 +2493,6 @@ static struct image_partition_entry read_file(const char *part_name, const char return entry; } -/** Creates a new image partition from arbitrary data */ -static struct image_partition_entry put_data(const char *part_name, const char *datain, size_t len) { - - struct image_partition_entry entry = alloc_image_partition(part_name, len); - - memcpy(entry.data, datain, len); - - return entry; -} - /** Copies a list of image partitions into an image buffer and generates the image partition table while doing so @@ -2710,36 +2720,33 @@ static void build_image(const char *output, } parts[0] = make_partition_table(info->partitions); - if (info->soft_ver) - parts[1] = make_soft_version_from_string(info->soft_ver); - else - parts[1] = make_soft_version(info, rev); - + parts[1] = make_soft_version(info, rev); parts[2] = make_support_list(info); parts[3] = read_file("os-image", kernel_image, false, NULL); parts[4] = read_file("file-system", rootfs_image, add_jffs2_eof, file_system_partition); /* Some devices need the extra-para partition to accept the firmware */ - if (strcasecmp(info->id, "ARCHER-C2-V3") == 0 || + if (strcasecmp(info->id, "ARCHER-A7-V5") == 0 || + strcasecmp(info->id, "ARCHER-C2-V3") == 0 || + strcasecmp(info->id, "ARCHER-C7-V4") == 0 || + strcasecmp(info->id, "ARCHER-C7-V5") == 0 || strcasecmp(info->id, "ARCHER-C25-V1") == 0 || strcasecmp(info->id, "ARCHER-C59-V2") == 0 || strcasecmp(info->id, "ARCHER-C60-V2") == 0 || strcasecmp(info->id, "ARCHER-C60-V3") == 0 || strcasecmp(info->id, "TLWR1043NV5") == 0) { - const char mdat[11] = {0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00}; - parts[5] = put_data("extra-para", mdat, 11); - } else if (strcasecmp(info->id, "ARCHER-A7-V5") == 0 || strcasecmp(info->id, "ARCHER-C7-V4") == 0 || strcasecmp(info->id, "ARCHER-C7-V5") == 0) { - const char mdat[11] = {0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0xca, 0x00, 0x01, 0x00, 0x00}; - parts[5] = put_data("extra-para", mdat, 11); + const uint8_t extra_para[2] = {0x01, 0x00}; + parts[5] = make_extra_para(info, extra_para, + sizeof(extra_para)); } else if (strcasecmp(info->id, "ARCHER-C6-V2") == 0) { - const char mdat[11] = {0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00}; - parts[5] = put_data("extra-para", mdat, 11); - } else if (strcasecmp(info->id, "ARCHER-C6-V2-US") == 0) { - const char mdat[11] = {0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00}; - parts[5] = put_data("extra-para", mdat, 11); - } else if (strcasecmp(info->id, "EAP245-V3") == 0) { - const char mdat[10] = {0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01}; - parts[5] = put_data("extra-para", mdat, 10); + const uint8_t extra_para[2] = {0x00, 0x01}; + parts[5] = make_extra_para(info, extra_para, + sizeof(extra_para)); + } else if (strcasecmp(info->id, "ARCHER-C6-V2-US") == 0 || + strcasecmp(info->id, "EAP245-V3") == 0) { + const uint8_t extra_para[2] = {0x01, 0x01}; + parts[5] = make_extra_para(info, extra_para, + sizeof(extra_para)); } size_t len; From cb38170f4cd57ee028ab7b270f395cd1ee8adf00 Mon Sep 17 00:00:00 2001 From: Sander Vanheule Date: Sat, 15 Aug 2020 09:51:18 +0200 Subject: [PATCH 23/65] firmware-utils: tplink-safeloader: refactor meta-partition padding Because some padding values in the TP-Link safeloader image generation were hardcoded, different values were sometimes used throughout a factory image. TP-Link's upgrade images use the same value everywhere, so let's do the same here. Although a lot of TP-Link's safeloader images have padded partition payloads, images for the EAP-series of AC devices don't. This padding is therefore also made optional. By replacing the type of the padding value byte with a wider datatype, new values outside of the previously valid range become available. Use these new values to denote that padding should not be performed. Because char might be signed, also replace the char literals by a numeric literal. Otherwise '\xff' might be sign extended to 0xffff. This results in factory images differing by 1 byte for: * C2600 * ARCHER-C5-V2 * ARCHERC9 * TLWA850REV2 * TLWA855REV1 * TL-WPA8630P-V2-EU * TL-WPA8630P-V2-INT * TL-WPA8630P-V2.1-EU * TLWR1043NDV4 * TL-WR902AC-V1 * TLWR942NV1 * RE200-V2 * RE200-V3 * RE220-V2 * RE305-V1 * RE350-V1 * RE350K-V1 * RE355 * RE450 * RE450-V2 * RE450-V3 * RE500-V1 * RE650-V1 The following factory images no longer have padding, shrinking the factory images by a few bytes for: * EAP225-OUTDOOR-V1 * EAP225-V3 * EAP225-WALL-V2 * EAP245-V1 * EAP245-V3 Signed-off-by: Sander Vanheule --- tools/firmware-utils/Makefile | 2 +- tools/firmware-utils/src/tplink-safeloader.c | 155 +++++++++++-------- 2 files changed, 89 insertions(+), 68 deletions(-) diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile index 9c9a0ba40f..9a68b80c71 100644 --- a/tools/firmware-utils/Makefile +++ b/tools/firmware-utils/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME := firmware-utils -PKG_RELEASE := 6 +PKG_RELEASE := 7 include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/kernel.mk diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c index 41b3b8aff9..ce07a95574 100644 --- a/tools/firmware-utils/src/tplink-safeloader.c +++ b/tools/firmware-utils/src/tplink-safeloader.c @@ -70,12 +70,22 @@ struct flash_partition_entry { uint32_t size; }; +/** Partition trailing padding definitions + * Values 0x00 to 0xff are reserved to indicate the padding value + * Values from 0x100 are reserved to indicate other behaviour */ +enum partition_trail_value { + PART_TRAIL_00 = 0x00, + PART_TRAIL_FF = 0xff, + PART_TRAIL_MAX = 0xff, + PART_TRAIL_NONE = 0x100 +}; + /** Firmware layout description */ struct device_info { const char *id; const char *vendor; const char *support_list; - char support_trail; + enum partition_trail_value part_trail; const char *soft_ver; uint32_t soft_ver_compat_level; struct flash_partition_entry partitions[MAX_PARTITIONS+1]; @@ -135,7 +145,7 @@ static struct device_info boards[] = { "CPE220(TP-LINK|UN|N300-2):1.1\r\n" "CPE220(TP-LINK|US|N300-2):1.1\r\n" "CPE220(TP-LINK|EU|N300-2):1.1\r\n", - .support_trail = '\xff', + .part_trail = 0xff, .soft_ver = NULL, .partitions = { @@ -175,7 +185,7 @@ static struct device_info boards[] = { "CPE210(TP-LINK|UN|N300-2):2.0\r\n" "CPE210(TP-LINK|EU|N300-2):2.0\r\n" "CPE210(TP-LINK|US|N300-2):2.0\r\n", - .support_trail = '\xff', + .part_trail = 0xff, .soft_ver = NULL, .partitions = { @@ -217,7 +227,7 @@ static struct device_info boards[] = { "CPE210(TP-LINK|EU|N300-2|45550000):3.20\r\n" "CPE210(TP-LINK|UN|N300-2|00000000):3.20\r\n" "CPE210(TP-LINK|US|N300-2|55530000):3.20\r\n", - .support_trail = '\xff', + .part_trail = 0xff, .soft_ver = NULL, .partitions = { @@ -258,7 +268,7 @@ static struct device_info boards[] = { "CPE220(TP-LINK|UN|N300-2):2.0\r\n" "CPE220(TP-LINK|EU|N300-2):2.0\r\n" "CPE220(TP-LINK|US|N300-2):2.0\r\n", - .support_trail = '\xff', + .part_trail = 0xff, .soft_ver = NULL, .partitions = { @@ -298,7 +308,7 @@ static struct device_info boards[] = { "CPE220(TP-LINK|UN|N300-2):3.0\r\n" "CPE220(TP-LINK|EU|N300-2):3.0\r\n" "CPE220(TP-LINK|US|N300-2):3.0\r\n", - .support_trail = '\xff', + .part_trail = 0xff, .soft_ver = NULL, .partitions = { @@ -337,7 +347,7 @@ static struct device_info boards[] = { "CPE520(TP-LINK|UN|N300-5):1.1\r\n" "CPE520(TP-LINK|US|N300-5):1.1\r\n" "CPE520(TP-LINK|EU|N300-5):1.1\r\n", - .support_trail = '\xff', + .part_trail = 0xff, .soft_ver = NULL, .partitions = { @@ -379,7 +389,7 @@ static struct device_info boards[] = { "CPE510(TP-LINK|UN|N300-5):2.0\r\n" "CPE510(TP-LINK|EU|N300-5):2.0\r\n" "CPE510(TP-LINK|US|N300-5):2.0\r\n", - .support_trail = '\xff', + .part_trail = 0xff, .soft_ver = NULL, .partitions = { @@ -421,7 +431,7 @@ static struct device_info boards[] = { "CPE510(TP-LINK|UN|N300-5):3.0\r\n" "CPE510(TP-LINK|EU|N300-5):3.0\r\n" "CPE510(TP-LINK|US|N300-5):3.0\r\n", - .support_trail = '\xff', + .part_trail = 0xff, .soft_ver = NULL, .partitions = { @@ -461,7 +471,7 @@ static struct device_info boards[] = { "CPE610(TP-LINK|UN|N300-5):1.0\r\n" "CPE610(TP-LINK|EU|N300-5):1.0\r\n" "CPE610(TP-LINK|US|N300-5):1.0\r\n", - .support_trail = '\xff', + .part_trail = 0xff, .soft_ver = NULL, .partitions = { @@ -501,7 +511,7 @@ static struct device_info boards[] = { "CPE610(TP-LINK|UN|N300-5):2.0\r\n" "CPE610(TP-LINK|EU|N300-5):2.0\r\n" "CPE610(TP-LINK|US|N300-5):2.0\r\n", - .support_trail = '\xff', + .part_trail = 0xff, .soft_ver = NULL, .partitions = { @@ -533,7 +543,7 @@ static struct device_info boards[] = { "WBS210(TP-LINK|UN|N300-2):1.20\r\n" "WBS210(TP-LINK|US|N300-2):1.20\r\n" "WBS210(TP-LINK|EU|N300-2):1.20\r\n", - .support_trail = '\xff', + .part_trail = 0xff, .soft_ver = NULL, .partitions = { @@ -565,7 +575,7 @@ static struct device_info boards[] = { "WBS210(TP-LINK|UN|N300-2|00000000):2.0\r\n" "WBS210(TP-LINK|US|N300-2|55530000):2.0\r\n" "WBS210(TP-LINK|EU|N300-2|45550000):2.0\r\n", - .support_trail = '\xff', + .part_trail = 0xff, .soft_ver = NULL, .partitions = { @@ -598,7 +608,7 @@ static struct device_info boards[] = { "WBS510(TP-LINK|US|N300-5):1.20\r\n" "WBS510(TP-LINK|EU|N300-5):1.20\r\n" "WBS510(TP-LINK|CA|N300-5):1.20\r\n", - .support_trail = '\xff', + .part_trail = 0xff, .soft_ver = NULL, .partitions = { @@ -631,7 +641,7 @@ static struct device_info boards[] = { "WBS510(TP-LINK|US|N300-5|55530000):2.0\r\n" "WBS510(TP-LINK|EU|N300-5|45550000):2.0\r\n" "WBS510(TP-LINK|CA|N300-5|43410000):2.0\r\n", - .support_trail = '\xff', + .part_trail = 0xff, .soft_ver = NULL, .partitions = { @@ -662,7 +672,7 @@ static struct device_info boards[] = { .support_list = "SupportList:\r\n" "{product_name:Archer C2600,product_ver:1.0.0,special_id:00000000}\r\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = NULL, /** @@ -713,7 +723,7 @@ static struct device_info boards[] = { "{product_name:Archer A7,product_ver:5.0.0,special_id:43410000}\n" "{product_name:Archer A7,product_ver:5.0.0,special_id:4A500000}\n" "{product_name:Archer A7,product_ver:5.0.0,special_id:54570000}\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = "soft_ver:1.0.0\n", /* We're using a dynamic kernel/rootfs split here */ @@ -751,7 +761,7 @@ static struct device_info boards[] = { "{product_name:ArcherC2,product_ver:3.0.0,special_id:00000000}\n" "{product_name:ArcherC2,product_ver:3.0.0,special_id:55530000}\n" "{product_name:ArcherC2,product_ver:3.0.0,special_id:45550000}\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = "soft_ver:3.0.1\n", /** We're using a dynamic kernel/rootfs split here */ @@ -789,7 +799,7 @@ static struct device_info boards[] = { "{product_name:ArcherC25,product_ver:1.0.0,special_id:00000000}\n" "{product_name:ArcherC25,product_ver:1.0.0,special_id:55530000}\n" "{product_name:ArcherC25,product_ver:1.0.0,special_id:45550000}\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = "soft_ver:1.0.0\n", /* We're using a dynamic kernel/rootfs split here */ @@ -828,7 +838,7 @@ static struct device_info boards[] = { "{product_name:Archer C58,product_ver:1.0.0,special_id:00000000}\r\n" "{product_name:Archer C58,product_ver:1.0.0,special_id:45550000}\r\n" "{product_name:Archer C58,product_ver:1.0.0,special_id:55530000}\r\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = "soft_ver:1.0.0\n", .partitions = { @@ -863,7 +873,7 @@ static struct device_info boards[] = { "{product_name:Archer C59,product_ver:1.0.0,special_id:45550000}\r\n" "{product_name:Archer C59,product_ver:1.0.0,special_id:52550000}\r\n" "{product_name:Archer C59,product_ver:1.0.0,special_id:55530000}\r\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = "soft_ver:1.0.0\n", /* We're using a dynamic kernel/rootfs split here */ @@ -901,7 +911,7 @@ static struct device_info boards[] = { "{product_name:Archer C59,product_ver:2.0.0,special_id:00000000}\r\n" "{product_name:Archer C59,product_ver:2.0.0,special_id:45550000}\r\n" "{product_name:Archer C59,product_ver:2.0.0,special_id:55530000}\r\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = "soft_ver:2.0.0 Build 20161206 rel.7303\n", /** We're using a dynamic kernel/rootfs split here */ @@ -941,7 +951,7 @@ static struct device_info boards[] = { "{product_name:Archer C6,product_ver:2.0.0,special_id:45550000}\r\n" "{product_name:Archer C6,product_ver:2.0.0,special_id:52550000}\r\n" "{product_name:Archer C6,product_ver:2.0.0,special_id:4A500000}\r\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = "soft_ver:1.9.1\n", .partitions = { @@ -976,7 +986,7 @@ static struct device_info boards[] = { "{product_name:Archer A6,product_ver:2.0.0,special_id:55530000}\n" "{product_name:Archer A6,product_ver:2.0.0,special_id:54570000}\n" "{product_name:Archer C6,product_ver:2.0.0,special_id:55530000}\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = "soft_ver:1.9.1\n", .partitions = { @@ -1011,7 +1021,7 @@ static struct device_info boards[] = { "{product_name:Archer C60,product_ver:1.0.0,special_id:00000000}\r\n" "{product_name:Archer C60,product_ver:1.0.0,special_id:45550000}\r\n" "{product_name:Archer C60,product_ver:1.0.0,special_id:55530000}\r\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = "soft_ver:1.0.0\n", .partitions = { @@ -1045,7 +1055,7 @@ static struct device_info boards[] = { "{product_name:Archer C60,product_ver:2.0.0,special_id:42520000}\r\n" "{product_name:Archer C60,product_ver:2.0.0,special_id:45550000}\r\n" "{product_name:Archer C60,product_ver:2.0.0,special_id:55530000}\r\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = "soft_ver:2.0.0\n", .partitions = { @@ -1081,7 +1091,7 @@ static struct device_info boards[] = { "{product_name:Archer C60,product_ver:3.0.0,special_id:42520000}\r\n" "{product_name:Archer C60,product_ver:3.0.0,special_id:45550000}\r\n" "{product_name:Archer C60,product_ver:3.0.0,special_id:55530000}\r\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = "soft_ver:3.0.0\n", .partitions = { @@ -1117,7 +1127,7 @@ static struct device_info boards[] = { "{product_name:ArcherC5,product_ver:2.0.0,special_id:00000000}\r\n" "{product_name:ArcherC5,product_ver:2.0.0,special_id:55530000}\r\n" "{product_name:ArcherC5,product_ver:2.0.0,special_id:4A500000}\r\n", /* JP version */ - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = NULL, .partitions = { @@ -1158,7 +1168,7 @@ static struct device_info boards[] = { "{product_name:Archer C7,product_ver:4.0.0,special_id:54570000}\n" "{product_name:Archer C7,product_ver:4.0.0,special_id:55530000}\n" "{product_name:Archer C7,product_ver:4.0.0,special_id:43410000}\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = "soft_ver:1.0.0\n", /* We're using a dynamic kernel/rootfs split here */ @@ -1203,7 +1213,7 @@ static struct device_info boards[] = { "{product_name:Archer C7,product_ver:5.0.0,special_id:52550000}\n" "{product_name:Archer C7,product_ver:5.0.0,special_id:4B520000}\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = "soft_ver:1.0.0\n", /* We're using a dynamic kernel/rootfs split here */ @@ -1246,7 +1256,7 @@ static struct device_info boards[] = { "{product_name:ArcherC9," "product_ver:1.0.0," "special_id:00000000}\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = NULL, .partitions = { @@ -1279,7 +1289,7 @@ static struct device_info boards[] = { .support_list = "SupportList:\r\n" "EAP120(TP-LINK|UN|N300-2):1.0\r\n", - .support_trail = '\xff', + .part_trail = 0xff, .soft_ver = NULL, .partitions = { @@ -1308,7 +1318,7 @@ static struct device_info boards[] = { .support_list = "SupportList:\r\n" "EAP225-Outdoor(TP-Link|UN|AC1200-D):1.0\r\n", - .support_trail = '\xff', + .part_trail = PART_TRAIL_NONE, .soft_ver = NULL, .soft_ver_compat_level = 1, @@ -1337,7 +1347,7 @@ static struct device_info boards[] = { .support_list = "SupportList:\r\n" "EAP225(TP-Link|UN|AC1350-D):3.0\r\n", - .support_trail = '\xff', + .part_trail = PART_TRAIL_NONE, .soft_ver = NULL, .soft_ver_compat_level = 1, @@ -1366,7 +1376,7 @@ static struct device_info boards[] = { .support_list = "SupportList:\r\n" "EAP225-Wall(TP-Link|UN|AC1200-D):2.0\r\n", - .support_trail = '\xff', + .part_trail = PART_TRAIL_NONE, .soft_ver = NULL, .soft_ver_compat_level = 1, @@ -1395,7 +1405,7 @@ static struct device_info boards[] = { .support_list = "SupportList:\r\n" "EAP245(TP-LINK|UN|AC1750-D):1.0\r\n", - .support_trail = '\xff', + .part_trail = PART_TRAIL_NONE, .soft_ver = NULL, .partitions = { @@ -1421,7 +1431,7 @@ static struct device_info boards[] = { .support_list = "SupportList:\r\n" "EAP245(TP-Link|UN|AC1750-D):3.0\r\n", - .support_trail = '\xff', + .part_trail = PART_TRAIL_NONE, .soft_ver = NULL, .soft_ver_compat_level = 1, @@ -1463,7 +1473,7 @@ static struct device_info boards[] = { "{product_name:TL-WA850RE,product_ver:2.0.0,special_id:43410000}\n" "{product_name:TL-WA850RE,product_ver:2.0.0,special_id:41550000}\n" "{product_name:TL-WA850RE,product_ver:2.0.0,special_id:52550000}\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = NULL, /** @@ -1505,7 +1515,7 @@ static struct device_info boards[] = { "{product_name:TL-WA855RE,product_ver:1.0.0,special_id:43410000}\n" "{product_name:TL-WA855RE,product_ver:1.0.0,special_id:41550000}\n" "{product_name:TL-WA855RE,product_ver:1.0.0,special_id:52550000}\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = NULL, .partitions = { @@ -1536,7 +1546,7 @@ static struct device_info boards[] = { .support_list = "SupportList:\n" "{product_name:TL-WPA8630P,product_ver:2.0.0,special_id:45550000}\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = NULL, .partitions = { @@ -1573,7 +1583,7 @@ static struct device_info boards[] = { "{product_name:TL-WPA8630P,product_ver:2.0.0,special_id:41550000}\n" "{product_name:TL-WPA8630P,product_ver:2.0.0,special_id:44450000}\n" "{product_name:TL-WPA8630P,product_ver:2.1.0,special_id:41550000}\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = NULL, .partitions = { @@ -1608,7 +1618,7 @@ static struct device_info boards[] = { .support_list = "SupportList:\n" "{product_name:TL-WPA8630P,product_ver:2.1.0,special_id:45550000}\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = NULL, .partitions = { @@ -1644,7 +1654,7 @@ static struct device_info boards[] = { "SupportList:\n" "{product_name:TL-WR1043N,product_ver:5.0.0,special_id:45550000}\n" "{product_name:TL-WR1043N,product_ver:5.0.0,special_id:55530000}\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = "soft_ver:1.0.0\n", .partitions = { {"factory-boot", 0x00000, 0x20000}, @@ -1678,7 +1688,7 @@ static struct device_info boards[] = { .support_list = "SupportList:\n" "{product_name:TL-WR1043ND,product_ver:4.0.0,special_id:45550000}\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = NULL, /* We're using a dynamic kernel/rootfs split here */ @@ -1711,7 +1721,7 @@ static struct device_info boards[] = { "SupportList:\n" "{product_name:TL-WR902AC,product_ver:1.0.0,special_id:45550000}\n" "{product_name:TL-WR902AC,product_ver:1.0.0,special_id:55530000}\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = NULL, /** @@ -1747,7 +1757,7 @@ static struct device_info boards[] = { "SupportList:\r\n" "{product_name:TL-WR942N,product_ver:1.0.0,special_id:00000000}\r\n" "{product_name:TL-WR942N,product_ver:1.0.0,special_id:52550000}\r\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = NULL, .partitions = { @@ -1794,7 +1804,7 @@ static struct device_info boards[] = { "{product_name:RE200,product_ver:2.0.0,special_id:52550000}\n" "{product_name:RE200,product_ver:2.0.0,special_id:54570000}\n" "{product_name:RE200,product_ver:2.0.0,special_id:55530000}\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = NULL, .partitions = { @@ -1838,7 +1848,7 @@ static struct device_info boards[] = { "{product_name:RE200,product_ver:3.0.0,special_id:52550000}\n" "{product_name:RE200,product_ver:3.0.0,special_id:54570000}\n" "{product_name:RE200,product_ver:3.0.0,special_id:55530000}\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = NULL, .partitions = { @@ -1882,7 +1892,7 @@ static struct device_info boards[] = { "{product_name:RE200,product_ver:4.0.0,special_id:45530000}\n" "{product_name:RE200,product_ver:4.0.0,special_id:49440000}\n" "{product_name:RE200,product_ver:4.0.0,special_id:45470000}\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = "soft_ver:1.1.0\n", .partitions = { @@ -1925,7 +1935,7 @@ static struct device_info boards[] = { "{product_name:RE220,product_ver:2.0.0,special_id:52550000}\n" "{product_name:RE220,product_ver:2.0.0,special_id:54570000}\n" "{product_name:RE220,product_ver:2.0.0,special_id:55530000}\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = NULL, .partitions = { @@ -1962,7 +1972,7 @@ static struct device_info boards[] = { "{product_name:RE305,product_ver:1.0.0,special_id:4b520000}\n" "{product_name:RE305,product_ver:1.0.0,special_id:41550000}\n" "{product_name:RE305,product_ver:1.0.0,special_id:43410000}\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = NULL, .partitions = { @@ -1998,7 +2008,7 @@ static struct device_info boards[] = { "{product_name:RE350,product_ver:1.0.0,special_id:43410000}\n" "{product_name:RE350,product_ver:1.0.0,special_id:4b520000}\n" "{product_name:RE350,product_ver:1.0.0,special_id:4a500000}\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = NULL, /** We're using a dynamic kernel/rootfs split here */ @@ -2029,7 +2039,7 @@ static struct device_info boards[] = { .support_list = "SupportList:\n" "{product_name:RE350K,product_ver:1.0.0,special_id:00000000,product_region:US}\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = NULL, /** We're using a dynamic kernel/rootfs split here */ @@ -2068,7 +2078,7 @@ static struct device_info boards[] = { "{product_name:RE355,product_ver:1.0.0,special_id:41550000}\r\n" "{product_name:RE355,product_ver:1.0.0,special_id:4B520000}\r\n" "{product_name:RE355,product_ver:1.0.0,special_id:55534100}\r\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = NULL, /* We're using a dynamic kernel/rootfs split here */ @@ -2106,7 +2116,7 @@ static struct device_info boards[] = { "{product_name:RE450,product_ver:1.0.0,special_id:41550000}\r\n" "{product_name:RE450,product_ver:1.0.0,special_id:4B520000}\r\n" "{product_name:RE450,product_ver:1.0.0,special_id:55534100}\r\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = NULL, /** We're using a dynamic kernel/rootfs split here */ @@ -2145,7 +2155,7 @@ static struct device_info boards[] = { "{product_name:RE450,product_ver:2.0.0,special_id:41530000}\r\n" "{product_name:RE450,product_ver:2.0.0,special_id:4B520000}\r\n" "{product_name:RE450,product_ver:2.0.0,special_id:42520000}\r\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = NULL, /* We're using a dynamic kernel/rootfs split here */ @@ -2184,7 +2194,7 @@ static struct device_info boards[] = { "{product_name:RE450,product_ver:3.0.0,special_id:41530000}\r\n" "{product_name:RE450,product_ver:3.0.0,special_id:4B520000}\r\n" "{product_name:RE450,product_ver:3.0.0,special_id:42520000}\r\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = NULL, /* We're using a dynamic kernel/rootfs split here */ @@ -2222,7 +2232,7 @@ static struct device_info boards[] = { "{product_name:RE500,product_ver:1.0.0,special_id:43410000}\r\n" "{product_name:RE500,product_ver:1.0.0,special_id:41550000}\r\n" "{product_name:RE500,product_ver:1.0.0,special_id:41530000}\r\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = NULL, /* We're using a dynamic kernel/rootfs split here */ @@ -2259,7 +2269,7 @@ static struct device_info boards[] = { "{product_name:RE650,product_ver:1.0.0,special_id:43410000}\r\n" "{product_name:RE650,product_ver:1.0.0,special_id:41550000}\r\n" "{product_name:RE650,product_ver:1.0.0,special_id:41530000}\r\n", - .support_trail = '\x00', + .part_trail = 0x00, .soft_ver = NULL, /* We're using a dynamic kernel/rootfs split here */ @@ -2303,15 +2313,23 @@ static inline void put32(uint8_t *buf, uint32_t val) { buf[3] = val; } +static inline bool meta_partition_should_pad(enum partition_trail_value pv) +{ + return (pv >= 0) && (pv <= PART_TRAIL_MAX); +} + /** Allocate a padded meta partition with a correctly initialised header * If the `data` pointer is NULL, then the required space is only allocated, * otherwise `data_len` bytes will be copied from `data` into the partition * entry. */ static struct image_partition_entry init_meta_partition_entry( const char *name, const void *data, uint32_t data_len, - uint8_t pad_value) + enum partition_trail_value pad_value) { - uint32_t total_len = sizeof(struct meta_header) + data_len + 1; + uint32_t total_len = sizeof(struct meta_header) + data_len; + if (meta_partition_should_pad(pad_value)) + total_len += 1; + struct image_partition_entry entry = { .name = name, .size = total_len, @@ -2327,7 +2345,8 @@ static struct image_partition_entry init_meta_partition_entry( if (data) memcpy(entry.data+sizeof(*header), data, data_len); - entry.data[total_len - 1] = pad_value; + if (meta_partition_should_pad(pad_value)) + entry.data[total_len - 1] = (uint8_t) pad_value; return entry; } @@ -2405,7 +2424,7 @@ static struct image_partition_entry make_soft_version( if (info->soft_ver) { uint32_t len = strlen(info->soft_ver) + 1; return init_meta_partition_entry("soft-version", - info->soft_ver, len, 0); + info->soft_ver, len, info->part_trail); } time_t t; @@ -2434,10 +2453,11 @@ static struct image_partition_entry make_soft_version( if (info->soft_ver_compat_level == 0) return init_meta_partition_entry("soft-version", &s, - (uint8_t *)(&s.compat_level) - (uint8_t *)(&s), 0xff); + (uint8_t *)(&s.compat_level) - (uint8_t *)(&s), + info->part_trail); else return init_meta_partition_entry("soft-version", &s, - sizeof(s), 0xff); + sizeof(s), info->part_trail); } /** Generates the support-list partition */ @@ -2446,14 +2466,15 @@ static struct image_partition_entry make_support_list( { uint32_t len = strlen(info->support_list); return init_meta_partition_entry("support-list", info->support_list, - len, info->support_trail); + len, info->part_trail); } /** Partition with extra-para data */ static struct image_partition_entry make_extra_para( const struct device_info *info, const uint8_t *extra_para, size_t len) { - return init_meta_partition_entry("extra-para", extra_para, len, 0x00); + return init_meta_partition_entry("extra-para", extra_para, len, + info->part_trail); } /** Creates a new image partition with an arbitrary name from a file */ From b9971db7c365c0145faf1db2e78ee48cee4b643d Mon Sep 17 00:00:00 2001 From: Damien Mascord Date: Mon, 7 Dec 2020 13:01:38 +1100 Subject: [PATCH 24/65] ath79: add support for Belkin F9J1108v2 (AC1750 DB Wi-Fi) This device is the non-US build of the F9K1115 v2, with a different firmware magic. Specifications: SoC: QCA9558 CPU: 720 MHz Flash: 16 MiB NOR RAM: 128 MiB WiFi 2.4 GHz: QCA9558-AT4A 3x3 MIMO 802.11b/g/n WiFi 5 GHz: QCA9880-2R4E 3x3 MIMO 802.11a/n/ac Ethernet: 4x LAN and 1x WAN (all 1gbps) USB: 1 x USB 2.0 (lower), 1 x USB 3.0 (upper) MAC addresses based on OEM firmware: Interface Address Location --------- ------- -------- lan *:5A sometimes in 0x6 wan *:5B 0x0 2.4Ghz *:5A 0x1002 5Ghz As per mini PCIe EEPROM Flashing instructions: The factory.bin can be flashed via the Belkin web UI or via the uboot http upgrade page. Once the factory.bin has been written, sysupgrade.bin will work as usual. Signed-off-by: Damien Mascord Acked-by: Martin Blumenstingl [wrap commit message/code, adjust label-mac-device, whitespace fixes, merge block in 02_network] Signed-off-by: Adrian Schmutzler --- .../ath79/dts/qca9558_belkin_f9j1108-v2.dts | 229 ++++++++++++++++++ .../generic/base-files/etc/board.d/02_network | 17 +- target/linux/ath79/image/generic.mk | 39 +++ 3 files changed, 277 insertions(+), 8 deletions(-) create mode 100644 target/linux/ath79/dts/qca9558_belkin_f9j1108-v2.dts diff --git a/target/linux/ath79/dts/qca9558_belkin_f9j1108-v2.dts b/target/linux/ath79/dts/qca9558_belkin_f9j1108-v2.dts new file mode 100644 index 0000000000..0bd3af98db --- /dev/null +++ b/target/linux/ath79/dts/qca9558_belkin_f9j1108-v2.dts @@ -0,0 +1,229 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca955x.dtsi" + +#include +#include + +/ { + model = "Belkin F9J1108 v2 (AC1750 DB Wi-Fi)"; + compatible = "belkin,f9j1108-v2", "qca,qca9558"; + + aliases { + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; + label-mac-device = ð1; + }; + + leds { + compatible = "gpio-leds"; + + usb { + label = "green:usb2"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + trigger-sources = <&hub_port0>; + linux,default-trigger = "usbport"; + }; + + status { + label = "amber:status"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + wps-amber { + label = "amber:wps"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + wps-blue { + label = "blue:wps"; + gpios = <&gpio 19 GPIO_ACTIVE_LOW>; + }; + + led_system: system { + label = "blue:system"; + gpios = <&gpio 20 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-export { + compatible = "gpio-export"; + #size-cells = <0>; + + usb2_power { + gpio-export,name = "usb2:power"; + gpio-export,output = <1>; + gpios = <&gpio 21 GPIO_ACTIVE_HIGH>; + }; + }; + + keys { + compatible = "gpio-keys"; + + wps { + label = "WPS button"; + linux,code = ; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + reset { + label = "Reset button"; + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + virtual_flash { + compatible = "mtd-concat"; + + devices = <&fwpart1 &fwpart2>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + compatible = "openwrt,okli"; + label = "firmware"; + reg = <0x0 0x0>; + }; + }; + }; +}; + +&pcie1 { + status = "okay"; +}; + +&uart { + status = "okay"; +}; + +&usb_phy0 { + status = "okay"; +}; + +&usb0 { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + hub_port0: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <80000000>; + m25p,fast-read; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + uboot: partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x010000>; + }; + + fwpart1: partition@50000 { + label = "fwpart1"; + reg = <0x050000 0xe20000>; + }; + + partition@e70000 { + label = "loader"; + reg = <0xe70000 0x10000>; + read-only; + }; + + fwpart2: partition@e80000 { + label = "fwpart2"; + reg = <0xe80000 0x170000>; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + }; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy0: ethernet-phy@0 { + reg = <0>; + + qca,ar8327-initvals = < + 0x04 0x00080080 /* PORT0 PAD MODE CTRL */ + 0x0c 0x07600000 /* PORT6 PAD MODE CTRL */ + 0x50 0xc737c737 /* LED_CTRL0 */ + 0x54 0x00000000 /* LED_CTRL1 */ + 0x58 0x00000000 /* LED_CTRL2 */ + 0x5c 0x0030c300 /* LED_CTRL3 */ + 0x7c 0x0000007e /* PORT0_STATUS */ + 0x94 0x0000007e /* PORT6 STATUS */ + >; + }; +}; + +ð0 { + status = "okay"; + + mtd-mac-address = <&art 0x0>; + phy-handle = <&phy0>; + pll-data = <0xa6000000 0x00000101 0x00001616>; + + gmac-config { + device = <&gmac>; + rgmii-enabled = <1>; + }; +}; + +ð1 { + status = "okay"; + + mtd-mac-address = <&art 0x0>; + mtd-mac-address-increment = <(-1)>; + pll-data = <0x03000101 0x00000101 0x00001616>; + + fixed-link { + speed = <1000>; + full-duplex; + }; +}; + +&pcie0 { + status = "okay"; + + wifi@0,0 { + compatible = "qcom,ath10k"; + reg = <0 0 0 0 0>; + }; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; 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 149f7b1141..987b405431 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 @@ -100,6 +100,15 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2" ;; + belkin,f9j1108-v2|\ + tplink,archer-c5-v1|\ + tplink,archer-c7-v1|\ + tplink,archer-c7-v2|\ + tplink,tl-wdr4900-v2|\ + tplink,tl-wdr7500-v3) + ucidef_add_switch "switch0" \ + "0@eth1" "2:lan" "3:lan" "4:lan" "5:lan" "6@eth0" "1:wan" + ;; buffalo,bhr-4grv|\ buffalo,wzr-hp-g450h) ucidef_add_switch "switch0" \ @@ -308,14 +317,6 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1" ;; - tplink,archer-c5-v1|\ - tplink,archer-c7-v1|\ - tplink,archer-c7-v2|\ - tplink,tl-wdr4900-v2|\ - tplink,tl-wdr7500-v3) - ucidef_add_switch "switch0" \ - "0@eth1" "2:lan" "3:lan" "4:lan" "5:lan" "6@eth0" "1:wan" - ;; tplink,archer-d50-v1) ucidef_add_switch "switch0" \ "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1" "1:wan" diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 614f9ff0b2..d5fbd89c26 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -50,6 +50,24 @@ define Build/cybertan-trx -rm $@-empty.bin endef +define Build/edimax-headers + $(eval edimax_magic=$(word 1,$(1))) + $(eval edimax_model=$(word 2,$(1))) + + $(STAGING_DIR_HOST)/bin/edimax_fw_header -M $(edimax_magic) -m $(edimax_model)\ + -v $(VERSION_DIST)$(firstword $(subst +, , $(firstword $(subst -, ,$(REVISION))))) \ + -n "uImage" \ + -i $(KDIR)/loader-$(DEVICE_NAME).uImage \ + -o $@.uImage + $(STAGING_DIR_HOST)/bin/edimax_fw_header -M $(edimax_magic) -m $(edimax_model)\ + -v $(VERSION_DIST)$(firstword $(subst +, , $(firstword $(subst -, ,$(REVISION))))) \ + -n "rootfs" \ + -i $@ \ + -o $@.rootfs + cat $@.uImage $@.rootfs > $@ + rm -rf $@.uImage $@.rootfs +endef + # This needs to make /tmp/_sys/sysupgrade.tgz an empty file prior to # sysupgrade, as otherwise it will implant the old configuration from # OEM firmware when writing rootfs from factory.bin @@ -363,6 +381,27 @@ define Device/avm_fritzdvbc endef TARGET_DEVICES += avm_fritzdvbc +define Device/belkin_f9j1108-v2 + SOC := qca9558 + DEVICE_VENDOR := Belkin + DEVICE_MODEL := F9J1108 v2 (AC1750 DB Wi-Fi) + IMAGE_SIZE := 14464k + DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct kmod-usb2 \ + kmod-usb3 kmod-usb-ledtrig-usbport + LOADER_TYPE := bin + LOADER_FLASH_OFFS := 0x50000 + COMPILE := loader-$(1).bin loader-$(1).uImage + COMPILE/loader-$(1).bin := loader-okli-compile + COMPILE/loader-$(1).uImage := append-loader-okli $(1) | pad-to 64k | \ + lzma | uImage lzma + KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x4f4b4c49 + IMAGES += factory.bin + IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \ + append-rootfs | pad-rootfs | check-size | \ + edimax-headers F9J1108v1 BR-6679BAC | pad-to $$$$(BLOCKSIZE) +endef +TARGET_DEVICES += belkin_f9j1108-v2 + define Device/buffalo_bhr-4grv $(Device/buffalo_common) SOC := ar7242 From e6a181dceafbe2043931f6a048a40a4ed277537a Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Tue, 1 Dec 2020 14:48:41 +0100 Subject: [PATCH 25/65] ramips: simplify status for ehci/ohci on mt7628 TP-Link devices At the moment, ehci/ohci is enabled in mt7628an SoC DTSI, then disabled in the TP-Link-specific DTSI files, and finally enabled again in the DTS files of the devices needing it. This on-off-on scheme is hard to grasp on a quick look. Thus, this patch drops the status in the TP-Link-specific DTSI files, having the TP-Link devices treated like the rest of mt7628an DTSes, i.e. ehci/ohci is enabled by default and needs to be disabled explicitly where needed. Signed-off-by: Adrian Schmutzler --- .../linux/ramips/dts/mt7628an_tplink_8m-split-uboot.dtsi | 8 -------- target/linux/ramips/dts/mt7628an_tplink_8m.dtsi | 8 -------- target/linux/ramips/dts/mt7628an_tplink_archer-c20-v4.dts | 8 ++++++++ target/linux/ramips/dts/mt7628an_tplink_archer-c20-v5.dts | 8 ++++++++ target/linux/ramips/dts/mt7628an_tplink_archer-c50-v3.dts | 8 ++++++++ target/linux/ramips/dts/mt7628an_tplink_archer-c50-v4.dts | 8 ++++++++ target/linux/ramips/dts/mt7628an_tplink_tl-mr3420-v5.dts | 8 -------- target/linux/ramips/dts/mt7628an_tplink_tl-mr6400-v4.dts | 8 -------- target/linux/ramips/dts/mt7628an_tplink_tl-mr6400-v5.dts | 8 -------- target/linux/ramips/dts/mt7628an_tplink_tl-wa801nd-v5.dts | 8 ++++++++ target/linux/ramips/dts/mt7628an_tplink_tl-wr802n-v4.dts | 8 ++++++++ target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v4.dts | 8 ++++++++ target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v13.dts | 8 ++++++++ target/linux/ramips/dts/mt7628an_tplink_tl-wr842n-v5.dts | 8 -------- target/linux/ramips/dts/mt7628an_tplink_tl-wr850n-v2.dts | 8 ++++++++ target/linux/ramips/dts/mt7628an_tplink_tl-wr902ac-v3.dts | 8 -------- 16 files changed, 72 insertions(+), 56 deletions(-) diff --git a/target/linux/ramips/dts/mt7628an_tplink_8m-split-uboot.dtsi b/target/linux/ramips/dts/mt7628an_tplink_8m-split-uboot.dtsi index 7f7e5ac8b4..b6ce7b1f56 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_8m-split-uboot.dtsi +++ b/target/linux/ramips/dts/mt7628an_tplink_8m-split-uboot.dtsi @@ -72,14 +72,6 @@ }; }; -&ehci { - status = "disabled"; -}; - -&ohci { - status = "disabled"; -}; - &wmac { status = "okay"; mtd-mac-address = <&rom 0xf100>; diff --git a/target/linux/ramips/dts/mt7628an_tplink_8m.dtsi b/target/linux/ramips/dts/mt7628an_tplink_8m.dtsi index b134badb15..2faf8a87fe 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_8m.dtsi +++ b/target/linux/ramips/dts/mt7628an_tplink_8m.dtsi @@ -53,14 +53,6 @@ }; }; -&ehci { - status = "disabled"; -}; - -&ohci { - status = "disabled"; -}; - &wmac { status = "okay"; mtd-mac-address = <&factory 0xf100>; diff --git a/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v4.dts b/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v4.dts index f6321bb15f..58743db6b4 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v4.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v4.dts @@ -69,6 +69,14 @@ }; }; +&ehci { + status = "disabled"; +}; + +&ohci { + status = "disabled"; +}; + &wmac { mtd-mac-address-increment = <(-2)>; }; diff --git a/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v5.dts b/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v5.dts index 7969bfc733..d76ce34ca9 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v5.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v5.dts @@ -71,6 +71,14 @@ }; }; +&ehci { + status = "disabled"; +}; + +&ohci { + status = "disabled"; +}; + &state_default { gpio { groups = "i2s", "gpio", "refclk", "p0led_an", "p1led_an", diff --git a/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v3.dts b/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v3.dts index ea53870eeb..4966d56a68 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v3.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v3.dts @@ -67,6 +67,14 @@ }; }; +&ehci { + status = "disabled"; +}; + +&ohci { + status = "disabled"; +}; + &state_default { gpio { groups = "i2c", "gpio", "p0led_an", "p1led_an", "p2led_an", diff --git a/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v4.dts b/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v4.dts index 4ca0cd61a5..11bf903531 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v4.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v4.dts @@ -69,6 +69,14 @@ }; }; +&ehci { + status = "disabled"; +}; + +&ohci { + status = "disabled"; +}; + &state_default { gpio { groups = "i2c", "p0led_an", "p1led_an", "p2led_an", diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-mr3420-v5.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-mr3420-v5.dts index 8e602331f3..173b4cddca 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-mr3420-v5.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-mr3420-v5.dts @@ -69,14 +69,6 @@ }; }; -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; - &state_default { gpio { groups = "i2c", "i2s", "p2led_an", "refclk", "uart1", "wdt", "wled_an"; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-mr6400-v4.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-mr6400-v4.dts index 787abfad55..a142be7870 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-mr6400-v4.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-mr6400-v4.dts @@ -70,14 +70,6 @@ }; }; -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; - &state_default { gpio { groups = "p0led_an", "p1led_an", "p2led_an", "p3led_an", "p4led_an", "refclk", "uart1", "wdt", "wled_an"; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-mr6400-v5.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-mr6400-v5.dts index 71e9694dde..7ab19632e8 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-mr6400-v5.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-mr6400-v5.dts @@ -70,14 +70,6 @@ }; }; -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; - &state_default { gpio { groups = "i2c", "p0led_an", "p1led_an", "p2led_an", "p3led_an", "p4led_an", "uart1", "wdt"; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-wa801nd-v5.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wa801nd-v5.dts index 21c09ec5d9..de9a48445a 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-wa801nd-v5.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wa801nd-v5.dts @@ -58,6 +58,14 @@ }; }; +&ehci { + status = "disabled"; +}; + +&ohci { + status = "disabled"; +}; + &state_default { gpio { groups = "p0led_an", "p1led_an", "perst", "refclk", diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-wr802n-v4.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr802n-v4.dts index d6077b4c0e..bce34045c6 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-wr802n-v4.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr802n-v4.dts @@ -33,6 +33,14 @@ }; }; +&ehci { + status = "disabled"; +}; + +&ohci { + status = "disabled"; +}; + &state_default { gpio { groups = "refclk", "wdt"; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v4.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v4.dts index f960a0ae8f..8a8ba81ec3 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v4.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v4.dts @@ -51,6 +51,14 @@ }; }; +&ehci { + status = "disabled"; +}; + +&ohci { + status = "disabled"; +}; + &state_default { gpio { groups = "p0led_an", "p2led_an", "perst", "refclk", "wdt", "wled_an"; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v13.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v13.dts index c4c83b8549..5c7f9836b6 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v13.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v13.dts @@ -77,6 +77,14 @@ }; }; +&ehci { + status = "disabled"; +}; + +&ohci { + status = "disabled"; +}; + &state_default { gpio { groups = "gpio", "p0led_an", "p1led_an", "p2led_an", "p3led_an", "p4led_an", "perst", "refclk", "uart1", "wdt", "wled_an"; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-wr842n-v5.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr842n-v5.dts index e843672600..9077ec00ce 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-wr842n-v5.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr842n-v5.dts @@ -69,14 +69,6 @@ }; }; -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; - &state_default { gpio { groups = "i2c", "i2s", "p2led_an", "refclk", "uart1", "wdt", "wled_an"; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-wr850n-v2.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr850n-v2.dts index 1fec73d4dc..7abeae9c07 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-wr850n-v2.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr850n-v2.dts @@ -54,6 +54,14 @@ }; }; +&ehci { + status = "disabled"; +}; + +&ohci { + status = "disabled"; +}; + &state_default { gpio { groups = "p0led_an", "p2led_an", "perst", "refclk", "wdt", "wled_an"; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-wr902ac-v3.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr902ac-v3.dts index bce394747b..77a68acf34 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-wr902ac-v3.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr902ac-v3.dts @@ -83,14 +83,6 @@ }; }; -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; - &pcie { status = "okay"; }; From 66d12ce667ce9cac249736eebfa95786a9ae2a54 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Tue, 1 Dec 2020 14:48:42 +0100 Subject: [PATCH 26/65] ramips: remove redundant status for USB controllers mt7621, mt7628an and rt5350 have USB controllers (ehci/ohci or xhci) enabled by default. Thus, this patch drops redundant status=okay statements in derived device DTS files. While at it, also drop an explicit status=okay in mt7621.dtsi, as this is default. Note: For rt5350, about 50 % of the devices enabled ehci/ohci in the DTS files, and there is actually no device actively disabling it. It looks like only a few people are aware that the controllers are enabled by default here. Signed-off-by: Adrian Schmutzler --- target/linux/ramips/dts/mt7621.dtsi | 1 - target/linux/ramips/dts/mt7621_youku_yk-l2.dts | 4 ---- target/linux/ramips/dts/mt7628an_glinet_gl-mt300n-v2.dts | 8 -------- target/linux/ramips/dts/mt7628an_ravpower_rp-wd009.dts | 8 -------- target/linux/ramips/dts/mt7628an_skylab_skw92a.dts | 8 -------- target/linux/ramips/dts/mt7628an_tama_w06.dts | 8 -------- target/linux/ramips/dts/mt7628an_tplink_tl-mr3020-v3.dts | 8 -------- .../linux/ramips/dts/mt7628an_zyxel_keenetic-extra-ii.dts | 8 -------- target/linux/ramips/dts/rt5350_allnet_all5003.dts | 8 -------- target/linux/ramips/dts/rt5350_asiarf_awm002-evb.dtsi | 8 -------- target/linux/ramips/dts/rt5350_dlink_dcs-930l-b1.dts | 8 -------- target/linux/ramips/dts/rt5350_dlink_dir-320-b1.dts | 8 -------- target/linux/ramips/dts/rt5350_easyacc_wizard-8800.dts | 8 -------- target/linux/ramips/dts/rt5350_hame_mpr-a1.dts | 8 -------- target/linux/ramips/dts/rt5350_hame_mpr-a2.dts | 8 -------- target/linux/ramips/dts/rt5350_hilink_hlk-rm04.dts | 8 -------- target/linux/ramips/dts/rt5350_hootoo_ht-tm02.dts | 8 -------- target/linux/ramips/dts/rt5350_intenso_memory2move.dts | 8 -------- target/linux/ramips/dts/rt5350_nexx_wt1520.dtsi | 8 -------- target/linux/ramips/dts/rt5350_nixcore_x1.dtsi | 8 -------- .../linux/ramips/dts/rt5350_olimex_rt5350f-olinuxino.dtsi | 8 -------- target/linux/ramips/dts/rt5350_omnima_miniembplug.dts | 8 -------- target/linux/ramips/dts/rt5350_poray_m3.dts | 8 -------- target/linux/ramips/dts/rt5350_poray_m4.dtsi | 8 -------- target/linux/ramips/dts/rt5350_poray_x5.dts | 8 -------- target/linux/ramips/dts/rt5350_poray_x8.dts | 8 -------- target/linux/ramips/dts/rt5350_tenda_3g150b.dts | 8 -------- target/linux/ramips/dts/rt5350_trendnet_tew-714tru.dts | 8 -------- target/linux/ramips/dts/rt5350_unbranded_a5-v11.dts | 8 -------- target/linux/ramips/dts/rt5350_vocore_vocore.dtsi | 8 -------- target/linux/ramips/dts/rt5350_wansview_ncs601w.dts | 8 -------- target/linux/ramips/dts/rt5350_wiznet_wizfi630a.dts | 8 -------- 32 files changed, 245 deletions(-) diff --git a/target/linux/ramips/dts/mt7621.dtsi b/target/linux/ramips/dts/mt7621.dtsi index 1c19545443..7636f9d800 100644 --- a/target/linux/ramips/dts/mt7621.dtsi +++ b/target/linux/ramips/dts/mt7621.dtsi @@ -371,7 +371,6 @@ xhci: xhci@1E1C0000 { #address-cells = <1>; #size-cells = <0>; - status = "okay"; compatible = "mediatek,mt8173-xhci"; reg = <0x1e1c0000 0x1000 diff --git a/target/linux/ramips/dts/mt7621_youku_yk-l2.dts b/target/linux/ramips/dts/mt7621_youku_yk-l2.dts index fd4395985c..627188873d 100644 --- a/target/linux/ramips/dts/mt7621_youku_yk-l2.dts +++ b/target/linux/ramips/dts/mt7621_youku_yk-l2.dts @@ -63,10 +63,6 @@ status = "okay"; }; -&xhci { - status = "okay"; -}; - &spi0 { status = "okay"; diff --git a/target/linux/ramips/dts/mt7628an_glinet_gl-mt300n-v2.dts b/target/linux/ramips/dts/mt7628an_glinet_gl-mt300n-v2.dts index 4ebe0cf11f..c5e0c2e02b 100644 --- a/target/linux/ramips/dts/mt7628an_glinet_gl-mt300n-v2.dts +++ b/target/linux/ramips/dts/mt7628an_glinet_gl-mt300n-v2.dts @@ -131,11 +131,3 @@ &uart1 { status = "okay"; }; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/dts/mt7628an_ravpower_rp-wd009.dts b/target/linux/ramips/dts/mt7628an_ravpower_rp-wd009.dts index 95d7750be0..6962651e1b 100644 --- a/target/linux/ramips/dts/mt7628an_ravpower_rp-wd009.dts +++ b/target/linux/ramips/dts/mt7628an_ravpower_rp-wd009.dts @@ -93,14 +93,6 @@ }; }; -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; - &sdhci { status = "okay"; }; diff --git a/target/linux/ramips/dts/mt7628an_skylab_skw92a.dts b/target/linux/ramips/dts/mt7628an_skylab_skw92a.dts index 111f70a8d5..6e1cb396b8 100644 --- a/target/linux/ramips/dts/mt7628an_skylab_skw92a.dts +++ b/target/linux/ramips/dts/mt7628an_skylab_skw92a.dts @@ -97,11 +97,3 @@ &uart1 { status = "okay"; }; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/dts/mt7628an_tama_w06.dts b/target/linux/ramips/dts/mt7628an_tama_w06.dts index 26e5ab00a5..2be5f3fc88 100644 --- a/target/linux/ramips/dts/mt7628an_tama_w06.dts +++ b/target/linux/ramips/dts/mt7628an_tama_w06.dts @@ -37,18 +37,10 @@ }; }; -&ehci { - status = "okay"; -}; - ðernet { mtd-mac-address = <&factory 0x28>; }; -&ohci { - status = "okay"; -}; - &state_default { gpio { groups = "uart1", "p0led_an", "wdt"; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-mr3020-v3.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-mr3020-v3.dts index a45019e2d0..5bc12758d4 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-mr3020-v3.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-mr3020-v3.dts @@ -114,14 +114,6 @@ }; }; -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; - &state_default { gpio { groups = "i2s", "refclk", "wdt", "p2led_an", "p1led_an", "p0led_an", "wled_an"; diff --git a/target/linux/ramips/dts/mt7628an_zyxel_keenetic-extra-ii.dts b/target/linux/ramips/dts/mt7628an_zyxel_keenetic-extra-ii.dts index 47e4b429a9..5e92cd2126 100644 --- a/target/linux/ramips/dts/mt7628an_zyxel_keenetic-extra-ii.dts +++ b/target/linux/ramips/dts/mt7628an_zyxel_keenetic-extra-ii.dts @@ -167,14 +167,6 @@ }; }; -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; - ðernet { mtd-mac-address = <&factory 0x4>; }; diff --git a/target/linux/ramips/dts/rt5350_allnet_all5003.dts b/target/linux/ramips/dts/rt5350_allnet_all5003.dts index 335a85dc00..96dde0fbf1 100644 --- a/target/linux/ramips/dts/rt5350_allnet_all5003.dts +++ b/target/linux/ramips/dts/rt5350_allnet_all5003.dts @@ -101,11 +101,3 @@ &wmac { ralink,mtd-eeprom = <&factory 0x0>; }; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/dts/rt5350_asiarf_awm002-evb.dtsi b/target/linux/ramips/dts/rt5350_asiarf_awm002-evb.dtsi index 07e088652c..80965a48b8 100644 --- a/target/linux/ramips/dts/rt5350_asiarf_awm002-evb.dtsi +++ b/target/linux/ramips/dts/rt5350_asiarf_awm002-evb.dtsi @@ -61,11 +61,3 @@ &esw { mediatek,portmap = <0x3f>; }; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/dts/rt5350_dlink_dcs-930l-b1.dts b/target/linux/ramips/dts/rt5350_dlink_dcs-930l-b1.dts index fcff567885..58a8407301 100644 --- a/target/linux/ramips/dts/rt5350_dlink_dcs-930l-b1.dts +++ b/target/linux/ramips/dts/rt5350_dlink_dcs-930l-b1.dts @@ -104,11 +104,3 @@ &wmac { ralink,mtd-eeprom = <&factory 0x0>; }; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/dts/rt5350_dlink_dir-320-b1.dts b/target/linux/ramips/dts/rt5350_dlink_dir-320-b1.dts index bc3e431982..7d9bb0e359 100644 --- a/target/linux/ramips/dts/rt5350_dlink_dir-320-b1.dts +++ b/target/linux/ramips/dts/rt5350_dlink_dir-320-b1.dts @@ -127,11 +127,3 @@ &wmac { ralink,mtd-eeprom = <&factory 0x0>; }; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/dts/rt5350_easyacc_wizard-8800.dts b/target/linux/ramips/dts/rt5350_easyacc_wizard-8800.dts index 336073f155..43769eeb62 100644 --- a/target/linux/ramips/dts/rt5350_easyacc_wizard-8800.dts +++ b/target/linux/ramips/dts/rt5350_easyacc_wizard-8800.dts @@ -64,14 +64,6 @@ mediatek,portmap = <0x2f>; }; -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; - &wmac { ralink,mtd-eeprom = <&factory 0x0>; }; diff --git a/target/linux/ramips/dts/rt5350_hame_mpr-a1.dts b/target/linux/ramips/dts/rt5350_hame_mpr-a1.dts index 2635134348..5054a8c211 100644 --- a/target/linux/ramips/dts/rt5350_hame_mpr-a1.dts +++ b/target/linux/ramips/dts/rt5350_hame_mpr-a1.dts @@ -119,11 +119,3 @@ &wmac { ralink,mtd-eeprom = <&factory 0x0>; }; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/dts/rt5350_hame_mpr-a2.dts b/target/linux/ramips/dts/rt5350_hame_mpr-a2.dts index 500f6ebd01..f9365d5700 100644 --- a/target/linux/ramips/dts/rt5350_hame_mpr-a2.dts +++ b/target/linux/ramips/dts/rt5350_hame_mpr-a2.dts @@ -116,11 +116,3 @@ &wmac { ralink,mtd-eeprom = <&factory 0x0>; }; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/dts/rt5350_hilink_hlk-rm04.dts b/target/linux/ramips/dts/rt5350_hilink_hlk-rm04.dts index 432110b875..83b1fb2a6d 100644 --- a/target/linux/ramips/dts/rt5350_hilink_hlk-rm04.dts +++ b/target/linux/ramips/dts/rt5350_hilink_hlk-rm04.dts @@ -109,11 +109,3 @@ &wmac { ralink,mtd-eeprom = <&factory 0x0>; }; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/dts/rt5350_hootoo_ht-tm02.dts b/target/linux/ramips/dts/rt5350_hootoo_ht-tm02.dts index 9d4de243aa..543fda74b7 100644 --- a/target/linux/ramips/dts/rt5350_hootoo_ht-tm02.dts +++ b/target/linux/ramips/dts/rt5350_hootoo_ht-tm02.dts @@ -106,11 +106,3 @@ &wmac { ralink,mtd-eeprom = <&factory 0x0>; }; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/dts/rt5350_intenso_memory2move.dts b/target/linux/ramips/dts/rt5350_intenso_memory2move.dts index 769aec6a50..8ab2a87304 100644 --- a/target/linux/ramips/dts/rt5350_intenso_memory2move.dts +++ b/target/linux/ramips/dts/rt5350_intenso_memory2move.dts @@ -105,14 +105,6 @@ mediatek,portmap = <0x2f>; }; -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; - &wmac { ralink,mtd-eeprom = <&factory 0x0>; }; diff --git a/target/linux/ramips/dts/rt5350_nexx_wt1520.dtsi b/target/linux/ramips/dts/rt5350_nexx_wt1520.dtsi index dbe925508a..540fd253eb 100644 --- a/target/linux/ramips/dts/rt5350_nexx_wt1520.dtsi +++ b/target/linux/ramips/dts/rt5350_nexx_wt1520.dtsi @@ -32,11 +32,3 @@ &wmac { ralink,mtd-eeprom = <&factory 0x0>; }; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/dts/rt5350_nixcore_x1.dtsi b/target/linux/ramips/dts/rt5350_nixcore_x1.dtsi index b837d5c67c..2459c6b65b 100644 --- a/target/linux/ramips/dts/rt5350_nixcore_x1.dtsi +++ b/target/linux/ramips/dts/rt5350_nixcore_x1.dtsi @@ -139,11 +139,3 @@ &wmac { ralink,mtd-eeprom = <&factory 0x0>; }; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/dts/rt5350_olimex_rt5350f-olinuxino.dtsi b/target/linux/ramips/dts/rt5350_olimex_rt5350f-olinuxino.dtsi index 3d1968a03c..902cc6e522 100644 --- a/target/linux/ramips/dts/rt5350_olimex_rt5350f-olinuxino.dtsi +++ b/target/linux/ramips/dts/rt5350_olimex_rt5350f-olinuxino.dtsi @@ -78,14 +78,6 @@ ralink,led-polarity = <1>; }; -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; - &i2c { status = "okay"; }; diff --git a/target/linux/ramips/dts/rt5350_omnima_miniembplug.dts b/target/linux/ramips/dts/rt5350_omnima_miniembplug.dts index b5583eb892..499b555da4 100644 --- a/target/linux/ramips/dts/rt5350_omnima_miniembplug.dts +++ b/target/linux/ramips/dts/rt5350_omnima_miniembplug.dts @@ -111,11 +111,3 @@ &wmac { ralink,mtd-eeprom = <&factory 0x0>; }; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/dts/rt5350_poray_m3.dts b/target/linux/ramips/dts/rt5350_poray_m3.dts index 1fc4959639..b6bad0ab77 100644 --- a/target/linux/ramips/dts/rt5350_poray_m3.dts +++ b/target/linux/ramips/dts/rt5350_poray_m3.dts @@ -102,11 +102,3 @@ ralink,mtd-eeprom = <&factory 0x0>; ralink,led-polarity = <1>; }; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/dts/rt5350_poray_m4.dtsi b/target/linux/ramips/dts/rt5350_poray_m4.dtsi index c4ca6ab6cd..9b36961ffb 100644 --- a/target/linux/ramips/dts/rt5350_poray_m4.dtsi +++ b/target/linux/ramips/dts/rt5350_poray_m4.dtsi @@ -54,11 +54,3 @@ ralink,mtd-eeprom = <&factory 0x0>; ralink,led-polarity = <1>; }; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/dts/rt5350_poray_x5.dts b/target/linux/ramips/dts/rt5350_poray_x5.dts index bbc1c14e65..9c00da82ed 100644 --- a/target/linux/ramips/dts/rt5350_poray_x5.dts +++ b/target/linux/ramips/dts/rt5350_poray_x5.dts @@ -134,11 +134,3 @@ ralink,mtd-eeprom = <&factory 0x0>; ralink,led-polarity = <1>; }; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/dts/rt5350_poray_x8.dts b/target/linux/ramips/dts/rt5350_poray_x8.dts index b36dd46f57..b60bb99ee9 100644 --- a/target/linux/ramips/dts/rt5350_poray_x8.dts +++ b/target/linux/ramips/dts/rt5350_poray_x8.dts @@ -95,11 +95,3 @@ ralink,mtd-eeprom = <&factory 0x0>; ralink,led-polarity = <1>; }; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/dts/rt5350_tenda_3g150b.dts b/target/linux/ramips/dts/rt5350_tenda_3g150b.dts index 9bfa793646..a20cd04a26 100644 --- a/target/linux/ramips/dts/rt5350_tenda_3g150b.dts +++ b/target/linux/ramips/dts/rt5350_tenda_3g150b.dts @@ -116,11 +116,3 @@ ralink,mtd-eeprom = <&factory 0x0>; ralink,led-polarity = <1>; }; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/dts/rt5350_trendnet_tew-714tru.dts b/target/linux/ramips/dts/rt5350_trendnet_tew-714tru.dts index 11765f10c6..13d1a16741 100644 --- a/target/linux/ramips/dts/rt5350_trendnet_tew-714tru.dts +++ b/target/linux/ramips/dts/rt5350_trendnet_tew-714tru.dts @@ -115,11 +115,3 @@ &wmac { ralink,mtd-eeprom = <&factory 0x0>; }; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/dts/rt5350_unbranded_a5-v11.dts b/target/linux/ramips/dts/rt5350_unbranded_a5-v11.dts index 42e6dcfb4e..2173ec4fba 100644 --- a/target/linux/ramips/dts/rt5350_unbranded_a5-v11.dts +++ b/target/linux/ramips/dts/rt5350_unbranded_a5-v11.dts @@ -121,11 +121,3 @@ &wmac { ralink,mtd-eeprom = <&factory 0x0>; }; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/dts/rt5350_vocore_vocore.dtsi b/target/linux/ramips/dts/rt5350_vocore_vocore.dtsi index a905e023cb..0c82919669 100644 --- a/target/linux/ramips/dts/rt5350_vocore_vocore.dtsi +++ b/target/linux/ramips/dts/rt5350_vocore_vocore.dtsi @@ -184,14 +184,6 @@ ralink,mtd-eeprom = <&factory 0x0>; }; -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; - &spi1 { status = "okay"; diff --git a/target/linux/ramips/dts/rt5350_wansview_ncs601w.dts b/target/linux/ramips/dts/rt5350_wansview_ncs601w.dts index c6eced34ba..adb4034e8a 100644 --- a/target/linux/ramips/dts/rt5350_wansview_ncs601w.dts +++ b/target/linux/ramips/dts/rt5350_wansview_ncs601w.dts @@ -63,11 +63,3 @@ &wmac { ralink,mtd-eeprom = <&factory 0x0>; }; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/dts/rt5350_wiznet_wizfi630a.dts b/target/linux/ramips/dts/rt5350_wiznet_wizfi630a.dts index 9a2c0a606c..314c4091a4 100644 --- a/target/linux/ramips/dts/rt5350_wiznet_wizfi630a.dts +++ b/target/linux/ramips/dts/rt5350_wiznet_wizfi630a.dts @@ -144,11 +144,3 @@ &wmac { ralink,mtd-eeprom = <&factory 0x0>; }; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; From 0eb2fa39f313cac1e1e76c09e6ecf204064697a9 Mon Sep 17 00:00:00 2001 From: Stijn Tintel Date: Fri, 4 Dec 2020 18:32:46 +0200 Subject: [PATCH 27/65] rules.mk: use -fPIC instead of -fpic on arm64 Some packages fail to build on arm64 when PKG_ASLR_PIE_ALL=y, due to machine-specific size restrictions on the global offset table. While the manual instructs to recompile with -fPIC if it fails with -fpic, by doing this per package, there is still a risk of random breakage due to version bumps or other changes, so let's use -fPIC on arm64 by default. While comparing the sizes of 141 packages built with -fpic vs -fPIC, most packages are either equal or smaller in size. Only 9 of the compared packages turned out slightly larger. Signed-off-by: Stijn Tintel --- rules.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules.mk b/rules.mk index 34222a3a71..f79340b124 100644 --- a/rules.mk +++ b/rules.mk @@ -77,7 +77,7 @@ IS_PACKAGE_BUILD := $(if $(filter package/%,$(BUILD_SUBDIR)),1) OPTIMIZE_FOR_CPU=$(subst i386,i486,$(ARCH)) -ifeq ($(ARCH),powerpc) +ifneq (,$(findstring $(ARCH) , aarch64 aarch64_be powerpc )) FPIC:=-fPIC else FPIC:=-fpic From 0ba83a757728185eabd965e07331508923cca825 Mon Sep 17 00:00:00 2001 From: Stijn Tintel Date: Fri, 4 Dec 2020 19:16:26 +0200 Subject: [PATCH 28/65] build: require rsync It seems to be required to build toolchain/kernel-headers. Signed-off-by: Stijn Tintel --- README.md | 2 +- include/prereq-build.mk | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8d9a616ac5..21acbf4b80 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ documentation. ``` gcc binutils bzip2 flex python3 perl make find grep diff unzip gawk getopt -subversion libz-dev libc-dev +subversion libz-dev libc-dev rsync ``` ### Quickstart diff --git a/include/prereq-build.mk b/include/prereq-build.mk index e7314b253b..5045fabdfb 100644 --- a/include/prereq-build.mk +++ b/include/prereq-build.mk @@ -170,6 +170,9 @@ $(eval $(call SetupHostCommand,git,Please install Git (git-core) >= 1.7.12.2, \ $(eval $(call SetupHostCommand,file,Please install the 'file' package, \ file --version 2>&1 | grep file)) +$(eval $(call SetupHostCommand,rsync,Please install 'rsync', \ + rsync --version Date: Sat, 5 Dec 2020 01:21:05 -0800 Subject: [PATCH 29/65] libcxx[abi]: remove This is a neat project, but offers no benefit to OpenWrt. The initial reason for it was to be a replacement for libstdcpp as it is smaller and lacks compatibility for C++98. Unfortunately, compiling several packages with it results in larger ipk sizes. While not a member of the packages feed, this will be moved to packages-abandoned to keep it somewhere. Signed-off-by: Rosen Penev --- config/Config-build.in | 4 -- include/uclibc++.mk | 12 +--- package/libs/libcxx/Makefile | 66 ------------------ package/libs/libcxx/files/g++-libcxx | 19 ------ package/libs/libcxx/patches/010-ssp.patch | 13 ---- package/libs/libcxxabi/Makefile | 71 -------------------- package/libs/libcxxabi/patches/010-arm.patch | 27 -------- 7 files changed, 2 insertions(+), 210 deletions(-) delete mode 100644 package/libs/libcxx/Makefile delete mode 100755 package/libs/libcxx/files/g++-libcxx delete mode 100644 package/libs/libcxx/patches/010-ssp.patch delete mode 100644 package/libs/libcxxabi/Makefile delete mode 100644 package/libs/libcxxabi/patches/010-arm.patch diff --git a/config/Config-build.in b/config/Config-build.in index a54df11566..cfefa4eed3 100644 --- a/config/Config-build.in +++ b/config/Config-build.in @@ -215,10 +215,6 @@ menu "Global build settings" config USE_UCLIBCXX bool "uClibc++" - config USE_LIBCXX - bool "libc++" - depends on !USE_UCLIBC - config USE_LIBSTDCXX bool "libstdc++" endchoice diff --git a/include/uclibc++.mk b/include/uclibc++.mk index 27533279c9..a1a61f26d4 100644 --- a/include/uclibc++.mk +++ b/include/uclibc++.mk @@ -4,8 +4,8 @@ ifndef DUMP endif endif -PKG_PREPARED_DEPENDS += CONFIG_USE_UCLIBCXX CONFIG_USE_LIBCXX -CXX_DEPENDS = +USE_UCLIBCXX:uclibcxx +USE_LIBCXX:libcxx +USE_LIBSTDCXX:libstdcpp +PKG_PREPARED_DEPENDS += CONFIG_USE_UCLIBCXX +CXX_DEPENDS = +USE_UCLIBCXX:uclibcxx +USE_LIBSTDCXX:libstdcpp ifneq ($(CONFIG_USE_UCLIBCXX),) ifneq ($(CONFIG_CCACHE),) @@ -14,11 +14,3 @@ ifneq ($(CONFIG_USE_UCLIBCXX),) TARGET_CXX=g++-uc endif endif - -ifneq ($(CONFIG_USE_LIBCXX),) - ifneq ($(CONFIG_CCACHE),) - TARGET_CXX_NOCACHE=g++-libcxx - else - TARGET_CXX=g++-libcxx - endif -endif diff --git a/package/libs/libcxx/Makefile b/package/libs/libcxx/Makefile deleted file mode 100644 index 3809bea651..0000000000 --- a/package/libs/libcxx/Makefile +++ /dev/null @@ -1,66 +0,0 @@ - -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=libcxx -PKG_VERSION:=10.0.0 -PKG_RELEASE:=1 - -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).src.tar.xz -PKG_SOURCE_URL:=https://github.com/llvm/llvm-project/releases/download/llvmorg-$(PKG_VERSION) -PKG_HASH:=270f8a3f176f1981b0f6ab8aa556720988872ec2b48ed3b605d0ced8d09156c7 -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION).src - -PKG_MAINTAINER:=Rosen Penev -PKG_LICENSE:=MIT -PKG_LICENSE_FILES:=LICENSE.txt - -PKG_BUILD_PARALLEL:=1 -PKG_BUILD_DEPENDS:=libcxxabi -CMAKE_BINARY_SUBDIR:=build - -include $(INCLUDE_DIR)/package.mk -include $(INCLUDE_DIR)/cmake.mk - -define Package/libcxx - SECTION:=libs - CATEGORY:=Libraries - TITLE:=LLVM libstdc++ - URL:=https://libcxx.llvm.org/ - DEPENDS:=+libatomic +libpthread -endef - -define Package/libcxx/description - libc++ is an implementation of the C++ standard library, targeting C++11, C++14 and above. -endef - -CMAKE_OPTIONS += \ - -DLIBCXX_CXX_ABI="libcxxabi" \ - -DLIBCXX_ENABLE_ASSERTIONS=OFF \ - -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF \ - -DLIBCXX_INCLUDE_BENCHMARKS=OFF \ - -DLIBCXX_INCLUDE_DOCS=OFF \ - -DLIBCXX_INCLUDE_TESTS=OFF \ - -DLIBCXX_LIBDIR_SUFFIX="" \ - -DLIBCXX_STANDALONE_BUILD=ON \ - -DLIBCXX_HAS_MUSL_LIBC=$(if $(CONFIG_USE_MUSL),ON,OFF) - -TARGET_CXXFLAGS += -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -Wno-attributes -flto -TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed - -define Build/InstallDev - $(call Build/InstallDev/cmake,$(1)) - $(CP) files/g++-libcxx $(TOOLCHAIN_DIR)/bin/ - $(SED) 's,CXX,$(TARGET_CXX),g' $(TOOLCHAIN_DIR)/bin/g++-libcxx -endef - -define Package/libcxx/install - $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libc++.so.* $(1)/usr/lib/ -endef - -$(eval $(call BuildPackage,libcxx)) diff --git a/package/libs/libcxx/files/g++-libcxx b/package/libs/libcxx/files/g++-libcxx deleted file mode 100755 index 88b3e7da01..0000000000 --- a/package/libs/libcxx/files/g++-libcxx +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -WRAPPER_INCLUDEDIR="-I$STAGING_DIR/usr/include/c++/v1" -WRAPPER_LIBDIR="-L$STAGING_DIR/usr/lib" -WRAPPER_LIBS="-lc -lgcc_s -lssp_nonshared" - -WRAPPER_OPTIONS="" -WRAPPER_INCLIB="Y" -for arg -do - case "$arg" in - -c|-E|-S) WRAPPER_INCLIB="N" ;; - -static) [ "$WRAPPER_LIBS" != "-lc -lgcc_s -lssp_nonshared -lgcc_eh" ] && WRAPPER_LIBS="-lc -lgcc_s -lssp_nonshared -lgcc_eh" ;; - esac -done -[ "$WRAPPER_INCLIB" = "Y" ] && WRAPPER_OPTIONS="-nodefaultlibs $WRAPPER_LIBDIR -lc++ -lc++abi $WRAPPER_LIBS" - -exec CXX -nostdinc++ -DGCC_HASCLASSVISIBILITY "$WRAPPER_INCLUDEDIR" "$@" $WRAPPER_OPTIONS - diff --git a/package/libs/libcxx/patches/010-ssp.patch b/package/libs/libcxx/patches/010-ssp.patch deleted file mode 100644 index f83c7b9b56..0000000000 --- a/package/libs/libcxx/patches/010-ssp.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -760,6 +760,10 @@ function(cxx_link_system_libraries targe - target_link_libraries(${target} PRIVATE atomic) - endif() - -+ if (LIBCXX_HAS_MUSL_LIBC) -+ target_link_libraries(${target} PRIVATE ssp_nonshared) -+ endif() -+ - if (MINGW) - target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}") - endif() diff --git a/package/libs/libcxxabi/Makefile b/package/libs/libcxxabi/Makefile deleted file mode 100644 index 90547561b2..0000000000 --- a/package/libs/libcxxabi/Makefile +++ /dev/null @@ -1,71 +0,0 @@ - -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=libcxxabi -PKG_VERSION:=10.0.0 -PKG_RELEASE:=1 - -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).src.tar.xz -PKG_SOURCE_URL:=https://github.com/llvm/llvm-project/releases/download/llvmorg-$(PKG_VERSION) -PKG_HASH:=e71bac75a88c9dde455ad3f2a2b449bf745eafd41d2d8432253b2964e0ca14e1 -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION).src - -PKG_MAINTAINER:=Rosen Penev -PKG_LICENSE:=MIT -PKG_LICENSE_FILES:=LICENSE.txt - -PKG_BUILD_PARALLEL:=1 -CMAKE_BINARY_SUBDIR:=build - -include $(INCLUDE_DIR)/package.mk -include $(INCLUDE_DIR)/cmake.mk - -define Package/libcxxabi - SECTION:=libs - CATEGORY:=Libraries - TITLE:=LLVM lib++abi - URL:=https://libcxxabi.llvm.org/ - DEPENDS:=+libpthread - BUILDONLY:=1 -endef - -define Package/libcxxabi/description - libc++abi is a new implementation of low level support for a standard C++ library. -endef - -CMAKE_OPTIONS += \ - -DLIBCXXABI_ENABLE_EXCEPTIONS=ON \ - -DLIBCXXABI_ENABLE_PEDANTIC=OFF \ - -DLIBCXXABI_ENABLE_PIC=ON \ - -DLIBCXXABI_ENABLE_WERROR=OFF \ - -DLIBCXXABI_USE_LLVM_UNWINDER=OFF \ - -DLIBCXXABI_USE_COMPILER_RT=OFF \ - -DLIBCXXABI_ENABLE_THREADS=ON \ - -DLIBCXXABI_HAS_PTHREAD_API=ON \ - -DLIBCXXABI_INCLUDE_TESTS=OFF \ - -DLIBCXXABI_LIBDIR_SUFFIX="" \ - -DLIBCXXABI_INSTALL_LIBRARY=ON \ - -DLIBCXXABI_ENABLE_SHARED=OFF \ - -DLIBCXXABI_LIBCXX_SRC_DIR=$(BUILD_DIR)/libcxx-$(PKG_VERSION).src \ - -DLIBCXXABI_LIBCXX_INCLUDES=$(BUILD_DIR)/libcxx-$(PKG_VERSION).src/include - -TARGET_CXXFLAGS += -flto -TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed - -define Build/Prepare - $(MAKE) -C $(TOPDIR)/package/libs/libcxx prepare - $(call Build/Prepare/Default) -endef - -define Build/InstallDev - $(call Build/InstallDev/cmake,$(1)) - $(INSTALL_DIR) $(1)/usr/include/ - $(INSTALL_DATA) $(PKG_BUILD_DIR)/include/*.h $(1)/usr/include/ -endef - -$(eval $(call BuildPackage,libcxxabi)) diff --git a/package/libs/libcxxabi/patches/010-arm.patch b/package/libs/libcxxabi/patches/010-arm.patch deleted file mode 100644 index b14609dc62..0000000000 --- a/package/libs/libcxxabi/patches/010-arm.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- a/src/cxa_exception.h -+++ b/src/cxa_exception.h -@@ -27,6 +27,13 @@ _LIBCXXABI_HIDDEN uint64_t __getExceptio - _LIBCXXABI_HIDDEN void __setExceptionClass ( _Unwind_Exception*, uint64_t); - _LIBCXXABI_HIDDEN bool __isOurExceptionClass(const _Unwind_Exception*); - -+#if defined(__arm__) && defined(__GNUC__) -+// missing values from _Unwind_Reason_Code enum -+#define _URC_FATAL_PHASE2_ERROR ((_Unwind_Reason_Code)2) -+#define _URC_FATAL_PHASE1_ERROR ((_Unwind_Reason_Code)3) -+#define _URC_NORMAL_STOP ((_Unwind_Reason_Code)4) -+#endif -+ - struct _LIBCXXABI_HIDDEN __cxa_exception { - #if defined(__LP64__) || defined(_WIN64) || defined(_LIBCXXABI_ARM_EHABI) - // Now _Unwind_Exception is marked with __attribute__((aligned)), ---- a/src/cxa_personality.cpp -+++ b/src/cxa_personality.cpp -@@ -1108,7 +1108,7 @@ __gxx_personality_v0(_Unwind_State state - - // Check the undocumented force unwinding behavior - bool is_force_unwinding = state & _US_FORCE_UNWIND; -- state &= ~_US_FORCE_UNWIND; -+ state = (_Unwind_State)(state & ~_US_FORCE_UNWIND); - - scan_results results; - switch (state) { From 36e0268aa67bb757d7b9b39cbe1e7f89332f6746 Mon Sep 17 00:00:00 2001 From: John Beckett Date: Mon, 21 Sep 2020 13:34:17 +0100 Subject: [PATCH 30/65] build: find_md5 list with mod time and sorted It was observed that the MD5 would not change after source files had been modified, looking deeper into the build process it was discovered that find_md5 build function makes a list of the files being built and then passes the list to a summing utility on stdin. The resultant MD5 is of the file list, not the contents of the files. The MD5 would change if the ordering of the list changed, or items were removed or deleted. The proposed fix is to add the modification time after the filename and then sort the list to prevent find returning files in a different order falsely re-triggering a rebuild. The MD5 will now change when a file is modified or files are added/removed from the list. Using 'T@' to show time in epoch for timezone independent behaviour. Signed-off-by: John Beckett --- include/depends.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/depends.mk b/include/depends.mk index 3df51adae3..ace7139000 100644 --- a/include/depends.mk +++ b/include/depends.mk @@ -13,7 +13,7 @@ DEP_FINDPARAMS := -x "*/.svn*" -x ".*" -x "*:*" -x "*\!*" -x "* *" -x "*\\\#*" -x "*/.*_check" -x "*/.*.swp" -x "*/.pkgdir*" -find_md5=find $(wildcard $(1)) -type f $(patsubst -x,-and -not -path,$(DEP_FINDPARAMS) $(2)) | mkhash md5 +find_md5=find $(wildcard $(1)) -type f $(patsubst -x,-and -not -path,$(DEP_FINDPARAMS) $(2)) -printf "%p%T@\n" | sort | mkhash md5 define rdep .PRECIOUS: $(2) From 89e6cc5c76e675e94c070b920dbe1ff58cfd4436 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Tue, 8 Dec 2020 15:33:32 +0100 Subject: [PATCH 31/65] ramips: mt7628: create shared DTSI for Xiaomi Mi Router 4A/4C The Xiaomi Mi Router 4A (100M) and 4C are relatively similar in their specs. Create a shared DTSI for them. Partitions are split in preparation for Mi Router 4AC. Signed-off-by: Adrian Schmutzler --- .../dts/mt7628an_xiaomi_mi-router-4.dtsi | 102 ++++++++++++++ .../dts/mt7628an_xiaomi_mi-router-4c.dts | 124 +++--------------- .../ramips/dts/mt7628an_xiaomi_mir4a-100m.dts | 115 ++-------------- 3 files changed, 132 insertions(+), 209 deletions(-) create mode 100644 target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4.dtsi diff --git a/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4.dtsi b/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4.dtsi new file mode 100644 index 0000000000..0f5897f5c5 --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4.dtsi @@ -0,0 +1,102 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7628an.dtsi" + +#include +#include + +/ { + aliases { + led-boot = &led_power_yellow; + led-failsafe = &led_power_yellow; + led-running = &led_power_blue; + led-upgrade = &led_power_yellow; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + leds { + compatible = "gpio-leds"; + + led_power_blue: power_blue { + label = "blue:power"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + }; + + led_power_yellow: power_yellow { + label = "yellow:power"; + gpios = <&gpio 44 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 38 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash0: flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partitions: partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x0 0x20000>; + read-only; + }; + + partition@20000 { + label = "config"; + reg = <0x20000 0x10000>; + read-only; + }; + + factory: partition@30000 { + label = "factory"; + reg = <0x30000 0x10000>; + read-only; + }; + + partition@40000 { + label = "crash"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + label = "cfg_bak"; + reg = <0x50000 0x10000>; + read-only; + }; + + /* additional partitions in DTS */ + }; + }; +}; + +&state_default { + gpio { + groups = "gpio", "wdt", "wled_an"; + function = "gpio"; + }; +}; + +&wmac { + status = "okay"; +}; diff --git a/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4c.dts b/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4c.dts index f459ae0358..4389a9daf4 100644 --- a/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4c.dts +++ b/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4c.dts @@ -1,55 +1,31 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include "mt7628an.dtsi" - -#include -#include +#include "mt7628an_xiaomi_mi-router-4.dtsi" / { compatible = "xiaomi,mi-router-4c", "mediatek,mt7628an-soc"; model = "Xiaomi Mi Router 4C"; aliases { - led-boot = &led_power_yellow; - led-failsafe = &led_power_yellow; - led-running = &led_power_blue; - led-upgrade = &led_power_yellow; label-mac-device = ðernet; }; - - chosen { - bootargs = "console=ttyS0,115200"; - }; - - leds { - compatible = "gpio-leds"; - - led_power_blue: power_blue { - label = "blue:power"; - gpios = <&gpio 11 GPIO_ACTIVE_LOW>; - }; - - led_power_yellow: power_yellow { - label = "yellow:power"; - gpios = <&gpio 44 GPIO_ACTIVE_LOW>; - }; - }; - - keys { - compatible = "gpio-keys"; - - reset { - label = "reset"; - gpios = <&gpio 38 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - }; }; -&state_default { - gpio { - groups = "gpio", "wdt", "wled_an"; - function = "gpio"; +&flash0 { + spi-max-frequency = <40000000>; +}; + +&partitions { + partition@60000 { + label = "overlay"; + reg = <0x60000 0x100000>; + read-only; + }; + + partition@160000 { + label = "firmware"; + reg = <0x160000 0xea0000>; + compatible = "denx,uimage"; }; }; @@ -61,73 +37,11 @@ status = "disabled"; }; -&esw { - mediatek,portmap = <0x3d>; - mediatek,portdisable = <0x29>; -}; - -&wmac { - status = "okay"; -}; - ðernet { mtd-mac-address = <&factory 0x28>; }; -&spi0 { - status = "okay"; - - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <40000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "bootloader"; - reg = <0x0 0x20000>; - read-only; - }; - - partition@20000 { - label = "config"; - reg = <0x20000 0x10000>; - read-only; - }; - - factory: partition@30000 { - label = "factory"; - reg = <0x30000 0x10000>; - read-only; - }; - - partition@40000 { - label = "crash"; - reg = <0x40000 0x10000>; - read-only; - }; - - partition@50000 { - label = "cfg_bak"; - reg = <0x50000 0x10000>; - read-only; - }; - - partition@60000 { - label = "overlay"; - reg = <0x60000 0x100000>; - read-only; - }; - - partition@160000 { - label = "firmware"; - reg = <0x160000 0xea0000>; - compatible = "denx,uimage"; - }; - }; - }; +&esw { + mediatek,portmap = <0x3d>; + mediatek,portdisable = <0x29>; }; diff --git a/target/linux/ramips/dts/mt7628an_xiaomi_mir4a-100m.dts b/target/linux/ramips/dts/mt7628an_xiaomi_mir4a-100m.dts index c4912048f5..a1a7dc7383 100644 --- a/target/linux/ramips/dts/mt7628an_xiaomi_mir4a-100m.dts +++ b/target/linux/ramips/dts/mt7628an_xiaomi_mir4a-100m.dts @@ -1,105 +1,23 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include "mt7628an.dtsi" - -#include -#include +#include "mt7628an_xiaomi_mi-router-4.dtsi" / { compatible = "xiaomi,mir4a-100m", "mediatek,mt7628an-soc"; model = "Xiaomi Mi Router 4A (100M Edition)"; - - chosen { - bootargs = "console=ttyS0,115200"; - }; - - aliases { - led-boot = &power_yellow; - led-failsafe = &power_yellow; - led-running = &power_blue; - led-upgrade = &power_yellow; - }; - - leds { - compatible = "gpio-leds"; - - power_blue: power_blue { - label = "blue:power"; - gpios = <&gpio 11 GPIO_ACTIVE_LOW>; - }; - - power_yellow: power_yellow { - label = "yellow:power"; - gpios = <&gpio 44 GPIO_ACTIVE_LOW>; - }; - }; - - keys { - compatible = "gpio-keys"; - - reset { - label = "reset"; - gpios = <&gpio 38 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - }; }; -&spi0 { - status = "okay"; +&partitions { + partition@60000 { + label = "overlay"; + reg = <0x60000 0x100000>; + read-only; + }; - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <10000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "bootloader"; - reg = <0x0 0x20000>; - read-only; - }; - - partition@20000 { - label = "config"; - reg = <0x20000 0x10000>; - read-only; - }; - - factory: partition@30000 { - label = "factory"; - reg = <0x30000 0x10000>; - read-only; - }; - - partition@40000 { - label = "crash"; - reg = <0x40000 0x10000>; - read-only; - }; - - partition@50000 { - label = "cfg_bak"; - reg = <0x50000 0x10000>; - read-only; - }; - - partition@60000 { - label = "overlay"; - reg = <0x60000 0x100000>; - read-only; - }; - - partition@160000 { - label = "firmware"; - reg = <0x160000 0xea0000>; - compatible = "denx,uimage"; - }; - }; + partition@160000 { + label = "firmware"; + reg = <0x160000 0xea0000>; + compatible = "denx,uimage"; }; }; @@ -116,13 +34,6 @@ }; }; -&state_default { - gpio { - groups = "gpio", "wdt", "wled_an"; - function = "gpio"; - }; -}; - ðernet { mtd-mac-address = <&factory 0x4>; mtd-mac-address-increment = <(-1)>; @@ -132,7 +43,3 @@ mediatek,portmap = <0x3e>; mediatek,portdisable = <0x2a>; }; - -&wmac { - status = "okay"; -}; From 6d4382711a65b5606cc9b815e6590b0e36ebf5b5 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Tue, 8 Dec 2020 15:05:47 +0100 Subject: [PATCH 32/65] ramips: use full names for Xiaomi Mi Router devices This aligns the device/image names of the older Xiaomi Mi Router devices with their "friendly" model and DEVICE_MODEL properties. This also reintroduces consistency with the newer devices already following that scheme. Signed-off-by: Adrian Schmutzler --- ....dts => mt7621_xiaomi_mi-router-3-pro.dts} | 2 +- ....dts => mt7621_xiaomi_mi-router-3g-v2.dts} | 2 +- ...r3g.dts => mt7621_xiaomi_mi-router-3g.dts} | 2 +- ... => mt7628an_xiaomi_mi-router-4a-100m.dts} | 2 +- target/linux/ramips/image/mt7621.mk | 29 ++++++++++--------- target/linux/ramips/image/mt76x8.mk | 5 ++-- .../mt7621/base-files/etc/board.d/02_network | 6 ++-- .../mt7621/base-files/lib/upgrade/platform.sh | 4 +-- .../mt76x8/base-files/etc/board.d/02_network | 6 ++-- 9 files changed, 30 insertions(+), 28 deletions(-) rename target/linux/ramips/dts/{mt7621_xiaomi_mir3p.dts => mt7621_xiaomi_mi-router-3-pro.dts} (98%) rename target/linux/ramips/dts/{mt7621_xiaomi_mir3g-v2.dts => mt7621_xiaomi_mi-router-3g-v2.dts} (69%) rename target/linux/ramips/dts/{mt7621_xiaomi_mir3g.dts => mt7621_xiaomi_mi-router-3g.dts} (98%) rename target/linux/ramips/dts/{mt7628an_xiaomi_mir4a-100m.dts => mt7628an_xiaomi_mi-router-4a-100m.dts} (91%) diff --git a/target/linux/ramips/dts/mt7621_xiaomi_mir3p.dts b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3-pro.dts similarity index 98% rename from target/linux/ramips/dts/mt7621_xiaomi_mir3p.dts rename to target/linux/ramips/dts/mt7621_xiaomi_mi-router-3-pro.dts index 43e61e9140..b9101b7ccb 100644 --- a/target/linux/ramips/dts/mt7621_xiaomi_mir3p.dts +++ b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3-pro.dts @@ -6,7 +6,7 @@ #include / { - compatible = "xiaomi,mir3p", "mediatek,mt7621-soc"; + compatible = "xiaomi,mi-router-3-pro", "mediatek,mt7621-soc"; model = "Xiaomi Mi Router 3 Pro"; aliases { diff --git a/target/linux/ramips/dts/mt7621_xiaomi_mir3g-v2.dts b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3g-v2.dts similarity index 69% rename from target/linux/ramips/dts/mt7621_xiaomi_mir3g-v2.dts rename to target/linux/ramips/dts/mt7621_xiaomi_mi-router-3g-v2.dts index 50c5a7dafb..fe03ff1e6a 100644 --- a/target/linux/ramips/dts/mt7621_xiaomi_mir3g-v2.dts +++ b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3g-v2.dts @@ -3,6 +3,6 @@ #include "mt7621_xiaomi_mi-router-4a-3g-v2.dtsi" / { - compatible = "xiaomi,mir3g-v2", "mediatek,mt7621-soc"; + compatible = "xiaomi,mi-router-3g-v2", "mediatek,mt7621-soc"; model = "Xiaomi Mi Router 3G v2"; }; diff --git a/target/linux/ramips/dts/mt7621_xiaomi_mir3g.dts b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3g.dts similarity index 98% rename from target/linux/ramips/dts/mt7621_xiaomi_mir3g.dts rename to target/linux/ramips/dts/mt7621_xiaomi_mi-router-3g.dts index 51f4842255..479cfc354c 100644 --- a/target/linux/ramips/dts/mt7621_xiaomi_mir3g.dts +++ b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3g.dts @@ -4,7 +4,7 @@ #include / { - compatible = "xiaomi,mir3g", "mediatek,mt7621-soc"; + compatible = "xiaomi,mi-router-3g", "mediatek,mt7621-soc"; model = "Xiaomi Mi Router 3G"; aliases { diff --git a/target/linux/ramips/dts/mt7628an_xiaomi_mir4a-100m.dts b/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4a-100m.dts similarity index 91% rename from target/linux/ramips/dts/mt7628an_xiaomi_mir4a-100m.dts rename to target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4a-100m.dts index a1a7dc7383..37797fc368 100644 --- a/target/linux/ramips/dts/mt7628an_xiaomi_mir4a-100m.dts +++ b/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4a-100m.dts @@ -3,7 +3,7 @@ #include "mt7628an_xiaomi_mi-router-4.dtsi" / { - compatible = "xiaomi,mir4a-100m", "mediatek,mt7628an-soc"; + compatible = "xiaomi,mi-router-4a-100m", "mediatek,mt7628an-soc"; model = "Xiaomi Mi Router 4A (100M Edition)"; }; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 7b8a73c1bd..fad18552c9 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -1191,13 +1191,7 @@ define Device/xiaomi-ac2100 uboot-envtools endef -define Device/xiaomi_mi-router-ac2100 - $(Device/xiaomi-ac2100) - DEVICE_MODEL := Mi Router AC2100 -endef -TARGET_DEVICES += xiaomi_mi-router-ac2100 - -define Device/xiaomi_mir3g +define Device/xiaomi_mi-router-3g $(Device/dsa-migration) $(Device/uimage-lzma-loader) BLOCKSIZE := 128k @@ -1211,14 +1205,13 @@ define Device/xiaomi_mir3g IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata DEVICE_VENDOR := Xiaomi DEVICE_MODEL := Mi Router 3G - SUPPORTED_DEVICES += R3G - SUPPORTED_DEVICES += mir3g DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 \ kmod-usb-ledtrig-usbport uboot-envtools + SUPPORTED_DEVICES += R3G mir3g xiaomi,mir3g endef -TARGET_DEVICES += xiaomi_mir3g +TARGET_DEVICES += xiaomi_mi-router-3g -define Device/xiaomi_mir3g-v2 +define Device/xiaomi_mi-router-3g-v2 $(Device/dsa-migration) $(Device/uimage-lzma-loader) IMAGE_SIZE := 14848k @@ -1226,10 +1219,11 @@ define Device/xiaomi_mir3g-v2 DEVICE_MODEL := Mi Router 3G DEVICE_VARIANT := v2 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 + SUPPORTED_DEVICES += xiaomi,mir3g-v2 endef -TARGET_DEVICES += xiaomi_mir3g-v2 +TARGET_DEVICES += xiaomi_mi-router-3g-v2 -define Device/xiaomi_mir3p +define Device/xiaomi_mi-router-3-pro $(Device/dsa-migration) $(Device/uimage-lzma-loader) BLOCKSIZE := 128k @@ -1245,8 +1239,9 @@ define Device/xiaomi_mir3p check-size DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware kmod-usb3 \ kmod-usb-ledtrig-usbport uboot-envtools + SUPPORTED_DEVICES += xiaomi,mir3p endef -TARGET_DEVICES += xiaomi_mir3p +TARGET_DEVICES += xiaomi_mi-router-3-pro define Device/xiaomi_mi-router-4a-gigabit $(Device/dsa-migration) @@ -1259,6 +1254,12 @@ define Device/xiaomi_mi-router-4a-gigabit endef TARGET_DEVICES += xiaomi_mi-router-4a-gigabit +define Device/xiaomi_mi-router-ac2100 + $(Device/xiaomi-ac2100) + DEVICE_MODEL := Mi Router AC2100 +endef +TARGET_DEVICES += xiaomi_mi-router-ac2100 + define Device/xiaomi_redmi-router-ac2100 $(Device/xiaomi-ac2100) DEVICE_MODEL := Redmi Router AC2100 diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk index edd42a4dd5..00593dd6f5 100644 --- a/target/linux/ramips/image/mt76x8.mk +++ b/target/linux/ramips/image/mt76x8.mk @@ -743,14 +743,15 @@ define Device/wrtnode_wrtnode2r endef TARGET_DEVICES += wrtnode_wrtnode2r -define Device/xiaomi_mir4a-100m +define Device/xiaomi_mi-router-4a-100m IMAGE_SIZE := 14976k DEVICE_VENDOR := Xiaomi DEVICE_MODEL := Mi Router 4A DEVICE_VARIANT := 100M Edition DEVICE_PACKAGES := kmod-mt76x2 + SUPPORTED_DEVICES += xiaomi,mir4a-100m endef -TARGET_DEVICES += xiaomi_mir4a-100m +TARGET_DEVICES += xiaomi_mi-router-4a-100m define Device/xiaomi_mi-router-4c IMAGE_SIZE := 14976k 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 fccd9c6985..c5b35145f1 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 @@ -16,8 +16,8 @@ ramips_setup_interfaces() asiarf,ap7621-nv1|\ lenovo,newifi-d1|\ mikrotik,routerboard-m33g|\ - xiaomi,mir3g|\ - xiaomi,mir3g-v2|\ + xiaomi,mi-router-3g|\ + xiaomi,mi-router-3g-v2|\ xiaomi,mi-router-4a-gigabit) ucidef_set_interfaces_lan_wan "lan1 lan2" "wan" ;; @@ -33,8 +33,8 @@ ramips_setup_interfaces() ;; gehua,ghl-r-001|\ hiwifi,hc5962|\ + xiaomi,mi-router-3-pro|\ xiaomi,mi-router-ac2100|\ - xiaomi,mir3p|\ xiaomi,redmi-router-ac2100) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan" ;; diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh index b4d07f8146..c68b012d0b 100755 --- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh @@ -61,9 +61,9 @@ platform_do_upgrade() { netgear,wac104|\ netgear,wac124|\ netis,wf2881|\ + xiaomi,mi-router-3g|\ + xiaomi,mi-router-3-pro|\ xiaomi,mi-router-ac2100|\ - xiaomi,mir3g|\ - xiaomi,mir3p|\ xiaomi,redmi-router-ac2100) nand_do_upgrade "$1" ;; diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network index 6f0078c70a..fcc2630b3f 100755 --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network @@ -133,7 +133,7 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "0:wan" "3:lan" "4:lan" "6@eth0" ;; - xiaomi,mir4a-100m) + xiaomi,mi-router-4a-100m) ucidef_add_switch "switch0" \ "4:lan:1" "2:lan:2" "0:wan" "6@eth0" ;; @@ -238,8 +238,8 @@ ramips_setup_macs() label_mac=$(mtd_get_mac_binary factory 0x4) wan_mac=$(mtd_get_mac_binary factory 0x28) ;; - xiaomi,mi-router-4c|\ - xiaomi,mir4a-100m) + xiaomi,mi-router-4a-100m|\ + xiaomi,mi-router-4c) wan_mac=$(mtd_get_mac_binary factory 0x4) ;; esac From af07c6de9ce8bca3db7317c911760102bb418bad Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Tue, 8 Dec 2020 23:45:10 +0100 Subject: [PATCH 33/65] uboot-envtools: ramips: use full names for Xiaomi Mi Routers This updates uboot-envtools with the updated names from ramips target. Fixes: 6d4382711a65 ("ramips: use full names for Xiaomi Mi Router devices") Signed-off-by: Adrian Schmutzler --- package/boot/uboot-envtools/Makefile | 2 +- package/boot/uboot-envtools/files/ramips | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package/boot/uboot-envtools/Makefile b/package/boot/uboot-envtools/Makefile index 398f37de12..590e38d883 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:=8 +PKG_RELEASE:=9 PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:= \ diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips index a2753eed7a..4319832e11 100644 --- a/package/boot/uboot-envtools/files/ramips +++ b/package/boot/uboot-envtools/files/ramips @@ -29,7 +29,7 @@ buffalo,wsr-1166dhp|\ buffalo,wsr-600dhp|\ mediatek,linkit-smart-7688|\ samknows,whitebox-v8|\ -xiaomi,mir3g-v2|\ +xiaomi,mi-router-3g-v2|\ xiaomi,mi-router-4a-gigabit|\ xiaomi,mi-router-4c|\ xiaomi,miwifi-nano|\ @@ -45,9 +45,9 @@ ravpower,rp-wd03) linksys,ea7300-v1|\ linksys,ea7300-v2|\ linksys,ea7500-v2|\ +xiaomi,mi-router-3g|\ +xiaomi,mi-router-3-pro|\ xiaomi,mi-router-ac2100|\ -xiaomi,mir3p|\ -xiaomi,mir3g|\ xiaomi,redmi-router-ac2100) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000" ;; From 21311ca6b6144c86bcfea28bff51eb937e34029e Mon Sep 17 00:00:00 2001 From: Sieng Piaw Liew Date: Fri, 9 Oct 2020 17:01:20 +0800 Subject: [PATCH 34/65] kernel: unlock MX25L6406E with 4 bit Block Protect MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hacked in basic support for 4 bit Block Protection register, copied from linux-master. Needed to unlock Innacomm W3400V's SPI flash MX25L6406E, compatible with MX25L6405D. Signed-off-by: Sieng Piaw Liew [Amend commit description, refresh patch] Signed-off-by: Álvaro Fernández Rojas --- ...k_mx25l6406e_with_4bit_block_protect.patch | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 target/linux/generic/hack-5.4/400-unlock_mx25l6406e_with_4bit_block_protect.patch diff --git a/target/linux/generic/hack-5.4/400-unlock_mx25l6406e_with_4bit_block_protect.patch b/target/linux/generic/hack-5.4/400-unlock_mx25l6406e_with_4bit_block_protect.patch new file mode 100644 index 0000000000..e25fdcd858 --- /dev/null +++ b/target/linux/generic/hack-5.4/400-unlock_mx25l6406e_with_4bit_block_protect.patch @@ -0,0 +1,69 @@ +--- a/drivers/mtd/spi-nor/spi-nor.c ++++ b/drivers/mtd/spi-nor/spi-nor.c +@@ -196,7 +196,7 @@ struct flash_info { + u16 page_size; + u16 addr_width; + +- u16 flags; ++ u32 flags; + #define SECT_4K BIT(0) /* SPINOR_OP_BE_4K works uniformly */ + #define SPI_NOR_NO_ERASE BIT(1) /* No erase command needed */ + #define SST_WRITE BIT(2) /* use SST byte programming */ +@@ -233,6 +233,10 @@ struct flash_info { + #define SPI_NOR_SKIP_SFDP BIT(13) /* Skip parsing of SFDP tables */ + #define USE_CLSR BIT(14) /* use CLSR command */ + #define SPI_NOR_OCTAL_READ BIT(15) /* Flash supports Octal Read */ ++#define SPI_NOR_4BIT_BP BIT(17) /* ++ * Flash SR has 4 bit fields (BP0-3) ++ * for block protection. ++ */ + + /* Part specific fixup hooks. */ + const struct spi_nor_fixups *fixups; +@@ -1983,6 +1987,9 @@ static int spi_nor_clear_sr_bp(struct sp + int ret; + u8 mask = SR_BP2 | SR_BP1 | SR_BP0; + ++ if (nor->flags & SNOR_F_HAS_4BIT_BP) ++ mask |= SR_BP3; ++ + ret = read_sr(nor); + if (ret < 0) { + dev_err(nor->dev, "error while reading status register\n"); +@@ -2335,7 +2342,7 @@ static const struct flash_info spi_nor_i + { "mx25l1606e", INFO(0xc22015, 0, 64 * 1024, 32, SECT_4K) }, + { "mx25l3205d", INFO(0xc22016, 0, 64 * 1024, 64, SECT_4K) }, + { "mx25l3255e", INFO(0xc29e16, 0, 64 * 1024, 64, SECT_4K) }, +- { "mx25l6405d", INFO(0xc22017, 0, 64 * 1024, 128, SECT_4K) }, ++ { "mx25l6405d", INFO(0xc22017, 0, 64 * 1024, 128, SECT_4K | SPI_NOR_4BIT_BP) }, + { "mx25u2033e", INFO(0xc22532, 0, 64 * 1024, 4, SECT_4K) }, + { "mx25u3235f", INFO(0xc22536, 0, 64 * 1024, 64, + SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, +@@ -5024,6 +5031,9 @@ int spi_nor_scan(struct spi_nor *nor, co + if (info->flags & USE_CLSR) + nor->flags |= SNOR_F_USE_CLSR; + ++ if (info->flags & SPI_NOR_4BIT_BP) ++ nor->flags |= SNOR_F_HAS_4BIT_BP; ++ + if (info->flags & SPI_NOR_NO_ERASE) + mtd->flags |= MTD_NO_ERASE; + +--- a/include/linux/mtd/spi-nor.h ++++ b/include/linux/mtd/spi-nor.h +@@ -127,6 +127,7 @@ + #define SR_BP0 BIT(2) /* Block protect 0 */ + #define SR_BP1 BIT(3) /* Block protect 1 */ + #define SR_BP2 BIT(4) /* Block protect 2 */ ++#define SR_BP3 BIT(5) /* Block protect 3 */ + #define SR_TB BIT(5) /* Top/Bottom protect */ + #define SR_SRWD BIT(7) /* SR write protect */ + /* Spansion/Cypress specific status bits */ +@@ -243,6 +244,7 @@ enum spi_nor_option_flags { + SNOR_F_4B_OPCODES = BIT(6), + SNOR_F_HAS_4BAIT = BIT(7), + SNOR_F_HAS_LOCK = BIT(8), ++ SNOR_F_HAS_4BIT_BP = BIT(12), + }; + + /** From a58826c34f34e1ce99d0870a0a0eefd71e4868a0 Mon Sep 17 00:00:00 2001 From: Sieng Piaw Liew Date: Fri, 9 Oct 2020 17:04:03 +0800 Subject: [PATCH 35/65] bcm63xx: add support for Innacomm W3400V6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Innacomm W3400V6 is an xDSL B/G wireless router based on Broadcom BCM6328 SoC. Hardware: SoC: Broadcom BCM6328 CPU: BMIPS4350 V8.0, 320 MHz, 1 core Flash: SPI-NOR 8MB, MX25L6406E RAM: 64 MB Ethernet: 4x 10/100 Mbps Switch: Integrated Wireless: 802.11b/g, BCM4312 LEDs/Buttons: 9x / 2x Flash instruction, web UI: 1) Set a static IP on your computer compatible with 192.168.1.1, i.e 192.168.1.100 2) Connect the ethernet cable from your computer to the router. 3) Make sure the router is powered off. 4) Press the reset button, don't release it yet! 5) While pressing reset, power on the router. 6) Wait 10 seconds or more. Note: The power LED is red at first then turns to solid green when ready. 8) Release the reset button. 9) Browse to 192.168.1.1 10) Select .bin file. 10) Upgrade the image. 11) Wait for it to reboot. Signed-off-by: Sieng Piaw Liew [Ammend commit description, merge patches, DT improvements] Signed-off-by: Álvaro Fernández Rojas --- .../bcm63xx/base-files/etc/board.d/02_network | 1 + .../bcm63xx/dts/bcm6328-innacomm-w3400v6.dts | 118 ++++++++++++++++++ target/linux/bcm63xx/image/bcm63xx.mk | 12 ++ .../patches-5.4/512-board_bcm6328.patch | 48 ++++++- .../patches-5.4/513-board-bcm6338.patch | 6 +- .../patches-5.4/514-board_bcm6345.patch | 6 +- .../patches-5.4/515-board-bcm6348.patch | 6 +- .../patches-5.4/516-board-bcm6358.patch | 8 +- .../patches-5.4/517-board_bcm6362.patch | 6 +- .../patches-5.4/518-board_bcm6368.patch | 6 +- .../patches-5.4/519-board_bcm63268.patch | 6 +- ...31-board_bcm6348-bt-voyager-2500v-bb.patch | 2 +- 12 files changed, 199 insertions(+), 26 deletions(-) create mode 100644 target/linux/bcm63xx/dts/bcm6328-innacomm-w3400v6.dts diff --git a/target/linux/bcm63xx/base-files/etc/board.d/02_network b/target/linux/bcm63xx/base-files/etc/board.d/02_network index 700439ec36..cca607fce1 100755 --- a/target/linux/bcm63xx/base-files/etc/board.d/02_network +++ b/target/linux/bcm63xx/base-files/etc/board.d/02_network @@ -100,6 +100,7 @@ huawei,echolife-hg556a-c) "0:lan:1" "1:lan:2" "2:lan:3" "3:lan:4" "5t@eth0" ;; comtrend,ar-5315u|\ +innacomm,w3400v6|\ observa,vh4032n|\ sagem,fast-2704n) ucidef_add_switch "switch0" \ diff --git a/target/linux/bcm63xx/dts/bcm6328-innacomm-w3400v6.dts b/target/linux/bcm63xx/dts/bcm6328-innacomm-w3400v6.dts new file mode 100644 index 0000000000..dd8ab12958 --- /dev/null +++ b/target/linux/bcm63xx/dts/bcm6328-innacomm-w3400v6.dts @@ -0,0 +1,118 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "bcm6328.dtsi" + +#include + +/ { + model = "Innacomm W3400V6"; + compatible = "innacomm,w3400v6", "brcm,bcm6328"; + + aliases { + led-boot = &led_power_green; + led-failsafe = &led_power_red; + led-running = &led_power_green; + led-upgrade = &led_power_green; + }; + + chosen { + bootargs = "rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; + }; + + keys { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + + wps { + label = "wps"; + gpios = <&pinctrl 15 1>; + linux,code = ; + debounce-interval = <60>; + }; + + reset { + label = "reset"; + gpios = <&pinctrl 23 1>; + linux,code = ; + debounce-interval = <60>; + }; + }; +}; + +&hsspi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + spi-max-frequency = <16666667>; + spi-tx-bus-width = <2>; + spi-rx-bus-width = <2>; + reg = <0>; + + #address-cells = <1>; + #size-cells = <1>; + + partitions { + compatible = "brcm,bcm963xx-cfe-nor-partitions"; + }; + }; +}; + +&leds { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_leds>; + + led@1 { + reg = <1>; + active-low; + label = "green:inet"; + }; + + led@2 { + reg = <2>; + active-low; + label = "red:inet"; + }; + + led@3 { + reg = <3>; + active-low; + label = "green:dsl"; + }; + + led_power_green: led@4 { + reg = <4>; + active-low; + label = "green:power"; + default-state = "on"; + }; + + led_power_red: led@5 { + reg = <5>; + active-low; + label = "red:power"; + }; + + led@11 { + reg = <11>; + active-low; + label = "green:wps"; + }; +}; + +&pinctrl { + pinctrl_leds: leds { + function = "led"; + pins = "gpio1", "gpio2", "gpio3", + "gpio4", "gpio5", "gpio11"; + }; +}; + +&uart0 { + status = "okay"; +}; diff --git a/target/linux/bcm63xx/image/bcm63xx.mk b/target/linux/bcm63xx/image/bcm63xx.mk index 773f098dea..24b150c063 100644 --- a/target/linux/bcm63xx/image/bcm63xx.mk +++ b/target/linux/bcm63xx/image/bcm63xx.mk @@ -781,6 +781,18 @@ define Device/huawei_echolife-hg655b endef TARGET_DEVICES += huawei_echolife-hg655b +### Innacomm ### +define Device/innacomm_w3400v6 + $(Device/bcm63xx) + DEVICE_VENDOR := Innacomm + DEVICE_MODEL := W3400V6 + CFE_BOARD_ID := 96328ang + CHIP_ID := 6328 + FLASH_MB := 8 + DEVICE_PACKAGES := $(B43_PACKAGES) +endef +TARGET_DEVICES += innacomm_w3400v6 + ### Inteno ### define Device/inteno_vg50 $(Device/bcm63xx) diff --git a/target/linux/bcm63xx/patches-5.4/512-board_bcm6328.patch b/target/linux/bcm63xx/patches-5.4/512-board_bcm6328.patch index ae0c538660..e28ff912cb 100644 --- a/target/linux/bcm63xx/patches-5.4/512-board_bcm6328.patch +++ b/target/linux/bcm63xx/patches-5.4/512-board_bcm6328.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -348,6 +348,611 @@ static struct board_info __initdata boar +@@ -348,6 +348,651 @@ static struct board_info __initdata boar }, }, }; @@ -608,11 +608,51 @@ + .pci_bus = 1, + .pci_dev = 0, + }, ++}; ++ ++static struct board_info __initdata board_W3400V6 = { ++ .name = "96328ang", ++ .expected_cpu_id = 0x6328, ++ ++ .has_pci = 1, ++ ++ .has_enetsw = 1, ++ .enetsw = { ++ .used_ports = { ++ [0] = { ++ .used = 1, ++ .phy_id = 1, ++ .name = "Port 1", ++ }, ++ [1] = { ++ .used = 1, ++ .phy_id = 2, ++ .name = "Port 2", ++ }, ++ [2] = { ++ .used = 1, ++ .phy_id = 3, ++ .name = "Port 3", ++ }, ++ [3] = { ++ .used = 1, ++ .phy_id = 4, ++ .name = "Port 4", ++ }, ++ }, ++ }, ++ ++ .use_fallback_sprom = 1, ++ .fallback_sprom = { ++ .type = SPROM_BCM4318, ++ .pci_bus = 1, ++ .pci_dev = 0, ++ }, +}; #endif /* CONFIG_BCM63XX_CPU_6328 */ /* -@@ -703,6 +1308,19 @@ static const struct board_info __initcon +@@ -703,6 +1348,20 @@ static const struct board_info __initcon #endif /* CONFIG_BCM63XX_CPU_6318 */ #ifdef CONFIG_BCM63XX_CPU_6328 &board_96328avng, @@ -629,10 +669,11 @@ + &board_TG582N, + &board_TG582N_TELECOM_ITALIA, + &board_R5010UNV2, ++ &board_W3400V6, #endif /* CONFIG_BCM63XX_CPU_6328 */ #ifdef CONFIG_BCM63XX_CPU_6338 &board_96338gw, -@@ -742,7 +1360,22 @@ static struct of_device_id const bcm963x +@@ -742,7 +1401,23 @@ static struct of_device_id const bcm963x { .compatible = "sagem,fast-2704n", .data = &board_FAST2704N, }, #endif /* CONFIG_BCM63XX_CPU_6318 */ #ifdef CONFIG_BCM63XX_CPU_6328 @@ -646,6 +687,7 @@ + { .compatible = "comtrend,ar-5387un", .data = &board_AR5387un, }, + { .compatible = "d-link,dsl-274xb-f1", .data = &board_dsl_274xb_f1, }, + { .compatible = "d-link,dsl-2750u-c1", .data = &board_A4001N, }, ++ { .compatible = "innacomm,w3400v6", .data = &board_W3400V6, }, + { .compatible = "nucom,r5010un-v2", .data = &board_R5010UNV2, }, + { .compatible = "sagem,fast-2704-v2", .data = &board_FAST2704V2, }, + { .compatible = "sercomm,ad1018", .data = &board_AD1018, }, diff --git a/target/linux/bcm63xx/patches-5.4/513-board-bcm6338.patch b/target/linux/bcm63xx/patches-5.4/513-board-bcm6338.patch index 9319f974ac..f3847c8140 100644 --- a/target/linux/bcm63xx/patches-5.4/513-board-bcm6338.patch +++ b/target/linux/bcm63xx/patches-5.4/513-board-bcm6338.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -986,6 +986,32 @@ static struct board_info __initdata boar +@@ -1026,6 +1026,32 @@ static struct board_info __initdata boar .force_duplex_full = 1, }, }; @@ -33,7 +33,7 @@ #endif /* CONFIG_BCM63XX_CPU_6338 */ /* -@@ -1325,6 +1351,8 @@ static const struct board_info __initcon +@@ -1366,6 +1392,8 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6338 &board_96338gw, &board_96338w, @@ -42,7 +42,7 @@ #endif /* CONFIG_BCM63XX_CPU_6338 */ #ifdef CONFIG_BCM63XX_CPU_6345 &board_96345gw2, -@@ -1380,6 +1408,8 @@ static struct of_device_id const bcm963x +@@ -1422,6 +1450,8 @@ static struct of_device_id const bcm963x #ifdef CONFIG_BCM63XX_CPU_6338 { .compatible = "brcm,bcm96338gw", .data = &board_96338gw, }, { .compatible = "brcm,bcm96338w", .data = &board_96338w, }, diff --git a/target/linux/bcm63xx/patches-5.4/514-board_bcm6345.patch b/target/linux/bcm63xx/patches-5.4/514-board_bcm6345.patch index 3b1f2842b5..3f84c95385 100644 --- a/target/linux/bcm63xx/patches-5.4/514-board_bcm6345.patch +++ b/target/linux/bcm63xx/patches-5.4/514-board_bcm6345.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1022,6 +1022,19 @@ static struct board_info __initdata boar +@@ -1062,6 +1062,19 @@ static struct board_info __initdata boar .name = "96345GW2", .expected_cpu_id = 0x6345, }; @@ -20,7 +20,7 @@ #endif /* CONFIG_BCM63XX_CPU_6345 */ /* -@@ -1356,6 +1369,7 @@ static const struct board_info __initcon +@@ -1397,6 +1410,7 @@ static const struct board_info __initcon #endif /* CONFIG_BCM63XX_CPU_6338 */ #ifdef CONFIG_BCM63XX_CPU_6345 &board_96345gw2, @@ -28,7 +28,7 @@ #endif /* CONFIG_BCM63XX_CPU_6345 */ #ifdef CONFIG_BCM63XX_CPU_6348 &board_96348r, -@@ -1413,6 +1427,8 @@ static struct of_device_id const bcm963x +@@ -1455,6 +1469,8 @@ static struct of_device_id const bcm963x #endif /* CONFIG_BCM63XX_CPU_6338 */ #ifdef CONFIG_BCM63XX_CPU_6345 { .compatible = "brcm,bcm96345gw2", .data = &board_96345gw2, }, diff --git a/target/linux/bcm63xx/patches-5.4/515-board-bcm6348.patch b/target/linux/bcm63xx/patches-5.4/515-board-bcm6348.patch index eb3eb26dd0..891184eedd 100644 --- a/target/linux/bcm63xx/patches-5.4/515-board-bcm6348.patch +++ b/target/linux/bcm63xx/patches-5.4/515-board-bcm6348.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1221,6 +1221,275 @@ static struct board_info __initdata boar +@@ -1261,6 +1261,275 @@ static struct board_info __initdata boar .has_ohci0 = 1, }; @@ -276,7 +276,7 @@ #endif /* CONFIG_BCM63XX_CPU_6348 */ /* -@@ -1380,6 +1649,19 @@ static const struct board_info __initcon +@@ -1421,6 +1690,19 @@ static const struct board_info __initcon &board_DV201AMR, &board_96348gw_a, &board_rta1025w_16, @@ -296,7 +296,7 @@ #endif /* CONFIG_BCM63XX_CPU_6348 */ #ifdef CONFIG_BCM63XX_CPU_6358 &board_96358vw, -@@ -1431,15 +1713,29 @@ static struct of_device_id const bcm963x +@@ -1473,15 +1755,29 @@ static struct of_device_id const bcm963x { .compatible = "dynalink,rta770w", .data = &board_rta770w, }, #endif /* CONFIG_BCM63XX_CPU_6345 */ #ifdef CONFIG_BCM63XX_CPU_6348 diff --git a/target/linux/bcm63xx/patches-5.4/516-board-bcm6358.patch b/target/linux/bcm63xx/patches-5.4/516-board-bcm6358.patch index 6af94bdbe0..c1a4e9bbd5 100644 --- a/target/linux/bcm63xx/patches-5.4/516-board-bcm6358.patch +++ b/target/linux/bcm63xx/patches-5.4/516-board-bcm6358.patch @@ -8,7 +8,7 @@ #include #include #include -@@ -1574,6 +1575,88 @@ static struct board_info __initdata boar +@@ -1614,6 +1615,88 @@ static struct board_info __initdata boar .has_ehci0 = 1, }; @@ -97,7 +97,7 @@ static struct board_info __initdata board_DWVS0 = { .name = "DWV-S0", .expected_cpu_id = 0x6358, -@@ -1598,6 +1681,238 @@ static struct board_info __initdata boar +@@ -1638,6 +1721,238 @@ static struct board_info __initdata boar .has_ohci0 = 1, .has_ehci0 = 1, }; @@ -336,7 +336,7 @@ #endif /* CONFIG_BCM63XX_CPU_6358 */ /* -@@ -1667,7 +1982,20 @@ static const struct board_info __initcon +@@ -1708,7 +2023,20 @@ static const struct board_info __initcon &board_96358vw, &board_96358vw2, &board_AGPFS0, @@ -357,7 +357,7 @@ #endif /* CONFIG_BCM63XX_CPU_6358 */ }; -@@ -1743,11 +2071,24 @@ static struct of_device_id const bcm963x +@@ -1785,11 +2113,24 @@ static struct of_device_id const bcm963x { .compatible = "alcatel,rg100a", .data = &board_96358vw2, }, { .compatible = "brcm,bcm96358vw", .data = &board_96358vw, }, { .compatible = "brcm,bcm96358vw2", .data = &board_96358vw2, }, diff --git a/target/linux/bcm63xx/patches-5.4/517-board_bcm6362.patch b/target/linux/bcm63xx/patches-5.4/517-board_bcm6362.patch index c917914dd1..71a84937a2 100644 --- a/target/linux/bcm63xx/patches-5.4/517-board_bcm6362.patch +++ b/target/linux/bcm63xx/patches-5.4/517-board_bcm6362.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1915,6 +1915,117 @@ static struct board_info __initdata boar +@@ -1955,6 +1955,117 @@ static struct board_info __initdata boar }; #endif /* CONFIG_BCM63XX_CPU_6358 */ @@ -118,7 +118,7 @@ /* * all boards */ -@@ -1997,6 +2108,12 @@ static const struct board_info __initcon +@@ -2038,6 +2149,12 @@ static const struct board_info __initcon &board_nb4_fxc_r1, &board_spw303v, #endif /* CONFIG_BCM63XX_CPU_6358 */ @@ -131,7 +131,7 @@ }; static struct of_device_id const bcm963xx_boards_dt[] = { -@@ -2091,6 +2208,10 @@ static struct of_device_id const bcm963x +@@ -2133,6 +2250,10 @@ static struct of_device_id const bcm963x { .compatible = "telsey,cpva642", .data = &board_CPVA642, }, #endif /* CONFIG_BCM63XX_CPU_6358 */ #ifdef CONFIG_BCM63XX_CPU_6362 diff --git a/target/linux/bcm63xx/patches-5.4/518-board_bcm6368.patch b/target/linux/bcm63xx/patches-5.4/518-board_bcm6368.patch index 31d724ca24..4b85e0bbab 100644 --- a/target/linux/bcm63xx/patches-5.4/518-board_bcm6368.patch +++ b/target/linux/bcm63xx/patches-5.4/518-board_bcm6368.patch @@ -9,7 +9,7 @@ #include #include #include -@@ -2027,6 +2029,648 @@ static struct board_info __initdata boar +@@ -2067,6 +2069,648 @@ static struct board_info __initdata boar #endif /* CONFIG_BCM63XX_CPU_6362 */ /* @@ -658,7 +658,7 @@ * all boards */ static const struct board_info __initconst *bcm963xx_boards[] = { -@@ -2114,6 +2758,22 @@ static const struct board_info __initcon +@@ -2155,6 +2799,22 @@ static const struct board_info __initcon &board_hg253s_v2, &board_nb6, #endif /* CONFIG_BCM63XX_CPU_6362 */ @@ -681,7 +681,7 @@ }; static struct of_device_id const bcm963xx_boards_dt[] = { -@@ -2214,6 +2874,20 @@ static struct of_device_id const bcm963x +@@ -2256,6 +2916,20 @@ static struct of_device_id const bcm963x { .compatible = "sfr,neufbox-6-sercomm-r0", .data = &board_nb6, }, #endif /* CONFIG_BCM63XX_CPU_6362 */ #ifdef CONFIG_BCM63XX_CPU_6368 diff --git a/target/linux/bcm63xx/patches-5.4/519-board_bcm63268.patch b/target/linux/bcm63xx/patches-5.4/519-board_bcm63268.patch index 20fbf5e68e..f46cbbedc7 100644 --- a/target/linux/bcm63xx/patches-5.4/519-board_bcm63268.patch +++ b/target/linux/bcm63xx/patches-5.4/519-board_bcm63268.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -2671,6 +2671,273 @@ static struct board_info __initdata boar +@@ -2711,6 +2711,273 @@ static struct board_info __initdata boar #endif /* CONFIG_BCM63XX_CPU_6368 */ /* @@ -274,7 +274,7 @@ * all boards */ static const struct board_info __initconst *bcm963xx_boards[] = { -@@ -2774,6 +3041,15 @@ static const struct board_info __initcon +@@ -2815,6 +3082,15 @@ static const struct board_info __initcon &board_VR3026e, &board_WAP5813n, #endif /* CONFIG_BCM63XX_CPU_6368 */ @@ -290,7 +290,7 @@ }; static struct of_device_id const bcm963xx_boards_dt[] = { -@@ -2890,6 +3166,14 @@ static struct of_device_id const bcm963x +@@ -2932,6 +3208,14 @@ static struct of_device_id const bcm963x { .compatible = "zyxel,p870hw-51a-v2", .data = &board_P870HW51A_V2, }, #endif /* CONFIG_BCM63XX_CPU_6368 */ #ifdef CONFIG_BCM63XX_CPU_63268 diff --git a/target/linux/bcm63xx/patches-5.4/531-board_bcm6348-bt-voyager-2500v-bb.patch b/target/linux/bcm63xx/patches-5.4/531-board_bcm6348-bt-voyager-2500v-bb.patch index 23fefee97a..ec49e933d6 100644 --- a/target/linux/bcm63xx/patches-5.4/531-board_bcm6348-bt-voyager-2500v-bb.patch +++ b/target/linux/bcm63xx/patches-5.4/531-board_bcm6348-bt-voyager-2500v-bb.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -3202,6 +3202,22 @@ void __init board_bcm963xx_init(void) +@@ -3244,6 +3244,22 @@ void __init board_bcm963xx_init(void) val &= MPI_CSBASE_BASE_MASK; } boot_addr = (u8 *)KSEG1ADDR(val); From dd5b3b58d8aa4427c40bc1247196a6693a57f460 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 9 Dec 2020 11:53:04 +0100 Subject: [PATCH 36/65] lldpd: fix autoreconf failure The lldpd sources ship a modified local AX_LIB_READLINE M4 macro which conflicts with the official macro shipped by autoconf-archive. Due to the official macro having the same name and a higher serial number, autoconf will prefer including that one instead of the local copy, preventing the substitution of @READLINE_LIBS@ in Makefile.in templates, ultimately leading to the following build failure when linking lldpcli: ...-gcc: error: READLINE_LIBS@: No such file or directory Avoid this problem by renaming the locally shipped macro to not clash with the official implementation anymore. Ref: https://github.com/lldpd/lldpd/pull/423 Acked-by: Stijn Tintel Tested-by: Rosen Penev Signed-off-by: Jo-Philipp Wich --- ...2-fix-AX_LIB_READLINE-macro-conflict.patch | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 package/network/services/lldpd/patches/002-fix-AX_LIB_READLINE-macro-conflict.patch diff --git a/package/network/services/lldpd/patches/002-fix-AX_LIB_READLINE-macro-conflict.patch b/package/network/services/lldpd/patches/002-fix-AX_LIB_READLINE-macro-conflict.patch new file mode 100644 index 0000000000..9cdf66f2e7 --- /dev/null +++ b/package/network/services/lldpd/patches/002-fix-AX_LIB_READLINE-macro-conflict.patch @@ -0,0 +1,61 @@ +From 23509dc05b24a28fb46022800e0e271ae0118de2 Mon Sep 17 00:00:00 2001 +From: Jo-Philipp Wich +Date: Wed, 9 Dec 2020 12:04:04 +0100 +Subject: [PATCH] build: prevent conflict with official AX_LIB_READLINE macro + +On systems where the official AX_LIB_READLINE (ax_lib_readline.m4) is +present in a globally shared autoconf include directory, auto(re)conf +will prefer including that offical version over the local variant due +to the offical macro having a higher serial number. + +As a consequence, @READLINE_LIBS@ will not be substituted in *.in files, +eventually failing the compilation with errors similar to: + + gcc: error: READLINE_LIBS@: No such file or directory + +Avoid this problem by renaming the incompatible local macro to +AX_LIB_READLINE_LLDPD which is sufficient to prevent any clashes. + +We encountered this problem on OpenWrt which uses GNU autoconf-archive +to provide commonly used M4 macros through a global include directory, +which happens to ship AX_LIB_READLINE as well. + +Signed-off-by: Jo-Philipp Wich +--- + configure.ac | 2 +- + m4/ax_lib_readline.m4 | 6 +++--- + 2 files changed, 4 insertions(+), 4 deletions(-) + +--- a/configure.ac ++++ b/configure.ac +@@ -273,7 +273,7 @@ AC_ARG_WITH([readline], + [], + [with_readline=auto]) + if test x"$with_readline" != x"no"; then +- AX_LIB_READLINE ++ AX_LIB_READLINE_LLDPD + if test x"$with_readline" != x"check" -a x"$with_readline" != x"auto"; then + if test x"$ax_cv_lib_readline" = x"no"; then + AC_MSG_FAILURE([*** no readline support found]) +--- a/m4/ax_lib_readline.m4 ++++ b/m4/ax_lib_readline.m4 +@@ -4,7 +4,7 @@ + # + # SYNOPSIS + # +-# AX_LIB_READLINE ++# AX_LIB_READLINE_LLDPD + # + # DESCRIPTION + # +@@ -66,8 +66,8 @@ + + #serial 6 + +-AU_ALIAS([VL_LIB_READLINE], [AX_LIB_READLINE]) +-AC_DEFUN([AX_LIB_READLINE], [ ++AU_ALIAS([VL_LIB_READLINE], [AX_LIB_READLINE_LLDPD]) ++AC_DEFUN([AX_LIB_READLINE_LLDPD], [ + AC_CACHE_CHECK([for a readline compatible library], + ax_cv_lib_readline, [ + _save_LIBS="$LIBS" From 3f165fa7ccc24a1927483457cd2a20511460550f Mon Sep 17 00:00:00 2001 From: John Audia Date: Tue, 8 Dec 2020 09:27:08 -0500 Subject: [PATCH 37/65] kernel: bump 5.4 to 5.4.82 Removed since included upstream and could be reverse-applied by quilt: backport-5.4/315-v5.10-usbnet-ipeth-fix-connectivity-with-ios-14.patch Remaining modifications made by update_kernel.sh Build system: x86_64 Build-tested: ipq806x/R7800, ath79/generic, bcm27xx/bcm2711 Run-tested: ipq806x/R7800 No dmesg regressions, everything functional Signed-off-by: John Audia Tested-by: Curtis Deptuck [build/run x86_64] --- include/kernel-version.mk | 4 +- ...t-ipeth-fix-connectivity-with-ios-14.patch | 44 ------------------- ...agate-resolved-link-config-via-mac_l.patch | 2 +- ...nclude-linux-add-phy-ops-for-rtl838x.patch | 2 +- 4 files changed, 4 insertions(+), 48 deletions(-) delete mode 100644 target/linux/generic/backport-5.4/315-v5.10-usbnet-ipeth-fix-connectivity-with-ios-14.patch diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 11df16e9f5..2633ef5107 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -6,9 +6,9 @@ ifdef CONFIG_TESTING_KERNEL KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER) endif -LINUX_VERSION-5.4 = .81 +LINUX_VERSION-5.4 = .82 -LINUX_KERNEL_HASH-5.4.81 = 9470bde475726996202d845a5fc3bc8bd3bb546bbc6816fb663fa73df25d8427 +LINUX_KERNEL_HASH-5.4.82 = fb4458e4ea38b6c5df4ee8cee0d9b0420b5aed07e273787b045c0db48709ddaf remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/target/linux/generic/backport-5.4/315-v5.10-usbnet-ipeth-fix-connectivity-with-ios-14.patch b/target/linux/generic/backport-5.4/315-v5.10-usbnet-ipeth-fix-connectivity-with-ios-14.patch deleted file mode 100644 index bb572b3f21..0000000000 --- a/target/linux/generic/backport-5.4/315-v5.10-usbnet-ipeth-fix-connectivity-with-ios-14.patch +++ /dev/null @@ -1,44 +0,0 @@ -From: Yves-Alexis Perez -Subject: [PATCH] usbnet: ipheth: fix connectivity with iOS 14 -Date: Thu, 19 Nov 2020 18:24:39 +0100 -Archived-At: -List-Post: - -Starting with iOS 14 released in September 2020, connectivity using the -personal hotspot USB tethering function of iOS devices is broken. - -Communication between the host and the device (for example ICMP traffic -or DNS resolution using the DNS service running in the device itself) -works fine, but communication to endpoints further away doesn't work. - -Investigation on the matter shows that UDP and ICMP traffic from the -tethered host is reaching the Internet at all. For TCP traffic there are -exchanges between tethered host and server but packets are modified in -transit leading to impossible communication. - -After some trials Matti Vuorela discovered that reducing the URB buffer -size by two bytes restored the previous behavior. While a better -solution might exist to fix the issue, since the protocol is not -publicly documented and considering the small size of the fix, let's do -that. - -Tested-by: Matti Vuorela -Signed-off-by: Yves-Alexis Perez -Link: https://lore.kernel.org/linux-usb/CAAn0qaXmysJ9vx3ZEMkViv_B19ju-_ExN8Yn_uSefxpjS6g4Lw@mail.gmail.com/ -Link: https://github.com/libimobiledevice/libimobiledevice/issues/1038 -Cc: stable@vger.kernel.org ---- - drivers/net/usb/ipheth.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/drivers/net/usb/ipheth.c -+++ b/drivers/net/usb/ipheth.c -@@ -59,7 +59,7 @@ - #define IPHETH_USBINTF_SUBCLASS 253 - #define IPHETH_USBINTF_PROTO 1 - --#define IPHETH_BUF_SIZE 1516 -+#define IPHETH_BUF_SIZE 1514 - #define IPHETH_IP_ALIGN 2 /* padding at front of URB */ - #define IPHETH_TX_TIMEOUT (5 * HZ) - diff --git a/target/linux/mediatek/patches-5.4/0600-net-phylink-propagate-resolved-link-config-via-mac_l.patch b/target/linux/mediatek/patches-5.4/0600-net-phylink-propagate-resolved-link-config-via-mac_l.patch index d2a9c65cdc..424061ef5e 100644 --- a/target/linux/mediatek/patches-5.4/0600-net-phylink-propagate-resolved-link-config-via-mac_l.patch +++ b/target/linux/mediatek/patches-5.4/0600-net-phylink-propagate-resolved-link-config-via-mac_l.patch @@ -95,7 +95,7 @@ Signed-off-by: David S. Miller } netif_tx_start_all_queues(port->dev); -@@ -5124,8 +5128,11 @@ static void mvpp2_mac_config(struct phyl +@@ -5125,8 +5129,11 @@ static void mvpp2_mac_config(struct phyl mvpp2_port_enable(port); } diff --git a/target/linux/realtek/patches-5.4/703-include-linux-add-phy-ops-for-rtl838x.patch b/target/linux/realtek/patches-5.4/703-include-linux-add-phy-ops-for-rtl838x.patch index c61b5f6fff..03accd1e07 100644 --- a/target/linux/realtek/patches-5.4/703-include-linux-add-phy-ops-for-rtl838x.patch +++ b/target/linux/realtek/patches-5.4/703-include-linux-add-phy-ops-for-rtl838x.patch @@ -1,6 +1,6 @@ --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -650,6 +650,10 @@ struct phy_driver { +@@ -644,6 +644,10 @@ struct phy_driver { struct ethtool_tunable *tuna, const void *data); int (*set_loopback)(struct phy_device *dev, bool enable); From 7f285d0b436c4b05a89c78ef3f1910d6f78040da Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Fri, 3 Jul 2020 19:51:57 -0700 Subject: [PATCH 38/65] scripts/feeds: warn when skipping core package override Otherwise, a n00b like myself can get quite confused when moving a package from core to feeds, for example. (Hint: one *really* needs to clear out the tmp/info/.packageinfo... entries for the stale package, but '-f' works as well.) Signed-off-by: Brian Norris --- scripts/feeds | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/feeds b/scripts/feeds index 22d4f8e8f4..e402200194 100755 --- a/scripts/feeds +++ b/scripts/feeds @@ -536,7 +536,10 @@ sub install_src { # If it's a core package and we don't want to override, just return my $override = 0; if (is_core_src($name)) { - return 0 unless $force; + if (!$force) { + warn "Not overriding core package $name; use -f to force\n"; + return 0; + } $override = 1; } From dd3464023f1836ef4fa417509830aaf5618b9ae9 Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Wed, 9 Dec 2020 22:30:38 +0100 Subject: [PATCH 39/65] odhcp6c: update to latest git HEAD 0ffa3a3 dhcpv6: harden reconfigure logic 3999b6d dhcpv6: rework DHCPv6 message to string implementation 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 1cf0950076..b1528ee2d1 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-03 -PKG_SOURCE_VERSION:=faed29aa733cd3e7c0269d5dc2fc6a8e1d35f1ce -PKG_MIRROR_HASH:=7b47aeacfc381e81e570a00733aeafd229e45f576134d5b8548eeb01d56f1073 +PKG_SOURCE_DATE:=2020-12-08 +PKG_SOURCE_VERSION:=0ffa3a31f7146d320214f431291c1196070a010f +PKG_MIRROR_HASH:=16eab81663ad7bd7f650c62019b65ded21f08e797874041787543e2e8ed665e8 PKG_MAINTAINER:=Hans Dedecker PKG_LICENSE:=GPL-2.0 From e7e16667ffd9d4a9d8d925a19ee08d0d360ae755 Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Wed, 9 Dec 2020 11:20:49 -1000 Subject: [PATCH 40/65] iftop: remove package The package has no reason to be in openwrt.git. Move it to packages.git. Signed-off-by: Paul Spooren Acked-by: Jo-Philipp Wich --- package/network/utils/iftop/Makefile | 45 ---------------------------- 1 file changed, 45 deletions(-) delete mode 100644 package/network/utils/iftop/Makefile diff --git a/package/network/utils/iftop/Makefile b/package/network/utils/iftop/Makefile deleted file mode 100644 index 98fe15c8f5..0000000000 --- a/package/network/utils/iftop/Makefile +++ /dev/null @@ -1,45 +0,0 @@ -# -# Copyright (C) 2006 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=iftop -PKG_RELEASE:=1 - -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://code.blinkace.com/pdw/iftop.git -PKG_SOURCE_DATE:=2018-10-03 -PKG_SOURCE_VERSION:=77901c8c53e01359d83b8090aacfe62214658183 -PKG_MIRROR_HASH:=219231541a437f5aecd497796be0202d337e13f141359a93595bf2cd8c5c5544 -PKG_MAINTAINER:=Jo-Philipp Wich -PKG_LICENSE:=GPL-2.0 - -PKG_FIXUP:=autoreconf - -include $(INCLUDE_DIR)/package.mk - -define Package/iftop - SECTION:=net - CATEGORY:=Network - DEPENDS:=+libpcap +libncurses +libpthread - TITLE:=display bandwith usage on an interface - URL:=http://www.ex-parrot.com/~pdw/iftop/ -endef - -define Package/iftop/description - iftop does for network usage what top(1) does for CPU usage. It - listens to network traffic on a named interface and displays a - table of current bandwidth usage by pairs of hosts. Handy for - answering the question 'why is our ADSL link so slow?'. -endef - -define Package/iftop/install - $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/iftop $(1)/usr/bin/ -endef - -$(eval $(call BuildPackage,iftop)) From 6ea03ec94c688d3a1a5489cc1d4dff44ec2f2ff2 Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Sun, 6 Dec 2020 09:24:52 -1000 Subject: [PATCH 41/65] opkg: remove legacy dist and extra_data efb26a3 libopkg: remove "extra_data" option 1d67ab7 libopkg: remove support for "dist" config Reduces opkg size by about 400 Bytes. Signed-off-by: Paul Spooren --- package/system/opkg/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/system/opkg/Makefile b/package/system/opkg/Makefile index c29dcb891e..4a7288d2e4 100644 --- a/package/system/opkg/Makefile +++ b/package/system/opkg/Makefile @@ -14,9 +14,9 @@ PKG_FLAGS:=essential PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://git.openwrt.org/project/opkg-lede.git -PKG_SOURCE_DATE:=2020-11-25 -PKG_SOURCE_VERSION:=66f458decf9fd2839d77bf420e93d9c78025488a -PKG_MIRROR_HASH:=932cf0002fd05e8a231df6d3e2c807b2c62501aa36ac2a3e20665622872e262d +PKG_SOURCE_DATE:=2020-12-05 +PKG_SOURCE_VERSION:=efb26a35e4e5446f135307c4ff7df9e9563c23a9 +PKG_MIRROR_HASH:=9294140567f1b122a7229fc80ab1b70e167b478c1a3062e0b64631c189beeda5 PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=COPYING From a3e5b24d430a752caebf513aaacce707204b5def Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Tue, 10 Dec 2019 13:04:19 +0100 Subject: [PATCH 42/65] scripts/feeds: fix preference of package install MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous behavior prefered same feed for dependent packages as initial package. This caused inconsitency in installation of packages. The difference was if two feeds provide same package (different version) there was different result if you executed install for that specific version compared to install for package depending on it from different feed. This ensures that preferred feed is propagated without change and selected feed is used only really for package it was selected for. Signed-off-by: Karel Kočí --- scripts/feeds | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/scripts/feeds b/scripts/feeds index e402200194..122f8568cb 100755 --- a/scripts/feeds +++ b/scripts/feeds @@ -517,19 +517,19 @@ sub install_src { my $force = shift; my $ret = 0; - $feed = lookup_src($feed, $name); - unless ($feed) { + my $select_feed = lookup_src($feed, $name); + unless ($select_feed) { $installed{$name} and return 0; $feed_src->{$name} or warn "WARNING: No feed for source package '$name' found\n"; return 0; } # switch to the metadata for the selected feed - get_feed($feed->[1]); + get_feed($select_feed->[1]); my $src = $feed_src->{$name} or return 1; # enable force flag if feed src line was declared with --force - if (exists($feed->[3]{force})) { + if (exists($select_feed->[3]{force})) { $force = 1; } @@ -557,12 +557,12 @@ sub install_src { } if ($override) { - warn "Overriding core package '$name' with version from $feed->[1]\n"; + warn "Overriding core package '$name' with version from $select_feed->[1]\n"; } else { - warn "Installing package '$name' from $feed->[1]\n"; + warn "Installing package '$name' from $select_feed->[1]\n"; } - do_install_src($feed, $src) == 0 or do { + do_install_src($select_feed, $src) == 0 or do { warn "failed.\n"; return 1; }; @@ -597,15 +597,15 @@ sub install_package { my $name = shift; my $force = shift; - $feed = lookup_package($feed, $name); - unless ($feed) { + my $select_feed = lookup_package($feed, $name); + unless ($select_feed) { $installed_pkg{$name} and return 0; $feed_vpackage->{$name} or warn "WARNING: No feed for package '$name' found\n"; return 0; } # switch to the metadata for the selected feed - get_feed($feed->[1]); + get_feed($select_feed->[1]); my $pkg = $feed_vpackage->{$name} or return 1; return install_src($feed, $pkg->[0]{src}{name}, $force); } @@ -615,14 +615,12 @@ sub install_target_or_package { my $name = shift; my $force = shift; - my $this_feed_target = lookup_target($feed, $name); - $this_feed_target and do { - return install_target($this_feed_target, $name); + lookup_target($feed, $name) and do { + return install_target($feed, $name); }; - my $this_feed_src = lookup_src($feed, $name); - $this_feed_src and do { - return install_src($this_feed_src, $name, $force); + lookup_src($feed, $name) and do { + return install_src($feed, $name, $force); }; return install_package($feed, $name, $force); From 866307285445f1086af1cc8352a46e55260274d1 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Thu, 10 Dec 2020 19:29:03 +0000 Subject: [PATCH 43/65] config: add big EXPERIMENTAL option As discussed in the today's (2020-12-10) meeting, add a new option to menuconfig to group the selection of all experimental features to be selected by default. Developers are recommended to make use of this new symbol to guard new features. Other developers and community members should feel encouraged to build with this flag enabled to help testing and provide feedback. Signed-off-by: Daniel Golle --- config/Config-build.in | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/config/Config-build.in b/config/Config-build.in index cfefa4eed3..0aaf6b31c3 100644 --- a/config/Config-build.in +++ b/config/Config-build.in @@ -5,6 +5,20 @@ # See /LICENSE for more information. # +config EXPERIMENTAL + bool "Enable experimental features by default" + default n + help + Set this option to build with latest bleeding edge features + which may or may not work as expected. + If you would like to help the development of OpenWrt, you are + encouraged to set this option and provide feedback (both + positive and negative). But do so only if you know how to + recover your device in case of flashing potentially non-working + firmware. + + If you plan to use this build in production, say NO! + menu "Global build settings" config JSON_OVERVIEW_IMAGE_INFO @@ -51,7 +65,7 @@ menu "Global build settings" config TESTING_KERNEL bool "Use the testing kernel version" depends on HAS_TESTING_KERNEL - default n + default EXPERIMENTAL help If the target supports a newer kernel version than the default, you can use this config option to enable it From 81df64557239e2dd363d7bd9b7a491c65597f6cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gonz=C3=A1lez=20Cabanelas?= Date: Thu, 10 Dec 2020 10:26:46 +0100 Subject: [PATCH 44/65] bcm63xx: DGND3700v1: use the real board name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Netgear DGND3700v1/DGND3800B shows kernel redundant info at the board message, already provided by the machine info message. Use the real board name which is silkscreened on the PCB and used in the stock firmware header. Signed-off-by: Daniel González Cabanelas --- target/linux/bcm63xx/patches-5.4/518-board_bcm6368.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/bcm63xx/patches-5.4/518-board_bcm6368.patch b/target/linux/bcm63xx/patches-5.4/518-board_bcm6368.patch index 4b85e0bbab..e200535217 100644 --- a/target/linux/bcm63xx/patches-5.4/518-board_bcm6368.patch +++ b/target/linux/bcm63xx/patches-5.4/518-board_bcm6368.patch @@ -136,7 +136,7 @@ +}; + +static struct board_info __initdata board_DGND3700v1_3800B = { -+ .name = "DGND3700v1_3800B", ++ .name = "U12L144T01", + .expected_cpu_id = 0x6368, + + .has_pci = 1, From 4e8a0014aa87645994382c7619e9181922f15aa4 Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Sun, 6 Dec 2020 23:43:47 -0300 Subject: [PATCH 45/65] wolfssl: add lighty support, skip crypttests Tnis adds the --enable-lighty option to configure, enabling the minimum API needed to run lighttpd, in the packages feed. Size increase is about 120 bytes for arm_cortex-a9_vfpv3-d16. While at it, speed up build by disabling crypt bench/test. Signed-off-by: Eneas U de Queiroz --- package/libs/wolfssl/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package/libs/wolfssl/Makefile b/package/libs/wolfssl/Makefile index dc8ca2b262..4b891d634a 100644 --- a/package/libs/wolfssl/Makefile +++ b/package/libs/wolfssl/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=wolfssl PKG_VERSION:=4.5.0-stable -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/wolfSSL/wolfssl/archive/v$(PKG_VERSION) @@ -61,9 +61,11 @@ TARGET_LDFLAGS += -flto # --enable-stunnel needed for OpenSSL API compatibility bits CONFIGURE_ARGS += \ + --enable-lighty \ --enable-opensslextra \ --enable-sni \ --enable-stunnel \ + --disable-crypttests \ --disable-examples \ --disable-jobserver \ --$(if $(CONFIG_IPV6),enable,disable)-ipv6 \ From f31c9cd383b2d4e694b774575e4261ee97140f77 Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Sun, 6 Dec 2020 23:43:48 -0300 Subject: [PATCH 46/65] wolfssl: compile with --enable-opensslall This enables all OpenSSL API available. It is required to avoid some silent failures, such as when performing client certificate validation. Package size increases from 356.6K to 374.7K for arm_cortex-a9_vfpv3-d16. Signed-off-by: Eneas U de Queiroz --- package/libs/wolfssl/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package/libs/wolfssl/Makefile b/package/libs/wolfssl/Makefile index 4b891d634a..aeea1b7b7b 100644 --- a/package/libs/wolfssl/Makefile +++ b/package/libs/wolfssl/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=wolfssl PKG_VERSION:=4.5.0-stable -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/wolfSSL/wolfssl/archive/v$(PKG_VERSION) @@ -62,6 +62,7 @@ TARGET_LDFLAGS += -flto # --enable-stunnel needed for OpenSSL API compatibility bits CONFIGURE_ARGS += \ --enable-lighty \ + --enable-opensslall \ --enable-opensslextra \ --enable-sni \ --enable-stunnel \ From 064d65c2f76409759ac8d72268f2558c7b55f3b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Mon, 7 Dec 2020 10:10:49 +0100 Subject: [PATCH 47/65] wolfssl: fix broken wolfSSL_X509_check_host MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backport upstream post 4.5.0 fix for broken wolfSSL_X509_check_host(). References: https://github.com/wolfSSL/wolfssl/issues/3329 Signed-off-by: Petr Štetiar --- package/libs/wolfssl/Makefile | 2 +- .../200-fix-checkhostname-matching.patch | 123 ++++++++++++++++++ 2 files changed, 124 insertions(+), 1 deletion(-) create mode 100644 package/libs/wolfssl/patches/200-fix-checkhostname-matching.patch diff --git a/package/libs/wolfssl/Makefile b/package/libs/wolfssl/Makefile index aeea1b7b7b..6758f7dd08 100644 --- a/package/libs/wolfssl/Makefile +++ b/package/libs/wolfssl/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=wolfssl PKG_VERSION:=4.5.0-stable -PKG_RELEASE:=4 +PKG_RELEASE:=5 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/wolfSSL/wolfssl/archive/v$(PKG_VERSION) diff --git a/package/libs/wolfssl/patches/200-fix-checkhostname-matching.patch b/package/libs/wolfssl/patches/200-fix-checkhostname-matching.patch new file mode 100644 index 0000000000..aaf14e46d9 --- /dev/null +++ b/package/libs/wolfssl/patches/200-fix-checkhostname-matching.patch @@ -0,0 +1,123 @@ +From ea5c290d605b2af7b10d6e5ce69aa3534f52385f Mon Sep 17 00:00:00 2001 +From: Eric Blankenhorn +Date: Fri, 17 Jul 2020 08:37:02 -0500 +Subject: [PATCH] Fix CheckHostName matching + +--- + src/internal.c | 18 ++++++++++++------ + src/ssl.c | 5 +++++ + tests/api.c | 30 ++++++++++++++++++++++++++++++ + 3 files changed, 47 insertions(+), 6 deletions(-) + +diff --git a/src/internal.c b/src/internal.c +index dc57df0242..cda815d875 100644 +--- a/src/internal.c ++++ b/src/internal.c +@@ -9346,7 +9346,7 @@ int CheckForAltNames(DecodedCert* dCert, const char* domain, int* checkCN) + altName = dCert->altNames; + + if (checkCN != NULL) { +- *checkCN = altName == NULL; ++ *checkCN = (altName == NULL) ? 1 : 0; + } + + while (altName) { +@@ -9415,23 +9415,29 @@ int CheckForAltNames(DecodedCert* dCert, const char* domain, int* checkCN) + int CheckHostName(DecodedCert* dCert, const char *domainName, size_t domainNameLen) + { + int checkCN; ++ int ret = DOMAIN_NAME_MISMATCH; + + /* Assume name is NUL terminated. */ + (void)domainNameLen; + + if (CheckForAltNames(dCert, domainName, &checkCN) != 1) { +- WOLFSSL_MSG("DomainName match on alt names failed too"); +- return DOMAIN_NAME_MISMATCH; ++ WOLFSSL_MSG("DomainName match on alt names failed"); + } ++ else { ++ ret = 0; ++ } ++ + if (checkCN == 1) { + if (MatchDomainName(dCert->subjectCN, dCert->subjectCNLen, +- domainName) == 0) { ++ domainName) == 1) { ++ ret = 0; ++ } ++ else { + WOLFSSL_MSG("DomainName match on common name failed"); +- return DOMAIN_NAME_MISMATCH; + } + } + +- return 0; ++ return ret; + } + + int CheckIPAddr(DecodedCert* dCert, const char* ipasc) +diff --git a/src/ssl.c b/src/ssl.c +index 11bc08a3cb..59ad9bae60 100644 +--- a/src/ssl.c ++++ b/src/ssl.c +@@ -43661,6 +43661,11 @@ int wolfSSL_X509_check_host(WOLFSSL_X509 *x, const char *chk, size_t chklen, + (void)flags; + (void)peername; + ++ if ((x == NULL) || (chk == NULL)) { ++ WOLFSSL_MSG("Invalid parameter"); ++ return WOLFSSL_FAILURE; ++ } ++ + if (flags == WOLFSSL_NO_WILDCARDS) { + WOLFSSL_MSG("X509_CHECK_FLAG_NO_WILDCARDS not yet implemented"); + return WOLFSSL_FAILURE; +diff --git a/tests/api.c b/tests/api.c +index 774a332968..db888952d4 100644 +--- a/tests/api.c ++++ b/tests/api.c +@@ -23875,6 +23875,35 @@ static void test_wolfSSL_X509_issuer_name_hash(void) + #endif + } + ++static void test_wolfSSL_X509_check_host(void) ++{ ++#if defined(OPENSSL_EXTRA) && !defined(NO_CERTS) && !defined(NO_FILESYSTEM) \ ++ && !defined(NO_SHA) && !defined(NO_RSA) ++ ++ X509* x509; ++ const char altName[] = "example.com"; ++ ++ printf(testingFmt, "wolfSSL_X509_check_host()"); ++ ++ AssertNotNull(x509 = wolfSSL_X509_load_certificate_file(cliCertFile, ++ SSL_FILETYPE_PEM)); ++ ++ AssertIntEQ(X509_check_host(x509, altName, XSTRLEN(altName), 0, NULL), ++ WOLFSSL_SUCCESS); ++ ++ AssertIntEQ(X509_check_host(x509, NULL, 0, 0, NULL), ++ WOLFSSL_FAILURE); ++ ++ X509_free(x509); ++ ++ AssertIntEQ(X509_check_host(NULL, altName, XSTRLEN(altName), 0, NULL), ++ WOLFSSL_FAILURE); ++ ++ printf(resultFmt, passed); ++ ++#endif ++} ++ + static void test_wolfSSL_DES(void) + { + #if defined(OPENSSL_EXTRA) && !defined(NO_DES3) +@@ -36407,6 +36436,7 @@ void ApiTest(void) + test_wolfSSL_X509_INFO(); + test_wolfSSL_X509_subject_name_hash(); + test_wolfSSL_X509_issuer_name_hash(); ++ test_wolfSSL_X509_check_host(); + test_wolfSSL_DES(); + test_wolfSSL_certs(); + test_wolfSSL_ASN1_TIME_print(); From d82c1912838f262b6f4b9157077f390f5f06b6c4 Mon Sep 17 00:00:00 2001 From: John Thomson Date: Wed, 9 Dec 2020 13:03:04 +1000 Subject: [PATCH 48/65] package/base-files: caldata: use dd iflag fullblock MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This dd flag ensures that the requested size is retrieved from pipes or special filesystems (if available). Without this flag, on multi-core systems, Piped or special filesystem data can be truncated when a size greater than PIPE_BUF is requested. Fixes: FS#3494 Fixes: 7557e7f ("package/base-files: caldata: work around dd's limitation") Cc: Thibaut VARÈNE Signed-off-by: John Thomson --- package/base-files/Makefile | 2 +- .../base-files/files/lib/functions/caldata.sh | 37 +++++++++++++------ 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/package/base-files/Makefile b/package/base-files/Makefile index 0c612b73ca..fbcb694592 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:=239 +PKG_RELEASE:=240 PKG_FLAGS:=nonshared PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/ diff --git a/package/base-files/files/lib/functions/caldata.sh b/package/base-files/files/lib/functions/caldata.sh index e22c7d27e6..2177cf8415 100644 --- a/package/base-files/files/lib/functions/caldata.sh +++ b/package/base-files/files/lib/functions/caldata.sh @@ -3,6 +3,16 @@ . /lib/functions.sh . /lib/functions/system.sh +caldata_dd() { + local source=$1 + local target=$2 + local count=$(($3)) + local offset=$(($4)) + + dd if=$source of=$target iflag=skip_bytes,fullblock bs=$count skip=$offset count=1 2>/dev/null + return $? +} + caldata_die() { echo "caldata: " "$*" exit 1 @@ -17,7 +27,7 @@ caldata_extract() { mtd=$(find_mtd_chardev $part) [ -n "$mtd" ] || caldata_die "no mtd device found for partition $part" - dd if=$mtd of=/lib/firmware/$FIRMWARE iflag=skip_bytes bs=$count skip=$offset count=1 2>/dev/null || \ + caldata_dd $mtd /lib/firmware/$FIRMWARE $count $offset || \ caldata_die "failed to extract calibration data from $mtd" } @@ -34,7 +44,7 @@ caldata_extract_ubi() { ubi=$(nand_find_volume $ubidev $part) [ -n "$ubi" ] || caldata_die "no UBI volume found for $part" - dd if=/dev/$ubi of=/lib/firmware/$FIRMWARE iflag=skip_bytes bs=$count skip=$offset count=1 2>/dev/null || \ + caldata_dd /dev/$ubi /lib/firmware/$FIRMWARE $count $offset || \ caldata_die "failed to extract calibration data from $ubi" } @@ -64,8 +74,7 @@ caldata_from_file() { [ -n "$target" ] || target=/lib/firmware/$FIRMWARE - # dd doesn't handle partial reads from special files: use cat - cat $source | dd of=$target iflag=skip_bytes bs=$count skip=$offset count=1 2>/dev/null || \ + caldata_dd $source $target $count $offset || \ caldata_die "failed to extract calibration data from $source" } @@ -73,16 +82,20 @@ caldata_sysfsload_from_file() { local source=$1 local offset=$(($2)) local count=$(($3)) + local target_dir="/sys/$DEVPATH" + local target="$target_dir/data" - # dd doesn't handle partial reads from special files: use cat - # test extract to /dev/null first - cat $source | dd of=/dev/null iflag=skip_bytes bs=$count skip=$offset count=1 2>/dev/null || \ + [ -d "$target_dir" ] || \ + caldata_die "no sysfs dir to write: $target" + + echo 1 > "$target_dir/loading" + caldata_dd $source $target $count $offset + if [ $? != 0 ]; then + echo 1 > "$target_dir/loading" caldata_die "failed to extract calibration data from $source" - - # can't fail now - echo 1 > /sys/$DEVPATH/loading - cat $source | dd of=/sys/$DEVPATH/data iflag=skip_bytes bs=$count skip=$offset count=1 2>/dev/null - echo 0 > /sys/$DEVPATH/loading + else + echo 0 > "$target_dir/loading" + fi } caldata_valid() { From 848d668427c544d20f8aa3041fa11b4d4adc9bc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mikrut?= Date: Tue, 8 Dec 2020 21:54:40 +0100 Subject: [PATCH 49/65] realtek: Fix self assignment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cppcheck shows self initialization error, which is an obvious bug. Basing on logic of similar fragment below I assigned to this variable, value `RTL838X_LED_GLB_CTRL` which I think is proper. Signed-off-by: Rafał Mikrut --- target/linux/realtek/files-5.4/drivers/gpio/gpio-rtl838x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/realtek/files-5.4/drivers/gpio/gpio-rtl838x.c b/target/linux/realtek/files-5.4/drivers/gpio/gpio-rtl838x.c index 92cf5f765a..8207e4bb73 100644 --- a/target/linux/realtek/files-5.4/drivers/gpio/gpio-rtl838x.c +++ b/target/linux/realtek/files-5.4/drivers/gpio/gpio-rtl838x.c @@ -357,7 +357,7 @@ static int rtl838x_gpio_probe(struct platform_device *pdev) } if (soc_info.family == RTL8380_FAMILY_ID) { - gpios->led_glb_ctrl = gpios->led_glb_ctrl; + gpios->led_glb_ctrl = RTL838X_LED_GLB_CTRL; gpios->led_sw_ctrl = RTL838X_LED_SW_CTRL; gpios->led_sw_p_ctrl = rtl838x_led_sw_p_ctrl; gpios->led_sw_p_en_ctrl = rtl838x_led_sw_p_en_ctrl; From 561bfc96f9bb3303791f6620a958d02167abed0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mikrut?= Date: Tue, 8 Dec 2020 22:01:14 +0100 Subject: [PATCH 50/65] realtek: Add missing case in switch statement MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cppcheck shows here duplicated break. Code `state->speed = SPEED_1000;` will be never executed because above it there is break statement. Almost identical statement is placed in another realtek driver https://github.com/openwrt/openwrt/blob/18a53d43d646290053eff4736ec852efcf6bf510/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/dsa.c#L286-L294 Signed-off-by: Rafał Mikrut --- .../linux/realtek/files-5.4/drivers/net/ethernet/rtl838x_eth.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/realtek/files-5.4/drivers/net/ethernet/rtl838x_eth.c b/target/linux/realtek/files-5.4/drivers/net/ethernet/rtl838x_eth.c index d53d5dec12..fec842674e 100644 --- a/target/linux/realtek/files-5.4/drivers/net/ethernet/rtl838x_eth.c +++ b/target/linux/realtek/files-5.4/drivers/net/ethernet/rtl838x_eth.c @@ -986,6 +986,7 @@ static int rtl838x_mac_pcs_get_state(struct phylink_config *config, case 1: state->speed = SPEED_100; break; + case 2: state->speed = SPEED_1000; break; default: From 7e122c353ae7f1e5c546ada94b6d2c3025bee0fe Mon Sep 17 00:00:00 2001 From: Konstantin Demin Date: Wed, 25 Nov 2020 01:54:05 +0300 Subject: [PATCH 51/65] dropbear: enable back DROPBEAR_USE_PASSWORD_ENV this option was disabled in 2011 and these long nine years showed us that change was definitely wrong. binary size cost is much less than 1k. tested on ath79/generic: bin: 215128 -> 215128 (no change) ipk: 111108 -> 111183 (+75b) Fixes: 3c801b3dc0359 ("tune some more options by default to decrease size") Signed-off-by: Konstantin Demin --- package/network/services/dropbear/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package/network/services/dropbear/Makefile b/package/network/services/dropbear/Makefile index 8520426382..727f1c16b0 100644 --- a/package/network/services/dropbear/Makefile +++ b/package/network/services/dropbear/Makefile @@ -126,8 +126,7 @@ define Build/Configure $(PKG_BUILD_DIR)/sysoptions.h # disable legacy/unsafe methods and unused functionality - for OPTION in INETD_MODE DROPBEAR_CLI_NETCAT \ - DROPBEAR_DSS DROPBEAR_USE_PASSWORD_ENV DO_MOTD ; do \ + for OPTION in INETD_MODE DROPBEAR_CLI_NETCAT DROPBEAR_DSS DO_MOTD ; do \ echo "#define $$$$OPTION 0" >> \ $(PKG_BUILD_DIR)/localoptions.h; \ done From 42eff7c7e677f6bbc15da1215db664c0e5d260da Mon Sep 17 00:00:00 2001 From: Konstantin Demin Date: Wed, 25 Nov 2020 02:59:59 +0300 Subject: [PATCH 52/65] dropbear: reorder options in Configure recipe put static options at first place, then place configurable options. also put DROPBEAR_ECC right before DROPBEAR_ECC_FULL to ease maintainance. Signed-off-by: Konstantin Demin --- package/network/services/dropbear/Makefile | 28 +++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/package/network/services/dropbear/Makefile b/package/network/services/dropbear/Makefile index 727f1c16b0..22befbb0cf 100644 --- a/package/network/services/dropbear/Makefile +++ b/package/network/services/dropbear/Makefile @@ -107,20 +107,6 @@ define Build/Configure echo '#define DEFAULT_PATH "$(TARGET_INIT_PATH)"' >> \ $(PKG_BUILD_DIR)/localoptions.h - echo '#define DROPBEAR_CURVE25519 $(if $(CONFIG_DROPBEAR_CURVE25519),1,0)' >> \ - $(PKG_BUILD_DIR)/localoptions.h - - for OPTION in DROPBEAR_ECDSA DROPBEAR_ECDH; do \ - echo "#define $$$$OPTION $(if $(CONFIG_DROPBEAR_ECC),1,0)" >> \ - $(PKG_BUILD_DIR)/localoptions.h; \ - done - - echo '#define DROPBEAR_ED25519 $(if $(CONFIG_DROPBEAR_ED25519),1,0)' >> \ - $(PKG_BUILD_DIR)/localoptions.h - - echo '#define DROPBEAR_CHACHA20POLY1305 $(if $(CONFIG_DROPBEAR_CHACHA20POLY1305),1,0)' >> \ - $(PKG_BUILD_DIR)/localoptions.h - # remove protocol idented software version number $(ESED) 's,^(#define LOCAL_IDENT) .*$$$$,\1 "SSH-2.0-dropbear",g' \ $(PKG_BUILD_DIR)/sysoptions.h @@ -131,6 +117,20 @@ define Build/Configure $(PKG_BUILD_DIR)/localoptions.h; \ done + echo '#define DROPBEAR_CURVE25519 $(if $(CONFIG_DROPBEAR_CURVE25519),1,0)' >> \ + $(PKG_BUILD_DIR)/localoptions.h + + echo '#define DROPBEAR_ED25519 $(if $(CONFIG_DROPBEAR_ED25519),1,0)' >> \ + $(PKG_BUILD_DIR)/localoptions.h + + echo '#define DROPBEAR_CHACHA20POLY1305 $(if $(CONFIG_DROPBEAR_CHACHA20POLY1305),1,0)' >> \ + $(PKG_BUILD_DIR)/localoptions.h + + for OPTION in DROPBEAR_ECDSA DROPBEAR_ECDH; do \ + echo "#define $$$$OPTION $(if $(CONFIG_DROPBEAR_ECC),1,0)" >> \ + $(PKG_BUILD_DIR)/localoptions.h; \ + done + # enable nistp384 and nistp521 only if full ECC support was requested for OPTION in DROPBEAR_ECC_384 DROPBEAR_ECC_521; do \ $(ESED) 's,^(#define '$$$$OPTION') .*$$$$,\1 $(if $(CONFIG_DROPBEAR_ECC_FULL),1,0),g' \ From 79d5c2472482e7c1564104e5e3db26e97bdfd84f Mon Sep 17 00:00:00 2001 From: Konstantin Demin Date: Wed, 25 Nov 2020 07:33:25 +0300 Subject: [PATCH 53/65] dropbear: rework recipes that configure build - add two helper functions to avoid mistakes with choice of correct header file to work with - update rules accordingly Signed-off-by: Konstantin Demin --- package/network/services/dropbear/Makefile | 39 ++++++++++------------ 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/package/network/services/dropbear/Makefile b/package/network/services/dropbear/Makefile index 22befbb0cf..0a6e83ad01 100644 --- a/package/network/services/dropbear/Makefile +++ b/package/network/services/dropbear/Makefile @@ -99,43 +99,38 @@ CONFIGURE_ARGS += \ TARGET_CFLAGS += -DARGTYPE=3 -ffunction-sections -fdata-sections -flto TARGET_LDFLAGS += -Wl,--gc-sections -flto=jobserver +db_opt_add =echo '\#define $(1) $(2)' >> $(PKG_BUILD_DIR)/localoptions.h +db_opt_replace =$(ESED) 's,^(\#define $(1)) .*$$$$,\1 $(2),g' $(PKG_BUILD_DIR)/sysoptions.h + define Build/Configure : > $(PKG_BUILD_DIR)/localoptions.h $(Build/Configure/Default) - echo '#define DEFAULT_PATH "$(TARGET_INIT_PATH)"' >> \ - $(PKG_BUILD_DIR)/localoptions.h + $(call db_opt_add,DEFAULT_PATH,"$(TARGET_INIT_PATH)") # remove protocol idented software version number - $(ESED) 's,^(#define LOCAL_IDENT) .*$$$$,\1 "SSH-2.0-dropbear",g' \ - $(PKG_BUILD_DIR)/sysoptions.h + $(call db_opt_replace,LOCAL_IDENT,"SSH-2.0-dropbear") # disable legacy/unsafe methods and unused functionality - for OPTION in INETD_MODE DROPBEAR_CLI_NETCAT DROPBEAR_DSS DO_MOTD ; do \ - echo "#define $$$$OPTION 0" >> \ - $(PKG_BUILD_DIR)/localoptions.h; \ - done + $(foreach opt,INETD_MODE DROPBEAR_CLI_NETCAT DROPBEAR_DSS DO_MOTD, \ + $(call db_opt_add,$(opt),0) ; \ + ) - echo '#define DROPBEAR_CURVE25519 $(if $(CONFIG_DROPBEAR_CURVE25519),1,0)' >> \ - $(PKG_BUILD_DIR)/localoptions.h + $(call db_opt_add,DROPBEAR_CURVE25519,$(if $(CONFIG_DROPBEAR_CURVE25519),1,0)) - echo '#define DROPBEAR_ED25519 $(if $(CONFIG_DROPBEAR_ED25519),1,0)' >> \ - $(PKG_BUILD_DIR)/localoptions.h + $(call db_opt_add,DROPBEAR_ED25519,$(if $(CONFIG_DROPBEAR_ED25519),1,0)) - echo '#define DROPBEAR_CHACHA20POLY1305 $(if $(CONFIG_DROPBEAR_CHACHA20POLY1305),1,0)' >> \ - $(PKG_BUILD_DIR)/localoptions.h + $(call db_opt_add,DROPBEAR_CHACHA20POLY1305,$(if $(CONFIG_DROPBEAR_CHACHA20POLY1305),1,0)) - for OPTION in DROPBEAR_ECDSA DROPBEAR_ECDH; do \ - echo "#define $$$$OPTION $(if $(CONFIG_DROPBEAR_ECC),1,0)" >> \ - $(PKG_BUILD_DIR)/localoptions.h; \ - done + $(foreach opt,DROPBEAR_ECDSA DROPBEAR_ECDH, \ + $(call db_opt_add,$(opt),$(if $(CONFIG_DROPBEAR_ECC),1,0)) ; \ + ) # enable nistp384 and nistp521 only if full ECC support was requested - for OPTION in DROPBEAR_ECC_384 DROPBEAR_ECC_521; do \ - $(ESED) 's,^(#define '$$$$OPTION') .*$$$$,\1 $(if $(CONFIG_DROPBEAR_ECC_FULL),1,0),g' \ - $(PKG_BUILD_DIR)/sysoptions.h; \ - done + $(foreach opt,DROPBEAR_ECC_384 DROPBEAR_ECC_521, \ + $(call db_opt_replace,$(opt),$(if $(CONFIG_DROPBEAR_ECC_FULL),1,0)) ; \ + ) # Enforce rebuild of svr-chansession.c rm -f $(PKG_BUILD_DIR)/svr-chansession.o From e1bd9645b6aee8fc2ae3b56fb2c4332c4d792b89 Mon Sep 17 00:00:00 2001 From: Konstantin Demin Date: Wed, 25 Nov 2020 06:12:41 +0300 Subject: [PATCH 54/65] dropbear: roll up recipes into mapping lists this commit removes manual recipes for options and introduces mapping lists: - DB_OPT_COMMON holds option mappings which are common for all builds; - DB_OPT_CONFIG holds option mappings which are depend on config settings. DB_OPT_COMMON is space-separated list of 'words', each of them is in format: 'header_option|value' 'header_option' is added with value 'value' to 'localoptions.h'. if 'header_option' is preceded by two exclamation marks ('!!') then option is not added to 'localoptions.h' but replaced in 'sysoptions.h'. in short: option|value - add option to localoptions.h !!option|value - replace option in sysoptions.h DB_OPT_CONFIG is space-separated list of 'words', each of them is in format: 'header_option|config_variable|value_enabled|value_disabled' 'header_option' is handled likewise in DB_OPT_COMMON. if 'config_variable' is enabled (technically: not disabled) then 'header_option' is set to 'value_enabled' and 'value_disabled' otherwise. in short: option|config|enabled|disabled = add option to localoptions.h !!option|config|enabled|disabled = replace option in sysoptions.h option := (config) ? enabled : disabled If you're not sure that option's value doesn't have '|' within - add your recipe manually right after '$(Build/Configure/dropbear_headers)' and write some words about your decision. PS about two exclamation marks: early idea was to use one exclamation mark to denote such header options but then i thought single exclamation mark may be overlooked by mistake. Signed-off-by: Konstantin Demin --- package/network/services/dropbear/Makefile | 83 +++++++++++++++------- 1 file changed, 59 insertions(+), 24 deletions(-) diff --git a/package/network/services/dropbear/Makefile b/package/network/services/dropbear/Makefile index 0a6e83ad01..5021c2aee1 100644 --- a/package/network/services/dropbear/Makefile +++ b/package/network/services/dropbear/Makefile @@ -96,41 +96,76 @@ CONFIGURE_ARGS += \ $(if $(CONFIG_DROPBEAR_ZLIB),,--disable-zlib) \ --enable-bundled-libtom +############################################################################## +# +# option|value - add option to localoptions.h +# !!option|value - replace option in sysoptions.h +# +############################################################################## + +# remove protocol idented software version number: +# - LOCAL_IDENT +# disable legacy/unsafe methods and unused functionality: +# - INETD_MODE +# - DROPBEAR_CLI_NETCAT +# - DROPBEAR_DSS +# - DO_MOTD +DB_OPT_COMMON = \ + DEFAULT_PATH|"$(TARGET_INIT_PATH)" \ + !!LOCAL_IDENT|"SSH-2.0-dropbear" \ + INETD_MODE|0 \ + DROPBEAR_CLI_NETCAT|0 \ + DROPBEAR_DSS|0 \ + DO_MOTD|0 \ + + +############################################################################## +# +# option|config|enabled|disabled = add option to localoptions.h +# !!option|config|enabled|disabled = replace option in sysoptions.h +# +# option := (config) ? enabled : disabled +# +############################################################################## + +DB_OPT_CONFIG = \ + DROPBEAR_CURVE25519|CONFIG_DROPBEAR_CURVE25519|1|0 \ + DROPBEAR_ED25519|CONFIG_DROPBEAR_ED25519|1|0 \ + DROPBEAR_CHACHA20POLY1305|CONFIG_DROPBEAR_CHACHA20POLY1305|1|0 \ + DROPBEAR_ECDSA|CONFIG_DROPBEAR_ECC|1|0 \ + DROPBEAR_ECDH|CONFIG_DROPBEAR_ECC|1|0 \ + !!DROPBEAR_ECC_384|CONFIG_DROPBEAR_ECC_FULL|1|0 \ + !!DROPBEAR_ECC_521|CONFIG_DROPBEAR_ECC_FULL|1|0 \ + + TARGET_CFLAGS += -DARGTYPE=3 -ffunction-sections -fdata-sections -flto TARGET_LDFLAGS += -Wl,--gc-sections -flto=jobserver db_opt_add =echo '\#define $(1) $(2)' >> $(PKG_BUILD_DIR)/localoptions.h db_opt_replace =$(ESED) 's,^(\#define $(1)) .*$$$$,\1 $(2),g' $(PKG_BUILD_DIR)/sysoptions.h +define Build/Configure/dropbear_headers + $(strip $(foreach s,$(DB_OPT_COMMON), \ + $(if $(filter !!%,$(word 1,$(subst |, ,$(s)))), \ + $(call db_opt_replace,$(patsubst !!%,%,$(word 1,$(subst |, ,$(s)))),$(word 2,$(subst |, ,$(s)))), \ + $(call db_opt_add,$(word 1,$(subst |, ,$(s))),$(word 2,$(subst |, ,$(s)))) \ + ) ; \ + )) + + $(strip $(foreach s,$(DB_OPT_CONFIG), \ + $(if $(filter !!%,$(word 1,$(subst |, ,$(s)))), \ + $(call db_opt_replace,$(patsubst !!%,%,$(word 1,$(subst |, ,$(s)))),$(if $($(word 2,$(subst |, ,$(s)))),$(word 3,$(subst |, ,$(s))),$(word 4,$(subst |, ,$(s))))), \ + $(call db_opt_add,$(word 1,$(subst |, ,$(s))),$(if $($(word 2,$(subst |, ,$(s)))),$(word 3,$(subst |, ,$(s))),$(word 4,$(subst |, ,$(s))))) \ + ) ; \ + )) +endef + define Build/Configure : > $(PKG_BUILD_DIR)/localoptions.h $(Build/Configure/Default) - $(call db_opt_add,DEFAULT_PATH,"$(TARGET_INIT_PATH)") - - # remove protocol idented software version number - $(call db_opt_replace,LOCAL_IDENT,"SSH-2.0-dropbear") - - # disable legacy/unsafe methods and unused functionality - $(foreach opt,INETD_MODE DROPBEAR_CLI_NETCAT DROPBEAR_DSS DO_MOTD, \ - $(call db_opt_add,$(opt),0) ; \ - ) - - $(call db_opt_add,DROPBEAR_CURVE25519,$(if $(CONFIG_DROPBEAR_CURVE25519),1,0)) - - $(call db_opt_add,DROPBEAR_ED25519,$(if $(CONFIG_DROPBEAR_ED25519),1,0)) - - $(call db_opt_add,DROPBEAR_CHACHA20POLY1305,$(if $(CONFIG_DROPBEAR_CHACHA20POLY1305),1,0)) - - $(foreach opt,DROPBEAR_ECDSA DROPBEAR_ECDH, \ - $(call db_opt_add,$(opt),$(if $(CONFIG_DROPBEAR_ECC),1,0)) ; \ - ) - - # enable nistp384 and nistp521 only if full ECC support was requested - $(foreach opt,DROPBEAR_ECC_384 DROPBEAR_ECC_521, \ - $(call db_opt_replace,$(opt),$(if $(CONFIG_DROPBEAR_ECC_FULL),1,0)) ; \ - ) + $(Build/Configure/dropbear_headers) # Enforce rebuild of svr-chansession.c rm -f $(PKG_BUILD_DIR)/svr-chansession.o From 228298290e5de2a1a7404e90aef81ace68273683 Mon Sep 17 00:00:00 2001 From: Konstantin Demin Date: Wed, 25 Nov 2020 06:14:30 +0300 Subject: [PATCH 55/65] dropbear: add ssh-askpass support in configuration binary size cost is much less than 1k. tested on ath79/generic: bin: 215128 -> 215132 (+4b) ipk: 111183 -> 111494 (+311b) Signed-off-by: Konstantin Demin --- package/network/services/dropbear/Config.in | 10 ++++++++++ package/network/services/dropbear/Makefile | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/package/network/services/dropbear/Config.in b/package/network/services/dropbear/Config.in index 6aa5a7e4e1..15000eff53 100644 --- a/package/network/services/dropbear/Config.in +++ b/package/network/services/dropbear/Config.in @@ -99,4 +99,14 @@ config DROPBEAR_SCP bool "Build dropbear with scp" default y +config DROPBEAR_ASKPASS + bool "Enable askpass helper support" + default n + depends on DROPBEAR_DBCLIENT + help + This enables support for ssh-askpass helper in dropbear client + in order to authenticate on remote hosts. + + Increases binary size by about 0.1 kB (MIPS). + endmenu diff --git a/package/network/services/dropbear/Makefile b/package/network/services/dropbear/Makefile index 5021c2aee1..af346f44ac 100644 --- a/package/network/services/dropbear/Makefile +++ b/package/network/services/dropbear/Makefile @@ -32,7 +32,7 @@ PKG_CONFIG_DEPENDS:= \ CONFIG_DROPBEAR_CURVE25519 CONFIG_DROPBEAR_ZLIB \ CONFIG_DROPBEAR_ED25519 CONFIG_DROPBEAR_CHACHA20POLY1305 \ CONFIG_DROPBEAR_UTMP CONFIG_DROPBEAR_PUTUTLINE \ - CONFIG_DROPBEAR_DBCLIENT CONFIG_DROPBEAR_SCP + CONFIG_DROPBEAR_DBCLIENT CONFIG_DROPBEAR_SCP CONFIG_DROPBEAR_ASKPASS include $(INCLUDE_DIR)/package.mk @@ -136,6 +136,7 @@ DB_OPT_CONFIG = \ DROPBEAR_ECDH|CONFIG_DROPBEAR_ECC|1|0 \ !!DROPBEAR_ECC_384|CONFIG_DROPBEAR_ECC_FULL|1|0 \ !!DROPBEAR_ECC_521|CONFIG_DROPBEAR_ECC_FULL|1|0 \ + DROPBEAR_CLI_ASKPASS_HELPER|CONFIG_DROPBEAR_ASKPASS|1|0 \ TARGET_CFLAGS += -DARGTYPE=3 -ffunction-sections -fdata-sections -flto From 52aa2017d32226284c586f0142cafeba32ce7528 Mon Sep 17 00:00:00 2001 From: Konstantin Demin Date: Wed, 25 Nov 2020 06:16:06 +0300 Subject: [PATCH 56/65] dropbear: bump package version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bump package version after previous changes. Signed-off-by: Konstantin Demin [added missing commit description] Signed-off-by: Petr Štetiar --- package/network/services/dropbear/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/network/services/dropbear/Makefile b/package/network/services/dropbear/Makefile index af346f44ac..8bbb26f829 100644 --- a/package/network/services/dropbear/Makefile +++ b/package/network/services/dropbear/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dropbear PKG_VERSION:=2020.81 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:= \ From e401a2a42e6d7c892e1cf7d765fa5ec9b2db3fb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 22 Oct 2020 13:29:57 +0200 Subject: [PATCH 57/65] mvebu: fix initramfs/kernel image for CZNIC Turris Omnia MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This adds DTB to kernel and that way makes it possible to easily boot initramfs image and also kernel. The sequence to boot initramfs on Omnia is then just: env set bootargs earlyprintk console=ttyS0,115200 dhcp 0x1000000 192.168.1.1:openwrt-mvebu-cortexa9-cznic_turris-omnia-initramfs-kernel.bin bootz 0x1000000 Without this change kernel boot won't proceed and is stuck on "Starting kernel". Signed-off-by: Karel Kočí [fixed From: to match with SoB:] Signed-off-by: Petr Štetiar --- target/linux/mvebu/image/cortexa9.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/target/linux/mvebu/image/cortexa9.mk b/target/linux/mvebu/image/cortexa9.mk index ea20a25a29..67f68b1770 100644 --- a/target/linux/mvebu/image/cortexa9.mk +++ b/target/linux/mvebu/image/cortexa9.mk @@ -32,8 +32,7 @@ define Device/cznic_turris-omnia DEVICE_VENDOR := CZ.NIC DEVICE_MODEL := Turris Omnia KERNEL_INSTALL := 1 - KERNEL := kernel-bin - KERNEL_INITRAMFS := kernel-bin + KERNEL := kernel-bin | append-dtb DEVICE_PACKAGES := \ mkf2fs e2fsprogs kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1 \ wpad-basic-wolfssl kmod-ath9k kmod-ath10k-ct ath10k-firmware-qca988x-ct \ From b63e57ba1795dfedd425d5cd6fffdae56274b3d1 Mon Sep 17 00:00:00 2001 From: Marty Jones Date: Mon, 23 Nov 2020 21:49:10 -0500 Subject: [PATCH 58/65] kernel: add Aquantia AQtion USB-to-5GbE adapters This add support for USB-to-Ethernet Aquantia AQtion 5/2.5GbE adapters based on the AQC111U controllers. Run-tested: x86 Adapter-tested: Sabrent NT-SS5G Signed-off-by: Marty Jones --- package/kernel/linux/modules/usb.mk | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/package/kernel/linux/modules/usb.mk b/package/kernel/linux/modules/usb.mk index eaf9eadb28..81a7f00066 100644 --- a/package/kernel/linux/modules/usb.mk +++ b/package/kernel/linux/modules/usb.mk @@ -1104,6 +1104,21 @@ define AddDepends/usb-net endef +define KernelPackage/usb-net-aqc111 + TITLE:=Support for USB-to-Ethernet Aquantia AQtion 5/2.5GbE + KCONFIG:=CONFIG_USB_NET_AQC111 + FILES:=$(LINUX_DIR)/drivers/$(USBNET_DIR)/aqc111.ko + AUTOLOAD:=$(call AutoProbe,aqc111) + $(call AddDepends/usb-net) +endef + +define KernelPackage/usb-net-aqc111/description + Support for USB-to-Ethernet Aquantia AQtion 5/2.5GbE +endef + +$(eval $(call KernelPackage,usb-net-aqc111)) + + define KernelPackage/usb-net-asix TITLE:=Kernel module for USB-to-Ethernet Asix convertors DEPENDS:=+kmod-libphy From 882ca13d923796438fd06badeb00dc95b7eb1467 Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Fri, 11 Dec 2020 08:39:35 -0300 Subject: [PATCH 59/65] openssl: update to 1.1.1i Fixes: CVE-2020-1971, defined as high severity, summarized as: NULL pointer deref in GENERAL_NAME_cmp function can lead to a DOS attack. Signed-off-by: Eneas U de Queiroz --- package/libs/openssl/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile index 77c6d41cec..714ce2059a 100644 --- a/package/libs/openssl/Makefile +++ b/package/libs/openssl/Makefile @@ -9,9 +9,9 @@ include $(TOPDIR)/rules.mk PKG_NAME:=openssl PKG_BASE:=1.1.1 -PKG_BUGFIX:=h +PKG_BUGFIX:=i PKG_VERSION:=$(PKG_BASE)$(PKG_BUGFIX) -PKG_RELEASE:=2 +PKG_RELEASE:=1 PKG_USE_MIPS16:=0 ENGINES_DIR=engines-1.1 @@ -24,7 +24,7 @@ PKG_SOURCE_URL:= \ ftp://ftp.pca.dfn.de/pub/tools/net/openssl/source/ \ http://www.openssl.org/source/ \ http://www.openssl.org/source/old/$(PKG_BASE)/ -PKG_HASH:=5c9ca8774bd7b03e5784f26ae9e9e6d749c9da2438545077e6b3d755a06595d9 +PKG_HASH:=e8be6a35fe41d10603c3cc635e93289ed00bf34b79671a3a4de64fcee00d5242 PKG_LICENSE:=OpenSSL PKG_LICENSE_FILES:=LICENSE From 5d2b577a53021372ffe8327a102859124d9dffd2 Mon Sep 17 00:00:00 2001 From: Philip Prindeville Date: Mon, 7 Dec 2020 13:19:30 -0700 Subject: [PATCH 60/65] xfrm: support 'multicast' attribute on interfaces You shouldn't need the overhead of GRE just to add multicast capability on a point-to-point interface (for instance, you might want to run mDNS over IPsec transport connections, and Avahi requires IFF_MULTICAST be set on interfaces, even point-to-point ones). Borrowed heavily from: b3c9321b9e gre: Support multicast configurable gre interfaces Signed-off-by: Philip Prindeville --- package/network/config/xfrm/Makefile | 2 +- package/network/config/xfrm/files/xfrm.sh | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/package/network/config/xfrm/Makefile b/package/network/config/xfrm/Makefile index 1b3b99adb0..bcee89f82c 100644 --- a/package/network/config/xfrm/Makefile +++ b/package/network/config/xfrm/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=xfrm -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_LICENSE:=GPL-2.0 include $(INCLUDE_DIR)/package.mk diff --git a/package/network/config/xfrm/files/xfrm.sh b/package/network/config/xfrm/files/xfrm.sh index 1bd1958726..ca7c3380e6 100755 --- a/package/network/config/xfrm/files/xfrm.sh +++ b/package/network/config/xfrm/files/xfrm.sh @@ -11,8 +11,8 @@ proto_xfrm_setup() { local cfg="$1" local mode="xfrm" - local tunlink ifid mtu zone - json_get_vars tunlink ifid mtu zone + local tunlink ifid mtu zone multicast + json_get_vars tunlink ifid mtu zone multicast [ -z "$tunlink" ] && { proto_notify_error "$cfg" NO_TUNLINK @@ -36,6 +36,8 @@ proto_xfrm_setup() { json_add_string link "$tunlink" + json_add_boolean multicast "${multicast:-1}" + json_add_object 'data' [ -n "$ifid" ] && json_add_int ifid "$ifid" json_close_object @@ -61,6 +63,7 @@ proto_xfrm_init_config() { proto_config_add_string "tunlink" proto_config_add_string "zone" proto_config_add_int "ifid" + proto_config_add_boolean "multicast" } From be6aa93e4dbd2a0bc709de6eba3269998e25f490 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sat, 12 Dec 2020 14:45:16 +0000 Subject: [PATCH 61/65] selinux-policy: update to version 0.4 Signed-off-by: Daniel Golle --- package/system/selinux-policy/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package/system/selinux-policy/Makefile b/package/system/selinux-policy/Makefile index c2cef3a270..dad57e16b8 100644 --- a/package/system/selinux-policy/Makefile +++ b/package/system/selinux-policy/Makefile @@ -8,8 +8,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=selinux-policy PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://git.defensec.nl/selinux-policy.git -PKG_VERSION:=0.3 -PKG_MIRROR_HASH:=8f224e4e0ecb459648563862e26fcd5d4d113de5daa277363fc4316da5a05360 +PKG_VERSION:=0.4 +PKG_MIRROR_HASH:=6bf4df7df2e1a4f641e4068ec79b1f4921e29e531d5b76843f39c79470e646f8 PKG_SOURCE_VERSION:=v$(PKG_VERSION) PKG_BUILD_DEPENDS:=secilc/host policycoreutils/host @@ -44,6 +44,7 @@ endef define Package/selinux-policy/install $(INSTALL_DIR) $(1)/etc/selinux/$(PKG_NAME)/contexts/files/ $(INSTALL_DIR) $(1)/etc/selinux/$(PKG_NAME)/policy/ + $(INSTALL_DATA) $(PKG_BUILD_DIR)/customizable_types $(1)/etc/selinux/$(PKG_NAME)/contexts/ $(INSTALL_DATA) $(PKG_BUILD_DIR)/file_contexts.subs_dist $(1)/etc/selinux/$(PKG_NAME)/contexts/files/ $(INSTALL_DATA) $(PKG_BUILD_DIR)/file_contexts $(1)/etc/selinux/$(PKG_NAME)/contexts/files/ $(INSTALL_CONF) $(PKG_BUILD_DIR)/policy.* $(1)/etc/selinux/$(PKG_NAME)/policy/ From ee0ff7343ee05e985c2126f392dd003090ed213b Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sat, 12 Dec 2020 23:26:16 +0000 Subject: [PATCH 62/65] libubox: utils: introduce mkdir_p Add new utility function mkdir_p(char *path, mode_t mode) to replace the partially buggy implementations found accross fstools and procd. Signed-off-by: Daniel Golle --- package/libs/libubox/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/libs/libubox/Makefile b/package/libs/libubox/Makefile index 9d41ed7c7a..d9c239a50d 100644 --- a/package/libs/libubox/Makefile +++ b/package/libs/libubox/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/libubox.git -PKG_MIRROR_HASH:=cf963b19f5a25da85b2d8888514cbcc33c3f641c4478c9c25312b8bf83fe9e6b -PKG_SOURCE_DATE:=2020-08-06 -PKG_SOURCE_VERSION:=9e52171d70def760a6949676800d0b73f85ee22d +PKG_MIRROR_HASH:=97dc4eba01cf2c5d6a6d0db3747e0cdc0d95cb87e51b3115272e7d3e69a8b255 +PKG_SOURCE_DATE:=2020-12-12 +PKG_SOURCE_VERSION:=357877693ca363b12e6e7e14d345639b2440cd07 CMAKE_INSTALL:=1 PKG_LICENSE:=ISC @@ -27,7 +27,7 @@ define Package/libubox SECTION:=libs CATEGORY:=Libraries TITLE:=Basic utility library - ABI_VERSION:=20191228 + ABI_VERSION:=20201212 DEPENDS:= endef From 278b1e95a714aac0074fc2f0ffd225148a45ff7b Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sat, 12 Dec 2020 23:29:59 +0000 Subject: [PATCH 63/65] fstools: update to git HEAD 0c6fb90 jffs2-reset: allow doing a factory reset and passing a sysupgrade.tgz 4862530 mount: restorecon: guard against execl() errors f415323 block: replace local mkdir_p implementation Signed-off-by: Daniel Golle --- package/system/fstools/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/system/fstools/Makefile b/package/system/fstools/Makefile index 90644532b2..bd4825b9f9 100644 --- a/package/system/fstools/Makefile +++ b/package/system/fstools/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/fstools.git -PKG_MIRROR_HASH:=97cfe9528405d9a21c05fa1638780c27a66bfb6f21becfc3f4fdca1420711db8 -PKG_SOURCE_DATE:=2020-10-16 -PKG_SOURCE_VERSION:=f25ab8a8484215e5fc88c952f25db9a06de311f7 +PKG_MIRROR_HASH:=22670e033b5623348de37c1d1e69caf799752b38205be8b25bc7020ef9e69884 +PKG_SOURCE_DATE:=2020-12-12 +PKG_SOURCE_VERSION:=f415323b7c87d66ab11d89325937d5dae5eb65c9 CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 From 54239ccfe7b0e0077f60c7b8c069c9f0b866a86c Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sat, 12 Dec 2020 23:33:14 +0000 Subject: [PATCH 64/65] procd: update to git HEAD 111416d jail: remove unreachable code 7f12c89 treewide: replace local mkdir_p implementations Signed-off-by: Daniel Golle --- package/system/procd/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile index ed73587056..60936ba637 100644 --- a/package/system/procd/Makefile +++ b/package/system/procd/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/procd.git -PKG_SOURCE_DATE:=2020-12-04 -PKG_SOURCE_VERSION:=6acc48c7a2faac48c534b8a5516500c270550a9e -PKG_MIRROR_HASH:=ee1a238a54fff4c71a6e52f092394b94dbcc488581e6fd3a1bb6da515ce1cbaf +PKG_SOURCE_DATE:=2020-12-12 +PKG_SOURCE_VERSION:=7f12c89d0b99a2f04e91b2327e74c049f6362b67 +PKG_MIRROR_HASH:=b71134d96a54327baae532415df430ad91c757c7862c736447f03bd22e2d5ec5 CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 From b2d48c1dfe81911c563f0a745a2408b438db9bc4 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sun, 13 Dec 2020 00:12:37 +0000 Subject: [PATCH 65/65] odhcpd: remove local mkdir_p implementation Replace local mkdir_p implementation in favour of using mkdir_p now added to libubox. Signed-off-by: Daniel Golle --- package/network/services/odhcpd/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/network/services/odhcpd/Makefile b/package/network/services/odhcpd/Makefile index 9a4cd19bef..1ab68ec33b 100644 --- a/package/network/services/odhcpd/Makefile +++ b/package/network/services/odhcpd/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcpd.git -PKG_SOURCE_DATE:=2020-11-15 -PKG_SOURCE_VERSION:=fb55e80394c51d7502bb278f57520dec15a11355 -PKG_MIRROR_HASH:=631d15fd7c93529fa33433380c4811dbacca9665864e5836c6daca0c7165f25a +PKG_SOURCE_DATE:=2020-12-13 +PKG_SOURCE_VERSION:=2cf6232fd170a24b801d71d497947d7aabd12015 +PKG_MIRROR_HASH:=097a6b186bc85cc8ff95a611e23ab50a6d8025988f19e0d48520e12a1020274d PKG_MAINTAINER:=Hans Dedecker PKG_LICENSE:=GPL-2.0