Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/kernel-version.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ ifdef CONFIG_TESTING_KERNEL
endif

LINUX_VERSION-5.4 = .113
LINUX_VERSION-5.10 = .32
LINUX_VERSION-5.10 = .33

LINUX_KERNEL_HASH-5.4.113 = 30cde92463c474b75f9eb197654570dd6dbb32ec20695544c5469f292662da47
LINUX_KERNEL_HASH-5.10.32 = 644f8e326e4cb8eac65f0874774c09ccf91cbe0b55eb8438c1e8711d3d07d7ba
LINUX_KERNEL_HASH-5.10.33 = 933fdbc36371c0f830b7a6a957a559fca2dad1cc0eaa852ef42fb168185b4315

remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))
sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1)))))))
Expand Down
2 changes: 2 additions & 0 deletions package/firmware/ipq-wifi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ ALLWIFIBOARDS:= \
linksys_mr8300-v0 \
luma_wrtq-329acn \
mikrotik_hap-ac2 \
mikrotik_sxtsq-5-ac \
mobipromo_cm520-79f \
nec_wg2600hp3 \
plasmacloud_pa1200 \
Expand Down Expand Up @@ -128,6 +129,7 @@ $(eval $(call generate-ipq-wifi-package,linksys_ea8300,Linksys EA8300))
$(eval $(call generate-ipq-wifi-package,linksys_mr8300-v0,Linksys MR8300))
$(eval $(call generate-ipq-wifi-package,luma_wrtq-329acn,Luma WRTQ-329ACN))
$(eval $(call generate-ipq-wifi-package,mikrotik_hap-ac2,Mikrotik hAP ac2))
$(eval $(call generate-ipq-wifi-package,mikrotik_sxtsq-5-ac,MikroTik SXTsq 5 ac))
$(eval $(call generate-ipq-wifi-package,mobipromo_cm520-79f,MobiPromo CM520-79F))
$(eval $(call generate-ipq-wifi-package,nec_wg2600hp3,NEC Platforms WG2600HP3))
$(eval $(call generate-ipq-wifi-package,plasmacloud_pa1200,Plasma Cloud PA1200))
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
From c5d66587b8900201e1530b7c18d41e87bd5812f4 Mon Sep 17 00:00:00 2001
From: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
Date: Thu, 15 Apr 2021 17:37:48 -0700
Subject: [PATCH] net: ethernet: mediatek: ppe: fix busy wait loop

The intention is for the loop to timeout if the body does not succeed.
The current logic calls time_is_before_jiffies(timeout) which is false
until after the timeout, so the loop body never executes.

Fix by using readl_poll_timeout as a more standard and less error-prone
solution.

Fixes: ba37b7caf1ed ("net: ethernet: mtk_eth_soc: add support for initializing the PPE")
Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
Cc: Felix Fietkau <nbd@nbd.name>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
drivers/net/ethernet/mediatek/mtk_ppe.c | 20 +++++++++-----------
drivers/net/ethernet/mediatek/mtk_ppe.h | 1 +
2 files changed, 10 insertions(+), 11 deletions(-)

--- a/drivers/net/ethernet/mediatek/mtk_ppe.c
+++ b/drivers/net/ethernet/mediatek/mtk_ppe.c
@@ -2,9 +2,8 @@
/* Copyright (C) 2020 Felix Fietkau <nbd@nbd.name> */

