Re: [OpenWrt-Devel] [PATCH] build: depend on host zip tool
Am Donnerstag, 11. Oktober 2018, 19:34:35 CEST schrieb Sven Roederer: > tools/firmware-utils/src/mksercommfw.c depends on the zip-tool to generate > the firmwareimage. Thinking of this again, I wonder if it would be the proper way to build the zip-tool as y host-command like we do for tar and xz? Sven ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] tools/xz: Add PKG_CPE_ID for proper CVE tracking
Signed-off-by: Rosen Penev --- tools/xz/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/xz/Makefile b/tools/xz/Makefile index d6b619db41..5d574892bb 100644 --- a/tools/xz/Makefile +++ b/tools/xz/Makefile @@ -13,6 +13,7 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=@SF/lzmautils \ http://tukaani.org/xz PKG_HASH:=3313fd2a95f43d88e44264e6b015e7d03053e681860b0d5d3f9baca79c57b7bf +PKG_CPE_ID:=cpe:/a:tukaani:xz HOST_BUILD_PARALLEL:=1 -- 2.19.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [RFC 0/9] Using the mainline mtk-eth-soc driver for MT7621
Bjørn Mork writes: > Bjørn Mork writes: >> John Crispin writes: >> >>> have you seen my staging tree ? >>> https://git.openwrt.org/?p=openwrt/staging/blogic.git;a=shortlog;h=refs/heads/mt7621_dsa >> >> No, I hadn't. Thanks for the pointer. Will look at it now > > > I've now tried to build this with the WAP6805, but I'm afraid I can't > get the second gmac to work. Probably something I did wrong with the > DTS... DSA and eth0 seems to work fine. > > This is your mt7621_dsa branc with my attempt to use it on the WAP6805 > on top: https://github.com/bmork/LEDE/tree/blogic-mt7621-mainline-eth FWIW, I experimented a bit by removing code I didn't understand. There was some hardcoded initialisation in mtk_hw_init() which didn't look very reassuring. And what do you know? Removing it made the second gmac work in my device. I've added the removal patch to the branch on github. And it's attached here as well. Comments appreciated. Bjørn >From a926747f15681b680e8e341dfbc7959af1878f71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= Date: Mon, 15 Oct 2018 19:01:11 +0200 Subject: [PATCH] mt7621: test mtk_hw_init() hunk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Bjørn Mork --- .../202-Adding-MT7621-DSA-support.patch| 36 -- target/linux/ramips/patches-4.14/205-mtk-eth.patch | 34 2 files changed, 70 deletions(-) diff --git a/target/linux/ramips/patches-4.14/202-Adding-MT7621-DSA-support.patch b/target/linux/ramips/patches-4.14/202-Adding-MT7621-DSA-support.patch index f1cfa07e7415..b01c03610970 100644 --- a/target/linux/ramips/patches-4.14/202-Adding-MT7621-DSA-support.patch +++ b/target/linux/ramips/patches-4.14/202-Adding-MT7621-DSA-support.patch @@ -198,42 +198,6 @@ Index: linux-4.14.61/drivers/net/ethernet/mediatek/mtk_eth_soc.c mtk_tx_irq_enable(eth, MTK_TX_DONE_INT); mtk_rx_irq_enable(eth, MTK_RX_DONE_INT); } -@@ -1953,6 +1989,27 @@ static int mtk_hw_init(struct mtk_eth *e - } - regmap_write(eth->ethsys, ETHSYS_SYSCFG0, val); - -+#ifdef CONFIG_SOC_MT7621 -+ -+#define SYSC_PAD_RGMII2_MDIO 0x58 -+#define SYSC_GPIO_MODE 0x60 -+#define SYSC_REG_CFG1 0x14 -+ printk("MT7621: GE2: Pininit\n"); -+ -+ /* reduce RGMII1 PAD driving strength */ -+ regmap_read(eth->ethsys, SYSC_PAD_RGMII2_MDIO, ); -+ // MDIO -+ val &= ~(3 << 4); -+ // RGMII2, 12mA -+ val &= ~(3 <<20); -+ val |= (2 << 20); -+ regmap_write(eth->ethsys, SYSC_PAD_RGMII2_MDIO, val); -+ -+ /* gpio mux - RGMII1=Normal mode, set GMAC1,2 RGMII mode */ -+ regmap_read(eth->ethsys, SYSC_GPIO_MODE, ); -+ val &= ~(BIT(14) | BIT(15) | 3 << 12 | 3 << 14); -+ regmap_write(eth->ethsys, SYSC_GPIO_MODE, val); -+#else - if (eth->pctl) { - /* Set GE2 driving and slew rate */ - regmap_write(eth->pctl, GPIO_DRV_SEL10, 0xa00); -@@ -1963,6 +2020,7 @@ static int mtk_hw_init(struct mtk_eth *e - /* set GE2 TUNE */ - regmap_write(eth->pctl, GPIO_BIAS_CTRL, 0x0); - } -+#endif - - /* Set linkdown as the default for each GMAC. Its own MCR would be set - * up with the more appropriate value when mtk_phy_link_adjust call is @@ -2548,13 +2606,15 @@ static int mtk_probe(struct platform_dev } } diff --git a/target/linux/ramips/patches-4.14/205-mtk-eth.patch b/target/linux/ramips/patches-4.14/205-mtk-eth.patch index 19072a5d8b28..dccc23c4e7be 100644 --- a/target/linux/ramips/patches-4.14/205-mtk-eth.patch +++ b/target/linux/ramips/patches-4.14/205-mtk-eth.patch @@ -37,40 +37,6 @@ Index: linux-4.14.61/drivers/net/ethernet/mediatek/mtk_eth_soc.c val &= ~SYSCFG0_GE_MODE(SYSCFG0_GE_MASK, eth->mac[i]->id); val |= SYSCFG0_GE_MODE(eth->mac[i]->ge_mode, eth->mac[i]->id); } -@@ -1998,17 +2002,26 @@ static int mtk_hw_init(struct mtk_eth *e - - /* reduce RGMII1 PAD driving strength */ - regmap_read(eth->ethsys, SYSC_PAD_RGMII2_MDIO, ); -- // MDIO -+ // MDIO driving 2mA - val &= ~(3 << 4); -- // RGMII2, 12mA -- val &= ~(3 <<20); -- val |= (2 << 20); -- regmap_write(eth->ethsys, SYSC_PAD_RGMII2_MDIO, val); - -- /* gpio mux - RGMII1=Normal mode, set GMAC1,2 RGMII mode */ -+ if (eth->mac[1]) { -+ // When 2nd MAC is enabled set pin strength. -+ // RGMII2, 12mA -+ val &= ~(3 <<20); -+ val |= (2 << 20); -+ regmap_write(eth->ethsys, SYSC_PAD_RGMII2_MDIO, val); -+ }; -+ -+ /* set GMAC1,2 RGMII mode */ - regmap_read(eth->ethsys, SYSC_GPIO_MODE, ); -- val &= ~(BIT(14) | BIT(15) | 3 << 12 | 3 << 14); -+ val &= ~(3<<12); // MDIO_MODE = MDIO -+ val &= ~(BIT(15) | BIT(14)); // RGMIIx GPIO MODE = RGMIIx -+ if (!eth->mac[1]) -+ val |= BIT(15); - regmap_write(eth->ethsys, SYSC_GPIO_MODE, val); -+ -+ - #else - if (eth->pctl) { - /* Set GE2 driving and slew rate */ @@ -2055,7 +2068,7 @@ static int mtk_hw_init(struct mtk_eth *e mtk_w32(eth, MTK_RX_DONE_INT, MTK_QDMA_INT_GRP2); mtk_w32(eth, 0x21021000, MTK_FE_INT_GRP); -- 2.11.0 ___ openwrt-devel mailing list
[OpenWrt-Devel] [PATCH][18.06] apm821xx: MBL: load kernel/dtb from SATA 0:1 first
From: Freddy Leitner This remedies an issue with the MBL Duo if both disks are inserted and contain OpenWrt. kernel and dtb would be loaded from SATA 1:1 while rootfs (/dev/sda2) would be mounted on SATA 0:1. Such a mix would obviously only work if both OpenWrt versions/ builds are identical, and especially fail after sysupgrade upgraded the system disk on SATA 0:1. The fallback to SATA 1:1 needs to be kept for MBL Single (only has SATA 1:1) and MBL Duo with one disk inserted on SATA 1:1. To speed up booting in those cases, the unneccesarily doubled "sata init" will only be called once. (In theory it could be omitted completely since the on-flash boot script already initializes SATA to load the on-disk boot script.) Tested on MBL Duo (all possible combination of disks) and MBL Single Signed-off-by: Freddy Leitner Acked-by: Christian Lamparter --- Commit in -master: 7aa5dc46ee79c095e53f2b8e19c640cee8a58e0f --- target/linux/apm821xx/image/mbl_boot.scr | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/linux/apm821xx/image/mbl_boot.scr b/target/linux/apm821xx/image/mbl_boot.scr index 955216983b..394659a5b5 100644 --- a/target/linux/apm821xx/image/mbl_boot.scr +++ b/target/linux/apm821xx/image/mbl_boot.scr @@ -1,6 +1,6 @@ setenv boot_args 'setenv bootargs root=/dev/sda2 rw rootfstype=squashfs,ext4' -setenv load_part1 'sata init; ext2load sata 1:1 ${kernel_addr_r} /boot/uImage; ext2load sata 1:1 ${fdt_addr_r} /boot/apollo3g.dtb' -setenv load_part2 'sata init; ext2load sata 0:1 ${kernel_addr_r} /boot/uImage; ext2load sata 0:1 ${fdt_addr_r} /boot/apollo3g.dtb' -setenv load_sata 'if run load_part1; then echo Loaded part 1; elif run load_part2; then echo Loaded part 2; fi' +setenv load_part1 'ext2load sata 0:1 ${kernel_addr_r} /boot/uImage; ext2load sata 0:1 ${fdt_addr_r} /boot/apollo3g.dtb' +setenv load_part2 'ext2load sata 1:1 ${kernel_addr_r} /boot/uImage; ext2load sata 1:1 ${fdt_addr_r} /boot/apollo3g.dtb' +setenv load_sata 'sata init; if run load_part1; then echo Loaded part 1; elif run load_part2; then echo Loaded part 2; fi' setenv boot_sata 'run load_sata; run boot_args addtty; bootm ${kernel_addr_r} - ${fdt_addr_r}' run boot_sata -- 2.19.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 3/5] apm821xx: force WNDR4700 console to 115200n8
With the upcoming 4.19 release, the serial console on the Netgear WNDR4700 would no longer work as it is never really set and always relied on the kernel's serial code not to change the baud rate. On the stock firmware, Netgear forced the console setting through a custom CONFIG_CMDLINE in their kernel to 115200. Normally, they should have done it in a different way and just passed the baudrate through a "console=..." kernel parameter via the bootargs in the "/chosen" dt node. But in their default u-boot bootcmd setting, they somehow forgot to add the "run addtty", so there's no easy way to pass the baudrate from u-boot to the kernel. So it has to be forced as otherwise it ends up as 9600 baud. Signed-off-by: Christian Lamparter --- target/linux/apm821xx/dts/netgear-wndr4700.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/apm821xx/dts/netgear-wndr4700.dts b/target/linux/apm821xx/dts/netgear-wndr4700.dts index 171b7e34d6..a8f73e8a04 100644 --- a/target/linux/apm821xx/dts/netgear-wndr4700.dts +++ b/target/linux/apm821xx/dts/netgear-wndr4700.dts @@ -26,7 +26,7 @@ }; chosen { - stdout-path = "/plb/opb/serial@ef600300"; + stdout-path = "/plb/opb/serial@ef600300:115200n8"; }; thermal-zones { -- 2.19.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 4/5] apm821xx: apm82181.dtsi overhaul
- order entries by mmio address where possible - switch to lower-case address values - comment on BSP u-boot behaviour in regards to what it edits and look for - annotate irq lines with the help of interrupt-names - remove deprecated "device_type" properties The pci and network device_type had to stay since they are required by the drivers and u-boot. the cpu and memory device_types will remain as well as they are still part of the DT Spec. Signed-off-by: Christian Lamparter --- target/linux/apm821xx/dts/apm82181.dtsi | 274 1 file changed, 139 insertions(+), 135 deletions(-) diff --git a/target/linux/apm821xx/dts/apm82181.dtsi b/target/linux/apm821xx/dts/apm82181.dtsi index 79596da672..951f3d5f08 100644 --- a/target/linux/apm821xx/dts/apm82181.dtsi +++ b/target/linux/apm821xx/dts/apm82181.dtsi @@ -32,7 +32,7 @@ compatible = "apm,bluestone"; aliases { - ethernet0 = + ethernet0 = /* needed for BSP u-boot */ }; cpus { @@ -61,7 +61,7 @@ }; UIC0: interrupt-controller0 { - compatible = "apm,uic-apm82181","ibm,uic"; + compatible = "apm,uic-apm82181", "ibm,uic"; interrupt-controller; cell-index = <0>; dcr-reg = <0x0c0 0x009>; @@ -71,28 +71,28 @@ }; UIC1: interrupt-controller1 { - compatible = "apm,uic-apm82181","ibm,uic"; + compatible = "apm,uic-apm82181", "ibm,uic"; interrupt-controller; cell-index = <1>; dcr-reg = <0x0d0 0x009>; #address-cells = <0>; #size-cells = <0>; #interrupt-cells = <2>; - interrupts = <0x1e IRQ_TYPE_LEVEL_HIGH - 0x1f IRQ_TYPE_LEVEL_HIGH>; /* cascade */ + interrupts = <0x1e IRQ_TYPE_LEVEL_HIGH>, +<0x1f IRQ_TYPE_LEVEL_HIGH>; /* cascade */ interrupt-parent = <>; }; UIC2: interrupt-controller2 { - compatible = "apm,uic-apm82181","ibm,uic"; + compatible = "apm,uic-apm82181", "ibm,uic"; interrupt-controller; cell-index = <2>; dcr-reg = <0x0e0 0x009>; #address-cells = <0>; #size-cells = <0>; #interrupt-cells = <2>; - interrupts = <0x0a IRQ_TYPE_LEVEL_HIGH - 0x0b IRQ_TYPE_LEVEL_HIGH>; /* cascade */ + interrupts = <0x0a IRQ_TYPE_LEVEL_HIGH>, +<0x0b IRQ_TYPE_LEVEL_HIGH>; /* cascade */ interrupt-parent = <>; }; @@ -104,8 +104,8 @@ #address-cells = <0>; #size-cells = <0>; #interrupt-cells = <2>; - interrupts = <0x10 IRQ_TYPE_LEVEL_HIGH - 0x11 IRQ_TYPE_LEVEL_HIGH>; /* cascade */ + interrupts = <0x10 IRQ_TYPE_LEVEL_HIGH>, +<0x11 IRQ_TYPE_LEVEL_HIGH>; /* cascade */ interrupt-parent = <>; }; @@ -156,7 +156,7 @@ compatible = "apm,plb-apm82181", "ibm,plb-460ex", "ibm,plb4"; #address-cells = <2>; #size-cells = <1>; - ranges; + ranges; /* Filled in by U-Boot */ clock-frequency = <0>; /* Filled in by U-Boot */ SDRAM0: sdram { @@ -172,16 +172,15 @@ }; - CRYPTO: crypto@18 { - compatible = "amcc,ppc460ex-crypto", "amcc,ppc4xx-crypto"; - reg = <4 0x0018 0x80400>; - interrupt-parent = <>; - interrupts = <0x1d IRQ_TYPE_LEVEL_HIGH>; + TRNG: trng@11 { + compatible = "amcc,ppc460ex-rng", "ppc4xx-rng", "amcc, ppc4xx-trng"; + reg = <4 0x0011 0x100>; + interrupt-parent = <>; + interrupts = <0x03 IRQ_TYPE_LEVEL_HIGH>; status = "disabled"; }; PKA: pka@114000 { - device_type = "pka"; compatible = "ppc4xx-pka", "amcc,ppc4xx-pka", "amcc, ppc4xx-pka"; reg = <4 0x00114000 0x4000>; interrupt-parent = <>; @@ -189,13 +188,12 @@ status = "disabled"; }; - TRNG: trng@11 { - device_type = "trng"; - compatible = "amcc,ppc460ex-rng", "ppc4xx-rng", "amcc, ppc4xx-trng"; - reg = <4 0x0011 0x100>; - interrupt-parent = <>; - interrupts = <0x03 IRQ_TYPE_LEVEL_HIGH>; - status = "disabled"; +
[OpenWrt-Devel] [PATCH 1/5] build: remove obsolete -rc kernel testing rewrites
The -rcX "testing" kernels are no longer hosted on cdn.kernel.org file servers directly in a "testing" directory. Therefore the logic that tested for "-rc" can be removed. Signed-off-by: Christian Lamparter --- include/kernel.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/kernel.mk b/include/kernel.mk index 77c5ecf600..62a8e99e2d 100644 --- a/include/kernel.mk +++ b/include/kernel.mk @@ -60,9 +60,8 @@ else LINUX_KERNEL:=$(KERNEL_BUILD_DIR)/vmlinux LINUX_SOURCE:=linux-$(LINUX_VERSION).tar.xz - TESTING:=$(if $(findstring -rc,$(LINUX_VERSION)),/testing,) ifeq ($(call qstrip,$(CONFIG_EXTERNAL_KERNEL_TREE))$(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI)),) - LINUX_SITE:=@KERNEL/linux/kernel/v$(word 1,$(subst ., ,$(KERNEL_BASE))).x$(TESTING) + LINUX_SITE:=@KERNEL/linux/kernel/v$(word 1,$(subst ., ,$(KERNEL_BASE))).x else LINUX_UNAME_VERSION:=$(strip $(shell cat $(LINUX_DIR)/include/config/kernel.release 2>/dev/null)) endif -- 2.19.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 5/5] apm821xx: add disk-activity triggers via DT.
The WNDR4700 and the MBL have a dedicated HDD activity LED. This patch adds the default led triggers to the DTS and removes the entries in 01_leds. Signed-off-by: Christian Lamparter --- target/linux/apm821xx/base-files/etc/board.d/01_leds | 5 - target/linux/apm821xx/dts/netgear-wndr4700.dts | 1 + target/linux/apm821xx/dts/wd-mybooklive.dts | 1 + 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/target/linux/apm821xx/base-files/etc/board.d/01_leds b/target/linux/apm821xx/base-files/etc/board.d/01_leds index 8ba57bdf06..632d22a470 100755 --- a/target/linux/apm821xx/base-files/etc/board.d/01_leds +++ b/target/linux/apm821xx/base-files/etc/board.d/01_leds @@ -23,12 +23,7 @@ meraki,mx60) ucidef_set_led_switch "lan4" "LAN4" "mx60:green:lan4" "switch0" "0x02" ;; -wd,mybooklive) - ucidef_set_led_ide "sata" "SATA" "mbl:blue:power" - ;; - netgear,wndr4700) - ucidef_set_led_ide "sata" "SATA" "wndr4700:green:hd" ucidef_set_led_switch "wan_green" "WAN (green)" "wndr4700:green:wan" "switch0" "0x20" ucidef_set_led_netdev "wan_yellow" "WAN (yellow)" "wndr4700:yellow:wan" "eth0.2" "tx rx" ucidef_set_led_usbport "usb3" "USB3" "wndr4700:blue:usb" "usb2-port1" "usb2-port2" "usb3-port1" "usb3-port2" diff --git a/target/linux/apm821xx/dts/netgear-wndr4700.dts b/target/linux/apm821xx/dts/netgear-wndr4700.dts index a8f73e8a04..6a8c9990e6 100644 --- a/target/linux/apm821xx/dts/netgear-wndr4700.dts +++ b/target/linux/apm821xx/dts/netgear-wndr4700.dts @@ -390,6 +390,7 @@ hd-green { label = "wndr4700:green:hd"; gpios = < 14 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "disk-activity"; }; hd-red { diff --git a/target/linux/apm821xx/dts/wd-mybooklive.dts b/target/linux/apm821xx/dts/wd-mybooklive.dts index 4c61987119..9412f38d4a 100644 --- a/target/linux/apm821xx/dts/wd-mybooklive.dts +++ b/target/linux/apm821xx/dts/wd-mybooklive.dts @@ -103,6 +103,7 @@ power-blue { label = "mbl:blue:power"; gpios = < 6 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "disk-activity"; }; }; -- 2.19.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 2/5] apm821xx: set uart compatible to ns16750
The APM821XX/PPC460EX datasheet mentions: "Register compatibility with 16750 register set" Signed-off-by: Christian Lamparter --- target/linux/apm821xx/dts/apm82181.dtsi | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/target/linux/apm821xx/dts/apm82181.dtsi b/target/linux/apm821xx/dts/apm82181.dtsi index be8ace9207..79596da672 100644 --- a/target/linux/apm821xx/dts/apm82181.dtsi +++ b/target/linux/apm821xx/dts/apm82181.dtsi @@ -306,24 +306,29 @@ }; UART0: serial@ef600300 { - device_type = "serial"; - compatible = "ns16550"; + /* +* AMCC's BSP u-boot scans for the "ns16550" +* compatible, without it, u-boot wouldn't +* set the "clock-frequency" which is required. +* +* However, the hardware documentation lists: +* "Register compatibility with 16750 register set" +*/ + compatible = "ns16750", "ns16550"; reg = <0xef600300 0x0008>; virtual-reg = <0xef600300>; clock-frequency = <0>; /* Filled in by U-Boot */ - current-speed = <0>; /* Filled in by U-Boot */ interrupt-parent = <>; interrupts = <0x01 IRQ_TYPE_LEVEL_HIGH>; status = "disabled"; }; UART1: serial@ef600400 { - device_type = "serial"; - compatible = "ns16550"; + /* same "ns16750" as with UART0 */ + compatible = "ns16750", "ns16550"; reg = <0xef600400 0x0008>; virtual-reg = <0xef600400>; clock-frequency = <0>; /* Filled in by U-Boot */ - current-speed = <0>; /* Filled in by U-Boot */ interrupt-parent = <>; interrupts = <0x01 IRQ_TYPE_LEVEL_HIGH>; status = "disabled"; -- 2.19.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 2/2] tools/xz: Add PKG_CPE_ID for proper CVE tracking
Signed-off-by: Rosen Penev --- tools/xz/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/xz/Makefile b/tools/xz/Makefile index d6b619db41..5de9eb5e28 100644 --- a/tools/xz/Makefile +++ b/tools/xz/Makefile @@ -13,6 +13,7 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=@SF/lzmautils \ http://tukaani.org/xz PKG_HASH:=3313fd2a95f43d88e44264e6b015e7d03053e681860b0d5d3f9baca79c57b7bf +cpe:/a:tukaani:xz HOST_BUILD_PARALLEL:=1 -- 2.19.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 1/2] tools/libressl: Add PKG_CPE_ID for proper CVE tracking
Signed-off-by: Rosen Penev --- tools/libressl/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/libressl/Makefile b/tools/libressl/Makefile index 1698971f4f..57cdacd961 100644 --- a/tools/libressl/Makefile +++ b/tools/libressl/Makefile @@ -12,6 +12,8 @@ PKG_VERSION:=2.8.1 PKG_HASH:=334bf7050f1db4087feebb30571ec13d9fa975bf05d6003ce3ab6d7d2452cf42 PKG_RELEASE:=1 +PKG_CPE_ID:=cpe:/a:openbsd:libressl + PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://mirror.ox.ac.uk/pub/OpenBSD/LibreSSL \ http://ftp.jaist.ac.jp/pub/OpenBSD/LibreSSL \ -- 2.19.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] patch: Add missing CVE
uscan reports a new CVE now that PKG_CPE_ID was added. Reordered patches by date. Signed-off-by: Rosen Penev --- tools/patch/Makefile | 2 +- tools/patch/patches/010-CVE-2018-6951.patch | 29 +++ ...00156.patch => 020-CVE-2018-1000156.patch} | 20 +++-- ...018-6952.patch => 030-CVE-2018-6952.patch} | 9 -- 4 files changed, 48 insertions(+), 12 deletions(-) create mode 100644 tools/patch/patches/010-CVE-2018-6951.patch rename tools/patch/patches/{010-CVE-2018-1000156.patch => 020-CVE-2018-1000156.patch} (89%) rename tools/patch/patches/{020-CVE-2018-6952.patch => 030-CVE-2018-6952.patch} (78%) diff --git a/tools/patch/Makefile b/tools/patch/Makefile index 0f4d7f0326..7323b5b2ab 100644 --- a/tools/patch/Makefile +++ b/tools/patch/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=patch PKG_VERSION:=2.7.6 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_CPE_ID:=cpe:/a:gnu:patch PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz diff --git a/tools/patch/patches/010-CVE-2018-6951.patch b/tools/patch/patches/010-CVE-2018-6951.patch new file mode 100644 index 00..5dbcb35e29 --- /dev/null +++ b/tools/patch/patches/010-CVE-2018-6951.patch @@ -0,0 +1,29 @@ +From 1f7853c05f9949d81da9be7a02b90cc64284d1f8 Mon Sep 17 00:00:00 2001 +From: Andreas Gruenbacher +Date: Mon, 12 Feb 2018 16:48:24 +0100 +Subject: [PATCH] Fix segfault with mangled rename patch + +http://savannah.gnu.org/bugs/?53132 +* src/pch.c (intuit_diff_type): Ensure that two filenames are specified +for renames and copies (fix the existing check). +--- + src/pch.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/pch.c b/src/pch.c +index ff9ed2c..bc6278c 100644 +--- a/src/pch.c b/src/pch.c +@@ -974,7 +974,8 @@ intuit_diff_type (bool need_header, mode_t *p_file_type) + if ((pch_rename () || pch_copy ()) + && ! inname + && ! ((i == OLD || i == NEW) && +-p_name[! reverse] && ++p_name[reverse] && p_name[! reverse] && ++name_is_valid (p_name[reverse]) && + name_is_valid (p_name[! reverse]))) + { + say ("Cannot %s file without two valid file names\n", pch_rename () ? "rename" : "copy"); +-- +2.19.1 + diff --git a/tools/patch/patches/010-CVE-2018-1000156.patch b/tools/patch/patches/020-CVE-2018-1000156.patch similarity index 89% rename from tools/patch/patches/010-CVE-2018-1000156.patch rename to tools/patch/patches/020-CVE-2018-1000156.patch index 7114f82e8f..83b6d84637 100644 --- a/tools/patch/patches/010-CVE-2018-1000156.patch +++ b/tools/patch/patches/020-CVE-2018-1000156.patch @@ -1,4 +1,4 @@ -From ee2904728eb4364a36d62d66f723d0b68749e5df Mon Sep 17 00:00:00 2001 +From b3a0ca3deed00334f9feece43f76776b6a168e47 Mon Sep 17 00:00:00 2001 From: Andreas Gruenbacher Date: Fri, 6 Apr 2018 12:14:49 +0200 Subject: [PATCH] Fix arbitrary command execution in ed-style patches @@ -10,12 +10,11 @@ instead of rejecting them and carrying on. * tests/ed-style: New test case. * tests/Makefile.am (TESTS): Add test case. --- - src/pch.c | 89 +++ - tests/Makefile.am | 1 + - tests/ed-style| 41 ++ - 3 files changed, 108 insertions(+), 23 deletions(-) - create mode 100644 tests/ed-style + src/pch.c | 89 +-- + 1 file changed, 66 insertions(+), 23 deletions(-) +diff --git a/src/pch.c b/src/pch.c +index bc6278c..4fd5a05 100644 --- a/src/pch.c +++ b/src/pch.c @@ -33,6 +33,7 @@ @@ -26,7 +25,7 @@ instead of rejecting them and carrying on. #define INITHUNKMAX 125 /* initial dynamic allocation size */ -@@ -2388,22 +2389,28 @@ do_ed_script (char const *inname, char c +@@ -2389,22 +2390,28 @@ do_ed_script (char const *inname, char const *outname, static char const editor_program[] = EDITOR_PROGRAM; file_offset beginning_of_this_line; @@ -69,7 +68,7 @@ instead of rejecting them and carrying on. for (;;) { char ed_command_letter; beginning_of_this_line = file_tell (pfp); -@@ -2414,14 +2421,14 @@ do_ed_script (char const *inname, char c +@@ -2415,14 +2422,14 @@ do_ed_script (char const *inname, char const *outname, } ed_command_letter = get_ed_command_letter (buf); if (ed_command_letter) { @@ -88,7 +87,7 @@ instead of rejecting them and carrying on. write_fatal (); if (chars_read == 2 && strEQ (buf, ".\n")) break; -@@ -2434,13 +2441,49 @@ do_ed_script (char const *inname, char c +@@ -2435,13 +2442,49 @@ do_ed_script (char const *inname, char const *outname, break; } } @@ -143,3 +142,6 @@ instead of rejecting them and carrying on. if (ofp) { +-- +2.19.1 + diff --git a/tools/patch/patches/020-CVE-2018-6952.patch b/tools/patch/patches/030-CVE-2018-6952.patch
Re: [OpenWrt-Devel] Compile juci on Ubuntu 18.04
I just followed "Usage on OpenWrt". OpenWrt Commit ID: 9b4650b3b92e6246b986ac9e3d7c2a80d66b805b Here is the commit to fix the regex stuff: > https://github.com/PolynomialDivision/openwrt/commit/c0d2080fa4253f34506360cddeb0c457683854b5 On 10/15/2018 04:58 PM, Koen Vandeputte wrote: > > > On 2018-10-15 16:20, Nick wrote: >> Hi, >> did someone manage to follow the Readme.md? >> I got several problems when compiling juci in Xubuntu 18.04. >> First where was a Regex mismatch. >> And then npm makes trouble. >> Now there is a new issue: >> >>> touch >>> /home/user/openwrt_juci/staging_dir/target-x86_64_musl-1.1.14/stamp/.juci_installed >>> >>> make[3]: Leaving directory '/home/user/openwrt_juci/feeds/juci/juci' >>> make[3]: Entering directory >>> '/home/user/openwrt_juci/feeds/juci/libblobpack' >>> Makefile:43: *** Download/default is missing the FILE field.. Stop. >> There is a similar issue on github >> (https://github.com/openwrt/packages/issues/5180). >> I don't know how to move on. Some ideas? >> >> Best, >> Nick >> >> >> > Hi, > > I'm seeing "musl-1.1.14" in the path above. > How old is this? > > Koen > > > ___ > openwrt-devel mailing list > openwrt-devel@lists.openwrt.org > https://lists.openwrt.org/mailman/listinfo/openwrt-devel ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] Compile juci on Ubuntu 18.04
On 2018-10-15 16:20, Nick wrote: Hi, did someone manage to follow the Readme.md? I got several problems when compiling juci in Xubuntu 18.04. First where was a Regex mismatch. And then npm makes trouble. Now there is a new issue: touch /home/user/openwrt_juci/staging_dir/target-x86_64_musl-1.1.14/stamp/.juci_installed make[3]: Leaving directory '/home/user/openwrt_juci/feeds/juci/juci' make[3]: Entering directory '/home/user/openwrt_juci/feeds/juci/libblobpack' Makefile:43: *** Download/default is missing the FILE field.. Stop. There is a similar issue on github (https://github.com/openwrt/packages/issues/5180). I don't know how to move on. Some ideas? Best, Nick Hi, I'm seeing "musl-1.1.14" in the path above. How old is this? Koen ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] Compile juci on Ubuntu 18.04
Hi, did someone manage to follow the Readme.md? I got several problems when compiling juci in Xubuntu 18.04. First where was a Regex mismatch. And then npm makes trouble. Now there is a new issue: > touch > /home/user/openwrt_juci/staging_dir/target-x86_64_musl-1.1.14/stamp/.juci_installed > make[3]: Leaving directory '/home/user/openwrt_juci/feeds/juci/juci' > make[3]: Entering directory > '/home/user/openwrt_juci/feeds/juci/libblobpack' > Makefile:43: *** Download/default is missing the FILE field.. Stop. There is a similar issue on github (https://github.com/openwrt/packages/issues/5180). I don't know how to move on. Some ideas? Best, Nick ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [RFC 0/9] Using the mainline mtk-eth-soc driver for MT7621
Bjørn Mork writes: > John Crispin writes: > >> have you seen my staging tree ? >> https://git.openwrt.org/?p=openwrt/staging/blogic.git;a=shortlog;h=refs/heads/mt7621_dsa > > No, I hadn't. Thanks for the pointer. Will look at it now I've now tried to build this with the WAP6805, but I'm afraid I can't get the second gmac to work. Probably something I did wrong with the DTS... DSA and eth0 seems to work fine. This is your mt7621_dsa branc with my attempt to use it on the WAP6805 on top: https://github.com/bmork/LEDE/tree/blogic-mt7621-mainline-eth Boot log, with failing attempt to use eth1: [0.00] Linux version 4.14.61 (bjorn@canardo) (gcc version 7.3.0 (OpenWrt GCC 7.3.0 r6690-cd7878e69dc9)) #0 SMP Mon Oct 15 11:57:33 2018 [0.00] SoC Type: MediaTek MT7621 ver:1 eco:3 [0.00] bootconsole [early0] enabled [0.00] CPU0 revision is: 0001992f (MIPS 1004Kc) [0.00] MIPS: machine is ZyXEL WAP6805 [0.00] Determined physical RAM map: [0.00] memory: 0400 @ (usable) [0.00] Initrd not found or empty - disabling initrd [0.00] VPE topology {2} total 2 [0.00] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes. [0.00] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes [0.00] MIPS secondary cache 256kB, 8-way, linesize 32 bytes. [0.00] Zone ranges: [0.00] Normal [mem 0x-0x03ff] [0.00] HighMem empty [0.00] Movable zone start for each node [0.00] Early memory node ranges [0.00] node 0: [mem 0x-0x03ff] [0.00] Initmem setup node 0 [mem 0x-0x03ff] [0.00] random: get_random_bytes called from start_kernel+0x90/0x4a4 with crng_init=0 [0.00] percpu: Embedded 14 pages/cpu @8109 s26192 r8192 d22960 u57344 [0.00] Built 1 zonelists, mobility grouping on. Total pages: 16256 [0.00] Kernel command line: console=ttyS0,57600 rootfstype=squashfs,jffs2 [0.00] PID hash table entries: 256 (order: -2, 1024 bytes) [0.00] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes) [0.00] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes) [0.00] Writing ErrCtl register=0001164a [0.00] Readback ErrCtl register=0001164a [0.00] Memory: 58324K/65536K available (4573K kernel code, 214K rwdata, 1084K rodata, 260K init, 284K bss, 7212K reserved, 0K cma-reserved, 0K highmem) [0.00] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=2, Nodes=1 [0.00] Hierarchical RCU implementation. [0.00] RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2. [0.00] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2 [0.00] NR_IRQS: 256 [0.00] clocksource: GIC: mask: 0x max_cycles: 0xcaf478abb4, max_idle_ns: 440795247997 ns [0.00] clocksource: MIPS: mask: 0x max_cycles: 0x, max_idle_ns: 4343773742 ns [0.09] sched_clock: 32 bits at 440MHz, resolution 2ns, wraps every 4880645118ns [0.015493] Calibrating delay loop... 586.13 BogoMIPS (lpj=2930688) [0.087794] pid_max: default: 32768 minimum: 301 [0.097092] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes) [0.110108] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes) [0.125717] Hierarchical SRCU implementation. [0.136751] smp: Bringing up secondary CPUs ... [0.149955] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes. [0.149963] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes [0.149974] MIPS secondary cache 256kB, 8-way, linesize 32 bytes. [0.150122] CPU1 revision is: 0001992f (MIPS 1004Kc) [0.205824] Synchronize counters for CPU 1: done. [0.265496] smp: Brought up 1 node, 2 CPUs [0.277227] clocksource: jiffies: mask: 0x max_cycles: 0x, max_idle_ns: 1911260446275 ns [0.296702] futex hash table entries: 512 (order: 2, 16384 bytes) [0.308929] pinctrl core: initialized pinctrl subsystem [0.320656] NET: Registered protocol family 16 [0.340951] pull PCIe RST: RALINK_RSTCTRL = 0 [0.649952] release PCIe RST: RALINK_RSTCTRL = 700 [0.660019] * Xtal 40MHz * [0.666746] release PCIe RST: RALINK_RSTCTRL = 700 [0.676955] Port 0 N_FTS = 1b102800 [0.683853] Port 1 N_FTS = 1b102800 [0.690781] Port 2 N_FTS = 1b102800 [1.849206] PCIE1 no card, disable it(RST) [1.857893] PCIE2 no card, disable it(RST) [1.866693] -> 21007f2 [1.871541] PCIE0 enabled [1.876726] PCI host bridge /pcie@1e14 ranges: [1.886249] MEM 0x6000..0x6fff [1.896613] IO 0x1e16..0x1e16 [1.906971] PCI coherence region base: 0xbfbf8000, mask/settings: 0x6000 [1.933546] mt7621_gpio 1e000600.gpio:
Re: [OpenWrt-Devel] [RFC 0/9] Using the mainline mtk-eth-soc driver for MT7621
John Crispin writes: > have you seen my staging tree ? > https://git.openwrt.org/?p=openwrt/staging/blogic.git;a=shortlog;h=refs/heads/mt7621_dsa No, I hadn't. Thanks for the pointer. Will look at it now I started out with Thirsty's work, but ended up redoing it all to try to keep changes as small and incremental as possible. But I did intend to credit him, as the original idea and concept is all Thirstys. Simply forgot. Sorry about that, Thirsty. > i dont see the clk stuff in this series. do you have a "add mt7621 > support to the driver" patch ? i am failing to see that, maybe i am > just blind... No, that's correct. I simply ignored the clk stuff after looking at how the driver used it (not at all). If you can get away with a simpler solution, then choose it ;-) Yes, I realize that this is probably simplifying a bit too much. The same goes for regulators, where I simply depend on the default dummy regulator instead of creating similar dummies. > sorry my patch is stuff needing annotation and a split up Then we're two... Including the boot log from the WAP6805 below to show the warnings etc caused by all my shortcuts. And if anyone wants to test this with a WAP6805 or WAP6806, then you also need to enable the RGMII connected Quantenna module: io -w -4 0x1e110008 0x9000c echo 1 > /sys/class/gpio/gpio16/value The gpio is probably enabling power to the slot, while the register write is still magic to me. I found it in the OEM firmware. The register appears to be somewhere in the ethernet FE block? The default value is 0xc000c. With that default I only see FCS errors, which leads me to wonder if this is somehow related to RGMII timing? Bjørn === MT7621 stage1 code Mar 12 2015 14:42:52 (ASIC) CPU=5000 HZ BUS=1250 HZ == Change MPLL source from XTAL to CR... do MEMPLL setting.. MEMPLL Config : 0x3100 3PLL mode + External loopback === XTAL-40Mhz === DDR-800Mhz === PLL3 FB_DL: 0x4, 1/0 = 612/412 1100 PLL4 FB_DL: 0xa, 1/0 = 549/475 2900 PLL2 FB_DL: 0xf, 1/0 = 536/488 3D00 do DDR setting..[00320381] Apply DDR2 Setting...(use default AC) 08 16 24 32 40 48 56 64 72 80 88 96 104 112 120 :|00000000000000 00 0001:|00000000000000 00 0002:|00000000000000 00 0003:|00000000000000 00 0004:|00000000000000 00 0005:|00000000000000 00 0006:|00000000000001 11 0007:|00000011111111 11 0008:|11111111111111 00 0009:|11111000000000 00 000A:|00000000000000 00 000B:|00000000000000 00 000C:|00000000000000 00 000D:|00000000000000 00 000E:|00000000000000 00 000F:|00000000000000 00 0010:|00000000000000 00 0011:|00000000000000 00 0012:|00000000000000 00 0013:|00000000000000 00 0014:|00000000000000 00 0015:|00000000000000 00 0016:|00000000000000 00 0017:|00000000000000 00 0018:|00000000000000 00 0019:|00000000000000 00 001A:|00000000000000 00 001B:|00000000000000 00 001C:|00000000000000
Re: [OpenWrt-Devel] [RFC 0/9] Using the mainline mtk-eth-soc driver for MT7621
On 15/10/2018 12:24, Bjørn Mork wrote: This is NOT READY for merge. ( This code can also be found in a github branch, in case you find that easier to review: https://github.com/bmork/LEDE/tree/mt7621-with-mainline-eth-driver ) Hoping for some early feedback in case what I am doing here is completely out of the question. Which it very well might be... The primary questions are: - Is it OK to rename the out-of-tree ramips ethernet directory to avoid conflict with the mainline mediatek ethernet drivers? - Is it OK to let the MT7621 use the mainline driver, while the rest of the ramips target still use the out-of-tree - If OK, is the method I use here fine, or is there some better way to create a split of this type? My final goal is supporting MT7621 devices where the second ethernet gmac is connected to something else than the internal switch. I have one such device, the ZyXEL WAP6805, with a Quantenna 5G module connected by RGMII to the MT7621. Patches for this device is included primarily as an example of how the per-device driver change is done. Using the mainline driver also means converting to DSA, similar to the mediatek target. So this also serves as an example of how that change can be done (The recent discussion about DSA configration was the trigger that made me submit this unfinished work now). Note that this is for new devices only. Support for migrating existing configs to DSA is not (yet) part of this work. The first two patches in the series can be safely ignored by anyone not specifically interested in the ZyXEL WAP6805. They only add basic support for this device. The 3rd patch renames the out-of-tree driver directory from "mediatek" to "ramips" to enable this driver to co-exist with the mainline driver. Patch 4 imports all OpenWRT patches from the mediatek target, on the assumption that the drivers for these two tagets should be kept in sync. Patch 5 has all the necessary magic to acually enable MT7621 support in the mainline driver. Please note how few these changes really are. Patch 6 works around an issue where the ethernet devices would lock up due to a sofirq busy loop. I'll admit that I don't full understand the issue, or why it should affect this driver and not the out-of-tree version. But I wonder of this is really the issue seen by a number of people reporting lockups and driver resets with MT7621? Patch 7 modifies the mt7621.dtsi to be compatible with the mainline driver, while keeping compatibility with the out-of-tree driver. Patch 8 adds the mainline driver configuration as a virtual package, enabling per-device switching from out-of-tree to mainline driver. Patch 9 shows how the changes necessary to switch the WAP6805 device to the mainline driver. This serves as documentation of the process. Most of the patch concerns adding DSA support to the DTS. have you seen my staging tree ? https://git.openwrt.org/?p=openwrt/staging/blogic.git;a=shortlog;h=refs/heads/mt7621_dsa i dont see the clk stuff in this series. do you have a "add mt7621 support to the driver" patch ? i am failing to see that, maybe i am just blind... sorry my patch is stuff needing annotation and a split up John Bjørn Mork (9): wap6805: add Mitrastar uImage tool wap6805: add board definition and DTS ramips: rename out-of-tree net driver to "ralink" mt7621: import mtk_eth_soc and mt7530 patches from the mediatek target mt7621: enable mainline driver mt7621: fix softirq loop mt7621: update dtsi mt7621 dsa: add virtual DSA kernel package wap6805: use mtk-eth-soc driver with DSA include/image-commands.mk | 10 + .../linux/ramips/base-files/etc/board.d/02_network | 3 + .../ramips/base-files/etc/board.d/03_gpio_switches | 3 + target/linux/ramips/base-files/lib/ramips.sh | 3 + .../ramips/base-files/lib/upgrade/platform.sh | 6 +- target/linux/ramips/dts/WAP6805.dts| 201 + target/linux/ramips/dts/mt7621.dtsi| 5 +- .../drivers/net/ethernet/mediatek/Kconfig | 70 -- .../drivers/net/ethernet/mediatek/Makefile | 22 - .../files-4.14/drivers/net/ethernet/ralink/Kconfig | 70 ++ .../drivers/net/ethernet/ralink/Makefile | 22 + .../net/ethernet/{mediatek => ralink}/esw_rt3050.c | 0 .../net/ethernet/{mediatek => ralink}/esw_rt3050.h | 2 +- .../net/ethernet/{mediatek => ralink}/ethtool.c| 0 .../net/ethernet/{mediatek => ralink}/ethtool.h| 0 .../net/ethernet/{mediatek => ralink}/gsw_mt7620.c | 0 .../net/ethernet/{mediatek => ralink}/gsw_mt7620.h | 0 .../net/ethernet/{mediatek => ralink}/gsw_mt7621.c | 0 .../net/ethernet/{mediatek => ralink}/mdio.c | 2 +- .../net/ethernet/{mediatek => ralink}/mdio.h | 2 +- .../ethernet/{mediatek => ralink}/mdio_mt7620.c| 0 .../ethernet/{mediatek => ralink}/mdio_rt2880.c| 0 .../ethernet/{mediatek =>
[OpenWrt-Devel] [RFC 4/9] mt7621: import mtk_eth_soc and mt7530 patches from the mediatek target
This syncronizes most of the mtk_eth_soc and mt7530 patches between the two targets, with the following exception: 0045-net-dsa-mediatek-turn-into-platform-driver.patch which will require more changes to the mt7621 device-trees than the absolute minimum. Signed-off-by: Bjørn Mork --- .../0027-net-next-mediatek-fix-DQL-support.patch | 92 +++ ...iatek-add-support-for-GMAC2-wired-to-ext-.patch | 26 ++ .../ramips/patches-4.14/0033-dsa-multi-cpu.patch | 268 + ...5-net-mediatek-disable-RX-VLan-offloading.patch | 47 ...diatek-honour-special-tag-bit-inside-RX-D.patch | 50 ...diatek-enable-special-tag-indication-for-.patch | 41 ...a-mediatek-tell-GDMA-when-we-are-turning-.patch | 43 .../0046-net-mediatek-add-irq-delay.patch | 21 ++ .../0051-net-mediatek-increase-tx_timeout.patch| 21 ++ .../ramips/patches-4.14/0062-mdio-atomic.patch | 14 ++ .../ramips/patches-4.14/0063-atomic-sleep.patch| 46 ...k-remove-superfluous-pin-setup-for-MT7622.patch | 102 12 files changed, 771 insertions(+) create mode 100644 target/linux/ramips/patches-4.14/0027-net-next-mediatek-fix-DQL-support.patch create mode 100644 target/linux/ramips/patches-4.14/0032-net-dsa-mediatek-add-support-for-GMAC2-wired-to-ext-.patch create mode 100644 target/linux/ramips/patches-4.14/0033-dsa-multi-cpu.patch create mode 100644 target/linux/ramips/patches-4.14/0035-net-mediatek-disable-RX-VLan-offloading.patch create mode 100644 target/linux/ramips/patches-4.14/0042-net-next-mediatek-honour-special-tag-bit-inside-RX-D.patch create mode 100644 target/linux/ramips/patches-4.14/0043-net-next-mediatek-enable-special-tag-indication-for-.patch create mode 100644 target/linux/ramips/patches-4.14/0044-net-next-dsa-mediatek-tell-GDMA-when-we-are-turning-.patch create mode 100644 target/linux/ramips/patches-4.14/0046-net-mediatek-add-irq-delay.patch create mode 100644 target/linux/ramips/patches-4.14/0051-net-mediatek-increase-tx_timeout.patch create mode 100644 target/linux/ramips/patches-4.14/0062-mdio-atomic.patch create mode 100644 target/linux/ramips/patches-4.14/0063-atomic-sleep.patch create mode 100644 target/linux/ramips/patches-4.14/0175-net-mediatek-remove-superfluous-pin-setup-for-MT7622.patch diff --git a/target/linux/ramips/patches-4.14/0027-net-next-mediatek-fix-DQL-support.patch b/target/linux/ramips/patches-4.14/0027-net-next-mediatek-fix-DQL-support.patch new file mode 100644 index ..3ea2f456a8ce --- /dev/null +++ b/target/linux/ramips/patches-4.14/0027-net-next-mediatek-fix-DQL-support.patch @@ -0,0 +1,92 @@ +From f974e397b806f7b16d11cc1542538616291924f1 Mon Sep 17 00:00:00 2001 +From: John Crispin +Date: Sat, 23 Apr 2016 11:57:21 +0200 +Subject: [PATCH 27/57] net-next: mediatek: fix DQL support + +The MTK ethernet core has 2 MACs both sitting on the same DMA ring. The +current code will assign the TX traffic of each MAC to its own DQL. This +results in the amount of data, that DQL says is in the queue incorrect. As +the data from multiple devices is infact enqueued. This makes any decision +based on these value non deterministic. Fix this by tracking all TX +traffic, regardless of the MAC it belongs to in the DQL of all devices +using the DMA. + +Signed-off-by: John Crispin +--- + drivers/net/ethernet/mediatek/mtk_eth_soc.c | 35 + + 1 file changed, 21 insertions(+), 14 deletions(-) + +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +@@ -779,7 +779,16 @@ static int mtk_tx_map(struct sk_buff *sk + WRITE_ONCE(itxd->txd3, (TX_DMA_SWC | TX_DMA_PLEN0(skb_headlen(skb)) | + (!nr_frags * TX_DMA_LS0))); + +- netdev_sent_queue(dev, skb->len); ++ /* we have a single DMA ring so BQL needs to be updated for all devices ++ * sitting on this ring ++ */ ++ for (i = 0; i < MTK_MAC_COUNT; i++) { ++ if (!eth->netdev[i]) ++ continue; ++ ++ netdev_sent_queue(eth->netdev[i], skb->len); ++ } ++ + skb_tx_timestamp(skb); + + ring->next_free = mtk_qdma_phys_to_virt(ring, txd->txd2); +@@ -1076,20 +1085,17 @@ static int mtk_poll_tx(struct mtk_eth *e + struct mtk_tx_dma *desc; + struct sk_buff *skb; + struct mtk_tx_buf *tx_buf; +- unsigned int done[MTK_MAX_DEVS]; +- unsigned int bytes[MTK_MAX_DEVS]; ++ int total = 0, done = 0; ++ unsigned int bytes = 0; + u32 cpu, dma; +- int total = 0, i; +- +- memset(done, 0, sizeof(done)); +- memset(bytes, 0, sizeof(bytes)); ++ int i; + + cpu = mtk_r32(eth, MTK_QTX_CRX_PTR); + dma = mtk_r32(eth, MTK_QTX_DRX_PTR); + + desc = mtk_qdma_phys_to_virt(ring, cpu); + +- while ((cpu != dma) && budget) { ++ while ((cpu != dma) && (done < budget)) { + u32 next_cpu = desc->txd2; +
[OpenWrt-Devel] [RFC 1/9] wap6805: add Mitrastar uImage tool
Signed-off-by: Bjørn Mork --- include/image-commands.mk | 10 + tools/firmware-utils/Makefile | 1 + tools/firmware-utils/src/mkmitrastar.c | 958 + 3 files changed, 969 insertions(+) create mode 100644 tools/firmware-utils/src/mkmitrastar.c diff --git a/include/image-commands.mk b/include/image-commands.mk index 05d36093d3ec..2537895587bc 100644 --- a/include/image-commands.mk +++ b/include/image-commands.mk @@ -316,6 +316,16 @@ define Build/tplink-v2-image rm -rf $@.new endef +define Build/mitrastar + mkmitrastar -A $(LINUX_KARCH) \ + -O linux -T kernel \ + -C $(1) -a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \ + -n '$(if $(UIMAGE_NAME),$(UIMAGE_NAME),$(call toupper,$(LINUX_KARCH)) $(VERSION_DIST) Linux-$(LINUX_VERSION))' \ + -c '$(if $(UIMAGE_NAME),$(UIMAGE_NAME),$(call toupper,$(LINUX_KARCH)) $(VERSION_DIST) Linux-$(LINUX_VERSION))' \ + -i $(MITRASTAR_MODEL_ID) -I $(MITRASTAR_CUST_ID) -d $@ $@.new + mv $@.new $@ +endef + json_quote=$(subst ','\'',$(subst ",\",$(1))) #")') metadata_devices=$(if $(1),$(subst "$(space)","$(comma)",$(strip $(foreach v,$(1),"$(call json_quote,$(v))" diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile index 00917c34178c..95bd951a0690 100644 --- a/tools/firmware-utils/Makefile +++ b/tools/firmware-utils/Makefile @@ -86,6 +86,7 @@ define Host/Compile $(call cc,mkdlinkfw mkdlinkfw-lib, -lz -Wall --std=gnu99) $(call cc,dns313-header, -Wall) $(call cc,mksercommfw, -Wall --std=gnu99) + $(call cc,mkmitrastar, -lz) endef define Host/Install diff --git a/tools/firmware-utils/src/mkmitrastar.c b/tools/firmware-utils/src/mkmitrastar.c new file mode 100644 index ..257334789380 --- /dev/null +++ b/tools/firmware-utils/src/mkmitrastar.c @@ -0,0 +1,958 @@ +/* + * (C) Copyright 2000-2004 + * DENX Software Engineering + * Wolfgang Denk, w...@denx.de + * All rights reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#include +#include +#include +#include +#include +#ifndef __WIN32__ +#include /* for host / network byte order conversions*/ +#endif +#include +#include +#include +#include +#include/*for crc32 */ + +#if defined(__BEOS__) || defined(__NetBSD__) || defined(__APPLE__) +#include +#endif + +#ifdef __WIN32__ +typedef unsigned int __u32; + +#define SWAP_LONG(x) \ + ((__u32)( \ + (((__u32)(x) & (__u32)0x00ffUL) << 24) | \ + (((__u32)(x) & (__u32)0xff00UL) << 8) | \ + (((__u32)(x) & (__u32)0x00ffUL) >> 8) | \ + (((__u32)(x) & (__u32)0xff00UL) >> 24) )) +typedefunsigned char uint8_t; +typedefunsigned short uint16_t; +typedefunsigned intuint32_t; + +#define ntohl(a) SWAP_LONG(a) +#define htonl(a) SWAP_LONG(a) +#endif /* __WIN32__ */ + +#ifndefO_BINARY/* should be define'd on __WIN32__ */ +#define O_BINARY 0 +#endif + +extern int errno; + +#ifndef MAP_FAILED +#define MAP_FAILED (-1) +#endif + +/* + * Operating System Codes + */ +#define IH_OS_INVALID 0 /* Invalid OS */ +#define IH_OS_OPENBSD 1 /* OpenBSD */ +#define IH_OS_NETBSD 2 /* NetBSD */ +#define IH_OS_FREEBSD 3 /* FreeBSD */ +#define IH_OS_4_4BSD 4 /* 4.4BSD */ +#define IH_OS_LINUX5 /* Linux*/ +#define IH_OS_SVR4 6 /* SVR4 */ +#define IH_OS_ESIX 7 /* Esix */ +#define IH_OS_SOLARIS 8 /* Solaris */ +#define IH_OS_IRIX 9 /* Irix */ +#define IH_OS_SCO 10 /* SCO */ +#define IH_OS_DELL 11 /* Dell */ +#define IH_OS_NCR 12 /* NCR */ +#define IH_OS_LYNXOS 13 /* LynxOS */ +#define IH_OS_VXWORKS 14 /* VxWorks */ +#define IH_OS_PSOS 15 /* pSOS */ +#define IH_OS_QNX 16 /* QNX */ +#define
[OpenWrt-Devel] [RFC 3/9] ramips: rename out-of-tree net driver to "ralink"
Signed-off-by: Bjørn Mork --- .../drivers/net/ethernet/mediatek/Kconfig | 70 -- .../drivers/net/ethernet/mediatek/Makefile | 22 --- .../files-4.14/drivers/net/ethernet/ralink/Kconfig | 70 ++ .../drivers/net/ethernet/ralink/Makefile | 22 +++ .../net/ethernet/{mediatek => ralink}/esw_rt3050.c | 0 .../net/ethernet/{mediatek => ralink}/esw_rt3050.h | 2 +- .../net/ethernet/{mediatek => ralink}/ethtool.c| 0 .../net/ethernet/{mediatek => ralink}/ethtool.h| 0 .../net/ethernet/{mediatek => ralink}/gsw_mt7620.c | 0 .../net/ethernet/{mediatek => ralink}/gsw_mt7620.h | 0 .../net/ethernet/{mediatek => ralink}/gsw_mt7621.c | 0 .../net/ethernet/{mediatek => ralink}/mdio.c | 2 +- .../net/ethernet/{mediatek => ralink}/mdio.h | 2 +- .../ethernet/{mediatek => ralink}/mdio_mt7620.c| 0 .../ethernet/{mediatek => ralink}/mdio_rt2880.c| 0 .../ethernet/{mediatek => ralink}/mdio_rt2880.h| 0 .../net/ethernet/{mediatek => ralink}/mt7530.c | 0 .../net/ethernet/{mediatek => ralink}/mt7530.h | 0 .../ethernet/{mediatek => ralink}/mtk_debugfs.c| 0 .../ethernet/{mediatek => ralink}/mtk_eth_soc.c| 12 ++-- .../ethernet/{mediatek => ralink}/mtk_eth_soc.h| 0 .../ethernet/{mediatek => ralink}/mtk_offload.c| 6 +- .../ethernet/{mediatek => ralink}/mtk_offload.h| 0 .../net/ethernet/{mediatek => ralink}/soc_mt7620.c | 0 .../net/ethernet/{mediatek => ralink}/soc_mt7621.c | 0 .../net/ethernet/{mediatek => ralink}/soc_rt2880.c | 0 .../net/ethernet/{mediatek => ralink}/soc_rt3050.c | 0 .../net/ethernet/{mediatek => ralink}/soc_rt3883.c | 0 target/linux/ramips/mt7620/config-4.14 | 14 ++--- target/linux/ramips/mt7621/config-4.14 | 12 ++-- target/linux/ramips/mt76x8/config-4.14 | 10 ++-- .../patches-4.14/700-add-net-ethernet-ralink.patch | 20 +++ target/linux/ramips/rt288x/config-4.14 | 10 ++-- target/linux/ramips/rt305x/config-4.14 | 8 +-- target/linux/ramips/rt3883/config-4.14 | 10 ++-- 35 files changed, 156 insertions(+), 136 deletions(-) delete mode 100644 target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/Kconfig delete mode 100644 target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/Makefile create mode 100644 target/linux/ramips/files-4.14/drivers/net/ethernet/ralink/Kconfig create mode 100644 target/linux/ramips/files-4.14/drivers/net/ethernet/ralink/Makefile rename target/linux/ramips/files-4.14/drivers/net/ethernet/{mediatek => ralink}/esw_rt3050.c (100%) rename target/linux/ramips/files-4.14/drivers/net/ethernet/{mediatek => ralink}/esw_rt3050.h (95%) rename target/linux/ramips/files-4.14/drivers/net/ethernet/{mediatek => ralink}/ethtool.c (100%) rename target/linux/ramips/files-4.14/drivers/net/ethernet/{mediatek => ralink}/ethtool.h (100%) rename target/linux/ramips/files-4.14/drivers/net/ethernet/{mediatek => ralink}/gsw_mt7620.c (100%) rename target/linux/ramips/files-4.14/drivers/net/ethernet/{mediatek => ralink}/gsw_mt7620.h (100%) rename target/linux/ramips/files-4.14/drivers/net/ethernet/{mediatek => ralink}/gsw_mt7621.c (100%) rename target/linux/ramips/files-4.14/drivers/net/ethernet/{mediatek => ralink}/mdio.c (98%) rename target/linux/ramips/files-4.14/drivers/net/ethernet/{mediatek => ralink}/mdio.h (96%) rename target/linux/ramips/files-4.14/drivers/net/ethernet/{mediatek => ralink}/mdio_mt7620.c (100%) rename target/linux/ramips/files-4.14/drivers/net/ethernet/{mediatek => ralink}/mdio_rt2880.c (100%) rename target/linux/ramips/files-4.14/drivers/net/ethernet/{mediatek => ralink}/mdio_rt2880.h (100%) rename target/linux/ramips/files-4.14/drivers/net/ethernet/{mediatek => ralink}/mt7530.c (100%) rename target/linux/ramips/files-4.14/drivers/net/ethernet/{mediatek => ralink}/mt7530.h (100%) rename target/linux/ramips/files-4.14/drivers/net/ethernet/{mediatek => ralink}/mtk_debugfs.c (100%) rename target/linux/ramips/files-4.14/drivers/net/ethernet/{mediatek => ralink}/mtk_eth_soc.c (99%) rename target/linux/ramips/files-4.14/drivers/net/ethernet/{mediatek => ralink}/mtk_eth_soc.h (100%) rename target/linux/ramips/files-4.14/drivers/net/ethernet/{mediatek => ralink}/mtk_offload.c (99%) rename target/linux/ramips/files-4.14/drivers/net/ethernet/{mediatek => ralink}/mtk_offload.h (100%) rename target/linux/ramips/files-4.14/drivers/net/ethernet/{mediatek => ralink}/soc_mt7620.c (100%) rename target/linux/ramips/files-4.14/drivers/net/ethernet/{mediatek => ralink}/soc_mt7621.c (100%) rename target/linux/ramips/files-4.14/drivers/net/ethernet/{mediatek => ralink}/soc_rt2880.c (100%) rename target/linux/ramips/files-4.14/drivers/net/ethernet/{mediatek => ralink}/soc_rt3050.c (100%) rename target/linux/ramips/files-4.14/drivers/net/ethernet/{mediatek => ralink}/soc_rt3883.c (100%) create mode
[OpenWrt-Devel] [RFC 0/9] Using the mainline mtk-eth-soc driver for MT7621
This is NOT READY for merge. ( This code can also be found in a github branch, in case you find that easier to review: https://github.com/bmork/LEDE/tree/mt7621-with-mainline-eth-driver ) Hoping for some early feedback in case what I am doing here is completely out of the question. Which it very well might be... The primary questions are: - Is it OK to rename the out-of-tree ramips ethernet directory to avoid conflict with the mainline mediatek ethernet drivers? - Is it OK to let the MT7621 use the mainline driver, while the rest of the ramips target still use the out-of-tree - If OK, is the method I use here fine, or is there some better way to create a split of this type? My final goal is supporting MT7621 devices where the second ethernet gmac is connected to something else than the internal switch. I have one such device, the ZyXEL WAP6805, with a Quantenna 5G module connected by RGMII to the MT7621. Patches for this device is included primarily as an example of how the per-device driver change is done. Using the mainline driver also means converting to DSA, similar to the mediatek target. So this also serves as an example of how that change can be done (The recent discussion about DSA configration was the trigger that made me submit this unfinished work now). Note that this is for new devices only. Support for migrating existing configs to DSA is not (yet) part of this work. The first two patches in the series can be safely ignored by anyone not specifically interested in the ZyXEL WAP6805. They only add basic support for this device. The 3rd patch renames the out-of-tree driver directory from "mediatek" to "ramips" to enable this driver to co-exist with the mainline driver. Patch 4 imports all OpenWRT patches from the mediatek target, on the assumption that the drivers for these two tagets should be kept in sync. Patch 5 has all the necessary magic to acually enable MT7621 support in the mainline driver. Please note how few these changes really are. Patch 6 works around an issue where the ethernet devices would lock up due to a sofirq busy loop. I'll admit that I don't full understand the issue, or why it should affect this driver and not the out-of-tree version. But I wonder of this is really the issue seen by a number of people reporting lockups and driver resets with MT7621? Patch 7 modifies the mt7621.dtsi to be compatible with the mainline driver, while keeping compatibility with the out-of-tree driver. Patch 8 adds the mainline driver configuration as a virtual package, enabling per-device switching from out-of-tree to mainline driver. Patch 9 shows how the changes necessary to switch the WAP6805 device to the mainline driver. This serves as documentation of the process. Most of the patch concerns adding DSA support to the DTS. Bjørn Mork (9): wap6805: add Mitrastar uImage tool wap6805: add board definition and DTS ramips: rename out-of-tree net driver to "ralink" mt7621: import mtk_eth_soc and mt7530 patches from the mediatek target mt7621: enable mainline driver mt7621: fix softirq loop mt7621: update dtsi mt7621 dsa: add virtual DSA kernel package wap6805: use mtk-eth-soc driver with DSA include/image-commands.mk | 10 + .../linux/ramips/base-files/etc/board.d/02_network | 3 + .../ramips/base-files/etc/board.d/03_gpio_switches | 3 + target/linux/ramips/base-files/lib/ramips.sh | 3 + .../ramips/base-files/lib/upgrade/platform.sh | 6 +- target/linux/ramips/dts/WAP6805.dts| 201 + target/linux/ramips/dts/mt7621.dtsi| 5 +- .../drivers/net/ethernet/mediatek/Kconfig | 70 -- .../drivers/net/ethernet/mediatek/Makefile | 22 - .../files-4.14/drivers/net/ethernet/ralink/Kconfig | 70 ++ .../drivers/net/ethernet/ralink/Makefile | 22 + .../net/ethernet/{mediatek => ralink}/esw_rt3050.c | 0 .../net/ethernet/{mediatek => ralink}/esw_rt3050.h | 2 +- .../net/ethernet/{mediatek => ralink}/ethtool.c| 0 .../net/ethernet/{mediatek => ralink}/ethtool.h| 0 .../net/ethernet/{mediatek => ralink}/gsw_mt7620.c | 0 .../net/ethernet/{mediatek => ralink}/gsw_mt7620.h | 0 .../net/ethernet/{mediatek => ralink}/gsw_mt7621.c | 0 .../net/ethernet/{mediatek => ralink}/mdio.c | 2 +- .../net/ethernet/{mediatek => ralink}/mdio.h | 2 +- .../ethernet/{mediatek => ralink}/mdio_mt7620.c| 0 .../ethernet/{mediatek => ralink}/mdio_rt2880.c| 0 .../ethernet/{mediatek => ralink}/mdio_rt2880.h| 0 .../net/ethernet/{mediatek => ralink}/mt7530.c | 0 .../net/ethernet/{mediatek => ralink}/mt7530.h | 0 .../ethernet/{mediatek => ralink}/mtk_debugfs.c| 0 .../ethernet/{mediatek => ralink}/mtk_eth_soc.c| 12 +- .../ethernet/{mediatek => ralink}/mtk_eth_soc.h| 0 .../ethernet/{mediatek => ralink}/mtk_offload.c| 6 +- .../ethernet/{mediatek => ralink}/mtk_offload.h
[OpenWrt-Devel] [RFC 2/9] wap6805: add board definition and DTS
Signed-off-by: Bjørn Mork --- .../linux/ramips/base-files/etc/board.d/02_network | 4 + .../ramips/base-files/etc/board.d/03_gpio_switches | 3 + target/linux/ramips/base-files/lib/ramips.sh | 3 + .../ramips/base-files/lib/upgrade/platform.sh | 6 +- target/linux/ramips/dts/WAP6805.dts| 142 + target/linux/ramips/image/mt7621.mk| 24 +++- 6 files changed, 179 insertions(+), 3 deletions(-) create mode 100644 target/linux/ramips/dts/WAP6805.dts diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network index 9e9ecbcb51df..f53bf02d221f 100755 --- a/target/linux/ramips/base-files/etc/board.d/02_network +++ b/target/linux/ramips/base-files/etc/board.d/02_network @@ -404,6 +404,10 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "0:lan:2" "1:lan:1" "4:wan" "6@eth0" ;; + wap6805) + ucidef_add_switch "switch0" \ + "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "6@eth0" + ;; *) RT3X5X=`cat /proc/cpuinfo | egrep "(RT3.5|RT5350)"` if [ -n "${RT3X5X}" ]; then diff --git a/target/linux/ramips/base-files/etc/board.d/03_gpio_switches b/target/linux/ramips/base-files/etc/board.d/03_gpio_switches index a847a64d6bb0..9753d5d69df8 100755 --- a/target/linux/ramips/base-files/etc/board.d/03_gpio_switches +++ b/target/linux/ramips/base-files/etc/board.d/03_gpio_switches @@ -17,6 +17,9 @@ ubnt-erx-sfp) ucidef_add_gpio_switch "poe_power_port3" "PoE Power Port3" "499" ucidef_add_gpio_switch "poe_power_port4" "PoE Power Port4" "500" ;; +wap6805) + ucidef_add_gpio_switch "qtn_power" "Quantenna Module Power" "16" + ;; esac board_config_flush diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh index 5741cbd2ee13..5afae99cd41e 100755 --- a/target/linux/ramips/base-files/lib/ramips.sh +++ b/target/linux/ramips/base-files/lib/ramips.sh @@ -718,6 +718,9 @@ ramips_board_detect() { *"ZyXEL Keenetic Viva") name="kng_rc" ;; + *"ZyXEL WAP6805") + name="wap6805" + ;; *"YK1") name="youku-yk1" ;; diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh index 7558b4e3168a..238290c7ea37 100755 --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh @@ -304,7 +304,8 @@ platform_check_image() { mir3g|\ r6220|\ ubnt-erx|\ - ubnt-erx-sfp) + ubnt-erx-sfp|\ + wap6805) nand_do_platform_check "$board" "$1" return $?; ;; @@ -361,7 +362,8 @@ platform_do_upgrade() { mir3g|\ r6220|\ ubnt-erx|\ - ubnt-erx-sfp) + ubnt-erx-sfp|\ + wap6805) nand_do_upgrade "$ARGV" ;; *) diff --git a/target/linux/ramips/dts/WAP6805.dts b/target/linux/ramips/dts/WAP6805.dts new file mode 100644 index ..53ef7301d13b --- /dev/null +++ b/target/linux/ramips/dts/WAP6805.dts @@ -0,0 +1,142 @@ +/dts-v1/; + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "zyxel,wap6805", "mediatek,mt7621-soc"; + model = "ZyXEL WAP6805"; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x400>; + }; + + chosen { + bootargs = "console=ttyS0,57600"; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + + wps { +label = "wps"; +gpios = < 8 GPIO_ACTIVE_LOW>; +linux,code = ; +}; + + reset { + label = "reset"; + gpios = < 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + +aliases { +led-status = _system; +}; + + gpio-leds { + compatible = "gpio-leds"; + + system_red { + label = "wap6805:red:system"; + gpios = < 4 GPIO_ACTIVE_HIGH>; + }; + + led_system: system_green { + label = "wap6805:green:system"; + gpios = < 13 GPIO_ACTIVE_HIGH>; + }; + }; +}; + + { + status = "okay"; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { +
[OpenWrt-Devel] [RFC 5/9] mt7621: enable mainline driver
Signed-off-by: Bjørn Mork --- target/linux/ramips/mt7621/config-4.14 | 1 + .../ramips/patches-4.14/2200-mt7621-eth-dsa.patch | 121 + 2 files changed, 122 insertions(+) create mode 100644 target/linux/ramips/patches-4.14/2200-mt7621-eth-dsa.patch diff --git a/target/linux/ramips/mt7621/config-4.14 b/target/linux/ramips/mt7621/config-4.14 index 07e0ec5038c5..cf05b22bf930 100644 --- a/target/linux/ramips/mt7621/config-4.14 +++ b/target/linux/ramips/mt7621/config-4.14 @@ -191,6 +191,7 @@ CONFIG_NET_RALINK_MDIO=y CONFIG_NET_RALINK_MDIO_MT7620=y CONFIG_NET_RALINK_MT7621=y CONFIG_NET_RALINK_SOC=y +# CONFIG_NET_VENDOR_MEDIATEK is not set CONFIG_NET_VENDOR_RALINK=y CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y # CONFIG_NO_IOPORT_MAP is not set diff --git a/target/linux/ramips/patches-4.14/2200-mt7621-eth-dsa.patch b/target/linux/ramips/patches-4.14/2200-mt7621-eth-dsa.patch new file mode 100644 index ..51a610264e82 --- /dev/null +++ b/target/linux/ramips/patches-4.14/2200-mt7621-eth-dsa.patch @@ -0,0 +1,121 @@ +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +@@ -1792,6 +1792,19 @@ static irqreturn_t mtk_handle_irq_tx(int + return IRQ_HANDLED; + } + ++static irqreturn_t mtk_handle_irq(int irq, void *_eth) ++{ ++ struct mtk_eth *eth = _eth; ++ ++ if (mtk_r32(eth, MTK_PDMA_INT_STATUS) & MTK_RX_DONE_INT) ++ mtk_handle_irq_rx(irq, _eth); ++ ++ if (mtk_r32(eth, MTK_QMTK_INT_STATUS) & MTK_TX_DONE_INT) ++ mtk_handle_irq_tx(irq, _eth); ++ ++ return IRQ_HANDLED; ++} ++ + #ifdef CONFIG_NET_POLL_CONTROLLER + static void mtk_poll_controller(struct net_device *dev) + { +@@ -2579,8 +2592,12 @@ static int mtk_probe(struct platform_dev + } + } + +- for (i = 0; i < 3; i++) { +- eth->irq[i] = platform_get_irq(pdev, i); ++ for (i = 0; i < 3; i++) ++ { ++ if (MTK_HAS_CAPS(eth->soc->caps, MTK_SHARED_INT) && i > 0) ++ eth->irq[i] = eth->irq[0]; ++ else ++ eth->irq[i] = platform_get_irq(pdev, i); + if (eth->irq[i] < 0) { + dev_err(>dev, "no IRQ%d resource found\n", i); + return -ENXIO; +@@ -2627,13 +2644,18 @@ static int mtk_probe(struct platform_dev + goto err_deinit_hw; + } + +- err = devm_request_irq(eth->dev, eth->irq[1], mtk_handle_irq_tx, 0, +- dev_name(eth->dev), eth); +- if (err) +- goto err_free_dev; ++ if (MTK_HAS_CAPS(eth->soc->caps, MTK_SHARED_INT)) { ++ err = devm_request_irq(eth->dev, eth->irq[0], mtk_handle_irq, 0, ++ dev_name(eth->dev), eth); ++ } else { ++ err = devm_request_irq(eth->dev, eth->irq[1], mtk_handle_irq_tx, 0, ++ dev_name(eth->dev), eth); ++ if (err) ++ goto err_free_dev; + +- err = devm_request_irq(eth->dev, eth->irq[2], mtk_handle_irq_rx, 0, +- dev_name(eth->dev), eth); ++ err = devm_request_irq(eth->dev, eth->irq[2], mtk_handle_irq_rx, 0, ++ dev_name(eth->dev), eth); ++ } + if (err) + goto err_free_dev; + +@@ -2706,6 +2728,12 @@ static const struct mtk_soc_data mt2701_ + .required_pctl = true, + }; + ++static const struct mtk_soc_data mt7621_data = { ++ .caps = MTK_SHARED_INT, ++ .required_clks = MT7621_CLKS_BITMAP, ++ .required_pctl = false, ++}; ++ + static const struct mtk_soc_data mt7622_data = { + .caps = MTK_DUAL_GMAC_SHARED_SGMII | MTK_GMAC1_ESW, + .required_clks = MT7622_CLKS_BITMAP, +@@ -2720,6 +2748,7 @@ static const struct mtk_soc_data mt7623_ + + const struct of_device_id of_mtk_match[] = { + { .compatible = "mediatek,mt2701-eth", .data = _data}, ++ { .compatible = "mediatek,mt7621-eth", .data = _data}, + { .compatible = "mediatek,mt7622-eth", .data = _data}, + { .compatible = "mediatek,mt7623-eth", .data = _data}, + {}, +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h b/drivers/net/ethernet/mediatek/mtk_eth_soc.h +@@ -364,6 +364,7 @@ + #define ETHSYS_CHIPID4_7 0x4 + #define MT7623_ETH7623 + #define MT7622_ETH7622 ++#define MT7621_ETH7621 + + /* ethernet subsystem config register */ + #define ETHSYS_SYSCFG00x14 +@@ -489,6 +490,8 @@ enum mtk_clks_map { +BIT(MTK_CLK_SGMII_CDR_FB) | \ +BIT(MTK_CLK_SGMII_CK) | \ +BIT(MTK_CLK_ETH2PLL)) ++#define MT7621_CLKS_BITMAP(0) ++ + enum mtk_dev_state { + MTK_HW_INIT, + MTK_RESETTING +@@ -567,6 +570,8 @@ struct mtk_rx_ring { + #define MTK_GMAC2_SGMII
[OpenWrt-Devel] [RFC 9/9] wap6805: use mtk-eth-soc driver with DSA
Signed-off-by: Bjørn Mork --- .../linux/ramips/base-files/etc/board.d/02_network | 3 +- target/linux/ramips/dts/WAP6805.dts| 61 +- target/linux/ramips/image/mt7621.mk| 1 + 3 files changed, 62 insertions(+), 3 deletions(-) diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network index f53bf02d221f..5b0dffbc0be2 100755 --- a/target/linux/ramips/base-files/etc/board.d/02_network +++ b/target/linux/ramips/base-files/etc/board.d/02_network @@ -405,8 +405,7 @@ ramips_setup_interfaces() "0:lan:2" "1:lan:1" "4:wan" "6@eth0" ;; wap6805) - ucidef_add_switch "switch0" \ - "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "6@eth0" + ucidef_set_interface_lan "lan0 lan1 lan2 lan3" ;; *) RT3X5X=`cat /proc/cpuinfo | egrep "(RT3.5|RT5350)"` diff --git a/target/linux/ramips/dts/WAP6805.dts b/target/linux/ramips/dts/WAP6805.dts index 53ef7301d13b..95fd3ecbebda 100644 --- a/target/linux/ramips/dts/WAP6805.dts +++ b/target/linux/ramips/dts/WAP6805.dts @@ -125,7 +125,66 @@ }; { - mtd-mac-address = < 0xe000>; + gmac0: mac@0 { + compatible = "mediatek,eth-mac"; + reg = <0>; + phy-mode = "rgmii"; + mtd-mac-address = < 0xe000>; + fixed-link { + speed = <1000>; + full-duplex; + pause; + }; + }; + gmac1: mac@1 { + compatible = "mediatek,eth-mac"; + reg = <1>; + mtd-mac-address = < 0xe000>; + mtd-mac-address-increment = <1>; + phy-mode = "rgmii"; + fixed-link { + speed = <1000>; + full-duplex; + pause; + }; + }; +}; + + { + compatible = "mediatek,mt7530"; + #address-cells = <1>; + #size-cells = <0>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + label = "lan0"; + cpu = <_port0>; + }; + port@1 { + reg = <1>; + label = "lan1"; + cpu = <_port0>; + }; + port@2 { + reg = <2>; + label = "lan2"; + cpu = <_port0>; + }; + port@3 { + reg = <3>; + label = "lan3"; + cpu = <_port0>; + }; + cpu_port0: port@6 { + reg = <6>; + label = "cpu"; + ethernet = <>; + }; + }; }; { diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index cc37c53bad28..b2f07b5e2e68 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -539,6 +539,7 @@ define Device/wap6805 IMAGE_SIZE := $(ralink_default_fw_size_32M) DEVICE_TITLE := ZyXEL WAP6805 DEVICE_PACKAGES := \ + kmod-mtk-eth-soc \ kmod-mt7603 kmod-mt76x2 \ kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini \ -swconfig -- 2.11.0 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [RFC 6/9] mt7621: fix softirq loop
Signed-off-by: Bjørn Mork --- .../2201-mt7621-eth-fix-napi-int.patch | 22 ++ 1 file changed, 22 insertions(+) create mode 100644 target/linux/ramips/patches-4.14/2201-mt7621-eth-fix-napi-int.patch diff --git a/target/linux/ramips/patches-4.14/2201-mt7621-eth-fix-napi-int.patch b/target/linux/ramips/patches-4.14/2201-mt7621-eth-fix-napi-int.patch new file mode 100644 index ..d52ff56643cb --- /dev/null +++ b/target/linux/ramips/patches-4.14/2201-mt7621-eth-fix-napi-int.patch @@ -0,0 +1,22 @@ +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +@@ -1775,8 +1775,8 @@ static irqreturn_t mtk_handle_irq_rx(int + + if (likely(napi_schedule_prep(>rx_napi))) { + __napi_schedule(>rx_napi); +- mtk_rx_irq_disable(eth, MTK_RX_DONE_INT); + } ++ mtk_rx_irq_disable(eth, MTK_RX_DONE_INT); + + return IRQ_HANDLED; + } +@@ -1787,8 +1787,8 @@ static irqreturn_t mtk_handle_irq_tx(int + + if (likely(napi_schedule_prep(>tx_napi))) { + __napi_schedule(>tx_napi); +- mtk_tx_irq_disable(eth, MTK_TX_DONE_INT); + } ++ mtk_tx_irq_disable(eth, MTK_TX_DONE_INT); + + return IRQ_HANDLED; + } -- 2.11.0 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [RFC 7/9] mt7621: update dtsi
Signed-off-by: Bjørn Mork --- target/linux/ramips/dts/mt7621.dtsi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target/linux/ramips/dts/mt7621.dtsi b/target/linux/ramips/dts/mt7621.dtsi index aa85aee6cb38..8b65f6149826 100644 --- a/target/linux/ramips/dts/mt7621.dtsi +++ b/target/linux/ramips/dts/mt7621.dtsi @@ -60,7 +60,7 @@ #size-cells = <1>; sysc: sysc@0 { - compatible = "mtk,mt7621-sysc"; + compatible = "mtk,mt7621-sysc", "syscon"; reg = <0x0 0x100>; }; @@ -408,7 +408,7 @@ }; ethernet: ethernet@1e10 { - compatible = "mediatek,mt7621-eth"; + compatible = "mediatek,mt7621-eth", "syscon"; reg = <0x1e10 0x1>; #address-cells = <1>; @@ -421,6 +421,7 @@ interrupts = ; mediatek,switch = <>; + mediatek,ethsys = <>; mdio-bus { #address-cells = <1>; -- 2.11.0 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [RFC 8/9] mt7621 dsa: add virtual DSA kernel package
Signed-off-by: Bjørn Mork --- target/linux/ramips/modules.mk | 26 ++ 1 file changed, 26 insertions(+) diff --git a/target/linux/ramips/modules.mk b/target/linux/ramips/modules.mk index 88e83a487f6f..5c3b09721934 100644 --- a/target/linux/ramips/modules.mk +++ b/target/linux/ramips/modules.mk @@ -136,3 +136,29 @@ define KernelPackage/sound-mt7620/description endef $(eval $(call KernelPackage,sound-mt7620)) + +define KernelPackage/mtk-eth-soc + TITLE:=Use mainline MediaTek ethernet driver with DSA + DEPENDS:=@TARGET_ramips @TARGET_ramips_mt7621 + HIDDEN:=1 + KCONFIG:= \ + NET_VENDOR_RALINK=n \ + CONFIG_NET_RALINK_SOC=n \ + CONFIG_NET_RALINK_GSW_MT7621=n \ + CONFIG_NET_RALINK_MDIO=n \ + CONFIG_NET_RALINK_MDIO_MT7620=n \ + CONFIG_NET_RALINK_MT7621=n \ + CONFIG_NET_VENDOR_MEDIATEK=y \ + CONFIG_NET_MEDIATEK_SOC=y \ + CONFIG_NET_DSA=y \ + CONFIG_NET_DSA_MT7530=y \ + CONFIG_NET_DSA_TAG_MTK=y \ + CONFIG_BRIDGE_VLAN_FILTERING=y \ + CONFIG_MDIO_BUS=y \ + CONFIG_MDIO_DEVICE=y \ + CONFIG_MDIO_I2C=y \ + CONFIG_MFD_SYSCON=y \ + CONFIG_REGMAP_MMIO=y +endef + +$(eval $(call KernelPackage,mtk-eth-soc)) -- 2.11.0 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel