Merge Official Source

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
Tianling Shen 2022-09-10 10:03:30 +08:00
commit 8dd2b6230d
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
73 changed files with 874 additions and 131 deletions

View File

@ -1,2 +1,2 @@
LINUX_VERSION-5.15 = .64
LINUX_KERNEL_HASH-5.15.64 = c6a1d38c6fa3798341372d5cf0088ae806ccdc827e31ecbff8988e097ba5de50
LINUX_VERSION-5.15 = .67
LINUX_KERNEL_HASH-5.15.67 = da47d9a80b694548835ccb553b6eb1a1f3f5d5cddd9e2bd6f4886b99ca14f940

View File

@ -50,3 +50,21 @@ define Package/mt7622bt-firmware/install
$(1)/lib/firmware/mediatek
endef
$(eval $(call BuildPackage,mt7622bt-firmware))
Package/mt7921bt-firmware = $(call Package/firmware-default,mt7921bt firmware)
define Package/mt7921bt-firmware/install
$(INSTALL_DIR) $(1)/lib/firmware/mediatek
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/mediatek/BT_RAM_CODE_MT7961_1_2_hdr.bin \
$(1)/lib/firmware/mediatek
endef
$(eval $(call BuildPackage,mt7921bt-firmware))
Package/mt7922bt-firmware = $(call Package/firmware-default,mt7922bt firmware)
define Package/mt7922bt-firmware/install
$(INSTALL_DIR) $(1)/lib/firmware/mediatek
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/mediatek/BT_RAM_CODE_MT7922_1_1_hdr.bin \
$(1)/lib/firmware/mediatek
endef
$(eval $(call BuildPackage,mt7922bt-firmware))

View File

@ -40,6 +40,8 @@ define KernelPackage/bluetooth
CONFIG_BT_BNEP \
CONFIG_BT_HCIBTUSB \
CONFIG_BT_HCIBTUSB_BCM=n \
CONFIG_BT_HCIBTUSB_MTK=y \
CONFIG_BT_HCIBTUSB_RTL=n \
CONFIG_BT_HCIUART \
CONFIG_BT_HCIUART_BCM=n \
CONFIG_BT_HCIUART_INTEL=n \

View File

@ -0,0 +1,275 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
// Copyright (c) 2021 Cezary Jackiewicz
// Copyright (c) 2021, 2022 Lech Perczak
// Copyright (c) 2022 David Bauer <mail@david-bauer.net>
#include "qca956x.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>
/ {
model = "ZTE MF281";
compatible = "zte,mf281", "qca,qca9563";
aliases {
led-boot = &led_debug;
led-failsafe = &led_debug;
led-running = &led_debug;
led-upgrade = &led_debug;
label-mac-device = &eth0;
};
leds {
compatible = "gpio-leds";
pinctrl-names = "default";
pinctrl-0 = <&enable_wlan_led_gpio>;
/* Hidden SMD LED below signal strength LEDs.
* Visible through slits underside of the case.
*/
led_debug: debug {
label = "green:debug";
gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
default-state = "on";
};
};
keys {
compatible = "gpio-keys";
reset {
label = "reset";
linux,code = <KEY_RESTART>;
gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
debounce-interval = <60>;
};
wps {
label = "wps";
linux,code = <KEY_WPS_BUTTON>;
gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
debounce-interval = <60>;
};
};
/* This GPIO is used to reset whole board _including_ the modem */
gpio-restart {
compatible = "gpio-restart";
gpios = <&gpio 5 GPIO_ACTIVE_HIGH>;
active-delay = <3000>;
inactive-delay = <1000>;
};
};
&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 = "u-boot";
reg = <0x0 0xa0000>;
read-only;
};
partition@80000 {
label = "u-boot-env";
reg = <0xa0000 0x20000>;
read-only;
};
};
};
flash@1 {
compatible = "spi-nand";
reg = <1>;
spi-max-frequency = <25000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "fota-flag";
reg = <0x000000 0xa0000>;
read-only;
};
partition@a0000 {
label = "art";
reg = <0xa0000 0x80000>;
read-only;
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;
cal_caldata_1000: cal@1000 {
reg = <0x1000 0x440>;
};
cal_caldata_5000: cal@5000 {
reg = <0x5000 0x2f20>;
};
};
partition@120000 {
label = "mac";
reg = <0x120000 0x80000>;
read-only;
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;
macaddr_mac_0: macaddr@0 {
reg = <0x0 0x6>;
};
};
partition@1a0000 {
label = "reserved2";
reg = <0x1a0000 0xc0000>;
read-only;
};
partition@260000 {
label = "cfg-param";
reg = <0x260000 0x400000>;
read-only;
};
partition@660000 {
label = "log";
reg = <0x660000 0x400000>;
read-only;
};
partition@a60000 {
label = "oops";
reg = <0xa60000 0xa0000>;
read-only;
};
partition@b00000 {
label = "reserved3";
reg = <0xb00000 0x500000>;
read-only;
};
partition@1000000 {
label = "web";
reg = <0x1000000 0x800000>;
read-only;
};
partition@1800000 {
label = "firmware";
reg = <0x1800000 0x1d00000>;
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "kernel";
reg = <0x0 0x600000>;
};
partition@600000 {
label = "ubi";
reg = <0x600000 0x1700000>;
};
};
partition@3500000 {
label = "data";
reg = <0x3500000 0x1900000>;
read-only;
};
partition@4e00000 {
label = "fota";
reg = <0x4e00000 0x3200000>;
read-only;
};
};
};
};
&mdio0 {
status = "okay";
phy0: ethernet-phy@0 {
reg = <0>;
phy-mode = "sgmii";
qca,ar8327-initvals = <
0x04 0x00080080 /* PORT0 PAD MODE CTRL */
0x7c 0x0000007e /* PORT0_STATUS */
>;
};
};
&eth0 {
status = "okay";
phy-mode = "sgmii";
phy-handle = <&phy0>;
nvmem-cells = <&macaddr_mac_0>;
nvmem-cell-names = "mac-address";
};
&pcie {
status = "okay";
wifi@0,0 {
compatible = "qcom,ath10k";
reg = <0x0 0 0 0 0>;
nvmem-cells = <&macaddr_mac_0>, <&cal_caldata_5000>;
nvmem-cell-names = "mac-address", "pre-calibration";
mac-address-increment = <1>;
};
};
&pinmux {
enable_wlan_led_gpio: pinmux_wlan_led_gpio {
pinctrl-single,bits = <0x10 0x0 0xff000000>;
};
};
&wmac {
status = "okay";
nvmem-cells = <&macaddr_mac_0>, <&cal_caldata_1000>;
nvmem-cell-names = "mac-address", "calibration";
};
&usb_phy0 {
status = "okay";
};
&usb0 {
status = "okay";
};
&usb_phy1 {
status = "okay";
};
&usb1 {
status = "okay";
};

View File

@ -322,7 +322,7 @@ define Device/netgear_wndr4500-v3
endef
TARGET_DEVICES += netgear_wndr4500-v3
define Device/zte_mf286_common
define Device/zte_mf28x_common
SOC := qca9563
DEVICE_VENDOR := ZTE
DEVICE_PACKAGES := kmod-usb2 kmod-ath10k-ct
@ -332,8 +332,21 @@ define Device/zte_mf286_common
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
endef
define Device/zte_mf281
$(Device/zte_mf28x_common)
DEVICE_MODEL := MF281
KERNEL_SIZE := 6144k
IMAGE_SIZE := 29696k
IMAGES += factory.bin
IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | \
check-size
DEVICE_PACKAGES += ath10k-firmware-qca9888-ct kmod-usb-net-rndis \
kmod-usb-acm comgt-ncm
endef
TARGET_DEVICES += zte_mf281
define Device/zte_mf286
$(Device/zte_mf286_common)
$(Device/zte_mf28x_common)
DEVICE_MODEL := MF286
DEVICE_PACKAGES += ath10k-firmware-qca988x-ct kmod-usb-net-qmi-wwan \
kmod-usb-serial-option uqmi
@ -341,7 +354,7 @@ endef
TARGET_DEVICES += zte_mf286
define Device/zte_mf286a
$(Device/zte_mf286_common)
$(Device/zte_mf28x_common)
DEVICE_MODEL := MF286A
DEVICE_PACKAGES += ath10k-firmware-qca9888-ct kmod-usb-net-qmi-wwan \
kmod-usb-serial-option uqmi
@ -349,7 +362,7 @@ endef
TARGET_DEVICES += zte_mf286a
define Device/zte_mf286r
$(Device/zte_mf286_common)
$(Device/zte_mf28x_common)
DEVICE_MODEL := MF286R
DEVICE_PACKAGES += ath10k-firmware-qca9888-ct kmod-usb-net-rndis kmod-usb-acm \
comgt-ncm

