diff --git a/target/linux/ipq40xx/patches-5.4/995-4g-add-u9300-driver.patch b/target/linux/ipq40xx/patches-5.4/998-4g-add-u9300-driver.patch similarity index 100% rename from target/linux/ipq40xx/patches-5.4/995-4g-add-u9300-driver.patch rename to target/linux/ipq40xx/patches-5.4/998-4g-add-u9300-driver.patch diff --git a/target/linux/ipq806x/files-5.4/arch/arm/boot/dts/qcom-ipq8064-mtfi-m520.dts b/target/linux/ipq806x/files-5.4/arch/arm/boot/dts/qcom-ipq8064-mtfi-m520.dts index b200a57fd1..239498147a 100644 --- a/target/linux/ipq806x/files-5.4/arch/arm/boot/dts/qcom-ipq8064-mtfi-m520.dts +++ b/target/linux/ipq806x/files-5.4/arch/arm/boot/dts/qcom-ipq8064-mtfi-m520.dts @@ -335,13 +335,6 @@ status = "okay"; phy-mode = "rgmii"; qcom,id = <1>; - qcom,phy_mdio_addr = <4>; - qcom,poll_required = <0>; - qcom,rgmii_delay = <1>; - qcom,phy_mii_type = <0>; - qcom,emulation = <0>; - qcom,irq = <255>; - mdiobus = <&mdio0>; pinctrl-0 = <&rgmii2_pins>; pinctrl-names = "default"; @@ -356,13 +349,6 @@ status = "okay"; phy-mode = "sgmii"; qcom,id = <2>; - qcom,phy_mdio_addr = <0>; /* none */ - qcom,poll_required = <0>; /* no polling */ - qcom,rgmii_delay = <0>; - qcom,phy_mii_type = <1>; - qcom,emulation = <0>; - qcom,irq = <258>; - mdiobus = <&mdio0>; fixed-link { speed = <1000>; diff --git a/target/linux/ramips/dts/mt7620a_iptime.dtsi b/target/linux/ramips/dts/mt7620a_iptime.dtsi index 5a6fdacb52..c7c90ca722 100644 --- a/target/linux/ramips/dts/mt7620a_iptime.dtsi +++ b/target/linux/ramips/dts/mt7620a_iptime.dtsi @@ -21,7 +21,7 @@ flash@0 { compatible = "jedec,spi-nor"; reg = <0>; - spi-max-frequency = <40000000>; + spi-max-frequency = <50000000>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ramips/dts/mt7620a_iptime_a1004ns.dts b/target/linux/ramips/dts/mt7620a_iptime_a1004ns.dts new file mode 100644 index 0000000000..02b674963b --- /dev/null +++ b/target/linux/ramips/dts/mt7620a_iptime_a1004ns.dts @@ -0,0 +1,104 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7620a_iptime.dtsi" + +/ { + compatible = "iptime,a1004ns", "ralink,mt7620a-soc"; + model = "ipTIME A1004ns"; + + aliases { + led-boot = &led_cpu; + led-failsafe = &led_cpu; + led-running = &led_cpu; + led-upgrade = &led_cpu; + }; + + leds { + compatible = "gpio-leds"; + + led_cpu: cpu { + label = "a1004ns:blue:cpu"; + gpios = <&gpio0 11 GPIO_ACTIVE_LOW>; + }; + + usb { + label = "a1004ns:blue:usb"; + gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; + trigger-sources = <&ohci_port1>, <&ehci_port1>; + linux,default-trigger = "usbport"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio0 1 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&firmware { + reg = <0x30000 0xfd0000>; +}; + +&state_default { + gpio { + ralink,group = "i2c", "uartf", "spi refclk"; + ralink,function = "gpio"; + }; +}; + +ðernet { + pinctrl-names = "default"; + pinctrl-0 = <&rgmii1_pins &mdio_pins>; + + port@5 { + status = "okay"; + mediatek,fixed-link = <1000 1 1 1>; + phy-mode = "rgmii"; + }; + + mdio-bus { + status = "okay"; + + ethernet-phy@0 { + reg = <0>; + phy-mode = "rgmii"; + }; + + ethernet-phy@1 { + reg = <1>; + phy-mode = "rgmii"; + }; + + ethernet-phy@2 { + reg = <2>; + phy-mode = "rgmii"; + }; + + ethernet-phy@3 { + reg = <3>; + phy-mode = "rgmii"; + }; + + ethernet-phy@4 { + reg = <4>; + phy-mode = "rgmii"; + }; + + ethernet-phy@1f { + reg = <0x1f>; + phy-mode = "rgmii"; + }; + }; +}; diff --git a/target/linux/ramips/dts/mt7621.dtsi b/target/linux/ramips/dts/mt7621.dtsi index 63befa1fdc..78979dc420 100644 --- a/target/linux/ramips/dts/mt7621.dtsi +++ b/target/linux/ramips/dts/mt7621.dtsi @@ -568,11 +568,10 @@ 0x01000000 0 0x00000000 0x1e160000 0 0x00010000 /* io space */ >; - #interrupt-cells = <1>; - interrupt-map-mask = <0xF0000 0 0 1>; - interrupt-map = <0x10000 0 0 1 &gic GIC_SHARED 4 IRQ_TYPE_LEVEL_HIGH>, - <0x20000 0 0 1 &gic GIC_SHARED 24 IRQ_TYPE_LEVEL_HIGH>, - <0x30000 0 0 1 &gic GIC_SHARED 25 IRQ_TYPE_LEVEL_HIGH>; + interrupt-parent = <&gic>; + interrupts = ; status = "disabled"; diff --git a/target/linux/ramips/dts/mt7621_hiwifi_hc5962.dts b/target/linux/ramips/dts/mt7621_hiwifi_hc5962.dts index 9d60d509ab..1bbfc157ae 100644 --- a/target/linux/ramips/dts/mt7621_hiwifi_hc5962.dts +++ b/target/linux/ramips/dts/mt7621_hiwifi_hc5962.dts @@ -44,6 +44,22 @@ linux,code = ; }; }; + + ubi-concat { + compatible = "mtd-concat"; + devices = <&ubipart0 &ubipart1>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + ubi@0 { + label = "ubi"; + reg = <0x0 0x79c0000>; + }; + }; + }; }; &nand { @@ -74,18 +90,12 @@ partition@140000 { label = "kernel"; - reg = <0x140000 0x200000>; + reg = <0x140000 0x400000>; }; - partition@340000 { - label = "ubi"; - reg = <0x340000 0x1E00000>; - }; - - partition@2140000 { - label = "hw_panic"; - reg = <0x2140000 0x80000>; - read-only; + ubipart0: partition@540000 { + label = "ubipart0"; + reg = <0x540000 0x1c80000>; }; partition@21c0000 { @@ -94,30 +104,9 @@ read-only; }; - partition@2240000 { - label = "backup"; - reg = <0x2240000 0x80000>; - read-only; - }; - - partition@22c0000 { - label = "overly"; - reg = <0x22c0000 0x1000000>; - }; - - partition@32c0000 { - label = "firmware_backup"; - reg = <0x32c0000 0x2000000>; - }; - - partition@52c0000 { - label = "oem"; - reg = <0x52c0000 0x200000>; - }; - - partition@54c0000 { - label = "opt"; - reg = <0x54c0000 0x2ac0000>; + ubipart1: partition@2240000 { + label = "ubipart1"; + reg = <0x2240000 0x5d40000>; }; }; }; diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile index ad13003e77..7d5c484a41 100644 --- a/target/linux/ramips/image/Makefile +++ b/target/linux/ramips/image/Makefile @@ -39,7 +39,7 @@ endef define Device/uimage-lzma-loader LOADER_TYPE := bin - KERNEL := $(KERNEL_DTB) | loader-kernel | uImage none + KERNEL := kernel-bin | append-dtb | lzma | loader-kernel | uImage none endef define Device/seama diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk index 30060da36f..48357832a6 100644 --- a/target/linux/ramips/image/mt7620.mk +++ b/target/linux/ramips/image/mt7620.mk @@ -503,6 +503,17 @@ define Device/iodata_wn-ac733gr3 endef TARGET_DEVICES += iodata_wn-ac733gr3 +define Device/iptime_a1004ns + SOC := mt7620a + IMAGE_SIZE := 16192k + UIMAGE_NAME := a1004ns + DEVICE_VENDOR := ipTIME + DEVICE_MODEL := A1004ns + DEVICE_PACKAGES := kmod-mt76x0e kmod-usb2 kmod-usb-ohci \ + kmod-usb-ledtrig-usbport +endef +TARGET_DEVICES += iptime_a1004ns + define Device/iptime_a104ns SOC := mt7620a IMAGE_SIZE := 8000k @@ -687,6 +698,7 @@ define Device/nexx_wt3020-4m DEVICE_MODEL := WT3020 DEVICE_VARIANT := 4M SUPPORTED_DEVICES += wt3020 wt3020-4M + DEFAULT := n endef TARGET_DEVICES += nexx_wt3020-4m @@ -975,6 +987,7 @@ define Device/vonets_var11n-300 BLOCKSIZE := 4k DEVICE_VENDOR := Vonets DEVICE_MODEL := VAR11N-300 + DEFAULT := n endef TARGET_DEVICES += vonets_var11n-300 @@ -1156,7 +1169,7 @@ define Device/zyxel_keenetic-omni DEVICE_MODEL := Keenetic Omni DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport IMAGES += factory.bin - IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | pad-to 64k | \ + IMAGE/factory.bin := $$(sysupgrade_bin) | pad-to 64k | \ check-size $$$$(IMAGE_SIZE) | zyimage -d 4882 -v "ZyXEL Keenetic Omni" SUPPORTED_DEVICES += kn_rc endef @@ -1169,7 +1182,7 @@ define Device/zyxel_keenetic-omni-ii DEVICE_MODEL := Keenetic Omni II DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport IMAGES += factory.bin - IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | pad-to 64k | \ + IMAGE/factory.bin := $$(sysupgrade_bin) | pad-to 64k | \ check-size $$$$(IMAGE_SIZE) | \ zyimage -d 2102034 -v "ZyXEL Keenetic Omni II" SUPPORTED_DEVICES += kn_rf diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 0514cbc24e..71f29c1918 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -251,6 +251,7 @@ endef TARGET_DEVICES += dlink_dir-878-a1 define Device/d-team_newifi-d2 + $(Device/uimage-lzma-loader) IMAGE_SIZE := 32448k DEVICE_VENDOR := Newifi DEVICE_MODEL := D2 @@ -400,6 +401,22 @@ define Device/iodata_wn-ax1167gr2 endef TARGET_DEVICES += iodata_wn-ax1167gr2 +define Device/iodata_wn-ax2033gr + BLOCKSIZE := 128k + PAGESIZE := 2048 + UBINIZE_OPTS := -E 5 + UIMAGE_MAGIC := 0x434f4d42 + KERNEL_SIZE := 4096k + IMAGE_SIZE := 51200k + DEVICE_VENDOR := I-O DATA + DEVICE_MODEL := WN-AX2033GR + KERNEL_INITRAMFS := $(KERNEL_DTB) | custom-initramfs-uimage 3.10(VST.1)C10 | \ + iodata-mstc-header + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata + DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e wpad-openssl +endef +TARGET_DEVICES += iodata_wn-ax2033gr + define Device/iodata_wn-dx1167r BLOCKSIZE := 128k PAGESIZE := 2048 @@ -474,6 +491,7 @@ endef TARGET_DEVICES += jdcloud_re-sp-01b define Device/lenovo_newifi-d1 + $(Device/uimage-lzma-loader) IMAGE_SIZE := 32448k DEVICE_VENDOR := Newifi DEVICE_MODEL := D1 @@ -758,6 +776,7 @@ endef TARGET_DEVICES += telco-electronics_x1 define Device/thunder_timecloud + $(Device/uimage-lzma-loader) IMAGE_SIZE := 16064k DEVICE_VENDOR := Thunder DEVICE_MODEL := Timecloud diff --git a/target/linux/ramips/image/rt288x.mk b/target/linux/ramips/image/rt288x.mk index 800dc553a2..acc267c9f3 100644 --- a/target/linux/ramips/image/rt288x.mk +++ b/target/linux/ramips/image/rt288x.mk @@ -21,6 +21,7 @@ define Device/airlink101_ar670w IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \ wrg-header wrgn16a_airlink_ar670w SUPPORTED_DEVICES += ar670w + DEFAULT := n endef TARGET_DEVICES += airlink101_ar670w @@ -32,6 +33,7 @@ define Device/airlink101_ar725w IMAGE/factory.bin := $$(sysupgrade_bin) | check-size 3328k | \ gemtek-header ar725w SUPPORTED_DEVICES += ar725w + DEFAULT := n endef TARGET_DEVICES += airlink101_ar725w @@ -42,6 +44,7 @@ define Device/asus_rt-n15 DEVICE_MODEL := RT-N15 DEVICE_PACKAGES := kmod-switch-rtl8366s SUPPORTED_DEVICES += rt-n15 + DEFAULT := n endef TARGET_DEVICES += asus_rt-n15 @@ -63,6 +66,7 @@ define Device/buffalo_wli-tx4-ag300n DEVICE_MODEL := WLI-TX4-AG300N DEVICE_PACKAGES := kmod-switch-ip17xx SUPPORTED_DEVICES += wli-tx4-ag300n + DEFAULT := n endef TARGET_DEVICES += buffalo_wli-tx4-ag300n @@ -73,6 +77,7 @@ define Device/buffalo_wzr-agl300nh DEVICE_MODEL := WZR-AGL300NH DEVICE_PACKAGES := kmod-switch-rtl8366s SUPPORTED_DEVICES += wzr-agl300nh + DEFAULT := n endef TARGET_DEVICES += buffalo_wzr-agl300nh @@ -88,6 +93,7 @@ define Device/dlink_dap-1522-a1 IMAGE/factory.bin := append-kernel | pad-offset $$$$(BLOCKSIZE) 96 | \ append-rootfs | pad-rootfs -x 96 | wrg-header wapnd01_dlink_dap1522 | \ check-size $$$$(IMAGE_SIZE) + DEFAULT := n endef TARGET_DEVICES += dlink_dap-1522-a1 @@ -97,5 +103,6 @@ define Device/ralink_v11st-fe DEVICE_VENDOR := Ralink DEVICE_MODEL := V11ST-FE SUPPORTED_DEVICES += v11st-fe + DEFAULT := n endef TARGET_DEVICES += ralink_v11st-fe diff --git a/target/linux/ramips/image/rt305x.mk b/target/linux/ramips/image/rt305x.mk index 0c0ee63f14..5c520dc532 100644 --- a/target/linux/ramips/image/rt305x.mk +++ b/target/linux/ramips/image/rt305x.mk @@ -30,6 +30,7 @@ define Device/7links_px-4885-4m DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb2 kmod-usb-ohci \ kmod-usb-ledtrig-usbport kmod-leds-gpio SUPPORTED_DEVICES += px-4885-4M + DEFAULT := n endef TARGET_DEVICES += 7links_px-4885-4m @@ -71,6 +72,7 @@ define Device/airlive_air3gii DEVICE_VENDOR := AirLive DEVICE_MODEL := Air3GII SUPPORTED_DEVICES += air3gii + DEFAULT := n endef TARGET_DEVICES += airlive_air3gii @@ -91,6 +93,7 @@ define Device/allnet_all0256n-4m DEVICE_VARIANT := 4M DEVICE_PACKAGES := rssileds SUPPORTED_DEVICES += all0256n-4M + DEFAULT := n endef TARGET_DEVICES += allnet_all0256n-4m @@ -111,7 +114,7 @@ define Device/allnet_all5002 DEVICE_VENDOR := Allnet DEVICE_MODEL := ALL5002 DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport \ - kmod-i2c-core kmod-i2c-gpio kmod-hwmon-lm92 kmod-gpio-pcf857x + kmod-i2c-gpio kmod-hwmon-lm92 kmod-gpio-pcf857x SUPPORTED_DEVICES += all5002 endef TARGET_DEVICES += allnet_all5002 @@ -122,7 +125,7 @@ define Device/allnet_all5003 DEVICE_VENDOR := Allnet DEVICE_MODEL := ALL5003 DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport \ - kmod-i2c-core kmod-i2c-gpio kmod-hwmon-lm92 kmod-gpio-pcf857x + kmod-i2c-gpio kmod-hwmon-lm92 kmod-gpio-pcf857x SUPPORTED_DEVICES += all5003 endef TARGET_DEVICES += allnet_all5003 @@ -175,6 +178,7 @@ define Device/asiarf_awapn2403 DEVICE_VENDOR := AsiaRF DEVICE_MODEL := AWAPN2403 SUPPORTED_DEVICES += awapn2403 + DEFAULT := n endef TARGET_DEVICES += asiarf_awapn2403 @@ -184,8 +188,9 @@ define Device/asiarf_awm002-evb-4m DEVICE_VENDOR := AsiaRF DEVICE_MODEL := AWM002-EVB DEVICE_VARIANT := 4M - DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-i2c-core kmod-i2c-gpio + DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-i2c-gpio SUPPORTED_DEVICES += awm002-evb-4M + DEFAULT := n endef TARGET_DEVICES += asiarf_awm002-evb-4m @@ -195,7 +200,7 @@ define Device/asiarf_awm002-evb-8m DEVICE_VENDOR := AsiaRF DEVICE_MODEL := AWM002-EVB/AWM003-EVB DEVICE_VARIANT := 8M - DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-i2c-core kmod-i2c-gpio + DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-i2c-gpio SUPPORTED_DEVICES += awm002-evb-8M endef TARGET_DEVICES += asiarf_awm002-evb-8m @@ -208,6 +213,7 @@ define Device/asus_rt-g32-b1 DEVICE_MODEL := RT-G32 DEVICE_VARIANT := B1 SUPPORTED_DEVICES += rt-g32-b1 + DEFAULT := n endef TARGET_DEVICES += asus_rt-g32-b1 @@ -218,6 +224,7 @@ define Device/asus_rt-n10-plus DEVICE_VENDOR := Asus DEVICE_MODEL := RT-N10+ SUPPORTED_DEVICES += rt-n10-plus + DEFAULT := n endef TARGET_DEVICES += asus_rt-n10-plus @@ -238,6 +245,7 @@ define Device/asus_wl-330n DEVICE_VENDOR := Asus DEVICE_MODEL := WL-330N SUPPORTED_DEVICES += wl-330n + DEFAULT := n endef TARGET_DEVICES += asus_wl-330n @@ -249,6 +257,7 @@ define Device/asus_wl-330n3g DEVICE_MODEL := WL-330N3G DEVICE_PACKAGES := SUPPORTED_DEVICES += wl-330n3g + DEFAULT := n endef TARGET_DEVICES += asus_wl-330n3g @@ -304,6 +313,7 @@ define Device/buffalo_whr-g300n IMAGE/tftp.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \ buffalo-tftp-header SUPPORTED_DEVICES += whr-g300n + DEFAULT := n endef TARGET_DEVICES += buffalo_whr-g300n @@ -329,6 +339,7 @@ define Device/dlink_dcs-930 DEVICE_PACKAGES := kmod-video-core kmod-video-uvc kmod-sound-core \ kmod-usb-audio kmod-usb-dwc2 SUPPORTED_DEVICES += dcs-930 + DEFAULT := n endef TARGET_DEVICES += dlink_dcs-930 @@ -341,6 +352,7 @@ define Device/dlink_dcs-930l-b1 DEVICE_PACKAGES := kmod-video-core kmod-video-uvc kmod-sound-core \ kmod-usb-audio kmod-usb-ohci kmod-usb2 SUPPORTED_DEVICES += dcs-930l-b1 + DEFAULT := n endef TARGET_DEVICES += dlink_dcs-930l-b1 @@ -354,6 +366,7 @@ define Device/dlink_dir-300-b1 DEVICE_MODEL := DIR-300 DEVICE_VARIANT := B1 SUPPORTED_DEVICES += dir-300-b1 + DEFAULT := n endef TARGET_DEVICES += dlink_dir-300-b1 @@ -388,6 +401,7 @@ define Device/dlink_dir-600-b1 DEVICE_MODEL := DIR-600 DEVICE_VARIANT := B1/B2 SUPPORTED_DEVICES += dir-600-b1 dir-600-b2 + DEFAULT := n endef TARGET_DEVICES += dlink_dir-600-b1 @@ -403,6 +417,7 @@ define Device/dlink_dir-610-a1 DEVICE_VARIANT := A1 DEVICE_PACKAGES := kmod-ledtrig-netdev kmod-ledtrig-timer SUPPORTED_DEVICES += dir-610-a1 + DEFAULT := n endef TARGET_DEVICES += dlink_dir-610-a1 @@ -416,6 +431,7 @@ define Device/dlink_dir-615-d DEVICE_MODEL := DIR-615 DEVICE_VARIANT := D SUPPORTED_DEVICES += dir-615-d + DEFAULT := n endef TARGET_DEVICES += dlink_dir-615-d @@ -429,6 +445,7 @@ define Device/dlink_dir-615-h1 DEVICE_MODEL := DIR-615 DEVICE_VARIANT := H1 SUPPORTED_DEVICES += dir-615-h1 + DEFAULT := n endef TARGET_DEVICES += dlink_dir-615-h1 @@ -490,6 +507,7 @@ define Device/edimax_3g-6200n DEVICE_VENDOR := Edimax DEVICE_MODEL := 3g-6200n SUPPORTED_DEVICES += 3g-6200n + DEFAULT := n endef TARGET_DEVICES += edimax_3g-6200n @@ -502,6 +520,7 @@ define Device/edimax_3g-6200nl DEVICE_VENDOR := Edimax DEVICE_MODEL := 3g-6200nl SUPPORTED_DEVICES += 3g-6200nl + DEFAULT := n endef TARGET_DEVICES += edimax_3g-6200nl @@ -512,6 +531,7 @@ define Device/engenius_esr-9753 DEVICE_VENDOR := EnGenius DEVICE_MODEL := ESR-9753 SUPPORTED_DEVICES += esr-9753 + DEFAULT := n endef TARGET_DEVICES += engenius_esr-9753 @@ -538,6 +558,7 @@ define Device/hame_mpr-a1 DEVICE_VARIANT := A1 DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-ledtrig-netdev SUPPORTED_DEVICES += mpr-a1 + DEFAULT := n endef TARGET_DEVICES += hame_mpr-a1 @@ -573,6 +594,7 @@ define Device/hilink_hlk-rm04 DEVICE_VENDOR := Hi-Link DEVICE_MODEL := HLK-RM04 SUPPORTED_DEVICES += hlk-rm04 + DEFAULT := n endef TARGET_DEVICES += hilink_hlk-rm04 @@ -593,6 +615,7 @@ define Device/huawei_d105 DEVICE_VENDOR := Huawei DEVICE_MODEL := D105 SUPPORTED_DEVICES += d105 + DEFAULT := n endef TARGET_DEVICES += huawei_d105 @@ -626,6 +649,7 @@ define Device/jcg_jhr-n805r DEVICE_VENDOR := JCG DEVICE_MODEL := JHR-N805R SUPPORTED_DEVICES += jhr-n805r + DEFAULT := n endef TARGET_DEVICES += jcg_jhr-n805r @@ -638,6 +662,7 @@ define Device/jcg_jhr-n825r DEVICE_VENDOR := JCG DEVICE_MODEL := JHR-N825R SUPPORTED_DEVICES += jhr-n825r + DEFAULT := n endef TARGET_DEVICES += jcg_jhr-n825r @@ -650,6 +675,7 @@ define Device/jcg_jhr-n926r DEVICE_VENDOR := JCG DEVICE_MODEL := JHR-N926R SUPPORTED_DEVICES += jhr-n926r + DEFAULT := n endef TARGET_DEVICES += jcg_jhr-n926r @@ -669,6 +695,7 @@ define Device/netcore_nw718 DEVICE_VENDOR := Netcore DEVICE_MODEL := NW718 SUPPORTED_DEVICES += nw718 + DEFAULT := n endef TARGET_DEVICES += netcore_nw718 @@ -683,6 +710,7 @@ define Device/netgear_wnce2001 DEVICE_VENDOR := NETGEAR DEVICE_MODEL := WNCE2001 SUPPORTED_DEVICES += wnce2001 + DEFAULT := n endef TARGET_DEVICES += netgear_wnce2001 @@ -705,6 +733,7 @@ define Device/nexx_wt1520-4m DEVICE_MODEL := WT1520 DEVICE_VARIANT := 4M SUPPORTED_DEVICES += wt1520-4M + DEFAULT := n endef TARGET_DEVICES += nexx_wt1520-4m @@ -727,7 +756,7 @@ define Device/nixcore_x1-16m DEVICE_VENDOR := Nixcore DEVICE_MODEL := X1 DEVICE_VARIANT := 16M - DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-i2c-core kmod-i2c-ralink \ + DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-i2c-ralink \ kmod-spi-dev SUPPORTED_DEVICES += nixcore-x1 nixcore-x1-16M endef @@ -739,7 +768,7 @@ define Device/nixcore_x1-8m DEVICE_VENDOR := Nixcore DEVICE_MODEL := X1 DEVICE_VARIANT := 8M - DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-i2c-core kmod-i2c-ralink \ + DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-i2c-ralink \ kmod-spi-dev SUPPORTED_DEVICES += nixcore-x1 nixcore-x1-8M endef @@ -750,7 +779,7 @@ define Device/olimex_rt5350f-olinuxino IMAGE_SIZE := 7872k DEVICE_VENDOR := OLIMEX DEVICE_MODEL := RT5350F-OLinuXino - DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-i2c-core kmod-i2c-ralink \ + DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-i2c-ralink \ kmod-spi-dev SUPPORTED_DEVICES += rt5350f-olinuxino endef @@ -761,7 +790,7 @@ define Device/olimex_rt5350f-olinuxino-evb IMAGE_SIZE := 7872k DEVICE_VENDOR := OLIMEX DEVICE_MODEL := RT5350F-OLinuXino-EVB - DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-i2c-core kmod-i2c-ralink \ + DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-i2c-ralink \ kmod-spi-dev SUPPORTED_DEVICES += rt5350f-olinuxino-evb endef @@ -792,6 +821,7 @@ define Device/petatel_psr-680w DEVICE_VENDOR := Petatel DEVICE_MODEL := PSR-680W Wireless 3G Router SUPPORTED_DEVICES += psr-680w + DEFAULT := n endef TARGET_DEVICES += petatel_psr-680w @@ -803,6 +833,7 @@ define Device/planex_mzk-dp150n DEVICE_MODEL := MZK-DP150N DEVICE_PACKAGES := kmod-spi-dev SUPPORTED_DEVICES += mzk-dp150n + DEFAULT := n endef TARGET_DEVICES += planex_mzk-dp150n @@ -815,6 +846,7 @@ define Device/planex_mzk-w300nh2 DEVICE_VENDOR := Planex DEVICE_MODEL := MZK-W300NH2 SUPPORTED_DEVICES += mzk-w300nh2 + DEFAULT := n endef TARGET_DEVICES += planex_mzk-w300nh2 @@ -846,6 +878,7 @@ define Device/poray_m3 DEVICE_MODEL := M3 DEVICE_PACKAGES := kmod-usb2 kmod-ledtrig-netdev kmod-ledtrig-timer SUPPORTED_DEVICES += m3 + DEFAULT := n endef TARGET_DEVICES += poray_m3 @@ -860,6 +893,7 @@ define Device/poray_m4-4m DEVICE_VARIANT := 4M DEVICE_PACKAGES := kmod-usb2 kmod-ledtrig-netdev kmod-ledtrig-timer SUPPORTED_DEVICES += m4-4M + DEFAULT := n endef TARGET_DEVICES += poray_m4-4m @@ -920,6 +954,7 @@ define Device/ralink_v22rw-2x2 DEVICE_VENDOR := Ralink DEVICE_MODEL := AP-RT3052-V22RW-2X2 SUPPORTED_DEVICES += v22rw-2x2 + DEFAULT := n endef TARGET_DEVICES += ralink_v22rw-2x2 @@ -931,6 +966,7 @@ define Device/sitecom_wl-351 DEVICE_MODEL := WL-351 v1 DEVICE_PACKAGES := kmod-switch-rtl8366rb kmod-swconfig swconfig SUPPORTED_DEVICES += wl-351 + DEFAULT := n endef TARGET_DEVICES += sitecom_wl-351 @@ -941,6 +977,7 @@ define Device/skyline_sl-r7205 DEVICE_VENDOR := Skyline DEVICE_MODEL := SL-R7205 Wireless 3G Router SUPPORTED_DEVICES += sl-r7205 + DEFAULT := n endef TARGET_DEVICES += skyline_sl-r7205 @@ -951,6 +988,7 @@ define Device/sparklan_wcr-150gn DEVICE_VENDOR := Sparklan DEVICE_MODEL := WCR-150GN SUPPORTED_DEVICES += wcr-150gn + DEFAULT := n endef TARGET_DEVICES += sparklan_wcr-150gn @@ -973,6 +1011,7 @@ define Device/tenda_3g150b DEVICE_MODEL := 3G150B DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport SUPPORTED_DEVICES += 3g150b + DEFAULT := n endef TARGET_DEVICES += tenda_3g150b @@ -984,6 +1023,7 @@ define Device/tenda_3g300m DEVICE_MODEL := 3G300M DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport SUPPORTED_DEVICES += 3g300m + DEFAULT := n endef TARGET_DEVICES += tenda_3g300m @@ -994,6 +1034,7 @@ define Device/tenda_w150m DEVICE_VENDOR := Tenda DEVICE_MODEL := W150M SUPPORTED_DEVICES += w150m + DEFAULT := n endef TARGET_DEVICES += tenda_w150m @@ -1005,6 +1046,7 @@ define Device/tenda_w306r-v2 DEVICE_MODEL := W306R DEVICE_VARIANT := V2.0 SUPPORTED_DEVICES += w306r-v20 + DEFAULT := n endef TARGET_DEVICES += tenda_w306r-v2 @@ -1018,6 +1060,7 @@ define Device/trendnet_tew-638apb-v2 DEVICE_MODEL := TEW-638APB DEVICE_VARIANT := v2 SUPPORTED_DEVICES += tew-638apb-v2 + DEFAULT := n endef TARGET_DEVICES += trendnet_tew-638apb-v2 @@ -1040,6 +1083,7 @@ define Device/unbranded_a5-v11 DEVICE_MODEL := A5-V11 DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 SUPPORTED_DEVICES += a5-v11 + DEFAULT := n endef TARGET_DEVICES += unbranded_a5-v11 @@ -1050,6 +1094,7 @@ define Device/unbranded_wr512-3gn-4m DEVICE_MODEL := WR512-3GN DEVICE_VARIANT := 4M SUPPORTED_DEVICES += wr512-3gn-4M + DEFAULT := n endef TARGET_DEVICES += unbranded_wr512-3gn-4m @@ -1070,6 +1115,7 @@ define Device/unbranded_xdx-rn502j DEVICE_VENDOR := XDX DEVICE_MODEL := RN502J SUPPORTED_DEVICES += xdxrn502j + DEFAULT := n endef TARGET_DEVICES += unbranded_xdx-rn502j @@ -1081,6 +1127,7 @@ define Device/upvel_ur-326n4g DEVICE_MODEL := UR-326N4G DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport SUPPORTED_DEVICES += ur-326n4g + DEFAULT := n endef TARGET_DEVICES += upvel_ur-326n4g @@ -1100,7 +1147,7 @@ define Device/vocore_vocore-16m DEVICE_VENDOR := VoCore DEVICE_MODEL := VoCore DEVICE_VARIANT := 16M - DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-i2c-core kmod-i2c-ralink \ + DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-i2c-ralink \ kmod-spi-dev SUPPORTED_DEVICES += vocore vocore-16M endef @@ -1112,7 +1159,7 @@ define Device/vocore_vocore-8m DEVICE_VENDOR := VoCore DEVICE_MODEL := VoCore DEVICE_VARIANT := 8M - DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-i2c-core kmod-i2c-ralink \ + DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-i2c-ralink \ kmod-spi-dev SUPPORTED_DEVICES += vocore vocore-8M endef @@ -1162,6 +1209,7 @@ define Device/zyxel_keenetic-start IMAGE_SIZE := 3776k DEVICE_VENDOR := ZyXEL DEVICE_MODEL := Keenetic Start + DEFAULT := n endef TARGET_DEVICES += zyxel_keenetic-start @@ -1172,6 +1220,7 @@ define Device/zyxel_nbg-419n DEVICE_VENDOR := ZyXEL DEVICE_MODEL := NBG-419N SUPPORTED_DEVICES += nbg-419n + DEFAULT := n endef TARGET_DEVICES += zyxel_nbg-419n diff --git a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network index 71326b3aaa..ba9d34bf60 100755 --- a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network @@ -143,7 +143,8 @@ ramips_setup_interfaces() "0:lan" "1:lan" "5:wan" "6@eth0" ;; iodata,wn-ac1167gr|\ - iodata,wn-ac733gr3) + iodata,wn-ac733gr3|\ + iptime,a1004ns) ucidef_add_switch "switch0" ucidef_add_switch_attr "switch0" "enable" "false" ucidef_add_switch "switch1" \ @@ -316,6 +317,9 @@ ramips_setup_macs() iodata,wn-ac733gr3) wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr) ;; + iptime,a1004ns) + wan_mac=$(mtd_get_mac_binary u-boot 0x1fc40) + ;; iptime,a104ns) wan_mac=$(macaddr_add "$(mtd_get_mac_binary u-boot 0x1fc20)" 2) ;; diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/03_gpio_switches b/target/linux/ramips/mt7621/base-files/etc/board.d/03_gpio_switches index 91a9459d8c..24bfcb2051 100755 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/03_gpio_switches +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/03_gpio_switches @@ -14,14 +14,14 @@ telco-electronics,x1) ucidef_add_gpio_switch "modem_reset" "Modem Reset" "16" ;; ubnt,edgerouter-x) - ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "0" + ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "480" ;; ubnt,edgerouter-x-sfp) - ucidef_add_gpio_switch "poe_power_port0" "PoE Power Port0" "496" - ucidef_add_gpio_switch "poe_power_port1" "PoE Power Port1" "497" - ucidef_add_gpio_switch "poe_power_port2" "PoE Power Port2" "498" - ucidef_add_gpio_switch "poe_power_port3" "PoE Power Port3" "499" - ucidef_add_gpio_switch "poe_power_port4" "PoE Power Port4" "500" + ucidef_add_gpio_switch "poe_power_port0" "PoE Power Port0" "400" + ucidef_add_gpio_switch "poe_power_port1" "PoE Power Port1" "401" + ucidef_add_gpio_switch "poe_power_port2" "PoE Power Port2" "402" + ucidef_add_gpio_switch "poe_power_port3" "PoE Power Port3" "403" + ucidef_add_gpio_switch "poe_power_port4" "PoE Power Port4" "404" ;; esac diff --git a/target/linux/ramips/mt7621/base-files/etc/uci-defaults/04_led_migration b/target/linux/ramips/mt7621/base-files/etc/uci-defaults/04_led_migration index 2e824c4d69..73140fd7d5 100644 --- a/target/linux/ramips/mt7621/base-files/etc/uci-defaults/04_led_migration +++ b/target/linux/ramips/mt7621/base-files/etc/uci-defaults/04_led_migration @@ -16,6 +16,7 @@ mikrotik,routerboard-m33g) netgear,wndr3700-v5) migrate_leds "^wndr3700v5:=$boardonly:" ;; + esac migrations_apply system diff --git a/target/linux/ramips/mt7621/config-5.4 b/target/linux/ramips/mt7621/config-5.4 index 2d887d776b..e91003d8d2 100644 --- a/target/linux/ramips/mt7621/config-5.4 +++ b/target/linux/ramips/mt7621/config-5.4 @@ -217,6 +217,7 @@ 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_MTD_VIRT_CONCAT=y # CONFIG_MTK_HSDMA is not set CONFIG_NEED_DMA_MAP_STATE=y CONFIG_NET_DEVLINK=y diff --git a/target/linux/ramips/patches-4.14/0025-pinctrl-ralink-add-pinctrl-driver.patch b/target/linux/ramips/patches-4.14/0025-pinctrl-ralink-add-pinctrl-driver.patch index a374e01b59..497110bb37 100644 --- a/target/linux/ramips/patches-4.14/0025-pinctrl-ralink-add-pinctrl-driver.patch +++ b/target/linux/ramips/patches-4.14/0025-pinctrl-ralink-add-pinctrl-driver.patch @@ -156,8 +156,8 @@ Signed-off-by: John Crispin + struct pinctrl_map **map) +{ + const char *function; -+ int func = of_property_read_string(np, "ralink,function", &function); -+ int grps = of_property_count_strings(np, "ralink,group"); ++ int func = of_property_read_string(np, "function", &function); ++ int grps = of_property_count_strings(np, "groups"); + int i; + + if (func || !grps) @@ -166,7 +166,7 @@ Signed-off-by: John Crispin + for (i = 0; i < grps; i++) { + const char *group; + -+ of_property_read_string_index(np, "ralink,group", i, &group); ++ of_property_read_string_index(np, "groups", i, &group); + + (*map)->type = PIN_MAP_TYPE_MUX_GROUP; + (*map)->name = function; @@ -186,7 +186,7 @@ Signed-off-by: John Crispin + struct device_node *np; + + for_each_child_of_node(np_config, np) { -+ int ret = of_property_count_strings(np, "ralink,group"); ++ int ret = of_property_count_strings(np, "groups"); + + if (ret >= 0) + max_maps += ret; @@ -482,7 +482,7 @@ Signed-off-by: John Crispin + if (!of_device_is_available(np)) + continue; + -+ ngpio = of_get_property(np, "ralink,nr-gpio", NULL); ++ ngpio = of_get_property(np, "ralink,num-gpios", NULL); + gpiobase = of_get_property(np, "ralink,gpio-base", NULL); + if (!ngpio || !gpiobase) { + dev_err(&pdev->dev, "failed to load chip info\n"); diff --git a/target/linux/ramips/patches-4.14/0026-DT-Add-documentation-for-gpio-ralink.patch b/target/linux/ramips/patches-4.14/0026-DT-Add-documentation-for-gpio-ralink.patch index 0bce0b433a..7d5f98f647 100644 --- a/target/linux/ramips/patches-4.14/0026-DT-Add-documentation-for-gpio-ralink.patch +++ b/target/linux/ramips/patches-4.14/0026-DT-Add-documentation-for-gpio-ralink.patch @@ -29,7 +29,7 @@ Cc: linux-gpio@vger.kernel.org +- reg : Physical base address and length of the controller's registers +- interrupt-parent: phandle to the INTC device node +- interrupts : Specify the INTC interrupt number -+- ralink,nr-gpio : Specify the number of GPIOs ++- ralink,num-gpios : Specify the number of GPIOs +- ralink,register-map : The register layout depends on the GPIO bank and actual + SoC type. Register offsets need to be in this order. + [ INT, EDGE, RENA, FENA, DATA, DIR, POL, SET, RESET, TOGGLE ] @@ -51,7 +51,7 @@ Cc: linux-gpio@vger.kernel.org + interrupts = <6>; + + ralink,gpio-base = <0>; -+ ralink,nr-gpio = <24>; ++ ralink,num-gpios = <24>; + ralink,register-map = [ 00 04 08 0c + 20 24 28 2c + 30 34 ]; diff --git a/target/linux/ramips/patches-4.14/0027-GPIO-MIPS-ralink-add-gpio-driver-for-ralink-SoC.patch b/target/linux/ramips/patches-4.14/0027-GPIO-MIPS-ralink-add-gpio-driver-for-ralink-SoC.patch index eaae0d3d02..35cedf61fd 100644 --- a/target/linux/ramips/patches-4.14/0027-GPIO-MIPS-ralink-add-gpio-driver-for-ralink-SoC.patch +++ b/target/linux/ramips/patches-4.14/0027-GPIO-MIPS-ralink-add-gpio-driver-for-ralink-SoC.patch @@ -371,7 +371,7 @@ Cc: linux-gpio@vger.kernel.org + return -EINVAL; + } + -+ ngpio = of_get_property(np, "ralink,nr-gpio", NULL); ++ ngpio = of_get_property(np, "ralink,num-gpios", NULL); + if (!ngpio) { + dev_err(&pdev->dev, "failed to read number of pins\n"); + return -EINVAL; diff --git a/target/linux/ramips/patches-4.14/200-add-ralink-eth.patch b/target/linux/ramips/patches-4.14/200-add-ralink-eth.patch new file mode 100644 index 0000000000..b662fe5e6f --- /dev/null +++ b/target/linux/ramips/patches-4.14/200-add-ralink-eth.patch @@ -0,0 +1,20 @@ +--- a/drivers/net/ethernet/Kconfig ++++ b/drivers/net/ethernet/Kconfig +@@ -159,6 +159,7 @@ source "drivers/net/ethernet/packetengin + source "drivers/net/ethernet/pasemi/Kconfig" + source "drivers/net/ethernet/qlogic/Kconfig" + source "drivers/net/ethernet/qualcomm/Kconfig" ++source "drivers/net/ethernet/ralink/Kconfig" + source "drivers/net/ethernet/realtek/Kconfig" + source "drivers/net/ethernet/renesas/Kconfig" + source "drivers/net/ethernet/rdc/Kconfig" +--- a/drivers/net/ethernet/Makefile ++++ b/drivers/net/ethernet/Makefile +@@ -70,6 +70,7 @@ obj-$(CONFIG_NET_PACKET_ENGINE) += packe + obj-$(CONFIG_NET_VENDOR_PASEMI) += pasemi/ + obj-$(CONFIG_NET_VENDOR_QLOGIC) += qlogic/ + obj-$(CONFIG_NET_VENDOR_QUALCOMM) += qualcomm/ ++obj-$(CONFIG_NET_VENDOR_RALINK) += ralink/ + obj-$(CONFIG_NET_VENDOR_REALTEK) += realtek/ + obj-$(CONFIG_NET_VENDOR_RENESAS) += renesas/ + obj-$(CONFIG_NET_VENDOR_RDC) += rdc/ diff --git a/target/linux/ramips/patches-5.4/0120-staging-mt7621-pci-properly-power-off-dual-ported-pc.patch b/target/linux/ramips/patches-5.4/0120-staging-mt7621-pci-properly-power-off-dual-ported-pc.patch new file mode 100644 index 0000000000..9efcb8011a --- /dev/null +++ b/target/linux/ramips/patches-5.4/0120-staging-mt7621-pci-properly-power-off-dual-ported-pc.patch @@ -0,0 +1,65 @@ +From 5fcded5e857cf66c9592e4be28c4dab4520c9177 Mon Sep 17 00:00:00 2001 +From: Sergio Paracuellos +Date: Thu, 9 Apr 2020 13:16:52 +0200 +Subject: [PATCH] staging: mt7621-pci: properly power off dual-ported pcie phy + +Pcie phy for pcie0 and pcie1 is shared using a dual ported +one. Current code was assuming that if nothing is connected +in pcie0 it won't be also nothing connected in pcie1. This +assumtion is wrong for some devices such us 'Mikrotik rbm33g' +and 'ZyXEL LTE3301-PLUS' where only connecting a card to the +second bus on the phy is possible. For such devices kernel +hangs in the same point because of the wrong poweroff of the +phy getting the following trace: + +mt7621-pci-phy 1e149000.pcie-phy: PHY for 0xbe149000 (dual port = 1) +mt7621-pci-phy 1e14a000.pcie-phy: PHY for 0xbe14a000 (dual port = 0) +mt7621-pci-phy 1e149000.pcie-phy: Xtal is 40MHz +mt7621-pci-phy 1e14a000.pcie-phy: Xtal is 40MHz +mt7621-pci 1e140000.pcie: pcie0 no card, disable it (RST & CLK) +[hangs] + +The wrong assumption is located in the 'mt7621_pcie_init_ports' +function where we are just making a power off of the phy for +slots 0 and 2 if nothing is connected in them. Hence, only +poweroff the phy if nothing is connected in both slot 0 and +slot 1 avoiding the kernel to hang. + +Fixes: 5737cfe87a9c ("staging: mt7621-pci: avoid to poweroff the phy for slot one") +Signed-off-by: Sergio Paracuellos +Link: https://lore.kernel.org/r/20200409111652.30964-1-sergio.paracuellos@gmail.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/staging/mt7621-pci/pci-mt7621.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +--- a/drivers/staging/mt7621-pci/pci-mt7621.c ++++ b/drivers/staging/mt7621-pci/pci-mt7621.c +@@ -502,17 +502,25 @@ static void mt7621_pcie_init_ports(struc + + mt7621_pcie_reset_ep_deassert(pcie); + ++ tmp = NULL; + list_for_each_entry(port, &pcie->ports, list) { + u32 slot = port->slot; + + if (!mt7621_pcie_port_is_linkup(port)) { + dev_err(dev, "pcie%d no card, disable it (RST & CLK)\n", + slot); +- if (slot != 1) +- phy_power_off(port->phy); + mt7621_control_assert(port); + mt7621_pcie_port_clk_disable(port); + port->enabled = false; ++ ++ if (slot == 0) { ++ tmp = port; ++ continue; ++ } ++ ++ if (slot == 1 && tmp && !tmp->enabled) ++ phy_power_off(tmp->phy); ++ + } + } + } diff --git a/target/linux/ramips/patches-5.4/0121-staging-mt7621-pci-fix-PCIe-interrupt-mapping.patch b/target/linux/ramips/patches-5.4/0121-staging-mt7621-pci-fix-PCIe-interrupt-mapping.patch new file mode 100644 index 0000000000..68de6df2db --- /dev/null +++ b/target/linux/ramips/patches-5.4/0121-staging-mt7621-pci-fix-PCIe-interrupt-mapping.patch @@ -0,0 +1,157 @@ +From fab6710e4c51f4eb622f95a08322ab5fdbe3f295 Mon Sep 17 00:00:00 2001 +From: Sergio Paracuellos +Date: Mon, 13 Apr 2020 07:59:42 +0200 +Subject: [PATCH] staging: mt7621-pci: fix PCIe interrupt mapping + +MT7621 has three assigned interrupts for the pcie. This +interrupts should properly being mapped taking into account +which devices are finally connected in which bus according +to link status. So the irq mappings should be as follows +according to link status (three bits indicating which devices +are link up): + +* For PCIe Bus 1 slot 0: + - status = 0x2 || status = 0x6 => IRQ = pcie1_irq (24). + - status = 0x4 => IRQ = pcie2_irq (25). + - default => IRQ = pcie0_irq (23). +* For PCIe Bus 2 slot 0: + - status = 0x5 || status = 0x6 => IRQ = pcie2_irq (25). + - default => IRQ = pcie1_irq (24). +* For PCIe Bus 2 slot 1: + - status = 0x5 || status = 0x6 => IRQ = pcie2_irq (25). + - default => IRQ = pcie1_irq (24). +* For PCIe Bus 3 any slot: + - default => IRQ = pcie2_irq (25). + +Because of this, the function 'of_irq_parse_and_map_pci' cannot +be used and we need to change device tree information from using +the 'interrupt-map' and 'interrupt-map-mask' properties into an +'interrupts' property to be able to get irq information from the +ports using the 'platform_get_irq' and storing an 'irq-map' into +the pcie driver data node to properly map correct irq using a +new 'mt7621_map_irq' function where this map will be read and the +correct irq returned. + +Fixes: 46d093124df4 ("staging: mt7621-pci: improve interrupt mapping") +Signed-off-by: Sergio Paracuellos +Link: https://lore.kernel.org/r/20200413055942.2714-1-sergio.paracuellos@gmail.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/staging/mt7621-dts/mt7621.dtsi | 9 +++---- + drivers/staging/mt7621-pci/pci-mt7621.c | 36 +++++++++++++++++++++++-- + 2 files changed, 38 insertions(+), 7 deletions(-) + +--- a/drivers/staging/mt7621-pci/pci-mt7621.c ++++ b/drivers/staging/mt7621-pci/pci-mt7621.c +@@ -97,6 +97,7 @@ + * @pcie_rst: pointer to port reset control + * @gpio_rst: gpio reset + * @slot: port slot ++ * @irq: GIC irq + * @enabled: indicates if port is enabled + */ + struct mt7621_pcie_port { +@@ -107,6 +108,7 @@ struct mt7621_pcie_port { + struct reset_control *pcie_rst; + struct gpio_desc *gpio_rst; + u32 slot; ++ int irq; + bool enabled; + }; + +@@ -120,6 +122,7 @@ struct mt7621_pcie_port { + * @dev: Pointer to PCIe device + * @io_map_base: virtual memory base address for io + * @ports: pointer to PCIe port information ++ * @irq_map: irq mapping info according pcie link status + * @resets_inverted: depends on chip revision + * reset lines are inverted. + */ +@@ -135,6 +138,7 @@ struct mt7621_pcie { + } offset; + unsigned long io_map_base; + struct list_head ports; ++ int irq_map[PCIE_P2P_MAX]; + bool resets_inverted; + }; + +@@ -279,6 +283,16 @@ static void setup_cm_memory_region(struc + } + } + ++static int mt7621_map_irq(const struct pci_dev *pdev, u8 slot, u8 pin) ++{ ++ struct mt7621_pcie *pcie = pdev->bus->sysdata; ++ struct device *dev = pcie->dev; ++ int irq = pcie->irq_map[slot]; ++ ++ dev_info(dev, "bus=%d slot=%d irq=%d\n", pdev->bus->number, slot, irq); ++ return irq; ++} ++ + static int mt7621_pci_parse_request_of_pci_ranges(struct mt7621_pcie *pcie) + { + struct device *dev = pcie->dev; +@@ -330,6 +344,7 @@ static int mt7621_pcie_parse_port(struct + { + struct mt7621_pcie_port *port; + struct device *dev = pcie->dev; ++ struct platform_device *pdev = to_platform_device(dev); + struct device_node *pnode = dev->of_node; + struct resource regs; + char name[10]; +@@ -371,6 +386,12 @@ static int mt7621_pcie_parse_port(struct + port->slot = slot; + port->pcie = pcie; + ++ port->irq = platform_get_irq(pdev, slot); ++ if (port->irq < 0) { ++ dev_err(dev, "Failed to get IRQ for PCIe%d\n", slot); ++ return -ENXIO; ++ } ++ + INIT_LIST_HEAD(&port->list); + list_add_tail(&port->list, &pcie->ports); + +@@ -585,13 +606,15 @@ static int mt7621_pcie_init_virtual_brid + { + u32 pcie_link_status = 0; + u32 n; +- int i; ++ int i = 0; + u32 p2p_br_devnum[PCIE_P2P_MAX]; ++ int irqs[PCIE_P2P_MAX]; + struct mt7621_pcie_port *port; + + list_for_each_entry(port, &pcie->ports, list) { + u32 slot = port->slot; + ++ irqs[i++] = port->irq; + if (port->enabled) + pcie_link_status |= BIT(slot); + } +@@ -614,6 +637,15 @@ static int mt7621_pcie_init_virtual_brid + (p2p_br_devnum[1] << PCIE_P2P_BR_DEVNUM1_SHIFT) | + (p2p_br_devnum[2] << PCIE_P2P_BR_DEVNUM2_SHIFT)); + ++ /* Assign IRQs */ ++ n = 0; ++ for (i = 0; i < PCIE_P2P_MAX; i++) ++ if (pcie_link_status & BIT(i)) ++ pcie->irq_map[n++] = irqs[i]; ++ ++ for (i = n; i < PCIE_P2P_MAX; i++) ++ pcie->irq_map[i] = -1; ++ + return 0; + } + +@@ -638,7 +670,7 @@ static int mt7621_pcie_register_host(str + host->busnr = pcie->busn.start; + host->dev.parent = pcie->dev; + host->ops = &mt7621_pci_ops; +- host->map_irq = of_irq_parse_and_map_pci; ++ host->map_irq = mt7621_map_irq; + host->swizzle_irq = pci_common_swizzle; + host->sysdata = pcie; +