From de499573006ab4f32ded9fd66a62ec5e0c183e8a Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 30 Jun 2021 19:08:59 +0200 Subject: [PATCH 01/17] mac80211: backport fix for nl80211 control port tx (fixes FS#3857) Signed-off-by: Felix Fietkau --- ...le-QoS-support-for-nl80211-ctrl-port.patch | 116 ++++++++++++++++++ ...pply-flow-control-on-management-fram.patch | 4 +- ...set-sk_pacing_shift-for-802.3-txpath.patch | 2 +- ...MPDU-session-check-from-minstrel_ht-.patch | 6 +- ...eee80211_tx_h_rate_ctrl-when-dequeue.patch | 12 +- ...te-control-support-for-encap-offload.patch | 2 +- ...rting-aggregation-sessions-on-mesh-i.patch | 8 +- 7 files changed, 133 insertions(+), 17 deletions(-) create mode 100644 package/kernel/mac80211/patches/subsys/316-mac80211-enable-QoS-support-for-nl80211-ctrl-port.patch diff --git a/package/kernel/mac80211/patches/subsys/316-mac80211-enable-QoS-support-for-nl80211-ctrl-port.patch b/package/kernel/mac80211/patches/subsys/316-mac80211-enable-QoS-support-for-nl80211-ctrl-port.patch new file mode 100644 index 0000000000..4be011ffec --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/316-mac80211-enable-QoS-support-for-nl80211-ctrl-port.patch @@ -0,0 +1,116 @@ +From: Markus Theil +Date: Sat, 6 Feb 2021 12:51:12 +0100 +Subject: [PATCH] mac80211: enable QoS support for nl80211 ctrl port + +This patch unifies sending control port frames +over nl80211 and AF_PACKET sockets a little more. + +Before this patch, EAPOL frames got QoS prioritization +only when using AF_PACKET sockets. + +__ieee80211_select_queue only selects a QoS-enabled queue +for control port frames, when the control port protocol +is set correctly on the skb. For the AF_PACKET path this +works, but the nl80211 path used ETH_P_802_3. + +Another check for injected frames in wme.c then prevented +the QoS TID to be copied in the frame. + +In order to fix this, get rid of the frame injection marking +for nl80211 ctrl port and set the correct ethernet protocol. + +Please note: +An erlier version of this path tried to prevent +frame aggregation for control port frames in order to speed up +the initial connection setup a little. This seemed to cause +issues on my older Intel dvm-based hardware, and was therefore +removed again. Future commits which try to reintroduce this +have to check carefully how hw behaves with aggregated and +non-aggregated traffic for the same TID. +My NIC: Intel(R) Centrino(R) Ultimate-N 6300 AGN, REV=0x74 + +Reported-by: kernel test robot +Signed-off-by: Markus Theil +Link: https://lore.kernel.org/r/20210206115112.567881-1-markus.theil@tu-ilmenau.de +Signed-off-by: Johannes Berg +--- + +--- a/net/mac80211/status.c ++++ b/net/mac80211/status.c +@@ -628,16 +628,12 @@ static void ieee80211_report_ack_skb(str + u64 cookie = IEEE80211_SKB_CB(skb)->ack.cookie; + struct ieee80211_sub_if_data *sdata; + struct ieee80211_hdr *hdr = (void *)skb->data; +- __be16 ethertype = 0; +- +- if (skb->len >= ETH_HLEN && skb->protocol == cpu_to_be16(ETH_P_802_3)) +- skb_copy_bits(skb, 2 * ETH_ALEN, ðertype, ETH_TLEN); + + rcu_read_lock(); + sdata = ieee80211_sdata_from_skb(local, skb); + if (sdata) { +- if (ethertype == sdata->control_port_protocol || +- ethertype == cpu_to_be16(ETH_P_PREAUTH)) ++ if (skb->protocol == sdata->control_port_protocol || ++ skb->protocol == cpu_to_be16(ETH_P_PREAUTH)) + cfg80211_control_port_tx_status(&sdata->wdev, + cookie, + skb->data, +--- a/net/mac80211/tx.c ++++ b/net/mac80211/tx.c +@@ -1195,9 +1195,7 @@ ieee80211_tx_prepare(struct ieee80211_su + tx->sta = rcu_dereference(sdata->u.vlan.sta); + if (!tx->sta && sdata->wdev.use_4addr) + return TX_DROP; +- } else if (info->flags & (IEEE80211_TX_INTFL_NL80211_FRAME_TX | +- IEEE80211_TX_CTL_INJECTED) || +- tx->sdata->control_port_protocol == tx->skb->protocol) { ++ } else if (tx->sdata->control_port_protocol == tx->skb->protocol) { + tx->sta = sta_info_get_bss(sdata, hdr->addr1); + } + if (!tx->sta && !is_multicast_ether_addr(hdr->addr1)) +@@ -5421,6 +5419,7 @@ int ieee80211_tx_control_port(struct wip + { + struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); + struct ieee80211_local *local = sdata->local; ++ struct sta_info *sta; + struct sk_buff *skb; + struct ethhdr *ehdr; + u32 ctrl_flags = 0; +@@ -5443,8 +5442,7 @@ int ieee80211_tx_control_port(struct wip + if (cookie) + ctrl_flags |= IEEE80211_TX_CTL_REQ_TX_STATUS; + +- flags |= IEEE80211_TX_INTFL_NL80211_FRAME_TX | +- IEEE80211_TX_CTL_INJECTED; ++ flags |= IEEE80211_TX_INTFL_NL80211_FRAME_TX; + + skb = dev_alloc_skb(local->hw.extra_tx_headroom + + sizeof(struct ethhdr) + len); +@@ -5461,10 +5459,25 @@ int ieee80211_tx_control_port(struct wip + ehdr->h_proto = proto; + + skb->dev = dev; +- skb->protocol = htons(ETH_P_802_3); ++ skb->protocol = proto; + skb_reset_network_header(skb); + skb_reset_mac_header(skb); + ++ /* update QoS header to prioritize control port frames if possible, ++ * priorization also happens for control port frames send over ++ * AF_PACKET ++ */ ++ rcu_read_lock(); ++ ++ if (ieee80211_lookup_ra_sta(sdata, skb, &sta) == 0 && !IS_ERR(sta)) { ++ u16 queue = __ieee80211_select_queue(sdata, sta, skb); ++ ++ skb_set_queue_mapping(skb, queue); ++ skb_get_hash(skb); ++ } ++ ++ rcu_read_unlock(); ++ + /* mutex lock is only needed for incrementing the cookie counter */ + mutex_lock(&local->mtx); + diff --git a/package/kernel/mac80211/patches/subsys/371-mac80211-don-t-apply-flow-control-on-management-fram.patch b/package/kernel/mac80211/patches/subsys/371-mac80211-don-t-apply-flow-control-on-management-fram.patch index b439a3814c..8d094a3632 100644 --- a/package/kernel/mac80211/patches/subsys/371-mac80211-don-t-apply-flow-control-on-management-fram.patch +++ b/package/kernel/mac80211/patches/subsys/371-mac80211-don-t-apply-flow-control-on-management-fram.patch @@ -28,7 +28,7 @@ Signed-off-by: Johannes Berg * * Transmit and frame generation functions. */ -@@ -1403,8 +1403,17 @@ static void ieee80211_txq_enqueue(struct +@@ -1401,8 +1401,17 @@ static void ieee80211_txq_enqueue(struct ieee80211_set_skb_enqueue_time(skb); spin_lock_bh(&fq->lock); @@ -48,7 +48,7 @@ Signed-off-by: Johannes Berg spin_unlock_bh(&fq->lock); } -@@ -3846,6 +3855,9 @@ bool ieee80211_txq_airtime_check(struct +@@ -3844,6 +3853,9 @@ bool ieee80211_txq_airtime_check(struct if (!txq->sta) return true; diff --git a/package/kernel/mac80211/patches/subsys/372-mac80211-set-sk_pacing_shift-for-802.3-txpath.patch b/package/kernel/mac80211/patches/subsys/372-mac80211-set-sk_pacing_shift-for-802.3-txpath.patch index 4d8a91a413..5bc1469a3f 100644 --- a/package/kernel/mac80211/patches/subsys/372-mac80211-set-sk_pacing_shift-for-802.3-txpath.patch +++ b/package/kernel/mac80211/patches/subsys/372-mac80211-set-sk_pacing_shift-for-802.3-txpath.patch @@ -9,7 +9,7 @@ Signed-off-by: Lorenzo Bianconi --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -4173,6 +4173,9 @@ static bool ieee80211_tx_8023(struct iee +@@ -4171,6 +4171,9 @@ static bool ieee80211_tx_8023(struct iee unsigned long flags; int q = info->hw_queue; diff --git a/package/kernel/mac80211/patches/subsys/374-mac80211-move-A-MPDU-session-check-from-minstrel_ht-.patch b/package/kernel/mac80211/patches/subsys/374-mac80211-move-A-MPDU-session-check-from-minstrel_ht-.patch index 4e3242e6a9..031f8e1636 100644 --- a/package/kernel/mac80211/patches/subsys/374-mac80211-move-A-MPDU-session-check-from-minstrel_ht-.patch +++ b/package/kernel/mac80211/patches/subsys/374-mac80211-move-A-MPDU-session-check-from-minstrel_ht-.patch @@ -76,7 +76,7 @@ Signed-off-by: Felix Fietkau .rate_init = minstrel_ht_rate_init, --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -3933,6 +3933,29 @@ void ieee80211_txq_schedule_start(struct +@@ -3931,6 +3931,29 @@ void ieee80211_txq_schedule_start(struct } EXPORT_SYMBOL(ieee80211_txq_schedule_start); @@ -106,7 +106,7 @@ Signed-off-by: Felix Fietkau void __ieee80211_subif_start_xmit(struct sk_buff *skb, struct net_device *dev, u32 info_flags, -@@ -3963,6 +3986,8 @@ void __ieee80211_subif_start_xmit(struct +@@ -3961,6 +3984,8 @@ void __ieee80211_subif_start_xmit(struct skb_get_hash(skb); } @@ -115,7 +115,7 @@ Signed-off-by: Felix Fietkau if (sta) { struct ieee80211_fast_tx *fast_tx; -@@ -4226,6 +4251,8 @@ static void ieee80211_8023_xmit(struct i +@@ -4224,6 +4249,8 @@ static void ieee80211_8023_xmit(struct i memset(info, 0, sizeof(*info)); diff --git a/package/kernel/mac80211/patches/subsys/375-mac80211-call-ieee80211_tx_h_rate_ctrl-when-dequeue.patch b/package/kernel/mac80211/patches/subsys/375-mac80211-call-ieee80211_tx_h_rate_ctrl-when-dequeue.patch index 49b1212213..cf84fca68a 100644 --- a/package/kernel/mac80211/patches/subsys/375-mac80211-call-ieee80211_tx_h_rate_ctrl-when-dequeue.patch +++ b/package/kernel/mac80211/patches/subsys/375-mac80211-call-ieee80211_tx_h_rate_ctrl-when-dequeue.patch @@ -10,7 +10,7 @@ Signed-off-by: Ryder Lee --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -1780,8 +1780,6 @@ static int invoke_tx_handlers_early(stru +@@ -1778,8 +1778,6 @@ static int invoke_tx_handlers_early(stru CALL_TXH(ieee80211_tx_h_ps_buf); CALL_TXH(ieee80211_tx_h_check_control_port_protocol); CALL_TXH(ieee80211_tx_h_select_key); @@ -19,7 +19,7 @@ Signed-off-by: Ryder Lee txh_done: if (unlikely(res == TX_DROP)) { -@@ -1814,6 +1812,9 @@ static int invoke_tx_handlers_late(struc +@@ -1812,6 +1810,9 @@ static int invoke_tx_handlers_late(struc goto txh_done; } @@ -29,7 +29,7 @@ Signed-off-by: Ryder Lee CALL_TXH(ieee80211_tx_h_michael_mic_add); CALL_TXH(ieee80211_tx_h_sequence); CALL_TXH(ieee80211_tx_h_fragment); -@@ -3384,15 +3385,21 @@ out: +@@ -3382,15 +3383,21 @@ out: * Can be called while the sta lock is held. Anything that can cause packets to * be generated will cause deadlock! */ @@ -55,7 +55,7 @@ Signed-off-by: Ryder Lee if (key) info->control.hw_key = &key->conf; -@@ -3441,6 +3448,8 @@ static void ieee80211_xmit_fast_finish(s +@@ -3439,6 +3446,8 @@ static void ieee80211_xmit_fast_finish(s break; } } @@ -64,7 +64,7 @@ Signed-off-by: Ryder Lee } static bool ieee80211_xmit_fast(struct ieee80211_sub_if_data *sdata, -@@ -3544,24 +3553,17 @@ static bool ieee80211_xmit_fast(struct i +@@ -3542,24 +3551,17 @@ static bool ieee80211_xmit_fast(struct i tx.sta = sta; tx.key = fast_tx->key; @@ -97,7 +97,7 @@ Signed-off-by: Ryder Lee if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) sdata = container_of(sdata->bss, -@@ -3672,8 +3674,12 @@ begin: +@@ -3670,8 +3672,12 @@ begin: (tx.key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV)) pn_offs = ieee80211_hdrlen(hdr->frame_control); diff --git a/package/kernel/mac80211/patches/subsys/376-mac80211-add-rate-control-support-for-encap-offload.patch b/package/kernel/mac80211/patches/subsys/376-mac80211-add-rate-control-support-for-encap-offload.patch index eefeaa4a8d..43a4a1334d 100644 --- a/package/kernel/mac80211/patches/subsys/376-mac80211-add-rate-control-support-for-encap-offload.patch +++ b/package/kernel/mac80211/patches/subsys/376-mac80211-add-rate-control-support-for-encap-offload.patch @@ -99,7 +99,7 @@ Signed-off-by: Ryder Lee tx->sta->tx_stats.last_rate = txrc.reported_rate; } else if (tx->sta) tx->sta->tx_stats.last_rate = txrc.reported_rate; -@@ -3662,8 +3664,16 @@ begin: +@@ -3660,8 +3662,16 @@ begin: else info->flags &= ~IEEE80211_TX_CTL_AMPDU; diff --git a/package/kernel/mac80211/patches/subsys/379-mac80211-fix-starting-aggregation-sessions-on-mesh-i.patch b/package/kernel/mac80211/patches/subsys/379-mac80211-fix-starting-aggregation-sessions-on-mesh-i.patch index 56eafaf847..2ad083f150 100644 --- a/package/kernel/mac80211/patches/subsys/379-mac80211-fix-starting-aggregation-sessions-on-mesh-i.patch +++ b/package/kernel/mac80211/patches/subsys/379-mac80211-fix-starting-aggregation-sessions-on-mesh-i.patch @@ -54,8 +54,8 @@ Signed-off-by: Felix Fietkau int tid; memset(tx, 0, sizeof(*tx)); -@@ -1202,8 +1226,10 @@ ieee80211_tx_prepare(struct ieee80211_su - tx->sdata->control_port_protocol == tx->skb->protocol) { +@@ -1200,8 +1224,10 @@ ieee80211_tx_prepare(struct ieee80211_su + } else if (tx->sdata->control_port_protocol == tx->skb->protocol) { tx->sta = sta_info_get_bss(sdata, hdr->addr1); } - if (!tx->sta && !is_multicast_ether_addr(hdr->addr1)) @@ -66,7 +66,7 @@ Signed-off-by: Felix Fietkau } if (tx->sta && ieee80211_is_data_qos(hdr->frame_control) && -@@ -1213,8 +1239,12 @@ ieee80211_tx_prepare(struct ieee80211_su +@@ -1211,8 +1237,12 @@ ieee80211_tx_prepare(struct ieee80211_su struct tid_ampdu_tx *tid_tx; tid = ieee80211_get_tid(hdr); @@ -80,7 +80,7 @@ Signed-off-by: Felix Fietkau if (tid_tx) { bool queued; -@@ -3949,29 +3979,6 @@ void ieee80211_txq_schedule_start(struct +@@ -3947,29 +3977,6 @@ void ieee80211_txq_schedule_start(struct } EXPORT_SYMBOL(ieee80211_txq_schedule_start); From 6cf1dfd7e1d6b5c6a94b87eb065408bb489574c0 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Mon, 21 Jun 2021 23:27:56 +0200 Subject: [PATCH 02/17] ath79: add support for Teltonika RUT230 v1 This commit adds support for the Teltonika RUT230 v1, a Atheros AR9331 based router with a Quectel UC20 UMTS modem. Hardware -------- Atheros AR9331 16 MB SPI-NOR XTX XT25F128B 64M DDR2 memory Atheros AR9331 1T1R 802.11bgn Wireless Boootloader: pepe2k U-Boot mod Hardware-Revision ----------------- There are two board revisions of the RUT230, a v0 and v1. A HW version is silkscreened on the top of the PCBs front side as well as shown in the Teltonika UI. However, this looks to be a different identifier, as the GPl dump shows this silkscreened / UI shown version are internally treated identically. Th following mapping has been obtained from the latest GPl dump. HW Ver 01 - 04 --> v0 HW Ver > 05 --> v1 My board was a HW Ver 09 and is treated as a v1. Installation ------------ While attaching power, hold down the reset button and release it after the signal LEDs flashed 3 times. Attach your Computer with the devices LAN port and assign yourself the IPv4 address 192.168.1.10/24. Open a web browser, navigate to 192.168.1.1. Upload the OpenWrt factory image. The device will install OpenWrt and automatically reboots afterwards. You can use the smae procedure with the stock firmware to return back to the vendor firmware. Signed-off-by: David Bauer --- .../ath79/dts/ar9331_teltonika_rut230-v1.dts | 193 ++++++++++++++++++ .../generic/base-files/etc/board.d/01_leds | 4 + target/linux/ath79/image/generic.mk | 35 +++- 3 files changed, 230 insertions(+), 2 deletions(-) create mode 100644 target/linux/ath79/dts/ar9331_teltonika_rut230-v1.dts diff --git a/target/linux/ath79/dts/ar9331_teltonika_rut230-v1.dts b/target/linux/ath79/dts/ar9331_teltonika_rut230-v1.dts new file mode 100644 index 0000000000..c394cf1cb8 --- /dev/null +++ b/target/linux/ath79/dts/ar9331_teltonika_rut230-v1.dts @@ -0,0 +1,193 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9331.dtsi" + +#include +#include + +/ { + model = "Teltonika RUT230 v1"; + compatible = "teltonika,rut230-v1", "qca,ar9331"; + + aliases { + label-mac-device = &wmac; + led-boot = &led_ss0; + led-failsafe = &led_ss0; + led-upgrade = &led_ss0; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 22 GPIO_ACTIVE_HIGH>; + debounce-interval = <60>; + }; + + input { + label = "input"; + linux,code = ; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + sim-tray { + label = "sim-tray"; + linux,code = ; + gpios = <&gpio 20 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + pinctrl-0 = <&switch_led_disable_pins>; + + led_ss0: signal-strength-0 { + label = "green:signal-strength-0"; + gpios = <&gpio 23 GPIO_ACTIVE_HIGH>; + }; + + signal-strength-1 { + label = "green:signal-strength-1"; + gpios = <&gpio 7 GPIO_ACTIVE_HIGH>; + }; + + signal-strength-2 { + label = "green:signal-strength-2"; + gpios = <&gpio 6 GPIO_ACTIVE_HIGH>; + }; + + signal-strength-3 { + label = "green:signal-strength-3"; + gpios = <&gpio 26 GPIO_ACTIVE_HIGH>; + }; + + signal-strength-4 { + label = "green:signal-strength4"; + gpios = <&gpio 27 GPIO_ACTIVE_HIGH>; + }; + + 2g { + label = "green:2g"; + gpios = <&gpio 8 GPIO_ACTIVE_HIGH>; + }; + + 3g { + label = "green:3g"; + gpios = <&gpio 24 GPIO_ACTIVE_HIGH>; + }; + + lan { + label = "green:lan"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + /* GPIO 13 - ACTIVE HIGH for hwrev 0 */ + }; + + wan { + label = "green:wan"; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + /* GPIO 14 - ACTIVE HIGH for hwrev 0 */ + }; + + /* 4G LED - GPIO21 ACTIVE_HIGH for RUT240 */ + }; + + reg_usb_vbus: reg_usb_vbus { + compatible = "regulator-fixed"; + regulator-name = "usb_vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&gpio 19 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; +}; + +ð0 { + status = "okay"; + + mtd-mac-address = <&config 0x0>; +}; + +ð1 { + status = "okay"; + + mtd-mac-address = <&config 0x0>; + mtd-mac-address-increment = <1>; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <30000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x20000>; + read-only; + }; + + config: partition@20000 { + label = "config"; + reg = <0x20000 0x10000>; + read-only; + }; + + art: partition@30000 { + label = "art"; + reg = <0x30000 0x10000>; + read-only; + }; + + partition@40000 { + compatible = "tplink,firmware"; + label = "firmware"; + reg = <0x40000 0xf30000>; + }; + + partition@f70000 { + label = "event-log"; + reg = <0xf70000 0x90000>; + read-only; + }; + }; + }; +}; + +&usb { + dr_mode = "host"; + vbus-supply = <®_usb_vbus>; + status = "okay"; +}; + +&gpio { + modem-power { + gpio-hog; + output-low; + gpios = <18 GPIO_ACTIVE_HIGH>; + line-name = "modem-power"; + }; +}; + +&usb_phy { + status = "okay"; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; + mtd-mac-address = <&config 0x0>; + mtd-mac-address-increment = <2>; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/01_leds b/target/linux/ath79/generic/base-files/etc/board.d/01_leds index d8e3d65967..c844c70e46 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds @@ -276,6 +276,10 @@ qihoo,c301) samsung,wam250) ucidef_set_led_netdev "lan" "LAN" "white:lan" "eth0" ;; +teltonika,rut230-v1) + ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1" + ucidef_set_led_switch "lan" "LAN" "green:lan" "switch0" "0x04" + ;; tplink,archer-a7-v5|\ tplink,archer-c7-v4|\ tplink,archer-c7-v5) diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 9d0be2b86b..ab875bd220 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -142,11 +142,20 @@ define Build/teltonika-fw-fake-checksum # from begin of the firmware file) with 16 bytes stored just before # 0xdeadc0de marker. Values are only compared, MD5 sum is not verified. let \ - offs="$$(stat -c%s $@) - 20"; \ + offs="$$(stat -c%s $@) - $(1)"; \ dd if=$@ bs=1 count=16 skip=76 |\ dd of=$@ bs=1 count=16 seek=$$offs conv=notrunc endef +define Build/teltonika-v1-header + $(STAGING_DIR_HOST)/bin/mktplinkfw \ + -c -H $(TPLINK_HWID) -W $(TPLINK_HWREV) -L $(KERNEL_LOADADDR) \ + -E $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \ + -m $(TPLINK_HEADER_VERSION) -N "$(VERSION_DIST)" -V "RUT2xx " \ + -k $@ -o $@.new $(1) + @mv $@.new $@ +endef + define Build/wrgg-pad-rootfs $(STAGING_DIR_HOST)/bin/padjffs2 $(IMAGE_ROOTFS) -c 64 >>$@ endef @@ -2182,6 +2191,28 @@ define Device/telco_t1 endef TARGET_DEVICES += telco_t1 +define Device/teltonika_rut230-v1 + SOC := ar9331 + DEVICE_VENDOR := Teltonika + DEVICE_MODEL := RUT230 + DEVICE_VARIANT := v1 + DEVICE_PACKAGES := kmod-usb-chipidea2 kmod-usb-acm kmod-usb-net-qmi-wwan \ + uqmi -uboot-envtools + IMAGE_SIZE := 15552k + TPLINK_HWID := 0x32200002 + TPLINK_HWREV := 0x1 + TPLINK_HEADER_VERSION := 1 + KERNEL := kernel-bin | append-dtb | lzma | teltonika-v1-header + KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | uImage lzma + IMAGES += factory.bin + IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs |\ + pad-rootfs | pad-extra 64 | teltonika-fw-fake-checksum 54 | check-size + IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(BLOCKSIZE) |\ + append-rootfs | pad-rootfs | append-metadata |\ + check-size +endef +TARGET_DEVICES += teltonika_rut230-v1 + define Device/teltonika_rut955 SOC := ar9344 DEVICE_VENDOR := Teltonika @@ -2196,7 +2227,7 @@ define Device/teltonika_rut955 KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | uImage lzma IMAGES += factory.bin IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs |\ - pad-rootfs | teltonika-fw-fake-checksum | append-string master |\ + pad-rootfs | teltonika-fw-fake-checksum 20 | append-string master |\ append-md5sum-bin | check-size IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(BLOCKSIZE) |\ append-rootfs | pad-rootfs | append-metadata |\ From 3c574750854488ff463b2069a5d23d9c44f2a3dc Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 30 Jun 2021 21:57:19 +0200 Subject: [PATCH 03/17] ubus: update to the latest version 4fc532c8a55b ubusd: fix tx_queue linked list usage Signed-off-by: Felix Fietkau --- package/system/ubus/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/system/ubus/Makefile b/package/system/ubus/Makefile index 9b29bf0e01..678ebb1b9e 100644 --- a/package/system/ubus/Makefile +++ b/package/system/ubus/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/ubus.git -PKG_SOURCE_DATE:=2021-06-03 -PKG_SOURCE_VERSION:=a8cf678230ed163ff7a07eb1e2c872f9d655460a -PKG_MIRROR_HASH:=aee34cd1c1aa0f1a459dda0b2c6cbdb6b66e67147ebd1bcbb2a16a2ef923d008 +PKG_SOURCE_DATE:=2021-06-30 +PKG_SOURCE_VERSION:=4fc532c8a55ba8217ad67d7fd47c5eb9a8aba044 +PKG_MIRROR_HASH:=a5c8205f2e2b2f1f9ad687592e66a6e2bf8900dc54cfe3ceefe6c297d18971a8 PKG_ABI_VERSION:=$(call abi_version_str,$(PKG_SOURCE_DATE)) CMAKE_INSTALL:=1 From aeee1bd2da724e89e9aa19e79627abd2ffd90fca Mon Sep 17 00:00:00 2001 From: Ansuel Smith Date: Tue, 25 May 2021 02:58:27 +0200 Subject: [PATCH 04/17] ipq806x: fix missing changes in 5.4 for new cpufreq implementation The new cpufreq dedicated driver changed the node structure on how the cache should be defined in the dts. The 5.4 dtsi addition patch has not been updated to follow the new implementation. Fix this to restore correct cache scaling and restore any performance regression. Signed-off-by: Ansuel Smith --- .../083-ipq8064-dtsi-additions.patch | 80 +++++++++++++------ .../patches-5.4/851-add-gsbi1-dts.patch | 2 +- 2 files changed, 57 insertions(+), 25 deletions(-) diff --git a/target/linux/ipq806x/patches-5.4/083-ipq8064-dtsi-additions.patch b/target/linux/ipq806x/patches-5.4/083-ipq8064-dtsi-additions.patch index cbb0231d43..ccfae25494 100644 --- a/target/linux/ipq806x/patches-5.4/083-ipq8064-dtsi-additions.patch +++ b/target/linux/ipq806x/patches-5.4/083-ipq8064-dtsi-additions.patch @@ -26,7 +26,7 @@ }; cpu1: cpu@1 { -@@ -38,11 +50,458 @@ +@@ -38,11 +50,476 @@ next-level-cache = <&L2>; qcom,acc = <&acc1>; qcom,saw = <&saw1>; @@ -42,19 +42,9 @@ + cpu-idle-states = <&CPU_SPC>; }; - L2: l2-cache { - compatible = "cache"; - cache-level = <2>; -+ qcom,saw = <&saw_l2>; -+ }; -+ -+ qcom,l2 { -+ qcom,l2-rates = <384000000 1000000000 1200000000>; -+ qcom,l2-cpufreq = <384000000 600000000 1200000000>; -+ qcom,l2-volt = <1100000 1100000 1150000>; -+ qcom,l2-supply = <&smb208_s1a>; -+ }; -+ +- L2: l2-cache { +- compatible = "cache"; +- cache-level = <2>; + idle-states { + CPU_SPC: spc { + compatible = "qcom,idle-state-spc", "arm,idle-state"; @@ -66,6 +56,31 @@ + }; + }; + ++ opp_table_l2: opp_table_l2 { ++ compatible = "operating-points-v2"; ++ ++ opp-384000000 { ++ opp-hz = /bits/ 64 <384000000>; ++ opp-microvolt = <1100000>; ++ clock-latency-ns = <100000>; ++ opp-level = <0>; ++ }; ++ ++ opp-1000000000 { ++ opp-hz = /bits/ 64 <1000000000>; ++ opp-microvolt = <1100000>; ++ clock-latency-ns = <100000>; ++ opp-level = <1>; ++ }; ++ ++ opp-1200000000 { ++ opp-hz = /bits/ 64 <1200000000>; ++ opp-microvolt = <1150000>; ++ clock-latency-ns = <100000>; ++ opp-level = <2>; ++ }; ++ }; ++ + opp_table0: opp_table0 { + compatible = "operating-points-v2-kryo-cpu"; + nvmem-cells = <&speedbin_efuse>; @@ -78,6 +93,7 @@ + opp-microvolt-speed0-pvs3-v0 = <800000>; + opp-supported-hw = <0x1>; + clock-latency-ns = <100000>; ++ opp-level = <0>; + }; + + opp-600000000 { @@ -88,6 +104,7 @@ + opp-microvolt-speed0-pvs3-v0 = <850000>; + opp-supported-hw = <0x1>; + clock-latency-ns = <100000>; ++ opp-level = <1>; + }; + + opp-800000000 { @@ -98,6 +115,7 @@ + opp-microvolt-speed0-pvs3-v0 = <900000>; + opp-supported-hw = <0x1>; + clock-latency-ns = <100000>; ++ opp-level = <1>; + }; + + opp-1000000000 { @@ -108,6 +126,7 @@ + opp-microvolt-speed0-pvs3-v0 = <950000>; + opp-supported-hw = <0x1>; + clock-latency-ns = <100000>; ++ opp-level = <1>; + }; + + opp-1200000000 { @@ -118,6 +137,7 @@ + opp-microvolt-speed0-pvs3-v0 = <1000000>; + opp-supported-hw = <0x1>; + clock-latency-ns = <100000>; ++ opp-level = <1>; + }; + + opp-1400000000 { @@ -128,6 +148,7 @@ + opp-microvolt-speed0-pvs3-v0 = <1050000>; + opp-supported-hw = <0x1>; + clock-latency-ns = <100000>; ++ opp-level = <2>; + }; + }; + @@ -485,7 +506,7 @@ }; }; -@@ -93,6 +552,15 @@ +@@ -93,6 +570,15 @@ }; }; @@ -501,10 +522,21 @@ firmware { scm { compatible = "qcom,scm-ipq806x", "qcom,scm"; -@@ -120,6 +588,84 @@ +@@ -120,6 +606,95 @@ reg-names = "lpass-lpaif"; }; ++ L2: l2-cache { ++ compatible = "qcom,krait-cache", "cache"; ++ cache-level = <2>; ++ qcom,saw = <&saw_l2>; ++ ++ clocks = <&kraitcc 4>; ++ clock-names = "l2"; ++ l2-supply = <&smb208_s1a>; ++ operating-points-v2 = <&opp_table_l2>; ++ }; ++ + qfprom: qfprom@700000 { + compatible = "qcom,qfprom", "syscon"; + reg = <0x700000 0x1000>; @@ -586,7 +618,7 @@ qcom_pinmux: pinmux@800000 { compatible = "qcom,ipq8064-pinctrl"; reg = <0x800000 0x4000>; -@@ -159,6 +705,15 @@ +@@ -159,6 +734,15 @@ }; }; @@ -602,7 +634,7 @@ spi_pins: spi_pins { mux { pins = "gpio18", "gpio19", "gpio21"; -@@ -168,6 +723,53 @@ +@@ -168,6 +752,53 @@ }; }; @@ -656,7 +688,7 @@ leds_pins: leds_pins { mux { pins = "gpio7", "gpio8", "gpio9", -@@ -229,6 +831,17 @@ +@@ -229,6 +860,17 @@ clock-output-names = "acpu1_aux"; }; @@ -674,7 +706,7 @@ saw0: regulator@2089000 { compatible = "qcom,saw2", "qcom,apq8064-saw2-v1.1-cpu", "syscon"; reg = <0x02089000 0x1000>, <0x02009000 0x1000>; -@@ -241,6 +854,17 @@ +@@ -241,6 +883,17 @@ regulator; }; @@ -692,7 +724,7 @@ gsbi2: gsbi@12480000 { compatible = "qcom,gsbi-v1.0.0"; cell-index = <2>; -@@ -436,6 +1060,15 @@ +@@ -436,6 +1089,15 @@ #power-domain-cells = <1>; }; @@ -708,7 +740,7 @@ tcsr: syscon@1a400000 { compatible = "qcom,tcsr-ipq8064", "syscon"; reg = <0x1a400000 0x100>; -@@ -448,6 +1081,95 @@ +@@ -448,6 +1110,95 @@ #reset-cells = <1>; }; @@ -804,7 +836,7 @@ pcie0: pci@1b500000 { compatible = "qcom,pcie-ipq8064"; reg = <0x1b500000 0x1000 -@@ -601,6 +1323,167 @@ +@@ -601,6 +1352,167 @@ perst-gpio = <&qcom_pinmux 63 GPIO_ACTIVE_LOW>; }; @@ -972,7 +1004,7 @@ vsdcc_fixed: vsdcc-regulator { compatible = "regulator-fixed"; regulator-name = "SDCC Power"; -@@ -676,4 +1559,17 @@ +@@ -676,4 +1588,17 @@ }; }; }; diff --git a/target/linux/ipq806x/patches-5.4/851-add-gsbi1-dts.patch b/target/linux/ipq806x/patches-5.4/851-add-gsbi1-dts.patch index f75f994904..a123189804 100644 --- a/target/linux/ipq806x/patches-5.4/851-add-gsbi1-dts.patch +++ b/target/linux/ipq806x/patches-5.4/851-add-gsbi1-dts.patch @@ -1,6 +1,6 @@ --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi -@@ -865,6 +865,41 @@ +@@ -894,6 +894,41 @@ reg = <0x12100000 0x10000>; }; From 014aac7944ab9c6d5f33f57491acea5698d77f3b Mon Sep 17 00:00:00 2001 From: Ansuel Smith Date: Thu, 20 May 2021 23:39:36 +0200 Subject: [PATCH 05/17] ipq806x: fix missing 1.4ghz cache freq for ipq8065 SoC With the new implementation of the dedicated cpufreq driver, the 1.4 Ghz was only dropped and not added to the ipq8065 SoC. Fix this to improve performance. Signed-off-by: Ansuel Smith --- .../ipq806x/files/arch/arm/boot/dts/qcom-ipq8065.dtsi | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065.dtsi b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065.dtsi index 9c3a24f600..a0312686a0 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065.dtsi +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065.dtsi @@ -77,6 +77,17 @@ qcom,mpll = <5>; }; +&opp_table_l2 { + /delete-node/opp-1200000000; + + opp-1400000000 { + opp-hz = /bits/ 64 <1400000000>; + opp-microvolt = <1150000>; + clock-latency-ns = <100000>; + opp-level = <2>; + }; +}; + &opp_table0 { /* * On ipq8065 1.2 ghz freq is not present From 5e52f96714ee113b7703cb5a6c4cce1aeaec4373 Mon Sep 17 00:00:00 2001 From: Ansuel Smith Date: Thu, 20 May 2021 23:41:57 +0200 Subject: [PATCH 06/17] ipq806x: fix dedicated cpufreq driver 2 small fix for the dedicated cpufreq driver: - Fix index wrongly used as the current cpu - Exit early if a bad freq is detected. In the current state the freq is applied anyway even with invalid state. Signed-off-by: Ansuel Smith --- ...q-add-Krait-dedicated-scaling-driver.patch | 30 ++++++++++--------- ...add-fab-scaling-support-with-cpufreq.patch | 6 ++-- ...q-add-Krait-dedicated-scaling-driver.patch | 30 ++++++++++--------- ...add-fab-scaling-support-with-cpufreq.patch | 6 ++-- 4 files changed, 38 insertions(+), 34 deletions(-) diff --git a/target/linux/ipq806x/patches-5.10/098-1-cpufreq-add-Krait-dedicated-scaling-driver.patch b/target/linux/ipq806x/patches-5.10/098-1-cpufreq-add-Krait-dedicated-scaling-driver.patch index 42913a994c..769686220b 100644 --- a/target/linux/ipq806x/patches-5.10/098-1-cpufreq-add-Krait-dedicated-scaling-driver.patch +++ b/target/linux/ipq806x/patches-5.10/098-1-cpufreq-add-Krait-dedicated-scaling-driver.patch @@ -75,7 +75,7 @@ Signed-off-by: Ansuel Smith ################################################################################## --- /dev/null +++ b/drivers/cpufreq/qcom-cpufreq-krait.c -@@ -0,0 +1,601 @@ +@@ -0,0 +1,603 @@ +// SPDX-License-Identifier: GPL-2.0 + +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt @@ -115,9 +115,11 @@ Signed-off-by: Ansuel Smith + int cpu, ret; + + if (l2_pdev) { ++ int policy_cpu = policy->cpu; ++ + /* find the max freq across all core */ + for_each_present_cpu(cpu) -+ if (cpu != index) ++ if (cpu != policy_cpu) + target_freq = max( + target_freq, + (unsigned long)cpufreq_quick_get(cpu)); @@ -132,6 +134,18 @@ Signed-off-by: Ansuel Smith + level = dev_pm_opp_get_level(opp); + dev_pm_opp_put(opp); + ++ /* ++ * Hardware constraint: ++ * Krait CPU cannot operate at 384MHz with L2 at 1Ghz. ++ * Assume index 0 with the idle freq and level > 0 as ++ * any L2 freq > 384MHz. ++ * Skip CPU freq change in this corner case. ++ */ ++ if (unlikely(index == 0 && level != 0)) { ++ dev_err(priv->cpu_dev, "Krait CPU can't operate at idle freq with L2 at 1GHz"); ++ return -EINVAL; ++ } ++ + opp = dev_pm_opp_find_level_exact(&l2_pdev->dev, level); + if (IS_ERR(opp)) { + dev_err(&l2_pdev->dev, @@ -144,18 +158,6 @@ Signed-off-by: Ansuel Smith + ret = dev_pm_opp_set_rate(&l2_pdev->dev, target_freq); + if (ret) + return ret; -+ -+ /* -+ * Hardware constraint: -+ * Krait CPU cannot operate at 384MHz with L2 at 1Ghz. -+ * Assume index 0 with the idle freq and level > 0 as -+ * any L2 freq > 384MHz. -+ * Skip CPU freq change in this corner case. -+ */ -+ if (unlikely(index == 0 && level != 0)) { -+ dev_err(priv->cpu_dev, "Krait CPU can't operate at idle freq with L2 at 1GHz"); -+ return -EINVAL; -+ } + } + + ret = dev_pm_opp_set_rate(priv->cpu_dev, freq * 1000); diff --git a/target/linux/ipq806x/patches-5.10/098-3-add-fab-scaling-support-with-cpufreq.patch b/target/linux/ipq806x/patches-5.10/098-3-add-fab-scaling-support-with-cpufreq.patch index fe9143218f..8ce3f062cf 100644 --- a/target/linux/ipq806x/patches-5.10/098-3-add-fab-scaling-support-with-cpufreq.patch +++ b/target/linux/ipq806x/patches-5.10/098-3-add-fab-scaling-support-with-cpufreq.patch @@ -227,9 +227,9 @@ #include "cpufreq-dt.h" -@@ -54,6 +55,13 @@ static int set_target(struct cpufreq_pol - level = dev_pm_opp_get_level(opp); - dev_pm_opp_put(opp); +@@ -68,6 +69,13 @@ static int set_target(struct cpufreq_pol + return -EINVAL; + } + /* + * Scale fabrics with max freq across all cores diff --git a/target/linux/ipq806x/patches-5.4/098-1-cpufreq-add-Krait-dedicated-scaling-driver.patch b/target/linux/ipq806x/patches-5.4/098-1-cpufreq-add-Krait-dedicated-scaling-driver.patch index cfc4341ebc..d6711105da 100644 --- a/target/linux/ipq806x/patches-5.4/098-1-cpufreq-add-Krait-dedicated-scaling-driver.patch +++ b/target/linux/ipq806x/patches-5.4/098-1-cpufreq-add-Krait-dedicated-scaling-driver.patch @@ -75,7 +75,7 @@ Signed-off-by: Ansuel Smith ################################################################################## --- /dev/null +++ b/drivers/cpufreq/qcom-cpufreq-krait.c -@@ -0,0 +1,601 @@ +@@ -0,0 +1,603 @@ +// SPDX-License-Identifier: GPL-2.0 + +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt @@ -115,9 +115,11 @@ Signed-off-by: Ansuel Smith + int cpu, ret; + + if (l2_pdev) { ++ int policy_cpu = policy->cpu; ++ + /* find the max freq across all core */ + for_each_present_cpu(cpu) -+ if (cpu != index) ++ if (cpu != policy_cpu) + target_freq = max( + target_freq, + (unsigned long)cpufreq_quick_get(cpu)); @@ -132,6 +134,18 @@ Signed-off-by: Ansuel Smith + level = dev_pm_opp_get_level(opp); + dev_pm_opp_put(opp); + ++ /* ++ * Hardware constraint: ++ * Krait CPU cannot operate at 384MHz with L2 at 1Ghz. ++ * Assume index 0 with the idle freq and level > 0 as ++ * any L2 freq > 384MHz. ++ * Skip CPU freq change in this corner case. ++ */ ++ if (unlikely(index == 0 && level != 0)) { ++ dev_err(priv->cpu_dev, "Krait CPU can't operate at idle freq with L2 at 1GHz"); ++ return -EINVAL; ++ } ++ + opp = dev_pm_opp_find_level_exact(&l2_pdev->dev, level); + if (IS_ERR(opp)) { + dev_err(&l2_pdev->dev, @@ -144,18 +158,6 @@ Signed-off-by: Ansuel Smith + ret = dev_pm_opp_set_rate(&l2_pdev->dev, target_freq); + if (ret) + return ret; -+ -+ /* -+ * Hardware constraint: -+ * Krait CPU cannot operate at 384MHz with L2 at 1Ghz. -+ * Assume index 0 with the idle freq and level > 0 as -+ * any L2 freq > 384MHz. -+ * Skip CPU freq change in this corner case. -+ */ -+ if (unlikely(index == 0 && level != 0)) { -+ dev_err(priv->cpu_dev, "Krait CPU can't operate at idle freq with L2 at 1GHz"); -+ return -EINVAL; -+ } + } + + ret = dev_pm_opp_set_rate(priv->cpu_dev, freq * 1000); diff --git a/target/linux/ipq806x/patches-5.4/098-3-add-fab-scaling-support-with-cpufreq.patch b/target/linux/ipq806x/patches-5.4/098-3-add-fab-scaling-support-with-cpufreq.patch index fe9143218f..8ce3f062cf 100644 --- a/target/linux/ipq806x/patches-5.4/098-3-add-fab-scaling-support-with-cpufreq.patch +++ b/target/linux/ipq806x/patches-5.4/098-3-add-fab-scaling-support-with-cpufreq.patch @@ -227,9 +227,9 @@ #include "cpufreq-dt.h" -@@ -54,6 +55,13 @@ static int set_target(struct cpufreq_pol - level = dev_pm_opp_get_level(opp); - dev_pm_opp_put(opp); +@@ -68,6 +69,13 @@ static int set_target(struct cpufreq_pol + return -EINVAL; + } + /* + * Scale fabrics with max freq across all cores From 964863bb23999a1fae99b883053cc4f3c5c42b40 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 27 Jun 2021 00:52:50 +0200 Subject: [PATCH 07/17] ltq-deu: Mark lantiq DEU broken When the ltq_deu_vr9 kernel module is loaded, hostapd does not start any more. It fails with this error message: daemon.err hostapd: nl80211: kernel reports: key addition failed daemon.err hostapd: Interface initialization failed OpenWrt uses the standard Linux crypto API in the wifi drivers now and this probably makes the system offload more crypto operations to special hardware like the Lantiq DEU. There is probably a bug in the DEU and these operations fail and then hostapd does not start the interface. Do not include the Lantiq DEU by default any more. Fixes: FS#3901 Fixes: 53b6783907f3 ("mac80211: remove patches stripping down crypto support") Signed-off-by: Hauke Mehrtens Acked-by: Martin Blumenstingl Tested-by: Notupus --- target/linux/lantiq/image/ar9.mk | 15 ++++++--------- target/linux/lantiq/image/danube.mk | 1 - target/linux/lantiq/xrx200/target.mk | 1 - 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/target/linux/lantiq/image/ar9.mk b/target/linux/lantiq/image/ar9.mk index a973c90beb..ea3836ea9d 100644 --- a/target/linux/lantiq/image/ar9.mk +++ b/target/linux/lantiq/image/ar9.mk @@ -7,7 +7,7 @@ define Device/avm_fritz7312 kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \ kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \ ltq-adsl-app ppp-mod-pppoa \ - kmod-ltq-deu-ar9 -swconfig + -swconfig endef TARGET_DEVICES += avm_fritz7312 @@ -22,7 +22,7 @@ define Device/avm_fritz7320 kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \ kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \ ltq-adsl-app ppp-mod-pppoa \ - kmod-ltq-deu-ar9 kmod-usb-dwc2 -swconfig + kmod-usb-dwc2 -swconfig SUPPORTED_DEVICES += FRITZ7320 endef TARGET_DEVICES += avm_fritz7320 @@ -38,7 +38,6 @@ define Device/bt_homehub-v3a DEVICE_PACKAGES := kmod-usb-dwc2 \ kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \ kmod-ltq-adsl-ar9-fw-a kmod-ltq-atm-ar9 \ - kmod-ltq-deu-ar9 \ ltq-adsl-app ppp-mod-pppoa \ kmod-ath9k kmod-owl-loader wpad-basic-wolfssl \ uboot-envtools @@ -107,8 +106,7 @@ define Device/netgear_dgn3500 kmod-ath9k kmod-owl-loader wpad-basic-wolfssl \ kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \ kmod-ltq-adsl-ar9-fw-a kmod-ltq-atm-ar9 \ - ltq-adsl-app ppp-mod-pppoa \ - kmod-ltq-deu-ar9 + ltq-adsl-app ppp-mod-pppoa SUPPORTED_DEVICES += DGN3500 endef TARGET_DEVICES += netgear_dgn3500 @@ -130,8 +128,7 @@ define Device/netgear_dgn3500b kmod-ath9k kmod-owl-loader wpad-basic-wolfssl \ kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \ kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \ - ltq-adsl-app ppp-mod-pppoa \ - kmod-ltq-deu-ar9 + ltq-adsl-app ppp-mod-pppoa SUPPORTED_DEVICES += DGN3500B endef TARGET_DEVICES += netgear_dgn3500b @@ -145,7 +142,7 @@ define Device/zte_h201l kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \ kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \ ltq-adsl-app ppp-mod-pppoe \ - kmod-ltq-deu-ar9 kmod-usb-dwc2 kmod-usb-ledtrig-usbport \ + kmod-usb-dwc2 kmod-usb-ledtrig-usbport \ kmod-ltq-tapi kmod-ltq-vmmc SUPPORTED_DEVICES += H201L endef @@ -161,7 +158,7 @@ define Device/zyxel_p-2601hn kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \ kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \ ltq-adsl-app ppp-mod-pppoe \ - kmod-ltq-deu-ar9 kmod-usb-dwc2 + kmod-usb-dwc2 SUPPORTED_DEVICES += P2601HNFX endef TARGET_DEVICES += zyxel_p-2601hn diff --git a/target/linux/lantiq/image/danube.mk b/target/linux/lantiq/image/danube.mk index 73ec27222a..28fa4ed800 100644 --- a/target/linux/lantiq/image/danube.mk +++ b/target/linux/lantiq/image/danube.mk @@ -192,7 +192,6 @@ define Device/bt_homehub-v2b DEVICE_PACKAGES := kmod-usb-dwc2 \ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \ - kmod-ltq-deu-danube \ ltq-adsl-app ppp-mod-pppoa \ kmod-ath9k kmod-owl-loader wpad-basic-wolfssl SUPPORTED_DEVICES += BTHOMEHUBV2B diff --git a/target/linux/lantiq/xrx200/target.mk b/target/linux/lantiq/xrx200/target.mk index c89f4bb83c..55299f632f 100644 --- a/target/linux/lantiq/xrx200/target.mk +++ b/target/linux/lantiq/xrx200/target.mk @@ -11,7 +11,6 @@ DEFAULT_PACKAGES+=kmod-leds-gpio \ kmod-ltq-vdsl-vr9 \ kmod-ltq-atm-vr9 \ kmod-ltq-ptm-vr9 \ - kmod-ltq-deu-vr9 \ ltq-vdsl-app \ dsl-vrx200-firmware-xdsl-a \ dsl-vrx200-firmware-xdsl-b-patch \ From a58bcc9e673db3c6aa39f2089d216d51c8356418 Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Mon, 28 Jun 2021 10:57:21 +0200 Subject: [PATCH 08/17] ath79: mikrotik: fix beeper phantom noise on RB912 Analysis done by Denis Kalashnikov: It seems that some ROS versions on some routerboard models have this bug: after silence boot (no output to uart, no beeps) beeper clicks when wireless traffic is. https://forum.mikrotik.com/viewtopic.php?f=3&t=92269 https://forum.mikrotik.com/viewtopic.php?t=63399 From these links: 1) Hello, I have RB951G-2HnD and I noticed strange thing when I loaded the device with some wireless traffic it produced strange sound - like hissing, fizzing etc. 2) Same problem still on 6.33, with silent boot enabled I hear buzzing noise on wireless load. 3) The sound is fixed in v5.19, it was a bug that caused beeper to make clicks. It also got fixed in RouterOS: * What's new in 5.19 (2012-Jul-16 10:51): fix ticking sound on RB411UAHL; * What's new in 6.38.3 (2017-Feb-07 09:52): rb3011 - fixed noise from buzzer after silent boot; I've checked with an oscilloscope that: * When on the ssr beeper pin is 0, on the beeper itself is 1 (~5V), and when on the ssr beeper pin is 1, on the beeper is 0 The beeper doesn't consume power, so 1 should be a default/idle value for the ssr beeper pin). * When there is wireless traffic (ping packets) in the background and the beeper clicks, I see pulses on the beeper itself, but no pulses on the ssr beeper pin (Q5 pin of 74hc595). When I manually toggle the ssr beeper pin I see pulses on both. So, it is likely that the phantom beeper clicks are caused by the EMI. Suggested-by: Denis Kalashnikov Reviewed-by: Sergey Ryazanov Signed-off-by: Koen Vandeputte --- .../ath79/dts/ar9342_mikrotik_routerboard-912uag-2hpnd.dts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/target/linux/ath79/dts/ar9342_mikrotik_routerboard-912uag-2hpnd.dts b/target/linux/ath79/dts/ar9342_mikrotik_routerboard-912uag-2hpnd.dts index cc5553acda..ee2c12b4e0 100644 --- a/target/linux/ath79/dts/ar9342_mikrotik_routerboard-912uag-2hpnd.dts +++ b/target/linux/ath79/dts/ar9342_mikrotik_routerboard-912uag-2hpnd.dts @@ -107,6 +107,12 @@ gpio-export { compatible = "gpio-export"; + beeper { + gpio-export,name = "beeper"; + gpio-export,output = <1>; /* Must be 1 to avoid EMI induced clicking noise */ + gpios = <&ssr 5 GPIO_ACTIVE_HIGH>; + }; + usb_power { gpio-export,name = "power-usb"; gpio-export,output = <1>; From 04942780734da56626d088d824a6117a74757637 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Wed, 30 Jun 2021 23:36:02 +0200 Subject: [PATCH 09/17] ath79: resolve GPIO address conflicts The ar71xx GPIO driver only uses 0x24 registers, all following GPIO registers are using to control pinmux functions, which are not handles by the GPIO driver but the generic Linux pinctrl driver. For some SoC conflicting address ranges were defined for these (AR7240 & AR9330). Resolve these cases and align the address space of the GPIO controller between all SoCs, as the used address space of the driver is identical for all these. Signed-off-by: David Bauer --- target/linux/ath79/dts/ar7100.dtsi | 2 +- target/linux/ath79/dts/ar724x.dtsi | 2 +- target/linux/ath79/dts/ar9132.dtsi | 2 +- target/linux/ath79/dts/ar9330.dtsi | 2 +- target/linux/ath79/dts/ar934x.dtsi | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/target/linux/ath79/dts/ar7100.dtsi b/target/linux/ath79/dts/ar7100.dtsi index ec6ff30ab6..86673cb5da 100644 --- a/target/linux/ath79/dts/ar7100.dtsi +++ b/target/linux/ath79/dts/ar7100.dtsi @@ -57,7 +57,7 @@ gpio: gpio@18040000 { compatible = "qca,ar7100-gpio"; - reg = <0x18040000 0x30>; + reg = <0x18040000 0x28>; interrupts = <2>; ngpios = <16>; diff --git a/target/linux/ath79/dts/ar724x.dtsi b/target/linux/ath79/dts/ar724x.dtsi index 25d72a786c..882b0bc51a 100644 --- a/target/linux/ath79/dts/ar724x.dtsi +++ b/target/linux/ath79/dts/ar724x.dtsi @@ -50,7 +50,7 @@ gpio: gpio@18040000 { compatible = "qca,ar7240-gpio", "qca,ar7100-gpio"; - reg = <0x18040000 0x30>; + reg = <0x18040000 0x28>; interrupts = <2>; ngpios = <18>; diff --git a/target/linux/ath79/dts/ar9132.dtsi b/target/linux/ath79/dts/ar9132.dtsi index 37fc32e6d6..44a5870ad7 100644 --- a/target/linux/ath79/dts/ar9132.dtsi +++ b/target/linux/ath79/dts/ar9132.dtsi @@ -77,7 +77,7 @@ gpio: gpio@18040000 { compatible = "qca,ar9132-gpio", "qca,ar7100-gpio"; - reg = <0x18040000 0x30>; + reg = <0x18040000 0x28>; interrupts = <2>; ngpios = <22>; diff --git a/target/linux/ath79/dts/ar9330.dtsi b/target/linux/ath79/dts/ar9330.dtsi index 7607fede49..06e1cf4601 100644 --- a/target/linux/ath79/dts/ar9330.dtsi +++ b/target/linux/ath79/dts/ar9330.dtsi @@ -49,7 +49,7 @@ gpio: gpio@18040000 { compatible = "qca,ar7100-gpio"; - reg = <0x18040000 0x34>; + reg = <0x18040000 0x28>; interrupts = <2>; ngpios = <30>; diff --git a/target/linux/ath79/dts/ar934x.dtsi b/target/linux/ath79/dts/ar934x.dtsi index 42fbab4b60..84dbe65f85 100644 --- a/target/linux/ath79/dts/ar934x.dtsi +++ b/target/linux/ath79/dts/ar934x.dtsi @@ -78,7 +78,7 @@ gpio: gpio@18040000 { compatible = "qca,ar9340-gpio"; - reg = <0x18040000 0x2c>; + reg = <0x18040000 0x28>; interrupts = <2>; ngpios = <23>; From 89ef883b92b3a87d9ab1bd289de26b9e72681dac Mon Sep 17 00:00:00 2001 From: Arjun AK Date: Thu, 16 Jul 2020 21:22:24 +0530 Subject: [PATCH 10/17] package/comgt: Handle bind/unbind events This script was expecting only add/remove events which has not been the case since Kernel 4.12 (which added bind/unbind). Bind events were getting treated as remove events which would cause hotplugged 3g modems to not work. More info: https://lkml.org/lkml/2018/12/23/128 https://github.com/systemd/systemd/issues/8221 Signed-off-by: Arjun AK --- package/network/utils/comgt/files/3g.usb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/network/utils/comgt/files/3g.usb b/package/network/utils/comgt/files/3g.usb index 8f0d62ca83..9c7d07a0e6 100644 --- a/package/network/utils/comgt/files/3g.usb +++ b/package/network/utils/comgt/files/3g.usb @@ -23,6 +23,8 @@ find_3g_iface() { fi } +[ "$ACTION" = add ] || [ "$ACTION" = remove ] || exit 0 + case "$DEVICENAME" in tty*) [ -e "/dev/$DEVICENAME" ] || [ "$ACTION" = remove ] || exit 0 From 8307da3dbdaff13d5ce99f8aefa32f5b7a2e18e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Fri, 2 Jul 2021 18:00:09 +0200 Subject: [PATCH 11/17] treewide: unmark selected packages nonshared MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This partially reverts changes done in commit 72cc44958ef4 ("treewide: mark selected packages nonshared") as it removes the nonshared flag, but keeps the PKG_RELEASE as the PKG_RELEASE bump while adding nonshared flag was incorrect. Unmark uci, ubus, libubox, lua, libnl-tiny and libjson-c as nonshared packages as this fix attempt didn't worked out. Currently the imagebuilder is broken again: openwrt-imagebuilder-21.02.0-rc3-ipq40xx-generic.Linux-x86_64$ make image PROFILE=avm_fritzbox-7530 PACKAGES=luci-ssl-openssl ... Collected errors: * pkg_hash_check_unresolved: cannot find dependency libiwinfo20210430 for luci-mod-status * pkg_hash_fetch_best_installation_candidate: Packages for luci-mod-status found, but incompatible with the architectures configured * pkg_hash_check_unresolved: cannot find dependency libiwinfo20210430 for rpcd-mod-iwinfo * pkg_hash_fetch_best_installation_candidate: Packages for rpcd-mod-iwinfo found, but incompatible with the architectures configured * satisfy_dependencies_for: Cannot satisfy the following dependencies for luci-ssl-openssl: * libiwinfo20210430 * opkg_install_cmd: Cannot install package luci-ssl-openssl. Everything because iwinfo's ABI was changed two times since rc3 release: +IWINFO_ABI_VERSION:=20210430 +IWINFO_ABI_VERSION:=20210420 Since iwinfo is marked as nonshared, it wasn't built by phase2 builders, but luci-mod-status was already updated 2 times since rc3 and was thus rebuilt by phase2 builders: d1d452ed2fb3 luci-mod-status: don't set '-' hostname when creating static lease 95b3633055c1 luci-mod-status: switch to html table for wlan channel analysis So now luci-mod-status depends on libiwinfo20210430 but only libiwinfo20210106 can be downloaded. This is first part of the fix, in the upcoming commit Jo is going to remove nonshared flag from iwinfo package as well. References: https://lists.infradead.org/pipermail/openwrt-devel/2021-July/035736.html References: https://lists.infradead.org/pipermail/openwrt-devel/2021-July/035741.html Acked-by: Jo-Philipp Wich Reported-by: Nick Hainke Signed-off-by: Petr Štetiar --- package/libs/libjson-c/Makefile | 1 - package/libs/libnl-tiny/Makefile | 2 -- package/libs/libubox/Makefile | 2 -- package/system/ubus/Makefile | 1 - package/system/uci/Makefile | 2 -- package/utils/lua/Makefile | 1 - 6 files changed, 9 deletions(-) diff --git a/package/libs/libjson-c/Makefile b/package/libs/libjson-c/Makefile index d4a16f36cb..63cc214438 100644 --- a/package/libs/libjson-c/Makefile +++ b/package/libs/libjson-c/Makefile @@ -20,7 +20,6 @@ PKG_LICENSE:=MIT PKG_LICENSE_FILES:=COPYING PKG_CPE_ID:=cpe:/a:json-c_project:json-c -PKG_FLAGS := nonshared HOST_BUILD_PREFIX:=$(STAGING_DIR_HOST) include $(INCLUDE_DIR)/package.mk diff --git a/package/libs/libnl-tiny/Makefile b/package/libs/libnl-tiny/Makefile index ff3da5b518..bdb496c48e 100644 --- a/package/libs/libnl-tiny/Makefile +++ b/package/libs/libnl-tiny/Makefile @@ -17,8 +17,6 @@ PKG_SOURCE_VERSION:=c291088f631d1694f7ba0444b59677b194348da8 PKG_MIRROR_HASH:=99bcce12701bb34dadb39689d95c2c5cf1e27719d0ecfd645d3957a8947025ac CMAKE_INSTALL:=1 -PKG_FLAGS := nonshared - PKG_LICENSE:=LGPL-2.1 PKG_MAINTAINER:=Felix Fietkau diff --git a/package/libs/libubox/Makefile b/package/libs/libubox/Makefile index cc5d7f7ae6..42a3f4ac3c 100644 --- a/package/libs/libubox/Makefile +++ b/package/libs/libubox/Makefile @@ -11,8 +11,6 @@ PKG_SOURCE_VERSION:=b14c4688612c05c78ce984d7bde633bce8703b1e PKG_ABI_VERSION:=$(call abi_version_str,$(PKG_SOURCE_DATE)) CMAKE_INSTALL:=1 -PKG_FLAGS := nonshared - PKG_LICENSE:=ISC PKG_LICENSE_FILES:= diff --git a/package/system/ubus/Makefile b/package/system/ubus/Makefile index 678ebb1b9e..e39de3c5dc 100644 --- a/package/system/ubus/Makefile +++ b/package/system/ubus/Makefile @@ -15,7 +15,6 @@ PKG_LICENSE:=LGPL-2.1 PKG_LICENSE_FILES:= PKG_MAINTAINER:=Felix Fietkau -PKG_FLAGS := nonshared PKG_ASLR_PIE_REGULAR:=1 include $(INCLUDE_DIR)/package.mk diff --git a/package/system/uci/Makefile b/package/system/uci/Makefile index 1355955d1a..0c18033e06 100644 --- a/package/system/uci/Makefile +++ b/package/system/uci/Makefile @@ -22,8 +22,6 @@ PKG_LICENSE_FILES:= PKG_MAINTAINER:=Felix Fietkau -PKG_FLAGS := nonshared - include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk diff --git a/package/utils/lua/Makefile b/package/utils/lua/Makefile index 83b83e4856..d262d1e1fc 100644 --- a/package/utils/lua/Makefile +++ b/package/utils/lua/Makefile @@ -16,7 +16,6 @@ PKG_SOURCE_URL:=http://www.lua.org/ftp/ \ http://www.tecgraf.puc-rio.br/lua/ftp/ PKG_HASH:=2640fc56a795f29d28ef15e13c34a47e223960b0240e8cb0a82d9b0738695333 PKG_BUILD_PARALLEL:=1 -PKG_FLAGS := nonshared PKG_LICENSE:=MIT PKG_LICENSE_FILES:=COPYRIGHT From 5a1065758b88b568a04a50189400321601904bdf Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 2 Jul 2021 18:04:17 +0200 Subject: [PATCH 12/17] iwinfo: build with nl80211 backend only and make shared Drop support for building the obsolete broadcom-wl backend and always forcibly enable the nl82011 support. This allows us to make the package shared again since no target specific compilation is happening anymore. This will solve various repository coherency issues related to unavailable libiwinfo versions in the long run. Signed-off-by: Jo-Philipp Wich --- package/network/utils/iwinfo/Makefile | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/package/network/utils/iwinfo/Makefile b/package/network/utils/iwinfo/Makefile index 9124e5fa07..3802d8d614 100644 --- a/package/network/utils/iwinfo/Makefile +++ b/package/network/utils/iwinfo/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libiwinfo -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/iwinfo.git @@ -17,14 +17,6 @@ PKG_MIRROR_HASH:=f33779035153da6bd0b2f100f402f62f1554ab87ed6fbbd938d41df6b9947a1 PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=GPL-2.0 -PKG_FLAGS := nonshared - -PKG_CONFIG_DEPENDS := \ - CONFIG_PACKAGE_kmod-brcm-wl \ - CONFIG_PACKAGE_kmod-brcm-wl-mini \ - CONFIG_PACKAGE_kmod-brcm-wl-mimo \ - CONFIG_PACKAGE_kmod-cfg80211 - IWINFO_ABI_VERSION:=20210430 include $(INCLUDE_DIR)/package.mk @@ -34,13 +26,13 @@ define Package/libiwinfo SECTION:=libs CATEGORY:=Libraries TITLE:=Generalized Wireless Information Library (iwinfo) - DEPENDS:=+PACKAGE_kmod-cfg80211:libnl-tiny +libuci +libubus + DEPENDS:=+libnl-tiny +libuci +libubus ABI_VERSION:=$(IWINFO_ABI_VERSION) endef define Package/libiwinfo/description - Wireless information library with consistent interface for proprietary Broadcom, - nl80211 and wext driver interfaces. + Wireless information library with simplified API for nl80211 + and wext driver interfaces. endef @@ -73,12 +65,6 @@ endef define Build/Configure endef -IWINFO_BACKENDS := \ - $(if $(CONFIG_PACKAGE_kmod-brcm-wl),wl) \ - $(if $(CONFIG_PACKAGE_kmod-brcm-wl-mini),wl) \ - $(if $(CONFIG_PACKAGE_kmod-brcm-wl-mimo),wl) \ - $(if $(CONFIG_PACKAGE_kmod-cfg80211),nl80211) - TARGET_CFLAGS += \ -I$(STAGING_DIR)/usr/include/libnl-tiny \ -I$(STAGING_DIR)/usr/include \ @@ -88,7 +74,7 @@ MAKE_FLAGS += \ FPIC="$(FPIC)" \ CFLAGS="$(TARGET_CFLAGS)" \ LDFLAGS="$(TARGET_LDFLAGS)" \ - BACKENDS="$(IWINFO_BACKENDS)" \ + BACKENDS="nl80211" \ SOVERSION="$(IWINFO_ABI_VERSION)" define Build/InstallDev From 3c3a96df3ff51d99f608be435dfe3d25231ff845 Mon Sep 17 00:00:00 2001 From: Nicholas Smith Date: Thu, 1 Jul 2021 15:07:56 +1000 Subject: [PATCH 13/17] .gitignore: ignore any .vscode* file .vscode-ctags are being tracked by git. Update .gitignore to include any .vscode* file Signed-off-by: Nicholas Smith --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 9647daa5a4..11f280d0aa 100644 --- a/.gitignore +++ b/.gitignore @@ -29,4 +29,4 @@ git-src .project .cproject .ccache -.vscode +.vscode* From 12eb5b2384a63427c0062856331fda60a1ebb309 Mon Sep 17 00:00:00 2001 From: Russell Senior Date: Fri, 4 Jun 2021 17:27:48 -0700 Subject: [PATCH 14/17] ath79: add support for Ubiquiti PowerBeam M (XW) This patch adds support for the Ubiquiti PowerBeam M (XW), e.g. PBE-M5-400, a 802.11n wireless with a feed+dish form factor. This device was previously supported by the ar71xx loco-m-xw firmware. Specifications: - Atheros AR9342 SoC - 64 MB RAM - 8 MB SPI flash - 1x 10/100 Mbps Ethernet port, 24 Vdc PoE-in - Power and LAN green LEDs - 4x RSSI LEDs (red, orange, green, green) - UART (115200 8N1) Flashing via stock GUI: - Downgrade to AirOS v5.5.x (latest available is 5.5.10-u2) first (see https://openwrt.org/toh/ubiquiti/powerbeam installation instructions) - Upload the factory image via AirOS web GUI. Flashing via TFTP: - Use a pointy tool (e.g., unbent paperclip) to keep the reset button pressed. - Power on the device (keep reset button pressed). - Keep pressing until LEDs flash alternatively LED1+LED3 => LED2+LED4 => LED1+LED3, etc. - Release reset button. - The device starts a TFTP server at 192.168.1.20. - Set a static IP on the computer (e.g., 192.168.1.21/24). - Upload via tftp the factory image: $ tftp 192.168.1.20 tftp> bin tftp> trace tftp> put openwrt-ath79-generic-xxxxx-ubnt_powerbeam-m-xw-squashfs-factory.bin WARNING: so far, no non-destructive method has been discovered for opening the enclosure to reach the serial console. Internal photos are available here: https://fcc.io/SWX-NBM5HP Signed-off-by: Russell Senior --- .../ath79/dts/ar9342_ubnt_powerbeam-m-xw.dts | 34 +++++++++++++++++++ .../generic/base-files/etc/board.d/01_leds | 1 + .../generic/base-files/etc/board.d/02_network | 1 + target/linux/ath79/image/generic-ubnt.mk | 8 +++++ 4 files changed, 44 insertions(+) create mode 100644 target/linux/ath79/dts/ar9342_ubnt_powerbeam-m-xw.dts diff --git a/target/linux/ath79/dts/ar9342_ubnt_powerbeam-m-xw.dts b/target/linux/ath79/dts/ar9342_ubnt_powerbeam-m-xw.dts new file mode 100644 index 0000000000..6db058f887 --- /dev/null +++ b/target/linux/ath79/dts/ar9342_ubnt_powerbeam-m-xw.dts @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9342_ubnt_xw.dtsi" + +/ { + compatible = "ubnt,powerbeam-m-xw", "ubnt,xw", "qca,ar9342"; + model = "Ubiquiti PowerBeam M (XW)"; +}; + +&mdio0 { + status = "okay"; + + phy-mask = <4>; + + phy4: ethernet-phy@4 { + reg = <4>; + }; +}; + +ð0 { + status = "okay"; + + /* default for ar934x, except for 1000M and 10M */ + pll-data = <0x02000000 0x00000101 0x00001313>; + + phy-mode = "rgmii-id"; + phy-handle = <&phy4>; + + gmac-config { + device = <&gmac>; + rxd-delay = <3>; + rxdv-delay = <3>; + }; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/01_leds b/target/linux/ath79/generic/base-files/etc/board.d/01_leds index c844c70e46..8044d0c1f2 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds @@ -397,6 +397,7 @@ ubnt,nanostation-loco-m-xw|\ ubnt,nanostation-m|\ ubnt,nanostation-m-xw|\ ubnt,picostation-m|\ +ubnt,powerbeam-m-xw|\ ubnt,powerbridge-m|\ ubnt,rocket-m) ucidef_set_rssimon "wlan0" "200000" "1" diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index 2fa51ab905..b7e9d9584f 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -85,6 +85,7 @@ ath79_setup_interfaces() ubnt,picostation-m|\ ubnt,powerbeam-5ac-500|\ ubnt,powerbeam-5ac-gen2|\ + ubnt,powerbeam-m-xw|\ ubnt,powerbridge-m|\ ubnt,rocket-5ac-lite|\ ubnt,rocket-m|\ diff --git a/target/linux/ath79/image/generic-ubnt.mk b/target/linux/ath79/image/generic-ubnt.mk index f8e1d1e432..e8ea06a07a 100644 --- a/target/linux/ath79/image/generic-ubnt.mk +++ b/target/linux/ath79/image/generic-ubnt.mk @@ -328,6 +328,14 @@ define Device/ubnt_powerbeam-5ac-gen2 endef TARGET_DEVICES += ubnt_powerbeam-5ac-gen2 +define Device/ubnt_powerbeam-m-xw + $(Device/ubnt-xw) + DEVICE_MODEL := PowerBeam M + DEVICE_PACKAGES += rssileds + SUPPORTED_DEVICES += loco-m-xw +endef +TARGET_DEVICES += ubnt_powerbeam-m-xw + define Device/ubnt_powerbridge-m $(Device/ubnt-xm) SOC := ar7241 From cce2e8db564b6e40fb5c1831678d98232f09f305 Mon Sep 17 00:00:00 2001 From: Diogenes Rengo Date: Fri, 25 Jun 2021 11:44:40 -0300 Subject: [PATCH 15/17] ath79: add support for TP-Link TL-WR941HP v1 Specifications: SOC: Qualcomm Atheros TP9343 (750 MHz) Flash: 8 Mb (GigaDevice GD25Q64CSIG) RAM: 64 Mb (Zentel A3R12E40DBF-8E) Serial: yes, 4-pin header Wlan: Qualcomm Atheros TP9343, antenna: MIM0 3x3:3 RP-SMA 3 x 2.4GHz power amp module Skyworks (SiGe) SE2576L Ethernet: Qualcomm Atheros TP9343 Lan speed: 100M ports: 4 Lan speed: 100M ports: 1 Other info: same case, ram and flash that TP-Link TL-WR841HP, different SOC https://forum.openwrt.org/t/adding-device-support-tp-link-wr941hp/ Label MAC addresses based on vendor firmware: LAN *:ee label WAN *:ef label +1 WLAN *:ee label The label MAC address found in "config" partition at 0x8 Flash instruction: Upload the generated factory firmware on web interface. Signed-off-by: Diogenes Rengo [remove various whitespace issues, squash commits, use short 0x0] Signed-off-by: Adrian Schmutzler --- .../ath79/dts/tp9343_tplink_tl-wr941hp-v1.dts | 154 ++++++++++++++++++ .../generic/base-files/etc/board.d/01_leds | 4 + .../generic/base-files/etc/board.d/02_network | 3 +- target/linux/ath79/image/generic-tp-link.mk | 10 ++ tools/firmware-utils/src/tplink-safeloader.c | 31 ++++ 5 files changed, 201 insertions(+), 1 deletion(-) create mode 100644 target/linux/ath79/dts/tp9343_tplink_tl-wr941hp-v1.dts diff --git a/target/linux/ath79/dts/tp9343_tplink_tl-wr941hp-v1.dts b/target/linux/ath79/dts/tp9343_tplink_tl-wr941hp-v1.dts new file mode 100644 index 0000000000..7451f00740 --- /dev/null +++ b/target/linux/ath79/dts/tp9343_tplink_tl-wr941hp-v1.dts @@ -0,0 +1,154 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca956x.dtsi" + +#include +#include + +/ { + compatible = "tplink,tl-wr941hp-v1", "qca,tp9343"; + model = "TP-Link TL-WR941HP v1"; + + aliases { + label-mac-device = &wmac; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + leds { + compatible = "gpio-leds"; + + re { + label = "blue:re"; + gpios = <&gpio 6 GPIO_ACTIVE_LOW>; + }; + + wifi { + label = "blue:wifi"; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + led_power: power { + label = "blue:power"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + wan_blue { + label = "blue:wan"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + wan_red { + label = "red:wan"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + lan { + label = "blue:lan"; + gpios = <&gpio 7 GPIO_ACTIVE_LOW>; + }; + + wps { + label = "blue:wps"; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + re { + label = "range extender button"; + linux,code = ; + gpios = <&gpio 5 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + wifi { + label = "wifi button"; + linux,code = ; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + reset { + label = "reset button"; + linux,code = ; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + wps { + label = "wps button"; + linux,code = ; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; +}; + +&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>; + + uboot: partition@0 { + label = "u-boot"; + reg = <0x0 0x020000>; + read-only; + }; + + partition@20000 { + compatible = "tplink,firmware"; + label = "firmware"; + reg = <0x020000 0x730000>; + }; + + config: partition@750000 { + label = "config"; + reg = <0x750000 0x0a0000>; + read-only; + }; + + art: partition@7f0000 { + label = "art"; + reg = <0x7f0000 0x010000>; + read-only; + }; + }; + }; +}; + +ð0 { + status = "okay"; + + phy-handle = <&swphy0>; + + mtd-mac-address = <&config 0x8>; + mtd-mac-address-increment = <1>; +}; + +ð1 { + status = "okay"; + + mtd-mac-address = <&config 0x8>; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; + mtd-mac-address = <&config 0x8>; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/01_leds b/target/linux/ath79/generic/base-files/etc/board.d/01_leds index 8044d0c1f2..ffda0253f3 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds @@ -374,6 +374,10 @@ tplink,tl-wr842n-v2) ucidef_set_led_switch "lan3" "LAN3" "green:lan3" "switch0" "0x10" ucidef_set_led_switch "lan4" "LAN4" "green:lan4" "switch0" "0x02" ;; +tplink,tl-wr941hp-v1) + ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth1" "link tx rx" + ucidef_set_led_switch "lan" "LAN" "blue:lan" "switch0" "0x1e" + ;; trendnet,tew-823dru) ucidef_set_led_netdev "wan" "WAN" "green:planet" "eth0" ;; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index b7e9d9584f..56cff8c031 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -398,7 +398,8 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1" "5:lan:4" ;; - tplink,tl-wr842n-v2) + tplink,tl-wr842n-v2)\ + tplink,tl-wr941hp-v1) ucidef_set_interface_wan "eth1" ucidef_add_switch "switch0" \ "0@eth0" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3" diff --git a/target/linux/ath79/image/generic-tp-link.mk b/target/linux/ath79/image/generic-tp-link.mk index 8b228a73d2..daeac8341f 100644 --- a/target/linux/ath79/image/generic-tp-link.mk +++ b/target/linux/ath79/image/generic-tp-link.mk @@ -798,6 +798,16 @@ define Device/tplink_tl-wr902ac-v1 endef TARGET_DEVICES += tplink_tl-wr902ac-v1 +define Device/tplink_tl-wr941hp-v1 + $(Device/tplink-safeloader) + SOC := tp9343 + DEVICE_MODEL := TL-WR941HP + DEVICE_VARIANT := v1 + TPLINK_BOARD_ID := TL-WR941HP-V1 + IMAGE_SIZE := 7360k +endef +TARGET_DEVICES += tplink_tl-wr941hp-v1 + define Device/tplink_wbs210-v1 $(Device/tplink-safeloader-okli) SOC := ar9344 diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c index fd154e7e0a..432044882c 100644 --- a/tools/firmware-utils/src/tplink-safeloader.c +++ b/tools/firmware-utils/src/tplink-safeloader.c @@ -1930,6 +1930,37 @@ static struct device_info boards[] = { .last_sysupgrade_partition = "file-system", }, + /** Firmware layout for the TL-WR941HP v1 */ + { + .id = "TL-WR941HP-V1", + .vendor = "", + .support_list = + "SupportList:\n" + "{product_name:TL-WR941HP,product_ver:1.0.0,special_id:00000000}\n", + .part_trail = 0x00, + .soft_ver = NULL, + + .partitions = { + {"fs-uboot", 0x00000, 0x20000}, + {"firmware", 0x20000, 0x730000}, + {"default-mac", 0x750000, 0x00200}, + {"pin", 0x750200, 0x00200}, + {"product-info", 0x750400, 0x0fc00}, + {"soft-version", 0x760000, 0x0b000}, + {"support-list", 0x76b000, 0x04000}, + {"profile", 0x770000, 0x04000}, + {"default-config", 0x774000, 0x0b000}, + {"user-config", 0x780000, 0x40000}, + {"partition-table", 0x7c0000, 0x10000}, + {"log", 0x7d0000, 0x20000}, + {"radio", 0x7f0000, 0x10000}, + {NULL, 0, 0} + }, + + .first_sysupgrade_partition = "os-image", + .last_sysupgrade_partition = "file-system", + }, + /** Firmware layout for the TL-WR942N V1 */ { .id = "TLWR942NV1", From 6c148116f778bfd2db88476cee4753b32538eafe Mon Sep 17 00:00:00 2001 From: Evgeniy Isaev Date: Tue, 11 May 2021 13:45:51 +0500 Subject: [PATCH 16/17] ath79: add support for Xiaomi AIoT Router AC2350 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Device specifications * SoC: QCA9563 @ 775MHz (MIPS 74Kc) * RAM: 128MiB DDR2 * Flash: 16MiB SPI-NOR (EN25QH128) * Wireless 2.4GHz (SoC): b/g/n, 3x3 * Wireless 5Ghz (QCA9988): a/n/ac, 4x4 MU-MIMO * IoT Wireless 2.4GHz (QCA6006): currently unusable * Ethernet (AR8327): 3 LAN × 1GbE, 1 WAN × 1GbE * LEDs: Internet (blue/orange), System (blue/orange) * Buttons: Reset * UART: through-hole on PCB ([VCC 3.3v](RX)(GND)(TX) 115200, 8n1) * Power: 12VDC, 1,5A MAC addresses map (like in OEM firmware) art@0x0 88:C3:97:*:57 wan/label art@0x1002 88:C3:97:*:2D lan/wlan2g art@0x5006 88:C3:97:*:2C wlan5g Obtain SSH Access 1. Download and flash the firmware version 1.3.8 (China). 2. Login to the router web interface and get the value of `stok=` from the URL 3. Open a new tab and go to the following URL (replace with the stok value gained above; line breaks are only for easier handling, please put together all four lines into a single URL without any spaces): http://192.168.31.1/cgi-bin/luci/;stok=/api/misystem/set_config_iotdev ?bssid=any&user_id=any&ssid=-h%0Anvram%20set%20ssh_en%3D1%0Anvram%20commit %0Ased%20-i%20%27s%2Fchannel%3D.%2A%2Fchannel%3D%5C%5C%22debug%5C%5C%22%2F g%27%20%2Fetc%2Finit.d%2Fdropbear%0A%2Fetc%2Finit.d%2Fdropbear%20start%0A 4. Wait 30-60 seconds (this is the time required to generate keys for the SSH server on the router). Create Full Backup 1. Obtain SSH Access. 2. Create backup of all flash (on router): dd if=/dev/mtd0 of=/tmp/ALL.backup 3. Copy backup to PC (on PC): scp root@192.168.31.1:/tmp/ALL.backup ./ Tip: backup of the original firmware, taken three times, increases the chances of recovery :) Calculate The Password * Locally using shell (replace "12345/E0QM98765" with your router's serial number): On Linux printf "%s6d2df50a-250f-4a30-a5e6-d44fb0960aa0" "12345/E0QM98765" | \ md5sum - | head -c8 && echo On macOS printf "%s6d2df50a-250f-4a30-a5e6-d44fb0960aa0" "12345/E0QM98765" | \ md5 | head -c8 * Locally using python script (replace "12345/E0QM98765" with your router's serial number): wget https://raw.githubusercontent.com/eisaev/ax3600-files/master/scripts/calc_passwd.py python3.7 -c 'from calc_passwd import calc_passwd; print(calc_passwd("12345/E0QM98765"))' * Online https://www.oxygen7.cn/miwifi/ Debricking (lite) If you have a healthy bootloader, you can use recovery via TFTP using programs like TinyPXE on Windows or dnsmasq on Linux. To switch the router to TFTP recovery mode, hold down the reset button, connect the power supply, and release the button after about 10 seconds. The router must be connected directly to the PC via the LAN port. Debricking You will need a full dump of your flash, a CH341 programmer, and a clip for in-circuit programming. Install OpenWRT 1. Obtain SSH Access. 2. Create script (on router): echo '#!/bin/sh' > /tmp/flash_fw.sh echo >> /tmp/flash_fw.sh echo '. /bin/boardupgrade.sh' >> /tmp/flash_fw.sh echo >> /tmp/flash_fw.sh echo 'board_prepare_upgrade' >> /tmp/flash_fw.sh echo 'mtd erase rootfs_data' >> /tmp/flash_fw.sh echo 'mtd write /tmp/openwrt.bin firmware' >> /tmp/flash_fw.sh echo 'sleep 3' >> /tmp/flash_fw.sh echo 'reboot' >> /tmp/flash_fw.sh echo >> /tmp/flash_fw.sh chmod +x /tmp/flash_fw.sh 3. Copy `openwrt-ath79-generic-xiaomi_aiot-ac2350-squashfs-sysupgrade.bin` to the router (on PC): scp openwrt-ath79-generic-xiaomi_aiot-ac2350-squashfs-sysupgrade.bin \ root@192.168.31.1:/tmp/openwrt.bin 4. Flash OpenWRT (on router): /bin/ash /tmp/flash_fw.sh & 5. SSH connection will be interrupted - this is normal. 6. Wait for the indicator to turn blue. Signed-off-by: Evgeniy Isaev [improve commit message formatting slightly] Signed-off-by: Adrian Schmutzler --- .../ath79/dts/qca9563_xiaomi_aiot-ac2350.dts | 177 ++++++++++++++++++ .../generic/base-files/etc/board.d/01_leds | 3 + .../generic/base-files/etc/board.d/02_network | 6 +- .../etc/hotplug.d/firmware/11-ath10k-caldata | 5 + target/linux/ath79/image/generic.mk | 9 + 5 files changed, 199 insertions(+), 1 deletion(-) create mode 100644 target/linux/ath79/dts/qca9563_xiaomi_aiot-ac2350.dts diff --git a/target/linux/ath79/dts/qca9563_xiaomi_aiot-ac2350.dts b/target/linux/ath79/dts/qca9563_xiaomi_aiot-ac2350.dts new file mode 100644 index 0000000000..d8fc589d58 --- /dev/null +++ b/target/linux/ath79/dts/qca9563_xiaomi_aiot-ac2350.dts @@ -0,0 +1,177 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca956x.dtsi" + +#include +#include + +/ { + model = "Xiaomi AIoT AC2350"; + compatible = "xiaomi,aiot-ac2350", "qca,qca9563"; + + aliases { + label-mac-device = ð0; + + led-boot = &led_system_orange; + led-failsafe = &led_system_orange; + led-running = &led_system_blue; + led-upgrade = &led_system_orange; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 2 GPIO_ACTIVE_HIGH>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_system_blue: system_blue { + label = "blue:system"; + gpios = <&gpio 5 GPIO_ACTIVE_LOW>; + }; + + led_system_orange: system_orange { + label = "orange:system"; + gpios = <&gpio 7 GPIO_ACTIVE_LOW>; + }; + + wan_blue { + label = "blue:wan"; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + }; + + wan_orange { + label = "orange:wan"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-export { + compatible = "gpio-export"; + + wps { + gpio-export,name = "wps"; + gpio-export,output = <0>; + gpios = <&gpio 1 GPIO_ACTIVE_HIGH>; + }; + + usb-reset { + gpio-export,name = "usb-reset"; + gpio-export,output = <0>; + gpios = <&gpio 19 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "Bootloader"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "Nvram"; + reg = <0x30000 0x10000>; + }; + + partition@40000 { + label = "Bdata"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + label = "crash"; + reg = <0x50000 0x10000>; + read-only; + }; + + art: partition@60000 { + label = "art"; + reg = <0x60000 0x10000>; + read-only; + }; + + partition@70000 { + label = "cfg_bak"; + reg = <0x70000 0x20000>; + read-only; + }; + + partition@90000 { + label = "overlay"; + reg = <0x90000 0x170000>; + read-only; + }; + + partition@200000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x200000 0xe00000>; + }; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy-mask = <0x1>; + + phy0: ethernet-phy@0 { + reg = <0>; + phy-mode = "sgmii"; + + qca,ar8327-initvals = < + 0x04 0x00000080 /* PORT0 PAD MODE CTRL */ + 0x08 0x01000000 /* PORT5 PAD MODE CTRL */ + 0x0c 0x00000000 /* PORT6 PAD MODE CTRL */ + 0x10 0x602613a0 /* POWER_ON_STRAP */ + 0x50 0xcf35cf35 /* LED_CTRL0 */ + 0x54 0xca35ca35 /* LED_CTRL1 */ + 0x58 0xc935c935 /* LED_CTRL2 */ + 0x5c 0x03ffff00 /* LED_CTRL3 */ + 0x7c 0x000000fe /* PORT0_STATUS */ + 0x94 0x000010c2 /* PORT6_STATUS */ + 0xe0 0xc74164de /* SGMII_CTRL */ + >; + }; +}; + +ð0 { + status = "okay"; + + phy-mode = "sgmii"; + phy-handle = <&phy0>; + + mtd-mac-address = <&art 0x0>; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; + +&pcie { + status = "okay"; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/01_leds b/target/linux/ath79/generic/base-files/etc/board.d/01_leds index ffda0253f3..890b38e58a 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds @@ -426,6 +426,9 @@ wd,mynet-wifi-rangeextender) ucidef_set_led_rssi "rssimedium" "RSSIMED" "blue:rssi-med" "wlan0" "33" "100" ucidef_set_led_rssi "rssihigh" "RSSIMAX" "blue:rssi-max" "wlan0" "66" "100" ;; +xiaomi,aiot-ac2350) + ucidef_set_led_switch "wan" "WAN" "blue:wan" "switch0" "0x02" + ;; yuncore,a770) ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1" ucidef_set_led_switch "lan" "LAN" "green:lan" "switch0" "0x10" diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index 56cff8c031..8f547ba5ce 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -320,7 +320,8 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "2:lan" "3:wan" ;; - nec,wg800hp) + nec,wg800hp|\ + xiaomi,aiot-ac2350) ucidef_add_switch "switch0" \ "0@eth0" "2:lan" "3:lan" "4:lan" "1:wan" ;; @@ -679,6 +680,9 @@ ath79_setup_macs() wd,mynet-wifi-rangeextender) lan_mac=$(nvram get et0macaddr) ;; + xiaomi,aiot-ac2350) + lan_mac=$(mtd_get_mac_binary art 0x1002) + ;; zyxel,nbg6616) label_mac=$(mtd_get_mac_ascii u-boot-env ethaddr) ;; diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 8d070cba27..8d7407450d 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -248,6 +248,11 @@ case "$FIRMWARE" in caldata_extract "art" 0x5000 0x2f20 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) 1) ;; + xiaomi,aiot-ac2350) + caldata_extract "art" 0x5000 0x2f20 + ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \ + /lib/firmware/ath10k/QCA9984/hw1.0/board.bin + ;; yuncore,a782|\ yuncore,xd4200) caldata_extract "art" 0x5000 0x2f20 diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index ab875bd220..0db9987d70 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -2305,6 +2305,15 @@ define Device/winchannel_wb2000 endef TARGET_DEVICES += winchannel_wb2000 +define Device/xiaomi_aiot-ac2350 + SOC := qca9563 + DEVICE_VENDOR := Xiaomi + DEVICE_MODEL := AIoT AC2350 + DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9984-ct + IMAGE_SIZE := 14336k +endef +TARGET_DEVICES += xiaomi_aiot-ac2350 + define Device/xiaomi_mi-router-4q SOC := qca9561 DEVICE_VENDOR := Xiaomi From bb2a9af6f1f3a03617002d0b9ba361f97d68dc02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Mon, 5 Jul 2021 08:45:18 +0200 Subject: [PATCH 17/17] ath79: base-files: fix broken network config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix bash syntax error introduced in commit cce2e8db564b ("ath79: add support for TP-Link TL-WR941HP v1") which resulted in broken default network configuration. In target/linux/ath79/generic/base-files/etc/board.d/02_network line 402: tplink,tl-wr842n-v2)\ ^-- SC1073: Couldn't parse this case item. Fix to allow more checks. References: https://gitlab.com/ynezz/openwrt-device-runtime-testing/-/jobs/1398837698/artifacts/file/cram-result-archer-c7-v5-initramfs.txt Fixes: cce2e8db564b ("ath79: add support for TP-Link TL-WR941HP v1") Signed-off-by: Petr Štetiar --- target/linux/ath79/generic/base-files/etc/board.d/02_network | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index 8f547ba5ce..025d55fec0 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -399,7 +399,7 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1" "5:lan:4" ;; - tplink,tl-wr842n-v2)\ + tplink,tl-wr842n-v2|\ tplink,tl-wr941hp-v1) ucidef_set_interface_wan "eth1" ucidef_add_switch "switch0" \