From a44eff6ad31a82f32ed8fa22c404787635ad623e Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Mon, 13 Jul 2020 22:36:47 +0200 Subject: [PATCH 01/28] glibc: fix avx2 strncmp offset compare condition check [BZ #25933] 4e8a33a959 NEWS: Mention BZ 25933 fix fd15ba932d Fix avx2 strncmp offset compare condition check [BZ #25933 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 f0b95d3cc7..e3f2ea60cf 100644 --- a/toolchain/glibc/common.mk +++ b/toolchain/glibc/common.mk @@ -11,8 +11,8 @@ PKG_VERSION:=2.31 PKG_SOURCE_PROTO:=git PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE_VERSION:=3a44844c97a8ca1d0798c45b5252e6a49f9cf8e1 -PKG_MIRROR_HASH:=d7206510e494b3c723173d8ec0dd2e41314da59075871c5642324688001b3f6e +PKG_SOURCE_VERSION:=4e8a33a9590edc5c3a2cc5e726a3f2a73b66cdc0 +PKG_MIRROR_HASH:=41f678661dd1ee644dfae9734e27b47877ed7dee87c27eaddd9055394d36fe6a PKG_SOURCE_URL:=https://sourceware.org/git/glibc.git PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz From 96761ecc2f998e0ae082719ed27adbecd12e520f Mon Sep 17 00:00:00 2001 From: Mathieu Martin-Borret Date: Fri, 10 Jul 2020 13:40:58 +1000 Subject: [PATCH 02/28] kernel: mtdsplit_uimage: add SGE parser Adding SGE parser for SGE (T&W) Shenzhen Gongjin Electronics to add 96 bytes padding the the firmware image Signed-off-by: Mathieu Martin-Borret --- .../drivers/mtd/mtdsplit/mtdsplit_uimage.c | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_uimage.c b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_uimage.c index 525ad8218b..7a9ec8acde 100644 --- a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_uimage.c +++ b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_uimage.c @@ -407,6 +407,43 @@ static struct mtd_part_parser uimage_fonfxc_parser = { .parse_fn = mtdsplit_uimage_parse_fonfxc, }; +/************************************************** + * SGE (T&W) Shenzhen Gongjin Electronics + **************************************************/ + +#define SGE_PAD_LEN 96 + +static ssize_t uimage_find_sge(u_char *buf, size_t len, int *extralen) +{ + if (uimage_verify_default(buf, len, extralen) < 0) + return -EINVAL; + + *extralen = SGE_PAD_LEN; + + return 0; +} + +static int +mtdsplit_uimage_parse_sge(struct mtd_info *master, + const struct mtd_partition **pparts, + struct mtd_part_parser_data *data) +{ + return __mtdsplit_parse_uimage(master, pparts, data, + uimage_find_sge); +} + +static const struct of_device_id mtdsplit_uimage_sge_of_match_table[] = { + { .compatible = "sge,uimage" }, + {}, +}; + +static struct mtd_part_parser uimage_sge_parser = { + .owner = THIS_MODULE, + .name = "sge-fw", + .of_match_table = mtdsplit_uimage_sge_of_match_table, + .parse_fn = mtdsplit_uimage_parse_sge, +}; + /************************************************** * OKLI (OpenWrt Kernel Loader Image) **************************************************/ @@ -470,6 +507,7 @@ static int __init mtdsplit_uimage_init(void) register_mtd_parser(&uimage_netgear_parser); register_mtd_parser(&uimage_edimax_parser); register_mtd_parser(&uimage_fonfxc_parser); + register_mtd_parser(&uimage_sge_parser); register_mtd_parser(&uimage_okli_parser); return 0; From d7233b0a6a9b8cb9207a74a8cb3d0525170cf504 Mon Sep 17 00:00:00 2001 From: Mathieu Martin-Borret Date: Fri, 10 Jul 2020 13:49:20 +1000 Subject: [PATCH 03/28] ramips: add support for D-Link DIR-878 A1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Specifications: SoC: MT7621AT RAM: 128MB Flash: 16MB NOR SPI flash WiFi: MT7615N (2.4GHz) and MT7615N (5Ghz) LAN: 5x1000M Firmware layout is Uboot with extra 96 bytes in header Base PCB is AP-MTKH7-0002 LEDs Power Green,Power Orange,Internet Green,Internet Orange LEDs "2.4G" Green & "5G" Green connected directly to wifi module Buttons Reset,WPS,WIFI Flashing instructions: Upload image via emergency recovery mode Push and hold reset button (on the back of the device) until power led starts flashing (about 10 secs or so) while powering the device on. Give it ~30 seconds, to boot the recovery mode GUI Connect your client computer to LAN1 of the device Set your client IP address manually to 192.168.0.2 / 255.255.255.0. Call the recovery page for the device at http://192.168.0.1 Use the provided emergency web GUI to upload and flash a new firmware to the device. Some browsers/OS combinations are known not to work, so if you don't see the percentage complete displayed and moving within a few seconds, restart the procedure from scratch and try anoher one, or try the command line way. Alternative method using command line on Linux: curl -v -i -F "firmware=@openwrt-xxxx-squashfs-factory.bin" 192.168.0.1 Signed-off-by: Mathieu Martin-Borret [use of generic uimage-padhdr in image generation code] Signed-off-by: Petr Štetiar --- .../ramips/dts/mt7621_dlink_dir-878-a1.dts | 181 ++++++++++++++++++ target/linux/ramips/image/mt7621.mk | 15 ++ .../mt7621/base-files/etc/board.d/01_leds | 3 +- 3 files changed, 198 insertions(+), 1 deletion(-) create mode 100644 target/linux/ramips/dts/mt7621_dlink_dir-878-a1.dts diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-878-a1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-878-a1.dts new file mode 100644 index 0000000000..15c46cb5f7 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_dlink_dir-878-a1.dts @@ -0,0 +1,181 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "dlink,dir-878-a1", "mediatek,mt7621-soc"; + model = "D-Link DIR-878 A1"; + + aliases { + led-boot = &led_power_orange; + led-failsafe = &led_power_green; + led-running = &led_power_green; + led-upgrade = &led_net_orange; + label-mac-device = &gmac0; + }; + + chosen { + bootargs = "console=ttyS0,57600"; + }; + + leds { + compatible = "gpio-leds"; + + led_power_orange: power_orange { + label = "dir-878-a1:orange:power"; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + }; + + led_power_green: power_green { + label = "dir-878-a1:green:power"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + + led_net_orange: net_orange { + label = "dir-878-a1:orange:net"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + + net_green { + label = "dir-878-a1:green:net"; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wifi { + label = "wifi"; + gpios = <&gpio 7 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x20000>; + read-only; + }; + + partition@60000 { + compatible = "sge,uimage"; + label = "firmware"; + reg = <0x60000 0xfa0000>; + }; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0000>; + ieee80211-freq-limit = <2400000 2500000>; + + led { + led-active-low; + }; + }; +}; + +&pcie1 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + + led { + led-active-low; + }; + }; +}; + +&gmac0 { + mtd-mac-address = <&factory 0xe000>; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "lan4"; + }; + + port@1 { + status = "okay"; + label = "lan3"; + }; + + port@2 { + status = "okay"; + label = "lan2"; + }; + + port@3 { + status = "okay"; + label = "lan1"; + }; + + port@4 { + status = "okay"; + label = "wan"; + mtd-mac-address = <&factory 0xe006>; + }; + }; +}; + +&state_default { + gpio { + groups = "i2c", "uart3", "jtag", "wdt"; + function = "gpio"; + }; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 9e5bd811b0..48561d5ff9 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -236,6 +236,21 @@ define Device/dlink_dir-860l-b1 endef TARGET_DEVICES += dlink_dir-860l-b1 +define Device/dlink_dir-878-a1 + IMAGE_SIZE := 16000k + DEVICE_VENDOR := D-Link + DEVICE_MODEL := DIR-878 + DEVICE_VARIANT := A1 + DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware wpad-basic + KERNEL_INITRAMFS := $$(KERNEL) | uimage-padhdr 96 + IMAGES += factory.bin + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | uimage-padhdr 96 |\ + pad-rootfs | append-metadata | check-size + IMAGE/factory.bin := append-kernel | append-rootfs | uimage-padhdr 96 |\ + check-size +endef +TARGET_DEVICES += dlink_dir-878-a1 + define Device/d-team_newifi-d2 $(Device/uimage-lzma-loader) IMAGE_SIZE := 32448k diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds index a0f9b2b10d..02f264fb42 100755 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds @@ -26,7 +26,8 @@ d-team,pbr-m1|\ gehua,ghl-r-001) ucidef_set_led_netdev "internet" "internet" "$boardname:blue:internet" "wan" ;; -dlink,dir-860l-b1) +dlink,dir-860l-b1|\ +dlink,dir-878-a1) ucidef_set_led_netdev "wan" "wan" "$boardname:green:net" "wan" ;; gnubee,gb-pc1|\ From 5b8b42c78b10957c6dea82eb7a3e56a227d16edd Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Sat, 11 Jul 2020 18:44:55 -1000 Subject: [PATCH 04/28] build,json: fix compatibility with Python 3.5 The f-string feature was introduced in Python 3.6. As Buildbots may run on Debian 9, which comes per default with Python 3.5, this would cause an issue. Instead of f-strings use the *legacy* `.format()` function. Signed-off-by: Paul Spooren --- scripts/json_overview_image_info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/json_overview_image_info.py b/scripts/json_overview_image_info.py index c76a442840..ca6fbbc962 100755 --- a/scripts/json_overview_image_info.py +++ b/scripts/json_overview_image_info.py @@ -38,7 +38,7 @@ if output: "make", "--no-print-directory", "-C", - f"target/linux/{output['target'].split('/')[0]}", + "target/linux/{}".format(output['target'].split('/')[0]), "val.DEFAULT_PACKAGES", "val.ARCH_PACKAGES", ], From 26fda610f3c5217600e87904d1ba9236091c1b7c Mon Sep 17 00:00:00 2001 From: Roger Pueyo Centelles Date: Tue, 10 Mar 2020 19:31:20 +0100 Subject: [PATCH 05/28] ath79: use rgmii-id instead of rgmii in ubnt,lap-120 Since commit 6f2e1b7485 (ath79: disable delays on AT803X config init) the incoming incoming traffic on the ubnt,lap-120 devices Ethernet port was not making it through. Using rgmii-id instead of rgmii (same configuration as ubnt,litebeam-ac-gen2) fixes it. Fixes FS#2893. Signed-off-by: Roger Pueyo Centelles --- target/linux/ath79/dts/ar9342_ubnt_lap-120.dts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/target/linux/ath79/dts/ar9342_ubnt_lap-120.dts b/target/linux/ath79/dts/ar9342_ubnt_lap-120.dts index 9ea6079264..78567622b6 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_lap-120.dts +++ b/target/linux/ath79/dts/ar9342_ubnt_lap-120.dts @@ -13,7 +13,6 @@ phy-mask = <4>; phy4: ethernet-phy@4 { - phy-mode = "rgmii"; reg = <4>; }; }; @@ -22,11 +21,11 @@ status = "okay"; /* default for ar934x, except for 1000M and 10M */ - pll-data = <0x06000000 0x00000101 0x00001313>; + pll-data = <0x02000000 0x00000101 0x00001313>; mtd-mac-address = <&art 0x0>; - phy-mode = "rgmii"; + phy-mode = "rgmii-id"; phy-handle = <&phy4>; gmac-config { From 732b70c5bdce59507332cd51b55cd1c9e1b3c6b2 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Tue, 14 Jul 2020 00:23:11 +0100 Subject: [PATCH 06/28] procd: update to git HEAD 639df57 uxc: fix build with uClibc-ng b2230e4 procd: add service instance watchdog 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 cbdd38d197..abcc9a7a3c 100644 --- a/package/system/procd/Makefile +++ b/package/system/procd/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=3 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/procd.git -PKG_SOURCE_DATE:=2020-07-13 -PKG_SOURCE_VERSION:=dacab12b301085eac00e84a94e42096de70886e8 -PKG_MIRROR_HASH:=e9c49884ea1dd6554ce057c8ca7fb23bc980939b92e11f43d37b930c29f63dbd +PKG_SOURCE_DATE:=2020-07-14 +PKG_SOURCE_VERSION:=b2230e4ff28b29472d0a232fee5d9f4168390b52 +PKG_MIRROR_HASH:=67dd91d469a2e996a6b350575cfc0accedcf9ac948feaeee0d665199820bb6b0 CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 From 5792f6a1043d686d4ee3c8b8f7ce070ac1bb3e5d Mon Sep 17 00:00:00 2001 From: Daniel Bailey Date: Mon, 13 Jul 2020 15:21:50 -0700 Subject: [PATCH 07/28] procd: allow optional watchdog instance parameter Optional instance watchdog timeout and watchdog mode can be set by adding: procd_set_param $mode $timeout $mode is an integer [0-1] representing instance watchdog mode of operation: 0 = disabled 1 = passive mode, client must periodically poke watchdog via ubus $timeout is an integer representing how often, in seconds, the watchdog must be poked. Signed-off-by: Daniel Bailey --- package/system/procd/files/procd.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/system/procd/files/procd.sh b/package/system/procd/files/procd.sh index dd6dc1c58d..d86b7219da 100644 --- a/package/system/procd/files/procd.sh +++ b/package/system/procd/files/procd.sh @@ -247,7 +247,7 @@ _procd_set_param() { env|data|limits) _procd_add_table "$type" "$@" ;; - command|netdev|file|respawn|watch) + command|netdev|file|respawn|watch|watchdog) _procd_add_array "$type" "$@" ;; error) @@ -378,7 +378,7 @@ _procd_append_param() { env|data|limits) _procd_add_table_data "$@" ;; - command|netdev|file|respawn|watch) + command|netdev|file|respawn|watch|watchdog) _procd_add_array_data "$@" ;; error) From c83f7b6d217fdb116412d446b81d122b4a432874 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Fri, 3 Jul 2020 15:50:42 +0200 Subject: [PATCH 08/28] ipq806x: fix aliases node name for Qualcomm IPQ8064/DB149 This device uses a node incorrectly named "alias" instead of "aliases" since it was introduced. Remove it without replacement, as the definitions in it don't seem to be required anyway: The serial0 definition has never been effective anyway and this would be the only device deviating from the common setting "serial0 = &gsbi4_serial;" for ipq8064. (So, maybe the wrong node prevented us from finding out about the wrong serial definition?) The mdio-gpio0 alias was supposed to be removed in d2a2eb7e48f6 anyway, the redundant definition in the alias node was just overlooked back then. Fixes: 0fd202f3e563 ("ipq806x: add db149 dts files") Fixes: d2a2eb7e48f6 ("ipq806x: replace caf nss-gmac driver by upstream stmmac") Signed-off-by: Adrian Schmutzler --- .../files-4.19/arch/arm/boot/dts/qcom-ipq8064-db149.dts | 5 ----- .../files-5.4/arch/arm/boot/dts/qcom-ipq8064-db149.dts | 7 +------ 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-db149.dts b/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-db149.dts index 5da523a728..625e9a84ff 100644 --- a/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-db149.dts +++ b/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-db149.dts @@ -14,11 +14,6 @@ }; }; - alias { - serial0 = &uart2; - mdio-gpio0 = &mdio0; - }; - chosen { stdout-path = "serial0:115200n8"; }; diff --git a/target/linux/ipq806x/files-5.4/arch/arm/boot/dts/qcom-ipq8064-db149.dts b/target/linux/ipq806x/files-5.4/arch/arm/boot/dts/qcom-ipq8064-db149.dts index e29084d8a9..e97c16b7e0 100644 --- a/target/linux/ipq806x/files-5.4/arch/arm/boot/dts/qcom-ipq8064-db149.dts +++ b/target/linux/ipq806x/files-5.4/arch/arm/boot/dts/qcom-ipq8064-db149.dts @@ -13,11 +13,6 @@ no-map; }; }; - - alias { - serial0 = &uart2; - mdio-gpio0 = &mdio0; - }; }; &qcom_pinmux { @@ -180,4 +175,4 @@ phy-mode = "sgmii"; qcom,id = <3>; phy-handle = <&phy7>; -}; \ No newline at end of file +}; From e363470d1a7170d702ec2c8677ea340cd50a42fd Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Tue, 14 Jul 2020 12:23:53 +0200 Subject: [PATCH 09/28] ipq806x: use consistent DT labels for gsbiX_serial Kernel uses the label gsbiX_serial, so let's adjust our labels to this naming scheme. This is cosmetic, and actually only already existing gsbi4_serial has been used at all. Signed-off-by: Adrian Schmutzler --- .../ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064.dtsi | 4 ++-- .../ipq806x/files-5.4/arch/arm/boot/dts/qcom-ipq8064.dtsi | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064.dtsi b/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064.dtsi index f95b0b4f95..a542af7866 100644 --- a/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064.dtsi +++ b/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064.dtsi @@ -818,7 +818,7 @@ syscon-tcsr = <&tcsr>; - uart2: serial@12490000 { + gsbi2_serial: serial@12490000 { compatible = "qcom,msm-uartdm-v1.3", "qcom,msm-uartdm"; reg = <0x12490000 0x1000>, <0x12480000 0x1000>; @@ -893,7 +893,7 @@ syscon-tcsr = <&tcsr>; - uart5: serial@1a240000 { + gsbi5_serial: serial@1a240000 { compatible = "qcom,msm-uartdm-v1.3", "qcom,msm-uartdm"; reg = <0x1a240000 0x1000>, <0x1a200000 0x1000>; diff --git a/target/linux/ipq806x/files-5.4/arch/arm/boot/dts/qcom-ipq8064.dtsi b/target/linux/ipq806x/files-5.4/arch/arm/boot/dts/qcom-ipq8064.dtsi index 1c08b44535..38d77b6c0b 100644 --- a/target/linux/ipq806x/files-5.4/arch/arm/boot/dts/qcom-ipq8064.dtsi +++ b/target/linux/ipq806x/files-5.4/arch/arm/boot/dts/qcom-ipq8064.dtsi @@ -876,7 +876,7 @@ syscon-tcsr = <&tcsr>; - uart2: serial@12490000 { + gsbi2_serial: serial@12490000 { compatible = "qcom,msm-uartdm-v1.3", "qcom,msm-uartdm"; reg = <0x12490000 0x1000>, <0x12480000 0x1000>; @@ -951,7 +951,7 @@ syscon-tcsr = <&tcsr>; - uart5: serial@1a240000 { + gsbi5_serial: serial@1a240000 { compatible = "qcom,msm-uartdm-v1.3", "qcom,msm-uartdm"; reg = <0x1a240000 0x1000>, <0x1a200000 0x1000>; From 3635f7efc1deef2a17b69000dcd20ad044e73706 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Tue, 14 Jul 2020 16:59:44 +0200 Subject: [PATCH 10/28] ipq806x: really fix aliases node for Qualcomm IPQ8064/DB149 Having looked at this again, it appears that only gsbi2_serial is actually enabled for this device, so the entry in the broken aliases node was correct. Therefore, this needs to set its own serial0 instead of inheriting "serial0 = &gsbi4_serial;" from DTSI. Do this with the correctly named aliases node now. Fixes: c83f7b6d217f ("ipq806x: fix aliases node name for Qualcomm IPQ8064/DB149") Signed-off-by: Adrian Schmutzler --- .../files-4.19/arch/arm/boot/dts/qcom-ipq8064-db149.dts | 7 ++++++- .../files-5.4/arch/arm/boot/dts/qcom-ipq8064-db149.dts | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-db149.dts b/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-db149.dts index 625e9a84ff..35b7e0ea37 100644 --- a/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-db149.dts +++ b/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-db149.dts @@ -4,6 +4,10 @@ model = "Qualcomm IPQ8064/DB149"; compatible = "qcom,ipq8064-db149", "qcom,ipq8064"; + aliases { + serial0 = &gsbi2_serial; + }; + reserved-memory { #address-cells = <1>; #size-cells = <1>; @@ -56,7 +60,8 @@ gsbi2: gsbi@12480000 { qcom,mode = ; status = "okay"; - uart2: serial@12490000 { + + gsbi2_serial: serial@12490000 { status = "okay"; }; }; diff --git a/target/linux/ipq806x/files-5.4/arch/arm/boot/dts/qcom-ipq8064-db149.dts b/target/linux/ipq806x/files-5.4/arch/arm/boot/dts/qcom-ipq8064-db149.dts index e97c16b7e0..1f68f826cb 100644 --- a/target/linux/ipq806x/files-5.4/arch/arm/boot/dts/qcom-ipq8064-db149.dts +++ b/target/linux/ipq806x/files-5.4/arch/arm/boot/dts/qcom-ipq8064-db149.dts @@ -4,6 +4,10 @@ model = "Qualcomm IPQ8064/DB149"; compatible = "qcom,ipq8064-db149", "qcom,ipq8064"; + aliases { + serial0 = &gsbi2_serial; + }; + reserved-memory { #address-cells = <1>; #size-cells = <1>; @@ -28,7 +32,8 @@ &gsbi2 { qcom,mode = ; status = "okay"; - uart2: serial@12490000 { + + gsbi2_serial: serial@12490000 { status = "okay"; }; }; From 2557d2eb4c41fd3fba080ee324e12091f8f53e97 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Tue, 14 Jul 2020 09:50:31 +0200 Subject: [PATCH 11/28] ipq40xx: merge all ar40xx patches into one single patch Signed-off-by: John Crispin --- .../705-net-add-qualcomm-ar40xx-phy.patch | 29 ++++++++++++++----- ...706-ar40xx-abort-probe-on-missig-phy.patch | 23 --------------- 2 files changed, 22 insertions(+), 30 deletions(-) delete mode 100644 target/linux/ipq40xx/patches-5.4/706-ar40xx-abort-probe-on-missig-phy.patch diff --git a/target/linux/ipq40xx/patches-5.4/705-net-add-qualcomm-ar40xx-phy.patch b/target/linux/ipq40xx/patches-5.4/705-net-add-qualcomm-ar40xx-phy.patch index 083de038a2..648723df06 100644 --- a/target/linux/ipq40xx/patches-5.4/705-net-add-qualcomm-ar40xx-phy.patch +++ b/target/linux/ipq40xx/patches-5.4/705-net-add-qualcomm-ar40xx-phy.patch @@ -1,5 +1,7 @@ ---- a/drivers/net/phy/Kconfig -+++ b/drivers/net/phy/Kconfig +Index: linux-5.4.51/drivers/net/phy/Kconfig +=================================================================== +--- linux-5.4.51.orig/drivers/net/phy/Kconfig ++++ linux-5.4.51/drivers/net/phy/Kconfig @@ -587,6 +587,13 @@ config MDIO_IPQ40XX This driver supports the MDIO interface found in Qualcomm Atheros ipq40xx Soc chip. @@ -14,8 +16,10 @@ endif # PHYLIB config MICREL_KS8995MA ---- a/drivers/net/phy/Makefile -+++ b/drivers/net/phy/Makefile +Index: linux-5.4.51/drivers/net/phy/Makefile +=================================================================== +--- linux-5.4.51.orig/drivers/net/phy/Makefile ++++ linux-5.4.51/drivers/net/phy/Makefile @@ -70,6 +70,7 @@ ifdef CONFIG_HWMON aquantia-objs += aquantia_hwmon.o endif @@ -24,9 +28,11 @@ obj-$(CONFIG_AX88796B_PHY) += ax88796b.o obj-$(CONFIG_AT803X_PHY) += at803x.o obj-$(CONFIG_BCM63XX_PHY) += bcm63xx.o +Index: linux-5.4.51/drivers/net/phy/ar40xx.c +=================================================================== --- /dev/null -+++ b/drivers/net/phy/ar40xx.c -@@ -0,0 +1,2090 @@ ++++ linux-5.4.51/drivers/net/phy/ar40xx.c +@@ -0,0 +1,2097 @@ +/* + * Copyright (c) 2016, The Linux Foundation. All rights reserved. + * @@ -2050,6 +2056,12 @@ + /* register switch */ + swdev = &priv->dev; + ++ if (priv->mii_bus == NULL) { ++ dev_err(&pdev->dev, "Probe failed - Missing PHYs!\n"); ++ ret = -ENODEV; ++ goto err_missing_phy; ++ } ++ + swdev->alias = dev_name(&priv->mii_bus->dev); + + swdev->cpu_port = AR40XX_PORT_CPU; @@ -2081,6 +2093,7 @@ + unregister_switch(&priv->dev); +err_unregister_phy: + phy_driver_unregister(&ar40xx_phy_driver); ++err_missing_phy: + platform_set_drvdata(pdev, NULL); + return ret; +} @@ -2117,8 +2130,10 @@ + +MODULE_DESCRIPTION("IPQ40XX ESS driver"); +MODULE_LICENSE("Dual BSD/GPL"); +Index: linux-5.4.51/drivers/net/phy/ar40xx.h +=================================================================== --- /dev/null -+++ b/drivers/net/phy/ar40xx.h ++++ linux-5.4.51/drivers/net/phy/ar40xx.h @@ -0,0 +1,337 @@ +/* + * Copyright (c) 2016, The Linux Foundation. All rights reserved. diff --git a/target/linux/ipq40xx/patches-5.4/706-ar40xx-abort-probe-on-missig-phy.patch b/target/linux/ipq40xx/patches-5.4/706-ar40xx-abort-probe-on-missig-phy.patch deleted file mode 100644 index 19474bff0d..0000000000 --- a/target/linux/ipq40xx/patches-5.4/706-ar40xx-abort-probe-on-missig-phy.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- a/drivers/net/phy/ar40xx.c -+++ b/drivers/net/phy/ar40xx.c -@@ -2021,6 +2021,12 @@ static int ar40xx_probe(struct platform_ - /* register switch */ - swdev = &priv->dev; - -+ if (priv->mii_bus == NULL) { -+ dev_err(&pdev->dev, "Probe failed - Missing PHYs!\n"); -+ ret = -ENODEV; -+ goto err_missing_phy; -+ } -+ - swdev->alias = dev_name(&priv->mii_bus->dev); - - swdev->cpu_port = AR40XX_PORT_CPU; -@@ -2052,6 +2058,7 @@ err_unregister_switch: - unregister_switch(&priv->dev); - err_unregister_phy: - phy_driver_unregister(&ar40xx_phy_driver); -+err_missing_phy: - platform_set_drvdata(pdev, NULL); - return ret; - } From 9da2b567605b0964d921b9ca4f0c9886db4f636d Mon Sep 17 00:00:00 2001 From: John Crispin Date: Tue, 14 Jul 2020 10:07:32 +0200 Subject: [PATCH 12/28] ipq40xx: fix ethernet vlan double tagging As the the SoC uses implicit vlan tagging for dual MAC support, the offload feature breaks when using double tagging. Signed-off-by: Sven Eckelmann Signed-off-by: John Crispin --- .../net/ethernet/qualcomm/essedma/edma_axi.c | 9 ++--- .../705-net-add-qualcomm-ar40xx-phy.patch | 38 ++++++++++++++++--- 2 files changed, 36 insertions(+), 11 deletions(-) diff --git a/target/linux/ipq40xx/files-5.4/drivers/net/ethernet/qualcomm/essedma/edma_axi.c b/target/linux/ipq40xx/files-5.4/drivers/net/ethernet/qualcomm/essedma/edma_axi.c index 96a82b3116..50335b0d14 100644 --- a/target/linux/ipq40xx/files-5.4/drivers/net/ethernet/qualcomm/essedma/edma_axi.c +++ b/target/linux/ipq40xx/files-5.4/drivers/net/ethernet/qualcomm/essedma/edma_axi.c @@ -968,7 +968,6 @@ static int edma_axi_probe(struct platform_device *pdev) edma_netdev[i]->netdev_ops = &edma_axi_netdev_ops; edma_netdev[i]->max_mtu = 9000; edma_netdev[i]->features = NETIF_F_HW_CSUM | NETIF_F_RXCSUM - | NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_SG | NETIF_F_TSO | NETIF_F_GRO; edma_netdev[i]->hw_features = NETIF_F_HW_CSUM | NETIF_F_RXCSUM | @@ -980,10 +979,10 @@ static int edma_axi_probe(struct platform_device *pdev) NETIF_F_TSO | NETIF_F_GRO; #ifdef CONFIG_RFS_ACCEL - edma_netdev[i]->features |= NETIF_F_RXHASH | NETIF_F_NTUPLE; - edma_netdev[i]->hw_features |= NETIF_F_RXHASH | NETIF_F_NTUPLE; - edma_netdev[i]->vlan_features |= NETIF_F_RXHASH | NETIF_F_NTUPLE; - edma_netdev[i]->wanted_features |= NETIF_F_RXHASH | NETIF_F_NTUPLE; + edma_netdev[i]->features |= NETIF_F_NTUPLE; + edma_netdev[i]->hw_features |= NETIF_F_NTUPLE; + edma_netdev[i]->vlan_features |= NETIF_F_NTUPLE; + edma_netdev[i]->wanted_features |= NETIF_F_NTUPLE; #endif edma_set_ethtool_ops(edma_netdev[i]); diff --git a/target/linux/ipq40xx/patches-5.4/705-net-add-qualcomm-ar40xx-phy.patch b/target/linux/ipq40xx/patches-5.4/705-net-add-qualcomm-ar40xx-phy.patch index 648723df06..6c823b3483 100644 --- a/target/linux/ipq40xx/patches-5.4/705-net-add-qualcomm-ar40xx-phy.patch +++ b/target/linux/ipq40xx/patches-5.4/705-net-add-qualcomm-ar40xx-phy.patch @@ -32,7 +32,7 @@ Index: linux-5.4.51/drivers/net/phy/ar40xx.c =================================================================== --- /dev/null +++ linux-5.4.51/drivers/net/phy/ar40xx.c -@@ -0,0 +1,2097 @@ +@@ -0,0 +1,2118 @@ +/* + * Copyright (c) 2016, The Linux Foundation. All rights reserved. + * @@ -1235,7 +1235,11 @@ Index: linux-5.4.51/drivers/net/phy/ar40xx.c + ar40xx_rmw(priv, AR40XX_REG_PORT_STATUS(port), + AR40XX_PORT_AUTO_LINK_EN, 0); + -+ ar40xx_write(priv, AR40XX_REG_PORT_HEADER(port), 0); ++ /* CPU port is setting headers to limit output ports */ ++ if (port == 0) ++ ar40xx_write(priv, AR40XX_REG_PORT_HEADER(port), 0x8); ++ else ++ ar40xx_write(priv, AR40XX_REG_PORT_HEADER(port), 0); + + ar40xx_write(priv, AR40XX_REG_PORT_VLAN0(port), 0); + @@ -1278,6 +1282,10 @@ Index: linux-5.4.51/drivers/net/phy/ar40xx.c + t = (AR40XX_PORT0_FC_THRESH_ON_DFLT << 16) | + AR40XX_PORT0_FC_THRESH_OFF_DFLT; + ar40xx_write(priv, AR40XX_REG_PORT_FLOWCTRL_THRESH(0), t); ++ ++ /* set service tag to 802.1q */ ++ t = ETH_P_8021Q | AR40XX_ESS_SERVICE_TAG_STAG; ++ ar40xx_write(priv, AR40XX_ESS_SERVICE_TAG, t); +} + +static void @@ -1603,7 +1611,11 @@ Index: linux-5.4.51/drivers/net/phy/ar40xx.c + u32 pvid = priv->vlan_id[priv->pvid[port]]; + + if (priv->vlan) { -+ egress = AR40XX_PORT_VLAN1_OUT_MODE_UNMOD; ++ if (priv->vlan_tagged & BIT(port)) ++ egress = AR40XX_PORT_VLAN1_OUT_MODE_TAG; ++ else ++ egress = AR40XX_PORT_VLAN1_OUT_MODE_UNMOD; ++ + ingress = AR40XX_IN_SECURE; + } else { + egress = AR40XX_PORT_VLAN1_OUT_MODE_UNTOUCH; @@ -1614,8 +1626,17 @@ Index: linux-5.4.51/drivers/net/phy/ar40xx.c + t |= pvid << AR40XX_PORT_VLAN0_DEF_CVID_S; + ar40xx_write(priv, AR40XX_REG_PORT_VLAN0(port), t); + -+ t = AR40XX_PORT_VLAN1_PORT_VLAN_PROP; -+ t |= egress << AR40XX_PORT_VLAN1_OUT_MODE_S; ++ t = egress << AR40XX_PORT_VLAN1_OUT_MODE_S; ++ ++ /* set CPU port to core port */ ++ if (port == 0) ++ t |= AR40XX_PORT_VLAN1_CORE_PORT; ++ ++ if (priv->vlan_tagged & BIT(port)) ++ t |= AR40XX_PORT_VLAN1_PORT_VLAN_PROP; ++ else ++ t |= AR40XX_PORT_VLAN1_PORT_TLS_MODE; ++ + ar40xx_write(priv, AR40XX_REG_PORT_VLAN1(port), t); + + t = members; @@ -2134,7 +2155,7 @@ Index: linux-5.4.51/drivers/net/phy/ar40xx.h =================================================================== --- /dev/null +++ linux-5.4.51/drivers/net/phy/ar40xx.h -@@ -0,0 +1,337 @@ +@@ -0,0 +1,342 @@ +/* + * Copyright (c) 2016, The Linux Foundation. All rights reserved. + * @@ -2288,6 +2309,9 @@ Index: linux-5.4.51/drivers/net/phy/ar40xx.h +#define AR40XX_MIB_FUNC_NO_OP 0x0 +#define AR40XX_MIB_FUNC_FLUSH 0x1 + ++#define AR40XX_ESS_SERVICE_TAG 0x48 ++#define AR40XX_ESS_SERVICE_TAG_STAG BIT(17) ++ +#define AR40XX_REG_PORT_STATUS(_i) (0x07c + (_i) * 4) +#define AR40XX_PORT_SPEED BITS(0, 2) +#define AR40XX_PORT_STATUS_SPEED_S 0 @@ -2316,6 +2340,8 @@ Index: linux-5.4.51/drivers/net/phy/ar40xx.h +#define AR40XX_PORT_VLAN0_DEF_CVID_S 16 + +#define AR40XX_REG_PORT_VLAN1(_i) (0x424 + (_i) * 0x8) ++#define AR40XX_PORT_VLAN1_CORE_PORT BIT(9) ++#define AR40XX_PORT_VLAN1_PORT_TLS_MODE BIT(7) +#define AR40XX_PORT_VLAN1_PORT_VLAN_PROP BIT(6) +#define AR40XX_PORT_VLAN1_OUT_MODE BITS(12, 2) +#define AR40XX_PORT_VLAN1_OUT_MODE_S 12 From 9852104c7111c51a20466ae380d29631db6c01f3 Mon Sep 17 00:00:00 2001 From: Tony Ambardar Date: Mon, 29 Jun 2020 22:04:54 -0700 Subject: [PATCH 13/28] iproute2: tc: fix dynamic symbol table size optimization Recent iproute2 5.x versions modified the symbols resolved for plugins, causing "tc .. action xt .." to fail. Update the list of symbols to fix. Fixes: b61495409bb3 ("iproute2: tc: reduce size of dynamic symbol table") Signed-off-by: Tony Ambardar --- .../utils/iproute2/patches/175-reduce-dynamic-syms.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/network/utils/iproute2/patches/175-reduce-dynamic-syms.patch b/package/network/utils/iproute2/patches/175-reduce-dynamic-syms.patch index f4e33c4511..dbb516f02e 100644 --- a/package/network/utils/iproute2/patches/175-reduce-dynamic-syms.patch +++ b/package/network/utils/iproute2/patches/175-reduce-dynamic-syms.patch @@ -39,6 +39,6 @@ + for s in `grep -B 3 '\> $@ ; \ -+ echo "show_stats; print_tm; parse_rtattr; get_u32; matches; addattr_l; addattr_nest; addattr_nest_end; };" >> $@ ++ echo "show_stats; print_nl; print_tm; parse_rtattr; parse_rtattr_flags; get_u32; matches; addattr_l; addattr_nest; addattr_nest_end; };" >> $@ + endif From e89a7d72a5b0d91266c55eb330e236b0d2a4a4b0 Mon Sep 17 00:00:00 2001 From: Tony Ambardar Date: Mon, 29 Jun 2020 22:07:19 -0700 Subject: [PATCH 14/28] iproute2: tc: fix missing em_ipset module Feature detection doesn't recognize ipset v7 use on kernel v5.x systems and thus disables the tc ematch function em_ipset. - backport patch: * 002-configure-support-ipset-v7.patch: 650591a7a70c configure: support ipset version 7 with kernel version 5 Fixes: 4e0c54bc5bc8 ("kernel: add support for kernel 5.4") Signed-off-by: Tony Ambardar --- package/network/utils/iproute2/Makefile | 2 +- .../002-configure-support-ipset-v7.patch | 32 +++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 package/network/utils/iproute2/patches/002-configure-support-ipset-v7.patch diff --git a/package/network/utils/iproute2/Makefile b/package/network/utils/iproute2/Makefile index a29b26f817..56294430be 100644 --- a/package/network/utils/iproute2/Makefile +++ b/package/network/utils/iproute2/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=iproute2 PKG_VERSION:=5.7.0 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/utils/net/iproute2 diff --git a/package/network/utils/iproute2/patches/002-configure-support-ipset-v7.patch b/package/network/utils/iproute2/patches/002-configure-support-ipset-v7.patch new file mode 100644 index 0000000000..cd0c529544 --- /dev/null +++ b/package/network/utils/iproute2/patches/002-configure-support-ipset-v7.patch @@ -0,0 +1,32 @@ +From 650591a7a70cd79d826fcdc579a20c168c987cf2 Mon Sep 17 00:00:00 2001 +From: Tony Ambardar +Date: Tue, 7 Jul 2020 00:58:33 -0700 +Subject: [PATCH] configure: support ipset version 7 with kernel version 5 + +The configure script checks for ipset v6 availability but doesn't test +for v7, which is backward compatible and used on kernel v5.x systems. +Update the script to test for both ipset versions. Without this change, +the tc ematch function em_ipset will be disabled. + +Signed-off-by: Tony Ambardar +Signed-off-by: Stephen Hemminger +--- + configure | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure b/configure +index f415bf49..307912aa 100755 +--- a/configure ++++ b/configure +@@ -208,7 +208,7 @@ typedef unsigned short ip_set_id_t; + #include + + struct xt_set_info info; +-#if IPSET_PROTOCOL == 6 ++#if IPSET_PROTOCOL == 6 || IPSET_PROTOCOL == 7 + int main(void) + { + return IPSET_MAXNAMELEN; +-- +2.17.1 + From b94d1a2d2786f3115602fb7e771aa9944f63e6a2 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Wed, 15 Jul 2020 00:01:36 +0200 Subject: [PATCH 15/28] ravpower-mcu: remove target dependency Remove the target dependency as the tool is also usable with other battery-powered routers. Signed-off-by: David Bauer --- package/utils/ravpower-mcu/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/package/utils/ravpower-mcu/Makefile b/package/utils/ravpower-mcu/Makefile index b5bdfa56df..0118920796 100644 --- a/package/utils/ravpower-mcu/Makefile +++ b/package/utils/ravpower-mcu/Makefile @@ -17,7 +17,6 @@ define Package/ravpower-mcu SECTION:=utils CATEGORY:=Utilities TITLE:=Utility to control the RAVPower RP-WD009 PMIC - DEPENDS:=@TARGET_ramips_mt76x8 URL:=https://github.com/blocktrron/ravpower-mcu/ endef From 0453c3866feb701160bbab4ecf9762c5a3038503 Mon Sep 17 00:00:00 2001 From: Johannes Kimmel Date: Mon, 8 Jun 2020 16:14:43 +0200 Subject: [PATCH 16/28] vxlan: fix udp checksum control So far, passing "rxcsum" and "txcsum" had no effect. Fixes: 95ab18e0124e ("vxlan: add options to enable and disable UDP checksums") Signed-off-by: Johannes Kimmel [add Fixes:] Signed-off-by: Adrian Schmutzler --- package/network/config/vxlan/files/vxlan.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/network/config/vxlan/files/vxlan.sh b/package/network/config/vxlan/files/vxlan.sh index d055d41edc..7b1c703955 100755 --- a/package/network/config/vxlan/files/vxlan.sh +++ b/package/network/config/vxlan/files/vxlan.sh @@ -129,6 +129,8 @@ vxlan_generic_init_config() { proto_config_add_int "ttl" proto_config_add_int "tos" proto_config_add_int "mtu" + proto_config_add_boolean "rxcsum" + proto_config_add_boolean "txcsum" proto_config_add_string "macaddr" } From f886a26851f3f6e82fbd8c11fb0e7ff2f3295c5b Mon Sep 17 00:00:00 2001 From: David Bauer Date: Wed, 15 Jul 2020 09:56:05 +0200 Subject: [PATCH 17/28] ravpower-mcu: bump PKG_RELEASE Fixes commit b94d1a2d2786 ("ravpower-mcu: remove target dependency") Signed-off-by: David Bauer --- package/utils/ravpower-mcu/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/utils/ravpower-mcu/Makefile b/package/utils/ravpower-mcu/Makefile index 0118920796..949ccfcce1 100644 --- a/package/utils/ravpower-mcu/Makefile +++ b/package/utils/ravpower-mcu/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ravpower-mcu -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=https://github.com/blocktrron/ravpower-mcu.git From 8c7e9cc6b5a026176b1b2cb64ecc8206c7be2b84 Mon Sep 17 00:00:00 2001 From: Vieno Hakkerinen Date: Fri, 10 Jul 2020 23:23:01 +0200 Subject: [PATCH 18/28] ath79: add support for Ubiquiti PowerBridge M This adds support for the Ubiquiti PowerBridge M, which has the same board/LEDs as the Bullet M XM, but different case and antennas. Specifications: - AR7241 SoC @ 400 MHz - 64 MB RAM - 8 MB SPI flash - 1x 10/100 Mbps Ethernet, 24 Vdc PoE-in - Internal antenna: 25 dBi - POWER/LAN green LEDs - 4x RSSI LEDs (red, orange, green, green) - UART (115200 8N1) on PCB Flashing via WebUI: Upload the factory image via the stock firmware web UI. Attention: airOS firmware versions >= 5.6 have a new bootloader with an incompatible partition table! Please downgrade to <= 5.5 _before_ flashing OpenWrt! Refer to the device's Wiki page for further information. Flashing via TFTP: Same procedure as other Bullet M (XM) boards. - Use a pointy tool (e.g., pen cap, paper clip) and keep the reset button on the device or on the PoE supply pressed - Power on the device via PoE (keep reset button pressed) - Keep pressing until LEDs flash alternatively LED1+LED3 => LED2+LED4 => LED1+LED3, etc. - Release reset button - The device starts a TFTP server at 192.168.1.20 - Set a static IP on the computer (e.g., 192.168.1.21/24) - Upload via tftp the factory image: $ tftp 192.168.1.20 tftp> bin tftp> trace tftp> put openwrt-ath79-generic-xxxxx-ubnt_powerbridge-m-squashfs-factory.bin Signed-off-by: Vieno Hakkerinen --- .../linux/ath79/dts/ar7241_ubnt_powerbridge-m.dts | 15 +++++++++++++++ .../ath79/generic/base-files/etc/board.d/01_leds | 1 + .../generic/base-files/etc/board.d/02_network | 2 ++ .../etc/hotplug.d/firmware/10-ath9k-eeprom | 1 + target/linux/ath79/image/generic-ubnt.mk | 9 +++++++++ 5 files changed, 28 insertions(+) create mode 100644 target/linux/ath79/dts/ar7241_ubnt_powerbridge-m.dts diff --git a/target/linux/ath79/dts/ar7241_ubnt_powerbridge-m.dts b/target/linux/ath79/dts/ar7241_ubnt_powerbridge-m.dts new file mode 100644 index 0000000000..3bf9ca4a90 --- /dev/null +++ b/target/linux/ath79/dts/ar7241_ubnt_powerbridge-m.dts @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "ar7241.dtsi" +#include "ar724x_ubnt_xm.dtsi" +#include "ar724x_ubnt_xm_outdoor.dtsi" + +/ { + compatible = "ubnt,powerbridge-m", "ubnt,xm", "qca,ar7241"; + model = "Ubiquiti PowerBridge M"; +}; + +ð1 { + compatible = "syscon", "simple-mfd"; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/01_leds b/target/linux/ath79/generic/base-files/etc/board.d/01_leds index f3f8742560..636ff16a17 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds @@ -315,6 +315,7 @@ ubnt,nanostation-loco-m-xw|\ ubnt,nanostation-m|\ ubnt,nanostation-m-xw|\ ubnt,picostation-m|\ +ubnt,powerbridge-m|\ ubnt,rocket-m) ucidef_set_rssimon "wlan0" "200000" "1" ucidef_set_led_rssi "rssilow" "RSSILOW" "ubnt:red:link1" "wlan0" "1" "100" 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 f93d914374..e301b6f616 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 @@ -63,6 +63,7 @@ ath79_setup_interfaces() ubnt,picostation-m|\ ubnt,powerbeam-5ac-500|\ ubnt,powerbeam-5ac-gen2|\ + ubnt,powerbridge-m|\ ubnt,rocket-m|\ ubnt,unifiac-lite|\ ubnt,unifiac-lr|\ @@ -513,6 +514,7 @@ ath79_setup_macs() ubnt,nanostation-loco-m|\ ubnt,nanostation-m|\ ubnt,picostation-m|\ + ubnt,powerbridge-m|\ ubnt,rocket-m|\ ubnt,unifi) label_mac=$(cat /sys/class/ieee80211/phy0/macaddress) diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index 2573f66f4a..90752a8f9b 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -111,6 +111,7 @@ case "$FIRMWARE" in ubnt,nanostation-loco-m|\ ubnt,nanostation-m|\ ubnt,picostation-m|\ + ubnt,powerbridge-m|\ ubnt,rocket-m) caldata_extract "art" 0x1000 0x1000 ;; diff --git a/target/linux/ath79/image/generic-ubnt.mk b/target/linux/ath79/image/generic-ubnt.mk index 3f4cc13916..e9202eadf7 100644 --- a/target/linux/ath79/image/generic-ubnt.mk +++ b/target/linux/ath79/image/generic-ubnt.mk @@ -269,6 +269,15 @@ define Device/ubnt_powerbeam-5ac-gen2 endef TARGET_DEVICES += ubnt_powerbeam-5ac-gen2 +define Device/ubnt_powerbridge-m + $(Device/ubnt-xm) + SOC := ar7241 + DEVICE_MODEL := PowerBridge M + DEVICE_PACKAGES += rssileds + SUPPORTED_DEVICES += bullet-m +endef +TARGET_DEVICES += ubnt_powerbridge-m + define Device/ubnt_rocket-m $(Device/ubnt-xm) SOC := ar7241 From b29d620ed2521fe6fda40ddafe6cb0f1d70e4503 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Wed, 15 Jul 2020 16:49:36 +0200 Subject: [PATCH 19/28] vxlan: bump and change to PKG_RELEASE Bumping package version has been overlooked in a previous commit. While at it, use PKG_RELEASE instead of PKG_VERSION, as the latter is meant for upstream version number only. (The effective version string for the package would be "3" in both cases, so there is no harm done for version comparison.) Fixes: 0453c3866feb ("vxlan: fix udp checksum control") Signed-off-by: Adrian Schmutzler --- package/network/config/vxlan/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/network/config/vxlan/Makefile b/package/network/config/vxlan/Makefile index 5850c443e7..13fcf0c55d 100644 --- a/package/network/config/vxlan/Makefile +++ b/package/network/config/vxlan/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=vxlan -PKG_VERSION:=2 +PKG_RELEASE:=3 PKG_LICENSE:=GPL-2.0 include $(INCLUDE_DIR)/package.mk From 9c170cb92f4fbb316592c11567a080eb3f6a1fc3 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Mon, 24 Feb 2020 16:57:38 +0100 Subject: [PATCH 20/28] package: drop PKG_VERSION for purely local packages In the package guidelines, PKG_VERSION is supposed to be used as "The upstream version number that we're downloading", while PKG_RELEASE is referred to as "The version of this package Makefile". Thus, the variables in a strict interpretation provide a clear distinction between "their" (upstream) version in PKG_VERSION and "our" (local OpenWrt trunk) version in PKG_RELEASE. For local (OpenWrt-only) packages, this implies that those will only need PKG_RELEASE defined, while PKG_VERSION does not apply following a strict interpretation. While the majority of "our" packages actually follow that scheme, there are also some that mix both variables or have one of them defined but keep them at "1". This is misleading and confusing, which can be observed by the fact that there typically either one of the variables is never bumped or the choice of the variable to increase depends on the person doing the change. Consequently, this patch aims at clarifying the situation by consistently using only PKG_RELEASE for "our" packages. To achieve that, PKG_VERSION is removed there, bumping PKG_RELEASE where necessary to ensure the resulting package version string is bigger than before. During adjustment, one has to make sure that the new resulting composite package version will not be considered "older" than the previous one. A useful tool for evaluating that is 'opkg compare-versions'. In principle, there are the following cases: 1. Sole PKG_VERSION replaced by sole PKG_RELEASE: In this case, the resulting version string does not change, it's just the value of the variable put in the file. Consequently, we do not bump the number in these cases so nobody is tempted to install the same package again. 2. PKG_VERSION and PKG_RELEASE replaced by sole PKG_RELEASE: In this case, the resulting version string has been "version-release", e.g. 1-3 or 1.0-3. For this case, the new PKG_RELEASE will just need to be higher than the previous PKG_VERSION. For the cases where PKG_VERSION has always sticked to "1", and PKG_RELEASE has been incremented, we take the most recent value of PKG_RELEASE. Apart from that, a few packages appear to have developed their own complex versioning scheme, e.g. using x.y.z number for PKG_VERSION _and_ a PKG_RELEASE (qos-scripts) or using dates for PKG_VERSION (adb-enablemodem, wwan). I didn't touch these few in this patch. Cc: Hans Dedecker Cc: Felix Fietkau Cc: Andre Valentin Cc: Matthias Schiffer Cc: Jo-Philipp Wich Cc: Steven Barth Cc: Daniel Golle Cc: John Crispin Signed-off-by: Adrian Schmutzler --- package/kernel/om-watchdog/Makefile | 1 - package/kernel/trelay/Makefile | 1 - package/network/config/gre/Makefile | 1 - package/network/config/ipip/Makefile | 1 - package/network/config/vti/Makefile | 1 - package/network/config/xfrm/Makefile | 1 - package/network/ipv6/464xlat/Makefile | 2 +- package/network/ipv6/6in4/Makefile | 3 +-- package/network/ipv6/6rd/Makefile | 3 +-- package/network/ipv6/6to4/Makefile | 3 +-- package/network/ipv6/ds-lite/Makefile | 3 +-- package/network/ipv6/map/Makefile | 3 +-- package/network/utils/rssileds/Makefile | 3 +-- package/system/urandom-seed/Makefile | 1 - package/system/zram-swap/Makefile | 3 +-- 15 files changed, 8 insertions(+), 22 deletions(-) diff --git a/package/kernel/om-watchdog/Makefile b/package/kernel/om-watchdog/Makefile index 403069b816..a7e859dc8b 100644 --- a/package/kernel/om-watchdog/Makefile +++ b/package/kernel/om-watchdog/Makefile @@ -9,7 +9,6 @@ include $(TOPDIR)/rules.mk PKG_NAME:=om-watchdog PKG_RELEASE:=2 -PKG_VERSION:=1 include $(INCLUDE_DIR)/package.mk diff --git a/package/kernel/trelay/Makefile b/package/kernel/trelay/Makefile index a6bada1a9b..ad83523cd4 100644 --- a/package/kernel/trelay/Makefile +++ b/package/kernel/trelay/Makefile @@ -9,7 +9,6 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=trelay -PKG_VERSION:=0.1 PKG_RELEASE:=2 include $(INCLUDE_DIR)/package.mk diff --git a/package/network/config/gre/Makefile b/package/network/config/gre/Makefile index ca19f5d47c..b16dd72cde 100644 --- a/package/network/config/gre/Makefile +++ b/package/network/config/gre/Makefile @@ -8,7 +8,6 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gre -PKG_VERSION:=1 PKG_RELEASE:=12 PKG_LICENSE:=GPL-2.0 diff --git a/package/network/config/ipip/Makefile b/package/network/config/ipip/Makefile index 458709038b..c262182558 100644 --- a/package/network/config/ipip/Makefile +++ b/package/network/config/ipip/Makefile @@ -8,7 +8,6 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ipip -PKG_VERSION:=1 PKG_RELEASE:=3 PKG_LICENSE:=GPL-2.0 diff --git a/package/network/config/vti/Makefile b/package/network/config/vti/Makefile index ee7c0d11e8..ffac77ab91 100644 --- a/package/network/config/vti/Makefile +++ b/package/network/config/vti/Makefile @@ -8,7 +8,6 @@ include $(TOPDIR)/rules.mk PKG_NAME:=vti -PKG_VERSION:=1 PKG_RELEASE:=3 PKG_LICENSE:=GPL-2.0 diff --git a/package/network/config/xfrm/Makefile b/package/network/config/xfrm/Makefile index 1d0766f568..1b3b99adb0 100644 --- a/package/network/config/xfrm/Makefile +++ b/package/network/config/xfrm/Makefile @@ -2,7 +2,6 @@ include $(TOPDIR)/rules.mk PKG_NAME:=xfrm -PKG_VERSION:=1 PKG_RELEASE:=2 PKG_LICENSE:=GPL-2.0 diff --git a/package/network/ipv6/464xlat/Makefile b/package/network/ipv6/464xlat/Makefile index f4dce2e77d..c792323235 100644 --- a/package/network/ipv6/464xlat/Makefile +++ b/package/network/ipv6/464xlat/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=464xlat -PKG_VERSION:=12 +PKG_RELEASE:=12 PKG_SOURCE_DATE:=2018-01-16 PKG_MAINTAINER:=Hans Dedecker diff --git a/package/network/ipv6/6in4/Makefile b/package/network/ipv6/6in4/Makefile index 8ff4730e74..08696ef7a8 100644 --- a/package/network/ipv6/6in4/Makefile +++ b/package/network/ipv6/6in4/Makefile @@ -8,8 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=6in4 -PKG_VERSION:=25 -PKG_RELEASE:=1 +PKG_RELEASE:=26 PKG_LICENSE:=GPL-2.0 include $(INCLUDE_DIR)/package.mk diff --git a/package/network/ipv6/6rd/Makefile b/package/network/ipv6/6rd/Makefile index 47f20414fc..9836ae9361 100644 --- a/package/network/ipv6/6rd/Makefile +++ b/package/network/ipv6/6rd/Makefile @@ -8,8 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=6rd -PKG_VERSION:=9 -PKG_RELEASE:=4 +PKG_RELEASE:=10 PKG_LICENSE:=GPL-2.0 include $(INCLUDE_DIR)/package.mk diff --git a/package/network/ipv6/6to4/Makefile b/package/network/ipv6/6to4/Makefile index 32d7b325aa..dfb66aaae2 100644 --- a/package/network/ipv6/6to4/Makefile +++ b/package/network/ipv6/6to4/Makefile @@ -8,8 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=6to4 -PKG_VERSION:=12 -PKG_RELEASE:=2 +PKG_RELEASE:=13 PKG_LICENSE:=GPL-2.0 include $(INCLUDE_DIR)/package.mk diff --git a/package/network/ipv6/ds-lite/Makefile b/package/network/ipv6/ds-lite/Makefile index 198b6ebcc7..502da366a9 100644 --- a/package/network/ipv6/ds-lite/Makefile +++ b/package/network/ipv6/ds-lite/Makefile @@ -8,8 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ds-lite -PKG_VERSION:=7 -PKG_RELEASE:=4 +PKG_RELEASE:=8 PKG_LICENSE:=GPL-2.0 include $(INCLUDE_DIR)/package.mk diff --git a/package/network/ipv6/map/Makefile b/package/network/ipv6/map/Makefile index f05f216a4c..5d0e0bbd3d 100644 --- a/package/network/ipv6/map/Makefile +++ b/package/network/ipv6/map/Makefile @@ -8,8 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=map -PKG_VERSION:=4 -PKG_RELEASE:=13 +PKG_RELEASE:=5 PKG_LICENSE:=GPL-2.0 include $(INCLUDE_DIR)/package.mk diff --git a/package/network/utils/rssileds/Makefile b/package/network/utils/rssileds/Makefile index 7a59314693..892b9f2c51 100644 --- a/package/network/utils/rssileds/Makefile +++ b/package/network/utils/rssileds/Makefile @@ -8,8 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=rssileds -PKG_VERSION:=0.2 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_LICNESE:=GPL-2.0+ include $(INCLUDE_DIR)/package.mk diff --git a/package/system/urandom-seed/Makefile b/package/system/urandom-seed/Makefile index 5a48a07ce1..7cb7c72038 100644 --- a/package/system/urandom-seed/Makefile +++ b/package/system/urandom-seed/Makefile @@ -1,7 +1,6 @@ include $(TOPDIR)/rules.mk PKG_NAME:=urandom-seed -PKG_VERSION:=1.0 PKG_RELEASE:=2 PKG_LICENSE:=GPL-2.0-only diff --git a/package/system/zram-swap/Makefile b/package/system/zram-swap/Makefile index a6661ce5e9..4422c351ea 100644 --- a/package/system/zram-swap/Makefile +++ b/package/system/zram-swap/Makefile @@ -8,8 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=zram-swap -PKG_VERSION:=1.1 -PKG_RELEASE:=4 +PKG_RELEASE:=5 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) From e49fac097ca738658bf33fd918437bfec3e6ed80 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Sun, 10 May 2020 16:20:55 +0200 Subject: [PATCH 21/28] base-files: replace backticks in lib/upgrade/nand.sh This replaces deprecated backticks by more versatile $(...) syntax. Signed-off-by: Adrian Schmutzler --- package/base-files/files/lib/upgrade/nand.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/base-files/files/lib/upgrade/nand.sh b/package/base-files/files/lib/upgrade/nand.sh index e7d7bf8d13..ad04bbc753 100644 --- a/package/base-files/files/lib/upgrade/nand.sh +++ b/package/base-files/files/lib/upgrade/nand.sh @@ -231,7 +231,7 @@ nand_upgrade_ubinized() { # Write the UBIFS image to UBI volume nand_upgrade_ubifs() { - local rootfs_length=`(cat $1 | wc -c) 2> /dev/null` + local rootfs_length=$( (cat $1 | wc -c) 2> /dev/null) nand_upgrade_prepare_ubi "$rootfs_length" "ubifs" "0" "0" @@ -249,8 +249,8 @@ nand_upgrade_tar() { local board_dir=$(tar tf $tar_file | grep -m 1 '^sysupgrade-.*/$') board_dir=${board_dir%/} - local kernel_length=`(tar xf $tar_file ${board_dir}/kernel -O | wc -c) 2> /dev/null` - local rootfs_length=`(tar xf $tar_file ${board_dir}/root -O | wc -c) 2> /dev/null` + local kernel_length=$( (tar xf $tar_file ${board_dir}/kernel -O | wc -c) 2> /dev/null) + local rootfs_length=$( (tar xf $tar_file ${board_dir}/root -O | wc -c) 2> /dev/null) local rootfs_type="$(identify_tar "$tar_file" ${board_dir}/root)" @@ -307,7 +307,7 @@ nand_do_upgrade() { nand_do_platform_check() { local board_name="$1" local tar_file="$2" - local control_length=`(tar xf $tar_file sysupgrade-$board_name/CONTROL -O | wc -c) 2> /dev/null` + local control_length=$( (tar xf $tar_file sysupgrade-$board_name/CONTROL -O | wc -c) 2> /dev/null) local file_type="$(identify $2)" [ "$control_length" = 0 -a "$file_type" != "ubi" -a "$file_type" != "ubifs" ] && { From 9f3415d30bda1cdeef484d6f179f70d95295c9e2 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Wed, 15 Jul 2020 18:41:57 +0200 Subject: [PATCH 22/28] ath79: harmonize model names for Ubiquiti devices This harmonizes the model names for the ath79 Ubiquiti devices by applying a few minor cosmetic adjustments: - Removes hyphens where they are not found in the product names (Ubiquiti uses hyphens only for the abbreviated version names like UAP-AC-PRO which we don't use anyway.) - Add (XM) suffix for DTS model strings to help with distinguishing them from their XW counterparts. - Remove DEVICE_VARIANT for LAP-120 which actually was an alternate device name. - Generally make DTS model names and those from generic-ubnt.mk more consistent. Signed-off-by: Adrian Schmutzler --- .../ath79/dts/ar7161_ubnt_routerstation.dts | 2 +- .../ath79/dts/ar7240_ubnt_bullet-m-ar7240.dts | 2 +- .../linux/ath79/dts/ar7241_ubnt_airrouter.dts | 2 +- .../ath79/dts/ar7241_ubnt_bullet-m-ar7241.dts | 2 +- .../ath79/dts/ar7241_ubnt_nanobridge-m.dts | 2 +- .../dts/ar7241_ubnt_nanostation-loco-m.dts | 2 +- .../ath79/dts/ar7241_ubnt_nanostation-m.dts | 2 +- .../ath79/dts/ar7241_ubnt_picostation-m.dts | 2 +- .../ath79/dts/ar7241_ubnt_powerbridge-m.dts | 2 +- .../linux/ath79/dts/ar7241_ubnt_rocket-m.dts | 2 +- target/linux/ath79/dts/ar7241_ubnt_unifi.dts | 2 +- .../ath79/dts/qca9563_ubnt_unifiac-lite.dts | 2 +- .../ath79/dts/qca9563_ubnt_unifiac-lr.dts | 2 +- .../dts/qca9563_ubnt_unifiac-mesh-pro.dts | 2 +- .../ath79/dts/qca9563_ubnt_unifiac-mesh.dts | 2 +- .../ath79/dts/qca9563_ubnt_unifiac-pro.dts | 2 +- target/linux/ath79/image/generic-ubnt.mk | 21 +++++++++---------- 17 files changed, 26 insertions(+), 27 deletions(-) diff --git a/target/linux/ath79/dts/ar7161_ubnt_routerstation.dts b/target/linux/ath79/dts/ar7161_ubnt_routerstation.dts index 63b46b9c79..d3e6315306 100644 --- a/target/linux/ath79/dts/ar7161_ubnt_routerstation.dts +++ b/target/linux/ath79/dts/ar7161_ubnt_routerstation.dts @@ -5,7 +5,7 @@ / { compatible = "ubnt,routerstation", "qca,ar7161"; - model = "Ubiquiti Networks RouterStation"; + model = "Ubiquiti RouterStation"; }; ð0 { diff --git a/target/linux/ath79/dts/ar7240_ubnt_bullet-m-ar7240.dts b/target/linux/ath79/dts/ar7240_ubnt_bullet-m-ar7240.dts index 58b35f5c8b..73626f1ff4 100644 --- a/target/linux/ath79/dts/ar7240_ubnt_bullet-m-ar7240.dts +++ b/target/linux/ath79/dts/ar7240_ubnt_bullet-m-ar7240.dts @@ -7,7 +7,7 @@ / { compatible = "ubnt,bullet-m-ar7240", "ubnt,xm", "qca,ar7240"; - model = "Ubiquiti Bullet M XM (AR7240)"; + model = "Ubiquiti Bullet M (XM AR7240)"; }; ð0 { diff --git a/target/linux/ath79/dts/ar7241_ubnt_airrouter.dts b/target/linux/ath79/dts/ar7241_ubnt_airrouter.dts index dd2421da8e..9da1c45b47 100644 --- a/target/linux/ath79/dts/ar7241_ubnt_airrouter.dts +++ b/target/linux/ath79/dts/ar7241_ubnt_airrouter.dts @@ -6,7 +6,7 @@ / { compatible = "ubnt,airrouter", "ubnt,xm", "qca,ar7241"; - model = "Ubiquiti AirRouter"; + model = "Ubiquiti AirRouter (XM)"; aliases { led-boot = &led_globe; diff --git a/target/linux/ath79/dts/ar7241_ubnt_bullet-m-ar7241.dts b/target/linux/ath79/dts/ar7241_ubnt_bullet-m-ar7241.dts index 0e2183c27d..261ee5435e 100644 --- a/target/linux/ath79/dts/ar7241_ubnt_bullet-m-ar7241.dts +++ b/target/linux/ath79/dts/ar7241_ubnt_bullet-m-ar7241.dts @@ -7,7 +7,7 @@ / { compatible = "ubnt,bullet-m-ar7241", "ubnt,xm", "qca,ar7241"; - model = "Ubiquiti Bullet M XM (AR7241)"; + model = "Ubiquiti Bullet M (XM AR7241)"; }; ð1 { diff --git a/target/linux/ath79/dts/ar7241_ubnt_nanobridge-m.dts b/target/linux/ath79/dts/ar7241_ubnt_nanobridge-m.dts index 005ef27caa..4c4fd19d32 100644 --- a/target/linux/ath79/dts/ar7241_ubnt_nanobridge-m.dts +++ b/target/linux/ath79/dts/ar7241_ubnt_nanobridge-m.dts @@ -7,7 +7,7 @@ / { compatible = "ubnt,nanobridge-m", "ubnt,xm", "qca,ar7241"; - model = "Ubiquiti NanoBridge M"; + model = "Ubiquiti NanoBridge M (XM)"; }; ð1 { diff --git a/target/linux/ath79/dts/ar7241_ubnt_nanostation-loco-m.dts b/target/linux/ath79/dts/ar7241_ubnt_nanostation-loco-m.dts index 60d5a21a22..4ccb1d50a7 100644 --- a/target/linux/ath79/dts/ar7241_ubnt_nanostation-loco-m.dts +++ b/target/linux/ath79/dts/ar7241_ubnt_nanostation-loco-m.dts @@ -7,7 +7,7 @@ / { compatible = "ubnt,nanostation-loco-m", "ubnt,xm", "qca,ar7241"; - model = "Ubiquiti Nanostation Loco M"; + model = "Ubiquiti Nanostation Loco M (XM)"; }; ð1 { diff --git a/target/linux/ath79/dts/ar7241_ubnt_nanostation-m.dts b/target/linux/ath79/dts/ar7241_ubnt_nanostation-m.dts index 82344bb5ea..fff4ec7042 100644 --- a/target/linux/ath79/dts/ar7241_ubnt_nanostation-m.dts +++ b/target/linux/ath79/dts/ar7241_ubnt_nanostation-m.dts @@ -7,5 +7,5 @@ / { compatible = "ubnt,nanostation-m", "ubnt,xm", "qca,ar7241"; - model = "Ubiquiti Nanostation M"; + model = "Ubiquiti Nanostation M (XM)"; }; diff --git a/target/linux/ath79/dts/ar7241_ubnt_picostation-m.dts b/target/linux/ath79/dts/ar7241_ubnt_picostation-m.dts index d05aca3e67..4bb13e618c 100644 --- a/target/linux/ath79/dts/ar7241_ubnt_picostation-m.dts +++ b/target/linux/ath79/dts/ar7241_ubnt_picostation-m.dts @@ -7,7 +7,7 @@ / { compatible = "ubnt,picostation-m", "ubnt,xm", "qca,ar7241"; - model = "Ubiquiti Picostation M"; + model = "Ubiquiti Picostation M (XM)"; }; ð1 { diff --git a/target/linux/ath79/dts/ar7241_ubnt_powerbridge-m.dts b/target/linux/ath79/dts/ar7241_ubnt_powerbridge-m.dts index 3bf9ca4a90..e14bfbfa8d 100644 --- a/target/linux/ath79/dts/ar7241_ubnt_powerbridge-m.dts +++ b/target/linux/ath79/dts/ar7241_ubnt_powerbridge-m.dts @@ -7,7 +7,7 @@ / { compatible = "ubnt,powerbridge-m", "ubnt,xm", "qca,ar7241"; - model = "Ubiquiti PowerBridge M"; + model = "Ubiquiti PowerBridge M (XM)"; }; ð1 { diff --git a/target/linux/ath79/dts/ar7241_ubnt_rocket-m.dts b/target/linux/ath79/dts/ar7241_ubnt_rocket-m.dts index 9e342177e2..3e716dec6c 100644 --- a/target/linux/ath79/dts/ar7241_ubnt_rocket-m.dts +++ b/target/linux/ath79/dts/ar7241_ubnt_rocket-m.dts @@ -7,7 +7,7 @@ / { compatible = "ubnt,rocket-m", "ubnt,xm", "qca,ar7241"; - model = "Ubiquiti Rocket M"; + model = "Ubiquiti Rocket M (XM)"; }; ð1 { diff --git a/target/linux/ath79/dts/ar7241_ubnt_unifi.dts b/target/linux/ath79/dts/ar7241_ubnt_unifi.dts index 5f12fd581b..e7369f0dbf 100644 --- a/target/linux/ath79/dts/ar7241_ubnt_unifi.dts +++ b/target/linux/ath79/dts/ar7241_ubnt_unifi.dts @@ -8,7 +8,7 @@ / { compatible = "ubnt,unifi", "qca,ar7241"; - model = "Ubiquiti UniFi AP"; + model = "Ubiquiti UniFi"; aliases { led-boot = &led_dome_green; diff --git a/target/linux/ath79/dts/qca9563_ubnt_unifiac-lite.dts b/target/linux/ath79/dts/qca9563_ubnt_unifiac-lite.dts index 7b9fa0701b..4ab4197a87 100644 --- a/target/linux/ath79/dts/qca9563_ubnt_unifiac-lite.dts +++ b/target/linux/ath79/dts/qca9563_ubnt_unifiac-lite.dts @@ -5,5 +5,5 @@ / { compatible = "ubnt,unifiac-lite", "qca,qca9563"; - model = "Ubiquiti UniFi-AC-LITE"; + model = "Ubiquiti UniFi AC Lite"; }; diff --git a/target/linux/ath79/dts/qca9563_ubnt_unifiac-lr.dts b/target/linux/ath79/dts/qca9563_ubnt_unifiac-lr.dts index a1e542ada6..3128081b55 100644 --- a/target/linux/ath79/dts/qca9563_ubnt_unifiac-lr.dts +++ b/target/linux/ath79/dts/qca9563_ubnt_unifiac-lr.dts @@ -5,5 +5,5 @@ / { compatible = "ubnt,unifiac-lr", "qca,qca9563"; - model = "Ubiquiti UniFi-AC-LR"; + model = "Ubiquiti UniFi AC LR"; }; diff --git a/target/linux/ath79/dts/qca9563_ubnt_unifiac-mesh-pro.dts b/target/linux/ath79/dts/qca9563_ubnt_unifiac-mesh-pro.dts index 9d80217d4e..97d9763049 100644 --- a/target/linux/ath79/dts/qca9563_ubnt_unifiac-mesh-pro.dts +++ b/target/linux/ath79/dts/qca9563_ubnt_unifiac-mesh-pro.dts @@ -5,5 +5,5 @@ / { compatible = "ubnt,unifiac-mesh-pro", "qca,qca9563"; - model = "Ubiquiti UniFi-AC-MESH PRO"; + model = "Ubiquiti UniFi AC Mesh Pro"; }; diff --git a/target/linux/ath79/dts/qca9563_ubnt_unifiac-mesh.dts b/target/linux/ath79/dts/qca9563_ubnt_unifiac-mesh.dts index 6eed56bb6c..b3d652bdfa 100644 --- a/target/linux/ath79/dts/qca9563_ubnt_unifiac-mesh.dts +++ b/target/linux/ath79/dts/qca9563_ubnt_unifiac-mesh.dts @@ -5,5 +5,5 @@ / { compatible = "ubnt,unifiac-mesh", "qca,qca9563"; - model = "Ubiquiti UniFi-AC-MESH"; + model = "Ubiquiti UniFi AC Mesh"; }; diff --git a/target/linux/ath79/dts/qca9563_ubnt_unifiac-pro.dts b/target/linux/ath79/dts/qca9563_ubnt_unifiac-pro.dts index 41449bbfc3..48c9e105e2 100644 --- a/target/linux/ath79/dts/qca9563_ubnt_unifiac-pro.dts +++ b/target/linux/ath79/dts/qca9563_ubnt_unifiac-pro.dts @@ -5,7 +5,7 @@ / { compatible = "ubnt,unifiac-pro", "qca,qca9563"; - model = "Ubiquiti UniFi-AC-PRO"; + model = "Ubiquiti UniFi AC Pro"; }; &usb_phy0 { diff --git a/target/linux/ath79/image/generic-ubnt.mk b/target/linux/ath79/image/generic-ubnt.mk index e9202eadf7..55d98ce508 100644 --- a/target/linux/ath79/image/generic-ubnt.mk +++ b/target/linux/ath79/image/generic-ubnt.mk @@ -125,7 +125,7 @@ TARGET_DEVICES += ubnt_airrouter define Device/ubnt_bullet-m-ar7240 $(Device/ubnt-xm) SOC := ar7240 - DEVICE_MODEL := Bullet-M + DEVICE_MODEL := Bullet M DEVICE_VARIANT := XM (AR7240) DEVICE_PACKAGES += rssileds SUPPORTED_DEVICES += bullet-m @@ -135,7 +135,7 @@ TARGET_DEVICES += ubnt_bullet-m-ar7240 define Device/ubnt_bullet-m-ar7241 $(Device/ubnt-xm) SOC := ar7241 - DEVICE_MODEL := Bullet-M + DEVICE_MODEL := Bullet M DEVICE_VARIANT := XM (AR7241) DEVICE_PACKAGES += rssileds SUPPORTED_DEVICES += bullet-m ubnt,bullet-m @@ -144,7 +144,7 @@ TARGET_DEVICES += ubnt_bullet-m-ar7241 define Device/ubnt_bullet-m-xw $(Device/ubnt-xw) - DEVICE_MODEL := Bullet-M + DEVICE_MODEL := Bullet M DEVICE_PACKAGES += rssileds SUPPORTED_DEVICES += bullet-m-xw endef @@ -165,8 +165,7 @@ TARGET_DEVICES += ubnt_edgeswitch-8xp define Device/ubnt_lap-120 $(Device/ubnt-wa) - DEVICE_MODEL := LiteAP ac - DEVICE_VARIANT := LAP-120 + DEVICE_MODEL := LiteAP ac (LAP-120) DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct endef TARGET_DEVICES += ubnt_lap-120 @@ -281,7 +280,7 @@ TARGET_DEVICES += ubnt_powerbridge-m define Device/ubnt_rocket-m $(Device/ubnt-xm) SOC := ar7241 - DEVICE_MODEL := Rocket-M + DEVICE_MODEL := Rocket M DEVICE_PACKAGES += rssileds SUPPORTED_DEVICES += rocket-m endef @@ -337,35 +336,35 @@ endef define Device/ubnt_unifiac-lite $(Device/ubnt_unifiac) - DEVICE_MODEL := UniFi AC-Lite + DEVICE_MODEL := UniFi AC Lite SUPPORTED_DEVICES += unifiac-lite endef TARGET_DEVICES += ubnt_unifiac-lite define Device/ubnt_unifiac-lr $(Device/ubnt_unifiac) - DEVICE_MODEL := UniFi AC-LR + DEVICE_MODEL := UniFi AC LR SUPPORTED_DEVICES += unifiac-lite ubnt,unifiac-lite endef TARGET_DEVICES += ubnt_unifiac-lr define Device/ubnt_unifiac-mesh $(Device/ubnt_unifiac) - DEVICE_MODEL := UniFi AC-Mesh + DEVICE_MODEL := UniFi AC Mesh SUPPORTED_DEVICES += unifiac-lite endef TARGET_DEVICES += ubnt_unifiac-mesh define Device/ubnt_unifiac-mesh-pro $(Device/ubnt_unifiac) - DEVICE_MODEL := UniFi AC-Mesh Pro + DEVICE_MODEL := UniFi AC Mesh Pro SUPPORTED_DEVICES += unifiac-pro endef TARGET_DEVICES += ubnt_unifiac-mesh-pro define Device/ubnt_unifiac-pro $(Device/ubnt_unifiac) - DEVICE_MODEL := UniFi AC-Pro + DEVICE_MODEL := UniFi AC Pro DEVICE_PACKAGES += kmod-usb2 SUPPORTED_DEVICES += unifiac-pro endef From ea2884e018a61a1d45ed9b7cfc916be35c3198e1 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Thu, 16 Jul 2020 09:14:49 +0200 Subject: [PATCH 23/28] mediatek: minor fix to eip97 driver This patch makes the driver work on the newer v2.3 core. Signed-off-by: John Crispin --- .../0501-crypto-add-eip97-inside-secure-support.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/mediatek/patches-5.4/0501-crypto-add-eip97-inside-secure-support.patch b/target/linux/mediatek/patches-5.4/0501-crypto-add-eip97-inside-secure-support.patch index 98cb0b16ff..3eda4f291a 100644 --- a/target/linux/mediatek/patches-5.4/0501-crypto-add-eip97-inside-secure-support.patch +++ b/target/linux/mediatek/patches-5.4/0501-crypto-add-eip97-inside-secure-support.patch @@ -5,11 +5,11 @@ writel(val, EIP197_HIA_AIC(priv) + EIP197_HIA_MST_CTRL); } + /* -+ * Set maximum number of TX commands to 2^5 = 32 for EIP97 HW2.1 ++ * Set maximum number of TX commands to 2^4 = 16 for EIP97 HW2.1/HW2.3 + */ + else { + val = 0; -+ val |= EIP97_MST_CTRL_TX_MAX_CMD(5); ++ val |= EIP97_MST_CTRL_TX_MAX_CMD(4); + writel(val, EIP197_HIA_AIC(priv) + EIP197_HIA_MST_CTRL); + } From 5a5031e70b3eefc4d4bf1be4f4529e2cfa159f98 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Thu, 16 Jul 2020 09:16:34 +0200 Subject: [PATCH 24/28] mediatek: generate UBI images for the rev board Signed-off-by: John Crispin --- target/linux/mediatek/image/mt7622.mk | 20 +++++++++++++- .../mt7622/base-files/lib/upgrade/platform.sh | 3 +++ target/linux/mediatek/mt7622/config-5.4 | 27 ++++++++++++++++++- 3 files changed, 48 insertions(+), 2 deletions(-) diff --git a/target/linux/mediatek/image/mt7622.mk b/target/linux/mediatek/image/mt7622.mk index 218bf0dc93..dee340accf 100644 --- a/target/linux/mediatek/image/mt7622.mk +++ b/target/linux/mediatek/image/mt7622.mk @@ -1,4 +1,4 @@ -KERNEL_LOADADDR := 0x41080000 +KERNEL_LOADADDR := 0x44080000 define Device/bpi_bananapi-r64 DEVICE_VENDOR := Bpi @@ -40,3 +40,21 @@ define Device/mediatek_mt7622-rfb1 DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-usb3 kmod-ata-ahci-mtk endef TARGET_DEVICES += mediatek_mt7622-rfb1 + +define Device/mediatek_mt7622-ubi + DEVICE_VENDOR := MediaTek + DEVICE_MODEL := MTK7622 AP (UBI) + DEVICE_DTS := mt7622-rfb1-ubi + DEVICE_DTS_DIR := $(DTS_DIR)/mediatek + UBINIZE_OPTS := -E 5 + BLOCKSIZE := 128k + PAGESIZE := 2048 + KERNEL_SIZE := 4194304 + IMAGE_SIZE := 32768k + IMAGES += factory.bin + IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \ + check-size $$$$(IMAGE_SIZE) + IMAGE/sysupgrade.bin := sysupgrade-tar + DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-usb3 kmod-ata-ahci-mtk +endef +TARGET_DEVICES += mediatek_mt7622-ubi diff --git a/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh index 24b71ece63..8144476943 100755 --- a/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh @@ -7,6 +7,9 @@ platform_do_upgrade() { #of eMMC and to the location of the kernel get_image "$1" | dd of=/dev/mmcblk0 bs=2097152 seek=1 conv=fsync ;; + mediatek,mt7622,ubi) + nand_do_upgrade "$1" + ;; *) default_do_upgrade "$1" ;; diff --git a/target/linux/mediatek/mt7622/config-5.4 b/target/linux/mediatek/mt7622/config-5.4 index 02a8d5eaeb..92da879a82 100755 --- a/target/linux/mediatek/mt7622/config-5.4 +++ b/target/linux/mediatek/mt7622/config-5.4 @@ -197,9 +197,11 @@ CONFIG_CPU_FREQ_STAT=y CONFIG_CPU_RMAP=y CONFIG_CPU_THERMAL=y CONFIG_CRC16=y +CONFIG_CRYPTO_ACOMP2=y CONFIG_CRYPTO_AEAD=y CONFIG_CRYPTO_AEAD2=y CONFIG_CRYPTO_CMAC=y +CONFIG_CRYPTO_DEFLATE=y CONFIG_CRYPTO_DRBG=y CONFIG_CRYPTO_DRBG_HMAC=y CONFIG_CRYPTO_DRBG_MENU=y @@ -208,11 +210,13 @@ CONFIG_CRYPTO_ECC=y CONFIG_CRYPTO_ECDH=y CONFIG_CRYPTO_HASH=y CONFIG_CRYPTO_HASH2=y +CONFIG_CRYPTO_HASH_INFO=y CONFIG_CRYPTO_HMAC=y CONFIG_CRYPTO_JITTERENTROPY=y CONFIG_CRYPTO_KPP=y CONFIG_CRYPTO_KPP2=y CONFIG_CRYPTO_LIB_SHA256=y +CONFIG_CRYPTO_LZO=y CONFIG_CRYPTO_MANAGER=y CONFIG_CRYPTO_MANAGER2=y CONFIG_CRYPTO_NULL2=y @@ -277,6 +281,7 @@ CONFIG_GENERIC_STRNLEN_USER=y CONFIG_GENERIC_TIME_VSYSCALL=y CONFIG_GLOB=y CONFIG_GPIOLIB=y +CONFIG_GRO_CELLS=y CONFIG_HANDLE_DOMAIN_IRQ=y CONFIG_HARDEN_BRANCH_PREDICTOR=y CONFIG_HARDIRQS_SW_RESEND=y @@ -340,6 +345,9 @@ CONFIG_HAVE_SYSCALL_TRACEPOINTS=y CONFIG_HAVE_UID16=y CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y CONFIG_HOLES_IN_ZONE=y +# CONFIG_HW_NAT is not set +CONFIG_HZ=250 +CONFIG_HZ_250=y CONFIG_ICPLUS_PHY=y CONFIG_IIO=y CONFIG_IKCONFIG=y @@ -378,10 +386,13 @@ CONFIG_JUMP_LABEL=y CONFIG_LIBFDT=y CONFIG_LOCK_DEBUGGING_SUPPORT=y CONFIG_LOCK_SPIN_ON_OWNER=y +CONFIG_LZO_COMPRESS=y +CONFIG_LZO_DECOMPRESS=y CONFIG_MAGIC_SYSRQ=y CONFIG_MDIO_BUS=y CONFIG_MDIO_DEVICE=y CONFIG_MEDIATEK_MT6577_AUXADC=y +# CONFIG_MEDIATEK_NETSYS_V2 is not set CONFIG_MEDIATEK_WATCHDOG=y CONFIG_MEDIA_SUPPORT=y CONFIG_MEMFD_CREATE=y @@ -393,7 +404,7 @@ CONFIG_MMC_MTK=y # CONFIG_MMC_TIFM_SD is not set CONFIG_MODULES_TREE_LOOKUP=y CONFIG_MODULES_USE_ELF_RELA=y -# CONFIG_MT753X_GSW is not set +CONFIG_MT753X_GSW=y CONFIG_MTD_NAND_CORE=y CONFIG_MTD_NAND_ECC_SW_HAMMING=y CONFIG_MTD_NAND_MTK=y @@ -402,6 +413,12 @@ CONFIG_MTD_SPI_NAND=y CONFIG_MTD_SPI_NOR=y CONFIG_MTD_SPLIT_FIRMWARE=y CONFIG_MTD_SPLIT_FIT_FW=y +CONFIG_MTD_UBI=y +CONFIG_MTD_UBI_BEB_LIMIT=20 +CONFIG_MTD_UBI_BLOCK=y +# CONFIG_MTD_UBI_FASTMAP is not set +# CONFIG_MTD_UBI_GLUEBI is not set +CONFIG_MTD_UBI_WL_THRESHOLD=4096 # CONFIG_MTK_CMDQ is not set # CONFIG_MTK_CQDMA is not set CONFIG_MTK_EFUSE=y @@ -515,6 +532,7 @@ CONFIG_SERIAL_DEV_BUS=y CONFIG_SERIAL_DEV_CTRL_TTYPORT=y CONFIG_SERIAL_MCTRL_GPIO=y CONFIG_SERIAL_OF_PLATFORM=y +CONFIG_SGL_ALLOC=y CONFIG_SG_POOL=y CONFIG_SMP=y CONFIG_SPARSEMEM=y @@ -553,6 +571,11 @@ CONFIG_TIMER_OF=y CONFIG_TIMER_PROBE=y CONFIG_TREE_RCU=y CONFIG_TREE_SRCU=y +CONFIG_UBIFS_FS=y +CONFIG_UBIFS_FS_ADVANCED_COMPR=y +CONFIG_UBIFS_FS_LZO=y +CONFIG_UBIFS_FS_ZLIB=y +# CONFIG_UBIFS_FS_ZSTD is not set # CONFIG_UCLAMP_TASK is not set # CONFIG_UNMAP_KERNEL_AT_EL0 is not set CONFIG_USB=y @@ -570,4 +593,6 @@ CONFIG_WATCHDOG_PRETIMEOUT_GOV_PANIC=y CONFIG_WATCHDOG_PRETIMEOUT_GOV_SEL=m CONFIG_WATCHDOG_SYSFS=y CONFIG_XPS=y +CONFIG_ZLIB_DEFLATE=y +CONFIG_ZLIB_INFLATE=y CONFIG_ZONE_DMA32=y From eff87b8f9350ee49c572b1b048f1361e8ff23fef Mon Sep 17 00:00:00 2001 From: John Crispin Date: Thu, 16 Jul 2020 09:18:28 +0200 Subject: [PATCH 25/28] mediatek: backport latest pci/e driver from upstream Signed-off-by: John Crispin --- .../mt7622-bananapi-bpi-r64-rootdisk.dts | 20 +- .../mediatek/mt7622-elecom-wrc-2533gent.dts | 21 +- .../boot/dts/mediatek/mt7622-rfb1-ubi.dts | 646 ++++++++++++++++++ ...ngs-PCI-Mediatek-Update-PCIe-binding.patch | 420 ++++++++++++ ...e-regmap-to-get-shared-pcie-cfg-base.patch | 219 ++++++ ...ek-Split-PCIe-node-for-MT2712-MT7622.patch | 423 ++++++++++++ ...dts-mediatek-Update-mt7629-PCIe-node.patch | 207 ++++++ 7 files changed, 1932 insertions(+), 24 deletions(-) create mode 100644 target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7622-rfb1-ubi.dts create mode 100755 target/linux/mediatek/patches-5.4/0991-dt-bindings-PCI-Mediatek-Update-PCIe-binding.patch create mode 100755 target/linux/mediatek/patches-5.4/0992-PCI-mediatek-Use-regmap-to-get-shared-pcie-cfg-base.patch create mode 100755 target/linux/mediatek/patches-5.4/0993-arm64-dts-mediatek-Split-PCIe-node-for-MT2712-MT7622.patch create mode 100755 target/linux/mediatek/patches-5.4/0994-ARM-dts-mediatek-Update-mt7629-PCIe-node.patch diff --git a/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64-rootdisk.dts b/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64-rootdisk.dts index 6a14ef369b..1638867604 100644 --- a/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64-rootdisk.dts +++ b/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64-rootdisk.dts @@ -257,18 +257,16 @@ }; }; -&pcie { - pinctrl-names = "default"; - pinctrl-0 = <&pcie0_pins>, <&pcie1_pins>; - status = "okay"; +&pcie0 { + pinctrl-names = "default"; + pinctrl-0 = <&pcie0_pins>; + status = "okay"; +}; - pcie@0,0 { - status = "okay"; - }; - - pcie@1,0 { - status = "okay"; - }; +&pcie1 { + pinctrl-names = "default"; + pinctrl-0 = <&pcie1_pins>; + status = "okay"; }; &pio { diff --git a/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7622-elecom-wrc-2533gent.dts b/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7622-elecom-wrc-2533gent.dts index 224214e083..d905edc94f 100644 --- a/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7622-elecom-wrc-2533gent.dts +++ b/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7622-elecom-wrc-2533gent.dts @@ -165,19 +165,14 @@ }; }; -&pcie { - pinctrl-names = "default", "pcie1_pins"; - pinctrl-0 = <&pcie0_pins>; - pinctrl-1 = <&pcie1_pins>; - status = "okay"; - - pcie@0,0 { - status = "okay"; - mt7615@0,0 { - reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x05000>; - }; - }; +&pcie0 { + pinctrl-names = "default"; + pinctrl-0 = <&pcie0_pins>; + status = "okay"; + mt7615@0,0 { + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x05000>; + }; }; &pio { diff --git a/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7622-rfb1-ubi.dts b/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7622-rfb1-ubi.dts new file mode 100644 index 0000000000..f64a882370 --- /dev/null +++ b/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7622-rfb1-ubi.dts @@ -0,0 +1,646 @@ +/* + * Copyright (c) 2018 MediaTek Inc. + * Author: Ryder Lee + * + * SPDX-License-Identifier: (GPL-2.0 OR MIT) + */ + +/dts-v1/; +#include +#include + +#include "mt7622.dtsi" +#include "mt6380.dtsi" + +/ { + model = "MT7622_MT7531 RFB"; + compatible = "mediatek,mt7622,ubi"; + + aliases { + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + bootargs = "earlycon=uart8250,mmio32,0x11002000 console=ttyS0,115200n1 swiotlb=512"; + }; + + cpus { + cpu@0 { + proc-supply = <&mt6380_vcpu_reg>; + sram-supply = <&mt6380_vm_reg>; + }; + + cpu@1 { + proc-supply = <&mt6380_vcpu_reg>; + sram-supply = <&mt6380_vm_reg>; + }; + }; + + gpio-keys { + compatible = "gpio-keys"; + + factory { + label = "factory"; + linux,code = ; + gpios = <&pio 0 GPIO_ACTIVE_HIGH>; + }; + + wps { + label = "wps"; + linux,code = ; + gpios = <&pio 102 GPIO_ACTIVE_HIGH>; + }; + }; + + gsw: gsw@0 { + compatible = "mediatek,mt753x"; + mediatek,ethsys = <ðsys>; + #address-cells = <1>; + #size-cells = <0>; + }; + + leds { + compatible = "gpio-leds"; + + green { + label = "bpi-r64:pio:green"; + gpios = <&pio 89 GPIO_ACTIVE_HIGH>; + default-state = "off"; + }; + + red { + label = "bpi-r64:pio:red"; + gpios = <&pio 88 GPIO_ACTIVE_HIGH>; + default-state = "off"; + }; + }; + + memory { + reg = <0 0x40000000 0 0x40000000>; + }; + + reg_1p8v: regulator-1p8v { + compatible = "regulator-fixed"; + regulator-name = "fixed-1.8V"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + }; + + reg_3p3v: regulator-3p3v { + compatible = "regulator-fixed"; + regulator-name = "fixed-3.3V"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + regulator-always-on; + }; + + reg_5v: regulator-5v { + compatible = "regulator-fixed"; + regulator-name = "fixed-5V"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + regulator-boot-on; + regulator-always-on; + }; +}; + +&bch { + status = "okay"; +}; + +&btif { + status = "okay"; +}; + +&cir { + pinctrl-names = "default"; + pinctrl-0 = <&irrx_pins>; + status = "okay"; +}; + +ð { + status = "okay"; + gmac0: mac@0 { + compatible = "mediatek,eth-mac"; + reg = <0>; + phy-mode = "2500base-x"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + + gmac1: mac@1 { + compatible = "mediatek,eth-mac"; + reg = <1>; + phy-mode = "rgmii"; + + fixed-link { + speed = <1000>; + full-duplex; + pause; + }; + }; + + mdio: mdio-bus { + #address-cells = <1>; + #size-cells = <0>; + }; +}; + +&gsw { + mediatek,mdio = <&mdio>; + mediatek,portmap = "llllw"; + mediatek,mdio_master_pinmux = <0>; + reset-gpios = <&pio 54 0>; + interrupt-parent = <&pio>; + interrupts = <53 IRQ_TYPE_LEVEL_HIGH>; + status = "okay"; + + port5: port@5 { + compatible = "mediatek,mt753x-port"; + reg = <5>; + phy-mode = "rgmii"; + fixed-link { + speed = <1000>; + full-duplex; + }; + }; + + port6: port@6 { + compatible = "mediatek,mt753x-port"; + reg = <6>; + phy-mode = "sgmii"; + fixed-link { + speed = <2500>; + full-duplex; + }; + }; +}; + +&i2c1 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c1_pins>; + status = "okay"; +}; + +&i2c2 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c2_pins>; + status = "okay"; +}; + +&mmc0 { + pinctrl-names = "default", "state_uhs"; + pinctrl-0 = <&emmc_pins_default>; + pinctrl-1 = <&emmc_pins_uhs>; + status = "okay"; + bus-width = <8>; + max-frequency = <50000000>; + cap-mmc-highspeed; + mmc-hs200-1_8v; + vmmc-supply = <®_3p3v>; + vqmmc-supply = <®_1p8v>; + assigned-clocks = <&topckgen CLK_TOP_MSDC30_0_SEL>; + assigned-clock-parents = <&topckgen CLK_TOP_UNIV48M>; + non-removable; +}; + +&mmc1 { + pinctrl-names = "default", "state_uhs"; + pinctrl-0 = <&sd0_pins_default>; + pinctrl-1 = <&sd0_pins_uhs>; + status = "okay"; + bus-width = <4>; + max-frequency = <50000000>; + cap-sd-highspeed; + r_smpl = <1>; + cd-gpios = <&pio 81 GPIO_ACTIVE_LOW>; + vmmc-supply = <®_3p3v>; + vqmmc-supply = <®_3p3v>; + assigned-clocks = <&topckgen CLK_TOP_MSDC30_1_SEL>; + assigned-clock-parents = <&topckgen CLK_TOP_UNIV48M>; +}; + +&nandc { + pinctrl-names = "default"; + pinctrl-0 = <¶llel_nand_pins>; + status = "disabled"; +}; + +&nor_flash { + pinctrl-names = "default"; + pinctrl-0 = <&spi_nor_pins>; + status = "disabled"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + }; +}; + +&pcie0 { + pinctrl-names = "default"; + pinctrl-0 = <&pcie0_pins>; + status = "okay"; +}; + +&pcie1 { + pinctrl-names = "default"; + pinctrl-0 = <&pcie1_pins>; + status = "okay"; +}; + +&pio { + /* Attention: GPIO 90 is used to switch between PCIe@1,0 and + * SATA functions. i.e. output-high: PCIe, output-low: SATA + */ + asm_sel { + gpio-hog; + gpios = <90 GPIO_ACTIVE_HIGH>; + output-high; + }; + + /* eMMC is shared pin with parallel NAND */ + emmc_pins_default: emmc-pins-default { + mux { + function = "emmc", "emmc_rst"; + groups = "emmc"; + }; + + /* "NDL0","NDL1","NDL2","NDL3","NDL4","NDL5","NDL6","NDL7", + * "NRB","NCLE" pins are used as DAT0,DAT1,DAT2,DAT3,DAT4, + * DAT5,DAT6,DAT7,CMD,CLK for eMMC respectively + */ + conf-cmd-dat { + pins = "NDL0", "NDL1", "NDL2", + "NDL3", "NDL4", "NDL5", + "NDL6", "NDL7", "NRB"; + input-enable; + bias-pull-up; + }; + + conf-clk { + pins = "NCLE"; + bias-pull-down; + }; + }; + + emmc_pins_uhs: emmc-pins-uhs { + mux { + function = "emmc"; + groups = "emmc"; + }; + + conf-cmd-dat { + pins = "NDL0", "NDL1", "NDL2", + "NDL3", "NDL4", "NDL5", + "NDL6", "NDL7", "NRB"; + input-enable; + drive-strength = <4>; + bias-pull-up; + }; + + conf-clk { + pins = "NCLE"; + drive-strength = <4>; + bias-pull-down; + }; + }; + + eth_pins: eth-pins { + mux { + function = "eth"; + groups = "mdc_mdio", "rgmii_via_gmac2"; + }; + }; + + i2c1_pins: i2c1-pins { + mux { + function = "i2c"; + groups = "i2c1_0"; + }; + }; + + i2c2_pins: i2c2-pins { + mux { + function = "i2c"; + groups = "i2c2_0"; + }; + }; + + i2s1_pins: i2s1-pins { + mux { + function = "i2s"; + groups = "i2s_out_mclk_bclk_ws", + "i2s1_in_data", + "i2s1_out_data"; + }; + + conf { + pins = "I2S1_IN", "I2S1_OUT", "I2S_BCLK", + "I2S_WS", "I2S_MCLK"; + drive-strength = <12>; + bias-pull-down; + }; + }; + + irrx_pins: irrx-pins { + mux { + function = "ir"; + groups = "ir_1_rx"; + }; + }; + + irtx_pins: irtx-pins { + mux { + function = "ir"; + groups = "ir_1_tx"; + }; + }; + + /* Parallel nand is shared pin with eMMC */ + parallel_nand_pins: parallel-nand-pins { + mux { + function = "flash"; + groups = "par_nand"; + }; + }; + + pcie0_pins: pcie0-pins { + mux { + function = "pcie"; + groups = "pcie0_pad_perst", + "pcie0_1_waken", + "pcie0_1_clkreq"; + }; + }; + + pcie1_pins: pcie1-pins { + mux { + function = "pcie"; + groups = "pcie1_pad_perst", + "pcie1_0_waken", + "pcie1_0_clkreq"; + }; + }; + + pmic_bus_pins: pmic-bus-pins { + mux { + function = "pmic"; + groups = "pmic_bus"; + }; + }; + + pwm7_pins: pwm1-2-pins { + mux { + function = "pwm"; + groups = "pwm_ch7_2"; + }; + }; + + wled_pins: wled-pins { + mux { + function = "led"; + groups = "wled"; + }; + }; + + sd0_pins_default: sd0-pins-default { + mux { + function = "sd"; + groups = "sd_0"; + }; + + /* "I2S2_OUT, "I2S4_IN"", "I2S3_IN", "I2S2_IN", + * "I2S4_OUT", "I2S3_OUT" are used as DAT0, DAT1, + * DAT2, DAT3, CMD, CLK for SD respectively. + */ + conf-cmd-data { + pins = "I2S2_OUT", "I2S4_IN", "I2S3_IN", + "I2S2_IN","I2S4_OUT"; + input-enable; + drive-strength = <8>; + bias-pull-up; + }; + conf-clk { + pins = "I2S3_OUT"; + drive-strength = <12>; + bias-pull-down; + }; + conf-cd { + pins = "TXD3"; + bias-pull-up; + }; + }; + + sd0_pins_uhs: sd0-pins-uhs { + mux { + function = "sd"; + groups = "sd_0"; + }; + + conf-cmd-data { + pins = "I2S2_OUT", "I2S4_IN", "I2S3_IN", + "I2S2_IN","I2S4_OUT"; + input-enable; + bias-pull-up; + }; + + conf-clk { + pins = "I2S3_OUT"; + bias-pull-down; + }; + }; + + /* Serial NAND is shared pin with SPI-NOR */ + serial_nand_pins: serial-nand-pins { + mux { + function = "flash"; + groups = "snfi"; + }; + }; + + spic0_pins: spic0-pins { + mux { + function = "spi"; + groups = "spic0_0"; + }; + }; + + spic1_pins: spic1-pins { + mux { + function = "spi"; + groups = "spic1_0"; + }; + }; + + /* SPI-NOR is shared pin with serial NAND */ + spi_nor_pins: spi-nor-pins { + mux { + function = "flash"; + groups = "spi_nor"; + }; + }; + + /* serial NAND is shared pin with SPI-NOR */ + serial_nand_pins: serial-nand-pins { + mux { + function = "flash"; + groups = "snfi"; + }; + }; + + uart0_pins: uart0-pins { + mux { + function = "uart"; + groups = "uart0_0_tx_rx" ; + }; + }; + + uart2_pins: uart2-pins { + mux { + function = "uart"; + groups = "uart2_1_tx_rx" ; + }; + }; + + watchdog_pins: watchdog-pins { + mux { + function = "watchdog"; + groups = "watchdog"; + }; + }; +}; + +&pwm { + pinctrl-names = "default"; + pinctrl-0 = <&pwm7_pins>; + status = "okay"; +}; + +&pwrap { + pinctrl-names = "default"; + pinctrl-0 = <&pmic_bus_pins>; + + status = "okay"; +}; + +&sata { + status = "disable"; +}; + +&sata_phy { + status = "disable"; +}; + +&snfi { + pinctrl-names = "default"; + pinctrl-0 = <&serial_nand_pins>; + status = "okay"; + + spi_nand@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "spi-nand"; + spi-max-frequency = <104000000>; + reg = <0>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "Preloader"; + reg = <0x00000 0x0080000>; + read-only; + }; + + partition@80000 { + label = "ATF"; + reg = <0x80000 0x0040000>; + }; + + partition@c0000 { + label = "Bootloader"; + reg = <0xc0000 0x0080000>; + }; + + partition@140000 { + label = "Config"; + reg = <0x140000 0x0080000>; + }; + + factory: partition@1c0000 { + label = "Factory"; + reg = <0x1c0000 0x0040000>; + }; + + partition@200000 { + label = "kernel"; + reg = <0x200000 0x400000>; + }; + + partition@600000 { + label = "ubi"; + reg = <0x600000 0x1C00000>; + }; + + partition@2200000 { + label = "User_data"; + reg = <0x2200000 0x4000000>; + }; + }; + }; +}; + +&spi0 { + pinctrl-names = "default"; + pinctrl-0 = <&spic0_pins>; + status = "okay"; +}; + +&spi1 { + pinctrl-names = "default"; + pinctrl-0 = <&spic1_pins>; + status = "okay"; +}; + +&ssusb { + vusb33-supply = <®_3p3v>; + vbus-supply = <®_5v>; + status = "okay"; +}; + +&u3phy { + status = "okay"; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins>; + status = "okay"; +}; + +&uart2 { + pinctrl-names = "default"; + pinctrl-0 = <&uart2_pins>; + status = "okay"; +}; + +&watchdog { + pinctrl-names = "default"; + pinctrl-0 = <&watchdog_pins>; + status = "okay"; +}; + +&wmac { + mediatek,mtd-eeprom = <&factory 0x0000>; + status = "okay"; +}; diff --git a/target/linux/mediatek/patches-5.4/0991-dt-bindings-PCI-Mediatek-Update-PCIe-binding.patch b/target/linux/mediatek/patches-5.4/0991-dt-bindings-PCI-Mediatek-Update-PCIe-binding.patch new file mode 100755 index 0000000000..2c7e311836 --- /dev/null +++ b/target/linux/mediatek/patches-5.4/0991-dt-bindings-PCI-Mediatek-Update-PCIe-binding.patch @@ -0,0 +1,420 @@ +From patchwork Thu May 28 06:16:45 2020 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Chuanjia Liu +X-Patchwork-Id: 11574793 +Return-Path: + +Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org + [172.30.200.123]) + by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 391201392 + for ; + Thu, 28 May 2020 06:20:27 +0000 (UTC) +Received: from bombadil.infradead.org (bombadil.infradead.org + [198.137.202.133]) + (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) + (No client certificate requested) + by mail.kernel.org (Postfix) with ESMTPS id 104F620657 + for ; + Thu, 28 May 2020 06:20:27 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=pass (2048-bit key) header.d=lists.infradead.org + header.i=@lists.infradead.org header.b="raZHaWxs"; + dkim=fail reason="signature verification failed" (1024-bit key) + header.d=mediatek.com header.i=@mediatek.com header.b="YztrByG/" +DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 104F620657 +Authentication-Results: mail.kernel.org; + dmarc=fail (p=none dis=none) header.from=mediatek.com +Authentication-Results: mail.kernel.org; + spf=none + smtp.mailfrom=linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org +DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; + d=lists.infradead.org; s=bombadil.20170209; h=Sender: + Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: + List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: + Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: + Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: + List-Owner; bh=aVtKU+Ey8KEM97+S66fz9ZMo+H8BP570jhAAvaRsNWc=; b=raZHaWxsfCxsrd + Byn/w1oLN/J82ApnNdBBXixq9Qj0uXIU2tBVqkiQ9lG6QDk7uguxQSJLeTqrsI/uxQmCI/PGQtZdP + sH0oboi2sbQSqJ/1ud4uL2pPaiLRJCxINF5oWjoZMsjn/b2fWvn52P6vTr/dxDTaabiVhY0HL0J+X + 7YGc1aYtO76HZHE2ke3puR42QkI8hE9E2cEhiLWeuUiLdUBegNM5MdYftu4nJTcCXnAeJjp/wIpYG + 7X737N9cmanDf6Bxr2bNPgaYzH+m7JK6eGxuAvWo0+PE9OX7MLrXY3KjixcjD/b0he0mfEM++gBAq + KBYKl5wh1mnlR2WIWXew==; +Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) + by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) + id 1jeBtx-0005JC-DJ; Thu, 28 May 2020 06:20:25 +0000 +Received: from mailgw01.mediatek.com ([216.200.240.184]) + by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) + id 1jeBtW-0002f2-75; Thu, 28 May 2020 06:20:01 +0000 +X-UUID: d5cb6d96c2a5421796c2f8a284ff3670-20200527 +DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; + d=mediatek.com; + s=dk; + h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; + bh=EqjC+5cHgv6eykN7FPf2mtwK9UivJ3XSCE0jEvb8h+8=; + b=YztrByG/Ia304l9KDPBwoHFYkFCN6qBXPqwZgg56CA9VitadAg2+K1VgfEU+oHqsqcsGAMdZTRMQh17tpm4bJParw6MMzAQ28te2TcxvQMV8PZMkerJdZyyYblI7ybauPWuofAQgQMtuwSKVii8eTRJbf99OZ9vDGJP3zo2j1wU=; +X-UUID: d5cb6d96c2a5421796c2f8a284ff3670-20200527 +Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by + mailgw01.mediatek.com + (envelope-from ) + (musrelay.mediatek.com ESMTP with TLS) + with ESMTP id 681958707; Wed, 27 May 2020 22:20:16 -0800 +Received: from MTKMBS07N2.mediatek.inc (172.21.101.141) by + MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id + 15.0.1497.2; Wed, 27 May 2020 23:18:52 -0700 +Received: from mtkcas07.mediatek.inc (172.21.101.84) by + mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id + 15.0.1497.2; Thu, 28 May 2020 14:18:49 +0800 +Received: from localhost.localdomain (10.17.3.153) by mtkcas07.mediatek.inc + (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend + Transport; Thu, 28 May 2020 14:18:47 +0800 +From: +To: , , +Subject: [PATCH v2 1/4] dt-bindings: PCI: Mediatek: Update PCIe binding +Date: Thu, 28 May 2020 14:16:45 +0800 +Message-ID: <20200528061648.32078-2-chuanjia.liu@mediatek.com> +X-Mailer: git-send-email 2.18.0 +In-Reply-To: <20200528061648.32078-1-chuanjia.liu@mediatek.com> +References: <20200528061648.32078-1-chuanjia.liu@mediatek.com> +MIME-Version: 1.0 +X-MTK: N +X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 +X-CRM114-CacheID: sfid-20200527_231958_261064_608CC03E +X-CRM114-Status: GOOD ( 13.95 ) +X-Spam-Score: -0.2 (/) +X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: + Content analysis details: (-0.2 points) + pts rule name description + ---- ---------------------- + -------------------------------------------------- + -0.0 SPF_PASS SPF: sender matches SPF record + 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record + 0.0 MIME_BASE64_TEXT RAW: Message text disguised using base64 + encoding + -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from + author's domain + 0.1 DKIM_SIGNED Message has a DKIM or DK signature, + not necessarily + valid + -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature + -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from + envelope-from domain + 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay + lines +X-BeenThere: linux-mediatek@lists.infradead.org +X-Mailman-Version: 2.1.29 +Precedence: list +List-Id: +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +Cc: devicetree@vger.kernel.org, lorenzo.pieralisi@arm.com, + srv_heupstream@mediatek.com, "chuanjia.liu" , + linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, + jianjun.wang@mediatek.com, linux-mediatek@lists.infradead.org, + yong.wu@mediatek.com, bhelgaas@google.com, + linux-arm-kernel@lists.infradead.org, amurray@thegoodpenguin.co.uk +Sender: "Linux-mediatek" +Errors-To: + linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org + +From: "chuanjia.liu" + +There are two independent PCIe controllers in MT2712/MT7622 platform, +and each of them should contain an independent MSI domain. + +In current architecture, MSI domain will be inherited from the root +bridge, and all of the devices will share the same MSI domain. +Hence that, the PCIe devices will not work properly if the irq number +which required is more than 32. + +Split the PCIe node for MT2712/MT7622 platform to fix MSI issue and +comply with the hardware design. + +Signed-off-by: chuanjia.liu +--- + .../bindings/pci/mediatek-pcie-cfg.yaml | 38 +++++ + .../devicetree/bindings/pci/mediatek-pcie.txt | 144 +++++++++++------- + 2 files changed, 129 insertions(+), 53 deletions(-) + create mode 100644 Documentation/devicetree/bindings/pci/mediatek-pcie-cfg.yaml + +diff --git a/Documentation/devicetree/bindings/pci/mediatek-pcie-cfg.yaml b/Documentation/devicetree/bindings/pci/mediatek-pcie-cfg.yaml +new file mode 100644 +index 000000000000..4d2835ab4858 +--- /dev/null ++++ b/Documentation/devicetree/bindings/pci/mediatek-pcie-cfg.yaml +@@ -0,0 +1,38 @@ ++# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause ++%YAML 1.2 ++--- ++$id: http://devicetree.org/schemas/pci/mediatek-pcie-cfg.yaml# ++$schema: http://devicetree.org/meta-schemas/core.yaml# ++ ++title: Mediatek PCIECFG controller ++ ++maintainers: ++ - Chuanjia Liu ++ - Jianjun Wang ++ ++description: | ++ The MediaTek PCIECFG controller controls some feature about ++ LTSSM, ASPM and so on. ++ ++properties: ++ compatible: ++ items: ++ - enum: ++ - mediatek,mt7622-pciecfg ++ - mediatek,mt7629-pciecfg ++ - const: syscon ++ ++ reg: ++ maxItems: 1 ++ ++required: ++ - compatible ++ - reg ++ ++examples: ++ - | ++ pciecfg: pciecfg@1a140000 { ++ compatible = "mediatek,mt7622-pciecfg", "syscon"; ++ reg = <0 0x1a140000 0 0x1000>; ++ }; ++... +diff --git a/Documentation/devicetree/bindings/pci/mediatek-pcie.txt b/Documentation/devicetree/bindings/pci/mediatek-pcie.txt +index 7468d666763a..ddae110d4379 100644 +--- a/Documentation/devicetree/bindings/pci/mediatek-pcie.txt ++++ b/Documentation/devicetree/bindings/pci/mediatek-pcie.txt +@@ -8,7 +8,7 @@ Required properties: + "mediatek,mt7623-pcie" + "mediatek,mt7629-pcie" + - device_type: Must be "pci" +-- reg: Base addresses and lengths of the PCIe subsys and root ports. ++- reg: Base addresses and lengths of the root ports. + - reg-names: Names of the above areas to use during resource lookup. + - #address-cells: Address representation for root ports (must be 3) + - #size-cells: Size representation for root ports (must be 2) +@@ -19,10 +19,10 @@ Required properties: + - sys_ckN :transaction layer and data link layer clock + Required entries for MT2701/MT7623: + - free_ck :for reference clock of PCIe subsys +- Required entries for MT2712/MT7622: ++ Required entries for MT2712/MT7622/MT7629: + - ahb_ckN :AHB slave interface operating clock for CSR access and RC + initiated MMIO access +- Required entries for MT7622: ++ Required entries for MT7622/MT7629: + - axi_ckN :application layer MMIO channel operating clock + - aux_ckN :pe2_mac_bridge and pe2_mac_core operating clock when + pcie_mac_ck/pcie_pipe_ck is turned off +@@ -47,10 +47,13 @@ Required properties for MT7623/MT2701: + - reset-names: Must be "pcie-rst0", "pcie-rst1", "pcie-rstN".. based on the + number of root ports. + +-Required properties for MT2712/MT7622: ++Required properties for MT2712/MT7622/MT7629: + -interrupts: A list of interrupt outputs of the controller, must have one + entry for each PCIe port + ++Required properties for MT7622/MT7629: ++- mediatek,pcie-subsys: Should be a phandle of the pciecfg node. ++ + In addition, the device tree node must have sub-nodes describing each + PCIe port interface, having the following mandatory properties: + +@@ -143,56 +146,73 @@ Examples for MT7623: + + Examples for MT2712: + +- pcie: pcie@11700000 { ++ pcie1: pcie@112ff000 { + compatible = "mediatek,mt2712-pcie"; + device_type = "pci"; +- reg = <0 0x11700000 0 0x1000>, +- <0 0x112ff000 0 0x1000>; +- reg-names = "port0", "port1"; ++ reg = <0 0x112ff000 0 0x1000>; ++ reg-names = "port1"; + #address-cells = <3>; + #size-cells = <2>; +- interrupts = , +- ; +- clocks = <&topckgen CLK_TOP_PE2_MAC_P0_SEL>, +- <&topckgen CLK_TOP_PE2_MAC_P1_SEL>, +- <&pericfg CLK_PERI_PCIE0>, ++ interrupts = ; ++ interrupt-names = "pcie_irq"; ++ clocks = <&topckgen CLK_TOP_PE2_MAC_P1_SEL>, + <&pericfg CLK_PERI_PCIE1>; +- clock-names = "sys_ck0", "sys_ck1", "ahb_ck0", "ahb_ck1"; +- phys = <&pcie0_phy PHY_TYPE_PCIE>, <&pcie1_phy PHY_TYPE_PCIE>; +- phy-names = "pcie-phy0", "pcie-phy1"; ++ clock-names = "sys_ck1", "ahb_ck1"; ++ phys = <&u3port1 PHY_TYPE_PCIE>; ++ phy-names = "pcie-phy1"; + bus-range = <0x00 0xff>; +- ranges = <0x82000000 0 0x20000000 0x0 0x20000000 0 0x10000000>; ++ ranges = <0x82000000 0 0x11400000 0x0 0x11400000 0 0x300000>; ++ status = "disabled"; + +- pcie0: pcie@0,0 { +- reg = <0x0000 0 0 0 0>; ++ slot1: pcie@1,0 { ++ reg = <0x0800 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + #interrupt-cells = <1>; + ranges; + interrupt-map-mask = <0 0 0 7>; +- interrupt-map = <0 0 0 1 &pcie_intc0 0>, +- <0 0 0 2 &pcie_intc0 1>, +- <0 0 0 3 &pcie_intc0 2>, +- <0 0 0 4 &pcie_intc0 3>; +- pcie_intc0: interrupt-controller { ++ interrupt-map = <0 0 0 1 &pcie_intc1 0>, ++ <0 0 0 2 &pcie_intc1 1>, ++ <0 0 0 3 &pcie_intc1 2>, ++ <0 0 0 4 &pcie_intc1 3>; ++ pcie_intc1: interrupt-controller { + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <1>; + }; + }; ++ }; + +- pcie1: pcie@1,0 { +- reg = <0x0800 0 0 0 0>; ++ pcie0: pcie@11700000 { ++ compatible = "mediatek,mt2712-pcie"; ++ device_type = "pci"; ++ reg = <0 0x11700000 0 0x1000>; ++ reg-names = "port0"; ++ #address-cells = <3>; ++ #size-cells = <2>; ++ interrupts = ; ++ interrupt-names = "pcie_irq"; ++ clocks = <&topckgen CLK_TOP_PE2_MAC_P0_SEL>, ++ <&pericfg CLK_PERI_PCIE0>; ++ clock-names = "sys_ck0", "ahb_ck0"; ++ phys = <&u3port0 PHY_TYPE_PCIE>; ++ phy-names = "pcie-phy0"; ++ bus-range = <0x00 0xff>; ++ ranges = <0x82000000 0 0x20000000 0x0 0x20000000 0 0x10000000>; ++ status = "disabled"; ++ ++ slot0: pcie@0,0 { ++ reg = <0x0000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + #interrupt-cells = <1>; + ranges; + interrupt-map-mask = <0 0 0 7>; +- interrupt-map = <0 0 0 1 &pcie_intc1 0>, +- <0 0 0 2 &pcie_intc1 1>, +- <0 0 0 3 &pcie_intc1 2>, +- <0 0 0 4 &pcie_intc1 3>; +- pcie_intc1: interrupt-controller { ++ interrupt-map = <0 0 0 1 &pcie_intc0 0>, ++ <0 0 0 2 &pcie_intc0 1>, ++ <0 0 0 3 &pcie_intc0 2>, ++ <0 0 0 4 &pcie_intc0 3>; ++ pcie_intc0: interrupt-controller { + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <1>; +@@ -202,39 +222,31 @@ Examples for MT2712: + + Examples for MT7622: + +- pcie: pcie@1a140000 { ++ pcie0: pcie@1a143000 { + compatible = "mediatek,mt7622-pcie"; + device_type = "pci"; +- reg = <0 0x1a140000 0 0x1000>, +- <0 0x1a143000 0 0x1000>, +- <0 0x1a145000 0 0x1000>; +- reg-names = "subsys", "port0", "port1"; ++ reg = <0 0x1a143000 0 0x1000>; ++ reg-names = "port0"; ++ mediatek,pcie-cfg = <&pciecfg>; + #address-cells = <3>; + #size-cells = <2>; +- interrupts = , +- ; ++ interrupts = ; ++ interrupt-names = "pcie_irq"; + clocks = <&pciesys CLK_PCIE_P0_MAC_EN>, +- <&pciesys CLK_PCIE_P1_MAC_EN>, + <&pciesys CLK_PCIE_P0_AHB_EN>, +- <&pciesys CLK_PCIE_P1_AHB_EN>, + <&pciesys CLK_PCIE_P0_AUX_EN>, +- <&pciesys CLK_PCIE_P1_AUX_EN>, + <&pciesys CLK_PCIE_P0_AXI_EN>, +- <&pciesys CLK_PCIE_P1_AXI_EN>, + <&pciesys CLK_PCIE_P0_OBFF_EN>, +- <&pciesys CLK_PCIE_P1_OBFF_EN>, +- <&pciesys CLK_PCIE_P0_PIPE_EN>, +- <&pciesys CLK_PCIE_P1_PIPE_EN>; +- clock-names = "sys_ck0", "sys_ck1", "ahb_ck0", "ahb_ck1", +- "aux_ck0", "aux_ck1", "axi_ck0", "axi_ck1", +- "obff_ck0", "obff_ck1", "pipe_ck0", "pipe_ck1"; +- phys = <&pcie0_phy PHY_TYPE_PCIE>, <&pcie1_phy PHY_TYPE_PCIE>; +- phy-names = "pcie-phy0", "pcie-phy1"; ++ <&pciesys CLK_PCIE_P0_PIPE_EN>; ++ clock-names = "sys_ck0", "ahb_ck0", "aux_ck0", ++ "axi_ck0", "obff_ck0", "pipe_ck0"; ++ + power-domains = <&scpsys MT7622_POWER_DOMAIN_HIF0>; + bus-range = <0x00 0xff>; +- ranges = <0x82000000 0 0x20000000 0x0 0x20000000 0 0x10000000>; ++ ranges = <0x82000000 0 0x20000000 0 0x20000000 0 0x8000000>; ++ status = "disabled"; + +- pcie0: pcie@0,0 { ++ slot0: pcie@0,0 { + reg = <0x0000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; +@@ -251,8 +263,34 @@ Examples for MT7622: + #interrupt-cells = <1>; + }; + }; ++ }; ++ ++ pcie1: pcie@1a145000 { ++ compatible = "mediatek,mt7622-pcie"; ++ device_type = "pci"; ++ reg = <0 0x1a145000 0 0x1000>; ++ reg-names = "port1"; ++ mediatek,pcie-cfg = <&pciecfg>; ++ #address-cells = <3>; ++ #size-cells = <2>; ++ interrupts = ; ++ interrupt-names = "pcie_irq"; ++ clocks = <&pciesys CLK_PCIE_P1_MAC_EN>, ++ /* designer has connect RC1 with p0_ahb clock */ ++ <&pciesys CLK_PCIE_P0_AHB_EN>, ++ <&pciesys CLK_PCIE_P1_AUX_EN>, ++ <&pciesys CLK_PCIE_P1_AXI_EN>, ++ <&pciesys CLK_PCIE_P1_OBFF_EN>, ++ <&pciesys CLK_PCIE_P1_PIPE_EN>; ++ clock-names = "sys_ck1", "ahb_ck1", "aux_ck1", ++ "axi_ck1", "obff_ck1", "pipe_ck1"; ++ ++ power-domains = <&scpsys MT7622_POWER_DOMAIN_HIF0>; ++ bus-range = <0x00 0xff>; ++ ranges = <0x82000000 0 0x28000000 0 0x28000000 0 0x8000000>; ++ status = "disabled"; + +- pcie1: pcie@1,0 { ++ slot1: pcie@1,0 { + reg = <0x0800 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; diff --git a/target/linux/mediatek/patches-5.4/0992-PCI-mediatek-Use-regmap-to-get-shared-pcie-cfg-base.patch b/target/linux/mediatek/patches-5.4/0992-PCI-mediatek-Use-regmap-to-get-shared-pcie-cfg-base.patch new file mode 100755 index 0000000000..e773e2e676 --- /dev/null +++ b/target/linux/mediatek/patches-5.4/0992-PCI-mediatek-Use-regmap-to-get-shared-pcie-cfg-base.patch @@ -0,0 +1,219 @@ +From patchwork Thu May 28 06:16:46 2020 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Chuanjia Liu +X-Patchwork-Id: 11574781 +Return-Path: + +Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org + [172.30.200.123]) + by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0A99B60D + for ; + Thu, 28 May 2020 06:19:04 +0000 (UTC) +Received: from bombadil.infradead.org (bombadil.infradead.org + [198.137.202.133]) + (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) + (No client certificate requested) + by mail.kernel.org (Postfix) with ESMTPS id DCC99208FE + for ; + Thu, 28 May 2020 06:19:03 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=pass (2048-bit key) header.d=lists.infradead.org + header.i=@lists.infradead.org header.b="SpOi0ueF"; + dkim=fail reason="signature verification failed" (1024-bit key) + header.d=mediatek.com header.i=@mediatek.com header.b="UGIBoIEG" +DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DCC99208FE +Authentication-Results: mail.kernel.org; + dmarc=fail (p=none dis=none) header.from=mediatek.com +Authentication-Results: mail.kernel.org; + spf=none + smtp.mailfrom=linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org +DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; + d=lists.infradead.org; s=bombadil.20170209; h=Sender: + Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: + List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: + Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: + Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: + List-Owner; bh=LIr5poLUT/UdH6/akh/pnICGGa3rUBkN+4FhE1DyOrU=; b=SpOi0ueFcoJ/ka + 4esa6cDd5oU4fp0z684ZVPaVvvhm/azSZBBMYinHaAW6EvzKcMNYIX9grP8eg/728lEPNTKVq0I8H + PQZ9KvD4uTu8Opo1hD8LsRSLr+YLpNKt3KPOY/4gpwQ97uU9rI5PwkuAxPBgR949Vh5EiG0Vaww1H + Ep+I5BFRn2LVVQZP1Z7U0A0VUcOTLJ4znoWRLEXxtM9/Wd4hwQsrEPQszeDFti/RbwGfJ5efOb5UL + fhwBzSxELEzAAgH7env/XD2sSSpVf2Qsn6WO8D3ZepMtWrRtARiaRKSNxSBQTg2SSHcjmBSJSzcX+ + w8wqWaUMs0crlBuZWS1g==; +Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) + by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) + id 1jeBsc-0001tI-88; Thu, 28 May 2020 06:19:02 +0000 +Received: from mailgw01.mediatek.com ([216.200.240.184]) + by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) + id 1jeBsZ-0001rp-6g; Thu, 28 May 2020 06:19:01 +0000 +X-UUID: beeaf5765357439c91eab1f67ca7ef43-20200527 +DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; + d=mediatek.com; + s=dk; + h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; + bh=+IjWjsF/DhknqZB+lLSZ50cyvxDap+8w4tvqhp8Dv68=; + b=UGIBoIEGJUuq5pEvYEad1HVGpiv6yma+94hva83D2gD8lYmihRWkpJxB2yn+dVtNm7ZXXoQBf+jvvULOmslJgs1HZTLJTnjpdvLmQqo42OXRXSVpTE49HdRkJZDAIWIAReBfOEkFgNxcIX3uedrtnww/NLJ2lagrYPG5ET4lI2E=; +X-UUID: beeaf5765357439c91eab1f67ca7ef43-20200527 +Received: from mtkcas68.mediatek.inc [(172.29.94.19)] by mailgw01.mediatek.com + (envelope-from ) + (musrelay.mediatek.com ESMTP with TLS) + with ESMTP id 603406343; Wed, 27 May 2020 22:19:17 -0800 +Received: from mtkmbs07n1.mediatek.inc (172.21.101.16) by + MTKMBS62DR.mediatek.inc (172.29.94.18) with Microsoft SMTP Server (TLS) id + 15.0.1497.2; Wed, 27 May 2020 23:18:47 -0700 +Received: from mtkcas07.mediatek.inc (172.21.101.84) by + mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id + 15.0.1497.2; Thu, 28 May 2020 14:18:51 +0800 +Received: from localhost.localdomain (10.17.3.153) by mtkcas07.mediatek.inc + (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend + Transport; Thu, 28 May 2020 14:18:49 +0800 +From: +To: , , +Subject: [PATCH v2 2/4] PCI: mediatek: Use regmap to get shared pcie-cfg base +Date: Thu, 28 May 2020 14:16:46 +0800 +Message-ID: <20200528061648.32078-3-chuanjia.liu@mediatek.com> +X-Mailer: git-send-email 2.18.0 +In-Reply-To: <20200528061648.32078-1-chuanjia.liu@mediatek.com> +References: <20200528061648.32078-1-chuanjia.liu@mediatek.com> +MIME-Version: 1.0 +X-MTK: N +X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 +X-CRM114-CacheID: sfid-20200527_231859_251275_BED2B1E2 +X-CRM114-Status: GOOD ( 11.62 ) +X-Spam-Score: -0.2 (/) +X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: + Content analysis details: (-0.2 points) + pts rule name description + ---- ---------------------- + -------------------------------------------------- + -0.0 SPF_PASS SPF: sender matches SPF record + 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record + 0.0 MIME_BASE64_TEXT RAW: Message text disguised using base64 + encoding + -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from + author's domain + 0.1 DKIM_SIGNED Message has a DKIM or DK signature, + not necessarily + valid + -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature + -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from + envelope-from domain + 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay + lines +X-BeenThere: linux-mediatek@lists.infradead.org +X-Mailman-Version: 2.1.29 +Precedence: list +List-Id: +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +Cc: devicetree@vger.kernel.org, lorenzo.pieralisi@arm.com, + srv_heupstream@mediatek.com, "chuanjia.liu" , + linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, + jianjun.wang@mediatek.com, linux-mediatek@lists.infradead.org, + yong.wu@mediatek.com, bhelgaas@google.com, + linux-arm-kernel@lists.infradead.org, amurray@thegoodpenguin.co.uk +Sender: "Linux-mediatek" +Errors-To: + linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org + +From: "chuanjia.liu" + +Use regmap to get shared pcie-cfg base and change +the method to get pcie irq. + +Signed-off-by: chuanjia.liu +--- + drivers/pci/controller/pcie-mediatek.c | 25 ++++++++++++++++++------- + 1 file changed, 18 insertions(+), 7 deletions(-) + +diff --git a/drivers/pci/controller/pcie-mediatek.c b/drivers/pci/controller/pcie-mediatek.c +index cb982891b22b..2268d6073eb6 100644 +--- a/drivers/pci/controller/pcie-mediatek.c ++++ b/drivers/pci/controller/pcie-mediatek.c +@@ -14,6 +14,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -23,6 +24,7 @@ + #include + #include + #include ++#include + #include + + #include "../pci.h" +@@ -205,6 +207,7 @@ struct mtk_pcie_port { + * struct mtk_pcie - PCIe host information + * @dev: pointer to PCIe device + * @base: IO mapped register base ++ * @cfg: IO mapped register map for PCIe config + * @free_ck: free-run reference clock + * @mem: non-prefetchable memory resource + * @ports: pointer to PCIe port information +@@ -214,6 +217,7 @@ struct mtk_pcie_port { + struct mtk_pcie { + struct device *dev; + void __iomem *base; ++ struct regmap *cfg; + struct clk *free_ck; + + struct list_head ports; +@@ -650,7 +654,7 @@ static int mtk_pcie_setup_irq(struct mtk_pcie_port *port, + return err; + } + +- port->irq = platform_get_irq(pdev, port->slot); ++ port->irq = platform_get_irq_byname(pdev, "pcie_irq"); + irq_set_chained_handler_and_data(port->irq, + mtk_pcie_intr_handler, port); + +@@ -673,12 +677,11 @@ static int mtk_pcie_startup_port_v2(struct mtk_pcie_port *port) + if (!mem) + return -EINVAL; + +- /* MT7622 platforms need to enable LTSSM and ASPM from PCIe subsys */ +- if (pcie->base) { +- val = readl(pcie->base + PCIE_SYS_CFG_V2); +- val |= PCIE_CSR_LTSSM_EN(port->slot) | +- PCIE_CSR_ASPM_L1_EN(port->slot); +- writel(val, pcie->base + PCIE_SYS_CFG_V2); ++ /* MT7622/MT7629 platforms need to enable LTSSM and ASPM. */ ++ if (pcie->cfg) { ++ val = PCIE_CSR_LTSSM_EN(port->slot) | ++ PCIE_CSR_ASPM_L1_EN(port->slot); ++ regmap_update_bits(pcie->cfg, PCIE_SYS_CFG_V2, val, val); + } + + /* Assert all reset signals */ +@@ -984,6 +987,7 @@ static int mtk_pcie_subsys_powerup(struct mtk_pcie *pcie) + struct device *dev = pcie->dev; + struct platform_device *pdev = to_platform_device(dev); + struct resource *regs; ++ struct device_node *cfg_node; + int err; + + /* get shared registers, which are optional */ +@@ -996,6 +1000,13 @@ static int mtk_pcie_subsys_powerup(struct mtk_pcie *pcie) + } + } + ++ cfg_node = of_parse_phandle(dev->of_node, "mediatek,pcie-cfg", 0); ++ if (cfg_node) { ++ pcie->cfg = syscon_node_to_regmap(cfg_node); ++ if (IS_ERR(pcie->cfg)) ++ return PTR_ERR(pcie->cfg); ++ } ++ + pcie->free_ck = devm_clk_get(dev, "free_ck"); + if (IS_ERR(pcie->free_ck)) { + if (PTR_ERR(pcie->free_ck) == -EPROBE_DEFER) diff --git a/target/linux/mediatek/patches-5.4/0993-arm64-dts-mediatek-Split-PCIe-node-for-MT2712-MT7622.patch b/target/linux/mediatek/patches-5.4/0993-arm64-dts-mediatek-Split-PCIe-node-for-MT2712-MT7622.patch new file mode 100755 index 0000000000..7d3c55c0e4 --- /dev/null +++ b/target/linux/mediatek/patches-5.4/0993-arm64-dts-mediatek-Split-PCIe-node-for-MT2712-MT7622.patch @@ -0,0 +1,423 @@ +From patchwork Thu May 28 06:16:47 2020 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Chuanjia Liu +X-Patchwork-Id: 11574785 +Return-Path: + +Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org + [172.30.200.123]) + by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 933301391 + for ; + Thu, 28 May 2020 06:19:16 +0000 (UTC) +Received: from bombadil.infradead.org (bombadil.infradead.org + [198.137.202.133]) + (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) + (No client certificate requested) + by mail.kernel.org (Postfix) with ESMTPS id D19F02078C + for ; + Thu, 28 May 2020 06:19:15 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=pass (2048-bit key) header.d=lists.infradead.org + header.i=@lists.infradead.org header.b="s8K7t7DF"; + dkim=fail reason="signature verification failed" (1024-bit key) + header.d=mediatek.com header.i=@mediatek.com header.b="RhX81Iqp" +DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D19F02078C +Authentication-Results: mail.kernel.org; + dmarc=fail (p=none dis=none) header.from=mediatek.com +Authentication-Results: mail.kernel.org; + spf=none + smtp.mailfrom=linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org +DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; + d=lists.infradead.org; s=bombadil.20170209; h=Sender: + Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: + List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: + Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: + Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: + List-Owner; bh=NHyHqNMcE7LW10MwduOJoKiWe8cv+XayY+L6WDZeSu0=; b=s8K7t7DFh1iQ5w + eGvuMRgXEQv/YWRuSZRyX8lx8R2H9IuawEIgkhO6lEo6xv0VdsRuj8SptfoWg5afCItMhih373M21 + 6sUy3tEiuKGgklfxLU0reLEkaATkKRGLJDY3eSSs1mvZDrydKuZLDTka+YDGaiESlOhqMr95Nm6YM + yK8O00qTwSRPJUILRsBv1e/Kz8NRCmYhs56snABJkKeJ51NRAkb20R6qGTEd6UyBlz3jTVYwluLgF + bdqzywDT6+BNg/Agh6Zd+v2PpO4cmwCpGm62+3UUyZkfi/aQ4qZ/AFAfSQI+3ZBAgsKMC1PGifOi/ + FgGxIvAUk6atBy7DAHuw==; +Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) + by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) + id 1jeBsn-00025C-EF; Thu, 28 May 2020 06:19:13 +0000 +Received: from mailgw01.mediatek.com ([216.200.240.184]) + by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) + id 1jeBsZ-0001s4-6j; Thu, 28 May 2020 06:19:01 +0000 +X-UUID: c6210e6371fa445db0ae40a8b8a7a0a1-20200527 +DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; + d=mediatek.com; + s=dk; + h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; + bh=X9AwTdbhpWmlWY4LjTm8KLq4Cca3YI9UnyCX3O0BAak=; + b=RhX81Iqp0mWhBDyMQMFSEtt23+DGAWoin1SrFGP1bzp6GEtu38b2pK5RJVBshJtuxi/a1uMXZjeDsHJn02VGdNA07FrzZ7jq6YYEL+8cJs2DnhySmNElZazXPv2vKu9TWygfilTT24h/u8V/eszuRuhkdoUKWol8LwDlPl9gskg=; +X-UUID: c6210e6371fa445db0ae40a8b8a7a0a1-20200527 +Received: from mtkcas68.mediatek.inc [(172.29.94.19)] by mailgw01.mediatek.com + (envelope-from ) + (musrelay.mediatek.com ESMTP with TLS) + with ESMTP id 7561992; Wed, 27 May 2020 22:19:17 -0800 +Received: from mtkmbs07n1.mediatek.inc (172.21.101.16) by + MTKMBS62DR.mediatek.inc (172.29.94.18) with Microsoft SMTP Server (TLS) id + 15.0.1497.2; Wed, 27 May 2020 23:18:47 -0700 +Received: from mtkcas07.mediatek.inc (172.21.101.84) by + mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id + 15.0.1497.2; Thu, 28 May 2020 14:18:52 +0800 +Received: from localhost.localdomain (10.17.3.153) by mtkcas07.mediatek.inc + (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend + Transport; Thu, 28 May 2020 14:18:51 +0800 +From: +To: , , +Subject: [PATCH v2 3/4] arm64: dts: mediatek: Split PCIe node for + MT2712/MT7622 +Date: Thu, 28 May 2020 14:16:47 +0800 +Message-ID: <20200528061648.32078-4-chuanjia.liu@mediatek.com> +X-Mailer: git-send-email 2.18.0 +In-Reply-To: <20200528061648.32078-1-chuanjia.liu@mediatek.com> +References: <20200528061648.32078-1-chuanjia.liu@mediatek.com> +MIME-Version: 1.0 +X-MTK: N +X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 +X-CRM114-CacheID: sfid-20200527_231859_253529_B6751C5A +X-CRM114-Status: GOOD ( 12.20 ) +X-Spam-Score: -0.2 (/) +X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: + Content analysis details: (-0.2 points) + pts rule name description + ---- ---------------------- + -------------------------------------------------- + -0.0 SPF_PASS SPF: sender matches SPF record + 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record + 0.0 MIME_BASE64_TEXT RAW: Message text disguised using base64 + encoding + -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from + author's domain + 0.1 DKIM_SIGNED Message has a DKIM or DK signature, + not necessarily + valid + -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature + -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from + envelope-from domain + 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay + lines +X-BeenThere: linux-mediatek@lists.infradead.org +X-Mailman-Version: 2.1.29 +Precedence: list +List-Id: +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +Cc: devicetree@vger.kernel.org, lorenzo.pieralisi@arm.com, + srv_heupstream@mediatek.com, "chuanjia.liu" , + linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, + jianjun.wang@mediatek.com, linux-mediatek@lists.infradead.org, + yong.wu@mediatek.com, bhelgaas@google.com, + linux-arm-kernel@lists.infradead.org, amurray@thegoodpenguin.co.uk +Sender: "Linux-mediatek" +Errors-To: + linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org + +From: "chuanjia.liu" + +There are two independent PCIe controllers in MT2712/MT7622 platform, +and each of them should contain an independent MSI domain. + +In current architecture, MSI domain will be inherited from the root +bridge, and all of the devices will share the same MSI domain. +Hence that, the PCIe devices will not work properly if the irq number +which required is more than 32. + +Split the PCIe node for MT2712/MT7622 platform to fix MSI issue and +comply with the hardware design. + +Signed-off-by: chuanjia.liu +--- + arch/arm64/boot/dts/mediatek/mt2712e.dtsi | 75 +++++++++++-------- + .../dts/mediatek/mt7622-bananapi-bpi-r64.dts | 16 ++-- + arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts | 6 +- + arch/arm64/boot/dts/mediatek/mt7622.dtsi | 68 +++++++++++------ + 4 files changed, 96 insertions(+), 69 deletions(-) + +diff --git a/arch/arm64/boot/dts/mediatek/mt2712e.dtsi b/arch/arm64/boot/dts/mediatek/mt2712e.dtsi +index 2cd8b33886e5..ab27ff4a869e 100644 +--- a/arch/arm64/boot/dts/mediatek/mt2712e.dtsi ++++ b/arch/arm64/boot/dts/mediatek/mt2712e.dtsi +@@ -797,60 +797,73 @@ + }; + }; + +- pcie: pcie@11700000 { ++ pcie1: pcie@112ff000 { + compatible = "mediatek,mt2712-pcie"; + device_type = "pci"; +- reg = <0 0x11700000 0 0x1000>, +- <0 0x112ff000 0 0x1000>; +- reg-names = "port0", "port1"; ++ reg = <0 0x112ff000 0 0x1000>; ++ reg-names = "port1"; + #address-cells = <3>; + #size-cells = <2>; +- interrupts = , +- ; +- clocks = <&topckgen CLK_TOP_PE2_MAC_P0_SEL>, +- <&topckgen CLK_TOP_PE2_MAC_P1_SEL>, +- <&pericfg CLK_PERI_PCIE0>, ++ interrupts = ; ++ interrupt-names = "pcie_irq"; ++ clocks = <&topckgen CLK_TOP_PE2_MAC_P1_SEL>, + <&pericfg CLK_PERI_PCIE1>; +- clock-names = "sys_ck0", "sys_ck1", "ahb_ck0", "ahb_ck1"; +- phys = <&u3port0 PHY_TYPE_PCIE>, <&u3port1 PHY_TYPE_PCIE>; +- phy-names = "pcie-phy0", "pcie-phy1"; ++ clock-names = "sys_ck1", "ahb_ck1"; ++ phys = <&u3port1 PHY_TYPE_PCIE>; ++ phy-names = "pcie-phy1"; + bus-range = <0x00 0xff>; +- ranges = <0x82000000 0 0x20000000 0x0 0x20000000 0 0x10000000>; ++ ranges = <0x82000000 0 0x11400000 0x0 0x11400000 0 0x300000>; ++ status = "disabled"; + +- pcie0: pcie@0,0 { +- device_type = "pci"; +- status = "disabled"; +- reg = <0x0000 0 0 0 0>; ++ slot1: pcie@1,0 { ++ reg = <0x0800 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + #interrupt-cells = <1>; + ranges; + interrupt-map-mask = <0 0 0 7>; +- interrupt-map = <0 0 0 1 &pcie_intc0 0>, +- <0 0 0 2 &pcie_intc0 1>, +- <0 0 0 3 &pcie_intc0 2>, +- <0 0 0 4 &pcie_intc0 3>; +- pcie_intc0: interrupt-controller { ++ interrupt-map = <0 0 0 1 &pcie_intc1 0>, ++ <0 0 0 2 &pcie_intc1 1>, ++ <0 0 0 3 &pcie_intc1 2>, ++ <0 0 0 4 &pcie_intc1 3>; ++ pcie_intc1: interrupt-controller { + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <1>; + }; + }; ++ }; + +- pcie1: pcie@1,0 { +- device_type = "pci"; +- status = "disabled"; +- reg = <0x0800 0 0 0 0>; ++ pcie0: pcie@11700000 { ++ compatible = "mediatek,mt2712-pcie"; ++ device_type = "pci"; ++ reg = <0 0x11700000 0 0x1000>; ++ reg-names = "port0"; ++ #address-cells = <3>; ++ #size-cells = <2>; ++ interrupts = ; ++ interrupt-names = "pcie_irq"; ++ clocks = <&topckgen CLK_TOP_PE2_MAC_P0_SEL>, ++ <&pericfg CLK_PERI_PCIE0>; ++ clock-names = "sys_ck0", "ahb_ck0"; ++ phys = <&u3port0 PHY_TYPE_PCIE>; ++ phy-names = "pcie-phy0"; ++ bus-range = <0x00 0xff>; ++ ranges = <0x82000000 0 0x20000000 0x0 0x20000000 0 0x10000000>; ++ status = "disabled"; ++ ++ slot0: pcie@0,0 { ++ reg = <0x0000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + #interrupt-cells = <1>; + ranges; + interrupt-map-mask = <0 0 0 7>; +- interrupt-map = <0 0 0 1 &pcie_intc1 0>, +- <0 0 0 2 &pcie_intc1 1>, +- <0 0 0 3 &pcie_intc1 2>, +- <0 0 0 4 &pcie_intc1 3>; +- pcie_intc1: interrupt-controller { ++ interrupt-map = <0 0 0 1 &pcie_intc0 0>, ++ <0 0 0 2 &pcie_intc0 1>, ++ <0 0 0 3 &pcie_intc0 2>, ++ <0 0 0 4 &pcie_intc0 3>; ++ pcie_intc0: interrupt-controller { + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <1>; +diff --git a/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts b/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts +index 83e10591e0e5..7574d88cc46a 100644 +--- a/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts ++++ b/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts +@@ -207,18 +207,16 @@ + }; + }; + +-&pcie { ++&pcie0 { + pinctrl-names = "default"; +- pinctrl-0 = <&pcie0_pins>, <&pcie1_pins>; ++ pinctrl-0 = <&pcie0_pins>; + status = "okay"; ++}; + +- pcie@0,0 { +- status = "okay"; +- }; +- +- pcie@1,0 { +- status = "okay"; +- }; ++&pcie1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pcie1_pins>; ++ status = "okay"; + }; + + &pio { +diff --git a/arch/arm64/boot/dts/mediatek/mt7622.dtsi b/arch/arm64/boot/dts/mediatek/mt7622.dtsi +index 339dc9f88f43..d5131c8b6a79 100644 +--- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi ++++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi +@@ -766,45 +766,41 @@ + #reset-cells = <1>; + }; + +- pcie: pcie@1a140000 { ++ pciecfg: pciecfg@1a140000 { ++ compatible = "mediatek,mt7622-pciecfg", "syscon"; ++ reg = <0 0x1a140000 0 0x1000>; ++ }; ++ ++ pcie0: pcie@1a143000 { + compatible = "mediatek,mt7622-pcie"; + device_type = "pci"; +- reg = <0 0x1a140000 0 0x1000>, +- <0 0x1a143000 0 0x1000>, +- <0 0x1a145000 0 0x1000>; +- reg-names = "subsys", "port0", "port1"; ++ reg = <0 0x1a143000 0 0x1000>; ++ reg-names = "port0"; ++ mediatek,pcie-cfg = <&pciecfg>; + #address-cells = <3>; + #size-cells = <2>; +- interrupts = , +- ; ++ interrupts = ; ++ interrupt-names = "pcie_irq"; + clocks = <&pciesys CLK_PCIE_P0_MAC_EN>, +- <&pciesys CLK_PCIE_P1_MAC_EN>, +- <&pciesys CLK_PCIE_P0_AHB_EN>, + <&pciesys CLK_PCIE_P0_AHB_EN>, + <&pciesys CLK_PCIE_P0_AUX_EN>, +- <&pciesys CLK_PCIE_P1_AUX_EN>, + <&pciesys CLK_PCIE_P0_AXI_EN>, +- <&pciesys CLK_PCIE_P1_AXI_EN>, + <&pciesys CLK_PCIE_P0_OBFF_EN>, +- <&pciesys CLK_PCIE_P1_OBFF_EN>, +- <&pciesys CLK_PCIE_P0_PIPE_EN>, +- <&pciesys CLK_PCIE_P1_PIPE_EN>; +- clock-names = "sys_ck0", "sys_ck1", "ahb_ck0", "ahb_ck1", +- "aux_ck0", "aux_ck1", "axi_ck0", "axi_ck1", +- "obff_ck0", "obff_ck1", "pipe_ck0", "pipe_ck1"; ++ <&pciesys CLK_PCIE_P0_PIPE_EN>; ++ clock-names = "sys_ck0", "ahb_ck0", "aux_ck0", ++ "axi_ck0", "obff_ck0", "pipe_ck0"; ++ + power-domains = <&scpsys MT7622_POWER_DOMAIN_HIF0>; + bus-range = <0x00 0xff>; +- ranges = <0x82000000 0 0x20000000 0x0 0x20000000 0 0x10000000>; ++ ranges = <0x82000000 0 0x20000000 0x0 0x20000000 0 0x8000000>; + status = "disabled"; + +- pcie0: pcie@0,0 { ++ slot0: pcie@0,0 { + reg = <0x0000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + #interrupt-cells = <1>; + ranges; +- status = "disabled"; +- + interrupt-map-mask = <0 0 0 7>; + interrupt-map = <0 0 0 1 &pcie_intc0 0>, + <0 0 0 2 &pcie_intc0 1>, +@@ -816,15 +812,39 @@ + #interrupt-cells = <1>; + }; + }; ++ }; + +- pcie1: pcie@1,0 { ++ pcie1: pcie@1a145000 { ++ compatible = "mediatek,mt7622-pcie"; ++ device_type = "pci"; ++ reg = <0 0x1a145000 0 0x1000>; ++ reg-names = "port1"; ++ mediatek,pcie-cfg = <&pciecfg>; ++ #address-cells = <3>; ++ #size-cells = <2>; ++ interrupts = ; ++ interrupt-names = "pcie_irq"; ++ clocks = <&pciesys CLK_PCIE_P1_MAC_EN>, ++ /* designer has connect RC1 with p0_ahb clock */ ++ <&pciesys CLK_PCIE_P0_AHB_EN>, ++ <&pciesys CLK_PCIE_P1_AUX_EN>, ++ <&pciesys CLK_PCIE_P1_AXI_EN>, ++ <&pciesys CLK_PCIE_P1_OBFF_EN>, ++ <&pciesys CLK_PCIE_P1_PIPE_EN>; ++ clock-names = "sys_ck1", "ahb_ck1", "aux_ck1", ++ "axi_ck1", "obff_ck1", "pipe_ck1"; ++ ++ power-domains = <&scpsys MT7622_POWER_DOMAIN_HIF0>; ++ bus-range = <0x00 0xff>; ++ ranges = <0x82000000 0 0x28000000 0x0 0x28000000 0 0x8000000>; ++ status = "disabled"; ++ ++ slot1: pcie@1,0 { + reg = <0x0800 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + #interrupt-cells = <1>; + ranges; +- status = "disabled"; +- + interrupt-map-mask = <0 0 0 7>; + interrupt-map = <0 0 0 1 &pcie_intc1 0>, + <0 0 0 2 &pcie_intc1 1>, +--- a/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts 2020-06-15 18:52:25.092948824 +0800 ++++ b/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts 2020-06-15 18:52:15.909094229 +0800 +@@ -244,18 +244,16 @@ + }; + }; + +-&pcie { ++&pcie0 { + pinctrl-names = "default"; +- pinctrl-0 = <&pcie0_pins>, <&pcie1_pins>; ++ pinctrl-0 = <&pcie0_pins>; + status = "okay"; ++}; + +- pcie@0,0 { +- status = "okay"; +- }; +- +- pcie@1,0 { +- status = "okay"; +- }; ++&pcie1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pcie1_pins>; ++ status = "okay"; + }; + + &pio { diff --git a/target/linux/mediatek/patches-5.4/0994-ARM-dts-mediatek-Update-mt7629-PCIe-node.patch b/target/linux/mediatek/patches-5.4/0994-ARM-dts-mediatek-Update-mt7629-PCIe-node.patch new file mode 100755 index 0000000000..4ba99d89d0 --- /dev/null +++ b/target/linux/mediatek/patches-5.4/0994-ARM-dts-mediatek-Update-mt7629-PCIe-node.patch @@ -0,0 +1,207 @@ +From patchwork Thu May 28 06:16:48 2020 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Chuanjia Liu +X-Patchwork-Id: 11574797 +Return-Path: + +Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org + [172.30.200.123]) + by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 30A5E1392 + for ; + Thu, 28 May 2020 06:29:05 +0000 (UTC) +Received: from bombadil.infradead.org (bombadil.infradead.org + [198.137.202.133]) + (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) + (No client certificate requested) + by mail.kernel.org (Postfix) with ESMTPS id 08B6320721 + for ; + Thu, 28 May 2020 06:29:05 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=pass (2048-bit key) header.d=lists.infradead.org + header.i=@lists.infradead.org header.b="auhxDafY"; + dkim=fail reason="signature verification failed" (1024-bit key) + header.d=mediatek.com header.i=@mediatek.com header.b="Kj09Arxb" +DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 08B6320721 +Authentication-Results: mail.kernel.org; + dmarc=fail (p=none dis=none) header.from=mediatek.com +Authentication-Results: mail.kernel.org; + spf=none + smtp.mailfrom=linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org +DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; + d=lists.infradead.org; s=bombadil.20170209; h=Sender: + Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: + List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: + Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: + Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: + List-Owner; bh=+QPxF1vlOH7StIZYuXJa3V40x8QVDxCLF9AFXHblB9M=; b=auhxDafYBeaUZO + aYp2KVO8Aie0v4tYtRwBon7hF+x55JwD78SAxQR2RsSvrlOo9cMYYby+ToUWflVUWQ60FapAl+w+l + nkEjIOrLBErHwxNOcsD8T5kjyCBMqlz4OMAQYUDNJ3fSugRlGhOtxkjCGd9ebB8N2Rvu6/U8P1A9n + P15mEQoc+RLonR1+9mBgwTEXErjsraxkimTD4Txsp4IvMs3UdsMkP+r3OT5S/p+Uj6O9ES0h7xIon + aL79KaVqRLHrfZxnrVwuGiecAiTp8qLy9clHuJU32NA6ZcXH1OnWipKApgp8Ck7ys80WPKaMrat9B + XuskJ63w13DZAbCVvuGQ==; +Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) + by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) + id 1jeC2J-00014n-M9; Thu, 28 May 2020 06:29:03 +0000 +Received: from mailgw02.mediatek.com ([216.200.240.185]) + by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) + id 1jeC2H-00013t-Li; Thu, 28 May 2020 06:29:03 +0000 +X-UUID: a4877c1586e64afeb2d6172e10605d2b-20200527 +DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; + d=mediatek.com; + s=dk; + h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; + bh=CIwcBFK1x0LbOjDt1BG6/knHFxDHRiqj8ov/jWEZDBY=; + b=Kj09ArxbnLVTc9bpaVPT3jQrIVjhL87sSYyVF9dFypS976k78Ce9gZd0f4K3zAZbYZHYoQtuyOQ9TOeufQfgD+Cr+j5VR7pTdO2E1iXHFs/eQAz5gAjvjlK01z1JiunrLnn9dvIr6c1gEkjQHny0VpuZ1duxx79jwYusg/Nw6Wc=; +X-UUID: a4877c1586e64afeb2d6172e10605d2b-20200527 +Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by + mailgw02.mediatek.com + (envelope-from ) + (musrelay.mediatek.com ESMTP with TLS) + with ESMTP id 899663677; Wed, 27 May 2020 22:29:21 -0800 +Received: from MTKMBS07N2.mediatek.inc (172.21.101.141) by + MTKMBS62DR.mediatek.inc (172.29.94.18) with Microsoft SMTP Server (TLS) id + 15.0.1497.2; Wed, 27 May 2020 23:18:50 -0700 +Received: from mtkcas07.mediatek.inc (172.21.101.84) by + mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id + 15.0.1497.2; Thu, 28 May 2020 14:18:54 +0800 +Received: from localhost.localdomain (10.17.3.153) by mtkcas07.mediatek.inc + (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend + Transport; Thu, 28 May 2020 14:18:52 +0800 +From: +To: , , +Subject: [PATCH v2 4/4] ARM: dts: mediatek: Update mt7629 PCIe node +Date: Thu, 28 May 2020 14:16:48 +0800 +Message-ID: <20200528061648.32078-5-chuanjia.liu@mediatek.com> +X-Mailer: git-send-email 2.18.0 +In-Reply-To: <20200528061648.32078-1-chuanjia.liu@mediatek.com> +References: <20200528061648.32078-1-chuanjia.liu@mediatek.com> +MIME-Version: 1.0 +X-MTK: N +X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 +X-CRM114-CacheID: sfid-20200527_232901_719172_E5A99C62 +X-CRM114-Status: GOOD ( 11.61 ) +X-Spam-Score: -0.2 (/) +X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: + Content analysis details: (-0.2 points) + pts rule name description + ---- ---------------------- + -------------------------------------------------- + -0.0 SPF_PASS SPF: sender matches SPF record + 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record + 0.0 MIME_BASE64_TEXT RAW: Message text disguised using base64 + encoding + -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from + author's domain + 0.1 DKIM_SIGNED Message has a DKIM or DK signature, + not necessarily + valid + -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature + -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from + envelope-from domain + 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay + lines +X-BeenThere: linux-mediatek@lists.infradead.org +X-Mailman-Version: 2.1.29 +Precedence: list +List-Id: +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +Cc: devicetree@vger.kernel.org, lorenzo.pieralisi@arm.com, + srv_heupstream@mediatek.com, "chuanjia.liu" , + linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, + jianjun.wang@mediatek.com, linux-mediatek@lists.infradead.org, + yong.wu@mediatek.com, bhelgaas@google.com, + linux-arm-kernel@lists.infradead.org, amurray@thegoodpenguin.co.uk +Sender: "Linux-mediatek" +Errors-To: + linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org + +From: "chuanjia.liu" + +Remove unused property and add pciecfg node. + +Signed-off-by: chuanjia.liu +--- + arch/arm/boot/dts/mt7629-rfb.dts | 3 ++- + arch/arm/boot/dts/mt7629.dtsi | 23 +++++++++++++---------- + 2 files changed, 15 insertions(+), 11 deletions(-) + +diff --git a/arch/arm/boot/dts/mt7629-rfb.dts b/arch/arm/boot/dts/mt7629-rfb.dts +index 9980c10c6e29..eb536cbebd9b 100644 +--- a/arch/arm/boot/dts/mt7629-rfb.dts ++++ b/arch/arm/boot/dts/mt7629-rfb.dts +@@ -140,9 +140,10 @@ + }; + }; + +-&pcie { ++&pcie1 { + pinctrl-names = "default"; + pinctrl-0 = <&pcie_pins>; ++ status = "okay"; + }; + + &pciephy1 { +diff --git a/arch/arm/boot/dts/mt7629.dtsi b/arch/arm/boot/dts/mt7629.dtsi +index 5cbb3d244c75..94567307b842 100644 +--- a/arch/arm/boot/dts/mt7629.dtsi ++++ b/arch/arm/boot/dts/mt7629.dtsi +@@ -360,16 +360,21 @@ + #reset-cells = <1>; + }; + +- pcie: pcie@1a140000 { ++ pciecfg: pciecfg@1a140000 { ++ compatible = "mediatek,mt7629-pciecfg", "syscon"; ++ reg = <0x1a140000 0x1000>; ++ }; ++ ++ pcie1: pcie@1a145000 { + compatible = "mediatek,mt7629-pcie"; + device_type = "pci"; +- reg = <0x1a140000 0x1000>, +- <0x1a145000 0x1000>; +- reg-names = "subsys","port1"; ++ reg = <0x1a145000 0x1000>; ++ reg-names = "port1"; ++ mediatek,pcie-cfg = <&pciecfg>; + #address-cells = <3>; + #size-cells = <2>; +- interrupts = , +- ; ++ interrupts = ; ++ interrupt-names = "pcie_irq"; + clocks = <&pciesys CLK_PCIE_P1_MAC_EN>, + <&pciesys CLK_PCIE_P0_AHB_EN>, + <&pciesys CLK_PCIE_P1_AUX_EN>, +@@ -390,21 +395,19 @@ + power-domains = <&scpsys MT7622_POWER_DOMAIN_HIF0>; + bus-range = <0x00 0xff>; + ranges = <0x82000000 0 0x20000000 0x20000000 0 0x10000000>; ++ status = "disabled"; + +- pcie1: pcie@1,0 { +- device_type = "pci"; ++ slot1: pcie@1,0 { + reg = <0x0800 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + #interrupt-cells = <1>; + ranges; +- num-lanes = <1>; + interrupt-map-mask = <0 0 0 7>; + interrupt-map = <0 0 0 1 &pcie_intc1 0>, + <0 0 0 2 &pcie_intc1 1>, + <0 0 0 3 &pcie_intc1 2>, + <0 0 0 4 &pcie_intc1 3>; +- + pcie_intc1: interrupt-controller { + interrupt-controller; + #address-cells = <0>; From a79f55e7e03543afa03c473aebc7e29c49062727 Mon Sep 17 00:00:00 2001 From: INAGAKI Hiroshi Date: Wed, 15 Jul 2020 13:13:01 +0900 Subject: [PATCH 26/28] ramips: add support for ELECOM WRC-1750GS/GSV MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ELECOM WRC-1750GS is a 2.4/5 GHz band 11ac (Wi-Fi 5) router, based on MT7621A. WRC-1750GSV has the same hardware with WRC-1750GS. Specification: - SoC : MediaTek MT7621A - RAM : DDR3 128 MiB - Flash : SPI-NOR 16 MiB - WLAN : 2.4/5 GHz 3T3R (2x MediaTek MT7615) - Ethernet : 10/100/1000 Mbps x5 - Switch : MediaTek MT7530 (SoC) - LED/keys : 4x/6x (2x buttons, 1x slide-switch) - UART : through-hole on PCB - J4: 3.3V, GND, TX, RX from ethernet port side - 57600n8 - Power : 12VDC, 1.5A Flash instruction using factory image: 1. Boot WRC-1750GS (or WRC-1750GSV) normally 2. Access to "http://192.168.2.1/" and open firmware update page ("ファームウェア更新") 3. Select the OpenWrt factory image and click apply ("適用") button for WRC-1750GS : wrc-1750gs-squashfs-factory.bin for WRC-1750GSV: wrc-1750gsv-squashfs-factory.bin 4. Wait ~120 seconds to complete flashing Signed-off-by: INAGAKI Hiroshi --- .../ramips/dts/mt7621_elecom_wrc-1750gs.dts | 41 +++++++++++++++++++ .../ramips/dts/mt7621_elecom_wrc-1750gsv.dts | 41 +++++++++++++++++++ target/linux/ramips/image/mt7621.mk | 24 +++++++++++ 3 files changed, 106 insertions(+) create mode 100644 target/linux/ramips/dts/mt7621_elecom_wrc-1750gs.dts create mode 100644 target/linux/ramips/dts/mt7621_elecom_wrc-1750gsv.dts diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-1750gs.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-1750gs.dts new file mode 100644 index 0000000000..46d4c1a708 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-1750gs.dts @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7621_elecom_wrc-gst.dtsi" + +/ { + compatible = "elecom,wrc-1750gs", "mediatek,mt7621-soc"; + model = "ELECOM WRC-1750GS"; +}; + +&partitions { + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0xb00000>; + }; + + partition@b50000 { + label = "tm_pattern"; + reg = <0xb50000 0x380000>; + read-only; + }; + + partition@ed0000 { + label = "tm_key"; + reg = <0xed0000 0x80000>; + read-only; + }; + + partition@f50000 { + label = "art_block"; + reg = <0xf50000 0x30000>; + read-only; + }; + + partition@f80000 { + label = "user_data"; + reg = <0xf80000 0x80000>; + read-only; + }; +}; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-1750gsv.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-1750gsv.dts new file mode 100644 index 0000000000..6f2054b076 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-1750gsv.dts @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7621_elecom_wrc-gst.dtsi" + +/ { + compatible = "elecom,wrc-1750gsv", "mediatek,mt7621-soc"; + model = "ELECOM WRC-1750GSV"; +}; + +&partitions { + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0xb00000>; + }; + + partition@b50000 { + label = "tm_pattern"; + reg = <0xb50000 0x380000>; + read-only; + }; + + partition@ed0000 { + label = "tm_key"; + reg = <0xed0000 0x80000>; + read-only; + }; + + partition@f50000 { + label = "nvram"; + reg = <0xf50000 0x30000>; + read-only; + }; + + partition@f80000 { + label = "user_data"; + reg = <0xf80000 0x80000>; + read-only; + }; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 48561d5ff9..a16900aa8c 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -326,6 +326,30 @@ define Device/elecom_wrc-1167ghbk2-s endef TARGET_DEVICES += elecom_wrc-1167ghbk2-s +define Device/elecom_wrc-1750gs + $(Device/uimage-lzma-loader) + IMAGE_SIZE := 11264k + DEVICE_VENDOR := ELECOM + DEVICE_MODEL := WRC-1750GS + IMAGES += factory.bin + IMAGE/factory.bin := $$(sysupgrade_bin) | check-size | \ + elecom-gst-factory WRC-1750GS 0.00 + DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware wpad-basic +endef +TARGET_DEVICES += elecom_wrc-1750gs + +define Device/elecom_wrc-1750gsv + $(Device/uimage-lzma-loader) + IMAGE_SIZE := 11264k + DEVICE_VENDOR := ELECOM + DEVICE_MODEL := WRC-1750GSV + IMAGES += factory.bin + IMAGE/factory.bin := $$(sysupgrade_bin) | check-size | \ + elecom-gst-factory WRC-1750GSV 0.00 + DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware wpad-basic +endef +TARGET_DEVICES += elecom_wrc-1750gsv + define Device/elecom_wrc-1900gst $(Device/uimage-lzma-loader) IMAGE_SIZE := 11264k From 95a05b12d74a50f020bc7728a9541c4f181284ea Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Wed, 15 Jul 2020 20:08:22 +0200 Subject: [PATCH 27/28] ramips: provide common definition for ELECOM WRC GS devices Add a common definition for ELECOM WRC "GS" devices to mt7621.mk to not repeat the same assignments five times. To keep the naming consistent, slightly rename the DTSI and the factory image recipe as well. Note that elecom_wrc-1167ghbk2-s uses a slightly different build recipe for the factory image, so we keep it separate. Signed-off-by: Adrian Schmutzler Tested-by: INAGAKI Hiroshi [WRC-1750GSV] --- .../ramips/dts/mt7621_elecom_wrc-1750gs.dts | 2 +- .../ramips/dts/mt7621_elecom_wrc-1750gsv.dts | 2 +- .../ramips/dts/mt7621_elecom_wrc-1900gst.dts | 2 +- .../ramips/dts/mt7621_elecom_wrc-2533gst.dts | 2 +- .../ramips/dts/mt7621_elecom_wrc-2533gst2.dts | 2 +- ...wrc-gst.dtsi => mt7621_elecom_wrc-gs.dtsi} | 0 target/linux/ramips/image/mt7621.mk | 49 +++++++------------ 7 files changed, 24 insertions(+), 35 deletions(-) rename target/linux/ramips/dts/{mt7621_elecom_wrc-gst.dtsi => mt7621_elecom_wrc-gs.dtsi} (100%) diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-1750gs.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-1750gs.dts index 46d4c1a708..d96fe0cfb5 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-1750gs.dts +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-1750gs.dts @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT /dts-v1/; -#include "mt7621_elecom_wrc-gst.dtsi" +#include "mt7621_elecom_wrc-gs.dtsi" / { compatible = "elecom,wrc-1750gs", "mediatek,mt7621-soc"; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-1750gsv.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-1750gsv.dts index 6f2054b076..34631b5ce5 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-1750gsv.dts +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-1750gsv.dts @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT /dts-v1/; -#include "mt7621_elecom_wrc-gst.dtsi" +#include "mt7621_elecom_wrc-gs.dtsi" / { compatible = "elecom,wrc-1750gsv", "mediatek,mt7621-soc"; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-1900gst.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-1900gst.dts index 4b99cee31e..c8e6d9c3c9 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-1900gst.dts +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-1900gst.dts @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 /dts-v1/; -#include "mt7621_elecom_wrc-gst.dtsi" +#include "mt7621_elecom_wrc-gs.dtsi" / { compatible = "elecom,wrc-1900gst", "mediatek,mt7621-soc"; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-2533gst.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-2533gst.dts index 6158cf196a..2c37c96961 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-2533gst.dts +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-2533gst.dts @@ -1,6 +1,6 @@ /dts-v1/; -#include "mt7621_elecom_wrc-gst.dtsi" +#include "mt7621_elecom_wrc-gs.dtsi" / { compatible = "elecom,wrc-2533gst", "mediatek,mt7621-soc"; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-2533gst2.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-2533gst2.dts index 01f32e9b20..bce06a6b7d 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-2533gst2.dts +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-2533gst2.dts @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT /dts-v1/; -#include "mt7621_elecom_wrc-gst.dtsi" +#include "mt7621_elecom_wrc-gs.dtsi" / { compatible = "elecom,wrc-2533gst2", "mediatek,mt7621-soc"; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-gst.dtsi b/target/linux/ramips/dts/mt7621_elecom_wrc-gs.dtsi similarity index 100% rename from target/linux/ramips/dts/mt7621_elecom_wrc-gst.dtsi rename to target/linux/ramips/dts/mt7621_elecom_wrc-gs.dtsi diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index a16900aa8c..229897ffb5 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -7,7 +7,7 @@ include ./common-tp-link.mk DEFAULT_SOC := mt7621 KERNEL_DTB += -d21 -DEVICE_VARS += UIMAGE_MAGIC +DEVICE_VARS += UIMAGE_MAGIC ELECOM_HWNAME # The OEM webinterface expects an kernel with initramfs which has the uImage # header field ih_name. @@ -23,7 +23,7 @@ define Build/custom-initramfs-uimage mv $@.new $@ endef -define Build/elecom-gst-factory +define Build/elecom-wrc-gs-factory $(eval product=$(word 1,$(1))) $(eval version=$(word 2,$(1))) ( $(STAGING_DIR_HOST)/bin/mkhash md5 $@ | tr -d '\n' ) >> $@ @@ -326,63 +326,52 @@ define Device/elecom_wrc-1167ghbk2-s endef TARGET_DEVICES += elecom_wrc-1167ghbk2-s -define Device/elecom_wrc-1750gs +define Device/elecom_wrc-gs $(Device/uimage-lzma-loader) - IMAGE_SIZE := 11264k DEVICE_VENDOR := ELECOM - DEVICE_MODEL := WRC-1750GS IMAGES += factory.bin IMAGE/factory.bin := $$(sysupgrade_bin) | check-size | \ - elecom-gst-factory WRC-1750GS 0.00 + elecom-wrc-gs-factory $$$$(ELECOM_HWNAME) 0.00 DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware wpad-basic endef + +define Device/elecom_wrc-1750gs + $(Device/elecom_wrc-gs) + IMAGE_SIZE := 11264k + DEVICE_MODEL := WRC-1750GS + ELECOM_HWNAME := WRC-1750GS +endef TARGET_DEVICES += elecom_wrc-1750gs define Device/elecom_wrc-1750gsv - $(Device/uimage-lzma-loader) + $(Device/elecom_wrc-gs) IMAGE_SIZE := 11264k - DEVICE_VENDOR := ELECOM DEVICE_MODEL := WRC-1750GSV - IMAGES += factory.bin - IMAGE/factory.bin := $$(sysupgrade_bin) | check-size | \ - elecom-gst-factory WRC-1750GSV 0.00 - DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware wpad-basic + ELECOM_HWNAME := WRC-1750GSV endef TARGET_DEVICES += elecom_wrc-1750gsv define Device/elecom_wrc-1900gst - $(Device/uimage-lzma-loader) + $(Device/elecom_wrc-gs) IMAGE_SIZE := 11264k - DEVICE_VENDOR := ELECOM DEVICE_MODEL := WRC-1900GST - IMAGES += factory.bin - IMAGE/factory.bin := $$(sysupgrade_bin) | check-size | \ - elecom-gst-factory WRC-1900GST 0.00 - DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware wpad-basic + ELECOM_HWNAME := WRC-1900GST endef TARGET_DEVICES += elecom_wrc-1900gst define Device/elecom_wrc-2533gst - $(Device/uimage-lzma-loader) + $(Device/elecom_wrc-gs) IMAGE_SIZE := 11264k - DEVICE_VENDOR := ELECOM DEVICE_MODEL := WRC-2533GST - IMAGES += factory.bin - IMAGE/factory.bin := $$(sysupgrade_bin) | check-size | \ - elecom-gst-factory WRC-2533GST 0.00 - DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware wpad-basic + ELECOM_HWNAME := WRC-2533GST endef TARGET_DEVICES += elecom_wrc-2533gst define Device/elecom_wrc-2533gst2 - $(Device/uimage-lzma-loader) + $(Device/elecom_wrc-gs) IMAGE_SIZE := 24576k - DEVICE_VENDOR := ELECOM DEVICE_MODEL := WRC-2533GST2 - IMAGES += factory.bin - IMAGE/factory.bin := $$(sysupgrade_bin) | check-size | \ - elecom-gst-factory WRC-2533GST2 0.00 - DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware wpad-basic + ELECOM_HWNAME := WRC-2533GST2 endef TARGET_DEVICES += elecom_wrc-2533gst2 From ed087cba8a8e41f76f9487caa34eff926ea8a065 Mon Sep 17 00:00:00 2001 From: Santiago Rodriguez-Papa Date: Wed, 15 Jul 2020 20:24:43 -0400 Subject: [PATCH 28/28] ramips: add support for Linksys EA7300 v1 Specifications: * SoC: MediaTek MT7621A (880 MHz 2c/4t) * RAM: Nanya NT5CC128M16IP-DIT (256M DDR3-1600) * Flash: Macronix MX30LF1G18AC-TI (128M NAND) * Eth: MediaTek MT7621A (10/100/1000 Mbps x5) * Radio: MT7615N (2.4 GHz & 5 GHz) 4 antennae: 1 internal and 3 non-deatachable * USB: 3.0 (x1) * LEDs: White (x1 logo) Green (x6 eth + wps) Orange (x5, hardware-bound) * Buttons: Reset (x1) WPS (x1) Everything works! Been running it for a couple weeks now and haven't had any problems. Please let me know if you run into any. Installation: Flash factory image through GUI. This might fail due to the A/B nature of this device. When flashing, OEM firmware writes over the non-booted partition. If booted from 'A', flashing over 'B' won't work. To get around this, you should flash the OEM image over itself. This will then boot the router from 'B' and allow you to flash OpenWRT without problems. Reverting to factory firmware: Hard-reset the router three times to force it to boot from 'B.' This is where the stock firmware resides. To remove any traces of OpenWRT from your router simply flash the OEM image at this point. Signed-off-by: Santiago Rodriguez-Papa [use v1 only, minor DTS adjustments, use LINKSYS_HWNAME and add it to DEVICE_VARS, wrap DEVICE_PACKAGES, adjust commit message/title] Signed-off-by: Adrian Schmutzler --- package/boot/uboot-envtools/files/ramips | 1 + .../ramips/dts/mt7621_linksys_ea7300-v1.dts | 55 ++++++ .../ramips/dts/mt7621_linksys_ea7500-v2.dts | 154 +---------------- .../ramips/dts/mt7621_linksys_ea7xxx.dtsi | 157 ++++++++++++++++++ target/linux/ramips/image/mt7621.mk | 26 ++- .../mt7621/base-files/etc/board.d/01_leds | 1 + .../mt7621/base-files/etc/board.d/02_network | 1 + .../etc/hotplug.d/ieee80211/10_fix_wifi_mac | 1 + .../mt7621/base-files/etc/init.d/bootcount | 1 + .../mt7621/base-files/lib/upgrade/platform.sh | 1 + 10 files changed, 239 insertions(+), 159 deletions(-) create mode 100644 target/linux/ramips/dts/mt7621_linksys_ea7300-v1.dts create mode 100644 target/linux/ramips/dts/mt7621_linksys_ea7xxx.dtsi diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips index 701f051f77..80a91f0f45 100644 --- a/package/boot/uboot-envtools/files/ramips +++ b/package/boot/uboot-envtools/files/ramips @@ -33,6 +33,7 @@ xiaomi,miwifi-nano|\ zbtlink,zbt-wg2626) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000" ;; +linksys,ea7300-v1|\ linksys,ea7500-v2|\ xiaomi,mi-router-ac2100|\ xiaomi,mir3p|\ diff --git a/target/linux/ramips/dts/mt7621_linksys_ea7300-v1.dts b/target/linux/ramips/dts/mt7621_linksys_ea7300-v1.dts new file mode 100644 index 0000000000..67eb31768f --- /dev/null +++ b/target/linux/ramips/dts/mt7621_linksys_ea7300-v1.dts @@ -0,0 +1,55 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7621_linksys_ea7xxx.dtsi" + +/ { + compatible = "linksys,ea7300-v1", "mediatek,mt7621-soc"; + model = "Linksys EA7300 v1"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + leds { + compatible = "gpio-leds"; + + wan_green { + label = "ea7300-v1:green:wan"; + gpios = <&gpio 7 GPIO_ACTIVE_LOW>; + }; + + lan1_green { + label = "ea7300-v1:green:lan1"; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + + lan2_green { + label = "ea7300-v1:green:lan2"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + }; + + lan3_green { + label = "ea7300-v1:green:lan3"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + lan4_green { + label = "ea7300-v1:green:lan4"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + led_power: power { + label = "ea7300-v1:white:power"; + gpios = <&gpio 10 GPIO_ACTIVE_HIGH>; + }; + + wps { + label = "ea7300-v1:green:wps"; + gpios = <&gpio 5 GPIO_ACTIVE_HIGH>; + }; + }; +}; diff --git a/target/linux/ramips/dts/mt7621_linksys_ea7500-v2.dts b/target/linux/ramips/dts/mt7621_linksys_ea7500-v2.dts index ac13bdd369..bc454f3910 100644 --- a/target/linux/ramips/dts/mt7621_linksys_ea7500-v2.dts +++ b/target/linux/ramips/dts/mt7621_linksys_ea7500-v2.dts @@ -1,10 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT /dts-v1/; -#include "mt7621.dtsi" - -#include -#include +#include "mt7621_linksys_ea7xxx.dtsi" / { compatible = "linksys,ea7500-v2", "mediatek,mt7621-soc"; @@ -17,10 +14,6 @@ led-upgrade = &led_power; }; - chosen { - bootargs = "console=ttyS0,115200"; - }; - leds { compatible = "gpio-leds"; @@ -59,149 +52,4 @@ gpios = <&gpio 5 GPIO_ACTIVE_HIGH>; }; }; - - keys { - compatible = "gpio-keys"; - - wps { - label = "wps"; - gpios = <&gpio 17 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - - reset { - label = "reset"; - gpios = <&gpio 12 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - }; -}; - -&nand { - status = "okay"; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "boot"; - reg = <0x0 0x80000>; - read-only; - }; - - partition@80000 { - label = "u_env"; - reg = <0x80000 0x40000>; - read-only; - }; - - factory: partition@c0000 { - label = "factory"; - reg = <0xc0000 0x40000>; - read-only; - }; - - partition@100000 { - label = "s_env"; - reg = <0x100000 0x40000>; - }; - - partition@140000 { - label = "devinfo"; - reg = <0x140000 0x40000>; - read-only; - }; - - partition@180000 { - label = "kernel"; - reg = <0x180000 0x400000>; - }; - - partition@580000 { - label = "ubi"; - reg = <0x580000 0x2400000>; - }; - - partition@2980000 { - label = "alt_kernel"; - reg = <0x2980000 0x400000>; - read-only; - }; - - partition@2d80000 { - label = "alt_rootfs"; - reg = <0x2d80000 0x2400000>; - read-only; - }; - - partition@5180000 { - label = "sysdiag"; - reg = <0x5180000 0x100000>; - read-only; - }; - - partition@5280000 { - label = "syscfg"; - reg = <0x5280000 0x2d00000>; - read-only; - }; - }; -}; - -&state_default { - gpio { - groups = "i2c", "uart2", "uart3", "jtag", "wdt"; - function = "gpio"; - }; -}; - -&pcie { - status = "okay"; -}; - -&pcie0 { - mt76@0,0 { - compatible = "mediatek,mt76"; - reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; - }; -}; - -&pcie1 { - mt76@0,0 { - compatible = "mediatek,mt76"; - reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; - }; -}; - -&switch0 { - ports { - port@0 { - status = "okay"; - label = "wan"; - }; - - port@1 { - status = "okay"; - label = "lan1"; - }; - - port@2 { - status = "okay"; - label = "lan2"; - }; - - port@3 { - status = "okay"; - label = "lan3"; - }; - - port@4 { - status = "okay"; - label = "lan4"; - }; - }; }; diff --git a/target/linux/ramips/dts/mt7621_linksys_ea7xxx.dtsi b/target/linux/ramips/dts/mt7621_linksys_ea7xxx.dtsi new file mode 100644 index 0000000000..46b1c9cdfc --- /dev/null +++ b/target/linux/ramips/dts/mt7621_linksys_ea7xxx.dtsi @@ -0,0 +1,157 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include + +/ { + chosen { + bootargs = "console=ttyS0,115200"; + }; + + keys { + compatible = "gpio-keys"; + + wps { + label = "wps"; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + reset { + label = "reset"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&nand { + status = "okay"; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "boot"; + reg = <0x0 0x80000>; + read-only; + }; + + partition@80000 { + label = "u_env"; + reg = <0x80000 0x40000>; + read-only; + }; + + factory: partition@c0000 { + label = "factory"; + reg = <0xc0000 0x40000>; + read-only; + }; + + partition@100000 { + label = "s_env"; + reg = <0x100000 0x40000>; + }; + + partition@140000 { + label = "devinfo"; + reg = <0x140000 0x40000>; + read-only; + }; + + partition@180000 { + label = "kernel"; + reg = <0x180000 0x400000>; + }; + + partition@580000 { + label = "ubi"; + reg = <0x580000 0x2400000>; + }; + + partition@2980000 { + label = "alt_kernel"; + reg = <0x2980000 0x400000>; + read-only; + }; + + partition@2d80000 { + label = "alt_rootfs"; + reg = <0x2d80000 0x2400000>; + read-only; + }; + + partition@5180000 { + label = "sysdiag"; + reg = <0x5180000 0x100000>; + read-only; + }; + + partition@5280000 { + label = "syscfg"; + reg = <0x5280000 0x2d00000>; + read-only; + }; + }; +}; + +&state_default { + gpio { + groups = "i2c", "uart2", "uart3", "jtag", "wdt"; + function = "gpio"; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + mt76@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0000>; + }; +}; + +&pcie1 { + mt76@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + }; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "wan"; + }; + + port@1 { + status = "okay"; + label = "lan1"; + }; + + port@2 { + status = "okay"; + label = "lan2"; + }; + + port@3 { + status = "okay"; + label = "lan3"; + }; + + port@4 { + status = "okay"; + label = "lan4"; + }; + }; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 229897ffb5..e97d2315f1 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -7,7 +7,7 @@ include ./common-tp-link.mk DEFAULT_SOC := mt7621 KERNEL_DTB += -d21 -DEVICE_VARS += UIMAGE_MAGIC ELECOM_HWNAME +DEVICE_VARS += UIMAGE_MAGIC ELECOM_HWNAME LINKSYS_HWNAME # The OEM webinterface expects an kernel with initramfs which has the uImage # header field ih_name. @@ -539,21 +539,35 @@ define Device/lenovo_newifi-d1 endef TARGET_DEVICES += lenovo_newifi-d1 -define Device/linksys_ea7500-v2 +define Device/linksys_ea7xxx $(Device/uimage-lzma-loader) BLOCKSIZE := 128k PAGESIZE := 2048 KERNEL_SIZE := 4096k IMAGE_SIZE := 36864k DEVICE_VENDOR := Linksys - DEVICE_MODEL := EA7500 - DEVICE_VARIANT := v2 - DEVICE_PACKAGES := kmod-usb3 kmod-mt7615e kmod-mt7615-firmware wpad-basic uboot-envtools + DEVICE_PACKAGES := kmod-usb3 kmod-mt7615e kmod-mt7615-firmware wpad-basic \ + uboot-envtools UBINIZE_OPTS := -E 5 IMAGES := sysupgrade.bin factory.bin IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata | check-size IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | \ - append-ubi | check-size | linksys-image type=EA7500v2 + append-ubi | check-size | linksys-image type=$$$$(LINKSYS_HWNAME) +endef + +define Device/linksys_ea7300-v1 + $(Device/linksys_ea7xxx) + DEVICE_MODEL := EA7300 + DEVICE_VARIANT := v1 + LINKSYS_HWNAME := EA7300 +endef +TARGET_DEVICES += linksys_ea7300-v1 + +define Device/linksys_ea7500-v2 + $(Device/linksys_ea7xxx) + DEVICE_MODEL := EA7500 + DEVICE_VARIANT := v2 + LINKSYS_HWNAME := EA7500v2 endef TARGET_DEVICES += linksys_ea7500-v2 diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds index 02f264fb42..a44b1a09d0 100755 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds @@ -35,6 +35,7 @@ gnubee,gb-pc2) ucidef_set_led_netdev "lan1" "lan1" "$boardname:green:lan1" "lan1" ucidef_set_led_netdev "lan2" "lan2" "$boardname:green:lan2" "lan2" ;; +linksys,ea7300-v1|\ linksys,ea7500-v2) ucidef_set_led_netdev "lan1" "lan1 link" "$boardname:green:lan1" "lan1" "link" ucidef_set_led_netdev "lan2" "lan2 link" "$boardname:green:lan2" "lan2" "link" 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 ec05def88f..9c32f59ab8 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 @@ -100,6 +100,7 @@ ramips_setup_macs() wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr) label_mac=$wan_mac ;; + linksys,ea7300-v1|\ linksys,ea7500-v2) lan_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr) wan_mac=$lan_mac diff --git a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac index e05078648b..3f7fdc1a79 100644 --- a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac +++ b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac @@ -10,6 +10,7 @@ PHYNBR=${DEVPATH##*/phy} board=$(board_name) case "$board" in + linksys,ea7300-v1|\ linksys,ea7500-v2) hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr) [ "$PHYNBR" = "0" ] && macaddr_add $hw_mac_addr 1 > /sys${DEVPATH}/macaddress diff --git a/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount b/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount index e92912bbcc..b17161a50a 100755 --- a/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount +++ b/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount @@ -8,6 +8,7 @@ boot() { [ -n "$(fw_printenv bootcount bootchanged 2>/dev/null)" ] &&\ echo -e "bootcount\nbootchanged\n" | /usr/sbin/fw_setenv -s - ;; + linksys,ea7300-v1|\ linksys,ea7500-v2) mtd resetbc s_env || true ;; 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 a9a0bd40b9..01db733c98 100755 --- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh @@ -45,6 +45,7 @@ platform_do_upgrade() { asus,rt-ac65p|\ asus,rt-ac85p|\ hiwifi,hc5962|\ + linksys,ea7300-v1|\ linksys,ea7500-v2|\ netgear,r6220|\ netgear,r6260|\