#include <linux/kernel.h>
-#include <linux/jiffies.h>
-#include <linux/delay.h>
#include <linux/io.h>
+#include <linux/iopoll.h>
#include <linux/etherdevice.h>
#include <linux/platform_device.h>
#include "mtk_ppe.h"
@@ -44,18 +43,17 @@ static u32 ppe_clear(struct mtk_ppe *ppe

static int mtk_ppe_wait_busy(struct mtk_ppe *ppe)
{
- unsigned long timeout = jiffies + HZ;
-
- while (time_is_before_jiffies(timeout)) {
- if (!(ppe_r32(ppe, MTK_PPE_GLO_CFG) & MTK_PPE_GLO_CFG_BUSY))
- return 0;
+ int ret;
+ u32 val;

- usleep_range(10, 20);
- }
+ ret = readl_poll_timeout(ppe->base + MTK_PPE_GLO_CFG, val,
+ !(val & MTK_PPE_GLO_CFG_BUSY),
+ 20, MTK_PPE_WAIT_TIMEOUT_US);

- dev_err(ppe->dev, "PPE table busy");
+ if (ret)
+ dev_err(ppe->dev, "PPE table busy");

- return -ETIMEDOUT;
+ return ret;
}

static void mtk_ppe_cache_clear(struct mtk_ppe *ppe)
--- a/drivers/net/ethernet/mediatek/mtk_ppe.h
+++ b/drivers/net/ethernet/mediatek/mtk_ppe.h
@@ -12,6 +12,7 @@
#define MTK_PPE_ENTRIES_SHIFT 3
#define MTK_PPE_ENTRIES (1024 << MTK_PPE_ENTRIES_SHIFT)
#define MTK_PPE_HASH_MASK (MTK_PPE_ENTRIES - 1)
+#define MTK_PPE_WAIT_TIMEOUT_US 1000000

#define MTK_FOE_IB1_UNBIND_TIMESTAMP GENMASK(7, 0)
#define MTK_FOE_IB1_UNBIND_PACKETS GENMASK(23, 8)
8 changes: 8 additions & 0 deletions target/linux/ipq40xx/base-files/etc/board.d/01_leds
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ engenius,ens620ext)
ucidef_set_led_netdev "lan1" "LAN1" "green:lan1" "eth0"
ucidef_set_led_netdev "lan2" "LAN2" "green:lan2" "eth1"
;;
mikrotik,sxtsq-5-ac)
ucidef_set_rssimon "wlan0" "200000" "1"
ucidef_set_led_rssi "rssilow" "rssilow" "green:rssilow" "wlan0" "1" "100"
ucidef_set_led_rssi "rssimediumlow" "rssimediumlow" "green:rssimediumlow" "wlan0" "21" "100"
ucidef_set_led_rssi "rssimedium" "rssimedium" "green:rssimedium" "wlan0" "41" "100"
ucidef_set_led_rssi "rssimediumhigh" "rssimediumhigh" "green:rssimediumhigh" "wlan0" "61" "100"
ucidef_set_led_rssi "rssihigh" "rssihigh" "green:rssihigh" "wlan0" "81" "100"
;;
mobipromo,cm520-79f)
ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth1"
ucidef_set_led_switch "lan1" "LAN1" "blue:lan1" "switch0" "0x10"
Expand Down
5 changes: 5 additions & 0 deletions target/linux/ipq40xx/base-files/etc/board.d/02_network
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ ipq40xx_setup_interfaces()
engenius,eap1300|\
engenius,emd1|\
meraki,mr33|\
mikrotik,sxtsq-5-ac|\
netgear,ex6100v2|\
netgear,ex6150v2|\
zyxel,wre6606)
Expand Down Expand Up @@ -175,6 +176,10 @@ ipq40xx_setup_macs()
lan_mac=$(macaddr_add $wan_mac 1)
label_mac="$wan_mac"
;;
mikrotik,sxtsq-5-ac)
lan_mac=$(cat /sys/firmware/mikrotik/hard_config/mac_base)
label_mac="$lan_mac"
;;
esac

[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,8 @@ case "$FIRMWARE" in
caldata_valid "202f" || caldata_extract "ART" 0x5000 0x2f20
ath10k_patch_mac $(macaddr_add $(get_mac_binary "/sys/bus/i2c/devices/0-0050/eeprom" 0x66) +3)
;;
mikrotik,hap-ac2)
mikrotik,hap-ac2|\
mikrotik,sxtsq-5-ac)
wlan_data="/sys/firmware/mikrotik/hard_config/wlan_data"
( [ -f "$wlan_data" ] && caldata_sysfsload_from_file "$wlan_data" 0x8000 0x2f20 ) || \
( [ -d "$wlan_data" ] && caldata_sysfsload_from_file "$wlan_data/data_2" 0x0 0x2f20 )
Expand Down
3 changes: 2 additions & 1 deletion target/linux/ipq40xx/base-files/lib/upgrade/platform.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ platform_do_upgrade() {
CI_KERNPART="part.safe"
nand_do_upgrade "$1"
;;
mikrotik,hap-ac2)
mikrotik,hap-ac2|\
mikrotik,sxtsq-5-ac)
[ "$(rootfs_type)" = "tmpfs" ] && mtd erase firmware
default_do_upgrade "$1"
;;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,242 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/* Copyright (c) 2020, Robert Marko <robimarko@gmail.com> */

#include "qcom-ipq4019.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/soc/qcom,tcsr.h>

