From e8fae62f6485c71a9b904b5c2783c56f373c0155 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 25 Feb 2020 13:33:46 +0100 Subject: [PATCH 01/16] mt76: update to the latest version 0a53dcda5203 mt76: mt7603: add upper limit for dynamic sensitivity minimum receive power 46e63c05f7d1 mt76: mt7603: enable dynamic sensitivity adjustment by default 81476f11b68c mt76: mt7615: fix antenna mask initialization in DBDC mode Signed-off-by: Felix Fietkau --- package/kernel/mt76/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile index e9ad96dcf7..c1f79054b1 100644 --- a/package/kernel/mt76/Makefile +++ b/package/kernel/mt76/Makefile @@ -8,9 +8,9 @@ PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/openwrt/mt76 PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2020-02-20 -PKG_SOURCE_VERSION:=fd892bc033fbfad7b1a5bcba1432709a74327a1e -PKG_MIRROR_HASH:=1f73f5be38ec3f8fca07dc54d0e29dd08cfe6c6c82d72b6c489bf0aa8fd19acd +PKG_SOURCE_DATE:=2020-02-25 +PKG_SOURCE_VERSION:=81476f11b68c1728d9f7df319dbd696148ae657a +PKG_MIRROR_HASH:=d1245721ee2fb2f2f656acfd697135f4253f0b39511bd4f83d0789a3a8afb7c4 PKG_MAINTAINER:=Felix Fietkau PKG_BUILD_PARALLEL:=1 From d3b7838ebed98ae5cf064a3890b0fd3f16b9a664 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Tue, 25 Feb 2020 17:01:55 +0100 Subject: [PATCH 02/16] hostapd: enhance wifi reload Add a radio_config_id property. If the radio config changes return an error upon receiving the reconf call. Signed-off-by: John Crispin --- .../hostapd/patches/700-wifi-reload.patch | 149 ++++++++++++++++-- .../services/hostapd/src/src/ap/ubus.c | 3 +- 2 files changed, 134 insertions(+), 18 deletions(-) diff --git a/package/network/services/hostapd/patches/700-wifi-reload.patch b/package/network/services/hostapd/patches/700-wifi-reload.patch index b21ae85451..fa557b76c6 100644 --- a/package/network/services/hostapd/patches/700-wifi-reload.patch +++ b/package/network/services/hostapd/patches/700-wifi-reload.patch @@ -1,5 +1,7 @@ ---- a/hostapd/config_file.c -+++ b/hostapd/config_file.c +Index: hostapd-2019-08-08-ca8c2bd2/hostapd/config_file.c +=================================================================== +--- hostapd-2019-08-08-ca8c2bd2.orig/hostapd/config_file.c ++++ hostapd-2019-08-08-ca8c2bd2/hostapd/config_file.c @@ -2470,6 +2470,8 @@ static int hostapd_config_fill(struct ho bss->isolate = atoi(pos); } else if (os_strcmp(buf, "ap_max_inactivity") == 0) { @@ -9,8 +11,19 @@ } else if (os_strcmp(buf, "skip_inactivity_poll") == 0) { bss->skip_inactivity_poll = atoi(pos); } else if (os_strcmp(buf, "country_code") == 0) { ---- a/src/ap/ap_config.c -+++ b/src/ap/ap_config.c +@@ -3131,6 +3133,8 @@ static int hostapd_config_fill(struct ho + } + } else if (os_strcmp(buf, "acs_exclude_dfs") == 0) { + conf->acs_exclude_dfs = atoi(pos); ++ } else if (os_strcmp(buf, "radio_config_id") == 0) { ++ conf->config_id = os_strdup(pos); + } else if (os_strcmp(buf, "channel") == 0) { + if (os_strcmp(pos, "acs_survey") == 0) { + #ifndef CONFIG_ACS +Index: hostapd-2019-08-08-ca8c2bd2/src/ap/ap_config.c +=================================================================== +--- hostapd-2019-08-08-ca8c2bd2.orig/src/ap/ap_config.c ++++ hostapd-2019-08-08-ca8c2bd2/src/ap/ap_config.c @@ -698,6 +698,7 @@ void hostapd_config_free_bss(struct host os_free(conf->radius_req_attr_sqlite); os_free(conf->rsn_preauth_interfaces); @@ -19,8 +32,18 @@ os_free(conf->ca_cert); os_free(conf->server_cert); os_free(conf->server_cert2); ---- a/src/ap/ap_config.h -+++ b/src/ap/ap_config.h +@@ -881,6 +882,7 @@ void hostapd_config_free(struct hostapd_ + + for (i = 0; i < conf->num_bss; i++) + hostapd_config_free_bss(conf->bss[i]); ++ os_free(conf->config_id); + os_free(conf->bss); + os_free(conf->supported_rates); + os_free(conf->basic_rates); +Index: hostapd-2019-08-08-ca8c2bd2/src/ap/ap_config.h +=================================================================== +--- hostapd-2019-08-08-ca8c2bd2.orig/src/ap/ap_config.h ++++ hostapd-2019-08-08-ca8c2bd2/src/ap/ap_config.h @@ -829,6 +829,7 @@ struct hostapd_bss_config { */ u8 mka_psk_set; @@ -29,9 +52,39 @@ }; /** ---- a/src/ap/hostapd.c -+++ b/src/ap/hostapd.c -@@ -242,13 +242,13 @@ int hostapd_reload_config(struct hostapd +@@ -1012,6 +1013,7 @@ struct hostapd_config { + unsigned int airtime_update_interval; + #define AIRTIME_MODE_MAX (__AIRTIME_MODE_MAX - 1) + #endif /* CONFIG_AIRTIME_POLICY */ ++ char *config_id; + }; + + +Index: hostapd-2019-08-08-ca8c2bd2/src/ap/hostapd.c +=================================================================== +--- hostapd-2019-08-08-ca8c2bd2.orig/src/ap/hostapd.c ++++ hostapd-2019-08-08-ca8c2bd2/src/ap/hostapd.c +@@ -206,6 +206,10 @@ static int hostapd_iface_conf_changed(st + { + size_t i; + ++ if (newconf->config_id != oldconf->config_id) ++ if (strcmp(newconf->config_id, oldconf->config_id)) ++ return 1; ++ + if (newconf->num_bss != oldconf->num_bss) + return 1; + +@@ -219,7 +223,7 @@ static int hostapd_iface_conf_changed(st + } + + +-int hostapd_reload_config(struct hostapd_iface *iface) ++int hostapd_reload_config(struct hostapd_iface *iface, int reconf) + { + struct hapd_interfaces *interfaces = iface->interfaces; + struct hostapd_data *hapd = iface->bss[0]; +@@ -242,13 +246,16 @@ int hostapd_reload_config(struct hostapd if (newconf == NULL) return -1; @@ -42,12 +95,15 @@ char *fname; int res; ++ if (reconf) ++ return -1; ++ + hostapd_clear_old(iface); + wpa_printf(MSG_DEBUG, "Configuration changes include interface/BSS modification - force full disable+enable sequence"); fname = os_strdup(iface->config_fname); -@@ -273,6 +273,22 @@ int hostapd_reload_config(struct hostapd +@@ -273,6 +280,22 @@ int hostapd_reload_config(struct hostapd wpa_printf(MSG_ERROR, "Failed to enable interface on config reload"); return res; @@ -70,7 +126,7 @@ } iface->conf = newconf; -@@ -289,6 +305,12 @@ int hostapd_reload_config(struct hostapd +@@ -289,6 +312,12 @@ int hostapd_reload_config(struct hostapd for (j = 0; j < iface->num_bss; j++) { hapd = iface->bss[j]; @@ -83,7 +139,7 @@ hapd->iconf = newconf; hapd->conf = newconf->bss[j]; hostapd_reload_bss(hapd); -@@ -2257,6 +2279,10 @@ hostapd_alloc_bss_data(struct hostapd_if +@@ -2257,6 +2286,10 @@ hostapd_alloc_bss_data(struct hostapd_if hapd->iconf = conf; hapd->conf = bss; hapd->iface = hapd_iface; @@ -94,8 +150,19 @@ if (conf) hapd->driver = conf->driver; hapd->ctrl_sock = -1; ---- a/src/ap/hostapd.h -+++ b/src/ap/hostapd.h +Index: hostapd-2019-08-08-ca8c2bd2/src/ap/hostapd.h +=================================================================== +--- hostapd-2019-08-08-ca8c2bd2.orig/src/ap/hostapd.h ++++ hostapd-2019-08-08-ca8c2bd2/src/ap/hostapd.h +@@ -42,7 +42,7 @@ struct mesh_conf; + struct hostapd_iface; + + struct hapd_interfaces { +- int (*reload_config)(struct hostapd_iface *iface); ++ int (*reload_config)(struct hostapd_iface *iface, int reconf); + struct hostapd_config * (*config_read_cb)(const char *config_fname); + int (*ctrl_iface_init)(struct hostapd_data *hapd); + void (*ctrl_iface_deinit)(struct hostapd_data *hapd); @@ -149,6 +149,7 @@ struct hostapd_data { struct hostapd_config *iconf; struct hostapd_bss_config *conf; @@ -104,8 +171,19 @@ int interface_added; /* virtual interface added for this BSS */ unsigned int started:1; unsigned int disabled:1; ---- a/src/drivers/driver_nl80211.c -+++ b/src/drivers/driver_nl80211.c +@@ -576,7 +577,7 @@ struct hostapd_iface { + int hostapd_for_each_interface(struct hapd_interfaces *interfaces, + int (*cb)(struct hostapd_iface *iface, + void *ctx), void *ctx); +-int hostapd_reload_config(struct hostapd_iface *iface); ++int hostapd_reload_config(struct hostapd_iface *iface, int reconf); + void hostapd_reconfig_encryption(struct hostapd_data *hapd); + struct hostapd_data * + hostapd_alloc_bss_data(struct hostapd_iface *hapd_iface, +Index: hostapd-2019-08-08-ca8c2bd2/src/drivers/driver_nl80211.c +=================================================================== +--- hostapd-2019-08-08-ca8c2bd2.orig/src/drivers/driver_nl80211.c ++++ hostapd-2019-08-08-ca8c2bd2/src/drivers/driver_nl80211.c @@ -4295,6 +4295,9 @@ static int wpa_driver_nl80211_set_ap(voi if (ret) { wpa_printf(MSG_DEBUG, "nl80211: Beacon set failed: %d (%s)", @@ -116,3 +194,42 @@ } else { bss->beacon_set = 1; nl80211_set_bss(bss, params->cts_protect, params->preamble, +Index: hostapd-2019-08-08-ca8c2bd2/hostapd/ctrl_iface.c +=================================================================== +--- hostapd-2019-08-08-ca8c2bd2.orig/hostapd/ctrl_iface.c ++++ hostapd-2019-08-08-ca8c2bd2/hostapd/ctrl_iface.c +@@ -182,7 +182,7 @@ static int hostapd_ctrl_iface_update(str + iface->interfaces->config_read_cb = hostapd_ctrl_iface_config_read; + reload_opts = txt; + +- hostapd_reload_config(iface); ++ hostapd_reload_config(iface, 0); + + iface->interfaces->config_read_cb = config_read_cb; + } +Index: hostapd-2019-08-08-ca8c2bd2/hostapd/main.c +=================================================================== +--- hostapd-2019-08-08-ca8c2bd2.orig/hostapd/main.c ++++ hostapd-2019-08-08-ca8c2bd2/hostapd/main.c +@@ -320,7 +320,7 @@ static void handle_term(int sig, void *s + + static int handle_reload_iface(struct hostapd_iface *iface, void *ctx) + { +- if (hostapd_reload_config(iface) < 0) { ++ if (hostapd_reload_config(iface, 0) < 0) { + wpa_printf(MSG_WARNING, "Failed to read new configuration " + "file - continuing with old."); + } +Index: hostapd-2019-08-08-ca8c2bd2/src/ap/wps_hostapd.c +=================================================================== +--- hostapd-2019-08-08-ca8c2bd2.orig/src/ap/wps_hostapd.c ++++ hostapd-2019-08-08-ca8c2bd2/src/ap/wps_hostapd.c +@@ -275,7 +275,7 @@ static void wps_reload_config(void *eloo + + wpa_printf(MSG_DEBUG, "WPS: Reload configuration data"); + if (iface->interfaces == NULL || +- iface->interfaces->reload_config(iface) < 0) { ++ iface->interfaces->reload_config(iface, 1) < 0) { + wpa_printf(MSG_WARNING, "WPS: Failed to reload the updated " + "configuration"); + } diff --git a/package/network/services/hostapd/src/src/ap/ubus.c b/package/network/services/hostapd/src/src/ap/ubus.c index e25c3294ee..5ed6e186a6 100644 --- a/package/network/services/hostapd/src/src/ap/ubus.c +++ b/package/network/services/hostapd/src/src/ap/ubus.c @@ -152,8 +152,7 @@ hostapd_bss_reload(struct ubus_context *ctx, struct ubus_object *obj, struct blob_attr *msg) { struct hostapd_data *hapd = container_of(obj, struct hostapd_data, ubus.obj); - hostapd_reload_config(hapd->iface); - hostapd_reload_iface(hapd->iface); + return hostapd_reload_config(hapd->iface, 1); } static int From a1dd7732729a7b54890095187cd1766a773051d1 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Tue, 25 Feb 2020 17:03:44 +0100 Subject: [PATCH 03/16] mac80211: enhance wifi reload If the reconf call fails force a full restart of the radio. Signed-off-by: John Crispin --- .../mac80211/files/lib/netifd/wireless/mac80211.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh index ac9984ef22..f22730c9fc 100644 --- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh +++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh @@ -329,6 +329,8 @@ $base_cfg EOF json_select .. + radio_md5sum=$(md5sum $hostapd_conf_file | cut -d" " -f1) + echo "radio_config_id=${radio_md5sum}" >> $hostapd_conf_file } mac80211_hostapd_setup_bss() { @@ -943,11 +945,16 @@ drv_mac80211_setup() { local add_ap=0 local primary_ap=${NEWAPLIST%% *} [ -n "$hostapd_ctrl" ] && { + local no_reload=1 if [ -n "$(ubus list | grep hostapd.$primary_ap)" ]; then [ "${NEW_MD5}" = "${OLD_MD5}" ] || { ubus call hostapd.$primary_ap reload + no_reload=$? + mac80211_vap_cleanup hostapd "${OLDAPLIST}" + [ -n "${NEWAPLIST}" ] && mac80211_iw_interface_add "$phy" "${NEWAPLIST%% *}" __ap || return } - else + fi + if [ "$no_reload" != "0" ]; then add_ap=1 ubus wait_for hostapd.$phy ubus call hostapd.${phy} config_add "{\"iface\":\"$primary_ap\", \"config\":\"${hostapd_conf_file}\"}" From ffd249366f96a6a94fac18909109a6c98a458de7 Mon Sep 17 00:00:00 2001 From: Kevin Darbyshire-Bryant Date: Mon, 24 Feb 2020 13:53:57 +0000 Subject: [PATCH 04/16] kernel: x86_64: drop CALGARY IOMMU The calgary IOMMU was only used on high-end IBM systems in the early x86_64 age. This is an unlikely OpenWrt target and in fact upstream are looking to drop the driver entirely with the bonus that we no longer see: [ 0.000000] Calgary: detecting Calgary via BIOS EBDA area [ 0.000000] Calgary: Unable to locate Rio Grande table in EBDA - bailing! Signed-off-by: Kevin Darbyshire-Bryant --- target/linux/x86/64/config-4.19 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/x86/64/config-4.19 b/target/linux/x86/64/config-4.19 index ddbd818dfc..3d18d216f4 100644 --- a/target/linux/x86/64/config-4.19 +++ b/target/linux/x86/64/config-4.19 @@ -75,8 +75,8 @@ CONFIG_NVME_MULTIPATH=y CONFIG_BLK_MQ_VIRTIO=y # CONFIG_BOOTPARAM_HOTPLUG_CPU0 is not set CONFIG_BTT=y -CONFIG_CALGARY_IOMMU=y -CONFIG_CALGARY_IOMMU_ENABLED_BY_DEFAULT=y +# CONFIG_CALGARY_IOMMU=y +# CONFIG_CALGARY_IOMMU_ENABLED_BY_DEFAULT=y CONFIG_CONNECTOR=y # CONFIG_CPU_HOTPLUG_STATE_CONTROL is not set CONFIG_CPU_RMAP=y From 083eb80bf23619fe3d972bc6d28338dc85baa333 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Tue, 25 Feb 2020 17:15:07 +0100 Subject: [PATCH 05/16] mediatek: add latest fixes provided by MTK Signed-off-by: John Crispin --- .../arch/arm/boot/dts/mt7629-rfb.dts | 95 ++++++++++++------- .../arm64/boot/dts/mediatek/mt7622-rfb1.dts | 47 +++++++-- target/linux/mediatek/image/mt7622.mk | 17 +--- target/linux/mediatek/image/mt7623.mk | 6 +- target/linux/mediatek/image/mt7629.mk | 8 +- ...atek-Add-SPI-Nand-support-for-MT7629.patch | 59 +----------- 6 files changed, 109 insertions(+), 123 deletions(-) diff --git a/target/linux/mediatek/files-4.19/arch/arm/boot/dts/mt7629-rfb.dts b/target/linux/mediatek/files-4.19/arch/arm/boot/dts/mt7629-rfb.dts index 8043238fea..8ea7b163d8 100644 --- a/target/linux/mediatek/files-4.19/arch/arm/boot/dts/mt7629-rfb.dts +++ b/target/linux/mediatek/files-4.19/arch/arm/boot/dts/mt7629-rfb.dts @@ -10,7 +10,7 @@ / { model = "MediaTek MT7629 reference board"; - compatible = "mediatek,mt7629-rfb", "mediatek,mt7629"; + compatible = "mediatek,mt7629-lynx-rfb", "mediatek,mt7629"; aliases { serial0 = &uart0; @@ -18,6 +18,7 @@ chosen { stdout-path = "serial0:115200n8"; + bootargs = "earlycon=uart8250,mmio32,0x11002000 console=ttyS0,115200n8"; }; gpio-keys { @@ -36,6 +37,13 @@ }; }; + gsw: gsw@0 { + compatible = "mediatek,mt753x"; + mediatek,ethsys = <ðsys>; + #address-cells = <1>; + #size-cells = <0>; + }; + memory@40000000 { device_type = "memory"; reg = <0 0x40000000 0 0x10000000>; @@ -58,46 +66,61 @@ regulator-boot-on; regulator-always-on; }; - - rtkgsw: rtkgsw@0 { - compatible = "mediatek,rtk-gsw"; - mediatek,ethsys = <ðsys>; - mediatek,mdio = <&mdio>; - status = "okay"; - }; }; ð { - pinctrl-names = "default"; - pinctrl-0 = <&ephy_leds_pins>; - status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&ephy_leds_pins>; + status = "okay"; - gmac0: mac@0 { - compatible = "mediatek,eth-mac"; - reg = <0>; - phy-mode = "sgmii"; - fixed-link { - speed = <1000>; - full-duplex; - pause; - }; - }; + gmac0: mac@0 { + compatible = "mediatek,eth-mac"; + reg = <0>; + mtd-mac-address = <&factory 0x2a>; + phy-mode = "sgmii"; + fixed-link { + speed = <1000>; + full-duplex; + pause; + }; + }; - gmac1: mac@1 { - compatible = "mediatek,eth-mac"; - reg = <1>; - phy-handle = <&phy0>; - }; + gmac1: mac@1 { + compatible = "mediatek,eth-mac"; + reg = <1>; + mtd-mac-address = <&factory 0x24>; + phy-handle = <&phy0>; + }; - mdio: mdio-bus { - #address-cells = <1>; - #size-cells = <0>; + mdio: mdio-bus { + #address-cells = <1>; + #size-cells = <0>; - phy0: ethernet-phy@0 { - reg = <0>; - phy-mode = "gmii"; - }; - }; + phy0: ethernet-phy@0 { + reg = <0>; + phy-mode = "gmii"; + }; + }; +}; + +&gsw { + mediatek,mdio = <&mdio>; + mediatek,portmap = "llllw"; + mediatek,mdio_master_pinmux = <0>; + reset-gpios = <&pio 28 0>; + interrupt-parent = <&pio>; + interrupts = <6 IRQ_TYPE_LEVEL_HIGH>; + status = "okay"; + + port6: port@6 { + compatible = "mediatek,mt753x-port"; + reg = <6>; + phy-mode = "sgmii"; + fixed-link { + speed = <2500>; + full-duplex; + }; + }; }; &i2c { @@ -133,13 +156,13 @@ }; factory: partition@70000 { - label = "Factory"; + label = "factory"; reg = <0x70000 0x40000>; read-only; }; partition@b0000 { - label = "Kernel"; + label = "firmware"; reg = <0xb0000 0xb50000>; }; }; diff --git a/target/linux/mediatek/files-4.19/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts b/target/linux/mediatek/files-4.19/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts index 3805c5c4ce..ecd344c956 100644 --- a/target/linux/mediatek/files-4.19/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts +++ b/target/linux/mediatek/files-4.19/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts @@ -23,7 +23,7 @@ chosen { stdout-path = "serial0:115200n8"; - bootargs = "earlycon=uart8250,mmio32,0x11002000 swiotlb=512"; + bootargs = "earlycon=uart8250,mmio32,0x11002000 console=ttyS0,115200n1 swiotlb=512"; }; cpus { @@ -55,6 +55,13 @@ }; }; + gsw: gsw@0 { + compatible = "mediatek,mt753x"; + mediatek,ethsys = <ðsys>; + #address-cells = <1>; + #size-cells = <0>; + }; + memory { reg = <0 0x40000000 0 0x3F000000>; }; @@ -84,14 +91,6 @@ regulator-boot-on; regulator-always-on; }; - - rtkgsw: rtkgsw@0 { - compatible = "mediatek,rtk-gsw"; - mediatek,ethsys = <ðsys>; - mediatek,mdio = <&mdio>; - mediatek,reset-pin = <&pio 54 0>; - status = "okay"; - }; }; &pcie { @@ -405,6 +404,36 @@ }; }; +&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>; diff --git a/target/linux/mediatek/image/mt7622.mk b/target/linux/mediatek/image/mt7622.mk index 9a5aedc88d..486ab98b0f 100644 --- a/target/linux/mediatek/image/mt7622.mk +++ b/target/linux/mediatek/image/mt7622.mk @@ -8,19 +8,8 @@ define Device/mediatek_mt7622-rfb1 endef TARGET_DEVICES += mediatek_mt7622-rfb1 -define Device/mediatek_mt7622-lynx-rfb1 - DEVICE_VENDOR := MediaTek - DEVICE_MODEL := MTK7622 Lynx rfb1 AP - DEVICE_DTS := mt7622-lynx-rfb1 - DEVICE_DTS_DIR := $(DTS_DIR)/mediatek - SUPPORTED_DEVICES := mediatek,mt7622-rfb1 - DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-usb3 \ - kmod-ata-core kmod-ata-ahci-mtk -endef -TARGET_DEVICES += mediatek_mt7622-lynx-rfb1 - -define Device/lemaker_bananapi-bpi-r64 - DEVICE_VENDOR := LeMaker +define Device/bpi_bananapi-r64 + DEVICE_VENDOR := Bpi DEVICE_MODEL := Banana Pi R64 DEVICE_DTS := mt7622-bananapi-bpi-r64 DEVICE_DTS_DIR := $(DTS_DIR)/mediatek @@ -28,4 +17,4 @@ define Device/lemaker_bananapi-bpi-r64 DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-usb3 \ kmod-ata-core kmod-ata-ahci-mtk endef -TARGET_DEVICES += lemaker_bananapi-bpi-r64 +TARGET_DEVICES += bpi_bananapi-r64 diff --git a/target/linux/mediatek/image/mt7623.mk b/target/linux/mediatek/image/mt7623.mk index fd609d22fa..4c3c927439 100644 --- a/target/linux/mediatek/image/mt7623.mk +++ b/target/linux/mediatek/image/mt7623.mk @@ -9,10 +9,10 @@ define Device/unielec_u7623-02-emmc-512m endef TARGET_DEVICES += unielec_u7623-02-emmc-512m -define Device/lemaker_bananapi-bpi-r2 - DEVICE_VENDOR := LeMaker +define Device/bpi_bananapi-r2 + DEVICE_VENDOR := Bpi DEVICE_MODEL := Banana Pi R2 DEVICE_DTS := mt7623n-bananapi-bpi-r2 SUPPORTED_DEVICES := bananapi,bpi-r2 endef -TARGET_DEVICES += lemaker_bananapi-bpi-r2 +TARGET_DEVICES += bpi_bananapi-r2 diff --git a/target/linux/mediatek/image/mt7629.mk b/target/linux/mediatek/image/mt7629.mk index 71fb3dda09..ef4b752351 100644 --- a/target/linux/mediatek/image/mt7629.mk +++ b/target/linux/mediatek/image/mt7629.mk @@ -1,7 +1,7 @@ -define Device/mediatek_mt7629-lynx-rfb +define Device/mediatek_mt7629-rfb DEVICE_VENDOR := MediaTek - DEVICE_MODEL := MT7629 Lynx reference board - DEVICE_DTS := mt7629-lynx-rfb + DEVICE_MODEL := MT7629 rfb AP + DEVICE_DTS := mt7629-rfb DEVICE_PACKAGES := swconfig endef -TARGET_DEVICES += mediatek_mt7629-lynx-rfb +TARGET_DEVICES += mediatek_mt7629-rfb diff --git a/target/linux/mediatek/patches-4.19/0307-spi-mem-Mediatek-Add-SPI-Nand-support-for-MT7629.patch b/target/linux/mediatek/patches-4.19/0307-spi-mem-Mediatek-Add-SPI-Nand-support-for-MT7629.patch index 31530afc9b..b8cb416b3e 100644 --- a/target/linux/mediatek/patches-4.19/0307-spi-mem-Mediatek-Add-SPI-Nand-support-for-MT7629.patch +++ b/target/linux/mediatek/patches-4.19/0307-spi-mem-Mediatek-Add-SPI-Nand-support-for-MT7629.patch @@ -6,65 +6,10 @@ Subject: [PATCH] spi: spi-mem: Mediatek: Add SPI Nand support for MT7629 Signed-off-by: Xiangsheng Hou --- arch/arm/boot/dts/mt7629-rfb.dts | 45 ++++++++++++++++++++++++++++++++ - arch/arm/boot/dts/mt7629-lynx-rfb.dts | 45 ++++++++++++++++++++++++++++++++ arch/arm/boot/dts/mt7629.dtsi | 22 ++++++++++++++++ drivers/spi/spi-mtk-snfi.c | 12 +++++++++ 3 files changed, 79 insertions(+) ---- a/arch/arm/boot/dts/mt7629-rfb.dts -+++ b/arch/arm/boot/dts/mt7629-rfb.dts -@@ -258,6 +258,51 @@ - }; - }; - -+&bch { -+ status = "okay"; -+}; -+ -+&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 = "Bootloader"; -+ reg = <0x00000 0x0100000>; -+ read-only; -+ }; -+ -+ partition@100000 { -+ label = "Config"; -+ reg = <0x100000 0x0040000>; -+ }; -+ -+ partition@140000 { -+ label = "factory"; -+ reg = <0x140000 0x0080000>; -+ }; -+ -+ partition@1c0000 { -+ label = "firmware"; -+ reg = <0x1c0000 0x1000000>; -+ }; -+ }; -+ }; -+}; -+ - &spi { - pinctrl-names = "default"; - pinctrl-0 = <&spi_pins>; --- a/arch/arm/boot/dts/mt7629.dtsi +++ b/arch/arm/boot/dts/mt7629.dtsi @@ -259,6 +259,28 @@ @@ -119,8 +64,8 @@ Signed-off-by: Xiangsheng Hou { /* sentinel */ } }; ---- a/arch/arm/boot/dts/mt7629-lynx-rfb.dts -+++ b/arch/arm/boot/dts/mt7629-lynx-rfb.dts +--- a/arch/arm/boot/dts/mt7629-rfb.dts ++++ b/arch/arm/boot/dts/mt7629-rfb.dts @@ -281,6 +281,52 @@ }; }; From 3660a89cb9bfbdd077cf3322b7355a43faac8832 Mon Sep 17 00:00:00 2001 From: Kevin Darbyshire-Bryant Date: Tue, 25 Feb 2020 16:38:35 +0000 Subject: [PATCH 06/16] kernel: x86_64: drop CALGARY properly Use correct config syntax of 'is not set' instead of just commenting the line Signed-off-by: Kevin Darbyshire-Bryant --- target/linux/x86/64/config-4.19 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/x86/64/config-4.19 b/target/linux/x86/64/config-4.19 index 3d18d216f4..f5c82dcb91 100644 --- a/target/linux/x86/64/config-4.19 +++ b/target/linux/x86/64/config-4.19 @@ -75,8 +75,8 @@ CONFIG_NVME_MULTIPATH=y CONFIG_BLK_MQ_VIRTIO=y # CONFIG_BOOTPARAM_HOTPLUG_CPU0 is not set CONFIG_BTT=y -# CONFIG_CALGARY_IOMMU=y -# CONFIG_CALGARY_IOMMU_ENABLED_BY_DEFAULT=y +# CONFIG_CALGARY_IOMMU is not set +# CONFIG_CALGARY_IOMMU_ENABLED_BY_DEFAULT is not set CONFIG_CONNECTOR=y # CONFIG_CPU_HOTPLUG_STATE_CONTROL is not set CONFIG_CPU_RMAP=y From c81b2e94c7d89fbf9f03aa4680ebb3d26cede872 Mon Sep 17 00:00:00 2001 From: Roger Pueyo Centelles Date: Wed, 29 Jan 2020 11:27:03 +0100 Subject: [PATCH 07/16] rbextract: support devices with plain RLE caldata Old MikroTik devices have the RLE-encoded radio calibration data directly stored in the art (hard_config) partition, without LZO compression nor any preceding ERD magic bytes. This commit adds a fallback for these devices. Tested on the ath79 target with a MikroTik SXT 5nD r2 (SXT Lite5), only locally --not yet merged upstream--. Signed-off-by: Roger Pueyo Centelles --- package/utils/rbextract/Makefile | 2 +- package/utils/rbextract/src/rbextract.c | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/package/utils/rbextract/Makefile b/package/utils/rbextract/Makefile index 4bc6898b11..f50bbea120 100644 --- a/package/utils/rbextract/Makefile +++ b/package/utils/rbextract/Makefile @@ -11,7 +11,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=rbextract -PKG_RELEASE:=2 +PKG_RELEASE:=3 CMAKE_INSTALL:=1 include $(INCLUDE_DIR)/package.mk diff --git a/package/utils/rbextract/src/rbextract.c b/package/utils/rbextract/src/rbextract.c index ceed2494a1..e75d74957a 100644 --- a/package/utils/rbextract/src/rbextract.c +++ b/package/utils/rbextract/src/rbextract.c @@ -335,7 +335,7 @@ __rb_get_wlan_data(void) } /* Older ath79-based boards directly show the RB_MAGIC_ERD bytes followed by the LZO-compressed calibration data with no RLE */ - if (magic == RB_MAGIC_ERD) { + else if (magic == RB_MAGIC_ERD) { if (tag_len > RB_ART_SIZE) { printf("Calibration data too large\n"); goto err_free_lzo_in; @@ -362,6 +362,18 @@ __rb_get_wlan_data(void) buf_rle_out = buf_lzo_out; } + /* Even older ath79-base boards directly have RLE-encoded calibration data, + without any LZO compresion nor showing RB_MAGIC_ERD bytes */ + else { + printf("Decode calibration data with RLE\n"); + err = rle_decode(tag, tag_len, buf_rle_out, RB_ART_SIZE, + NULL, NULL); + if (err) { + printf("unable to decode ERD data\n"); + goto err_free_rle_out; + } + } + return buf_rle_out; err_free_rle_out: From 8f93c05a591bd68e4d8eaa0a8468ce2263762004 Mon Sep 17 00:00:00 2001 From: Roger Pueyo Centelles Date: Sun, 26 Jan 2020 17:56:05 +0100 Subject: [PATCH 08/16] ath79: add support for MikroTik RouterBOARD 922UAGS-5HPacD This patch ports support for the MikroTik RouterBOARD 922UAGS-5HPacD with a built-in 802.11ac High-Power radio (31dBm), which was already available in the ar71xx target. See https://mikrotik.com/product/RB922UAGS-5HPacD for more info. Specifications: - SoC: Qualcomm Atheros QCA9558 (720 MHz) - RAM: 128 MB - Storage: 128 MB NAND - Wireless: external QCA9882 802.11a/ac 2x2:2 - Ethernet: 1x 1000/100/10 Mbps, integrated, via AR8031 PHY, passive PoE-in 24V - SFP: 1x host - USB: 1x 2.0 type A - PCIe: 1x Mini slot (also contains USB 2.0 for 3G/LTE modems) - SIM slot: 1x mini-SIM Working: - Board/system detection - SPI and NAND storage - PCIe - USB type A host - Wireless - Ethernet - LEDs (user, phy0) - Reset button - Sysupgrade to/from ar71xx Not supported: - RSSI LEDs - SFP cage Installation methods: - Sysupgrade from ar71xx (it is advisable to use the -n option to wipe any previous settings), or - Boot the initramfs image via TFTP and then flash the sysupgrade image using "sysupgrade -n" Signed-off-by: Roger Pueyo Centelles --- ...58_mikrotik_routerboard-922uags-5hpacd.dts | 187 ++++++++++++++++++ target/linux/ath79/image/nand.mk | 14 ++ .../nand/base-files/etc/board.d/02_network | 3 +- .../etc/hotplug.d/firmware/11-ath10k-caldata | 8 + .../etc/uci-defaults/04_led_migration | 17 ++ .../nand/base-files/lib/upgrade/platform.sh | 16 +- target/linux/ath79/nand/config-default | 1 + target/linux/ath79/nand/target.mk | 2 +- 8 files changed, 245 insertions(+), 3 deletions(-) create mode 100644 target/linux/ath79/dts/qca9558_mikrotik_routerboard-922uags-5hpacd.dts create mode 100644 target/linux/ath79/nand/base-files/etc/uci-defaults/04_led_migration diff --git a/target/linux/ath79/dts/qca9558_mikrotik_routerboard-922uags-5hpacd.dts b/target/linux/ath79/dts/qca9558_mikrotik_routerboard-922uags-5hpacd.dts new file mode 100644 index 0000000000..26a18ad6a7 --- /dev/null +++ b/target/linux/ath79/dts/qca9558_mikrotik_routerboard-922uags-5hpacd.dts @@ -0,0 +1,187 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "qca9557.dtsi" + +/ { + compatible = "mikrotik,routerboard-922uags-5hpacd", "qca,qca9558"; + model = "MikroTik RouterBOARD 922UAGS-5HPacD"; + + aliases { + label-mac-device = ð0; + led-boot = &led_user; + led-failsafe = &led_user; + led-upgrade = &led_user; + serial0 = &uart; + }; + + chosen { + bootargs = "console=ttyS0,115200n8"; + }; + + leds { + compatible = "gpio-leds"; + + led_user: user { + label = "mikrotik:green:user"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + }; + + ath10k-leds { + compatible = "gpio-leds"; + + wlan5g { + label = "mikrotik:green:wlan5g"; + gpios = <&ath10k 0 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 20 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + gpio-export { + compatible = "gpio-export"; + + gpio_usb_power { + gpio-export,name = "mikrotik:power:usb"; + gpio-export,output = <0>; + gpios = <&gpio 13 GPIO_ACTIVE_HIGH>; + }; + + gpio_nand_power { + gpio-export,name = "mikrotik:power:nand"; + gpio-export,output = <0>; + gpios = <&gpio 23 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy4: ethernet-phy@4 { + reg = <4>; + }; +}; + +ð0 { + status = "okay"; + + mtd-mac-address = <&art 0x10>; + phy-handle = <&phy4>; + pll-data = <0x8f000000 0xa0000101 0xa0001313>; + + gmac-config { + device = <&gmac>; + rgmii-enabled = <1>; + }; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "routerboot"; + reg = <0x0000000 0x000c000>; + read-only; + }; + + art: partition@c000 { + label = "art"; + reg = <0x000c000 0x0001000>; + read-only; + }; + + partition@d000 { + label = "bios"; + reg = <0x000d000 0x0001000>; + read-only; + }; + + partition@e000 { + label = "soft_config"; + reg = <0x000e000 0x0001000>; + read-only; + }; + }; + }; +}; + +&nand { + status = "okay"; + + nand-ecc-mode = "soft"; + qca,nand-swap-dma; + qca,nand-scan-fixup; + + partitions { + compatible = "fixed-partitions"; + #size-cells = <1>; + + partition@0 { + label = "booter"; + reg = <0x0000000 0x0040000>; + read-only; + }; + + partition@40000 { + label = "kernel"; + reg = <0x0040000 0x03c0000>; + }; + + partition@400000 { + label = "ubi"; + reg = <0x0400000 0x7c00000>; + }; + }; +}; + +&uart { + status = "okay"; +}; + +&pcie0 { + status = "okay"; + + ath10k: wifi@0,0 { + compatible = "qcom,ath10k"; + reg = <0 0 0 0 0>; + #gpio-cells = <2>; + gpio-controller; + }; +}; + +&pcie1 { + status = "okay"; +}; + +&usb0 { + status = "okay"; +}; + +&usb_phy0 { + status = "okay"; +}; diff --git a/target/linux/ath79/image/nand.mk b/target/linux/ath79/image/nand.mk index 95ddca26b0..5a61be3545 100644 --- a/target/linux/ath79/image/nand.mk +++ b/target/linux/ath79/image/nand.mk @@ -1,3 +1,4 @@ +include ./common-mikrotik.mk include ./common-netgear.mk # for netgear-uImage # attention: only zlib compression is allowed for the boot fs @@ -110,6 +111,19 @@ define Device/glinet_gl-ar750s-nor endef TARGET_DEVICES += glinet_gl-ar750s-nor +define Device/mikrotik_routerboard-922uags-5hpacd + $(Device/mikrotik) + SOC := qca9558 + DEVICE_MODEL := RouterBOARD 922UAGS-5HPacD + BOARD_NAME := routerboard + IMAGE/sysupgrade.bin = append-kernel | kernel2minor -s 2048 -e -c | \ + sysupgrade-tar kernel=$$$$@ | append-metadata + DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct \ + kmod-usb2 nand-utils + SUPPORTED_DEVICES += rb-922uags-5hpacd +endef +TARGET_DEVICES += mikrotik_routerboard-922uags-5hpacd + # fake rootfs is mandatory, pad-offset 129 equals (2 * uimage_header + 0xff) define Device/netgear_ath79_nand DEVICE_VENDOR := NETGEAR diff --git a/target/linux/ath79/nand/base-files/etc/board.d/02_network b/target/linux/ath79/nand/base-files/etc/board.d/02_network index bd02a4b383..f42b1ea9c2 100755 --- a/target/linux/ath79/nand/base-files/etc/board.d/02_network +++ b/target/linux/ath79/nand/base-files/etc/board.d/02_network @@ -8,7 +8,8 @@ ath79_setup_interfaces() local board="$1" case "$board" in - aerohive,hiveap-121) + aerohive,hiveap-121|\ + mikrotik,routerboard-922uags-5hpacd) ucidef_set_interface_lan "eth0" ;; glinet,gl-ar750s-nor|\ diff --git a/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 9305f061fe..1989332f81 100644 --- a/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -3,6 +3,7 @@ [ -e /lib/firmware/$FIRMWARE ] && exit 0 . /lib/functions/caldata.sh +. /lib/functions/mikrotik-caldata.sh board=$(board_name) @@ -20,6 +21,13 @@ case "$FIRMWARE" in ;; esac ;; +"ath10k/cal-pci-0000:01:00.0.bin") + case $board in + mikrotik,routerboard-922uags-5hpacd) + mikrotik_caldata_extract "art" 0x5000 0x844 + ;; + esac + ;; *) exit 1 ;; diff --git a/target/linux/ath79/nand/base-files/etc/uci-defaults/04_led_migration b/target/linux/ath79/nand/base-files/etc/uci-defaults/04_led_migration new file mode 100644 index 0000000000..1a7b371a99 --- /dev/null +++ b/target/linux/ath79/nand/base-files/etc/uci-defaults/04_led_migration @@ -0,0 +1,17 @@ +#!/bin/sh + +. /lib/functions.sh +. /lib/functions/migrations.sh + +board=$(board_name) +boardonly="${board##*,}" + +case "$board" in +mikrotik,*) + migrate_leds "^rb:=mikrotik:" + ;; +esac + +migrations_apply system + +exit 0 diff --git a/target/linux/ath79/nand/base-files/lib/upgrade/platform.sh b/target/linux/ath79/nand/base-files/lib/upgrade/platform.sh index 15d88a361e..8d6b639b40 100644 --- a/target/linux/ath79/nand/base-files/lib/upgrade/platform.sh +++ b/target/linux/ath79/nand/base-files/lib/upgrade/platform.sh @@ -7,13 +7,27 @@ platform_check_image() { return 0 } -RAMFS_COPY_BIN='fw_printenv fw_setenv' +RAMFS_COPY_BIN='fw_printenv fw_setenv nandwrite' RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock' +platform_do_upgrade_mikrotik_nand() { + CI_KERNPART=none + local fw_mtd=$(find_mtd_part kernel) + fw_mtd="${fw_mtd/block/}" + [ -n "$fw_mtd" ] || return + mtd erase kernel + tar xf "$1" sysupgrade-routerboard/kernel -O | nandwrite -o "$fw_mtd" - + + nand_do_upgrade "$1" +} + platform_do_upgrade() { local board=$(board_name) case "$board" in + mikrotik,routerboard-922uags-5hpacd) + platform_do_upgrade_mikrotik_nand "$1" + ;; glinet,gl-ar300m-nand|\ glinet,gl-ar300m-nor) glinet_nand_nor_do_upgrade "$1" diff --git a/target/linux/ath79/nand/config-default b/target/linux/ath79/nand/config-default index 4742ad52d0..b03f977a07 100644 --- a/target/linux/ath79/nand/config-default +++ b/target/linux/ath79/nand/config-default @@ -3,6 +3,7 @@ CONFIG_MTD_NAND_AR934X=y CONFIG_MTD_NAND_CORE=y CONFIG_MTD_NAND_ECC=y CONFIG_MTD_SPI_NAND=y +CONFIG_MTD_SPLIT_MINOR_FW=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BLOCK=y CONFIG_MTD_UBI_WL_THRESHOLD=4096 diff --git a/target/linux/ath79/nand/target.mk b/target/linux/ath79/nand/target.mk index c565c9b2b8..fd5216b0eb 100644 --- a/target/linux/ath79/nand/target.mk +++ b/target/linux/ath79/nand/target.mk @@ -1,6 +1,6 @@ BOARDNAME := Generic devices with NAND flash -FEATURES += squashfs nand +FEATURES += squashfs nand minor DEFAULT_PACKAGES += wpad-basic From 817e77531942e6cc541e6cc92c6eb3655fe63b23 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 26 Feb 2020 16:36:16 +0100 Subject: [PATCH 09/16] Revert "ppp: backport security fixes" This reverts commit 215598fd03899c19a9cd26266221269dd5ec8cee since it didn't contain a reference to the CVE it addresses. The next commit will re-add the commit including a CVE reference in its commit message. Signed-off-by: Jo-Philipp Wich --- package/network/services/ppp/Makefile | 2 +- ...-Prevent-buffer-overflow-in-rc_mksid.patch | 30 --------- ...01-pppd-Fix-bounds-check-in-EAP-code.patch | 37 ----------- ...ived-EAP-messages-when-not-doing-EAP.patch | 61 ------------------- 4 files changed, 1 insertion(+), 129 deletions(-) delete mode 100644 package/network/services/ppp/patches/700-radius-Prevent-buffer-overflow-in-rc_mksid.patch delete mode 100644 package/network/services/ppp/patches/701-pppd-Fix-bounds-check-in-EAP-code.patch delete mode 100644 package/network/services/ppp/patches/702-pppd-Ignore-received-EAP-messages-when-not-doing-EAP.patch diff --git a/package/network/services/ppp/Makefile b/package/network/services/ppp/Makefile index b43a40bdce..451fdb04db 100644 --- a/package/network/services/ppp/Makefile +++ b/package/network/services/ppp/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=ppp -PKG_RELEASE:=2 +PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/paulusmack/ppp diff --git a/package/network/services/ppp/patches/700-radius-Prevent-buffer-overflow-in-rc_mksid.patch b/package/network/services/ppp/patches/700-radius-Prevent-buffer-overflow-in-rc_mksid.patch deleted file mode 100644 index 1c5722e6dd..0000000000 --- a/package/network/services/ppp/patches/700-radius-Prevent-buffer-overflow-in-rc_mksid.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 858976b1fc3107f1261aae337831959b511b83c2 Mon Sep 17 00:00:00 2001 -From: Paul Mackerras -Date: Sat, 4 Jan 2020 12:01:32 +1100 -Subject: [PATCH] radius: Prevent buffer overflow in rc_mksid() - -On some systems getpid() can return a value greater than 65535. -Increase the size of buf[] to allow for this, and use slprintf() -to make sure we never overflow it. - -Signed-off-by: Paul Mackerras ---- - pppd/plugins/radius/util.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/pppd/plugins/radius/util.c b/pppd/plugins/radius/util.c -index 6f976a712951..740131e8377c 100644 ---- a/pppd/plugins/radius/util.c -+++ b/pppd/plugins/radius/util.c -@@ -73,9 +73,9 @@ void rc_mdelay(int msecs) - char * - rc_mksid (void) - { -- static char buf[15]; -+ static char buf[32]; - static unsigned short int cnt = 0; -- sprintf (buf, "%08lX%04X%02hX", -+ slprintf(buf, sizeof(buf), "%08lX%04X%02hX", - (unsigned long int) time (NULL), - (unsigned int) getpid (), - cnt & 0xFF); diff --git a/package/network/services/ppp/patches/701-pppd-Fix-bounds-check-in-EAP-code.patch b/package/network/services/ppp/patches/701-pppd-Fix-bounds-check-in-EAP-code.patch deleted file mode 100644 index c2ca9729ec..0000000000 --- a/package/network/services/ppp/patches/701-pppd-Fix-bounds-check-in-EAP-code.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 8d7970b8f3db727fe798b65f3377fe6787575426 Mon Sep 17 00:00:00 2001 -From: Paul Mackerras -Date: Mon, 3 Feb 2020 15:53:28 +1100 -Subject: [PATCH] pppd: Fix bounds check in EAP code - -Given that we have just checked vallen < len, it can never be the case -that vallen >= len + sizeof(rhostname). This fixes the check so we -actually avoid overflowing the rhostname array. - -Reported-by: Ilja Van Sprundel -Signed-off-by: Paul Mackerras ---- - pppd/eap.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/pppd/eap.c b/pppd/eap.c -index 94407f56a336..1b93db01aebd 100644 ---- a/pppd/eap.c -+++ b/pppd/eap.c -@@ -1420,7 +1420,7 @@ int len; - } - - /* Not so likely to happen. */ -- if (vallen >= len + sizeof (rhostname)) { -+ if (len - vallen >= sizeof (rhostname)) { - dbglog("EAP: trimming really long peer name down"); - BCOPY(inp + vallen, rhostname, sizeof (rhostname) - 1); - rhostname[sizeof (rhostname) - 1] = '\0'; -@@ -1846,7 +1846,7 @@ int len; - } - - /* Not so likely to happen. */ -- if (vallen >= len + sizeof (rhostname)) { -+ if (len - vallen >= sizeof (rhostname)) { - dbglog("EAP: trimming really long peer name down"); - BCOPY(inp + vallen, rhostname, sizeof (rhostname) - 1); - rhostname[sizeof (rhostname) - 1] = '\0'; diff --git a/package/network/services/ppp/patches/702-pppd-Ignore-received-EAP-messages-when-not-doing-EAP.patch b/package/network/services/ppp/patches/702-pppd-Ignore-received-EAP-messages-when-not-doing-EAP.patch deleted file mode 100644 index 7286d81a56..0000000000 --- a/package/network/services/ppp/patches/702-pppd-Ignore-received-EAP-messages-when-not-doing-EAP.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 8d45443bb5c9372b4c6a362ba2f443d41c5636af Mon Sep 17 00:00:00 2001 -From: Paul Mackerras -Date: Mon, 3 Feb 2020 16:31:42 +1100 -Subject: [PATCH] pppd: Ignore received EAP messages when not doing EAP - -This adds some basic checks to the subroutines of eap_input to check -that we have requested or agreed to doing EAP authentication before -doing any processing on the received packet. The motivation is to -make it harder for a malicious peer to disrupt the operation of pppd -by sending unsolicited EAP packets. Note that eap_success() already -has a check that the EAP client state is reasonable, and does nothing -(apart from possibly printing a debug message) if not. - -Signed-off-by: Paul Mackerras ---- - pppd/eap.c | 18 ++++++++++++++++++ - 1 file changed, 18 insertions(+) - -diff --git a/pppd/eap.c b/pppd/eap.c -index 1b93db01aebd..082e95343120 100644 ---- a/pppd/eap.c -+++ b/pppd/eap.c -@@ -1328,6 +1328,12 @@ int len; - int fd; - #endif /* USE_SRP */ - -+ /* -+ * Ignore requests if we're not open -+ */ -+ if (esp->es_client.ea_state <= eapClosed) -+ return; -+ - /* - * Note: we update es_client.ea_id *only if* a Response - * message is being generated. Otherwise, we leave it the -@@ -1736,6 +1742,12 @@ int len; - u_char dig[SHA_DIGESTSIZE]; - #endif /* USE_SRP */ - -+ /* -+ * Ignore responses if we're not open -+ */ -+ if (esp->es_server.ea_state <= eapClosed) -+ return; -+ - if (esp->es_server.ea_id != id) { - dbglog("EAP: discarding Response %d; expected ID %d", id, - esp->es_server.ea_id); -@@ -2047,6 +2059,12 @@ u_char *inp; - int id; - int len; - { -+ /* -+ * Ignore failure messages if we're not open -+ */ -+ if (esp->es_client.ea_state <= eapClosed) -+ return; -+ - if (!eap_client_active(esp)) { - dbglog("EAP unexpected failure message in state %s (%d)", - eap_state_name(esp->es_client.ea_state), From 35890514bb191de3ab96dcd684714850a9142efc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Thu, 20 Feb 2020 09:03:54 +0100 Subject: [PATCH 10/16] ppp: backport security fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 8d45443bb5c9 pppd: Ignore received EAP messages when not doing EAP 8d7970b8f3db pppd: Fix bounds check in EAP code 858976b1fc31 radius: Prevent buffer overflow in rc_mksid() Signed-off-by: Petr Štetiar Fixes: CVE-2020-8597 Signed-off-by: Jo-Philipp Wich --- package/network/services/ppp/Makefile | 2 +- ...-Prevent-buffer-overflow-in-rc_mksid.patch | 30 +++++++++ ...01-pppd-Fix-bounds-check-in-EAP-code.patch | 37 +++++++++++ ...ived-EAP-messages-when-not-doing-EAP.patch | 61 +++++++++++++++++++ 4 files changed, 129 insertions(+), 1 deletion(-) create mode 100644 package/network/services/ppp/patches/700-radius-Prevent-buffer-overflow-in-rc_mksid.patch create mode 100644 package/network/services/ppp/patches/701-pppd-Fix-bounds-check-in-EAP-code.patch create mode 100644 package/network/services/ppp/patches/702-pppd-Ignore-received-EAP-messages-when-not-doing-EAP.patch diff --git a/package/network/services/ppp/Makefile b/package/network/services/ppp/Makefile index 451fdb04db..b43a40bdce 100644 --- a/package/network/services/ppp/Makefile +++ b/package/network/services/ppp/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=ppp -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/paulusmack/ppp diff --git a/package/network/services/ppp/patches/700-radius-Prevent-buffer-overflow-in-rc_mksid.patch b/package/network/services/ppp/patches/700-radius-Prevent-buffer-overflow-in-rc_mksid.patch new file mode 100644 index 0000000000..1c5722e6dd --- /dev/null +++ b/package/network/services/ppp/patches/700-radius-Prevent-buffer-overflow-in-rc_mksid.patch @@ -0,0 +1,30 @@ +From 858976b1fc3107f1261aae337831959b511b83c2 Mon Sep 17 00:00:00 2001 +From: Paul Mackerras +Date: Sat, 4 Jan 2020 12:01:32 +1100 +Subject: [PATCH] radius: Prevent buffer overflow in rc_mksid() + +On some systems getpid() can return a value greater than 65535. +Increase the size of buf[] to allow for this, and use slprintf() +to make sure we never overflow it. + +Signed-off-by: Paul Mackerras +--- + pppd/plugins/radius/util.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/pppd/plugins/radius/util.c b/pppd/plugins/radius/util.c +index 6f976a712951..740131e8377c 100644 +--- a/pppd/plugins/radius/util.c ++++ b/pppd/plugins/radius/util.c +@@ -73,9 +73,9 @@ void rc_mdelay(int msecs) + char * + rc_mksid (void) + { +- static char buf[15]; ++ static char buf[32]; + static unsigned short int cnt = 0; +- sprintf (buf, "%08lX%04X%02hX", ++ slprintf(buf, sizeof(buf), "%08lX%04X%02hX", + (unsigned long int) time (NULL), + (unsigned int) getpid (), + cnt & 0xFF); diff --git a/package/network/services/ppp/patches/701-pppd-Fix-bounds-check-in-EAP-code.patch b/package/network/services/ppp/patches/701-pppd-Fix-bounds-check-in-EAP-code.patch new file mode 100644 index 0000000000..c2ca9729ec --- /dev/null +++ b/package/network/services/ppp/patches/701-pppd-Fix-bounds-check-in-EAP-code.patch @@ -0,0 +1,37 @@ +From 8d7970b8f3db727fe798b65f3377fe6787575426 Mon Sep 17 00:00:00 2001 +From: Paul Mackerras +Date: Mon, 3 Feb 2020 15:53:28 +1100 +Subject: [PATCH] pppd: Fix bounds check in EAP code + +Given that we have just checked vallen < len, it can never be the case +that vallen >= len + sizeof(rhostname). This fixes the check so we +actually avoid overflowing the rhostname array. + +Reported-by: Ilja Van Sprundel +Signed-off-by: Paul Mackerras +--- + pppd/eap.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/pppd/eap.c b/pppd/eap.c +index 94407f56a336..1b93db01aebd 100644 +--- a/pppd/eap.c ++++ b/pppd/eap.c +@@ -1420,7 +1420,7 @@ int len; + } + + /* Not so likely to happen. */ +- if (vallen >= len + sizeof (rhostname)) { ++ if (len - vallen >= sizeof (rhostname)) { + dbglog("EAP: trimming really long peer name down"); + BCOPY(inp + vallen, rhostname, sizeof (rhostname) - 1); + rhostname[sizeof (rhostname) - 1] = '\0'; +@@ -1846,7 +1846,7 @@ int len; + } + + /* Not so likely to happen. */ +- if (vallen >= len + sizeof (rhostname)) { ++ if (len - vallen >= sizeof (rhostname)) { + dbglog("EAP: trimming really long peer name down"); + BCOPY(inp + vallen, rhostname, sizeof (rhostname) - 1); + rhostname[sizeof (rhostname) - 1] = '\0'; diff --git a/package/network/services/ppp/patches/702-pppd-Ignore-received-EAP-messages-when-not-doing-EAP.patch b/package/network/services/ppp/patches/702-pppd-Ignore-received-EAP-messages-when-not-doing-EAP.patch new file mode 100644 index 0000000000..7286d81a56 --- /dev/null +++ b/package/network/services/ppp/patches/702-pppd-Ignore-received-EAP-messages-when-not-doing-EAP.patch @@ -0,0 +1,61 @@ +From 8d45443bb5c9372b4c6a362ba2f443d41c5636af Mon Sep 17 00:00:00 2001 +From: Paul Mackerras +Date: Mon, 3 Feb 2020 16:31:42 +1100 +Subject: [PATCH] pppd: Ignore received EAP messages when not doing EAP + +This adds some basic checks to the subroutines of eap_input to check +that we have requested or agreed to doing EAP authentication before +doing any processing on the received packet. The motivation is to +make it harder for a malicious peer to disrupt the operation of pppd +by sending unsolicited EAP packets. Note that eap_success() already +has a check that the EAP client state is reasonable, and does nothing +(apart from possibly printing a debug message) if not. + +Signed-off-by: Paul Mackerras +--- + pppd/eap.c | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +diff --git a/pppd/eap.c b/pppd/eap.c +index 1b93db01aebd..082e95343120 100644 +--- a/pppd/eap.c ++++ b/pppd/eap.c +@@ -1328,6 +1328,12 @@ int len; + int fd; + #endif /* USE_SRP */ + ++ /* ++ * Ignore requests if we're not open ++ */ ++ if (esp->es_client.ea_state <= eapClosed) ++ return; ++ + /* + * Note: we update es_client.ea_id *only if* a Response + * message is being generated. Otherwise, we leave it the +@@ -1736,6 +1742,12 @@ int len; + u_char dig[SHA_DIGESTSIZE]; + #endif /* USE_SRP */ + ++ /* ++ * Ignore responses if we're not open ++ */ ++ if (esp->es_server.ea_state <= eapClosed) ++ return; ++ + if (esp->es_server.ea_id != id) { + dbglog("EAP: discarding Response %d; expected ID %d", id, + esp->es_server.ea_id); +@@ -2047,6 +2059,12 @@ u_char *inp; + int id; + int len; + { ++ /* ++ * Ignore failure messages if we're not open ++ */ ++ if (esp->es_client.ea_state <= eapClosed) ++ return; ++ + if (!eap_client_active(esp)) { + dbglog("EAP unexpected failure message in state %s (%d)", + eap_state_name(esp->es_client.ea_state), From 2299808c68cbaf2bbdde31073c5e887cd62874dc Mon Sep 17 00:00:00 2001 From: Xu Wang Date: Sat, 8 Feb 2020 23:04:11 +0000 Subject: [PATCH 11/16] base-files: add all buildinfo with INCLUDE_CONFIG CONFIG_INCLUDE_CONFIG option is helpful for being able to rebuild the exact same firmware as you see on a live OpenWRT instance, but it's crucially missing feeds information, so we can't rebuild the exact same package versions. This commit fixes this by adding the remaining feeds (and version) buildinfo files to the image. Signed-off-by: Xu Wang --- config/Config-build.in | 2 +- package/base-files/Makefile | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/config/Config-build.in b/config/Config-build.in index 59dfaea8bb..6a6fb2882c 100644 --- a/config/Config-build.in +++ b/config/Config-build.in @@ -100,7 +100,7 @@ menu "Global build settings" bool "Include build configuration in firmware" if DEVEL default n help - If enabled, config.buildinfo will be stored in /etc/build.config of firmware. + If enabled, buildinfo files will be stored in /etc/build.* of firmware. config COLLECT_KERNEL_DEBUG bool diff --git a/package/base-files/Makefile b/package/base-files/Makefile index 18325564dc..4f4e93361f 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -198,7 +198,9 @@ define Package/base-files/install $(if $(CONFIG_INCLUDE_CONFIG), \ echo -e "# Build configuration for board $(BOARD)/$(SUBTARGET)/$(PROFILE)\n" >$(1)/etc/build.config; \ - cat $(BIN_DIR)/config.buildinfo >>$(1)/etc/build.config) + cat $(BIN_DIR)/config.buildinfo >>$(1)/etc/build.config; \ + cat $(BIN_DIR)/feeds.buildinfo >>$(1)/etc/build.feeds; \ + cat $(BIN_DIR)/version.buildinfo >>$(1)/etc/build.version) $(if $(CONFIG_CLEAN_IPKG),, \ mkdir -p $(1)/etc/opkg; \ From 9de6bc872af50c80f0ba449422f413cfa613f7e5 Mon Sep 17 00:00:00 2001 From: Roger Pueyo Centelles Date: Mon, 24 Feb 2020 21:07:59 +0100 Subject: [PATCH 12/16] ath79: fix spi-max-frequency for wAP G-5HacT2HnD The introduction of ebf0d8dade (ath79: add new ar934x spi driver) made the SPI memory unusable. Reducing the spi-max-frequency to a smaller value makes it work again. Tested on two MikroTik RouterBOARD wAP G-5HacT2HnD devices. Signed-off-by: Roger Pueyo Centelles --- .../ath79/dts/qca9556_mikrotik_routerboard-wap-g-5hact2hnd.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/ath79/dts/qca9556_mikrotik_routerboard-wap-g-5hact2hnd.dts b/target/linux/ath79/dts/qca9556_mikrotik_routerboard-wap-g-5hact2hnd.dts index e13b58b600..015bd2efe5 100644 --- a/target/linux/ath79/dts/qca9556_mikrotik_routerboard-wap-g-5hact2hnd.dts +++ b/target/linux/ath79/dts/qca9556_mikrotik_routerboard-wap-g-5hact2hnd.dts @@ -73,7 +73,7 @@ flash@0 { compatible = "jedec,spi-nor"; reg = <0>; - spi-max-frequency = <104000000>; + spi-max-frequency = <50000000>; partitions { compatible = "fixed-partitions"; From ebc090e420d1fc3ed30fc9f0331ee95422c2bace Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Thu, 27 Feb 2020 11:55:36 +0100 Subject: [PATCH 13/16] ath79: reduce spi-max-frequency to 50 MHz The introduction of ebf0d8dadeca ("ath79: add new ar934x spi driver") made the SPI memory unusable on devices with very high spi-max-frequency (104 MHz). Here's how the actual clock is calculated: (AHB_CLK/((CLOCK_DIVIDER+1)*2)) where AHB_CLK is a fixed clock (e.g. 200MHz on AR9331) and CLOCK_DIVIDER is the parameter we can set. Highest clock according to this formula is AHB_CLK/2 (100MHz, but that didn't work in device tests). The next possible value is AHB_CLK/4 (50MHz). Speeds between 50 MHz and 100 MHz will be rounded down, so using values higher than 50 MHz does not provide any benefit. Consequently, this patch reduces spi-max-frequency for all devices with values higher than 50 MHz to 50 MHz (effectively, this only affects devices with 104 MHz before this patch). Tested on GL.inet GL-AR150: Boot fails with 104 MHz but is successful with both 50 MHz and 80 MHz (fast-read), where the latter two yield identical read speeds. Fixes: ebf0d8dadeca ("ath79: add new ar934x spi driver") Signed-off-by: Adrian Schmutzler --- target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts | 2 +- target/linux/ath79/dts/ar9330_pqi_air-pen.dts | 2 +- target/linux/ath79/dts/ar9331_8dev_carambola2.dts | 2 +- target/linux/ath79/dts/ar9331_embeddedwireless_dorin.dts | 2 +- target/linux/ath79/dts/ar9331_tplink_tl-mr3020-v1.dts | 2 +- target/linux/ath79/dts/ar9331_tplink_tl-mr3040-v2.dts | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts b/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts index 70754c905e..68e1995c76 100644 --- a/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts +++ b/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts @@ -86,7 +86,7 @@ flash@0 { compatible = "jedec,spi-nor"; - spi-max-frequency = <104000000>; + spi-max-frequency = <50000000>; reg = <0>; partitions { diff --git a/target/linux/ath79/dts/ar9330_pqi_air-pen.dts b/target/linux/ath79/dts/ar9330_pqi_air-pen.dts index 92484f9331..8537faa0f9 100644 --- a/target/linux/ath79/dts/ar9330_pqi_air-pen.dts +++ b/target/linux/ath79/dts/ar9330_pqi_air-pen.dts @@ -75,7 +75,7 @@ flash@0 { compatible = "jedec,spi-nor"; - spi-max-frequency = <104000000>; + spi-max-frequency = <50000000>; reg = <0>; partitions { diff --git a/target/linux/ath79/dts/ar9331_8dev_carambola2.dts b/target/linux/ath79/dts/ar9331_8dev_carambola2.dts index cc0320d652..ef244f0b55 100644 --- a/target/linux/ath79/dts/ar9331_8dev_carambola2.dts +++ b/target/linux/ath79/dts/ar9331_8dev_carambola2.dts @@ -73,7 +73,7 @@ flash@0 { compatible = "jedec,spi-nor"; - spi-max-frequency = <104000000>; + spi-max-frequency = <50000000>; reg = <0>; partitions { diff --git a/target/linux/ath79/dts/ar9331_embeddedwireless_dorin.dts b/target/linux/ath79/dts/ar9331_embeddedwireless_dorin.dts index 3489a972d4..4761b91093 100644 --- a/target/linux/ath79/dts/ar9331_embeddedwireless_dorin.dts +++ b/target/linux/ath79/dts/ar9331_embeddedwireless_dorin.dts @@ -68,7 +68,7 @@ flash@0 { compatible = "jedec,spi-nor"; - spi-max-frequency = <104000000>; + spi-max-frequency = <50000000>; reg = <0>; partitions { diff --git a/target/linux/ath79/dts/ar9331_tplink_tl-mr3020-v1.dts b/target/linux/ath79/dts/ar9331_tplink_tl-mr3020-v1.dts index 3cd5c130c8..97a058edf6 100644 --- a/target/linux/ath79/dts/ar9331_tplink_tl-mr3020-v1.dts +++ b/target/linux/ath79/dts/ar9331_tplink_tl-mr3020-v1.dts @@ -120,7 +120,7 @@ /* Spansion S25FL032PIF SPI flash */ flash@0 { compatible = "jedec,spi-nor"; - spi-max-frequency = <104000000>; + spi-max-frequency = <50000000>; reg = <0>; partitions { diff --git a/target/linux/ath79/dts/ar9331_tplink_tl-mr3040-v2.dts b/target/linux/ath79/dts/ar9331_tplink_tl-mr3040-v2.dts index e8a3dfbce7..5918e611dd 100644 --- a/target/linux/ath79/dts/ar9331_tplink_tl-mr3040-v2.dts +++ b/target/linux/ath79/dts/ar9331_tplink_tl-mr3040-v2.dts @@ -114,7 +114,7 @@ flash@0 { compatible = "jedec,spi-nor"; - spi-max-frequency = <104000000>; + spi-max-frequency = <50000000>; reg = <0>; partitions { From 16965a0f3f897ed48d9b8b7b53e0358c3a38ce6e Mon Sep 17 00:00:00 2001 From: Sungbo Eo Date: Mon, 24 Feb 2020 21:06:04 +0900 Subject: [PATCH 14/16] kirkwood: convert DTS patches into plain DTS files Move DTS files newly created by patch files to files directory. This will make these files much more maintainable. Patching the kernel Makefile is unnecessary, as the DTS files specified in DEVICE_DTS will be compiled by OpenWrt buildroot anyway. Signed-off-by: Sungbo Eo Acked-by: Adrian Schmutzler --- .../arch/arm/boot/dts/kirkwood-goflexhome.dts | 124 ++++++++ .../arm/boot/dts/kirkwood-linksys-audi.dts | 250 +++++++++++++++++ .../arch/arm/boot/dts/kirkwood-nsa310b.dts | 132 +++++++++ .../arch/arm/boot/dts/kirkwood-on100.dts | 165 +++++++++++ .../arch/arm/boot/dts/kirkwood-goflexhome.dts | 124 ++++++++ .../arm/boot/dts/kirkwood-linksys-audi.dts | 251 +++++++++++++++++ .../arch/arm/boot/dts/kirkwood-nsa310b.dts | 132 +++++++++ .../arch/arm/boot/dts/kirkwood-on100.dts | 163 +++++++++++ .../kirkwood/patches-4.14/104-ea3500.patch | 263 ----------------- .../patches-4.14/105-goflexhome.patch | 137 --------- .../patches-4.14/107-02-nsa310b.patch | 155 ---------- .../kirkwood/patches-4.14/108-on100.patch | 178 ------------ .../kirkwood/patches-4.19/104-ea3500.patch | 264 ------------------ .../patches-4.19/105-goflexhome.patch | 137 --------- .../patches-4.19/107-02-nsa310b.patch | 155 ---------- .../kirkwood/patches-4.19/108-on100.patch | 176 ------------ 16 files changed, 1341 insertions(+), 1465 deletions(-) create mode 100644 target/linux/kirkwood/files-4.14/arch/arm/boot/dts/kirkwood-goflexhome.dts create mode 100644 target/linux/kirkwood/files-4.14/arch/arm/boot/dts/kirkwood-linksys-audi.dts create mode 100644 target/linux/kirkwood/files-4.14/arch/arm/boot/dts/kirkwood-nsa310b.dts create mode 100644 target/linux/kirkwood/files-4.14/arch/arm/boot/dts/kirkwood-on100.dts create mode 100644 target/linux/kirkwood/files-4.19/arch/arm/boot/dts/kirkwood-goflexhome.dts create mode 100644 target/linux/kirkwood/files-4.19/arch/arm/boot/dts/kirkwood-linksys-audi.dts create mode 100644 target/linux/kirkwood/files-4.19/arch/arm/boot/dts/kirkwood-nsa310b.dts create mode 100644 target/linux/kirkwood/files-4.19/arch/arm/boot/dts/kirkwood-on100.dts delete mode 100644 target/linux/kirkwood/patches-4.14/104-ea3500.patch delete mode 100644 target/linux/kirkwood/patches-4.14/105-goflexhome.patch delete mode 100644 target/linux/kirkwood/patches-4.14/107-02-nsa310b.patch delete mode 100644 target/linux/kirkwood/patches-4.14/108-on100.patch delete mode 100644 target/linux/kirkwood/patches-4.19/104-ea3500.patch delete mode 100644 target/linux/kirkwood/patches-4.19/105-goflexhome.patch delete mode 100644 target/linux/kirkwood/patches-4.19/107-02-nsa310b.patch delete mode 100644 target/linux/kirkwood/patches-4.19/108-on100.patch diff --git a/target/linux/kirkwood/files-4.14/arch/arm/boot/dts/kirkwood-goflexhome.dts b/target/linux/kirkwood/files-4.14/arch/arm/boot/dts/kirkwood-goflexhome.dts new file mode 100644 index 0000000000..af20cf9e2c --- /dev/null +++ b/target/linux/kirkwood/files-4.14/arch/arm/boot/dts/kirkwood-goflexhome.dts @@ -0,0 +1,124 @@ +/dts-v1/; + +#include "kirkwood.dtsi" +#include "kirkwood-6281.dtsi" + +/ { + model = "Seagate GoFlex Home"; + compatible = "seagate,goflexhome", "marvell,kirkwood-88f6281", "marvell,kirkwood"; + + aliases { + led-boot = &led_health; + led-failsafe = &led_fault; + led-running = &led_health; + led-upgrade = &led_fault; + }; + + memory { + device_type = "memory"; + reg = <0x00000000 0x8000000>; + }; + + chosen { + bootargs = "console=ttyS0,115200n8 earlyprintk root=/dev/sda1 rootdelay=10"; + stdout-path = &uart0; + }; + + ocp@f1000000 { + pinctrl: pin-controller@10000 { + pmx_usb_power_enable: pmx-usb-power-enable { + marvell,pins = "mpp29"; + marvell,function = "gpio"; + }; + pmx_led_white: pmx-led-white { + marvell,pins = "mpp40"; + marvell,function = "gpio"; + }; + pmx_led_green: pmx-led_green { + marvell,pins = "mpp46"; + marvell,function = "gpio"; + }; + pmx_led_orange: pmx-led-orange { + marvell,pins = "mpp47"; + marvell,function = "gpio"; + }; + }; + serial@12000 { + status = "ok"; + }; + + sata@80000 { + status = "okay"; + nr-ports = <2>; + }; + + }; + gpio-leds { + compatible = "gpio-leds"; + + led_health: health { + label = "status:green:health"; + gpios = <&gpio1 14 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + led_fault: fault { + label = "status:orange:fault"; + gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; + }; + misc { + label = "status:white:misc"; + gpios = <&gpio1 8 GPIO_ACTIVE_LOW>; + linux,default-trigger = "disk-activity"; + }; + }; + regulators { + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <0>; + pinctrl-0 = <&pmx_usb_power_enable>; + pinctrl-names = "default"; + + usb_power: regulator@1 { + compatible = "regulator-fixed"; + reg = <1>; + regulator-name = "USB Power"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + enable-active-high; + regulator-always-on; + regulator-boot-on; + gpio = <&gpio0 29 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&nand { + chip-delay = <40>; + status = "okay"; + + partition@0 { + label = "u-boot"; + reg = <0x0000000 0x100000>; + read-only; + }; + + partition@100000 { + label = "ubi"; + reg = <0x100000 0x0ff00000>; + }; +}; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy@0 { + reg = <0>; + }; +}; + +ð0 { + status = "okay"; + ethernet0-port@0 { + phy-handle = <ðphy0>; + }; +}; diff --git a/target/linux/kirkwood/files-4.14/arch/arm/boot/dts/kirkwood-linksys-audi.dts b/target/linux/kirkwood/files-4.14/arch/arm/boot/dts/kirkwood-linksys-audi.dts new file mode 100644 index 0000000000..004ce10219 --- /dev/null +++ b/target/linux/kirkwood/files-4.14/arch/arm/boot/dts/kirkwood-linksys-audi.dts @@ -0,0 +1,250 @@ +/* + * kirkwood-linksys-audi.dts - Device Tree file for Linksys EA3500 + * + * (c) 2013 Jonas Gorski + * (c) 2013 Deutsche Telekom Innovation Laboratories + * (c) 2014 Luka Perkov + * (c) 2014 Dan Walters + * + * This file is licensed under the terms of the GNU General Public + * License version 2. This program is licensed "as is" without any + * warranty of any kind, whether express or implied. + */ + +/dts-v1/; + +#include "kirkwood.dtsi" +#include "kirkwood-6282.dtsi" + +/ { + model = "Linksys Audi (EA3500)"; + compatible = "linksys,audi", "marvell,kirkwood-88f6282", "marvell,kirkwood"; + + memory { + device_type = "memory"; + reg = <0x00000000 0x4000000>; + }; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + gpio_keys { + compatible = "gpio-keys"; + #address-cells = <1>; + #size-cells = <0>; + pinctrl-0 = < &pmx_btn_wps &pmx_btn_reset >; + pinctrl-names = "default"; + + wps { + label = "WPS Button"; + linux,code = ; + gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; + }; + + reset { + label = "Reset Button"; + linux,code = ; + gpios = <&gpio1 16 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + pinctrl-0 = < &pmx_led_green_power >; + pinctrl-names = "default"; + + led_power: power { + label = "audi:green:power"; + gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>; + default-state = "on"; + }; + }; + + mvsw61xx { + compatible = "marvell,88e6171"; + status = "okay"; + reg = <0x10>; + + mii-bus = <&mdio>; + cpu-port-0 = <5>; + cpu-port-1 = <6>; + is-indirect; + }; + + dsa { + compatible = "marvell,dsa"; + #address-cells = <2>; + #size-cells = <0>; + + dsa,ethernet = <ð0port>; + dsa,mii-bus = <&mdio>; + + switch@16,0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <16 0>; /* MDIO address 16, switch 0 in tree */ + + port@0 { + reg = <0>; + label = "ethernet1"; + }; + + port@1 { + reg = <1>; + label = "ethernet2"; + }; + + port@2 { + reg = <2>; + label = "ethernet3"; + }; + + port@3 { + reg = <3>; + label = "ethernet4"; + }; + + port@4 { + reg = <4>; + label = "internet"; + }; + + port@5 { + reg = <5>; + label = "cpu"; + }; + }; + }; +}; + +&pinctrl { + pmx_led_green_power: pmx-led-green-power { + marvell,pins = "mpp7"; + marvell,function = "gpo"; + }; + pmx_btn_wps: pmx-btn-wps { + marvell,pins = "mpp47"; + marvell,function = "gpio"; + }; + pmx_btn_reset: pmx-btn-reset { + marvell,pins = "mpp48"; + marvell,function = "gpio"; + }; +}; + +&nand { + status = "okay"; + pinctrl-0 = <&pmx_nand>; + pinctrl-names = "default"; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x80000>; + read-only; + }; + + partition@80000 { + label = "u_env"; + reg = <0x80000 0x4000>; + }; + + partition@84000 { + label = "s_env"; + reg = <0x84000 0x4000>; + }; + + partition@200000 { + label = "kernel1"; + reg = <0x200000 0x290000>; + }; + + partition@490000 { + label = "rootfs1"; + reg = <0x490000 0x1170000>; + }; + + partition@1600000 { + label = "kernel2"; + reg = <0x1600000 0x290000>; + }; + + partition@1890000 { + label = "rootfs2"; + reg = <0x1890000 0x1170000>; + }; + + partition@2a00000 { + label = "syscfg"; + reg = <0x2a00000 0x1600000>; + }; + + partition@88000 { + label = "unused"; + reg = <0x88000 0x178000>; + }; + + }; +}; + +&pciec { + status = "okay"; +}; + +&pcie0 { + status = "okay"; +}; + +&pcie1 { + status = "okay"; +}; + +&mdio { + status = "okay"; +}; + +&uart0 { + status = "okay"; +}; + +/* eth0 is connected to a Marvell 88E6171 switch, without a PHY. So set + * fixed speed and duplex. + */ +ð0 { + status = "okay"; + ethernet0-port@0 { + speed = <1000>; + duplex = <1>; + }; +}; + +/* eth1 is connected to the switch at port 6. However DSA only supports a + * single CPU port. Upstream uses DSA so they disable this port to avoid confusion. + */ +ð1 { + status = "okay"; + ethernet1-port@0 { + speed = <1000>; + duplex = <1>; + }; +}; + +/* There is no battery on the board, so the RTC does not keep + * time when there is no power, making it useless. + */ +&rtc { + status = "disabled"; +}; diff --git a/target/linux/kirkwood/files-4.14/arch/arm/boot/dts/kirkwood-nsa310b.dts b/target/linux/kirkwood/files-4.14/arch/arm/boot/dts/kirkwood-nsa310b.dts new file mode 100644 index 0000000000..a83a55af07 --- /dev/null +++ b/target/linux/kirkwood/files-4.14/arch/arm/boot/dts/kirkwood-nsa310b.dts @@ -0,0 +1,132 @@ +/dts-v1/; + +#include "kirkwood-nsa3x0-common.dtsi" + +/* + * There are at least two different NSA310 designs. This variant has + * a red/green USB Led (same as nsa310) and a lm85 temp/fan controller. + */ + +/ { + model = "ZyXEL NSA310b"; + compatible = "zyxel,nsa310b", "zyxel,nsa310", "marvell,kirkwood-88f6281", "marvell,kirkwood"; + + aliases { + led-boot = &led_green_sys; + led-failsafe = &led_red_sys; + led-running = &led_green_sys; + led-upgrade = &led_red_sys; + }; + + memory { + device_type = "memory"; + reg = <0x00000000 0x10000000>; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + stdout-path = &uart0; + }; + + ocp@f1000000 { + pinctrl: pin-controller@10000 { + pinctrl-names = "default"; + + pmx_led_esata_green: pmx-led-esata-green { + marvell,pins = "mpp12"; + marvell,function = "gpio"; + }; + + pmx_led_esata_red: pmx-led-esata-red { + marvell,pins = "mpp13"; + marvell,function = "gpio"; + }; + + pmx_led_usb_green: pmx-led-usb-green { + marvell,pins = "mpp15"; + marvell,function = "gpio"; + }; + + pmx_led_usb_red: pmx-led-usb-red { + marvell,pins = "mpp16"; + marvell,function = "gpio"; + }; + + pmx_led_sys_green: pmx-led-sys-green { + marvell,pins = "mpp28"; + marvell,function = "gpio"; + }; + + pmx_led_sys_red: pmx-led-sys-red { + marvell,pins = "mpp29"; + marvell,function = "gpio"; + }; + + pmx_led_hdd_green: pmx-led-hdd-green { + marvell,pins = "mpp41"; + marvell,function = "gpio"; + }; + + pmx_led_hdd_red: pmx-led-hdd-red { + marvell,pins = "mpp42"; + marvell,function = "gpio"; + }; + + }; + + i2c@11000 { + status = "okay"; + + lm85: lm85@2e { + compatible = "national,lm85"; + reg = <0x2e>; + }; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + + led_green_sys: green-sys { + label = "nsa310:green:sys"; + gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>; + default-state = "on"; + }; + led_red_sys: red-sys { + label = "nsa310:red:sys"; + gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>; + }; + green-hdd { + label = "nsa310:green:hdd"; + gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>; + }; + red-hdd { + label = "nsa310:red:hdd"; + gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>; + }; + green-esata { + label = "nsa310:green:esata"; + gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; + }; + red-esata { + label = "nsa310:red:esata"; + gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>; + }; + green-usb { + label = "nsa310:green:usb"; + gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>; + }; + red-usb { + label = "nsa310:red:usb"; + gpios = <&gpio0 16 GPIO_ACTIVE_HIGH>; + }; + green-copy { + label = "nsa310:green:copy"; + gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>; + }; + red-copy { + label = "nsa310:red:copy"; + gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>; + }; + }; +}; diff --git a/target/linux/kirkwood/files-4.14/arch/arm/boot/dts/kirkwood-on100.dts b/target/linux/kirkwood/files-4.14/arch/arm/boot/dts/kirkwood-on100.dts new file mode 100644 index 0000000000..9296c3fc71 --- /dev/null +++ b/target/linux/kirkwood/files-4.14/arch/arm/boot/dts/kirkwood-on100.dts @@ -0,0 +1,165 @@ +/dts-v1/; + +#include "kirkwood.dtsi" +#include "kirkwood-6282.dtsi" + +/ { + model = "Cisco Systems ON100"; + compatible = "cisco,on100", "marvell,kirkwood-88f6282", "marvell,kirkwood"; + + memory { + device_type = "memory"; + reg = <0x00000000 0x20000000>; + }; + + aliases { + led-boot = &led_health_green; + led-failsafe = &led_health_red; + led-running = &led_health_green; + led-upgrade = &led_health_red; + serial0 = &uart0; + }; + + chosen { + bootargs = "console=ttyS0,115200n8 earlyprintk"; + stdout-path = "serial0:115200n8"; + }; + + gpio_keys { + compatible = "gpio-keys"; + #address-cells = <1>; + #size-cells = <0>; + pinctrl-0 = <&pmx_btn_reset>; + pinctrl-names = "default"; + + button@1 { + label = "Reset Button"; + linux,code = ; + gpios = <&gpio1 9 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + pinctrl-0 = < &pmx_led_health_r &pmx_led_health_g >; + pinctrl-names = "default"; + + led_health_green: health_green { + label = "on100:green:health"; + gpios = <&gpio1 12 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + led_health_red: health_red { + label = "on100:red:health"; + gpios = <&gpio1 13 GPIO_ACTIVE_LOW>; + }; + + health2_green { + label = "on100:green:health2"; + gpios = <&gpio1 14 GPIO_ACTIVE_LOW>; + }; + + health2_red { + label = "on100:red:health2"; + gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; + }; + }; +}; + +ð0 { + status = "okay"; + + ethernet0-port@0 { + phy-handle = <ðphy0>; + phy-connection-type = "rgmii-id"; + }; +}; + +ð1 { + status = "okay"; + + ethernet1-port@0 { + phy-handle = <ðphy1>; + phy-connection-type = "rgmii-id"; + }; +}; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy@0 { + /* Marvell 88E1121R */ + compatible = "ethernet-phy-id0141.0cb0", + "ethernet-phy-ieee802.3-c22"; + reg = <0>; + }; + + ethphy1: ethernet-phy@1 { + /* Marvell 88E1121R */ + compatible = "ethernet-phy-id0141.0cb0", + "ethernet-phy-ieee802.3-c22"; + reg = <1>; + }; +}; + +&nand { + status = "okay"; + + partition@0 { + label = "u-boot"; + reg = <0x00000000 0x000a0000>; + read-only; + }; + + partition@a0000 { + label = "u-boot environment"; + reg = <0x000a0000 0x00020000>; + read-only; + }; + + partition@c0000 { + label = "kernel"; + reg = <0x000c0000 0x00540000>; + }; + + partition@600000 { + label = "ubi"; + reg = <0x00600000 0x1fa00000>; + }; +}; + +&pinctrl { + pmx_led_health_r: pmx-led-health-r { + marvell,pins = "mpp45"; + marvell,function = "gpio"; + }; + + pmx_led_health_g: pmx-led-health-g { + marvell,pins = "mpp44"; + marvell,function = "gpio"; + }; + + pmx_led_health2_r: pmx-led-health2-r { + marvell,pins = "mpp47"; + marvell,function = "gpio"; + }; + + pmx_led_health2_g: pmx-led-health2-g { + marvell,pins = "mpp46"; + marvell,function = "gpio"; + }; + + pmx_btn_reset: pmx-led-reset { + marvell,pins = "mpp31"; + marvell,function = "gpio"; + }; +}; + +&sdio { + status = "okay"; +}; + +&uart0 { + status = "okay"; +}; diff --git a/target/linux/kirkwood/files-4.19/arch/arm/boot/dts/kirkwood-goflexhome.dts b/target/linux/kirkwood/files-4.19/arch/arm/boot/dts/kirkwood-goflexhome.dts new file mode 100644 index 0000000000..6cb6f7249e --- /dev/null +++ b/target/linux/kirkwood/files-4.19/arch/arm/boot/dts/kirkwood-goflexhome.dts @@ -0,0 +1,124 @@ +/dts-v1/; + +#include "kirkwood.dtsi" +#include "kirkwood-6281.dtsi" + +/ { + model = "Seagate GoFlex Home"; + compatible = "seagate,goflexhome", "marvell,kirkwood-88f6281", "marvell,kirkwood"; + + aliases { + led-boot = &led_health; + led-failsafe = &led_fault; + led-running = &led_health; + led-upgrade = &led_fault; + }; + + memory@0 { + device_type = "memory"; + reg = <0x00000000 0x8000000>; + }; + + chosen { + bootargs = "console=ttyS0,115200n8 earlyprintk root=/dev/sda1 rootdelay=10"; + stdout-path = &uart0; + }; + + ocp@f1000000 { + pinctrl: pin-controller@10000 { + pmx_usb_power_enable: pmx-usb-power-enable { + marvell,pins = "mpp29"; + marvell,function = "gpio"; + }; + pmx_led_white: pmx-led-white { + marvell,pins = "mpp40"; + marvell,function = "gpio"; + }; + pmx_led_green: pmx-led_green { + marvell,pins = "mpp46"; + marvell,function = "gpio"; + }; + pmx_led_orange: pmx-led-orange { + marvell,pins = "mpp47"; + marvell,function = "gpio"; + }; + }; + serial@12000 { + status = "ok"; + }; + + sata@80000 { + status = "okay"; + nr-ports = <2>; + }; + + }; + gpio-leds { + compatible = "gpio-leds"; + + led_health: health { + label = "status:green:health"; + gpios = <&gpio1 14 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + led_fault: fault { + label = "status:orange:fault"; + gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; + }; + misc { + label = "status:white:misc"; + gpios = <&gpio1 8 GPIO_ACTIVE_LOW>; + linux,default-trigger = "disk-activity"; + }; + }; + regulators { + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <0>; + pinctrl-0 = <&pmx_usb_power_enable>; + pinctrl-names = "default"; + + usb_power: regulator@1 { + compatible = "regulator-fixed"; + reg = <1>; + regulator-name = "USB Power"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + enable-active-high; + regulator-always-on; + regulator-boot-on; + gpio = <&gpio0 29 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&nand { + chip-delay = <40>; + status = "okay"; + + partition@0 { + label = "u-boot"; + reg = <0x0000000 0x100000>; + read-only; + }; + + partition@100000 { + label = "ubi"; + reg = <0x100000 0x0ff00000>; + }; +}; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy@0 { + reg = <0>; + }; +}; + +ð0 { + status = "okay"; + ethernet0-port@0 { + phy-handle = <ðphy0>; + }; +}; diff --git a/target/linux/kirkwood/files-4.19/arch/arm/boot/dts/kirkwood-linksys-audi.dts b/target/linux/kirkwood/files-4.19/arch/arm/boot/dts/kirkwood-linksys-audi.dts new file mode 100644 index 0000000000..ac9db1949c --- /dev/null +++ b/target/linux/kirkwood/files-4.19/arch/arm/boot/dts/kirkwood-linksys-audi.dts @@ -0,0 +1,251 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * kirkwood-linksys-audi.dts - Device Tree file for Linksys EA3500 + * + * (c) 2013 Jonas Gorski + * (c) 2013 Deutsche Telekom Innovation Laboratories + * (c) 2014 Luka Perkov + * (c) 2014 Dan Walters + * + */ + +/dts-v1/; + +#include "kirkwood.dtsi" +#include "kirkwood-6282.dtsi" + +/ { + model = "Linksys Audi (EA3500)"; + compatible = "linksys,audi", "marvell,kirkwood-88f6282", "marvell,kirkwood"; + + memory@0 { + device_type = "memory"; + reg = <0x00000000 0x4000000>; + }; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + gpio_keys { + compatible = "gpio-keys"; + pinctrl-0 = < &pmx_btn_wps &pmx_btn_reset >; + pinctrl-names = "default"; + + wps { + label = "WPS Button"; + linux,code = ; + gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; + }; + + reset { + label = "Reset Button"; + linux,code = ; + gpios = <&gpio1 16 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + pinctrl-0 = < &pmx_led_green_power >; + pinctrl-names = "default"; + + led_power: power { + label = "audi:green:power"; + gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>; + default-state = "on"; + }; + }; + + switches { + #address-cells = <1>; + #size-cells = <0>; + + mvsw61xx@10 { + compatible = "marvell,88e6171"; + status = "okay"; + reg = <0x10>; + + mii-bus = <&mdio>; + cpu-port-0 = <5>; + cpu-port-1 = <6>; + is-indirect; + }; + }; + + dsa { + compatible = "marvell,dsa"; + #address-cells = <2>; + #size-cells = <0>; + + dsa,ethernet = <ð0port>; + dsa,mii-bus = <&mdio>; + + switch@16,0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <16 0>; /* MDIO address 16, switch 0 in tree */ + + port@0 { + reg = <0>; + label = "ethernet1"; + }; + + port@1 { + reg = <1>; + label = "ethernet2"; + }; + + port@2 { + reg = <2>; + label = "ethernet3"; + }; + + port@3 { + reg = <3>; + label = "ethernet4"; + }; + + port@4 { + reg = <4>; + label = "internet"; + }; + + port@5 { + reg = <5>; + label = "cpu"; + }; + }; + }; +}; + +&pinctrl { + pmx_led_green_power: pmx-led-green-power { + marvell,pins = "mpp7"; + marvell,function = "gpo"; + }; + pmx_btn_wps: pmx-btn-wps { + marvell,pins = "mpp47"; + marvell,function = "gpio"; + }; + pmx_btn_reset: pmx-btn-reset { + marvell,pins = "mpp48"; + marvell,function = "gpio"; + }; +}; + +&nand { + status = "okay"; + pinctrl-0 = <&pmx_nand>; + pinctrl-names = "default"; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x80000>; + read-only; + }; + + partition@80000 { + label = "u_env"; + reg = <0x80000 0x4000>; + }; + + partition@84000 { + label = "s_env"; + reg = <0x84000 0x4000>; + }; + + partition@200000 { + label = "kernel1"; + reg = <0x200000 0x290000>; + }; + + partition@490000 { + label = "rootfs1"; + reg = <0x490000 0x1170000>; + }; + + partition@1600000 { + label = "kernel2"; + reg = <0x1600000 0x290000>; + }; + + partition@1890000 { + label = "rootfs2"; + reg = <0x1890000 0x1170000>; + }; + + partition@2a00000 { + label = "syscfg"; + reg = <0x2a00000 0x1600000>; + }; + + partition@88000 { + label = "unused"; + reg = <0x88000 0x178000>; + }; + + }; +}; + +&pciec { + status = "okay"; +}; + +&pcie0 { + status = "okay"; +}; + +&pcie1 { + status = "okay"; +}; + +&mdio { + status = "okay"; +}; + +&uart0 { + status = "okay"; +}; + +/* eth0 is connected to a Marvell 88E6171 switch, without a PHY. So set + * fixed speed and duplex. + */ +ð0 { + status = "okay"; + ethernet0-port@0 { + speed = <1000>; + duplex = <1>; + }; +}; + +/* eth1 is connected to the switch at port 6. However DSA only supports a + * single CPU port. Upstream uses DSA so they disable this port to avoid confusion. + */ +ð1 { + status = "okay"; + ethernet1-port@0 { + speed = <1000>; + duplex = <1>; + }; +}; + +/* There is no battery on the board, so the RTC does not keep + * time when there is no power, making it useless. + */ +&rtc { + status = "disabled"; +}; diff --git a/target/linux/kirkwood/files-4.19/arch/arm/boot/dts/kirkwood-nsa310b.dts b/target/linux/kirkwood/files-4.19/arch/arm/boot/dts/kirkwood-nsa310b.dts new file mode 100644 index 0000000000..b06848576a --- /dev/null +++ b/target/linux/kirkwood/files-4.19/arch/arm/boot/dts/kirkwood-nsa310b.dts @@ -0,0 +1,132 @@ +/dts-v1/; + +#include "kirkwood-nsa3x0-common.dtsi" + +/* + * There are at least two different NSA310 designs. This variant has + * a red/green USB Led (same as nsa310) and a lm85 temp/fan controller. + */ + +/ { + model = "ZyXEL NSA310b"; + compatible = "zyxel,nsa310b", "zyxel,nsa310", "marvell,kirkwood-88f6281", "marvell,kirkwood"; + + aliases { + led-boot = &led_green_sys; + led-failsafe = &led_red_sys; + led-running = &led_green_sys; + led-upgrade = &led_red_sys; + }; + + memory@0 { + device_type = "memory"; + reg = <0x00000000 0x10000000>; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + stdout-path = &uart0; + }; + + ocp@f1000000 { + pinctrl: pin-controller@10000 { + pinctrl-names = "default"; + + pmx_led_esata_green: pmx-led-esata-green { + marvell,pins = "mpp12"; + marvell,function = "gpio"; + }; + + pmx_led_esata_red: pmx-led-esata-red { + marvell,pins = "mpp13"; + marvell,function = "gpio"; + }; + + pmx_led_usb_green: pmx-led-usb-green { + marvell,pins = "mpp15"; + marvell,function = "gpio"; + }; + + pmx_led_usb_red: pmx-led-usb-red { + marvell,pins = "mpp16"; + marvell,function = "gpio"; + }; + + pmx_led_sys_green: pmx-led-sys-green { + marvell,pins = "mpp28"; + marvell,function = "gpio"; + }; + + pmx_led_sys_red: pmx-led-sys-red { + marvell,pins = "mpp29"; + marvell,function = "gpio"; + }; + + pmx_led_hdd_green: pmx-led-hdd-green { + marvell,pins = "mpp41"; + marvell,function = "gpio"; + }; + + pmx_led_hdd_red: pmx-led-hdd-red { + marvell,pins = "mpp42"; + marvell,function = "gpio"; + }; + + }; + + i2c@11000 { + status = "okay"; + + lm85: lm85@2e { + compatible = "national,lm85"; + reg = <0x2e>; + }; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + + led_green_sys: green-sys { + label = "nsa310:green:sys"; + gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>; + default-state = "on"; + }; + led_red_sys: red-sys { + label = "nsa310:red:sys"; + gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>; + }; + green-hdd { + label = "nsa310:green:hdd"; + gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>; + }; + red-hdd { + label = "nsa310:red:hdd"; + gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>; + }; + green-esata { + label = "nsa310:green:esata"; + gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; + }; + red-esata { + label = "nsa310:red:esata"; + gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>; + }; + green-usb { + label = "nsa310:green:usb"; + gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>; + }; + red-usb { + label = "nsa310:red:usb"; + gpios = <&gpio0 16 GPIO_ACTIVE_HIGH>; + }; + green-copy { + label = "nsa310:green:copy"; + gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>; + }; + red-copy { + label = "nsa310:red:copy"; + gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>; + }; + }; +}; diff --git a/target/linux/kirkwood/files-4.19/arch/arm/boot/dts/kirkwood-on100.dts b/target/linux/kirkwood/files-4.19/arch/arm/boot/dts/kirkwood-on100.dts new file mode 100644 index 0000000000..6d45814050 --- /dev/null +++ b/target/linux/kirkwood/files-4.19/arch/arm/boot/dts/kirkwood-on100.dts @@ -0,0 +1,163 @@ +/dts-v1/; + +#include "kirkwood.dtsi" +#include "kirkwood-6282.dtsi" + +/ { + model = "Cisco Systems ON100"; + compatible = "cisco,on100", "marvell,kirkwood-88f6282", "marvell,kirkwood"; + + memory@0 { + device_type = "memory"; + reg = <0x00000000 0x20000000>; + }; + + aliases { + led-boot = &led_health_green; + led-failsafe = &led_health_red; + led-running = &led_health_green; + led-upgrade = &led_health_red; + serial0 = &uart0; + }; + + chosen { + bootargs = "console=ttyS0,115200n8 earlyprintk"; + stdout-path = "serial0:115200n8"; + }; + + gpio_keys { + compatible = "gpio-keys"; + pinctrl-0 = <&pmx_btn_reset>; + pinctrl-names = "default"; + + reset { + label = "Reset Button"; + linux,code = ; + gpios = <&gpio1 9 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + pinctrl-0 = < &pmx_led_health_r &pmx_led_health_g >; + pinctrl-names = "default"; + + led_health_green: health_green { + label = "on100:green:health"; + gpios = <&gpio1 12 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + led_health_red: health_red { + label = "on100:red:health"; + gpios = <&gpio1 13 GPIO_ACTIVE_LOW>; + }; + + health2_green { + label = "on100:green:health2"; + gpios = <&gpio1 14 GPIO_ACTIVE_LOW>; + }; + + health2_red { + label = "on100:red:health2"; + gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; + }; + }; +}; + +ð0 { + status = "okay"; + + ethernet0-port@0 { + phy-handle = <ðphy0>; + phy-connection-type = "rgmii-id"; + }; +}; + +ð1 { + status = "okay"; + + ethernet1-port@0 { + phy-handle = <ðphy1>; + phy-connection-type = "rgmii-id"; + }; +}; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy@0 { + /* Marvell 88E1121R */ + compatible = "ethernet-phy-id0141.0cb0", + "ethernet-phy-ieee802.3-c22"; + reg = <0>; + }; + + ethphy1: ethernet-phy@1 { + /* Marvell 88E1121R */ + compatible = "ethernet-phy-id0141.0cb0", + "ethernet-phy-ieee802.3-c22"; + reg = <1>; + }; +}; + +&nand { + status = "okay"; + + partition@0 { + label = "u-boot"; + reg = <0x00000000 0x000a0000>; + read-only; + }; + + partition@a0000 { + label = "u-boot environment"; + reg = <0x000a0000 0x00020000>; + read-only; + }; + + partition@c0000 { + label = "kernel"; + reg = <0x000c0000 0x00540000>; + }; + + partition@600000 { + label = "ubi"; + reg = <0x00600000 0x1fa00000>; + }; +}; + +&pinctrl { + pmx_led_health_r: pmx-led-health-r { + marvell,pins = "mpp45"; + marvell,function = "gpio"; + }; + + pmx_led_health_g: pmx-led-health-g { + marvell,pins = "mpp44"; + marvell,function = "gpio"; + }; + + pmx_led_health2_r: pmx-led-health2-r { + marvell,pins = "mpp47"; + marvell,function = "gpio"; + }; + + pmx_led_health2_g: pmx-led-health2-g { + marvell,pins = "mpp46"; + marvell,function = "gpio"; + }; + + pmx_btn_reset: pmx-led-reset { + marvell,pins = "mpp31"; + marvell,function = "gpio"; + }; +}; + +&sdio { + status = "okay"; +}; + +&uart0 { + status = "okay"; +}; diff --git a/target/linux/kirkwood/patches-4.14/104-ea3500.patch b/target/linux/kirkwood/patches-4.14/104-ea3500.patch deleted file mode 100644 index 851875c645..0000000000 --- a/target/linux/kirkwood/patches-4.14/104-ea3500.patch +++ /dev/null @@ -1,263 +0,0 @@ ---- a/arch/arm/boot/dts/Makefile -+++ b/arch/arm/boot/dts/Makefile -@@ -250,6 +250,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \ - kirkwood-linkstation-lswsxl.dtb \ - kirkwood-linkstation-lswvl.dtb \ - kirkwood-linkstation-lswxl.dtb \ -+ kirkwood-linksys-audi.dtb \ - kirkwood-linksys-viper.dtb \ - kirkwood-lschlv2.dtb \ - kirkwood-lsxhl.dtb \ ---- /dev/null -+++ b/arch/arm/boot/dts/kirkwood-linksys-audi.dts -@@ -0,0 +1,250 @@ -+/* -+ * kirkwood-linksys-audi.dts - Device Tree file for Linksys EA3500 -+ * -+ * (c) 2013 Jonas Gorski -+ * (c) 2013 Deutsche Telekom Innovation Laboratories -+ * (c) 2014 Luka Perkov -+ * (c) 2014 Dan Walters -+ * -+ * This file is licensed under the terms of the GNU General Public -+ * License version 2. This program is licensed "as is" without any -+ * warranty of any kind, whether express or implied. -+ */ -+ -+/dts-v1/; -+ -+#include "kirkwood.dtsi" -+#include "kirkwood-6282.dtsi" -+ -+/ { -+ model = "Linksys Audi (EA3500)"; -+ compatible = "linksys,audi", "marvell,kirkwood-88f6282", "marvell,kirkwood"; -+ -+ memory { -+ device_type = "memory"; -+ reg = <0x00000000 0x4000000>; -+ }; -+ -+ aliases { -+ led-boot = &led_power; -+ led-failsafe = &led_power; -+ led-running = &led_power; -+ led-upgrade = &led_power; -+ serial0 = &uart0; -+ }; -+ -+ chosen { -+ stdout-path = "serial0:115200n8"; -+ }; -+ -+ gpio_keys { -+ compatible = "gpio-keys"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ pinctrl-0 = < &pmx_btn_wps &pmx_btn_reset >; -+ pinctrl-names = "default"; -+ -+ wps { -+ label = "WPS Button"; -+ linux,code = ; -+ gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; -+ }; -+ -+ reset { -+ label = "Reset Button"; -+ linux,code = ; -+ gpios = <&gpio1 16 GPIO_ACTIVE_LOW>; -+ }; -+ }; -+ -+ gpio-leds { -+ compatible = "gpio-leds"; -+ pinctrl-0 = < &pmx_led_green_power >; -+ pinctrl-names = "default"; -+ -+ led_power: power { -+ label = "audi:green:power"; -+ gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>; -+ default-state = "on"; -+ }; -+ }; -+ -+ mvsw61xx { -+ compatible = "marvell,88e6171"; -+ status = "okay"; -+ reg = <0x10>; -+ -+ mii-bus = <&mdio>; -+ cpu-port-0 = <5>; -+ cpu-port-1 = <6>; -+ is-indirect; -+ }; -+ -+ dsa { -+ compatible = "marvell,dsa"; -+ #address-cells = <2>; -+ #size-cells = <0>; -+ -+ dsa,ethernet = <ð0port>; -+ dsa,mii-bus = <&mdio>; -+ -+ switch@16,0 { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ reg = <16 0>; /* MDIO address 16, switch 0 in tree */ -+ -+ port@0 { -+ reg = <0>; -+ label = "ethernet1"; -+ }; -+ -+ port@1 { -+ reg = <1>; -+ label = "ethernet2"; -+ }; -+ -+ port@2 { -+ reg = <2>; -+ label = "ethernet3"; -+ }; -+ -+ port@3 { -+ reg = <3>; -+ label = "ethernet4"; -+ }; -+ -+ port@4 { -+ reg = <4>; -+ label = "internet"; -+ }; -+ -+ port@5 { -+ reg = <5>; -+ label = "cpu"; -+ }; -+ }; -+ }; -+}; -+ -+&pinctrl { -+ pmx_led_green_power: pmx-led-green-power { -+ marvell,pins = "mpp7"; -+ marvell,function = "gpo"; -+ }; -+ pmx_btn_wps: pmx-btn-wps { -+ marvell,pins = "mpp47"; -+ marvell,function = "gpio"; -+ }; -+ pmx_btn_reset: pmx-btn-reset { -+ marvell,pins = "mpp48"; -+ marvell,function = "gpio"; -+ }; -+}; -+ -+&nand { -+ status = "okay"; -+ pinctrl-0 = <&pmx_nand>; -+ pinctrl-names = "default"; -+ -+ partitions { -+ compatible = "fixed-partitions"; -+ #address-cells = <1>; -+ #size-cells = <1>; -+ -+ partition@0 { -+ label = "u-boot"; -+ reg = <0x0 0x80000>; -+ read-only; -+ }; -+ -+ partition@80000 { -+ label = "u_env"; -+ reg = <0x80000 0x4000>; -+ }; -+ -+ partition@84000 { -+ label = "s_env"; -+ reg = <0x84000 0x4000>; -+ }; -+ -+ partition@200000 { -+ label = "kernel1"; -+ reg = <0x200000 0x290000>; -+ }; -+ -+ partition@490000 { -+ label = "rootfs1"; -+ reg = <0x490000 0x1170000>; -+ }; -+ -+ partition@1600000 { -+ label = "kernel2"; -+ reg = <0x1600000 0x290000>; -+ }; -+ -+ partition@1890000 { -+ label = "rootfs2"; -+ reg = <0x1890000 0x1170000>; -+ }; -+ -+ partition@2a00000 { -+ label = "syscfg"; -+ reg = <0x2a00000 0x1600000>; -+ }; -+ -+ partition@88000 { -+ label = "unused"; -+ reg = <0x88000 0x178000>; -+ }; -+ -+ }; -+}; -+ -+&pciec { -+ status = "okay"; -+}; -+ -+&pcie0 { -+ status = "okay"; -+}; -+ -+&pcie1 { -+ status = "okay"; -+}; -+ -+&mdio { -+ status = "okay"; -+}; -+ -+&uart0 { -+ status = "okay"; -+}; -+ -+/* eth0 is connected to a Marvell 88E6171 switch, without a PHY. So set -+ * fixed speed and duplex. -+ */ -+ð0 { -+ status = "okay"; -+ ethernet0-port@0 { -+ speed = <1000>; -+ duplex = <1>; -+ }; -+}; -+ -+/* eth1 is connected to the switch at port 6. However DSA only supports a -+ * single CPU port. Upstream uses DSA so they disable this port to avoid confusion. -+ */ -+ð1 { -+ status = "okay"; -+ ethernet1-port@0 { -+ speed = <1000>; -+ duplex = <1>; -+ }; -+}; -+ -+/* There is no battery on the board, so the RTC does not keep -+ * time when there is no power, making it useless. -+ */ -+&rtc { -+ status = "disabled"; -+}; diff --git a/target/linux/kirkwood/patches-4.14/105-goflexhome.patch b/target/linux/kirkwood/patches-4.14/105-goflexhome.patch deleted file mode 100644 index fcccbf7f39..0000000000 --- a/target/linux/kirkwood/patches-4.14/105-goflexhome.patch +++ /dev/null @@ -1,137 +0,0 @@ ---- a/arch/arm/boot/dts/Makefile -+++ b/arch/arm/boot/dts/Makefile -@@ -237,6 +237,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \ - kirkwood-ds411.dtb \ - kirkwood-ds411j.dtb \ - kirkwood-ds411slim.dtb \ -+ kirkwood-goflexhome.dtb \ - kirkwood-goflexnet.dtb \ - kirkwood-guruplug-server-plus.dtb \ - kirkwood-ib62x0.dtb \ ---- /dev/null -+++ b/arch/arm/boot/dts/kirkwood-goflexhome.dts -@@ -0,0 +1,124 @@ -+/dts-v1/; -+ -+#include "kirkwood.dtsi" -+#include "kirkwood-6281.dtsi" -+ -+/ { -+ model = "Seagate GoFlex Home"; -+ compatible = "seagate,goflexhome", "marvell,kirkwood-88f6281", "marvell,kirkwood"; -+ -+ aliases { -+ led-boot = &led_health; -+ led-failsafe = &led_fault; -+ led-running = &led_health; -+ led-upgrade = &led_fault; -+ }; -+ -+ memory { -+ device_type = "memory"; -+ reg = <0x00000000 0x8000000>; -+ }; -+ -+ chosen { -+ bootargs = "console=ttyS0,115200n8 earlyprintk root=/dev/sda1 rootdelay=10"; -+ stdout-path = &uart0; -+ }; -+ -+ ocp@f1000000 { -+ pinctrl: pin-controller@10000 { -+ pmx_usb_power_enable: pmx-usb-power-enable { -+ marvell,pins = "mpp29"; -+ marvell,function = "gpio"; -+ }; -+ pmx_led_white: pmx-led-white { -+ marvell,pins = "mpp40"; -+ marvell,function = "gpio"; -+ }; -+ pmx_led_green: pmx-led_green { -+ marvell,pins = "mpp46"; -+ marvell,function = "gpio"; -+ }; -+ pmx_led_orange: pmx-led-orange { -+ marvell,pins = "mpp47"; -+ marvell,function = "gpio"; -+ }; -+ }; -+ serial@12000 { -+ status = "ok"; -+ }; -+ -+ sata@80000 { -+ status = "okay"; -+ nr-ports = <2>; -+ }; -+ -+ }; -+ gpio-leds { -+ compatible = "gpio-leds"; -+ -+ led_health: health { -+ label = "status:green:health"; -+ gpios = <&gpio1 14 GPIO_ACTIVE_LOW>; -+ default-state = "on"; -+ }; -+ led_fault: fault { -+ label = "status:orange:fault"; -+ gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; -+ }; -+ misc { -+ label = "status:white:misc"; -+ gpios = <&gpio1 8 GPIO_ACTIVE_LOW>; -+ linux,default-trigger = "disk-activity"; -+ }; -+ }; -+ regulators { -+ compatible = "simple-bus"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ pinctrl-0 = <&pmx_usb_power_enable>; -+ pinctrl-names = "default"; -+ -+ usb_power: regulator@1 { -+ compatible = "regulator-fixed"; -+ reg = <1>; -+ regulator-name = "USB Power"; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ enable-active-high; -+ regulator-always-on; -+ regulator-boot-on; -+ gpio = <&gpio0 29 GPIO_ACTIVE_HIGH>; -+ }; -+ }; -+}; -+ -+&nand { -+ chip-delay = <40>; -+ status = "okay"; -+ -+ partition@0 { -+ label = "u-boot"; -+ reg = <0x0000000 0x100000>; -+ read-only; -+ }; -+ -+ partition@100000 { -+ label = "ubi"; -+ reg = <0x100000 0x0ff00000>; -+ }; -+}; -+ -+&mdio { -+ status = "okay"; -+ -+ ethphy0: ethernet-phy@0 { -+ reg = <0>; -+ }; -+}; -+ -+ð0 { -+ status = "okay"; -+ ethernet0-port@0 { -+ phy-handle = <ðphy0>; -+ }; -+}; diff --git a/target/linux/kirkwood/patches-4.14/107-02-nsa310b.patch b/target/linux/kirkwood/patches-4.14/107-02-nsa310b.patch deleted file mode 100644 index 1f2718fb80..0000000000 --- a/target/linux/kirkwood/patches-4.14/107-02-nsa310b.patch +++ /dev/null @@ -1,155 +0,0 @@ -kirkwood: add nsa310b dtb, a zyxel nsa310 variant - -add support to a nsa310 variant with red/green usb led -and lm85 temp/fan controller - -Signed-off-by: Alberto Bursi - -NOTE: this patch can be upstreamed as-is, LEDE-specific - nand partitions are set in another patch - ---- a/arch/arm/boot/dts/Makefile -+++ b/arch/arm/boot/dts/Makefile -@@ -268,6 +268,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \ - kirkwood-ns2mini.dtb \ - kirkwood-nsa310.dtb \ - kirkwood-nsa310a.dtb \ -+ kirkwood-nsa310b.dtb \ - kirkwood-nsa320.dtb \ - kirkwood-nsa325.dtb \ - kirkwood-openblocks_a6.dtb \ ---- /dev/null -+++ b/arch/arm/boot/dts/kirkwood-nsa310b.dts -@@ -0,0 +1,132 @@ -+/dts-v1/; -+ -+#include "kirkwood-nsa3x0-common.dtsi" -+ -+/* -+ * There are at least two different NSA310 designs. This variant has -+ * a red/green USB Led (same as nsa310) and a lm85 temp/fan controller. -+ */ -+ -+/ { -+ model = "ZyXEL NSA310b"; -+ compatible = "zyxel,nsa310b", "zyxel,nsa310", "marvell,kirkwood-88f6281", "marvell,kirkwood"; -+ -+ aliases { -+ led-boot = &led_green_sys; -+ led-failsafe = &led_red_sys; -+ led-running = &led_green_sys; -+ led-upgrade = &led_red_sys; -+ }; -+ -+ memory { -+ device_type = "memory"; -+ reg = <0x00000000 0x10000000>; -+ }; -+ -+ chosen { -+ bootargs = "console=ttyS0,115200"; -+ stdout-path = &uart0; -+ }; -+ -+ ocp@f1000000 { -+ pinctrl: pin-controller@10000 { -+ pinctrl-names = "default"; -+ -+ pmx_led_esata_green: pmx-led-esata-green { -+ marvell,pins = "mpp12"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_led_esata_red: pmx-led-esata-red { -+ marvell,pins = "mpp13"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_led_usb_green: pmx-led-usb-green { -+ marvell,pins = "mpp15"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_led_usb_red: pmx-led-usb-red { -+ marvell,pins = "mpp16"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_led_sys_green: pmx-led-sys-green { -+ marvell,pins = "mpp28"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_led_sys_red: pmx-led-sys-red { -+ marvell,pins = "mpp29"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_led_hdd_green: pmx-led-hdd-green { -+ marvell,pins = "mpp41"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_led_hdd_red: pmx-led-hdd-red { -+ marvell,pins = "mpp42"; -+ marvell,function = "gpio"; -+ }; -+ -+ }; -+ -+ i2c@11000 { -+ status = "okay"; -+ -+ lm85: lm85@2e { -+ compatible = "national,lm85"; -+ reg = <0x2e>; -+ }; -+ }; -+ }; -+ -+ gpio-leds { -+ compatible = "gpio-leds"; -+ -+ led_green_sys: green-sys { -+ label = "nsa310:green:sys"; -+ gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>; -+ default-state = "on"; -+ }; -+ led_red_sys: red-sys { -+ label = "nsa310:red:sys"; -+ gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>; -+ }; -+ green-hdd { -+ label = "nsa310:green:hdd"; -+ gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>; -+ }; -+ red-hdd { -+ label = "nsa310:red:hdd"; -+ gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>; -+ }; -+ green-esata { -+ label = "nsa310:green:esata"; -+ gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; -+ }; -+ red-esata { -+ label = "nsa310:red:esata"; -+ gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>; -+ }; -+ green-usb { -+ label = "nsa310:green:usb"; -+ gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>; -+ }; -+ red-usb { -+ label = "nsa310:red:usb"; -+ gpios = <&gpio0 16 GPIO_ACTIVE_HIGH>; -+ }; -+ green-copy { -+ label = "nsa310:green:copy"; -+ gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>; -+ }; -+ red-copy { -+ label = "nsa310:red:copy"; -+ gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>; -+ }; -+ }; -+}; diff --git a/target/linux/kirkwood/patches-4.14/108-on100.patch b/target/linux/kirkwood/patches-4.14/108-on100.patch deleted file mode 100644 index 78f2f4a3fe..0000000000 --- a/target/linux/kirkwood/patches-4.14/108-on100.patch +++ /dev/null @@ -1,178 +0,0 @@ ---- /dev/null -+++ b/arch/arm/boot/dts/kirkwood-on100.dts -@@ -0,0 +1,165 @@ -+/dts-v1/; -+ -+#include "kirkwood.dtsi" -+#include "kirkwood-6282.dtsi" -+ -+/ { -+ model = "Cisco Systems ON100"; -+ compatible = "cisco,on100", "marvell,kirkwood-88f6282", "marvell,kirkwood"; -+ -+ memory { -+ device_type = "memory"; -+ reg = <0x00000000 0x20000000>; -+ }; -+ -+ aliases { -+ led-boot = &led_health_green; -+ led-failsafe = &led_health_red; -+ led-running = &led_health_green; -+ led-upgrade = &led_health_red; -+ serial0 = &uart0; -+ }; -+ -+ chosen { -+ bootargs = "console=ttyS0,115200n8 earlyprintk"; -+ stdout-path = "serial0:115200n8"; -+ }; -+ -+ gpio_keys { -+ compatible = "gpio-keys"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ pinctrl-0 = <&pmx_btn_reset>; -+ pinctrl-names = "default"; -+ -+ button@1 { -+ label = "Reset Button"; -+ linux,code = ; -+ gpios = <&gpio1 9 GPIO_ACTIVE_LOW>; -+ }; -+ }; -+ -+ gpio-leds { -+ compatible = "gpio-leds"; -+ pinctrl-0 = < &pmx_led_health_r &pmx_led_health_g >; -+ pinctrl-names = "default"; -+ -+ led_health_green: health_green { -+ label = "on100:green:health"; -+ gpios = <&gpio1 12 GPIO_ACTIVE_LOW>; -+ default-state = "on"; -+ }; -+ -+ led_health_red: health_red { -+ label = "on100:red:health"; -+ gpios = <&gpio1 13 GPIO_ACTIVE_LOW>; -+ }; -+ -+ health2_green { -+ label = "on100:green:health2"; -+ gpios = <&gpio1 14 GPIO_ACTIVE_LOW>; -+ }; -+ -+ health2_red { -+ label = "on100:red:health2"; -+ gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; -+ }; -+ }; -+}; -+ -+ð0 { -+ status = "okay"; -+ -+ ethernet0-port@0 { -+ phy-handle = <ðphy0>; -+ phy-connection-type = "rgmii-id"; -+ }; -+}; -+ -+ð1 { -+ status = "okay"; -+ -+ ethernet1-port@0 { -+ phy-handle = <ðphy1>; -+ phy-connection-type = "rgmii-id"; -+ }; -+}; -+ -+&mdio { -+ status = "okay"; -+ -+ ethphy0: ethernet-phy@0 { -+ /* Marvell 88E1121R */ -+ compatible = "ethernet-phy-id0141.0cb0", -+ "ethernet-phy-ieee802.3-c22"; -+ reg = <0>; -+ }; -+ -+ ethphy1: ethernet-phy@1 { -+ /* Marvell 88E1121R */ -+ compatible = "ethernet-phy-id0141.0cb0", -+ "ethernet-phy-ieee802.3-c22"; -+ reg = <1>; -+ }; -+}; -+ -+&nand { -+ status = "okay"; -+ -+ partition@0 { -+ label = "u-boot"; -+ reg = <0x00000000 0x000a0000>; -+ read-only; -+ }; -+ -+ partition@a0000 { -+ label = "u-boot environment"; -+ reg = <0x000a0000 0x00020000>; -+ read-only; -+ }; -+ -+ partition@c0000 { -+ label = "kernel"; -+ reg = <0x000c0000 0x00540000>; -+ }; -+ -+ partition@600000 { -+ label = "ubi"; -+ reg = <0x00600000 0x1fa00000>; -+ }; -+}; -+ -+&pinctrl { -+ pmx_led_health_r: pmx-led-health-r { -+ marvell,pins = "mpp45"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_led_health_g: pmx-led-health-g { -+ marvell,pins = "mpp44"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_led_health2_r: pmx-led-health2-r { -+ marvell,pins = "mpp47"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_led_health2_g: pmx-led-health2-g { -+ marvell,pins = "mpp46"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_btn_reset: pmx-led-reset { -+ marvell,pins = "mpp31"; -+ marvell,function = "gpio"; -+ }; -+}; -+ -+&sdio { -+ status = "okay"; -+}; -+ -+&uart0 { -+ status = "okay"; -+}; ---- a/arch/arm/boot/dts/Makefile -+++ b/arch/arm/boot/dts/Makefile -@@ -271,6 +271,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \ - kirkwood-nsa310b.dtb \ - kirkwood-nsa320.dtb \ - kirkwood-nsa325.dtb \ -+ kirkwood-on100.dtb \ - kirkwood-openblocks_a6.dtb \ - kirkwood-openblocks_a7.dtb \ - kirkwood-openrd-base.dtb \ diff --git a/target/linux/kirkwood/patches-4.19/104-ea3500.patch b/target/linux/kirkwood/patches-4.19/104-ea3500.patch deleted file mode 100644 index 04a919e072..0000000000 --- a/target/linux/kirkwood/patches-4.19/104-ea3500.patch +++ /dev/null @@ -1,264 +0,0 @@ ---- a/arch/arm/boot/dts/Makefile -+++ b/arch/arm/boot/dts/Makefile -@@ -269,6 +269,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \ - kirkwood-linkstation-lswsxl.dtb \ - kirkwood-linkstation-lswvl.dtb \ - kirkwood-linkstation-lswxl.dtb \ -+ kirkwood-linksys-audi.dtb \ - kirkwood-linksys-viper.dtb \ - kirkwood-lschlv2.dtb \ - kirkwood-lsxhl.dtb \ ---- /dev/null -+++ b/arch/arm/boot/dts/kirkwood-linksys-audi.dts -@@ -0,0 +1,251 @@ -+// SPDX-License-Identifier: GPL-2.0 -+/* -+ * kirkwood-linksys-audi.dts - Device Tree file for Linksys EA3500 -+ * -+ * (c) 2013 Jonas Gorski -+ * (c) 2013 Deutsche Telekom Innovation Laboratories -+ * (c) 2014 Luka Perkov -+ * (c) 2014 Dan Walters -+ * -+ */ -+ -+/dts-v1/; -+ -+#include "kirkwood.dtsi" -+#include "kirkwood-6282.dtsi" -+ -+/ { -+ model = "Linksys Audi (EA3500)"; -+ compatible = "linksys,audi", "marvell,kirkwood-88f6282", "marvell,kirkwood"; -+ -+ memory@0 { -+ device_type = "memory"; -+ reg = <0x00000000 0x4000000>; -+ }; -+ -+ aliases { -+ led-boot = &led_power; -+ led-failsafe = &led_power; -+ led-running = &led_power; -+ led-upgrade = &led_power; -+ serial0 = &uart0; -+ }; -+ -+ chosen { -+ stdout-path = "serial0:115200n8"; -+ }; -+ -+ gpio_keys { -+ compatible = "gpio-keys"; -+ pinctrl-0 = < &pmx_btn_wps &pmx_btn_reset >; -+ pinctrl-names = "default"; -+ -+ wps { -+ label = "WPS Button"; -+ linux,code = ; -+ gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; -+ }; -+ -+ reset { -+ label = "Reset Button"; -+ linux,code = ; -+ gpios = <&gpio1 16 GPIO_ACTIVE_LOW>; -+ }; -+ }; -+ -+ gpio-leds { -+ compatible = "gpio-leds"; -+ pinctrl-0 = < &pmx_led_green_power >; -+ pinctrl-names = "default"; -+ -+ led_power: power { -+ label = "audi:green:power"; -+ gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>; -+ default-state = "on"; -+ }; -+ }; -+ -+ switches { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ -+ mvsw61xx@10 { -+ compatible = "marvell,88e6171"; -+ status = "okay"; -+ reg = <0x10>; -+ -+ mii-bus = <&mdio>; -+ cpu-port-0 = <5>; -+ cpu-port-1 = <6>; -+ is-indirect; -+ }; -+ }; -+ -+ dsa { -+ compatible = "marvell,dsa"; -+ #address-cells = <2>; -+ #size-cells = <0>; -+ -+ dsa,ethernet = <ð0port>; -+ dsa,mii-bus = <&mdio>; -+ -+ switch@16,0 { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ reg = <16 0>; /* MDIO address 16, switch 0 in tree */ -+ -+ port@0 { -+ reg = <0>; -+ label = "ethernet1"; -+ }; -+ -+ port@1 { -+ reg = <1>; -+ label = "ethernet2"; -+ }; -+ -+ port@2 { -+ reg = <2>; -+ label = "ethernet3"; -+ }; -+ -+ port@3 { -+ reg = <3>; -+ label = "ethernet4"; -+ }; -+ -+ port@4 { -+ reg = <4>; -+ label = "internet"; -+ }; -+ -+ port@5 { -+ reg = <5>; -+ label = "cpu"; -+ }; -+ }; -+ }; -+}; -+ -+&pinctrl { -+ pmx_led_green_power: pmx-led-green-power { -+ marvell,pins = "mpp7"; -+ marvell,function = "gpo"; -+ }; -+ pmx_btn_wps: pmx-btn-wps { -+ marvell,pins = "mpp47"; -+ marvell,function = "gpio"; -+ }; -+ pmx_btn_reset: pmx-btn-reset { -+ marvell,pins = "mpp48"; -+ marvell,function = "gpio"; -+ }; -+}; -+ -+&nand { -+ status = "okay"; -+ pinctrl-0 = <&pmx_nand>; -+ pinctrl-names = "default"; -+ -+ partitions { -+ compatible = "fixed-partitions"; -+ #address-cells = <1>; -+ #size-cells = <1>; -+ -+ partition@0 { -+ label = "u-boot"; -+ reg = <0x0 0x80000>; -+ read-only; -+ }; -+ -+ partition@80000 { -+ label = "u_env"; -+ reg = <0x80000 0x4000>; -+ }; -+ -+ partition@84000 { -+ label = "s_env"; -+ reg = <0x84000 0x4000>; -+ }; -+ -+ partition@200000 { -+ label = "kernel1"; -+ reg = <0x200000 0x290000>; -+ }; -+ -+ partition@490000 { -+ label = "rootfs1"; -+ reg = <0x490000 0x1170000>; -+ }; -+ -+ partition@1600000 { -+ label = "kernel2"; -+ reg = <0x1600000 0x290000>; -+ }; -+ -+ partition@1890000 { -+ label = "rootfs2"; -+ reg = <0x1890000 0x1170000>; -+ }; -+ -+ partition@2a00000 { -+ label = "syscfg"; -+ reg = <0x2a00000 0x1600000>; -+ }; -+ -+ partition@88000 { -+ label = "unused"; -+ reg = <0x88000 0x178000>; -+ }; -+ -+ }; -+}; -+ -+&pciec { -+ status = "okay"; -+}; -+ -+&pcie0 { -+ status = "okay"; -+}; -+ -+&pcie1 { -+ status = "okay"; -+}; -+ -+&mdio { -+ status = "okay"; -+}; -+ -+&uart0 { -+ status = "okay"; -+}; -+ -+/* eth0 is connected to a Marvell 88E6171 switch, without a PHY. So set -+ * fixed speed and duplex. -+ */ -+ð0 { -+ status = "okay"; -+ ethernet0-port@0 { -+ speed = <1000>; -+ duplex = <1>; -+ }; -+}; -+ -+/* eth1 is connected to the switch at port 6. However DSA only supports a -+ * single CPU port. Upstream uses DSA so they disable this port to avoid confusion. -+ */ -+ð1 { -+ status = "okay"; -+ ethernet1-port@0 { -+ speed = <1000>; -+ duplex = <1>; -+ }; -+}; -+ -+/* There is no battery on the board, so the RTC does not keep -+ * time when there is no power, making it useless. -+ */ -+&rtc { -+ status = "disabled"; -+}; diff --git a/target/linux/kirkwood/patches-4.19/105-goflexhome.patch b/target/linux/kirkwood/patches-4.19/105-goflexhome.patch deleted file mode 100644 index cca65f2141..0000000000 --- a/target/linux/kirkwood/patches-4.19/105-goflexhome.patch +++ /dev/null @@ -1,137 +0,0 @@ ---- a/arch/arm/boot/dts/Makefile -+++ b/arch/arm/boot/dts/Makefile -@@ -256,6 +256,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \ - kirkwood-ds411.dtb \ - kirkwood-ds411j.dtb \ - kirkwood-ds411slim.dtb \ -+ kirkwood-goflexhome.dtb \ - kirkwood-goflexnet.dtb \ - kirkwood-guruplug-server-plus.dtb \ - kirkwood-ib62x0.dtb \ ---- /dev/null -+++ b/arch/arm/boot/dts/kirkwood-goflexhome.dts -@@ -0,0 +1,124 @@ -+/dts-v1/; -+ -+#include "kirkwood.dtsi" -+#include "kirkwood-6281.dtsi" -+ -+/ { -+ model = "Seagate GoFlex Home"; -+ compatible = "seagate,goflexhome", "marvell,kirkwood-88f6281", "marvell,kirkwood"; -+ -+ aliases { -+ led-boot = &led_health; -+ led-failsafe = &led_fault; -+ led-running = &led_health; -+ led-upgrade = &led_fault; -+ }; -+ -+ memory@0 { -+ device_type = "memory"; -+ reg = <0x00000000 0x8000000>; -+ }; -+ -+ chosen { -+ bootargs = "console=ttyS0,115200n8 earlyprintk root=/dev/sda1 rootdelay=10"; -+ stdout-path = &uart0; -+ }; -+ -+ ocp@f1000000 { -+ pinctrl: pin-controller@10000 { -+ pmx_usb_power_enable: pmx-usb-power-enable { -+ marvell,pins = "mpp29"; -+ marvell,function = "gpio"; -+ }; -+ pmx_led_white: pmx-led-white { -+ marvell,pins = "mpp40"; -+ marvell,function = "gpio"; -+ }; -+ pmx_led_green: pmx-led_green { -+ marvell,pins = "mpp46"; -+ marvell,function = "gpio"; -+ }; -+ pmx_led_orange: pmx-led-orange { -+ marvell,pins = "mpp47"; -+ marvell,function = "gpio"; -+ }; -+ }; -+ serial@12000 { -+ status = "ok"; -+ }; -+ -+ sata@80000 { -+ status = "okay"; -+ nr-ports = <2>; -+ }; -+ -+ }; -+ gpio-leds { -+ compatible = "gpio-leds"; -+ -+ led_health: health { -+ label = "status:green:health"; -+ gpios = <&gpio1 14 GPIO_ACTIVE_LOW>; -+ default-state = "on"; -+ }; -+ led_fault: fault { -+ label = "status:orange:fault"; -+ gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; -+ }; -+ misc { -+ label = "status:white:misc"; -+ gpios = <&gpio1 8 GPIO_ACTIVE_LOW>; -+ linux,default-trigger = "disk-activity"; -+ }; -+ }; -+ regulators { -+ compatible = "simple-bus"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ pinctrl-0 = <&pmx_usb_power_enable>; -+ pinctrl-names = "default"; -+ -+ usb_power: regulator@1 { -+ compatible = "regulator-fixed"; -+ reg = <1>; -+ regulator-name = "USB Power"; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ enable-active-high; -+ regulator-always-on; -+ regulator-boot-on; -+ gpio = <&gpio0 29 GPIO_ACTIVE_HIGH>; -+ }; -+ }; -+}; -+ -+&nand { -+ chip-delay = <40>; -+ status = "okay"; -+ -+ partition@0 { -+ label = "u-boot"; -+ reg = <0x0000000 0x100000>; -+ read-only; -+ }; -+ -+ partition@100000 { -+ label = "ubi"; -+ reg = <0x100000 0x0ff00000>; -+ }; -+}; -+ -+&mdio { -+ status = "okay"; -+ -+ ethphy0: ethernet-phy@0 { -+ reg = <0>; -+ }; -+}; -+ -+ð0 { -+ status = "okay"; -+ ethernet0-port@0 { -+ phy-handle = <ðphy0>; -+ }; -+}; diff --git a/target/linux/kirkwood/patches-4.19/107-02-nsa310b.patch b/target/linux/kirkwood/patches-4.19/107-02-nsa310b.patch deleted file mode 100644 index ba2ae7d2de..0000000000 --- a/target/linux/kirkwood/patches-4.19/107-02-nsa310b.patch +++ /dev/null @@ -1,155 +0,0 @@ -kirkwood: add nsa310b dtb, a zyxel nsa310 variant - -add support to a nsa310 variant with red/green usb led -and lm85 temp/fan controller - -Signed-off-by: Alberto Bursi - -NOTE: this patch can be upstreamed as-is, LEDE-specific - nand partitions are set in another patch - ---- a/arch/arm/boot/dts/Makefile -+++ b/arch/arm/boot/dts/Makefile -@@ -287,6 +287,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \ - kirkwood-ns2mini.dtb \ - kirkwood-nsa310.dtb \ - kirkwood-nsa310a.dtb \ -+ kirkwood-nsa310b.dtb \ - kirkwood-nsa320.dtb \ - kirkwood-nsa325.dtb \ - kirkwood-openblocks_a6.dtb \ ---- /dev/null -+++ b/arch/arm/boot/dts/kirkwood-nsa310b.dts -@@ -0,0 +1,132 @@ -+/dts-v1/; -+ -+#include "kirkwood-nsa3x0-common.dtsi" -+ -+/* -+ * There are at least two different NSA310 designs. This variant has -+ * a red/green USB Led (same as nsa310) and a lm85 temp/fan controller. -+ */ -+ -+/ { -+ model = "ZyXEL NSA310b"; -+ compatible = "zyxel,nsa310b", "zyxel,nsa310", "marvell,kirkwood-88f6281", "marvell,kirkwood"; -+ -+ aliases { -+ led-boot = &led_green_sys; -+ led-failsafe = &led_red_sys; -+ led-running = &led_green_sys; -+ led-upgrade = &led_red_sys; -+ }; -+ -+ memory@0 { -+ device_type = "memory"; -+ reg = <0x00000000 0x10000000>; -+ }; -+ -+ chosen { -+ bootargs = "console=ttyS0,115200"; -+ stdout-path = &uart0; -+ }; -+ -+ ocp@f1000000 { -+ pinctrl: pin-controller@10000 { -+ pinctrl-names = "default"; -+ -+ pmx_led_esata_green: pmx-led-esata-green { -+ marvell,pins = "mpp12"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_led_esata_red: pmx-led-esata-red { -+ marvell,pins = "mpp13"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_led_usb_green: pmx-led-usb-green { -+ marvell,pins = "mpp15"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_led_usb_red: pmx-led-usb-red { -+ marvell,pins = "mpp16"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_led_sys_green: pmx-led-sys-green { -+ marvell,pins = "mpp28"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_led_sys_red: pmx-led-sys-red { -+ marvell,pins = "mpp29"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_led_hdd_green: pmx-led-hdd-green { -+ marvell,pins = "mpp41"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_led_hdd_red: pmx-led-hdd-red { -+ marvell,pins = "mpp42"; -+ marvell,function = "gpio"; -+ }; -+ -+ }; -+ -+ i2c@11000 { -+ status = "okay"; -+ -+ lm85: lm85@2e { -+ compatible = "national,lm85"; -+ reg = <0x2e>; -+ }; -+ }; -+ }; -+ -+ gpio-leds { -+ compatible = "gpio-leds"; -+ -+ led_green_sys: green-sys { -+ label = "nsa310:green:sys"; -+ gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>; -+ default-state = "on"; -+ }; -+ led_red_sys: red-sys { -+ label = "nsa310:red:sys"; -+ gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>; -+ }; -+ green-hdd { -+ label = "nsa310:green:hdd"; -+ gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>; -+ }; -+ red-hdd { -+ label = "nsa310:red:hdd"; -+ gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>; -+ }; -+ green-esata { -+ label = "nsa310:green:esata"; -+ gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; -+ }; -+ red-esata { -+ label = "nsa310:red:esata"; -+ gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>; -+ }; -+ green-usb { -+ label = "nsa310:green:usb"; -+ gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>; -+ }; -+ red-usb { -+ label = "nsa310:red:usb"; -+ gpios = <&gpio0 16 GPIO_ACTIVE_HIGH>; -+ }; -+ green-copy { -+ label = "nsa310:green:copy"; -+ gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>; -+ }; -+ red-copy { -+ label = "nsa310:red:copy"; -+ gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>; -+ }; -+ }; -+}; diff --git a/target/linux/kirkwood/patches-4.19/108-on100.patch b/target/linux/kirkwood/patches-4.19/108-on100.patch deleted file mode 100644 index bc0916f161..0000000000 --- a/target/linux/kirkwood/patches-4.19/108-on100.patch +++ /dev/null @@ -1,176 +0,0 @@ ---- /dev/null -+++ b/arch/arm/boot/dts/kirkwood-on100.dts -@@ -0,0 +1,163 @@ -+/dts-v1/; -+ -+#include "kirkwood.dtsi" -+#include "kirkwood-6282.dtsi" -+ -+/ { -+ model = "Cisco Systems ON100"; -+ compatible = "cisco,on100", "marvell,kirkwood-88f6282", "marvell,kirkwood"; -+ -+ memory@0 { -+ device_type = "memory"; -+ reg = <0x00000000 0x20000000>; -+ }; -+ -+ aliases { -+ led-boot = &led_health_green; -+ led-failsafe = &led_health_red; -+ led-running = &led_health_green; -+ led-upgrade = &led_health_red; -+ serial0 = &uart0; -+ }; -+ -+ chosen { -+ bootargs = "console=ttyS0,115200n8 earlyprintk"; -+ stdout-path = "serial0:115200n8"; -+ }; -+ -+ gpio_keys { -+ compatible = "gpio-keys"; -+ pinctrl-0 = <&pmx_btn_reset>; -+ pinctrl-names = "default"; -+ -+ reset { -+ label = "Reset Button"; -+ linux,code = ; -+ gpios = <&gpio1 9 GPIO_ACTIVE_LOW>; -+ }; -+ }; -+ -+ gpio-leds { -+ compatible = "gpio-leds"; -+ pinctrl-0 = < &pmx_led_health_r &pmx_led_health_g >; -+ pinctrl-names = "default"; -+ -+ led_health_green: health_green { -+ label = "on100:green:health"; -+ gpios = <&gpio1 12 GPIO_ACTIVE_LOW>; -+ default-state = "on"; -+ }; -+ -+ led_health_red: health_red { -+ label = "on100:red:health"; -+ gpios = <&gpio1 13 GPIO_ACTIVE_LOW>; -+ }; -+ -+ health2_green { -+ label = "on100:green:health2"; -+ gpios = <&gpio1 14 GPIO_ACTIVE_LOW>; -+ }; -+ -+ health2_red { -+ label = "on100:red:health2"; -+ gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; -+ }; -+ }; -+}; -+ -+ð0 { -+ status = "okay"; -+ -+ ethernet0-port@0 { -+ phy-handle = <ðphy0>; -+ phy-connection-type = "rgmii-id"; -+ }; -+}; -+ -+ð1 { -+ status = "okay"; -+ -+ ethernet1-port@0 { -+ phy-handle = <ðphy1>; -+ phy-connection-type = "rgmii-id"; -+ }; -+}; -+ -+&mdio { -+ status = "okay"; -+ -+ ethphy0: ethernet-phy@0 { -+ /* Marvell 88E1121R */ -+ compatible = "ethernet-phy-id0141.0cb0", -+ "ethernet-phy-ieee802.3-c22"; -+ reg = <0>; -+ }; -+ -+ ethphy1: ethernet-phy@1 { -+ /* Marvell 88E1121R */ -+ compatible = "ethernet-phy-id0141.0cb0", -+ "ethernet-phy-ieee802.3-c22"; -+ reg = <1>; -+ }; -+}; -+ -+&nand { -+ status = "okay"; -+ -+ partition@0 { -+ label = "u-boot"; -+ reg = <0x00000000 0x000a0000>; -+ read-only; -+ }; -+ -+ partition@a0000 { -+ label = "u-boot environment"; -+ reg = <0x000a0000 0x00020000>; -+ read-only; -+ }; -+ -+ partition@c0000 { -+ label = "kernel"; -+ reg = <0x000c0000 0x00540000>; -+ }; -+ -+ partition@600000 { -+ label = "ubi"; -+ reg = <0x00600000 0x1fa00000>; -+ }; -+}; -+ -+&pinctrl { -+ pmx_led_health_r: pmx-led-health-r { -+ marvell,pins = "mpp45"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_led_health_g: pmx-led-health-g { -+ marvell,pins = "mpp44"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_led_health2_r: pmx-led-health2-r { -+ marvell,pins = "mpp47"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_led_health2_g: pmx-led-health2-g { -+ marvell,pins = "mpp46"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_btn_reset: pmx-led-reset { -+ marvell,pins = "mpp31"; -+ marvell,function = "gpio"; -+ }; -+}; -+ -+&sdio { -+ status = "okay"; -+}; -+ -+&uart0 { -+ status = "okay"; -+}; ---- a/arch/arm/boot/dts/Makefile -+++ b/arch/arm/boot/dts/Makefile -@@ -290,6 +290,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \ - kirkwood-nsa310b.dtb \ - kirkwood-nsa320.dtb \ - kirkwood-nsa325.dtb \ -+ kirkwood-on100.dtb \ - kirkwood-openblocks_a6.dtb \ - kirkwood-openblocks_a7.dtb \ - kirkwood-openrd-base.dtb \ From 845093e8a0abdcb6eb72047f8d093cd37d81482e Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Thu, 27 Feb 2020 13:05:51 +0100 Subject: [PATCH 15/16] kirkwood: apply minor DTS style improvements This applies some minor DTS style improvements to the files kept in OpenWrt at the moment: - harmonize/improve LED/pinmux node names - harmonize empty lines between nodes - change "ok" to "okay" - some other minor formatting adjustments Since changes are only cosmetical, they are only applied to the "newer" DTS files for kernel 4.19. Signed-off-by: Adrian Schmutzler --- .../arch/arm/boot/dts/kirkwood-goflexhome.dts | 21 ++++++++++++---- .../arm/boot/dts/kirkwood-linksys-audi.dts | 14 +++++++---- .../arch/arm/boot/dts/kirkwood-nsa310b.dts | 9 +++++++ .../arch/arm/boot/dts/kirkwood-on100.dts | 24 ++++++++++--------- 4 files changed, 48 insertions(+), 20 deletions(-) diff --git a/target/linux/kirkwood/files-4.19/arch/arm/boot/dts/kirkwood-goflexhome.dts b/target/linux/kirkwood/files-4.19/arch/arm/boot/dts/kirkwood-goflexhome.dts index 6cb6f7249e..b0b69b46cd 100644 --- a/target/linux/kirkwood/files-4.19/arch/arm/boot/dts/kirkwood-goflexhome.dts +++ b/target/linux/kirkwood/files-4.19/arch/arm/boot/dts/kirkwood-goflexhome.dts @@ -30,29 +30,33 @@ marvell,pins = "mpp29"; marvell,function = "gpio"; }; + pmx_led_white: pmx-led-white { marvell,pins = "mpp40"; marvell,function = "gpio"; }; + pmx_led_green: pmx-led_green { marvell,pins = "mpp46"; marvell,function = "gpio"; }; + pmx_led_orange: pmx-led-orange { marvell,pins = "mpp47"; marvell,function = "gpio"; }; }; + serial@12000 { - status = "ok"; + status = "okay"; }; sata@80000 { status = "okay"; nr-ports = <2>; }; - }; + gpio-leds { compatible = "gpio-leds"; @@ -61,20 +65,25 @@ gpios = <&gpio1 14 GPIO_ACTIVE_LOW>; default-state = "on"; }; + led_fault: fault { label = "status:orange:fault"; gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; }; + misc { label = "status:white:misc"; gpios = <&gpio1 8 GPIO_ACTIVE_LOW>; linux,default-trigger = "disk-activity"; }; }; + regulators { compatible = "simple-bus"; + #address-cells = <1>; #size-cells = <0>; + pinctrl-0 = <&pmx_usb_power_enable>; pinctrl-names = "default"; @@ -93,18 +102,19 @@ }; &nand { - chip-delay = <40>; status = "okay"; + chip-delay = <40>; + partition@0 { label = "u-boot"; - reg = <0x0000000 0x100000>; + reg = <0x0000000 0x0100000>; read-only; }; partition@100000 { label = "ubi"; - reg = <0x100000 0x0ff00000>; + reg = <0x0100000 0xff00000>; }; }; @@ -118,6 +128,7 @@ ð0 { status = "okay"; + ethernet0-port@0 { phy-handle = <ðphy0>; }; diff --git a/target/linux/kirkwood/files-4.19/arch/arm/boot/dts/kirkwood-linksys-audi.dts b/target/linux/kirkwood/files-4.19/arch/arm/boot/dts/kirkwood-linksys-audi.dts index ac9db1949c..0d00943dfd 100644 --- a/target/linux/kirkwood/files-4.19/arch/arm/boot/dts/kirkwood-linksys-audi.dts +++ b/target/linux/kirkwood/files-4.19/arch/arm/boot/dts/kirkwood-linksys-audi.dts @@ -35,9 +35,10 @@ stdout-path = "serial0:115200n8"; }; - gpio_keys { + gpio-keys { compatible = "gpio-keys"; - pinctrl-0 = < &pmx_btn_wps &pmx_btn_reset >; + + pinctrl-0 = <&pmx_btn_wps &pmx_btn_reset>; pinctrl-names = "default"; wps { @@ -55,7 +56,8 @@ gpio-leds { compatible = "gpio-leds"; - pinctrl-0 = < &pmx_led_green_power >; + + pinctrl-0 = <&pmx_led_green_power>; pinctrl-names = "default"; led_power: power { @@ -132,10 +134,12 @@ marvell,pins = "mpp7"; marvell,function = "gpo"; }; + pmx_btn_wps: pmx-btn-wps { marvell,pins = "mpp47"; marvell,function = "gpio"; }; + pmx_btn_reset: pmx-btn-reset { marvell,pins = "mpp48"; marvell,function = "gpio"; @@ -144,6 +148,7 @@ &nand { status = "okay"; + pinctrl-0 = <&pmx_nand>; pinctrl-names = "default"; @@ -197,7 +202,6 @@ label = "unused"; reg = <0x88000 0x178000>; }; - }; }; @@ -226,6 +230,7 @@ */ ð0 { status = "okay"; + ethernet0-port@0 { speed = <1000>; duplex = <1>; @@ -237,6 +242,7 @@ */ ð1 { status = "okay"; + ethernet1-port@0 { speed = <1000>; duplex = <1>; diff --git a/target/linux/kirkwood/files-4.19/arch/arm/boot/dts/kirkwood-nsa310b.dts b/target/linux/kirkwood/files-4.19/arch/arm/boot/dts/kirkwood-nsa310b.dts index b06848576a..10b119eb01 100644 --- a/target/linux/kirkwood/files-4.19/arch/arm/boot/dts/kirkwood-nsa310b.dts +++ b/target/linux/kirkwood/files-4.19/arch/arm/boot/dts/kirkwood-nsa310b.dts @@ -92,38 +92,47 @@ gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>; default-state = "on"; }; + led_red_sys: red-sys { label = "nsa310:red:sys"; gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>; }; + green-hdd { label = "nsa310:green:hdd"; gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>; }; + red-hdd { label = "nsa310:red:hdd"; gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>; }; + green-esata { label = "nsa310:green:esata"; gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; }; + red-esata { label = "nsa310:red:esata"; gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>; }; + green-usb { label = "nsa310:green:usb"; gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>; }; + red-usb { label = "nsa310:red:usb"; gpios = <&gpio0 16 GPIO_ACTIVE_HIGH>; }; + green-copy { label = "nsa310:green:copy"; gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>; }; + red-copy { label = "nsa310:red:copy"; gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>; diff --git a/target/linux/kirkwood/files-4.19/arch/arm/boot/dts/kirkwood-on100.dts b/target/linux/kirkwood/files-4.19/arch/arm/boot/dts/kirkwood-on100.dts index 6d45814050..5ae66ede2f 100644 --- a/target/linux/kirkwood/files-4.19/arch/arm/boot/dts/kirkwood-on100.dts +++ b/target/linux/kirkwood/files-4.19/arch/arm/boot/dts/kirkwood-on100.dts @@ -25,8 +25,9 @@ stdout-path = "serial0:115200n8"; }; - gpio_keys { + gpio-keys { compatible = "gpio-keys"; + pinctrl-0 = <&pmx_btn_reset>; pinctrl-names = "default"; @@ -39,26 +40,27 @@ gpio-leds { compatible = "gpio-leds"; - pinctrl-0 = < &pmx_led_health_r &pmx_led_health_g >; + + pinctrl-0 = <&pmx_led_health_red &pmx_led_health_green>; pinctrl-names = "default"; - led_health_green: health_green { + led_health_green: health-green { label = "on100:green:health"; gpios = <&gpio1 12 GPIO_ACTIVE_LOW>; default-state = "on"; }; - led_health_red: health_red { + led_health_red: health-red { label = "on100:red:health"; gpios = <&gpio1 13 GPIO_ACTIVE_LOW>; }; - health2_green { + health2-green { label = "on100:green:health2"; gpios = <&gpio1 14 GPIO_ACTIVE_LOW>; }; - health2_red { + health2-red { label = "on100:red:health2"; gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; }; @@ -128,27 +130,27 @@ }; &pinctrl { - pmx_led_health_r: pmx-led-health-r { + pmx_led_health_red: pmx-led-health-red { marvell,pins = "mpp45"; marvell,function = "gpio"; }; - pmx_led_health_g: pmx-led-health-g { + pmx_led_health_green: pmx-led-health-green { marvell,pins = "mpp44"; marvell,function = "gpio"; }; - pmx_led_health2_r: pmx-led-health2-r { + pmx_led_health2_red: pmx-led-health2-red { marvell,pins = "mpp47"; marvell,function = "gpio"; }; - pmx_led_health2_g: pmx-led-health2-g { + pmx_led_health2_green: pmx-led-health2-green { marvell,pins = "mpp46"; marvell,function = "gpio"; }; - pmx_btn_reset: pmx-led-reset { + pmx_btn_reset: pmx-btn-reset { marvell,pins = "mpp31"; marvell,function = "gpio"; }; From 0b9b0c5d1526fce64b731c2583bf3eb8b9cb36c1 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Thu, 27 Feb 2020 14:49:08 +0100 Subject: [PATCH 16/16] ath79: also reduce spi-max-frequency for buffalo_wzr-hp-ag300h In accordance to ebc090e420d1 ("ath79: reduce spi-max-frequency to 50 MHz") this also reduces the spi-max-frequency to 50 MHz for the last remaining device with higher frequency in ath79. This will save us from having a single special case that will require adjustment when the spi driver for this device is changed in the future. Signed-off-by: Adrian Schmutzler Acked-by: Chuanhong Guo --- target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dts b/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dts index e87f422051..b3855eff06 100644 --- a/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dts +++ b/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dts @@ -234,14 +234,14 @@ flash0: flash@0 { compatible = "jedec,spi-nor"; reg = <0>; - spi-max-frequency = <104000000>; + spi-max-frequency = <50000000>; m25p,fast-read; }; flash1: flash@1 { compatible = "jedec,spi-nor"; reg = <1>; - spi-max-frequency = <104000000>; + spi-max-frequency = <50000000>; m25p,fast-read; }; };