View File

@ -53,6 +53,10 @@ ath79_setup_interfaces()
ucidef_add_switch "switch0" \
"0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
;;
zte,mf281)
ucidef_add_switch "switch0" \
"0@eth0" "5:lan"
;;
zte,mf286|\
zte,mf286a|\
zte,mf286r)

View File

@ -20,7 +20,7 @@ Link: https://lore.kernel.org/r/20211025152903.1088803-9-maxime@cerno.tech
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
@@ -2386,7 +2386,7 @@ static const struct vc4_hdmi_variant bcm
@@ -2385,7 +2385,7 @@ static const struct vc4_hdmi_variant bcm
.encoder_type = VC4_ENCODER_TYPE_HDMI0,
.debugfs_name = "hdmi0_regs",
.card_name = "vc4-hdmi-0",

View File

@ -14,7 +14,12 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
--- a/drivers/gpu/drm/vc4/Kconfig
+++ b/drivers/gpu/drm/vc4/Kconfig
@@ -9,6 +9,7 @@ config DRM_VC4
@@ -5,11 +5,11 @@ config DRM_VC4
depends on DRM
depends on SND && SND_SOC
depends on COMMON_CLK
- depends on PM
select DRM_KMS_HELPER
select DRM_KMS_CMA_HELPER
select DRM_GEM_CMA_HELPER
select DRM_PANEL_BRIDGE

View File