/ {
model = "MikroTik SXTsq 5 ac (RBSXTsqG-5acD)";
compatible = "mikrotik,sxtsq-5-ac";

memory {
device_type = "memory";
reg = <0x80000000 0x10000000>;
};

chosen {
stdout-path = "serial0:115200n8";
};

aliases {
led-boot = &led_user;
led-failsafe = &led_user;
led-running = &led_user;
led-upgrade = &led_user;
};

soc {
rng@22000 {
status = "okay";
};

mdio@90000 {
status = "okay";
};

counter@4a1000 {
compatible = "qcom,qca-gcnt";
reg = <0x4a1000 0x4>;
};

tcsr@1949000 {
compatible = "qcom,tcsr";
reg = <0x1949000 0x100>;
qcom,wifi_glb_cfg = <TCSR_WIFI_GLB_CFG>;
};

ess_tcsr@1953000 {
compatible = "qcom,tcsr";
reg = <0x1953000 0x1000>;
qcom,ess-interface-select = <TCSR_ESS_PSGMII>;
};

tcsr@1957000 {
compatible = "qcom,tcsr";
reg = <0x1957000 0x100>;
qcom,wifi_noc_memtype_m0_m2 = <TCSR_WIFI_NOC_MEMTYPE_M0_M2>;
};

crypto@8e3a000 {
status = "okay";
};

watchdog@b017000 {
status = "okay";
};

ess-psgmii@98000 {
status = "okay";
};

edma@c080000 {
status = "okay";
phy-mode = "rgmii";
qcom,num_gmac = <1>;
qcom,single-phy;
};
};

keys {
compatible = "gpio-keys";

reset {
label = "reset";
gpios = <&tlmm 63 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
};

leds {
compatible = "gpio-leds";

power {
label = "blue:power";
gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>;
default-state = "keep";
panic-indicator;
};

led_user: user {
label = "green:user";
gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>;
};

rssilow {
label = "green:rssilow";
gpios = <&tlmm 58 GPIO_ACTIVE_HIGH>;
};

rssimediumlow {
label = "green:rssimediumlow";
gpios = <&tlmm 1 GPIO_ACTIVE_HIGH>;
};

rssimedium {
label = "green:rssimedium";
gpios = <&tlmm 2 GPIO_ACTIVE_HIGH>;
};

rssimediumhigh {
label = "green:rssimediumhigh";
gpios = <&tlmm 4 GPIO_ACTIVE_HIGH>;
};

rssihigh {
label = "green:rssihigh";
gpios = <&tlmm 5 GPIO_ACTIVE_HIGH>;
};
};
};

&tlmm {
serial_pins: serial_pinmux {
mux {
pins = "gpio60", "gpio61";
function = "blsp_uart0";
bias-disable;
};
};

spi_0_pins: spi_0_pinmux {
pin {
function = "blsp_spi0";
pins = "gpio55", "gpio56", "gpio57";
drive-strength = <2>;
bias-disable;
};
pin_cs {
function = "gpio";
pins = "gpio54";
drive-strength = <2>;
bias-disable;
output-high;
};
};
};

&blsp_dma {
status = "okay";
};

&blsp1_spi1 {
status = "okay";

pinctrl-0 = <&spi_0_pins>;
pinctrl-names = "default";
cs-gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>;

flash@0 {
reg = <0>;
compatible = "jedec,spi-nor";
spi-max-frequency = <40000000>;

partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

partition@0 {
label = "Qualcomm";
reg = <0x0 0x80000>;
read-only;
};

partition@80000 {
compatible = "mikrotik,routerboot-partitions";
#address-cells = <1>;
#size-cells = <1>;
label = "RouterBoot";
reg = <0x80000 0x80000>;
read-only;

hard_config {
read-only;
};

dtb_config {
read-only;
};

soft_config {
};
};

partition@100000 {
compatible = "mikrotik,minor";
label = "firmware";
reg = <0x100000 0xf00000>;
};
};
};
};

&blsp1_uart1 {
status = "okay";

pinctrl-0 = <&serial_pins>;
pinctrl-names = "default";
};

&cryptobam {
status = "okay";
};

&wifi1 {
status = "okay";

qcom,ath10k-calibration-variant = "MikroTik-SXTsq-5-ac";
};

&gmac0 {
qcom,phy_mdio_addr = <4>;
qcom,poll_required = <1>;
qcom,forced_speed = <1000>;
qcom,forced_duplex = <1>;
vlan_tag = <1 0x20>;
};

&mdio {
status = "okay";
};
Loading