@ -70,7 +70,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
* @dev: the device whose endpoint is being disabled
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -1840,6 +1840,8 @@ extern int usb_clear_halt(struct usb_dev
@@ -1842,6 +1842,8 @@ extern int usb_clear_halt(struct usb_dev
extern int usb_reset_configuration(struct usb_device *dev);
extern int usb_set_interface(struct usb_device *dev, int ifnum, int alternate);
extern void usb_reset_endpoint(struct usb_device *dev, unsigned int epaddr);

View File

@ -15,7 +15,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -1620,6 +1620,109 @@ command_cleanup:
@@ -1611,6 +1611,109 @@ command_cleanup:
}
/*
@ -125,7 +125,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
* non-error returns are a promise to giveback() the urb later
* we drop ownership so next owner (or urb unlink) can get it
*/
@@ -5445,6 +5548,7 @@ static const struct hc_driver xhci_hc_dr
@@ -5436,6 +5539,7 @@ static const struct hc_driver xhci_hc_dr
.endpoint_reset = xhci_endpoint_reset,
.check_bandwidth = xhci_check_bandwidth,
.reset_bandwidth = xhci_reset_bandwidth,

View File

@ -33,7 +33,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
#define USB_VENDOR_ID_BELKIN 0x050d
#define USB_DEVICE_ID_FLIP_KVM 0x3201
@@ -1307,6 +1310,9 @@
@@ -1308,6 +1311,9 @@
#define USB_VENDOR_ID_XAT 0x2505
#define USB_DEVICE_ID_XAT_CSR 0x0220

View File

@ -10,7 +10,7 @@ Signed-off-by: Dom Cobley <popcornmix@gmail.com>
--- a/drivers/clk/bcm/clk-raspberrypi.c
+++ b/drivers/clk/bcm/clk-raspberrypi.c
@@ -271,6 +271,7 @@ static int raspberrypi_discover_clocks(s
@@ -276,6 +276,7 @@ static int raspberrypi_discover_clocks(s
case RPI_FIRMWARE_CORE_CLK_ID:
case RPI_FIRMWARE_M2MC_CLK_ID:
case RPI_FIRMWARE_V3D_CLK_ID:

View File

@ -17,7 +17,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -1347,6 +1347,8 @@ static int clk_core_determine_round_nolo
@@ -1346,6 +1346,8 @@ static int clk_core_determine_round_nolo
if (!core)
return 0;

View File

@ -16,7 +16,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -1923,6 +1923,8 @@ static const struct usb_audio_quirk_flag
@@ -1925,6 +1925,8 @@ static const struct usb_audio_quirk_flag
QUIRK_FLAG_GENERIC_IMPLICIT_FB),
DEVICE_FLG(0x2b53, 0x0031, /* Fiero SC-01 (firmware v1.1.0) */
QUIRK_FLAG_GENERIC_IMPLICIT_FB),

View File

@ -26,7 +26,7 @@ Signed-off-by: Dom Cobley <popcornmix@gmail.com>
};
#define RPI_FIRMWARE_STATE_ENABLE_BIT BIT(0)
@@ -273,6 +275,7 @@ static int raspberrypi_discover_clocks(s
@@ -278,6 +280,7 @@ static int raspberrypi_discover_clocks(s
case RPI_FIRMWARE_V3D_CLK_ID:
case RPI_FIRMWARE_HEVC_CLK_ID:
case RPI_FIRMWARE_PIXEL_BVB_CLK_ID:

View File

@ -55,7 +55,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
/* HDMI audio codec callbacks */
static void vc4_hdmi_audio_set_mai_clock(struct vc4_hdmi *vc4_hdmi,
unsigned int samplerate)
@@ -2777,6 +2783,7 @@ static const struct vc4_hdmi_variant bcm
@@ -2776,6 +2782,7 @@ static const struct vc4_hdmi_variant bcm
.phy_rng_disable = vc5_hdmi_phy_rng_disable,
.channel_map = vc5_hdmi_channel_map,
.supports_hdr = true,
@ -63,7 +63,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
};
static const struct vc4_hdmi_variant bcm2711_hdmi1_variant = {
@@ -2805,6 +2812,7 @@ static const struct vc4_hdmi_variant bcm
@@ -2804,6 +2811,7 @@ static const struct vc4_hdmi_variant bcm
.phy_rng_disable = vc5_hdmi_phy_rng_disable,
.channel_map = vc5_hdmi_channel_map,
.supports_hdr = true,

View File

@ -103,30 +103,6 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
return 0;
}
@@ -2615,20 +2641,11 @@ static int vc4_hdmi_bind(struct device *
if (ret)
goto err_put_ddc;
- /*
- * We need to have the device powered up at this point to call
- * our reset hook and for the CEC init.
- */
- ret = vc4_hdmi_runtime_resume(dev);
- if (ret)
- goto err_put_ddc;
-
- pm_runtime_get_noresume(dev);
- pm_runtime_set_active(dev);
pm_runtime_enable(dev);
- if (vc4_hdmi->variant->reset)
- vc4_hdmi->variant->reset(vc4_hdmi);
+ ret = pm_runtime_resume_and_get(dev);
+ if (ret)
+ goto err_put_ddc;
if ((of_device_is_compatible(dev->of_node, "brcm,bcm2711-hdmi0") ||
of_device_is_compatible(dev->of_node, "brcm,bcm2711-hdmi1")) &&
--- a/drivers/gpu/drm/vc4/vc4_hdmi_regs.h
+++ b/drivers/gpu/drm/vc4/vc4_hdmi_regs.h
@@ -417,7 +417,7 @@ static inline u32 vc4_hdmi_read(struct v

View File

@ -16,7 +16,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
--- a/drivers/clk/bcm/clk-raspberrypi.c
+++ b/drivers/clk/bcm/clk-raspberrypi.c
@@ -276,6 +276,7 @@ static int raspberrypi_discover_clocks(s
@@ -281,6 +281,7 @@ static int raspberrypi_discover_clocks(s
case RPI_FIRMWARE_HEVC_CLK_ID:
case RPI_FIRMWARE_PIXEL_BVB_CLK_ID:
case RPI_FIRMWARE_VEC_CLK_ID:

View File

@ -226,7 +226,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
}
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -879,8 +879,8 @@ static void xhci_clear_command_ring(stru
@@ -870,8 +870,8 @@ static void xhci_clear_command_ring(stru
seg = ring->deq_seg;
do {
memset(seg->trbs, 0,
@ -237,7 +237,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
cpu_to_le32(~TRB_CYCLE);
seg = seg->next;
} while (seg != ring->deq_seg);
@@ -891,7 +891,7 @@ static void xhci_clear_command_ring(stru
@@ -882,7 +882,7 @@ static void xhci_clear_command_ring(stru
ring->enq_seg = ring->deq_seg;
ring->enqueue = ring->dequeue;

View File

@ -18,7 +18,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -2387,11 +2387,7 @@ int clk_set_rate_range(struct clk *clk,
@@ -2386,11 +2386,7 @@ int clk_set_rate_range(struct clk *clk,
* this corner case when determining the rate
*/

View File

@ -30,7 +30,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -2372,28 +2372,29 @@ int clk_set_rate_range(struct clk *clk,
@@ -2371,28 +2371,29 @@ int clk_set_rate_range(struct clk *clk,
goto out;
}

View File

@ -29,7 +29,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -2331,19 +2331,15 @@ int clk_set_rate_exclusive(struct clk *c
@@ -2330,19 +2330,15 @@ int clk_set_rate_exclusive(struct clk *c
}
EXPORT_SYMBOL_GPL(clk_set_rate_exclusive);
@ -54,7 +54,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
if (!clk)
return 0;
@@ -2356,8 +2352,6 @@ int clk_set_rate_range(struct clk *clk,
@@ -2355,8 +2351,6 @@ int clk_set_rate_range(struct clk *clk,
return -EINVAL;
}
@ -63,7 +63,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
if (clk->exclusive_count)
clk_core_rate_unprotect(clk->core);
@@ -2401,6 +2395,28 @@ out:
@@ -2400,6 +2394,28 @@ out:
if (clk->exclusive_count)
clk_core_rate_protect(clk->core);
@ -92,7 +92,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
clk_prepare_unlock();
return ret;
@@ -4360,9 +4376,10 @@ void __clk_put(struct clk *clk)
@@ -4359,9 +4375,10 @@ void __clk_put(struct clk *clk)
}
hlist_del(&clk->clks_node);

View File

@ -22,7 +22,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -2366,6 +2366,10 @@ static int clk_set_rate_range_nolock(str
@@ -2365,6 +2365,10 @@ static int clk_set_rate_range_nolock(str
goto out;
}
@ -33,7 +33,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
/*
* Since the boundaries have been changed, let's give the
* opportunity to the provider to adjust the clock rate based on
@@ -2383,7 +2387,7 @@ static int clk_set_rate_range_nolock(str
@@ -2382,7 +2386,7 @@ static int clk_set_rate_range_nolock(str
* - the determine_rate() callback does not really check for
* this corner case when determining the rate
*/

View File

@ -23,7 +23,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -1758,6 +1758,23 @@ static void clk_core_update_orphan_statu
@@ -1757,6 +1757,23 @@ static void clk_core_update_orphan_statu
clk_core_update_orphan_status(child, is_orphan);
}
@ -47,7 +47,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
static void clk_reparent(struct clk_core *core, struct clk_core *new_parent)
{
bool was_orphan = core->orphan;
@@ -1782,6 +1799,7 @@ static void clk_reparent(struct clk_core
@@ -1781,6 +1798,7 @@ static void clk_reparent(struct clk_core
}
core->parent = new_parent;

View File

@ -25,7 +25,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -2388,6 +2388,12 @@ static int clk_set_rate_range_nolock(str
@@ -2387,6 +2387,12 @@ static int clk_set_rate_range_nolock(str
if (clk->core->flags & CLK_GET_RATE_NOCACHE)
rate = clk_core_get_rate_recalc(clk->core);

View File

@ -26,7 +26,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -1381,6 +1381,8 @@ static void clk_core_init_rate_req(struc
@@ -1380,6 +1380,8 @@ static void clk_core_init_rate_req(struc
if (WARN_ON(!core || !req))
return;
@ -35,7 +35,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
parent = core->parent;
if (parent) {
req->best_parent_hw = parent->hw;
@@ -1455,7 +1457,6 @@ unsigned long clk_hw_round_rate(struct c
@@ -1454,7 +1456,6 @@ unsigned long clk_hw_round_rate(struct c
int ret;
struct clk_rate_request req;
@ -43,7 +43,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
req.rate = rate;
ret = clk_core_round_rate_nolock(hw->core, &req);
@@ -1488,7 +1489,6 @@ long clk_round_rate(struct clk *clk, uns
@@ -1487,7 +1488,6 @@ long clk_round_rate(struct clk *clk, uns
if (clk->exclusive_count)
clk_core_rate_unprotect(clk->core);
@ -51,7 +51,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
req.rate = rate;
ret = clk_core_round_rate_nolock(clk->core, &req);
@@ -1995,8 +1995,6 @@ static struct clk_core *clk_calc_new_rat
@@ -1994,8 +1994,6 @@ static struct clk_core *clk_calc_new_rat
struct clk_rate_request req;
req.rate = rate;

View File

@ -19,7 +19,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -1374,13 +1374,15 @@ static int clk_core_determine_round_nolo
@@ -1373,13 +1373,15 @@ static int clk_core_determine_round_nolo
}
static void clk_core_init_rate_req(struct clk_core * const core,
@ -36,7 +36,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
clk_core_get_boundaries(core, &req->min_rate, &req->max_rate);
parent = core->parent;
@@ -1408,7 +1410,7 @@ static int clk_core_round_rate_nolock(st
@@ -1407,7 +1409,7 @@ static int clk_core_round_rate_nolock(st
return 0;
}
@ -45,7 +45,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
if (clk_core_can_round(core))
return clk_core_determine_round_nolock(core, req);
@@ -1994,9 +1996,7 @@ static struct clk_core *clk_calc_new_rat
@@ -1993,9 +1995,7 @@ static struct clk_core *clk_calc_new_rat
if (clk_core_can_round(core)) {
struct clk_rate_request req;

View File

@ -22,7 +22,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -1395,6 +1395,26 @@ static void clk_core_init_rate_req(struc
@@ -1394,6 +1394,26 @@ static void clk_core_init_rate_req(struc
}
}

View File

@ -19,7 +19,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -1479,7 +1479,7 @@ unsigned long clk_hw_round_rate(struct c
@@ -1478,7 +1478,7 @@ unsigned long clk_hw_round_rate(struct c
int ret;
struct clk_rate_request req;
@ -28,7 +28,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
ret = clk_core_round_rate_nolock(hw->core, &req);
if (ret)
@@ -1511,7 +1511,7 @@ long clk_round_rate(struct clk *clk, uns
@@ -1510,7 +1510,7 @@ long clk_round_rate(struct clk *clk, uns
if (clk->exclusive_count)
clk_core_rate_unprotect(clk->core);
@ -37,7 +37,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
ret = clk_core_round_rate_nolock(clk->core, &req);
@@ -2215,8 +2215,7 @@ static unsigned long clk_core_req_round_
@@ -2214,8 +2214,7 @@ static unsigned long clk_core_req_round_
if (cnt < 0)
return cnt;

View File

@ -23,7 +23,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -1430,8 +1430,6 @@ static int clk_core_round_rate_nolock(st
@@ -1429,8 +1429,6 @@ static int clk_core_round_rate_nolock(st
return 0;
}

View File

@ -47,7 +47,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
int clk_mux_determine_rate_flags(struct clk_hw *hw,
struct clk_rate_request *req,
unsigned long flags)
@@ -2569,25 +2589,11 @@ void clk_hw_reparent(struct clk_hw *hw,
@@ -2568,25 +2588,11 @@ void clk_hw_reparent(struct clk_hw *hw,
*/
bool clk_has_parent(struct clk *clk, struct clk *parent)
{

View File

@ -126,7 +126,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
}
}
@@ -1450,6 +1480,8 @@ static bool clk_core_can_round(struct cl
@@ -1449,6 +1479,8 @@ static bool clk_core_can_round(struct cl
static int clk_core_round_rate_nolock(struct clk_core *core,
struct clk_rate_request *req)
{
@ -135,7 +135,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
lockdep_assert_held(&prepare_lock);
if (!core) {
@@ -1459,8 +1491,20 @@ static int clk_core_round_rate_nolock(st
@@ -1458,8 +1490,20 @@ static int clk_core_round_rate_nolock(st
if (clk_core_can_round(core))
return clk_core_determine_round_nolock(core, req);

View File

@ -17,7 +17,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -1439,6 +1439,8 @@ static void clk_core_init_rate_req(struc
@@ -1438,6 +1438,8 @@ static void clk_core_init_rate_req(struc
if (WARN_ON(!core || !req))
return;

View File

@ -105,7 +105,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
if (ret) {
dev_err(rpi->dev, "Failed to initialize clkdev\n");
return ERR_PTR(ret);
@@ -266,30 +305,27 @@ static int raspberrypi_discover_clocks(s
@@ -271,30 +310,27 @@ static int raspberrypi_discover_clocks(s
return ret;
while (clks->id) {

View File

@ -28,7 +28,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -2576,6 +2576,24 @@ int clk_set_max_rate(struct clk *clk, un
@@ -2575,6 +2575,24 @@ int clk_set_max_rate(struct clk *clk, un
EXPORT_SYMBOL_GPL(clk_set_max_rate);
/**

View File

@ -13,7 +13,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -2589,7 +2589,9 @@ void clk_get_rate_range(struct clk *clk,
@@ -2588,7 +2588,9 @@ void clk_get_rate_range(struct clk *clk,
if (!clk || !min || !max)
return;

View File

@ -40,7 +40,7 @@ it on BCM4708 family.
/* called during probe() after chip reset completes */
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -155,6 +155,49 @@ int xhci_start(struct xhci_hcd *xhci)
@@ -157,6 +157,49 @@ int xhci_start(struct xhci_hcd *xhci)
return ret;
}
@ -90,7 +90,7 @@ it on BCM4708 family.
/*
* Reset a halted HC.
*
@@ -605,10 +648,20 @@ static int xhci_init(struct usb_hcd *hcd
@@ -607,10 +650,20 @@ static int xhci_init(struct usb_hcd *hcd
static int xhci_run_finished(struct xhci_hcd *xhci)
{
@ -114,7 +114,7 @@ it on BCM4708 family.
xhci->shared_hcd->state = HC_STATE_RUNNING;
xhci->cmd_ring_state = CMD_RING_STATE_RUNNING;
@@ -618,6 +671,10 @@ static int xhci_run_finished(struct xhci
@@ -620,6 +673,10 @@ static int xhci_run_finished(struct xhci
xhci_dbg_trace(xhci, trace_xhci_dbg_init,
"Finished xhci_run for USB3 roothub");
return 0;

View File

@ -60,7 +60,7 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
if (is531x5(dev) && phy_interface_is_rgmii(phydev)) {
if (port == dev->imp_port)
off = B53_RGMII_CTRL_IMP;
@@ -1421,6 +1454,9 @@ void b53_phylink_mac_link_up(struct dsa_
@@ -1419,6 +1452,9 @@ void b53_phylink_mac_link_up(struct dsa_
{
struct b53_device *dev = ds->priv;

View File

@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/Makefile
+++ b/Makefile
@@ -523,7 +523,7 @@ KBUILD_LDFLAGS_MODULE :=
@@ -525,7 +525,7 @@ KBUILD_LDFLAGS_MODULE :=
KBUILD_LDFLAGS :=
CLANG_FLAGS :=

View File

@ -530,7 +530,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static int
--- a/drivers/net/dsa/xrs700x/xrs700x.c
+++ b/drivers/net/dsa/xrs700x/xrs700x.c
@@ -456,7 +456,7 @@ static void xrs700x_phylink_validate(str
@@ -457,7 +457,7 @@ static void xrs700x_phylink_validate(str
phylink_set(mask, 1000baseT_Full);
break;
default:
@ -539,7 +539,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
dev_err(ds->dev, "Unsupported port: %i\n", port);
return;
}
@@ -467,10 +467,8 @@ static void xrs700x_phylink_validate(str
@@ -468,10 +468,8 @@ static void xrs700x_phylink_validate(str
phylink_set(mask, 10baseT_Full);
phylink_set(mask, 100baseT_Full);

View File

@ -0,0 +1,51 @@
From 5cb03751455c299b1bf10cb48631bf359cfb11b5 Mon Sep 17 00:00:00 2001
From: "mark-yw.chen" <mark-yw.chen@mediatek.com>
Date: Wed, 1 Sep 2021 11:32:25 +0800
Subject: [PATCH 1/5] Bluetooth: btusb: Support public address configuration
for MediaTek Chip.
The MediaTek chip support vendor specific HCI command(0xfc1a) to
change the public address. Add hdev->set_bdaddr handler for MediaTek
Chip. After doing a power cycle or MediaTek Bluetooth reset, BD_ADDR
will bring back the original one.
Signed-off-by: mark-yw.chen <mark-yw.chen@mediatek.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
---
drivers/bluetooth/btusb.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -2263,6 +2263,23 @@ struct btmtk_section_map {
};
} __packed;
+static int btusb_set_bdaddr_mtk(struct hci_dev *hdev, const bdaddr_t *bdaddr)
+{
+ struct sk_buff *skb;
+ long ret;
+
+ skb = __hci_cmd_sync(hdev, 0xfc1a, sizeof(bdaddr), bdaddr, HCI_INIT_TIMEOUT);
+ if (IS_ERR(skb)) {
+ ret = PTR_ERR(skb);
+ bt_dev_err(hdev, "changing Mediatek device address failed (%ld)",
+ ret);
+ return ret;
+ }
+ kfree_skb(skb);
+
+ return 0;
+}
+
static void btusb_mtk_wmt_recv(struct urb *urb)
{
struct hci_dev *hdev = urb->context;
@@ -3900,6 +3917,7 @@ static int btusb_probe(struct usb_interf
hdev->shutdown = btusb_mtk_shutdown;
hdev->manufacturer = 70;
hdev->cmd_timeout = btusb_mtk_cmd_timeout;
+ hdev->set_bdaddr = btusb_set_bdaddr_mtk;
set_bit(HCI_QUIRK_NON_PERSISTENT_SETUP, &hdev->quirks);
data->recv_acl = btusb_recv_acl_mtk;
}

View File

@ -0,0 +1,29 @@
From af774a731f7b4c2a90a8476cd44045ba8d1263ba Mon Sep 17 00:00:00 2001
From: David Yang <davidcomponentone@gmail.com>
Date: Wed, 13 Oct 2021 08:56:33 +0800
Subject: [PATCH 2/5] Bluetooth: btusb: Fix application of sizeof to pointer
The coccinelle check report:
"./drivers/bluetooth/btusb.c:2239:36-42:
ERROR: application of sizeof to pointer".
Using the real size to fix it.
Fixes: 5a87679ffd443 ("Bluetooth: btusb: Support public address configuration for MediaTek Chip.")
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: David Yang <davidcomponentone@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
---
drivers/bluetooth/btusb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -2268,7 +2268,7 @@ static int btusb_set_bdaddr_mtk(struct h
struct sk_buff *skb;
long ret;
- skb = __hci_cmd_sync(hdev, 0xfc1a, sizeof(bdaddr), bdaddr, HCI_INIT_TIMEOUT);
+ skb = __hci_cmd_sync(hdev, 0xfc1a, 6, bdaddr, HCI_INIT_TIMEOUT);
if (IS_ERR(skb)) {
ret = PTR_ERR(skb);
bt_dev_err(hdev, "changing Mediatek device address failed (%ld)",

View File

@ -0,0 +1,70 @@
From e57186fc02cedff191c469a26cce615371e41740 Mon Sep 17 00:00:00 2001
From: Yake Yang <yake.yang@mediatek.com>
Date: Wed, 23 Feb 2022 07:55:59 +0800
Subject: [PATCH 3/5] Bluetooth: btusb: Add a new PID/VID 13d3/3567 for MT7921
Add VID 13D3 & PID 3567 for MediaTek MT7921 USB Bluetooth chip.
The information in /sys/kernel/debug/usb/devices about the Bluetooth
device is listed as the below.
T: Bus=05 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=480 MxCh= 0
D: Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1
P: Vendor=13d3 ProdID=3567 Rev= 1.00
S: Manufacturer=MediaTek Inc.
S: Product=Wireless_Device
S: SerialNumber=000000000
C:* #Ifs= 3 Cfg#= 1 Atr=e0 MxPwr=100mA
A: FirstIf#= 0 IfCount= 3 Cls=e0(wlcon) Sub=01 Prot=01
I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=125us
E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms
I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms
I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms
I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms
I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms
I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms
I: If#= 1 Alt= 6 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 63 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 63 Ivl=1ms
I:* If#= 2 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none)
E: Ad=8a(I) Atr=03(Int.) MxPS= 64 Ivl=125us
E: Ad=0a(O) Atr=03(Int.) MxPS= 64 Ivl=125us
I: If#= 2 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none)
E: Ad=8a(I) Atr=03(Int.) MxPS= 64 Ivl=125us
E: Ad=0a(O) Atr=03(Int.) MxPS= 64 Ivl=125us
Co-developed-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Yake Yang <yake.yang@mediatek.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
---
drivers/bluetooth/btusb.c | 3 +++
1 file changed, 3 insertions(+)
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -460,6 +460,9 @@ static const struct usb_device_id blackl
{ USB_DEVICE(0x13d3, 0x3564), .driver_info = BTUSB_MEDIATEK |
BTUSB_WIDEBAND_SPEECH |
BTUSB_VALID_LE_STATES },
+ { USB_DEVICE(0x13d3, 0x3567), .driver_info = BTUSB_MEDIATEK |
+ BTUSB_WIDEBAND_SPEECH |
+ BTUSB_VALID_LE_STATES },
{ USB_DEVICE(0x0489, 0xe0cd), .driver_info = BTUSB_MEDIATEK |
BTUSB_WIDEBAND_SPEECH |
BTUSB_VALID_LE_STATES },

View File

@ -0,0 +1,68 @@
From e507366cd1e8e1d4eebe537c08fd142cf0b617fa Mon Sep 17 00:00:00 2001
From: Sean Wang <sean.wang@mediatek.com>
Date: Thu, 28 Apr 2022 02:38:39 +0800
Subject: [PATCH 4/5] Bluetooth: btusb: Add a new PID/VID 0489/e0c8 for MT7921
Add VID 0489 & PID e0c8 for MediaTek MT7921 USB Bluetooth chip.
The information in /sys/kernel/debug/usb/devices about the Bluetooth
device is listed as the below.
T: Bus=01 Lev=01 Prnt=01 Port=13 Cnt=03 Dev#= 4 Spd=480 MxCh= 0
D: Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1
P: Vendor=0489 ProdID=e0c8 Rev= 1.00
S: Manufacturer=MediaTek Inc.
S: Product=Wireless_Device
S: SerialNumber=000000000
C:* #Ifs= 3 Cfg#= 1 Atr=e0 MxPwr=100mA
A: FirstIf#= 0 IfCount= 3 Cls=e0(wlcon) Sub=01 Prot=01
I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=125us
E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms
I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms
I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms
I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms
I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms
I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms
I: If#= 1 Alt= 6 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 63 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 63 Ivl=1ms
I:* If#= 2 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none)
E: Ad=8a(I) Atr=03(Int.) MxPS= 64 Ivl=125us
E: Ad=0a(O) Atr=03(Int.) MxPS= 64 Ivl=125us
I: If#= 2 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none)
E: Ad=8a(I) Atr=03(Int.) MxPS= 512 Ivl=125us
E: Ad=0a(O) Atr=03(Int.) MxPS= 512 Ivl=125us
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
---
drivers/bluetooth/btusb.c | 3 +++
1 file changed, 3 insertions(+)
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -451,6 +451,9 @@ static const struct usb_device_id blackl
BTUSB_VALID_LE_STATES },
/* Additional MediaTek MT7921 Bluetooth devices */
+ { USB_DEVICE(0x0489, 0xe0c8), .driver_info = BTUSB_MEDIATEK |
+ BTUSB_WIDEBAND_SPEECH |
+ BTUSB_VALID_LE_STATES },
{ USB_DEVICE(0x04ca, 0x3802), .driver_info = BTUSB_MEDIATEK |
BTUSB_WIDEBAND_SPEECH |
BTUSB_VALID_LE_STATES },

View File

@ -337,6 +337,7 @@ CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8
# CONFIG_ARM64_ERRATUM_843419 is not set
# CONFIG_ARM64_ERRATUM_845719 is not set
# CONFIG_ARM64_ERRATUM_858921 is not set
# CONFIG_ARM64_ERRATUM_2441009 is not set
# CONFIG_ARM64_HW_AFDBM is not set
# CONFIG_ARM64_LSE_ATOMICS is not set
# CONFIG_ARM64_MODULE_PLTS is not set

View File

@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/net/netfilter/Kconfig
+++ b/net/netfilter/Kconfig
@@ -243,7 +243,6 @@ config NF_CONNTRACK_FTP
@@ -242,7 +242,6 @@ config NF_CONNTRACK_FTP
config NF_CONNTRACK_H323
tristate "H.323 protocol support"
@ -17,7 +17,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
depends on NETFILTER_ADVANCED
help
H.323 is a VoIP signalling protocol from ITU-T. As one of the most
@@ -1106,7 +1105,6 @@ config NETFILTER_XT_TARGET_SECMARK
@@ -1105,7 +1104,6 @@ config NETFILTER_XT_TARGET_SECMARK
config NETFILTER_XT_TARGET_TCPMSS
tristate '"TCPMSS" target support'

View File

@ -47,7 +47,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
depends on !NF_CONNTRACK || NF_CONNTRACK
--- a/net/netfilter/Kconfig
+++ b/net/netfilter/Kconfig
@@ -708,8 +708,6 @@ config NFT_REJECT_NETDEV
@@ -707,8 +707,6 @@ config NFT_REJECT_NETDEV
endif # NF_TABLES_NETDEV
@ -56,7 +56,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
config NF_FLOW_TABLE_INET
tristate "Netfilter flow table mixed IPv4/IPv6 module"
depends on NF_FLOW_TABLE
@@ -718,11 +716,12 @@ config NF_FLOW_TABLE_INET
@@ -717,11 +715,12 @@ config NF_FLOW_TABLE_INET
To compile it as a module, choose M here.
@ -70,7 +70,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
help
This option adds the flow table core infrastructure.
@@ -1011,6 +1010,15 @@ config NETFILTER_XT_TARGET_NOTRACK
@@ -1010,6 +1009,15 @@ config NETFILTER_XT_TARGET_NOTRACK
depends on NETFILTER_ADVANCED
select NETFILTER_XT_TARGET_CT

View File

@ -71,7 +71,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
*/
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -2816,6 +2816,10 @@ static inline int pskb_trim(struct sk_bu
@@ -2824,6 +2824,10 @@ static inline int pskb_trim(struct sk_bu
return (len < skb->len) ? __pskb_trim(skb, len) : 0;
}
@ -82,7 +82,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
/**
* pskb_trim_unique - remove end from a paged unique (not cloned) buffer
* @skb: buffer to alter
@@ -2966,16 +2970,6 @@ static inline struct sk_buff *dev_alloc_
@@ -2974,16 +2978,6 @@ static inline struct sk_buff *dev_alloc_
}

View File

@ -29,7 +29,7 @@ Subject: [PATCH] net/usb/qmi_wwan: add MeigLink modem support
#define QUECTEL_VENDOR_ID 0x2c7c
/* These Quectel products use Quectel's vendor ID */
@@ -1133,6 +1135,11 @@ static const struct usb_device_id option
@@ -1140,6 +1142,11 @@ static const struct usb_device_id option
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EG95, 0xff, 0, 0) },
{ USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG96),
.driver_info = RSVD(4) },

View File

@ -106,7 +106,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
}
--- a/scripts/link-vmlinux.sh
+++ b/scripts/link-vmlinux.sh
@@ -266,6 +266,10 @@ kallsyms()
@@ -257,6 +257,10 @@ kallsyms()
kallsymopt="${kallsymopt} --base-relative"
fi

View File

@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -2782,7 +2782,7 @@ static inline int pskb_network_may_pull(
@@ -2790,7 +2790,7 @@ static inline int pskb_network_may_pull(
* NET_IP_ALIGN(2) + ethernet_header(14) + IP_header(20/40) + ports(8)
*/
#ifndef NET_SKB_PAD

View File

@ -32,7 +32,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
__u8 inner_protocol_type:1;
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -6062,6 +6062,9 @@ static enum gro_result dev_gro_receive(s
@@ -6063,6 +6063,9 @@ static enum gro_result dev_gro_receive(s
int same_flow;
int grow;
@ -42,7 +42,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (netif_elide_gro(skb->dev))
goto normal;
@@ -8076,6 +8079,48 @@ static void __netdev_adjacent_dev_unlink
@@ -8077,6 +8080,48 @@ static void __netdev_adjacent_dev_unlink
&upper_dev->adj_list.lower);
}
@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
static int __netdev_upper_dev_link(struct net_device *dev,
struct net_device *upper_dev, bool master,
void *upper_priv, void *upper_info,
@@ -8127,6 +8172,7 @@ static int __netdev_upper_dev_link(struc
@@ -8128,6 +8173,7 @@ static int __netdev_upper_dev_link(struc
if (ret)
return ret;
@ -99,7 +99,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
ret = call_netdevice_notifiers_info(NETDEV_CHANGEUPPER,
&changeupper_info.info);
ret = notifier_to_errno(ret);
@@ -8223,6 +8269,7 @@ static void __netdev_upper_dev_unlink(st
@@ -8224,6 +8270,7 @@ static void __netdev_upper_dev_unlink(st
__netdev_adjacent_dev_unlink_neighbour(dev, upper_dev);
@ -107,7 +107,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
call_netdevice_notifiers_info(NETDEV_CHANGEUPPER,
&changeupper_info.info);
@@ -9042,6 +9089,7 @@ int dev_set_mac_address(struct net_devic
@@ -9043,6 +9090,7 @@ int dev_set_mac_address(struct net_devic
if (err)
return err;
dev->addr_assign_type = NET_ADDR_SET;

View File

@ -15,7 +15,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
--- a/drivers/net/ethernet/mediatek/mtk_sgmii.c
+++ b/drivers/net/ethernet/mediatek/mtk_sgmii.c
@@ -122,10 +122,26 @@ static void mtk_pcs_link_up(struct phyli
@@ -122,10 +122,28 @@ static void mtk_pcs_link_up(struct phyli
regmap_write(mpcs->regmap, SGMSYS_SGMII_MODE, val);
}
@ -24,12 +24,14 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
+ struct mtk_pcs *mpcs = pcs_to_mtk_pcs(pcs);
+ unsigned int val;
+
+ regmap_read(mpcs->regmap, mpcs->ana_rgc3, &val);
+ state->speed = val & RG_PHY_SPEED_3_125G ? SPEED_2500 : SPEED_1000;
+
+ regmap_read(mpcs->regmap, SGMSYS_PCS_CONTROL_1, &val);
+ state->an_complete = !!(val & SGMII_AN_COMPLETE);
+ state->link = !!(val & SGMII_LINK_STATYS);
+ if (!state->link)
+ return;
+
+ regmap_read(mpcs->regmap, mpcs->ana_rgc3, &val);
+ state->speed = val & RG_PHY_SPEED_3_125G ? SPEED_2500 : SPEED_1000;
+ state->duplex = DUPLEX_FULL;
+ state->pause = 0;
+}

View File

@ -13,7 +13,7 @@ Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
--- a/drivers/net/ethernet/mediatek/mtk_sgmii.c
+++ b/drivers/net/ethernet/mediatek/mtk_sgmii.c
@@ -180,6 +180,7 @@ int mtk_sgmii_init(struct mtk_sgmii *ss,
@@ -182,6 +182,7 @@ int mtk_sgmii_init(struct mtk_sgmii *ss,
return PTR_ERR(ss->pcs[i].regmap);
ss->pcs[i].pcs.ops = &mtk_pcs_ops;

View File

@ -0,0 +1,123 @@
From 8e18c5fef75debfae3531fbd6901f3bf317d91ed Mon Sep 17 00:00:00 2001
From: Daniel Golle <daniel@makrotopia.org>
Date: Fri, 9 Sep 2022 04:28:43 +0100
Subject: [PATCH] net: dsa: mt7530: add support for in-band link status
To: linux-mediatek@lists.infradead.org,
netdev@vger.kernel.org
Cc: Russell King <linux@armlinux.org.uk>,
Sean Wang <sean.wang@mediatek.com>,
Landen Chao <Landen.Chao@mediatek.com>,
DENG Qingfang <dqfext@gmail.com>,
Andrew Lunn <andrew@lunn.ch>,
Vivien Didelot <vivien.didelot@gmail.com>,
Florian Fainelli <f.fainelli@gmail.com>,
Vladimir Oltean <olteanv@gmail.com>,
David S. Miller <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>,
Matthias Brugger <matthias.bgg@gmail.com>,
Philipp Zabel <p.zabel@pengutronix.de>
Read link status from SGMII PCS for in-band managed 2500Base-X and
1000Base-X connection on a MAC port of the MT7531. This is needed to
get the SFP cage working which is connected to SGMII interface of
port 5 of the MT7531 switch IC on the Bananapi BPi-R3 board.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
drivers/net/dsa/mt7530.c | 48 +++++++++++++++++++++++++++++-----------
1 file changed, 35 insertions(+), 13 deletions(-)
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -2703,9 +2703,6 @@ mt7531_mac_config(struct dsa_switch *ds,
case PHY_INTERFACE_MODE_NA:
case PHY_INTERFACE_MODE_1000BASEX:
case PHY_INTERFACE_MODE_2500BASEX:
- if (phylink_autoneg_inband(mode))
- return -EINVAL;
-
return mt7531_sgmii_setup_mode_force(priv, port, interface);
default:
return -EINVAL;
@@ -2781,13 +2778,6 @@ unsupported:
return;
}
- if (phylink_autoneg_inband(mode) &&
- state->interface != PHY_INTERFACE_MODE_SGMII) {
- dev_err(ds->dev, "%s: in-band negotiation unsupported\n",
- __func__);
- return;
- }
-
mcr_cur = mt7530_read(priv, MT7530_PMCR_P(port));
mcr_new = mcr_cur;
mcr_new &= ~PMCR_LINK_SETTINGS_MASK;
@@ -2924,6 +2914,9 @@ static void mt753x_phylink_get_caps(stru
config->mac_capabilities = MAC_ASYM_PAUSE | MAC_SYM_PAUSE |
MAC_10 | MAC_100 | MAC_1000FD;
+ if ((priv->id == ID_MT7531) && mt753x_is_mac_port(port))
+ config->mac_capabilities |= MAC_2500FD;
+
/* This driver does not make use of the speed, duplex, pause or the
* advertisement in its mac_config, so it is safe to mark this driver
* as non-legacy.
@@ -3019,16 +3012,43 @@ mt7531_sgmii_pcs_get_state_an(struct mt7
return 0;
}
+static void
+mt7531_sgmii_pcs_get_state_inband(struct mt7530_priv *priv, int port,
+ struct phylink_link_state *state)
+{
+ unsigned int val;
+
+ val = mt7530_read(priv, MT7531_PCS_CONTROL_1(port));
+ state->link = !!(val & MT7531_SGMII_LINK_STATUS);
+ if (!state->link)
+ return;
+
+ if (state->interface == PHY_INTERFACE_MODE_2500BASEX)
+ state->speed = SPEED_2500;
+ else
+ state->speed = SPEED_1000;
+
+ state->duplex = DUPLEX_FULL;
+ state->pause = 0;
+}
+
static void mt7531_pcs_get_state(struct phylink_pcs *pcs,
struct phylink_link_state *state)
{
struct mt7530_priv *priv = pcs_to_mt753x_pcs(pcs)->priv;
int port = pcs_to_mt753x_pcs(pcs)->port;
+ unsigned int val;
- if (state->interface == PHY_INTERFACE_MODE_SGMII)
+ if (state->interface == PHY_INTERFACE_MODE_SGMII) {
mt7531_sgmii_pcs_get_state_an(priv, port, state);
- else
- state->link = false;
+ return;
+ } else if ((state->interface == PHY_INTERFACE_MODE_1000BASEX) ||
+ (state->interface == PHY_INTERFACE_MODE_2500BASEX)) {
+ mt7531_sgmii_pcs_get_state_inband(priv, port, state);
+ return;
+ }
+
+ state->link = false;
}
static int mt753x_pcs_config(struct phylink_pcs *pcs, unsigned int mode,
@@ -3069,6 +3089,8 @@ mt753x_setup(struct dsa_switch *ds)
priv->pcs[i].pcs.ops = priv->info->pcs_ops;
priv->pcs[i].priv = priv;
priv->pcs[i].port = i;
+ if (mt753x_is_mac_port(i))
+ priv->pcs[i].pcs.poll = 1;
}
ret = priv->info->sw_setup(ds);

View File

@ -0,0 +1,71 @@
From ced9d535126a81a85b022cff1e2fd8e0da46c7ae Mon Sep 17 00:00:00 2001
From: Daniel Golle <daniel@makrotopia.org>
Date: Fri, 9 Sep 2022 18:25:21 +0100
Subject: [PATCH] Bluetooth: btusb: Add a new VID/PID 0e8d/0608 for MT7921
To: linux-mediatek@lists.infradead.org,
linux-bluetooth@vger.kernel.org
Cc: Matthias Brugger <matthias.bgg@gmail.com>,
Luiz Augusto von Dentz <luiz.dentz@gmail.com>,
Johan Hedberg <johan.hedberg@gmail.com>,
Marcel Holtmann <marcel@holtmann.org>
Add a new PID/VID 0e8d/0608 for MT7921K chip found on AMD RZ608 module.
From /sys/kernel/debug/usb/devices:
T: Bus=01 Lev=02 Prnt=02 Port=01 Cnt=01 Dev#= 3 Spd=480 MxCh= 0
D: Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1
P: Vendor=0e8d ProdID=0608 Rev= 1.00
S: Manufacturer=MediaTek Inc.
S: Product=Wireless_Device
S: SerialNumber=000000000
C:* #Ifs= 3 Cfg#= 1 Atr=e0 MxPwr=100mA
A: FirstIf#= 0 IfCount= 3 Cls=e0(wlcon) Sub=01 Prot=01
I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=125us
E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms
I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms
I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms
I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms
I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms
I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms
I: If#= 1 Alt= 6 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 63 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 63 Ivl=1ms
I:* If#= 2 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none)
E: Ad=8a(I) Atr=03(Int.) MxPS= 64 Ivl=125us
E: Ad=0a(O) Atr=03(Int.) MxPS= 64 Ivl=125us
I: If#= 2 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none)
E: Ad=8a(I) Atr=03(Int.) MxPS= 64 Ivl=125us
E: Ad=0a(O) Atr=03(Int.) MxPS= 64 Ivl=125us
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
drivers/bluetooth/btusb.c | 3 +++
1 file changed, 3 insertions(+)
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -469,6 +469,9 @@ static const struct usb_device_id blackl
{ USB_DEVICE(0x0489, 0xe0cd), .driver_info = BTUSB_MEDIATEK |
BTUSB_WIDEBAND_SPEECH |
BTUSB_VALID_LE_STATES },
+ { USB_DEVICE(0x0e8d, 0x0608), .driver_info = BTUSB_MEDIATEK |
+ BTUSB_WIDEBAND_SPEECH |
+ BTUSB_VALID_LE_STATES },
/* MediaTek MT7922A Bluetooth devices */
{ USB_DEVICE(0x0489, 0xe0d8), .driver_info = BTUSB_MEDIATEK |

View File

@ -8,8 +8,7 @@ CPU_TYPE:=cortex-a7
CPU_SUBTYPE:=neon-vfpv4
SUBTARGETS:=generic chromium mikrotik
KERNEL_PATCHVER:=5.10
KERNEL_TESTING_PATCHVER:=5.15
KERNEL_PATCHVER:=5.15
KERNELNAME:=zImage Image dtbs

View File

@ -559,7 +559,7 @@ define Device/glinet_gl-ap1300
PAGESIZE := 2048
IMAGE_SIZE := 131072k
KERNEL_INSTALL := 1
DEVICE_PACKAGES := ipq-wifi-glinet_gl-ap1300
DEVICE_PACKAGES := ipq-wifi-glinet_gl-ap1300 kmod-usb-net-qmi-wwan kmod-usb-serial-option uqmi
endef
TARGET_DEVICES += glinet_gl-ap1300

View File

@ -10,7 +10,7 @@ mediatek_setup_interfaces()
case $board in
mediatek,mt7986a-rfb|\
mediatek,mt7986b-rfb)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" wan
ucidef_set_interfaces_lan_wan "lan0 lan1 lan2 lan3" eth1
;;
bananapi,bpi-r3)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 sfp2" "eth1 wan"

View File

@ -62,7 +62,9 @@ define Device/bananapi_bpi-r3
ARTIFACT/sdcard.img.gz := mt7986-gpt sdmmc |\
pad-to 17k | bl2 sdmmc-ddr4 |\
pad-to 6656k | bl31-uboot bananapi_bpi-r3-sdmmc |\
pad-to 12M | append-image-stage initramfs-recovery.itb |\
$(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),\
pad-to 12M | append-image-stage initramfs-recovery.itb | check-size 44m |\
) \
pad-to 44M | bl2 spim-nand-ddr4 |\
pad-to 45M | bl31-uboot bananapi_bpi-r3-snand |\
pad-to 49M | bl2 nor-ddr4 |\
@ -70,7 +72,10 @@ define Device/bananapi_bpi-r3
pad-to 51M | bl2 emmc-ddr4 |\
pad-to 52M | bl31-uboot bananapi_bpi-r3-emmc |\
pad-to 56M | mt7986-gpt emmc |\
pad-to 64M | append-image squashfs-sysupgrade.itb | gzip
$(if $(CONFIG_TARGET_ROOTFS_SQUASHFS),\
pad-to 64M | append-image squashfs-sysupgrade.itb | check-size | gzip \
)
IMAGE_SIZE := $$(shell expr 64 + $$(CONFIG_TARGET_ROOTFS_PARTSIZE))m
KERNEL := kernel-bin | gzip
KERNEL_INITRAMFS := kernel-bin | lzma | \
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k

View File

@ -86,13 +86,18 @@ define Device/bananapi_bpi-r64
ARTIFACT/sdcard.img.gz := mt7622-gpt sdmmc |\
pad-to 512k | bl2 sdmmc-2ddr |\
pad-to 2048k | bl31-uboot bananapi_bpi-r64-sdmmc |\
pad-to 6144k | append-image-stage initramfs-recovery.itb |\
$(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),\
pad-to 6144k | append-image-stage initramfs-recovery.itb | check-size 38912k |\
) \
pad-to 38912k | mt7622-gpt emmc |\
pad-to 39424k | bl2 emmc-2ddr |\
pad-to 40960k | bl31-uboot bananapi_bpi-r64-emmc |\
pad-to 43008k | bl2 snand-2ddr |\
pad-to 43520k | bl31-uboot bananapi_bpi-r64-snand |\
pad-to 46080k | append-image squashfs-sysupgrade.itb | gzip
$(if $(CONFIG_TARGET_ROOTFS_SQUASHFS),\
pad-to 46080k | append-image squashfs-sysupgrade.itb | check-size | gzip \
)
IMAGE_SIZE := $$(shell expr 45 + $$(CONFIG_TARGET_ROOTFS_PARTSIZE))m
KERNEL := kernel-bin | gzip
KERNEL_INITRAMFS := kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb with-initrd | pad-to 128k
IMAGE/sysupgrade.itb := append-kernel | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb external-static-with-rootfs | append-metadata

View File

@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -4987,6 +4987,16 @@ static int mvneta_setup_tc(struct net_de
@@ -4943,6 +4943,16 @@ static int mvneta_setup_tc(struct net_de
}
}
@ -26,7 +26,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
static const struct net_device_ops mvneta_netdev_ops = {
.ndo_open = mvneta_open,
.ndo_stop = mvneta_stop,
@@ -4997,6 +5007,9 @@ static const struct net_device_ops mvnet
@@ -4953,6 +4963,9 @@ static const struct net_device_ops mvnet
.ndo_fix_features = mvneta_fix_features,
.ndo_get_stats64 = mvneta_get_stats64,
.ndo_eth_ioctl = mvneta_ioctl,

View File

@ -26,7 +26,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
#include <linux/bpf_trace.h>
/* Registers */
@@ -4947,14 +4948,14 @@ static void mvneta_setup_rx_prio_map(str
@@ -4903,14 +4904,14 @@ static void mvneta_setup_rx_prio_map(str
}
static int mvneta_setup_mqprio(struct net_device *dev,
@ -44,7 +44,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (num_tc > rxq_number)
return -EINVAL;
@@ -4965,13 +4966,15 @@ static int mvneta_setup_mqprio(struct ne
@@ -4921,13 +4922,15 @@ static int mvneta_setup_mqprio(struct ne
return 0;
}

View File

@ -17,7 +17,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -4954,7 +4954,9 @@ static int mvneta_setup_mqprio(struct ne
@@ -4910,7 +4910,9 @@ static int mvneta_setup_mqprio(struct ne
u8 num_tc;
int i;

View File

@ -30,7 +30,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
phy_interface_t phy_interface;
struct device_node *dn;
@@ -4936,13 +4935,12 @@ static void mvneta_clear_rx_prio_map(str
@@ -4892,13 +4891,12 @@ static void mvneta_clear_rx_prio_map(str
mvreg_write(pp, MVNETA_VLAN_PRIO_TO_RXQ, 0);
}
@ -48,7 +48,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
mvreg_write(pp, MVNETA_VLAN_PRIO_TO_RXQ, val);
}
@@ -4951,8 +4949,8 @@ static int mvneta_setup_mqprio(struct ne
@@ -4907,8 +4905,8 @@ static int mvneta_setup_mqprio(struct ne
struct tc_mqprio_qopt_offload *mqprio)
{
struct mvneta_port *pp = netdev_priv(dev);
@ -58,7 +58,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (mqprio->qopt.hw != TC_MQPRIO_HW_OFFLOAD_TCS)
return 0;
@@ -4962,21 +4960,28 @@ static int mvneta_setup_mqprio(struct ne
@@ -4918,21 +4916,28 @@ static int mvneta_setup_mqprio(struct ne
if (num_tc > rxq_number)
return -EINVAL;

View File

@ -62,7 +62,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
#define MVNETA_LPI_CTRL_0 0x2cc0
#define MVNETA_LPI_CTRL_1 0x2cc4
#define MVNETA_LPI_REQUEST_ENABLE BIT(0)
@@ -4945,11 +4972,74 @@ static void mvneta_map_vlan_prio_to_rxq(
@@ -4901,11 +4928,74 @@ static void mvneta_map_vlan_prio_to_rxq(
mvreg_write(pp, MVNETA_VLAN_PRIO_TO_RXQ, val);
}
@ -138,7 +138,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
u8 num_tc;
if (mqprio->qopt.hw != TC_MQPRIO_HW_OFFLOAD_TCS)
@@ -4963,6 +5053,7 @@ static int mvneta_setup_mqprio(struct ne
@@ -4919,6 +5009,7 @@ static int mvneta_setup_mqprio(struct ne
mvneta_clear_rx_prio_map(pp);
if (!num_tc) {
@ -146,7 +146,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
netdev_reset_tc(dev);
return 0;
}
@@ -4983,6 +5074,33 @@ static int mvneta_setup_mqprio(struct ne
@@ -4939,6 +5030,33 @@ static int mvneta_setup_mqprio(struct ne
}
}

View File

@ -58,6 +58,7 @@ struct p_hdr {
uint16_t size; /* buffer size */
uint16_t offset;
uint16_t len; /* pkt len */
/* cpu_tag[0] is a reserved uint16_t on RTL83xx */
uint16_t cpu_tag[10];
} __packed __aligned(1);
@ -262,13 +263,14 @@ struct dsa_tag {
bool rtl838x_decode_tag(struct p_hdr *h, struct dsa_tag *t)
{
t->reason = h->cpu_tag[3] & 0xf;
t->queue = (h->cpu_tag[0] & 0xe0) >> 5;
/* cpu_tag[0] is reserved. Fields are off-by-one */
t->reason = h->cpu_tag[4] & 0xf;
t->queue = (h->cpu_tag[1] & 0xe0) >> 5;
t->port = h->cpu_tag[1] & 0x1f;
t->crc_error = t->reason == 13;
pr_debug("Reason: %d\n", t->reason);
if (t->reason != 4) // NIC_RX_REASON_SPECIAL_TRAP
if (t->reason != 6) // NIC_RX_REASON_SPECIAL_TRAP
t->l2_offloaded = 1;
else
t->l2_offloaded = 0;
@ -278,10 +280,11 @@ bool rtl838x_decode_tag(struct p_hdr *h, struct dsa_tag *t)
bool rtl839x_decode_tag(struct p_hdr *h, struct dsa_tag *t)
{
/* cpu_tag[0] is reserved. Fields are off-by-one */
t->reason = h->cpu_tag[5] & 0x1f;
t->queue = (h->cpu_tag[3] & 0xe000) >> 13;
t->queue = (h->cpu_tag[4] & 0xe000) >> 13;
t->port = h->cpu_tag[1] & 0x3f;
t->crc_error = h->cpu_tag[3] & BIT(2);
t->crc_error = h->cpu_tag[4] & BIT(6);
pr_debug("Reason: %d\n", t->reason);
if ((t->reason >= 7 && t->reason <= 13) || // NIC_RX_REASON_RMA

View File

@ -23,13 +23,36 @@ rockchip_setup_interfaces()
esac
}
nanopi_r2s_generate_mac()
generate_mac_from_mmc_cid()
{
local sd_hash=$(sha256sum /sys/class/block/mmcblk0/device/cid)
local mmc_dev=$1
local sd_hash=$(sha256sum /sys/class/block/$mmc_dev/device/cid)
local mac_base=$(macaddr_canonicalize "$(echo "${sd_hash}" | dd bs=1 count=12 2>/dev/null)")
echo "$(macaddr_unsetbit_mc "$(macaddr_setbit_la "${mac_base}")")"
}
nanopi_r4s_get_mac()
{
local interface=$1
local eeprom_path="/sys/bus/i2c/devices/2-0051/eeprom"
local address
if [ -f "$eeprom_path" ]; then
address=$(get_mac_binary "$eeprom_path" 0xfa)
if [ "$interface" = "lan" ]; then
address=$(macaddr_setbit_la "$address")
fi
else
address=$(generate_mac_from_mmc_cid mmcblk1)
if [ "$interface" = "lan" ]; then
address=$(macaddr_add "$address" 1)
fi
fi
echo "$address"
}
rockchip_setup_macs()
{
local board="$1"
@ -41,12 +64,12 @@ rockchip_setup_macs()
fastrhino,r66s|\
friendlyarm,nanopi-r2c|\
friendlyarm,nanopi-r2s)
wan_mac=$(nanopi_r2s_generate_mac)
wan_mac=$(generate_mac_from_mmc_cid mmcblk0)
lan_mac=$(macaddr_add "$wan_mac" 1)
;;
friendlyarm,nanopi-r4s)
wan_mac=$(get_mac_binary "/sys/bus/i2c/devices/2-0051/eeprom" 0xfa)
lan_mac=$(macaddr_setbit_la "$wan_mac")
wan_mac=$(nanopi_r4s_get_mac wan)
lan_mac=$(nanopi_r4s_get_mac lan)
;;
xunlong,orangepi-r1-plus|\
xunlong,orangepi-r1-plus-lts)