From 122e0c7fed72ffa592dafcfa69ad66c58f4b40dc Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Mon, 27 Mar 2023 02:17:03 +0200 Subject: [PATCH 01/67] kernel: bump 5.4 to 5.4.234 Compile-tested: armvirt/64, lantiq/xrx200 Run-tested: armvirt/64 Signed-off-by: Hauke Mehrtens --- include/kernel-5.4 | 4 ++-- .../linux/ath79/patches-5.4/910-unaligned_access_hacks.patch | 2 +- .../bcm27xx/patches-5.4/950-0037-Add-dwc_otg-driver.patch | 2 +- ...45-dma-mapping-treat-dev-bus_dma_mask-as-a-DMA-limit.patch | 2 +- ...MLK-9829-usb-core-print-suggested-message-if-failed-.patch | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/kernel-5.4 b/include/kernel-5.4 index a1a8ed05d6..aabcbf24ee 100644 --- a/include/kernel-5.4 +++ b/include/kernel-5.4 @@ -1,2 +1,2 @@ -LINUX_VERSION-5.4 = .231 -LINUX_KERNEL_HASH-5.4.231 = 8dd0ea7f1db4c1e89d485255798e3c3dfb9be63c0f2af369912a1a37b75f36a8 +LINUX_VERSION-5.4 = .234 +LINUX_KERNEL_HASH-5.4.234 = acc79cb33f2e31bbd8267d4caa7e90bcc9ef5f1fdd060cd34117ad4dae950991 diff --git a/target/linux/ath79/patches-5.4/910-unaligned_access_hacks.patch b/target/linux/ath79/patches-5.4/910-unaligned_access_hacks.patch index dbeba6f6ec..ace36e0ab6 100644 --- a/target/linux/ath79/patches-5.4/910-unaligned_access_hacks.patch +++ b/target/linux/ath79/patches-5.4/910-unaligned_access_hacks.patch @@ -214,7 +214,7 @@ #include #include #include -@@ -866,10 +867,10 @@ static void tcp_v6_send_response(const s +@@ -867,10 +868,10 @@ static void tcp_v6_send_response(const s topt = (__be32 *)(t1 + 1); if (tsecr) { diff --git a/target/linux/bcm27xx/patches-5.4/950-0037-Add-dwc_otg-driver.patch b/target/linux/bcm27xx/patches-5.4/950-0037-Add-dwc_otg-driver.patch index 67cd8b27da..1b5a0d1358 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0037-Add-dwc_otg-driver.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0037-Add-dwc_otg-driver.patch @@ -1040,7 +1040,7 @@ Signed-off-by: Jonathan Bell } --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c -@@ -5385,7 +5385,7 @@ static void port_event(struct usb_hub *h +@@ -5384,7 +5384,7 @@ static void port_event(struct usb_hub *h port_dev->over_current_count++; port_over_current_notify(port_dev); diff --git a/target/linux/bcm27xx/patches-5.4/950-0445-dma-mapping-treat-dev-bus_dma_mask-as-a-DMA-limit.patch b/target/linux/bcm27xx/patches-5.4/950-0445-dma-mapping-treat-dev-bus_dma_mask-as-a-DMA-limit.patch index da741d31dc..8cdc4b6c72 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0445-dma-mapping-treat-dev-bus_dma_mask-as-a-DMA-limit.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0445-dma-mapping-treat-dev-bus_dma_mask-as-a-DMA-limit.patch @@ -271,7 +271,7 @@ Signed-off-by: Christoph Hellwig u64 dma_direct_get_required_mask(struct device *dev); --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h -@@ -697,7 +697,7 @@ static inline int dma_coerce_mask_and_co +@@ -777,7 +777,7 @@ static inline int dma_coerce_mask_and_co */ static inline bool dma_addressing_limited(struct device *dev) { diff --git a/target/linux/layerscape/patches-5.4/820-usb-0019-MLK-9829-usb-core-print-suggested-message-if-failed-.patch b/target/linux/layerscape/patches-5.4/820-usb-0019-MLK-9829-usb-core-print-suggested-message-if-failed-.patch index b24ffa134c..44b2d3343b 100644 --- a/target/linux/layerscape/patches-5.4/820-usb-0019-MLK-9829-usb-core-print-suggested-message-if-failed-.patch +++ b/target/linux/layerscape/patches-5.4/820-usb-0019-MLK-9829-usb-core-print-suggested-message-if-failed-.patch @@ -20,7 +20,7 @@ Signed-off-by: Li Jun --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c -@@ -4783,7 +4783,8 @@ hub_port_init(struct usb_hub *hub, struc +@@ -4782,7 +4782,8 @@ hub_port_init(struct usb_hub *hub, struc } if (r) { if (r != -ENODEV) From a4f065a646c103d95a0b27ca827a7a93a5e47514 Mon Sep 17 00:00:00 2001 From: John Audia Date: Sat, 11 Mar 2023 10:42:26 -0500 Subject: [PATCH 02/67] kernel: tcindex classifier has been retired https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/net/sched?h=v5.4.235&id=7a6fb69bbcb21e9ce13bdf18c008c268874f0480 Signed-off-by: John Audia (cherry picked from commit fbfec3286e8bfce3a78749b7bcb67e658665f197) --- package/kernel/linux/modules/netsupport.mk | 3 +-- target/linux/generic/config-5.4 | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/package/kernel/linux/modules/netsupport.mk b/package/kernel/linux/modules/netsupport.mk index c3fb0340f7..35ec7ae695 100644 --- a/package/kernel/linux/modules/netsupport.mk +++ b/package/kernel/linux/modules/netsupport.mk @@ -689,7 +689,7 @@ $(eval $(call KernelPackage,mppe)) SCHED_MODULES = $(patsubst $(LINUX_DIR)/net/sched/%.ko,%,$(wildcard $(LINUX_DIR)/net/sched/*.ko)) -SCHED_MODULES_CORE = sch_ingress sch_fq_codel sch_hfsc sch_htb sch_tbf cls_basic cls_fw cls_route cls_flow cls_tcindex cls_u32 em_u32 act_gact act_mirred act_skbedit cls_matchall +SCHED_MODULES_CORE = sch_ingress sch_fq_codel sch_hfsc sch_htb sch_tbf cls_basic cls_fw cls_route cls_flow cls_u32 em_u32 act_gact act_mirred act_skbedit cls_matchall SCHED_MODULES_FILTER = $(SCHED_MODULES_CORE) act_connmark act_ctinfo sch_cake sch_netem sch_mqprio em_ipset cls_bpf cls_flower act_bpf act_vlan SCHED_MODULES_EXTRA = $(filter-out $(SCHED_MODULES_FILTER),$(SCHED_MODULES)) SCHED_FILES = $(patsubst %,$(LINUX_DIR)/net/sched/%.ko,$(filter $(SCHED_MODULES_CORE),$(SCHED_MODULES))) @@ -711,7 +711,6 @@ define KernelPackage/sched-core CONFIG_NET_CLS_FLOW \ CONFIG_NET_CLS_FW \ CONFIG_NET_CLS_ROUTE4 \ - CONFIG_NET_CLS_TCINDEX \ CONFIG_NET_CLS_U32 \ CONFIG_NET_ACT_GACT \ CONFIG_NET_ACT_MIRRED \ diff --git a/target/linux/generic/config-5.4 b/target/linux/generic/config-5.4 index ec37e515f0..be025d2073 100644 --- a/target/linux/generic/config-5.4 +++ b/target/linux/generic/config-5.4 @@ -3470,7 +3470,6 @@ CONFIG_NET_CLS_IND=y # CONFIG_NET_CLS_ROUTE4 is not set # CONFIG_NET_CLS_RSVP is not set # CONFIG_NET_CLS_RSVP6 is not set -# CONFIG_NET_CLS_TCINDEX is not set # CONFIG_NET_CLS_U32 is not set CONFIG_NET_CORE=y # CONFIG_NET_DEVLINK is not set From 3d93d2cea5ce1f6120da4233cfdb168d408ad923 Mon Sep 17 00:00:00 2001 From: Mathias Kresin Date: Sun, 27 Dec 2020 19:42:24 +0100 Subject: [PATCH 03/67] ltq-atm/ltq-ptm: add kernel 5.10 compatiblity The callback handling of the tasklet API was redesigned and the macros using the old syntax renamed to _OLD. The stuck queue is now passed to ndo_tx_timeout callback but not used so far. Signed-off-by: Mathias Kresin (cherry picked from commit 804c541446ab8e3fab11dba5d8fe07807af7fac5) [Add DECLARE_TASKLET handling for kernel 5.4.235 too] Signed-off-by: Hauke Mehrtens --- package/kernel/lantiq/ltq-atm/src/ltq_atm.c | 6 ++++++ .../kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c | 8 ++++++++ .../kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c | 13 +++++++++++++ 3 files changed, 27 insertions(+) diff --git a/package/kernel/lantiq/ltq-atm/src/ltq_atm.c b/package/kernel/lantiq/ltq-atm/src/ltq_atm.c index 55362a5c7b..695e2329a9 100644 --- a/package/kernel/lantiq/ltq-atm/src/ltq_atm.c +++ b/package/kernel/lantiq/ltq-atm/src/ltq_atm.c @@ -41,6 +41,7 @@ #include #include #include +#include #ifdef CONFIG_XFRM #include #endif @@ -199,7 +200,12 @@ static inline void mailbox_aal_rx_handler(void); static irqreturn_t mailbox_irq_handler(int, void *); static inline void mailbox_signal(unsigned int, int); static void do_ppe_tasklet(unsigned long); +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,9,0) && \ + !(LINUX_VERSION_CODE < KERNEL_VERSION(5,5,0) && LINUX_VERSION_CODE > KERNEL_VERSION(5,4,235)) DECLARE_TASKLET(g_dma_tasklet, do_ppe_tasklet, 0); +#else +DECLARE_TASKLET_OLD(g_dma_tasklet, do_ppe_tasklet); +#endif /* * QSB & HTU setting functions diff --git a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c index 18c715a290..5ee966c014 100644 --- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c +++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c @@ -127,7 +127,11 @@ static int ptm_stop(struct net_device *); static int ptm_napi_poll(struct napi_struct *, int); static int ptm_hard_start_xmit(struct sk_buff *, struct net_device *); static int ptm_ioctl(struct net_device *, struct ifreq *, int); +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0) static void ptm_tx_timeout(struct net_device *); +#else +static void ptm_tx_timeout(struct net_device *, unsigned int txqueue); +#endif /* * DSL Data LED @@ -511,7 +515,11 @@ static int ptm_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) return 0; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0) static void ptm_tx_timeout(struct net_device *dev) +#else +static void ptm_tx_timeout(struct net_device *dev, unsigned int txqueue) +#endif { int ndev; diff --git a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c index 44d805049b..f13908db62 100644 --- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c +++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c @@ -77,7 +77,11 @@ static int ptm_stop(struct net_device *); static int ptm_napi_poll(struct napi_struct *, int); static int ptm_hard_start_xmit(struct sk_buff *, struct net_device *); static int ptm_ioctl(struct net_device *, struct ifreq *, int); +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0) static void ptm_tx_timeout(struct net_device *); +#else +static void ptm_tx_timeout(struct net_device *, unsigned int txqueue); +#endif static inline struct sk_buff* alloc_skb_rx(void); static inline struct sk_buff* alloc_skb_tx(unsigned int); @@ -125,7 +129,12 @@ static char *g_net_dev_name[1] = {"dsl0"}; static int g_ptm_prio_queue_map[8]; +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,9,0) && \ + !(LINUX_VERSION_CODE < KERNEL_VERSION(5,5,0) && LINUX_VERSION_CODE > KERNEL_VERSION(5,4,235)) static DECLARE_TASKLET(g_swap_desc_tasklet, do_swap_desc_tasklet, 0); +#else +static DECLARE_TASKLET_OLD(g_swap_desc_tasklet, do_swap_desc_tasklet); +#endif unsigned int ifx_ptm_dbg_enable = DBG_ENABLE_MASK_ERR; @@ -451,7 +460,11 @@ static int ptm_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) return 0; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0) static void ptm_tx_timeout(struct net_device *dev) +#else +static void ptm_tx_timeout(struct net_device *dev, unsigned int txqueue) +#endif { ASSERT(dev == g_net_dev[0], "incorrect device"); From 8e12360fcf157d421366e929737471830f77a4f0 Mon Sep 17 00:00:00 2001 From: Mathias Kresin Date: Sun, 27 Dec 2020 17:25:25 +0100 Subject: [PATCH 04/67] lantiq: ltq-tapi: add kernel 5.10 compatiblity Due to SCHED_FIFO being a broken scheduler model, all users of sched_setscheduler() are converted to sched_set_fifo_low() upstream and sched_setscheduler() is no longer exported. The callback handling of the tasklet API was redesigned and the macros using the old syntax renamed to _OLD. Signed-off-by: Mathias Kresin (cherry picked from commit 31f3f797004ad318a1de88ec9cfdece523ee46d9) [Add DECLARE_TASKLET handling for kernel 5.4.235 too] Signed-off-by: Hauke Mehrtens --- .../ltq-tapi/patches/500-linux-509.patch | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 package/kernel/lantiq/ltq-tapi/patches/500-linux-509.patch diff --git a/package/kernel/lantiq/ltq-tapi/patches/500-linux-509.patch b/package/kernel/lantiq/ltq-tapi/patches/500-linux-509.patch new file mode 100644 index 0000000000..9c012301de --- /dev/null +++ b/package/kernel/lantiq/ltq-tapi/patches/500-linux-509.patch @@ -0,0 +1,51 @@ +--- a/src/drv_tapi_linux.c ++++ b/src/drv_tapi_linux.c +@@ -3287,10 +3287,13 @@ static IFX_void_t proc_EntriesRemove(IFX + */ + static IFX_void_t tapi_wq_setscheduler (IFX_int32_t foo) + { ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,9,0) + struct sched_param sched_params; +- + sched_params.sched_priority = TAPI_OS_THREAD_PRIO_HIGH; + sched_setscheduler(current, SCHED_FIFO, &sched_params); ++#else ++ sched_set_fifo_low(current); ++#endif + } + #endif /* LINUX_2_6 */ + +@@ -3727,6 +3730,7 @@ static IFX_int32_t TAPI_SelectCh (TAPI_F + */ + IFX_int32_t TAPI_OS_ThreadPriorityModify(IFX_uint32_t newPriority) + { ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,9,0)) + struct sched_param sched_params; + IFX_int32_t ret; + +@@ -3744,6 +3748,10 @@ IFX_int32_t TAPI_OS_ThreadPriorityModify + } + + return (ret < 0) ? IFX_ERROR : IFX_SUCCESS; ++#else ++ sched_set_fifo_low(current); ++ return IFX_SUCCESS; ++#endif + } + + +--- a/src/drv_tapi_kpi.c ++++ b/src/drv_tapi_kpi.c +@@ -134,7 +134,12 @@ extern IFX_int32_t block_ingre + /* ========================================================================== */ + static IFX_void_t ifx_tapi_KPI_IngressHandler (IFX_ulong_t foo); + #ifdef KPI_TASKLET ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,9,0) && \ ++ !(LINUX_VERSION_CODE < KERNEL_VERSION(5,5,0) && LINUX_VERSION_CODE > KERNEL_VERSION(5,4,235)) + DECLARE_TASKLET(tl_kpi_ingress, ifx_tapi_KPI_IngressHandler, 0L); ++#else ++DECLARE_TASKLET_OLD(tl_kpi_ingress, ifx_tapi_KPI_IngressHandler); ++#endif + #endif /* KPI_TASKLET */ + static IFX_int32_t ifx_tapi_KPI_IngressThread (IFXOS_ThreadParams_t *pThread); + static IFX_return_t ifx_tapi_KPI_GroupInit(IFX_uint32_t nKpiGroup); From 5e69c097f74644b6733f794583bd5e143806a371 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Mon, 27 Mar 2023 16:44:54 +0200 Subject: [PATCH 05/67] kernel: bump 5.4 to 5.4.238 Compile-tested: armvirt/64, lantiq/xrx200 Run-tested: armvirt/64, lantiq/xrx200 Signed-off-by: Hauke Mehrtens --- include/kernel-5.4 | 4 +- ...rypto4xx-reduce-memory-fragmentation.patch | 4 +- ...8xx-Enable-LEDs-and-auto-negotiation.patch | 6 +-- ...78xx-Read-initial-EEE-status-from-DT.patch | 2 +- ...Disable-TCP-Segmentation-Offload-TSO.patch | 2 +- ...e-enabling-of-EEE-into-PHY-init-code.patch | 4 +- ...e-link-events-to-minimize-poll-storm.patch | 2 +- ...xx-EEE-support-is-now-a-PHY-property.patch | 2 +- ...use-default-alignment-for-rx-buffers.patch | 2 +- ...Better-coalescing-parameter-defaults.patch | 4 +- ...ce-quirks-for-Freeway-Airmouse-T3-an.patch | 2 +- ...t-Workaround-2-for-Pi4-Ethernet-fail.patch | 2 +- ....dtbo-overlays-to-be-built-piecemeal.patch | 2 +- ...36-drm-v3d-The-third-IRQ-is-optional.patch | 2 +- ...-inbound-resource-parsing-to-helpers.patch | 2 +- ...ow-.dtbo-overlays-to-be-built-adjust.patch | 2 +- ...cc-Add-packed-10bit-YUV-4-2-0-format.patch | 2 +- ...et-bcmgenet-Reset-RBUF-on-first-open.patch | 8 ++-- ...-Ack-pending-PHY-ints-when-resetting.patch | 2 +- .../011-kbuild-export-SUBARCH.patch | 2 +- ...pi-poll-functionality-to-__napi_poll.patch | 8 ++-- ...threaded-able-napi-poll-loop-support.patch | 22 ++++----- ...tribute-to-control-napi-threaded-mod.patch | 6 +-- ...ween-napi-kthread-mode-and-busy-poll.patch | 10 ++-- ...up-on-napi_disable-for-threaded-napi.patch | 4 +- ...ast-GRO-for-skbs-with-Ethernet-heade.patch | 2 +- .../generic/hack-5.4/221-module_exports.patch | 6 +-- .../generic/hack-5.4/721-phy_packets.patch | 10 ++-- .../generic/hack-5.4/902-debloat_proc.patch | 2 +- ...mtd-device-named-ubi-or-data-on-boot.patch | 4 +- ...w_table-add-hardware-offload-support.patch | 6 +-- ...w_table-support-hw-offload-through-v.patch | 6 +-- ...ng-with-source-address-failed-policy.patch | 14 +++--- ...T-skip-GRO-for-foreign-MAC-addresses.patch | 12 ++--- ...4019-needs-rfs-vlan_tag-callbacks-in.patch | 4 +- .../lantiq/patches-5.4/0152-lantiq-VPE.patch | 16 ++----- .../patches-5.4/0155-lantiq-VPE-nosmp.patch | 2 +- ...le-all-hardware-interrupts-on-second.patch | 6 +-- ...-attach-do-not-return-EINVAL-if-the-.patch | 2 +- ...oC-fsl_sai-Fix-noise-when-using-EDMA.patch | 4 +- ...SoC-fsl_sai-Implement-set_bclk_ratio.patch | 4 +- ...-ASoC-fsl_sai-Add-support-for-imx8qm.patch | 2 +- ...l_sai-Add-support-for-imx7ulp-imx8mq.patch | 2 +- ..._sai-Add-support-for-SAI-new-version.patch | 48 +++++++++---------- ...sai-Update-Tx-Rx-channel-enable-mask.patch | 4 +- ...sai-Add-registers-definition-for-mul.patch | 12 ++--- ...ve-dev_err-usage-after-platform_get_.patch | 2 +- ...-ASoC-fsl_sai-mark-regmap-as-fast_io.patch | 2 +- ...sai-derive-TX-FIFO-watermark-from-FI.patch | 4 +- ...evert-ASoC-fsl_sai-add-of_match-data.patch | 6 +-- ...l_sai-There-is-underrun-detected-in-.patch | 4 +- ...-fsl-sai-Just-one-device-can-playbac.patch | 4 +- ...sl_sai-add-initial-value-for-is_slav.patch | 2 +- ...et-xCR4-xCR5-xMR-for-SAI-master-mode.patch | 2 +- ...-fsl_sai-correct-the-clock-source-fo.patch | 2 +- ...-fsl_sai-refine-driver-for-ip-upgrad.patch | 34 ++++++------- ...SoC-fsl_sai-fix-for-synchronize-mode.patch | 6 +-- ...introduce-shared-interrupt-DT-flag-p.patch | 4 +- ...andle-slave-mode-per-TX-RX-direction.patch | 18 +++---- ...sl_sai-set-specific-fmt-for-I2S-XTOR.patch | 4 +- ...-ASoC-fsl-sai-set-xCR4-xCR5-xMR-for-.patch | 2 +- ...sl_sai-Fix-mixing-initialization-dat.patch | 2 +- ...oC-fsl_sai-support-latest-sai-module.patch | 46 +++++++++--------- ...oC-fsl_sai-Fix-noise-when-using-EDMA.patch | 4 +- ...-fsl_sai-update-fifo_depth-for-diffe.patch | 2 +- ...-fsl_sai-refine-the-pm-runtime-funct.patch | 4 +- ...-fsl_sai-Refine-master-flag-handling.patch | 6 +-- ...-fsl_sai-enable-TCE-RCE-according-to.patch | 10 ++-- ...6-3-ASoC-fsl_sai-fix-the-xMR-setting.patch | 6 +-- ...-fsl_sai-use-min-channels-slots-for-.patch | 2 +- ...16929-1-ASoC-fsl_sai-add-bitclk_freq.patch | 2 +- ...C-fsl_sai-support-multi-fifo-and-DSD.patch | 28 ++++------- ...-10bits-fully-packed-variant-of-NV12.patch | 2 +- ...rial-lpuart-add-power-domain-support.patch | 4 +- ...al-fsl_lpuart-add-modem-device-reset.patch | 2 +- ...l_lpuart-enable-dma-mode-for-imx8qxp.patch | 24 +++++----- ...-fsl_lpuart-do-HW-reset-for-communic.patch | 4 +- ...-serial-lpuart-add-runtime-pm-suppor.patch | 20 ++++---- ...uart-enable-wakeup-source-for-lpuart.patch | 26 +++++----- ...rial-fsl_lpuart-enable-two-stop-bits.patch | 6 +-- ...l-lpuart-support-UPIO_MEM32-for-lpua.patch | 2 +- .../0308-dts-mt7622-add-snand-support.patch | 2 +- ...dts-add-wmac-support-for-mt7622-rfb1.patch | 2 +- ...ek-Split-PCIe-node-for-MT2712-MT7622.patch | 4 +- ..._eth_soc-add-support-for-coherent-DM.patch | 2 +- ...ediatek-add-support-for-coherent-DMA.patch | 10 ++-- ...r-Gateworks-PLX-PEX860x-switch-with-.patch | 2 +- ...0031-uvc-add-iPassion-iP2970-support.patch | 22 ++++----- 88 files changed, 300 insertions(+), 318 deletions(-) diff --git a/include/kernel-5.4 b/include/kernel-5.4 index aabcbf24ee..a31315270a 100644 --- a/include/kernel-5.4 +++ b/include/kernel-5.4 @@ -1,2 +1,2 @@ -LINUX_VERSION-5.4 = .234 -LINUX_KERNEL_HASH-5.4.234 = acc79cb33f2e31bbd8267d4caa7e90bcc9ef5f1fdd060cd34117ad4dae950991 +LINUX_VERSION-5.4 = .238 +LINUX_KERNEL_HASH-5.4.238 = 70a2b2da85598eba6a73cdc0749e441cbdf3011d9babcb7028a46aa8d98aa91f diff --git a/target/linux/apm821xx/patches-5.4/111-crypto-crypto4xx-reduce-memory-fragmentation.patch b/target/linux/apm821xx/patches-5.4/111-crypto-crypto4xx-reduce-memory-fragmentation.patch index 4d23b8816a..b9ddd48c22 100644 --- a/target/linux/apm821xx/patches-5.4/111-crypto-crypto4xx-reduce-memory-fragmentation.patch +++ b/target/linux/apm821xx/patches-5.4/111-crypto-crypto4xx-reduce-memory-fragmentation.patch @@ -68,7 +68,7 @@ Signed-off-by: Christian Lamparter for (i = 0; i < PPC4XX_NUM_SD; i++) { dev->sdr[i].ptr = dev->scatter_buffer_pa + PPC4XX_SD_BUFFER_SIZE * i; -@@ -1439,16 +1440,15 @@ static int crypto4xx_probe(struct platfo +@@ -1437,16 +1438,15 @@ static int crypto4xx_probe(struct platfo spin_lock_init(&core_dev->lock); INIT_LIST_HEAD(&core_dev->dev->alg_list); ratelimit_default_init(&core_dev->dev->aead_ratelimit); @@ -89,7 +89,7 @@ Signed-off-by: Christian Lamparter goto err_build_sdr; /* Init tasklet for bottom half processing */ -@@ -1493,7 +1493,6 @@ err_iomap: +@@ -1491,7 +1491,6 @@ err_iomap: err_build_sdr: crypto4xx_destroy_sdr(core_dev->dev); crypto4xx_destroy_gdr(core_dev->dev); diff --git a/target/linux/bcm27xx/patches-5.4/950-0030-lan78xx-Enable-LEDs-and-auto-negotiation.patch b/target/linux/bcm27xx/patches-5.4/950-0030-lan78xx-Enable-LEDs-and-auto-negotiation.patch index 1964988c75..0e7c0c83b1 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0030-lan78xx-Enable-LEDs-and-auto-negotiation.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0030-lan78xx-Enable-LEDs-and-auto-negotiation.patch @@ -14,7 +14,7 @@ Signed-off-by: Phil Elwell --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c -@@ -2471,6 +2471,11 @@ static int lan78xx_reset(struct lan78xx_ +@@ -2435,6 +2435,11 @@ static int lan78xx_reset(struct lan78xx_ int ret = 0; unsigned long timeout; u8 sig; @@ -26,7 +26,7 @@ Signed-off-by: Phil Elwell ret = lan78xx_read_reg(dev, HW_CFG, &buf); buf |= HW_CFG_LRST_; -@@ -2524,6 +2529,9 @@ static int lan78xx_reset(struct lan78xx_ +@@ -2488,6 +2493,9 @@ static int lan78xx_reset(struct lan78xx_ ret = lan78xx_read_reg(dev, HW_CFG, &buf); buf |= HW_CFG_MEF_; @@ -36,7 +36,7 @@ Signed-off-by: Phil Elwell ret = lan78xx_write_reg(dev, HW_CFG, buf); ret = lan78xx_read_reg(dev, USB_CFG0, &buf); -@@ -2579,6 +2587,9 @@ static int lan78xx_reset(struct lan78xx_ +@@ -2543,6 +2551,9 @@ static int lan78xx_reset(struct lan78xx_ buf |= MAC_CR_AUTO_DUPLEX_ | MAC_CR_AUTO_SPEED_; } } diff --git a/target/linux/bcm27xx/patches-5.4/950-0111-lan78xx-Read-initial-EEE-status-from-DT.patch b/target/linux/bcm27xx/patches-5.4/950-0111-lan78xx-Read-initial-EEE-status-from-DT.patch index 796ec2fe8f..cebdb38afb 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0111-lan78xx-Read-initial-EEE-status-from-DT.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0111-lan78xx-Read-initial-EEE-status-from-DT.patch @@ -15,7 +15,7 @@ Signed-off-by: Phil Elwell --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c -@@ -2653,6 +2653,22 @@ static int lan78xx_open(struct net_devic +@@ -2617,6 +2617,22 @@ static int lan78xx_open(struct net_devic netif_dbg(dev, ifup, dev->net, "phy initialised successfully"); diff --git a/target/linux/bcm27xx/patches-5.4/950-0117-net-lan78xx-Disable-TCP-Segmentation-Offload-TSO.patch b/target/linux/bcm27xx/patches-5.4/950-0117-net-lan78xx-Disable-TCP-Segmentation-Offload-TSO.patch index 5310569838..9cc52f0934 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0117-net-lan78xx-Disable-TCP-Segmentation-Offload-TSO.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0117-net-lan78xx-Disable-TCP-Segmentation-Offload-TSO.patch @@ -37,7 +37,7 @@ Signed-off-by: Dave Stevenson static int lan78xx_read_reg(struct lan78xx_net *dev, u32 index, u32 *data) { u32 *buf = kmalloc(sizeof(u32), GFP_KERNEL); -@@ -2935,8 +2944,14 @@ static int lan78xx_bind(struct lan78xx_n +@@ -2899,8 +2908,14 @@ static int lan78xx_bind(struct lan78xx_n if (DEFAULT_RX_CSUM_ENABLE) dev->net->features |= NETIF_F_RXCSUM; diff --git a/target/linux/bcm27xx/patches-5.4/950-0118-lan78xx-Move-enabling-of-EEE-into-PHY-init-code.patch b/target/linux/bcm27xx/patches-5.4/950-0118-lan78xx-Move-enabling-of-EEE-into-PHY-init-code.patch index 7b931de951..95877137db 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0118-lan78xx-Move-enabling-of-EEE-into-PHY-init-code.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0118-lan78xx-Move-enabling-of-EEE-into-PHY-init-code.patch @@ -16,7 +16,7 @@ Signed-off-by: Phil Elwell --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c -@@ -2185,6 +2185,22 @@ static int lan78xx_phy_init(struct lan78 +@@ -2153,6 +2153,22 @@ static int lan78xx_phy_init(struct lan78 mii_adv_to_linkmode_adv_t(fc, mii_adv); linkmode_or(phydev->advertising, fc, phydev->advertising); @@ -39,7 +39,7 @@ Signed-off-by: Phil Elwell if (phydev->mdio.dev.of_node) { u32 reg; int len; -@@ -2662,22 +2678,6 @@ static int lan78xx_open(struct net_devic +@@ -2626,22 +2642,6 @@ static int lan78xx_open(struct net_devic netif_dbg(dev, ifup, dev->net, "phy initialised successfully"); diff --git a/target/linux/bcm27xx/patches-5.4/950-0132-lan78xx-Debounce-link-events-to-minimize-poll-storm.patch b/target/linux/bcm27xx/patches-5.4/950-0132-lan78xx-Debounce-link-events-to-minimize-poll-storm.patch index fe073c66df..78b6894f24 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0132-lan78xx-Debounce-link-events-to-minimize-poll-storm.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0132-lan78xx-Debounce-link-events-to-minimize-poll-storm.patch @@ -27,7 +27,7 @@ See: https://github.com/raspberrypi/linux/issues/2447 static int lan78xx_read_reg(struct lan78xx_net *dev, u32 index, u32 *data) { u32 *buf = kmalloc(sizeof(u32), GFP_KERNEL); -@@ -3778,7 +3783,12 @@ static int lan78xx_probe(struct usb_inte +@@ -3742,7 +3747,12 @@ static int lan78xx_probe(struct usb_inte netdev->max_mtu = MAX_SINGLE_PACKET_SIZE; netif_set_gso_max_size(netdev, MAX_SINGLE_PACKET_SIZE - MAX_HEADER); diff --git a/target/linux/bcm27xx/patches-5.4/950-0137-lan78xx-EEE-support-is-now-a-PHY-property.patch b/target/linux/bcm27xx/patches-5.4/950-0137-lan78xx-EEE-support-is-now-a-PHY-property.patch index 719264994e..d90fec9808 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0137-lan78xx-EEE-support-is-now-a-PHY-property.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0137-lan78xx-EEE-support-is-now-a-PHY-property.patch @@ -15,7 +15,7 @@ Signed-off-by: Phil Elwell --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c -@@ -2190,7 +2190,7 @@ static int lan78xx_phy_init(struct lan78 +@@ -2158,7 +2158,7 @@ static int lan78xx_phy_init(struct lan78 mii_adv_to_linkmode_adv_t(fc, mii_adv); linkmode_or(phydev->advertising, fc, phydev->advertising); diff --git a/target/linux/bcm27xx/patches-5.4/950-0145-lan78xx-use-default-alignment-for-rx-buffers.patch b/target/linux/bcm27xx/patches-5.4/950-0145-lan78xx-use-default-alignment-for-rx-buffers.patch index 6784c906e2..79882c4122 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0145-lan78xx-use-default-alignment-for-rx-buffers.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0145-lan78xx-use-default-alignment-for-rx-buffers.patch @@ -12,7 +12,7 @@ in both dwc_otg and in ipv6 processing. --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c -@@ -3179,7 +3179,7 @@ static int rx_submit(struct lan78xx_net +@@ -3143,7 +3143,7 @@ static int rx_submit(struct lan78xx_net size_t size = dev->rx_urb_size; int ret = 0; diff --git a/target/linux/bcm27xx/patches-5.4/950-0208-bcmgenet-Better-coalescing-parameter-defaults.patch b/target/linux/bcm27xx/patches-5.4/950-0208-bcmgenet-Better-coalescing-parameter-defaults.patch index a52331dff9..796f7dfe0a 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0208-bcmgenet-Better-coalescing-parameter-defaults.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0208-bcmgenet-Better-coalescing-parameter-defaults.patch @@ -18,7 +18,7 @@ Signed-off-by: Phil Elwell --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c -@@ -2157,7 +2157,7 @@ static void bcmgenet_init_tx_ring(struct +@@ -2165,7 +2165,7 @@ static void bcmgenet_init_tx_ring(struct bcmgenet_tdma_ring_writel(priv, index, 0, TDMA_PROD_INDEX); bcmgenet_tdma_ring_writel(priv, index, 0, TDMA_CONS_INDEX); @@ -27,7 +27,7 @@ Signed-off-by: Phil Elwell /* Disable rate control for now */ bcmgenet_tdma_ring_writel(priv, index, flow_period_val, TDMA_FLOW_PERIOD); -@@ -3583,9 +3583,12 @@ static int bcmgenet_probe(struct platfor +@@ -3591,9 +3591,12 @@ static int bcmgenet_probe(struct platfor netif_set_real_num_rx_queues(priv->dev, priv->hw_params->rx_queues + 1); /* Set default coalescing parameters */ diff --git a/target/linux/bcm27xx/patches-5.4/950-0280-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch b/target/linux/bcm27xx/patches-5.4/950-0280-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch index 2f8d628d1e..9d06e3c494 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0280-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0280-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch @@ -33,7 +33,7 @@ Signed-off-by: Jonathan Bell #define USB_VENDOR_ID_BELKIN 0x050d #define USB_DEVICE_ID_FLIP_KVM 0x3201 -@@ -1270,6 +1273,9 @@ +@@ -1271,6 +1274,9 @@ #define USB_VENDOR_ID_XAT 0x2505 #define USB_DEVICE_ID_XAT_CSR 0x0220 diff --git a/target/linux/bcm27xx/patches-5.4/950-0292-net-bcmgenet-Workaround-2-for-Pi4-Ethernet-fail.patch b/target/linux/bcm27xx/patches-5.4/950-0292-net-bcmgenet-Workaround-2-for-Pi4-Ethernet-fail.patch index ebbc07e86d..c2627136c0 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0292-net-bcmgenet-Workaround-2-for-Pi4-Ethernet-fail.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0292-net-bcmgenet-Workaround-2-for-Pi4-Ethernet-fail.patch @@ -38,7 +38,7 @@ Signed-off-by: Phil Elwell static inline void bcmgenet_writel(u32 value, void __iomem *offset) { /* MIPS chips strapped for BE will automagically configure the -@@ -2003,6 +2007,11 @@ static void reset_umac(struct bcmgenet_p +@@ -2011,6 +2015,11 @@ static void reset_umac(struct bcmgenet_p bcmgenet_rbuf_ctrl_set(priv, 0); udelay(10); diff --git a/target/linux/bcm27xx/patches-5.4/950-0313-kbuild-Allow-.dtbo-overlays-to-be-built-piecemeal.patch b/target/linux/bcm27xx/patches-5.4/950-0313-kbuild-Allow-.dtbo-overlays-to-be-built-piecemeal.patch index 7a9646689f..d72712eb8b 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0313-kbuild-Allow-.dtbo-overlays-to-be-built-piecemeal.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0313-kbuild-Allow-.dtbo-overlays-to-be-built-piecemeal.patch @@ -24,7 +24,7 @@ Signed-off-by: Phil Elwell --- a/Makefile +++ b/Makefile -@@ -1274,6 +1274,9 @@ ifneq ($(dtstree),) +@@ -1281,6 +1281,9 @@ ifneq ($(dtstree),) %.dtb: include/config/kernel.release scripts_dtc $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@ diff --git a/target/linux/bcm27xx/patches-5.4/950-0336-drm-v3d-The-third-IRQ-is-optional.patch b/target/linux/bcm27xx/patches-5.4/950-0336-drm-v3d-The-third-IRQ-is-optional.patch index 50fc594e1e..7d4b6bb4d9 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0336-drm-v3d-The-third-IRQ-is-optional.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0336-drm-v3d-The-third-IRQ-is-optional.patch @@ -13,7 +13,7 @@ Signed-off-by: Phil Elwell --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c -@@ -3482,7 +3482,7 @@ static int bcmgenet_probe(struct platfor +@@ -3490,7 +3490,7 @@ static int bcmgenet_probe(struct platfor priv = netdev_priv(dev); priv->irq0 = platform_get_irq(pdev, 0); priv->irq1 = platform_get_irq(pdev, 1); diff --git a/target/linux/bcm27xx/patches-5.4/950-0441-PCI-of-Add-inbound-resource-parsing-to-helpers.patch b/target/linux/bcm27xx/patches-5.4/950-0441-PCI-of-Add-inbound-resource-parsing-to-helpers.patch index 08d0b1cb9a..e515f331ee 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0441-PCI-of-Add-inbound-resource-parsing-to-helpers.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0441-PCI-of-Add-inbound-resource-parsing-to-helpers.patch @@ -382,7 +382,7 @@ Cc: linux-rockchip@lists.infradead.org --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h -@@ -643,11 +643,15 @@ static inline void pci_release_bus_of_no +@@ -634,11 +634,15 @@ static inline void pci_release_bus_of_no #if defined(CONFIG_OF_ADDRESS) int devm_of_pci_get_host_bridge_resources(struct device *dev, unsigned char busno, unsigned char bus_max, diff --git a/target/linux/bcm27xx/patches-5.4/950-0454-Kbuild-Allow-.dtbo-overlays-to-be-built-adjust.patch b/target/linux/bcm27xx/patches-5.4/950-0454-Kbuild-Allow-.dtbo-overlays-to-be-built-adjust.patch index d1b71a9cf8..e61e6e4e13 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0454-Kbuild-Allow-.dtbo-overlays-to-be-built-adjust.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0454-Kbuild-Allow-.dtbo-overlays-to-be-built-adjust.patch @@ -15,7 +15,7 @@ Signed-off-by: Nataliya Korovkina --- a/Makefile +++ b/Makefile -@@ -1274,7 +1274,7 @@ ifneq ($(dtstree),) +@@ -1281,7 +1281,7 @@ ifneq ($(dtstree),) %.dtb: include/config/kernel.release scripts_dtc $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@ diff --git a/target/linux/bcm27xx/patches-5.4/950-0461-drm-fourcc-Add-packed-10bit-YUV-4-2-0-format.patch b/target/linux/bcm27xx/patches-5.4/950-0461-drm-fourcc-Add-packed-10bit-YUV-4-2-0-format.patch index ac4fe1698b..6c9239c1ad 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0461-drm-fourcc-Add-packed-10bit-YUV-4-2-0-format.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0461-drm-fourcc-Add-packed-10bit-YUV-4-2-0-format.patch @@ -16,7 +16,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/gpu/drm/drm_fourcc.c +++ b/drivers/gpu/drm/drm_fourcc.c -@@ -274,6 +274,9 @@ const struct drm_format_info *__drm_form +@@ -278,6 +278,9 @@ const struct drm_format_info *__drm_form { .format = DRM_FORMAT_YUV420_10BIT, .depth = 0, .num_planes = 1, .cpp = { 0, 0, 0 }, .hsub = 2, .vsub = 2, .is_yuv = true }, diff --git a/target/linux/bcm27xx/patches-5.4/950-0973-net-bcmgenet-Reset-RBUF-on-first-open.patch b/target/linux/bcm27xx/patches-5.4/950-0973-net-bcmgenet-Reset-RBUF-on-first-open.patch index 367eb9ef8d..c66ce3c0a2 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0973-net-bcmgenet-Reset-RBUF-on-first-open.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0973-net-bcmgenet-Reset-RBUF-on-first-open.patch @@ -24,7 +24,7 @@ Signed-off-by: Phil Elwell --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c -@@ -2798,7 +2798,7 @@ static void bcmgenet_set_hw_addr(struct +@@ -2806,7 +2806,7 @@ static void bcmgenet_set_hw_addr(struct } /* Returns a reusable dma control register value */ @@ -33,7 +33,7 @@ Signed-off-by: Phil Elwell { unsigned int i; u32 reg; -@@ -2823,6 +2823,14 @@ static u32 bcmgenet_dma_disable(struct b +@@ -2831,6 +2831,14 @@ static u32 bcmgenet_dma_disable(struct b udelay(10); bcmgenet_umac_writel(priv, 0, UMAC_TX_FLUSH); @@ -48,7 +48,7 @@ Signed-off-by: Phil Elwell return dma_ctrl; } -@@ -2918,8 +2926,8 @@ static int bcmgenet_open(struct net_devi +@@ -2926,8 +2934,8 @@ static int bcmgenet_open(struct net_devi bcmgenet_set_hw_addr(priv, dev->dev_addr); @@ -59,7 +59,7 @@ Signed-off-by: Phil Elwell /* Reinitialize TDMA and RDMA and SW housekeeping */ ret = bcmgenet_init_dma(priv); -@@ -3674,7 +3682,7 @@ static int bcmgenet_resume(struct device +@@ -3682,7 +3690,7 @@ static int bcmgenet_resume(struct device bcmgenet_power_up(priv, GENET_POWER_WOL_MAGIC); /* Disable RX/TX DMA and flush TX queues */ diff --git a/target/linux/bcm27xx/patches-5.4/950-1031-net-lan78xx-Ack-pending-PHY-ints-when-resetting.patch b/target/linux/bcm27xx/patches-5.4/950-1031-net-lan78xx-Ack-pending-PHY-ints-when-resetting.patch index f0d23f9be1..3cb59fafd8 100644 --- a/target/linux/bcm27xx/patches-5.4/950-1031-net-lan78xx-Ack-pending-PHY-ints-when-resetting.patch +++ b/target/linux/bcm27xx/patches-5.4/950-1031-net-lan78xx-Ack-pending-PHY-ints-when-resetting.patch @@ -20,7 +20,7 @@ Signed-off-by: Phil Elwell --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c -@@ -1183,6 +1183,9 @@ static int lan78xx_link_reset(struct lan +@@ -1179,6 +1179,9 @@ static int lan78xx_link_reset(struct lan if (unlikely(ret < 0)) return -EIO; diff --git a/target/linux/generic/backport-5.4/011-kbuild-export-SUBARCH.patch b/target/linux/generic/backport-5.4/011-kbuild-export-SUBARCH.patch index 60defa39c5..59f7a909c5 100644 --- a/target/linux/generic/backport-5.4/011-kbuild-export-SUBARCH.patch +++ b/target/linux/generic/backport-5.4/011-kbuild-export-SUBARCH.patch @@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau --- a/Makefile +++ b/Makefile -@@ -493,7 +493,7 @@ KBUILD_LDFLAGS := +@@ -500,7 +500,7 @@ KBUILD_LDFLAGS := GCC_PLUGINS_CFLAGS := CLANG_FLAGS := diff --git a/target/linux/generic/backport-5.4/600-v5.12-net-extract-napi-poll-functionality-to-__napi_poll.patch b/target/linux/generic/backport-5.4/600-v5.12-net-extract-napi-poll-functionality-to-__napi_poll.patch index 02b5b575db..34686f84a7 100644 --- a/target/linux/generic/backport-5.4/600-v5.12-net-extract-napi-poll-functionality-to-__napi_poll.patch +++ b/target/linux/generic/backport-5.4/600-v5.12-net-extract-napi-poll-functionality-to-__napi_poll.patch @@ -18,7 +18,7 @@ Signed-off-by: David S. Miller --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -6326,15 +6326,10 @@ void netif_napi_del(struct napi_struct * +@@ -6328,15 +6328,10 @@ void netif_napi_del(struct napi_struct * } EXPORT_SYMBOL(netif_napi_del); @@ -35,7 +35,7 @@ Signed-off-by: David S. Miller weight = n->weight; /* This NAPI_STATE_SCHED test is for avoiding a race -@@ -6352,7 +6347,7 @@ static int napi_poll(struct napi_struct +@@ -6354,7 +6349,7 @@ static int napi_poll(struct napi_struct WARN_ON_ONCE(work > weight); if (likely(work < weight)) @@ -44,7 +44,7 @@ Signed-off-by: David S. Miller /* Drivers must not modify the NAPI state if they * consume the entire weight. In such cases this code -@@ -6361,7 +6356,7 @@ static int napi_poll(struct napi_struct +@@ -6363,7 +6358,7 @@ static int napi_poll(struct napi_struct */ if (unlikely(napi_disable_pending(n))) { napi_complete(n); @@ -53,7 +53,7 @@ Signed-off-by: David S. Miller } if (n->gro_bitmask) { -@@ -6379,12 +6374,29 @@ static int napi_poll(struct napi_struct +@@ -6381,12 +6376,29 @@ static int napi_poll(struct napi_struct if (unlikely(!list_empty(&n->poll_list))) { pr_warn_once("%s: Budget exhausted after napi rescheduled\n", n->dev ? n->dev->name : "backlog"); diff --git a/target/linux/generic/backport-5.4/601-v5.12-net-implement-threaded-able-napi-poll-loop-support.patch b/target/linux/generic/backport-5.4/601-v5.12-net-implement-threaded-able-napi-poll-loop-support.patch index 1ece7cf1d3..c890240915 100644 --- a/target/linux/generic/backport-5.4/601-v5.12-net-implement-threaded-able-napi-poll-loop-support.patch +++ b/target/linux/generic/backport-5.4/601-v5.12-net-implement-threaded-able-napi-poll-loop-support.patch @@ -30,7 +30,7 @@ Signed-off-by: David S. Miller --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h -@@ -347,6 +347,7 @@ struct napi_struct { +@@ -349,6 +349,7 @@ struct napi_struct { struct list_head dev_list; struct hlist_node napi_hash_node; unsigned int napi_id; @@ -38,7 +38,7 @@ Signed-off-by: David S. Miller }; enum { -@@ -357,6 +358,7 @@ enum { +@@ -359,6 +360,7 @@ enum { NAPI_STATE_HASHED, /* In NAPI hash (busy polling possible) */ NAPI_STATE_NO_BUSY_POLL,/* Do not add in napi_hash, no busy polling */ NAPI_STATE_IN_BUSY_POLL,/* sk_busy_loop() owns this NAPI */ @@ -46,7 +46,7 @@ Signed-off-by: David S. Miller }; enum { -@@ -367,6 +369,7 @@ enum { +@@ -369,6 +371,7 @@ enum { NAPIF_STATE_HASHED = BIT(NAPI_STATE_HASHED), NAPIF_STATE_NO_BUSY_POLL = BIT(NAPI_STATE_NO_BUSY_POLL), NAPIF_STATE_IN_BUSY_POLL = BIT(NAPI_STATE_IN_BUSY_POLL), @@ -54,7 +54,7 @@ Signed-off-by: David S. Miller }; enum gro_result { -@@ -511,20 +514,7 @@ bool napi_hash_del(struct napi_struct *n +@@ -513,20 +516,7 @@ bool napi_hash_del(struct napi_struct *n */ void napi_disable(struct napi_struct *n); @@ -76,7 +76,7 @@ Signed-off-by: David S. Miller /** * napi_synchronize - wait until NAPI is not running -@@ -1790,6 +1780,8 @@ enum netdev_ml_priv_type { +@@ -1792,6 +1782,8 @@ enum netdev_ml_priv_type { * * @wol_enabled: Wake-on-LAN is enabled * @@ -85,7 +85,7 @@ Signed-off-by: David S. Miller * FIXME: cleanup struct net_device such that network protocol info * moves out. */ -@@ -2082,6 +2074,7 @@ struct net_device { +@@ -2084,6 +2076,7 @@ struct net_device { struct lock_class_key addr_list_lock_key; bool proto_down; unsigned wol_enabled:1; @@ -131,7 +131,7 @@ Signed-off-by: David S. Miller static int __dev_open(struct net_device *dev, struct netlink_ext_ack *extack) { const struct net_device_ops *ops = dev->netdev_ops; -@@ -3889,6 +3911,21 @@ int gro_normal_batch __read_mostly = 8; +@@ -3891,6 +3913,21 @@ int gro_normal_batch __read_mostly = 8; static inline void ____napi_schedule(struct softnet_data *sd, struct napi_struct *napi) { @@ -153,7 +153,7 @@ Signed-off-by: David S. Miller list_add_tail(&napi->poll_list, &sd->poll_list); __raise_softirq_irqoff(NET_RX_SOFTIRQ); } -@@ -6280,6 +6317,12 @@ void netif_napi_add(struct net_device *d +@@ -6282,6 +6319,12 @@ void netif_napi_add(struct net_device *d set_bit(NAPI_STATE_NPSVC, &napi->state); list_add_rcu(&napi->dev_list, &dev->napi_list); napi_hash_add(napi); @@ -166,7 +166,7 @@ Signed-off-by: David S. Miller } EXPORT_SYMBOL(netif_napi_add); -@@ -6296,9 +6339,28 @@ void napi_disable(struct napi_struct *n) +@@ -6298,9 +6341,28 @@ void napi_disable(struct napi_struct *n) hrtimer_cancel(&n->timer); clear_bit(NAPI_STATE_DISABLE, &n->state); @@ -195,7 +195,7 @@ Signed-off-by: David S. Miller static void flush_gro_hash(struct napi_struct *napi) { int i; -@@ -6323,6 +6385,11 @@ void netif_napi_del(struct napi_struct * +@@ -6325,6 +6387,11 @@ void netif_napi_del(struct napi_struct * flush_gro_hash(napi); napi->gro_bitmask = 0; @@ -207,7 +207,7 @@ Signed-off-by: David S. Miller } EXPORT_SYMBOL(netif_napi_del); -@@ -6402,6 +6469,51 @@ static int napi_poll(struct napi_struct +@@ -6404,6 +6471,51 @@ static int napi_poll(struct napi_struct return work; } diff --git a/target/linux/generic/backport-5.4/602-v5.12-net-add-sysfs-attribute-to-control-napi-threaded-mod.patch b/target/linux/generic/backport-5.4/602-v5.12-net-add-sysfs-attribute-to-control-napi-threaded-mod.patch index 93a8559fa6..05c40a91d5 100644 --- a/target/linux/generic/backport-5.4/602-v5.12-net-add-sysfs-attribute-to-control-napi-threaded-mod.patch +++ b/target/linux/generic/backport-5.4/602-v5.12-net-add-sysfs-attribute-to-control-napi-threaded-mod.patch @@ -46,7 +46,7 @@ Signed-off-by: David S. Miller + == ================================== --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h -@@ -505,6 +505,8 @@ static inline bool napi_complete(struct +@@ -507,6 +507,8 @@ static inline bool napi_complete(struct */ bool napi_hash_del(struct napi_struct *napi); @@ -57,7 +57,7 @@ Signed-off-by: David S. Miller * @n: NAPI context --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -3915,8 +3915,9 @@ static inline void ____napi_schedule(str +@@ -3917,8 +3917,9 @@ static inline void ____napi_schedule(str if (test_bit(NAPI_STATE_THREADED, &napi->state)) { /* Paired with smp_mb__before_atomic() in @@ -69,7 +69,7 @@ Signed-off-by: David S. Miller * wake_up_process() when it's not NULL. */ thread = READ_ONCE(napi->thread); -@@ -6294,6 +6295,49 @@ static void init_gro_hash(struct napi_st +@@ -6296,6 +6297,49 @@ static void init_gro_hash(struct napi_st napi->gro_bitmask = 0; } diff --git a/target/linux/generic/backport-5.4/603-v5.12-net-fix-race-between-napi-kthread-mode-and-busy-poll.patch b/target/linux/generic/backport-5.4/603-v5.12-net-fix-race-between-napi-kthread-mode-and-busy-poll.patch index 30a795df59..103ed5713b 100644 --- a/target/linux/generic/backport-5.4/603-v5.12-net-fix-race-between-napi-kthread-mode-and-busy-poll.patch +++ b/target/linux/generic/backport-5.4/603-v5.12-net-fix-race-between-napi-kthread-mode-and-busy-poll.patch @@ -27,7 +27,7 @@ Cc: Hannes Frederic Sowa --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h -@@ -359,6 +359,7 @@ enum { +@@ -361,6 +361,7 @@ enum { NAPI_STATE_NO_BUSY_POLL,/* Do not add in napi_hash, no busy polling */ NAPI_STATE_IN_BUSY_POLL,/* sk_busy_loop() owns this NAPI */ NAPI_STATE_THREADED, /* The poll is performed inside its own thread*/ @@ -35,7 +35,7 @@ Cc: Hannes Frederic Sowa }; enum { -@@ -370,6 +371,7 @@ enum { +@@ -372,6 +373,7 @@ enum { NAPIF_STATE_NO_BUSY_POLL = BIT(NAPI_STATE_NO_BUSY_POLL), NAPIF_STATE_IN_BUSY_POLL = BIT(NAPI_STATE_IN_BUSY_POLL), NAPIF_STATE_THREADED = BIT(NAPI_STATE_THREADED), @@ -45,7 +45,7 @@ Cc: Hannes Frederic Sowa enum gro_result { --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -3922,6 +3922,8 @@ static inline void ____napi_schedule(str +@@ -3924,6 +3924,8 @@ static inline void ____napi_schedule(str */ thread = READ_ONCE(napi->thread); if (thread) { @@ -54,7 +54,7 @@ Cc: Hannes Frederic Sowa wake_up_process(thread); return; } -@@ -6082,7 +6084,8 @@ bool napi_complete_done(struct napi_stru +@@ -6084,7 +6086,8 @@ bool napi_complete_done(struct napi_stru WARN_ON_ONCE(!(val & NAPIF_STATE_SCHED)); @@ -64,7 +64,7 @@ Cc: Hannes Frederic Sowa /* If STATE_MISSED was set, leave STATE_SCHED set, * because we will call napi->poll() one more time. -@@ -6515,16 +6518,25 @@ static int napi_poll(struct napi_struct +@@ -6517,16 +6520,25 @@ static int napi_poll(struct napi_struct static int napi_thread_wait(struct napi_struct *napi) { diff --git a/target/linux/generic/backport-5.4/604-v5.12-net-fix-hangup-on-napi_disable-for-threaded-napi.patch b/target/linux/generic/backport-5.4/604-v5.12-net-fix-hangup-on-napi_disable-for-threaded-napi.patch index a60763db60..a02597329b 100644 --- a/target/linux/generic/backport-5.4/604-v5.12-net-fix-hangup-on-napi_disable-for-threaded-napi.patch +++ b/target/linux/generic/backport-5.4/604-v5.12-net-fix-hangup-on-napi_disable-for-threaded-napi.patch @@ -34,7 +34,7 @@ Signed-off-by: Jakub Kicinski --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -6522,7 +6522,7 @@ static int napi_thread_wait(struct napi_ +@@ -6524,7 +6524,7 @@ static int napi_thread_wait(struct napi_ set_current_state(TASK_INTERRUPTIBLE); @@ -43,7 +43,7 @@ Signed-off-by: Jakub Kicinski /* Testing SCHED_THREADED bit here to make sure the current * kthread owns this napi and could poll on this napi. * Testing SCHED bit is not enough because SCHED bit might be -@@ -6540,6 +6540,7 @@ static int napi_thread_wait(struct napi_ +@@ -6542,6 +6542,7 @@ static int napi_thread_wait(struct napi_ set_current_state(TASK_INTERRUPTIBLE); } __set_current_state(TASK_RUNNING); diff --git a/target/linux/generic/backport-5.4/700-v5.5-net-core-allow-fast-GRO-for-skbs-with-Ethernet-heade.patch b/target/linux/generic/backport-5.4/700-v5.5-net-core-allow-fast-GRO-for-skbs-with-Ethernet-heade.patch index aeb22f5a0a..b063efb859 100644 --- a/target/linux/generic/backport-5.4/700-v5.5-net-core-allow-fast-GRO-for-skbs-with-Ethernet-heade.patch +++ b/target/linux/generic/backport-5.4/700-v5.5-net-core-allow-fast-GRO-for-skbs-with-Ethernet-heade.patch @@ -66,7 +66,7 @@ Signed-off-by: David S. Miller --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -5476,8 +5476,7 @@ static inline void skb_gro_reset_offset( +@@ -5478,8 +5478,7 @@ static inline void skb_gro_reset_offset( NAPI_GRO_CB(skb)->frag0 = NULL; NAPI_GRO_CB(skb)->frag0_len = 0; diff --git a/target/linux/generic/hack-5.4/221-module_exports.patch b/target/linux/generic/hack-5.4/221-module_exports.patch index 446bf53008..e8b775e2a9 100644 --- a/target/linux/generic/hack-5.4/221-module_exports.patch +++ b/target/linux/generic/hack-5.4/221-module_exports.patch @@ -56,9 +56,9 @@ Signed-off-by: Felix Fietkau } \ \ /* __*init sections */ \ -@@ -905,6 +915,8 @@ - EXIT_TEXT \ - EXIT_DATA \ +@@ -917,6 +927,8 @@ + /DISCARD/ : { \ + EXIT_DISCARDS \ EXIT_CALL \ + SYMTAB_DISCARD \ + SYMTAB_DISCARD_GPL \ diff --git a/target/linux/generic/hack-5.4/721-phy_packets.patch b/target/linux/generic/hack-5.4/721-phy_packets.patch index 9dfeaa27fa..3df66bc4df 100644 --- a/target/linux/generic/hack-5.4/721-phy_packets.patch +++ b/target/linux/generic/hack-5.4/721-phy_packets.patch @@ -15,7 +15,7 @@ Signed-off-by: Felix Fietkau --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h -@@ -1547,6 +1547,7 @@ enum netdev_priv_flags { +@@ -1549,6 +1549,7 @@ enum netdev_priv_flags { IFF_FAILOVER_SLAVE = 1<<28, IFF_L3MDEV_RX_HANDLER = 1<<29, IFF_LIVE_RENAME_OK = 1<<30, @@ -23,7 +23,7 @@ Signed-off-by: Felix Fietkau }; #define IFF_802_1Q_VLAN IFF_802_1Q_VLAN -@@ -1579,6 +1580,7 @@ enum netdev_priv_flags { +@@ -1581,6 +1582,7 @@ enum netdev_priv_flags { #define IFF_FAILOVER_SLAVE IFF_FAILOVER_SLAVE #define IFF_L3MDEV_RX_HANDLER IFF_L3MDEV_RX_HANDLER #define IFF_LIVE_RENAME_OK IFF_LIVE_RENAME_OK @@ -31,7 +31,7 @@ Signed-off-by: Felix Fietkau /* Specifies the type of the struct net_device::ml_priv pointer */ enum netdev_ml_priv_type { -@@ -1889,6 +1891,11 @@ struct net_device { +@@ -1891,6 +1893,11 @@ struct net_device { const struct tlsdev_ops *tlsdev_ops; #endif @@ -43,7 +43,7 @@ Signed-off-by: Felix Fietkau const struct header_ops *header_ops; unsigned int flags; -@@ -1971,6 +1978,10 @@ struct net_device { +@@ -1973,6 +1980,10 @@ struct net_device { struct mpls_dev __rcu *mpls_ptr; #endif @@ -101,7 +101,7 @@ Signed-off-by: Felix Fietkau help --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -3221,10 +3221,20 @@ static int xmit_one(struct sk_buff *skb, +@@ -3223,10 +3223,20 @@ static int xmit_one(struct sk_buff *skb, if (dev_nit_active(dev)) dev_queue_xmit_nit(skb, dev); diff --git a/target/linux/generic/hack-5.4/902-debloat_proc.patch b/target/linux/generic/hack-5.4/902-debloat_proc.patch index afde1e88df..44423db0d8 100644 --- a/target/linux/generic/hack-5.4/902-debloat_proc.patch +++ b/target/linux/generic/hack-5.4/902-debloat_proc.patch @@ -330,7 +330,7 @@ Signed-off-by: Felix Fietkau --- a/net/core/sock.c +++ b/net/core/sock.c -@@ -3641,6 +3641,8 @@ static __net_initdata struct pernet_oper +@@ -3657,6 +3657,8 @@ static __net_initdata struct pernet_oper static int __init proto_init(void) { diff --git a/target/linux/generic/pending-5.4/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch b/target/linux/generic/pending-5.4/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch index c670010989..b21daea4f0 100644 --- a/target/linux/generic/pending-5.4/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch +++ b/target/linux/generic/pending-5.4/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch @@ -8,7 +8,7 @@ Signed-off-by: Daniel Golle --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c -@@ -1161,6 +1161,73 @@ static struct mtd_info * __init open_mtd +@@ -1168,6 +1168,73 @@ static struct mtd_info * __init open_mtd return mtd; } @@ -82,7 +82,7 @@ Signed-off-by: Daniel Golle static int __init ubi_init(void) { int err, i, k; -@@ -1244,6 +1311,12 @@ static int __init ubi_init(void) +@@ -1251,6 +1318,12 @@ static int __init ubi_init(void) } } diff --git a/target/linux/generic/pending-5.4/640-netfilter-nf_flow_table-add-hardware-offload-support.patch b/target/linux/generic/pending-5.4/640-netfilter-nf_flow_table-add-hardware-offload-support.patch index 5767b41a26..88d2cb10ad 100644 --- a/target/linux/generic/pending-5.4/640-netfilter-nf_flow_table-add-hardware-offload-support.patch +++ b/target/linux/generic/pending-5.4/640-netfilter-nf_flow_table-add-hardware-offload-support.patch @@ -23,7 +23,7 @@ Signed-off-by: Pablo Neira Ayuso --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h -@@ -929,6 +929,13 @@ struct devlink; +@@ -931,6 +931,13 @@ struct devlink; struct tlsdev_ops; @@ -37,7 +37,7 @@ Signed-off-by: Pablo Neira Ayuso /* * This structure defines the management hooks for network devices. * The following hooks can be defined; unless noted otherwise, they are -@@ -1161,6 +1168,10 @@ struct tlsdev_ops; +@@ -1163,6 +1170,10 @@ struct tlsdev_ops; * int (*ndo_bridge_dellink)(struct net_device *dev, struct nlmsghdr *nlh, * u16 flags); * @@ -48,7 +48,7 @@ Signed-off-by: Pablo Neira Ayuso * int (*ndo_change_carrier)(struct net_device *dev, bool new_carrier); * Called to change device carrier. Soft-devices (like dummy, team, etc) * which do not represent real hardware may define this to allow their -@@ -1408,6 +1419,8 @@ struct net_device_ops { +@@ -1410,6 +1421,8 @@ struct net_device_ops { int (*ndo_bridge_dellink)(struct net_device *dev, struct nlmsghdr *nlh, u16 flags); diff --git a/target/linux/generic/pending-5.4/641-netfilter-nf_flow_table-support-hw-offload-through-v.patch b/target/linux/generic/pending-5.4/641-netfilter-nf_flow_table-support-hw-offload-through-v.patch index 7cb79f70e2..d766ca9140 100644 --- a/target/linux/generic/pending-5.4/641-netfilter-nf_flow_table-support-hw-offload-through-v.patch +++ b/target/linux/generic/pending-5.4/641-netfilter-nf_flow_table-support-hw-offload-through-v.patch @@ -15,7 +15,7 @@ Signed-off-by: Felix Fietkau --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h -@@ -930,6 +930,7 @@ struct tlsdev_ops; +@@ -932,6 +932,7 @@ struct tlsdev_ops; struct flow_offload; @@ -23,7 +23,7 @@ Signed-off-by: Felix Fietkau enum flow_offload_type { FLOW_OFFLOAD_ADD = 0, -@@ -1168,8 +1169,15 @@ enum flow_offload_type { +@@ -1170,8 +1171,15 @@ enum flow_offload_type { * int (*ndo_bridge_dellink)(struct net_device *dev, struct nlmsghdr *nlh, * u16 flags); * @@ -40,7 +40,7 @@ Signed-off-by: Felix Fietkau * Adds/deletes flow entry to/from net device flowtable. * * int (*ndo_change_carrier)(struct net_device *dev, bool new_carrier); -@@ -1419,8 +1427,11 @@ struct net_device_ops { +@@ -1421,8 +1429,11 @@ struct net_device_ops { int (*ndo_bridge_dellink)(struct net_device *dev, struct nlmsghdr *nlh, u16 flags); diff --git a/target/linux/generic/pending-5.4/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch b/target/linux/generic/pending-5.4/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch index f46dc94c5a..96aa2fd8fc 100644 --- a/target/linux/generic/pending-5.4/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch +++ b/target/linux/generic/pending-5.4/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch @@ -185,7 +185,7 @@ Signed-off-by: Jonas Gorski cfg->fc_flags |= RTF_REJECT; if (rtm->rtm_type == RTN_LOCAL) -@@ -6091,6 +6122,8 @@ static int ip6_route_dev_notify(struct n +@@ -6092,6 +6123,8 @@ static int ip6_route_dev_notify(struct n #ifdef CONFIG_IPV6_MULTIPLE_TABLES net->ipv6.ip6_prohibit_entry->dst.dev = dev; net->ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(dev); @@ -194,7 +194,7 @@ Signed-off-by: Jonas Gorski net->ipv6.ip6_blk_hole_entry->dst.dev = dev; net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev); #endif -@@ -6102,6 +6135,7 @@ static int ip6_route_dev_notify(struct n +@@ -6103,6 +6136,7 @@ static int ip6_route_dev_notify(struct n in6_dev_put_clear(&net->ipv6.ip6_null_entry->rt6i_idev); #ifdef CONFIG_IPV6_MULTIPLE_TABLES in6_dev_put_clear(&net->ipv6.ip6_prohibit_entry->rt6i_idev); @@ -202,7 +202,7 @@ Signed-off-by: Jonas Gorski in6_dev_put_clear(&net->ipv6.ip6_blk_hole_entry->rt6i_idev); #endif } -@@ -6294,6 +6328,8 @@ static int __net_init ip6_route_net_init +@@ -6295,6 +6329,8 @@ static int __net_init ip6_route_net_init #ifdef CONFIG_IPV6_MULTIPLE_TABLES net->ipv6.fib6_has_custom_rules = false; @@ -211,7 +211,7 @@ Signed-off-by: Jonas Gorski net->ipv6.ip6_prohibit_entry = kmemdup(&ip6_prohibit_entry_template, sizeof(*net->ipv6.ip6_prohibit_entry), GFP_KERNEL); -@@ -6304,11 +6340,21 @@ static int __net_init ip6_route_net_init +@@ -6305,11 +6341,21 @@ static int __net_init ip6_route_net_init ip6_template_metrics, true); INIT_LIST_HEAD(&net->ipv6.ip6_prohibit_entry->rt6i_uncached); @@ -234,7 +234,7 @@ Signed-off-by: Jonas Gorski net->ipv6.ip6_blk_hole_entry->dst.ops = &net->ipv6.ip6_dst_ops; dst_init_metrics(&net->ipv6.ip6_blk_hole_entry->dst, ip6_template_metrics, true); -@@ -6332,6 +6378,8 @@ out: +@@ -6333,6 +6379,8 @@ out: return ret; #ifdef CONFIG_IPV6_MULTIPLE_TABLES @@ -243,7 +243,7 @@ Signed-off-by: Jonas Gorski out_ip6_prohibit_entry: kfree(net->ipv6.ip6_prohibit_entry); out_ip6_null_entry: -@@ -6351,6 +6399,7 @@ static void __net_exit ip6_route_net_exi +@@ -6352,6 +6400,7 @@ static void __net_exit ip6_route_net_exi kfree(net->ipv6.ip6_null_entry); #ifdef CONFIG_IPV6_MULTIPLE_TABLES kfree(net->ipv6.ip6_prohibit_entry); @@ -251,7 +251,7 @@ Signed-off-by: Jonas Gorski kfree(net->ipv6.ip6_blk_hole_entry); #endif dst_entries_destroy(&net->ipv6.ip6_dst_ops); -@@ -6434,6 +6483,9 @@ void __init ip6_route_init_special_entri +@@ -6435,6 +6484,9 @@ void __init ip6_route_init_special_entri init_net.ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev; init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); diff --git a/target/linux/generic/pending-5.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/pending-5.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch index 614ac76f23..bec6787dc8 100644 --- a/target/linux/generic/pending-5.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch +++ b/target/linux/generic/pending-5.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch @@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h -@@ -1934,6 +1934,8 @@ struct net_device { +@@ -1936,6 +1936,8 @@ struct net_device { struct netdev_hw_addr_list mc; struct netdev_hw_addr_list dev_addrs; @@ -32,7 +32,7 @@ Signed-off-by: Felix Fietkau __u16 tc_index; /* traffic control index */ --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -5542,6 +5542,9 @@ static enum gro_result dev_gro_receive(s +@@ -5544,6 +5544,9 @@ static enum gro_result dev_gro_receive(s int same_flow; int grow; @@ -42,7 +42,7 @@ Signed-off-by: Felix Fietkau if (netif_elide_gro(skb->dev)) goto normal; -@@ -7485,6 +7488,48 @@ static void __netdev_adjacent_dev_unlink +@@ -7487,6 +7490,48 @@ static void __netdev_adjacent_dev_unlink &upper_dev->adj_list.lower); } @@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau static int __netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev, bool master, void *upper_priv, void *upper_info, -@@ -7535,6 +7580,7 @@ static int __netdev_upper_dev_link(struc +@@ -7537,6 +7582,7 @@ static int __netdev_upper_dev_link(struc if (ret) return ret; @@ -99,7 +99,7 @@ Signed-off-by: Felix Fietkau ret = call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, &changeupper_info.info); ret = notifier_to_errno(ret); -@@ -7628,6 +7674,7 @@ void netdev_upper_dev_unlink(struct net_ +@@ -7630,6 +7676,7 @@ void netdev_upper_dev_unlink(struct net_ __netdev_adjacent_dev_unlink_neighbour(dev, upper_dev); @@ -107,7 +107,7 @@ Signed-off-by: Felix Fietkau call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, &changeupper_info.info); -@@ -8358,6 +8405,7 @@ int dev_set_mac_address(struct net_devic +@@ -8360,6 +8407,7 @@ int dev_set_mac_address(struct net_devic if (err) return err; dev->addr_assign_type = NET_ADDR_SET; diff --git a/target/linux/ipq40xx/patches-5.4/703-net-IPQ4019-needs-rfs-vlan_tag-callbacks-in.patch b/target/linux/ipq40xx/patches-5.4/703-net-IPQ4019-needs-rfs-vlan_tag-callbacks-in.patch index 5b600c29f2..167673bd11 100644 --- a/target/linux/ipq40xx/patches-5.4/703-net-IPQ4019-needs-rfs-vlan_tag-callbacks-in.patch +++ b/target/linux/ipq40xx/patches-5.4/703-net-IPQ4019-needs-rfs-vlan_tag-callbacks-in.patch @@ -24,7 +24,7 @@ Reviewed-by: Grant Grundler --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h -@@ -774,6 +774,16 @@ struct xps_map { +@@ -776,6 +776,16 @@ struct xps_map { #define XPS_MIN_MAP_ALLOC ((L1_CACHE_ALIGN(offsetof(struct xps_map, queues[1])) \ - sizeof(struct xps_map)) / sizeof(u16)) @@ -41,7 +41,7 @@ Reviewed-by: Grant Grundler /* * This structure holds all XPS maps for device. Maps are indexed by CPU. */ -@@ -1377,6 +1387,9 @@ struct net_device_ops { +@@ -1379,6 +1389,9 @@ struct net_device_ops { const struct sk_buff *skb, u16 rxq_index, u32 flow_id); diff --git a/target/linux/lantiq/patches-5.4/0152-lantiq-VPE.patch b/target/linux/lantiq/patches-5.4/0152-lantiq-VPE.patch index 8a6996bd4d..4f5c18b037 100644 --- a/target/linux/lantiq/patches-5.4/0152-lantiq-VPE.patch +++ b/target/linux/lantiq/patches-5.4/0152-lantiq-VPE.patch @@ -15,7 +15,7 @@ default "y" --- a/arch/mips/include/asm/vpe.h +++ b/arch/mips/include/asm/vpe.h -@@ -127,4 +127,13 @@ void cleanup_tc(struct tc *tc); +@@ -126,4 +126,13 @@ void cleanup_tc(struct tc *tc); int __init vpe_module_init(void); void __exit vpe_module_exit(void); @@ -31,15 +31,7 @@ #endif /* _ASM_VPE_H */ --- a/arch/mips/kernel/vpe-mt.c +++ b/arch/mips/kernel/vpe-mt.c -@@ -29,6 +29,7 @@ int vpe_run(struct vpe *v) - struct vpe_notifications *notifier; - unsigned int vpeflags; - struct tc *t; -+ unsigned long physical_memsize = 0L; - - /* check we are the Master VPE */ - local_irq_save(flags); -@@ -416,6 +417,8 @@ int __init vpe_module_init(void) +@@ -415,6 +415,8 @@ int __init vpe_module_init(void) } v->ntcs = hw_tcs - aprp_cpu_index(); @@ -48,7 +40,7 @@ /* add the tc to the list of this vpe's tc's. */ list_add(&t->tc, &v->tc); -@@ -519,3 +522,47 @@ void __exit vpe_module_exit(void) +@@ -518,3 +520,47 @@ void __exit vpe_module_exit(void) release_vpe(v); } } @@ -142,7 +134,7 @@ { --- a/arch/mips/lantiq/prom.c +++ b/arch/mips/lantiq/prom.c -@@ -34,10 +34,14 @@ unsigned long physical_memsize = 0L; +@@ -28,10 +28,14 @@ EXPORT_SYMBOL_GPL(ebu_lock); */ static struct ltq_soc_info soc_info; diff --git a/target/linux/lantiq/patches-5.4/0155-lantiq-VPE-nosmp.patch b/target/linux/lantiq/patches-5.4/0155-lantiq-VPE-nosmp.patch index 898c2d4821..2705723dda 100644 --- a/target/linux/lantiq/patches-5.4/0155-lantiq-VPE-nosmp.patch +++ b/target/linux/lantiq/patches-5.4/0155-lantiq-VPE-nosmp.patch @@ -1,6 +1,6 @@ --- a/arch/mips/kernel/vpe-mt.c +++ b/arch/mips/kernel/vpe-mt.c -@@ -132,7 +132,10 @@ int vpe_run(struct vpe *v) +@@ -130,7 +130,10 @@ int vpe_run(struct vpe *v) * kernels need to turn it on, even if that wasn't the pre-dvpe() state. */ #ifdef CONFIG_SMP diff --git a/target/linux/lantiq/patches-5.4/0320-v6.1-MIPS-lantiq-enable-all-hardware-interrupts-on-second.patch b/target/linux/lantiq/patches-5.4/0320-v6.1-MIPS-lantiq-enable-all-hardware-interrupts-on-second.patch index b7b95d6bfc..0bb1fefc5f 100644 --- a/target/linux/lantiq/patches-5.4/0320-v6.1-MIPS-lantiq-enable-all-hardware-interrupts-on-second.patch +++ b/target/linux/lantiq/patches-5.4/0320-v6.1-MIPS-lantiq-enable-all-hardware-interrupts-on-second.patch @@ -39,7 +39,7 @@ Signed-off-by: Thomas Bogendoerfer --- a/arch/mips/lantiq/prom.c +++ b/arch/mips/lantiq/prom.c -@@ -37,6 +37,14 @@ static struct ltq_soc_info soc_info; +@@ -31,6 +31,14 @@ static struct ltq_soc_info soc_info; /* for Multithreading (APRP), vpe.c will use it */ unsigned long cp0_memsize; @@ -54,7 +54,7 @@ Signed-off-by: Thomas Bogendoerfer const char *get_system_type(void) { return soc_info.sys_type; -@@ -100,6 +108,17 @@ void __init device_tree_init(void) +@@ -94,6 +102,17 @@ void __init device_tree_init(void) unflatten_and_copy_device_tree(); } @@ -72,7 +72,7 @@ Signed-off-by: Thomas Bogendoerfer void __init prom_init(void) { /* call the soc specific detetcion code and get it to fill soc_info */ -@@ -111,7 +130,10 @@ void __init prom_init(void) +@@ -105,7 +124,10 @@ void __init prom_init(void) prom_init_cmdline(); #if defined(CONFIG_MIPS_MT_SMP) diff --git a/target/linux/layerscape/patches-5.4/303-core-0008-ENGR00279980-ubi-attach-do-not-return-EINVAL-if-the-.patch b/target/linux/layerscape/patches-5.4/303-core-0008-ENGR00279980-ubi-attach-do-not-return-EINVAL-if-the-.patch index 8b6515c759..95b8ca5b6c 100644 --- a/target/linux/layerscape/patches-5.4/303-core-0008-ENGR00279980-ubi-attach-do-not-return-EINVAL-if-the-.patch +++ b/target/linux/layerscape/patches-5.4/303-core-0008-ENGR00279980-ubi-attach-do-not-return-EINVAL-if-the-.patch @@ -35,7 +35,7 @@ Signed-off-by: Han Xu --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c -@@ -572,7 +572,7 @@ static int io_init(struct ubi_device *ub +@@ -573,7 +573,7 @@ static int io_init(struct ubi_device *ub dbg_gen("sizeof(struct ubi_ainf_peb) %zu", sizeof(struct ubi_ainf_peb)); dbg_gen("sizeof(struct ubi_wl_entry) %zu", sizeof(struct ubi_wl_entry)); diff --git a/target/linux/layerscape/patches-5.4/801-audio-0001-Revert-ASoC-fsl_sai-Fix-noise-when-using-EDMA.patch b/target/linux/layerscape/patches-5.4/801-audio-0001-Revert-ASoC-fsl_sai-Fix-noise-when-using-EDMA.patch index 98c9214eaf..6328ea00cd 100644 --- a/target/linux/layerscape/patches-5.4/801-audio-0001-Revert-ASoC-fsl_sai-Fix-noise-when-using-EDMA.patch +++ b/target/linux/layerscape/patches-5.4/801-audio-0001-Revert-ASoC-fsl_sai-Fix-noise-when-using-EDMA.patch @@ -11,7 +11,7 @@ This reverts commit e75f4940e8ad0dd76527302a10c06b58bf7eb590. --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c -@@ -628,16 +628,6 @@ static int fsl_sai_startup(struct snd_pc +@@ -629,16 +629,6 @@ static int fsl_sai_startup(struct snd_pc FSL_SAI_CR3_TRCE_MASK, FSL_SAI_CR3_TRCE); @@ -28,7 +28,7 @@ This reverts commit e75f4940e8ad0dd76527302a10c06b58bf7eb590. ret = snd_pcm_hw_constraint_list(substream->runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &fsl_sai_rate_constraints); -@@ -1052,35 +1042,30 @@ static int fsl_sai_remove(struct platfor +@@ -1053,35 +1043,30 @@ static int fsl_sai_remove(struct platfor static const struct fsl_sai_soc_data fsl_sai_vf610_data = { .use_imx_pcm = false, diff --git a/target/linux/layerscape/patches-5.4/801-audio-0002-Revert-ASoC-fsl_sai-Implement-set_bclk_ratio.patch b/target/linux/layerscape/patches-5.4/801-audio-0002-Revert-ASoC-fsl_sai-Implement-set_bclk_ratio.patch index 60e3e3e853..7771134276 100644 --- a/target/linux/layerscape/patches-5.4/801-audio-0002-Revert-ASoC-fsl_sai-Implement-set_bclk_ratio.patch +++ b/target/linux/layerscape/patches-5.4/801-audio-0002-Revert-ASoC-fsl_sai-Implement-set_bclk_ratio.patch @@ -28,7 +28,7 @@ This reverts commit 63d1a3488ff58e094a7f517cf93c0250f0a3f6be. static int fsl_sai_set_dai_sysclk_tr(struct snd_soc_dai *cpu_dai, int clk_id, unsigned int freq, int fsl_dir) { -@@ -433,14 +423,8 @@ static int fsl_sai_hw_params(struct snd_ +@@ -434,14 +424,8 @@ static int fsl_sai_hw_params(struct snd_ slot_width = sai->slot_width; if (!sai->is_slave_mode) { @@ -45,7 +45,7 @@ This reverts commit 63d1a3488ff58e094a7f517cf93c0250f0a3f6be. if (ret) return ret; -@@ -646,7 +630,6 @@ static void fsl_sai_shutdown(struct snd_ +@@ -647,7 +631,6 @@ static void fsl_sai_shutdown(struct snd_ } static const struct snd_soc_dai_ops fsl_sai_pcm_dai_ops = { diff --git a/target/linux/layerscape/patches-5.4/801-audio-0003-Revert-ASoC-fsl_sai-Add-support-for-imx8qm.patch b/target/linux/layerscape/patches-5.4/801-audio-0003-Revert-ASoC-fsl_sai-Add-support-for-imx8qm.patch index 1fe6c649dc..3f0d4ccdb4 100644 --- a/target/linux/layerscape/patches-5.4/801-audio-0003-Revert-ASoC-fsl_sai-Add-support-for-imx8qm.patch +++ b/target/linux/layerscape/patches-5.4/801-audio-0003-Revert-ASoC-fsl_sai-Add-support-for-imx8qm.patch @@ -10,7 +10,7 @@ This reverts commit 6eeb60be5ebb73b2e5911e26fb1aed02940b7d09. --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c -@@ -1047,19 +1047,12 @@ static const struct fsl_sai_soc_data fsl +@@ -1048,19 +1048,12 @@ static const struct fsl_sai_soc_data fsl .reg_offset = 8, }; diff --git a/target/linux/layerscape/patches-5.4/801-audio-0004-Revert-ASoC-fsl_sai-Add-support-for-imx7ulp-imx8mq.patch b/target/linux/layerscape/patches-5.4/801-audio-0004-Revert-ASoC-fsl_sai-Add-support-for-imx7ulp-imx8mq.patch index f08d8e0e38..e73be4c229 100644 --- a/target/linux/layerscape/patches-5.4/801-audio-0004-Revert-ASoC-fsl_sai-Add-support-for-imx7ulp-imx8mq.patch +++ b/target/linux/layerscape/patches-5.4/801-audio-0004-Revert-ASoC-fsl_sai-Add-support-for-imx7ulp-imx8mq.patch @@ -10,7 +10,7 @@ This reverts commit a860fac420971c5a90d4f78959b44ead793aee4f. --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c -@@ -1035,24 +1035,10 @@ static const struct fsl_sai_soc_data fsl +@@ -1036,24 +1036,10 @@ static const struct fsl_sai_soc_data fsl .reg_offset = 0, }; diff --git a/target/linux/layerscape/patches-5.4/801-audio-0005-Revert-ASoC-fsl_sai-Add-support-for-SAI-new-version.patch b/target/linux/layerscape/patches-5.4/801-audio-0005-Revert-ASoC-fsl_sai-Add-support-for-SAI-new-version.patch index d685119e04..87b74f17dc 100644 --- a/target/linux/layerscape/patches-5.4/801-audio-0005-Revert-ASoC-fsl_sai-Add-support-for-SAI-new-version.patch +++ b/target/linux/layerscape/patches-5.4/801-audio-0005-Revert-ASoC-fsl_sai-Add-support-for-SAI-new-version.patch @@ -76,7 +76,7 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674. bool tx = fsl_dir == FSL_FMT_TRANSMITTER; u32 val_cr2 = 0, val_cr4 = 0; -@@ -290,9 +287,9 @@ static int fsl_sai_set_dai_fmt_tr(struct +@@ -291,9 +288,9 @@ static int fsl_sai_set_dai_fmt_tr(struct return -EINVAL; } @@ -88,7 +88,7 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674. FSL_SAI_CR4_MF | FSL_SAI_CR4_FSE | FSL_SAI_CR4_FSP | FSL_SAI_CR4_FSD_MSTR, val_cr4); -@@ -319,7 +316,6 @@ static int fsl_sai_set_dai_fmt(struct sn +@@ -320,7 +317,6 @@ static int fsl_sai_set_dai_fmt(struct sn static int fsl_sai_set_bclk(struct snd_soc_dai *dai, bool tx, u32 freq) { struct fsl_sai *sai = snd_soc_dai_get_drvdata(dai); @@ -96,7 +96,7 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674. unsigned long clk_rate; u32 savediv = 0, ratio, savesub = freq; u32 id; -@@ -382,17 +378,17 @@ static int fsl_sai_set_bclk(struct snd_s +@@ -383,17 +379,17 @@ static int fsl_sai_set_bclk(struct snd_s */ if ((sai->synchronous[TX] && !sai->synchronous[RX]) || (!tx && !sai->synchronous[RX])) { @@ -118,7 +118,7 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674. FSL_SAI_CR2_DIV_MASK, savediv - 1); } -@@ -407,7 +403,6 @@ static int fsl_sai_hw_params(struct snd_ +@@ -408,7 +404,6 @@ static int fsl_sai_hw_params(struct snd_ struct snd_soc_dai *cpu_dai) { struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai); @@ -126,7 +126,7 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674. bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; unsigned int channels = params_channels(params); u32 word_width = params_width(params); -@@ -460,19 +455,19 @@ static int fsl_sai_hw_params(struct snd_ +@@ -461,19 +456,19 @@ static int fsl_sai_hw_params(struct snd_ if (!sai->is_slave_mode) { if (!sai->synchronous[TX] && sai->synchronous[RX] && !tx) { @@ -150,7 +150,7 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674. FSL_SAI_CR5_WNW_MASK | FSL_SAI_CR5_W0W_MASK | FSL_SAI_CR5_FBT_MASK, val_cr5); regmap_write(sai->regmap, FSL_SAI_RMR, -@@ -480,10 +475,10 @@ static int fsl_sai_hw_params(struct snd_ +@@ -481,10 +476,10 @@ static int fsl_sai_hw_params(struct snd_ } } @@ -163,7 +163,7 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674. FSL_SAI_CR5_WNW_MASK | FSL_SAI_CR5_W0W_MASK | FSL_SAI_CR5_FBT_MASK, val_cr5); regmap_write(sai->regmap, FSL_SAI_xMR(tx), ~0UL - ((1 << channels) - 1)); -@@ -511,8 +506,6 @@ static int fsl_sai_trigger(struct snd_pc +@@ -512,8 +507,6 @@ static int fsl_sai_trigger(struct snd_pc struct snd_soc_dai *cpu_dai) { struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai); @@ -172,7 +172,7 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674. bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; u32 xcsr, count = 100; -@@ -521,9 +514,9 @@ static int fsl_sai_trigger(struct snd_pc +@@ -522,9 +515,9 @@ static int fsl_sai_trigger(struct snd_pc * Rx sync with Tx clocks: Clear SYNC for Tx, set it for Rx. * Tx sync with Rx clocks: Clear SYNC for Rx, set it for Tx. */ @@ -185,7 +185,7 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674. sai->synchronous[RX] ? FSL_SAI_CR2_SYNC : 0); /* -@@ -534,44 +527,43 @@ static int fsl_sai_trigger(struct snd_pc +@@ -535,44 +528,43 @@ static int fsl_sai_trigger(struct snd_pc case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_RESUME: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: @@ -242,7 +242,7 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674. FSL_SAI_CSR_FR, FSL_SAI_CSR_FR); /* -@@ -583,13 +575,13 @@ static int fsl_sai_trigger(struct snd_pc +@@ -584,13 +576,13 @@ static int fsl_sai_trigger(struct snd_pc */ if (!sai->is_slave_mode) { /* Software Reset for both Tx and Rx */ @@ -262,7 +262,7 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674. } } break; -@@ -604,11 +596,10 @@ static int fsl_sai_startup(struct snd_pc +@@ -605,11 +597,10 @@ static int fsl_sai_startup(struct snd_pc struct snd_soc_dai *cpu_dai) { struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai); @@ -275,7 +275,7 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674. FSL_SAI_CR3_TRCE_MASK, FSL_SAI_CR3_TRCE); -@@ -622,10 +613,9 @@ static void fsl_sai_shutdown(struct snd_ +@@ -623,10 +614,9 @@ static void fsl_sai_shutdown(struct snd_ struct snd_soc_dai *cpu_dai) { struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai); @@ -287,7 +287,7 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674. FSL_SAI_CR3_TRCE_MASK, 0); } -@@ -643,20 +633,17 @@ static const struct snd_soc_dai_ops fsl_ +@@ -644,20 +634,17 @@ static const struct snd_soc_dai_ops fsl_ static int fsl_sai_dai_probe(struct snd_soc_dai *cpu_dai) { struct fsl_sai *sai = dev_get_drvdata(cpu_dai->dev); @@ -314,7 +314,7 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674. FSL_SAI_MAXBURST_RX - 1); snd_soc_dai_init_dma_data(cpu_dai, &sai->dma_params_tx, -@@ -694,12 +681,12 @@ static const struct snd_soc_component_dr +@@ -695,12 +682,12 @@ static const struct snd_soc_component_dr .name = "fsl-sai", }; @@ -333,7 +333,7 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674. {FSL_SAI_TDR0, 0}, {FSL_SAI_TDR1, 0}, {FSL_SAI_TDR2, 0}, -@@ -708,50 +695,24 @@ static struct reg_default fsl_sai_reg_de +@@ -709,50 +696,24 @@ static struct reg_default fsl_sai_reg_de {FSL_SAI_TDR5, 0}, {FSL_SAI_TDR6, 0}, {FSL_SAI_TDR7, 0}, @@ -397,7 +397,7 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674. case FSL_SAI_TFR0: case FSL_SAI_TFR1: case FSL_SAI_TFR2: -@@ -761,6 +722,12 @@ static bool fsl_sai_readable_reg(struct +@@ -762,6 +723,12 @@ static bool fsl_sai_readable_reg(struct case FSL_SAI_TFR6: case FSL_SAI_TFR7: case FSL_SAI_TMR: @@ -410,7 +410,7 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674. case FSL_SAI_RDR0: case FSL_SAI_RDR1: case FSL_SAI_RDR2: -@@ -786,13 +753,9 @@ static bool fsl_sai_readable_reg(struct +@@ -787,13 +754,9 @@ static bool fsl_sai_readable_reg(struct static bool fsl_sai_volatile_reg(struct device *dev, unsigned int reg) { @@ -426,7 +426,7 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674. case FSL_SAI_TFR0: case FSL_SAI_TFR1: case FSL_SAI_TFR2: -@@ -825,16 +788,13 @@ static bool fsl_sai_volatile_reg(struct +@@ -826,16 +789,13 @@ static bool fsl_sai_volatile_reg(struct static bool fsl_sai_writeable_reg(struct device *dev, unsigned int reg) { @@ -449,7 +449,7 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674. case FSL_SAI_TDR0: case FSL_SAI_TDR1: case FSL_SAI_TDR2: -@@ -844,6 +804,12 @@ static bool fsl_sai_writeable_reg(struct +@@ -845,6 +805,12 @@ static bool fsl_sai_writeable_reg(struct case FSL_SAI_TDR6: case FSL_SAI_TDR7: case FSL_SAI_TMR: @@ -462,7 +462,7 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674. case FSL_SAI_RMR: return true; default: -@@ -851,15 +817,15 @@ static bool fsl_sai_writeable_reg(struct +@@ -852,15 +818,15 @@ static bool fsl_sai_writeable_reg(struct } } @@ -481,7 +481,7 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674. .readable_reg = fsl_sai_readable_reg, .volatile_reg = fsl_sai_volatile_reg, .writeable_reg = fsl_sai_writeable_reg, -@@ -891,12 +857,6 @@ static int fsl_sai_probe(struct platform +@@ -892,12 +858,6 @@ static int fsl_sai_probe(struct platform if (IS_ERR(base)) return PTR_ERR(base); @@ -494,7 +494,7 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674. sai->regmap = devm_regmap_init_mmio_clk(&pdev->dev, "bus", base, &fsl_sai_regmap_config); -@@ -1026,13 +986,11 @@ static int fsl_sai_remove(struct platfor +@@ -1027,13 +987,11 @@ static int fsl_sai_remove(struct platfor static const struct fsl_sai_soc_data fsl_sai_vf610_data = { .use_imx_pcm = false, .fifo_depth = 32, @@ -508,7 +508,7 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674. }; static const struct of_device_id fsl_sai_ids[] = { -@@ -1065,7 +1023,6 @@ static int fsl_sai_runtime_suspend(struc +@@ -1066,7 +1024,6 @@ static int fsl_sai_runtime_suspend(struc static int fsl_sai_runtime_resume(struct device *dev) { struct fsl_sai *sai = dev_get_drvdata(dev); @@ -516,7 +516,7 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674. int ret; ret = clk_prepare_enable(sai->bus_clk); -@@ -1087,11 +1044,11 @@ static int fsl_sai_runtime_resume(struct +@@ -1088,11 +1045,11 @@ static int fsl_sai_runtime_resume(struct } regcache_cache_only(sai->regmap, false); diff --git a/target/linux/layerscape/patches-5.4/801-audio-0006-Revert-ASoC-fsl_sai-Update-Tx-Rx-channel-enable-mask.patch b/target/linux/layerscape/patches-5.4/801-audio-0006-Revert-ASoC-fsl_sai-Update-Tx-Rx-channel-enable-mask.patch index e116389031..1283e3edc6 100644 --- a/target/linux/layerscape/patches-5.4/801-audio-0006-Revert-ASoC-fsl_sai-Update-Tx-Rx-channel-enable-mask.patch +++ b/target/linux/layerscape/patches-5.4/801-audio-0006-Revert-ASoC-fsl_sai-Update-Tx-Rx-channel-enable-mask.patch @@ -11,7 +11,7 @@ This reverts commit b84f50b0fcb497a62068926fca793d2d213c7dbd. --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c -@@ -599,8 +599,7 @@ static int fsl_sai_startup(struct snd_pc +@@ -600,8 +600,7 @@ static int fsl_sai_startup(struct snd_pc bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; int ret; @@ -21,7 +21,7 @@ This reverts commit b84f50b0fcb497a62068926fca793d2d213c7dbd. FSL_SAI_CR3_TRCE); ret = snd_pcm_hw_constraint_list(substream->runtime, 0, -@@ -615,8 +614,7 @@ static void fsl_sai_shutdown(struct snd_ +@@ -616,8 +615,7 @@ static void fsl_sai_shutdown(struct snd_ struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai); bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; diff --git a/target/linux/layerscape/patches-5.4/801-audio-0007-Revert-ASoC-fsl_sai-Add-registers-definition-for-mul.patch b/target/linux/layerscape/patches-5.4/801-audio-0007-Revert-ASoC-fsl_sai-Add-registers-definition-for-mul.patch index d73a4269d6..62aba38119 100644 --- a/target/linux/layerscape/patches-5.4/801-audio-0007-Revert-ASoC-fsl_sai-Add-registers-definition-for-mul.patch +++ b/target/linux/layerscape/patches-5.4/801-audio-0007-Revert-ASoC-fsl_sai-Add-registers-definition-for-mul.patch @@ -12,7 +12,7 @@ This reverts commit 5f0ac20ed6db1d6da2eea8b862cf3d54fdfb5830. --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c -@@ -685,14 +685,7 @@ static struct reg_default fsl_sai_reg_de +@@ -686,14 +686,7 @@ static struct reg_default fsl_sai_reg_de {FSL_SAI_TCR3, 0}, {FSL_SAI_TCR4, 0}, {FSL_SAI_TCR5, 0}, @@ -28,7 +28,7 @@ This reverts commit 5f0ac20ed6db1d6da2eea8b862cf3d54fdfb5830. {FSL_SAI_TMR, 0}, {FSL_SAI_RCR1, 0}, {FSL_SAI_RCR2, 0}, -@@ -711,14 +704,7 @@ static bool fsl_sai_readable_reg(struct +@@ -712,14 +705,7 @@ static bool fsl_sai_readable_reg(struct case FSL_SAI_TCR3: case FSL_SAI_TCR4: case FSL_SAI_TCR5: @@ -44,7 +44,7 @@ This reverts commit 5f0ac20ed6db1d6da2eea8b862cf3d54fdfb5830. case FSL_SAI_TMR: case FSL_SAI_RCSR: case FSL_SAI_RCR1: -@@ -726,22 +712,8 @@ static bool fsl_sai_readable_reg(struct +@@ -727,22 +713,8 @@ static bool fsl_sai_readable_reg(struct case FSL_SAI_RCR3: case FSL_SAI_RCR4: case FSL_SAI_RCR5: @@ -69,7 +69,7 @@ This reverts commit 5f0ac20ed6db1d6da2eea8b862cf3d54fdfb5830. case FSL_SAI_RMR: return true; default: -@@ -754,30 +726,9 @@ static bool fsl_sai_volatile_reg(struct +@@ -755,30 +727,9 @@ static bool fsl_sai_volatile_reg(struct switch (reg) { case FSL_SAI_TCSR: case FSL_SAI_RCSR: @@ -103,7 +103,7 @@ This reverts commit 5f0ac20ed6db1d6da2eea8b862cf3d54fdfb5830. return true; default: return false; -@@ -793,14 +744,7 @@ static bool fsl_sai_writeable_reg(struct +@@ -794,14 +745,7 @@ static bool fsl_sai_writeable_reg(struct case FSL_SAI_TCR3: case FSL_SAI_TCR4: case FSL_SAI_TCR5: @@ -119,7 +119,7 @@ This reverts commit 5f0ac20ed6db1d6da2eea8b862cf3d54fdfb5830. case FSL_SAI_TMR: case FSL_SAI_RCSR: case FSL_SAI_RCR1: -@@ -942,8 +886,8 @@ static int fsl_sai_probe(struct platform +@@ -943,8 +887,8 @@ static int fsl_sai_probe(struct platform MCLK_DIR(index)); } diff --git a/target/linux/layerscape/patches-5.4/801-audio-0008-Revert-ASoC-Remove-dev_err-usage-after-platform_get_.patch b/target/linux/layerscape/patches-5.4/801-audio-0008-Revert-ASoC-Remove-dev_err-usage-after-platform_get_.patch index 207c832050..9dfde30beb 100644 --- a/target/linux/layerscape/patches-5.4/801-audio-0008-Revert-ASoC-Remove-dev_err-usage-after-platform_get_.patch +++ b/target/linux/layerscape/patches-5.4/801-audio-0008-Revert-ASoC-Remove-dev_err-usage-after-platform_get_.patch @@ -154,7 +154,7 @@ This reverts commit cf9441adb1a35506d7606866c382b9d8614169b5. esai_priv->name, esai_priv); --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c -@@ -831,8 +831,10 @@ static int fsl_sai_probe(struct platform +@@ -832,8 +832,10 @@ static int fsl_sai_probe(struct platform } irq = platform_get_irq(pdev, 0); diff --git a/target/linux/layerscape/patches-5.4/801-audio-0009-Revert-ASoC-fsl_sai-mark-regmap-as-fast_io.patch b/target/linux/layerscape/patches-5.4/801-audio-0009-Revert-ASoC-fsl_sai-mark-regmap-as-fast_io.patch index 454bfd5a18..0c031f9491 100644 --- a/target/linux/layerscape/patches-5.4/801-audio-0009-Revert-ASoC-fsl_sai-mark-regmap-as-fast_io.patch +++ b/target/linux/layerscape/patches-5.4/801-audio-0009-Revert-ASoC-fsl_sai-mark-regmap-as-fast_io.patch @@ -10,7 +10,7 @@ This reverts commit 6d19d8a3cec74a9680947ecb6abdeda38583110e. --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c -@@ -763,7 +763,6 @@ static const struct regmap_config fsl_sa +@@ -764,7 +764,6 @@ static const struct regmap_config fsl_sa .reg_bits = 32, .reg_stride = 4, .val_bits = 32, diff --git a/target/linux/layerscape/patches-5.4/801-audio-0010-Revert-ASoC-fsl_sai-derive-TX-FIFO-watermark-from-FI.patch b/target/linux/layerscape/patches-5.4/801-audio-0010-Revert-ASoC-fsl_sai-derive-TX-FIFO-watermark-from-FI.patch index 07c3b87b04..62e2151888 100644 --- a/target/linux/layerscape/patches-5.4/801-audio-0010-Revert-ASoC-fsl_sai-derive-TX-FIFO-watermark-from-FI.patch +++ b/target/linux/layerscape/patches-5.4/801-audio-0010-Revert-ASoC-fsl_sai-derive-TX-FIFO-watermark-from-FI.patch @@ -12,7 +12,7 @@ This reverts commit bd517707d85f19a7339ea8b882fcbf0fd9976bd6. --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c -@@ -640,7 +640,7 @@ static int fsl_sai_dai_probe(struct snd_ +@@ -641,7 +641,7 @@ static int fsl_sai_dai_probe(struct snd_ regmap_write(sai->regmap, FSL_SAI_RCSR, 0); regmap_update_bits(sai->regmap, FSL_SAI_TCR1, FSL_SAI_CR1_RFW_MASK, @@ -21,7 +21,7 @@ This reverts commit bd517707d85f19a7339ea8b882fcbf0fd9976bd6. regmap_update_bits(sai->regmap, FSL_SAI_RCR1, FSL_SAI_CR1_RFW_MASK, FSL_SAI_MAXBURST_RX - 1); -@@ -928,12 +928,10 @@ static int fsl_sai_remove(struct platfor +@@ -929,12 +929,10 @@ static int fsl_sai_remove(struct platfor static const struct fsl_sai_soc_data fsl_sai_vf610_data = { .use_imx_pcm = false, diff --git a/target/linux/layerscape/patches-5.4/801-audio-0011-Revert-ASoC-fsl_sai-add-of_match-data.patch b/target/linux/layerscape/patches-5.4/801-audio-0011-Revert-ASoC-fsl_sai-add-of_match-data.patch index 12a32bc26b..d6a8c97379 100644 --- a/target/linux/layerscape/patches-5.4/801-audio-0011-Revert-ASoC-fsl_sai-add-of_match-data.patch +++ b/target/linux/layerscape/patches-5.4/801-audio-0011-Revert-ASoC-fsl_sai-add-of_match-data.patch @@ -22,7 +22,7 @@ Signed-off-by: Yangbo Lu #include #include #include -@@ -789,7 +788,10 @@ static int fsl_sai_probe(struct platform +@@ -790,7 +789,10 @@ static int fsl_sai_probe(struct platform return -ENOMEM; sai->pdev = pdev; @@ -34,7 +34,7 @@ Signed-off-by: Yangbo Lu sai->is_lsb_first = of_property_read_bool(np, "lsb-first"); -@@ -901,7 +903,7 @@ static int fsl_sai_probe(struct platform +@@ -902,7 +904,7 @@ static int fsl_sai_probe(struct platform if (ret) goto err_pm_disable; @@ -43,7 +43,7 @@ Signed-off-by: Yangbo Lu ret = imx_pcm_dma_init(pdev, IMX_SAI_DMABUF_SIZE); if (ret) goto err_pm_disable; -@@ -926,18 +928,10 @@ static int fsl_sai_remove(struct platfor +@@ -927,18 +929,10 @@ static int fsl_sai_remove(struct platfor return 0; } diff --git a/target/linux/layerscape/patches-5.4/801-audio-0012-MLK-9974-ASoC-fsl_sai-There-is-underrun-detected-in-.patch b/target/linux/layerscape/patches-5.4/801-audio-0012-MLK-9974-ASoC-fsl_sai-There-is-underrun-detected-in-.patch index 3b7de3c98b..809a642ce9 100644 --- a/target/linux/layerscape/patches-5.4/801-audio-0012-MLK-9974-ASoC-fsl_sai-There-is-underrun-detected-in-.patch +++ b/target/linux/layerscape/patches-5.4/801-audio-0012-MLK-9974-ASoC-fsl_sai-There-is-underrun-detected-in-.patch @@ -15,7 +15,7 @@ Signed-off-by: Shengjiu Wang --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c -@@ -506,7 +506,9 @@ static int fsl_sai_trigger(struct snd_pc +@@ -507,7 +507,9 @@ static int fsl_sai_trigger(struct snd_pc { struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai); bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; @@ -25,7 +25,7 @@ Signed-off-by: Shengjiu Wang /* * Asynchronous mode: Clear SYNC for both Tx and Rx. -@@ -529,6 +531,11 @@ static int fsl_sai_trigger(struct snd_pc +@@ -530,6 +532,11 @@ static int fsl_sai_trigger(struct snd_pc regmap_update_bits(sai->regmap, FSL_SAI_xCSR(tx), FSL_SAI_CSR_FRDE, FSL_SAI_CSR_FRDE); diff --git a/target/linux/layerscape/patches-5.4/801-audio-0013-MLK-10611-1-ASoC-fsl-sai-Just-one-device-can-playbac.patch b/target/linux/layerscape/patches-5.4/801-audio-0013-MLK-10611-1-ASoC-fsl-sai-Just-one-device-can-playbac.patch index faff9786b7..d365c6c525 100644 --- a/target/linux/layerscape/patches-5.4/801-audio-0013-MLK-10611-1-ASoC-fsl-sai-Just-one-device-can-playbac.patch +++ b/target/linux/layerscape/patches-5.4/801-audio-0013-MLK-10611-1-ASoC-fsl-sai-Just-one-device-can-playbac.patch @@ -15,7 +15,7 @@ Signed-off-by: Zidan Wang --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c -@@ -605,6 +605,11 @@ static int fsl_sai_startup(struct snd_pc +@@ -606,6 +606,11 @@ static int fsl_sai_startup(struct snd_pc bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; int ret; @@ -27,7 +27,7 @@ Signed-off-by: Zidan Wang regmap_update_bits(sai->regmap, FSL_SAI_xCR3(tx), FSL_SAI_CR3_TRCE, FSL_SAI_CR3_TRCE); -@@ -621,6 +626,11 @@ static void fsl_sai_shutdown(struct snd_ +@@ -622,6 +627,11 @@ static void fsl_sai_shutdown(struct snd_ bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; regmap_update_bits(sai->regmap, FSL_SAI_xCR3(tx), FSL_SAI_CR3_TRCE, 0); diff --git a/target/linux/layerscape/patches-5.4/801-audio-0014-MLK-11628-ASoC-fsl_sai-add-initial-value-for-is_slav.patch b/target/linux/layerscape/patches-5.4/801-audio-0014-MLK-11628-ASoC-fsl_sai-add-initial-value-for-is_slav.patch index 0fe22451f1..0e282895cd 100644 --- a/target/linux/layerscape/patches-5.4/801-audio-0014-MLK-11628-ASoC-fsl_sai-add-initial-value-for-is_slav.patch +++ b/target/linux/layerscape/patches-5.4/801-audio-0014-MLK-11628-ASoC-fsl_sai-add-initial-value-for-is_slav.patch @@ -14,7 +14,7 @@ Signed-off-by: Zidan Wang --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c -@@ -264,6 +264,8 @@ static int fsl_sai_set_dai_fmt_tr(struct +@@ -265,6 +265,8 @@ static int fsl_sai_set_dai_fmt_tr(struct return -EINVAL; } diff --git a/target/linux/layerscape/patches-5.4/801-audio-0015-ASoC-fsl-sai-set-xCR4-xCR5-xMR-for-SAI-master-mode.patch b/target/linux/layerscape/patches-5.4/801-audio-0015-ASoC-fsl-sai-set-xCR4-xCR5-xMR-for-SAI-master-mode.patch index 8dbc6d1551..b43e581b30 100644 --- a/target/linux/layerscape/patches-5.4/801-audio-0015-ASoC-fsl-sai-set-xCR4-xCR5-xMR-for-SAI-master-mode.patch +++ b/target/linux/layerscape/patches-5.4/801-audio-0015-ASoC-fsl-sai-set-xCR4-xCR5-xMR-for-SAI-master-mode.patch @@ -18,7 +18,7 @@ Signed-off-by: Mark Brown --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c -@@ -476,6 +476,35 @@ static int fsl_sai_hw_params(struct snd_ +@@ -477,6 +477,35 @@ static int fsl_sai_hw_params(struct snd_ } } diff --git a/target/linux/layerscape/patches-5.4/801-audio-0017-MLK-12786-2-ASoC-fsl_sai-correct-the-clock-source-fo.patch b/target/linux/layerscape/patches-5.4/801-audio-0017-MLK-12786-2-ASoC-fsl_sai-correct-the-clock-source-fo.patch index 470b1d02c4..5c52d0334d 100644 --- a/target/linux/layerscape/patches-5.4/801-audio-0017-MLK-12786-2-ASoC-fsl_sai-correct-the-clock-source-fo.patch +++ b/target/linux/layerscape/patches-5.4/801-audio-0017-MLK-12786-2-ASoC-fsl_sai-correct-the-clock-source-fo.patch @@ -13,7 +13,7 @@ Signed-off-by: Shengjiu Wang --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c -@@ -868,8 +868,7 @@ static int fsl_sai_probe(struct platform +@@ -869,8 +869,7 @@ static int fsl_sai_probe(struct platform sai->bus_clk = NULL; } diff --git a/target/linux/layerscape/patches-5.4/801-audio-0018-MLK-13574-2-ASoC-fsl_sai-refine-driver-for-ip-upgrad.patch b/target/linux/layerscape/patches-5.4/801-audio-0018-MLK-13574-2-ASoC-fsl_sai-refine-driver-for-ip-upgrad.patch index 793936d376..0e35a7c79a 100644 --- a/target/linux/layerscape/patches-5.4/801-audio-0018-MLK-13574-2-ASoC-fsl_sai-refine-driver-for-ip-upgrad.patch +++ b/target/linux/layerscape/patches-5.4/801-audio-0018-MLK-13574-2-ASoC-fsl_sai-refine-driver-for-ip-upgrad.patch @@ -76,7 +76,7 @@ Signed-off-by: Yangbo Lu static const unsigned int fsl_sai_rates[] = { 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000, 64000, -@@ -505,6 +541,29 @@ static int fsl_sai_hw_params(struct snd_ +@@ -506,6 +542,29 @@ static int fsl_sai_hw_params(struct snd_ } } @@ -106,7 +106,7 @@ Signed-off-by: Yangbo Lu regmap_update_bits(sai->regmap, FSL_SAI_xCR4(tx), FSL_SAI_CR4_SYWD_MASK | FSL_SAI_CR4_FRSZ_MASK, val_cr4); -@@ -563,14 +622,16 @@ static int fsl_sai_trigger(struct snd_pc +@@ -564,14 +623,16 @@ static int fsl_sai_trigger(struct snd_pc FSL_SAI_CSR_FRDE, FSL_SAI_CSR_FRDE); for (i = 0; tx && i < channels; i++) @@ -126,7 +126,7 @@ Signed-off-by: Yangbo Lu regmap_update_bits(sai->regmap, FSL_SAI_xCSR(tx), FSL_SAI_CSR_xIE_MASK, FSL_SAI_FLAGS); -@@ -641,8 +702,8 @@ static int fsl_sai_startup(struct snd_pc +@@ -642,8 +703,8 @@ static int fsl_sai_startup(struct snd_pc else sai->is_stream_opened[tx] = true; @@ -137,7 +137,7 @@ Signed-off-by: Yangbo Lu ret = snd_pcm_hw_constraint_list(substream->runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &fsl_sai_rate_constraints); -@@ -659,7 +720,7 @@ static void fsl_sai_shutdown(struct snd_ +@@ -660,7 +721,7 @@ static void fsl_sai_shutdown(struct snd_ regmap_update_bits(sai->regmap, FSL_SAI_xCR3(tx), FSL_SAI_CR3_TRCE, 0); if (sai->is_stream_opened[tx]) { @@ -146,7 +146,7 @@ Signed-off-by: Yangbo Lu sai->is_stream_opened[tx] = false; } } -@@ -687,7 +748,7 @@ static int fsl_sai_dai_probe(struct snd_ +@@ -688,7 +749,7 @@ static int fsl_sai_dai_probe(struct snd_ regmap_write(sai->regmap, FSL_SAI_RCSR, 0); regmap_update_bits(sai->regmap, FSL_SAI_TCR1, FSL_SAI_CR1_RFW_MASK, @@ -155,7 +155,7 @@ Signed-off-by: Yangbo Lu regmap_update_bits(sai->regmap, FSL_SAI_RCR1, FSL_SAI_CR1_RFW_MASK, FSL_SAI_MAXBURST_RX - 1); -@@ -732,7 +793,8 @@ static struct reg_default fsl_sai_reg_de +@@ -733,7 +794,8 @@ static struct reg_default fsl_sai_reg_de {FSL_SAI_TCR3, 0}, {FSL_SAI_TCR4, 0}, {FSL_SAI_TCR5, 0}, @@ -165,7 +165,7 @@ Signed-off-by: Yangbo Lu {FSL_SAI_TMR, 0}, {FSL_SAI_RCR1, 0}, {FSL_SAI_RCR2, 0}, -@@ -751,7 +813,8 @@ static bool fsl_sai_readable_reg(struct +@@ -752,7 +814,8 @@ static bool fsl_sai_readable_reg(struct case FSL_SAI_TCR3: case FSL_SAI_TCR4: case FSL_SAI_TCR5: @@ -175,7 +175,7 @@ Signed-off-by: Yangbo Lu case FSL_SAI_TMR: case FSL_SAI_RCSR: case FSL_SAI_RCR1: -@@ -759,8 +822,10 @@ static bool fsl_sai_readable_reg(struct +@@ -760,8 +823,10 @@ static bool fsl_sai_readable_reg(struct case FSL_SAI_RCR3: case FSL_SAI_RCR4: case FSL_SAI_RCR5: @@ -188,7 +188,7 @@ Signed-off-by: Yangbo Lu case FSL_SAI_RMR: return true; default: -@@ -773,9 +838,12 @@ static bool fsl_sai_volatile_reg(struct +@@ -774,9 +839,12 @@ static bool fsl_sai_volatile_reg(struct switch (reg) { case FSL_SAI_TCSR: case FSL_SAI_RCSR: @@ -204,7 +204,7 @@ Signed-off-by: Yangbo Lu return true; default: return false; -@@ -791,7 +859,8 @@ static bool fsl_sai_writeable_reg(struct +@@ -792,7 +860,8 @@ static bool fsl_sai_writeable_reg(struct case FSL_SAI_TCR3: case FSL_SAI_TCR4: case FSL_SAI_TCR5: @@ -214,7 +214,7 @@ Signed-off-by: Yangbo Lu case FSL_SAI_TMR: case FSL_SAI_RCSR: case FSL_SAI_RCR1: -@@ -820,9 +889,19 @@ static const struct regmap_config fsl_sa +@@ -821,9 +890,19 @@ static const struct regmap_config fsl_sa .cache_type = REGCACHE_FLAT, }; @@ -234,7 +234,7 @@ Signed-off-by: Yangbo Lu struct fsl_sai *sai; struct regmap *gpr; struct resource *res; -@@ -837,11 +916,12 @@ static int fsl_sai_probe(struct platform +@@ -838,11 +917,12 @@ static int fsl_sai_probe(struct platform sai->pdev = pdev; @@ -250,7 +250,7 @@ Signed-off-by: Yangbo Lu res = platform_get_resource(pdev, IORESOURCE_MEM, 0); base = devm_ioremap_resource(&pdev->dev, res); -@@ -873,11 +953,25 @@ static int fsl_sai_probe(struct platform +@@ -874,11 +954,25 @@ static int fsl_sai_probe(struct platform sai->mclk_clk[i] = devm_clk_get(&pdev->dev, tmp); if (IS_ERR(sai->mclk_clk[i])) { dev_err(&pdev->dev, "failed to get mclk%d clock: %ld\n", @@ -277,7 +277,7 @@ Signed-off-by: Yangbo Lu irq = platform_get_irq(pdev, 0); if (irq < 0) { dev_err(&pdev->dev, "no irq for node %s\n", pdev->name); -@@ -936,8 +1030,8 @@ static int fsl_sai_probe(struct platform +@@ -937,8 +1031,8 @@ static int fsl_sai_probe(struct platform MCLK_DIR(index)); } @@ -288,7 +288,7 @@ Signed-off-by: Yangbo Lu sai->dma_params_rx.maxburst = FSL_SAI_MAXBURST_RX; sai->dma_params_tx.maxburst = FSL_SAI_MAXBURST_TX; -@@ -950,7 +1044,7 @@ static int fsl_sai_probe(struct platform +@@ -951,7 +1045,7 @@ static int fsl_sai_probe(struct platform if (ret) goto err_pm_disable; @@ -297,7 +297,7 @@ Signed-off-by: Yangbo Lu ret = imx_pcm_dma_init(pdev, IMX_SAI_DMABUF_SIZE); if (ret) goto err_pm_disable; -@@ -996,6 +1090,9 @@ static int fsl_sai_runtime_suspend(struc +@@ -997,6 +1091,9 @@ static int fsl_sai_runtime_suspend(struc clk_disable_unprepare(sai->bus_clk); @@ -307,7 +307,7 @@ Signed-off-by: Yangbo Lu regcache_cache_only(sai->regmap, true); regcache_mark_dirty(sai->regmap); -@@ -1025,6 +1122,10 @@ static int fsl_sai_runtime_resume(struct +@@ -1026,6 +1123,10 @@ static int fsl_sai_runtime_resume(struct goto disable_tx_clk; } diff --git a/target/linux/layerscape/patches-5.4/801-audio-0019-MLK-13609-ASoC-fsl_sai-fix-for-synchronize-mode.patch b/target/linux/layerscape/patches-5.4/801-audio-0019-MLK-13609-ASoC-fsl_sai-fix-for-synchronize-mode.patch index 2d7832744a..40915d41cd 100644 --- a/target/linux/layerscape/patches-5.4/801-audio-0019-MLK-13609-ASoC-fsl_sai-fix-for-synchronize-mode.patch +++ b/target/linux/layerscape/patches-5.4/801-audio-0019-MLK-13609-ASoC-fsl_sai-fix-for-synchronize-mode.patch @@ -15,7 +15,7 @@ Signed-off-by: Shengjiu Wang --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c -@@ -527,8 +527,6 @@ static int fsl_sai_hw_params(struct snd_ +@@ -528,8 +528,6 @@ static int fsl_sai_hw_params(struct snd_ regmap_update_bits(sai->regmap, FSL_SAI_TCR5, FSL_SAI_CR5_WNW_MASK | FSL_SAI_CR5_W0W_MASK | FSL_SAI_CR5_FBT_MASK, val_cr5); @@ -24,7 +24,7 @@ Signed-off-by: Shengjiu Wang } else if (!sai->synchronous[RX] && sai->synchronous[TX] && tx) { regmap_update_bits(sai->regmap, FSL_SAI_RCR4, FSL_SAI_CR4_SYWD_MASK | FSL_SAI_CR4_FRSZ_MASK, -@@ -536,8 +534,6 @@ static int fsl_sai_hw_params(struct snd_ +@@ -537,8 +535,6 @@ static int fsl_sai_hw_params(struct snd_ regmap_update_bits(sai->regmap, FSL_SAI_RCR5, FSL_SAI_CR5_WNW_MASK | FSL_SAI_CR5_W0W_MASK | FSL_SAI_CR5_FBT_MASK, val_cr5); @@ -33,7 +33,7 @@ Signed-off-by: Shengjiu Wang } } -@@ -626,12 +622,17 @@ static int fsl_sai_trigger(struct snd_pc +@@ -627,12 +623,17 @@ static int fsl_sai_trigger(struct snd_pc if (tx) udelay(10); diff --git a/target/linux/layerscape/patches-5.4/801-audio-0020-ASoC-fsl_-e-sai-introduce-shared-interrupt-DT-flag-p.patch b/target/linux/layerscape/patches-5.4/801-audio-0020-ASoC-fsl_-e-sai-introduce-shared-interrupt-DT-flag-p.patch index 1184bce0e3..5397a3e8d1 100644 --- a/target/linux/layerscape/patches-5.4/801-audio-0020-ASoC-fsl_-e-sai-introduce-shared-interrupt-DT-flag-p.patch +++ b/target/linux/layerscape/patches-5.4/801-audio-0020-ASoC-fsl_-e-sai-introduce-shared-interrupt-DT-flag-p.patch @@ -18,7 +18,7 @@ Signed-off-by: Dong Aisheng --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c -@@ -910,6 +910,7 @@ static int fsl_sai_probe(struct platform +@@ -911,6 +911,7 @@ static int fsl_sai_probe(struct platform char tmp[8]; int irq, ret, i; int index; @@ -26,7 +26,7 @@ Signed-off-by: Dong Aisheng sai = devm_kzalloc(&pdev->dev, sizeof(*sai), GFP_KERNEL); if (!sai) -@@ -979,7 +980,12 @@ static int fsl_sai_probe(struct platform +@@ -980,7 +981,12 @@ static int fsl_sai_probe(struct platform return irq; } diff --git a/target/linux/layerscape/patches-5.4/801-audio-0021-ASoC-fsl_sai-handle-slave-mode-per-TX-RX-direction.patch b/target/linux/layerscape/patches-5.4/801-audio-0021-ASoC-fsl_sai-handle-slave-mode-per-TX-RX-direction.patch index 2fb5789ef3..bcdd39a9b3 100644 --- a/target/linux/layerscape/patches-5.4/801-audio-0021-ASoC-fsl_sai-handle-slave-mode-per-TX-RX-direction.patch +++ b/target/linux/layerscape/patches-5.4/801-audio-0021-ASoC-fsl_sai-handle-slave-mode-per-TX-RX-direction.patch @@ -16,7 +16,7 @@ Signed-off-by: Viorel Suman --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c -@@ -300,7 +300,7 @@ static int fsl_sai_set_dai_fmt_tr(struct +@@ -301,7 +301,7 @@ static int fsl_sai_set_dai_fmt_tr(struct return -EINVAL; } @@ -25,7 +25,7 @@ Signed-off-by: Viorel Suman /* DAI clock master masks */ switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { -@@ -310,7 +310,7 @@ static int fsl_sai_set_dai_fmt_tr(struct +@@ -311,7 +311,7 @@ static int fsl_sai_set_dai_fmt_tr(struct sai->is_slave_mode = false; break; case SND_SOC_DAIFMT_CBM_CFM: @@ -34,7 +34,7 @@ Signed-off-by: Viorel Suman break; case SND_SOC_DAIFMT_CBS_CFM: val_cr2 |= FSL_SAI_CR2_BCD_MSTR; -@@ -318,7 +318,7 @@ static int fsl_sai_set_dai_fmt_tr(struct +@@ -319,7 +319,7 @@ static int fsl_sai_set_dai_fmt_tr(struct break; case SND_SOC_DAIFMT_CBM_CFS: val_cr4 |= FSL_SAI_CR4_FSD_MSTR; @@ -43,7 +43,7 @@ Signed-off-by: Viorel Suman break; default: return -EINVAL; -@@ -359,7 +359,7 @@ static int fsl_sai_set_bclk(struct snd_s +@@ -360,7 +360,7 @@ static int fsl_sai_set_bclk(struct snd_s int ret = 0; /* Don't apply to slave mode */ @@ -52,7 +52,7 @@ Signed-off-by: Viorel Suman return 0; for (id = 0; id < FSL_SAI_MCLK_MAX; id++) { -@@ -454,7 +454,7 @@ static int fsl_sai_hw_params(struct snd_ +@@ -455,7 +455,7 @@ static int fsl_sai_hw_params(struct snd_ if (sai->slot_width) slot_width = sai->slot_width; @@ -61,7 +61,7 @@ Signed-off-by: Viorel Suman ret = fsl_sai_set_bclk(cpu_dai, tx, slots * slot_width * params_rate(params)); if (ret) -@@ -490,7 +490,7 @@ static int fsl_sai_hw_params(struct snd_ +@@ -491,7 +491,7 @@ static int fsl_sai_hw_params(struct snd_ * error. */ @@ -70,7 +70,7 @@ Signed-off-by: Viorel Suman if (!sai->synchronous[TX] && sai->synchronous[RX] && !tx) { regmap_update_bits(sai->regmap, FSL_SAI_TCR4, FSL_SAI_CR4_SYWD_MASK | FSL_SAI_CR4_FRSZ_MASK, -@@ -519,7 +519,7 @@ static int fsl_sai_hw_params(struct snd_ +@@ -520,7 +520,7 @@ static int fsl_sai_hw_params(struct snd_ * error. */ @@ -79,7 +79,7 @@ Signed-off-by: Viorel Suman if (!sai->synchronous[TX] && sai->synchronous[RX] && !tx) { regmap_update_bits(sai->regmap, FSL_SAI_TCR4, FSL_SAI_CR4_SYWD_MASK | FSL_SAI_CR4_FRSZ_MASK, -@@ -577,7 +577,7 @@ static int fsl_sai_hw_free(struct snd_pc +@@ -578,7 +578,7 @@ static int fsl_sai_hw_free(struct snd_pc struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai); bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; @@ -88,7 +88,7 @@ Signed-off-by: Viorel Suman sai->mclk_streams & BIT(substream->stream)) { clk_disable_unprepare(sai->mclk_clk[sai->mclk_id[tx]]); sai->mclk_streams &= ~BIT(substream->stream); -@@ -672,7 +672,7 @@ static int fsl_sai_trigger(struct snd_pc +@@ -673,7 +673,7 @@ static int fsl_sai_trigger(struct snd_pc * This is a hardware bug, and will be fix in the * next sai version. */ diff --git a/target/linux/layerscape/patches-5.4/801-audio-0022-ASoC-fsl_sai-set-specific-fmt-for-I2S-XTOR.patch b/target/linux/layerscape/patches-5.4/801-audio-0022-ASoC-fsl_sai-set-specific-fmt-for-I2S-XTOR.patch index 84bf81ae64..cfdfac9c3a 100644 --- a/target/linux/layerscape/patches-5.4/801-audio-0022-ASoC-fsl_sai-set-specific-fmt-for-I2S-XTOR.patch +++ b/target/linux/layerscape/patches-5.4/801-audio-0022-ASoC-fsl_sai-set-specific-fmt-for-I2S-XTOR.patch @@ -15,7 +15,7 @@ Signed-off-by: Viorel Suman --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c -@@ -335,14 +335,23 @@ static int fsl_sai_set_dai_fmt_tr(struct +@@ -336,14 +336,23 @@ static int fsl_sai_set_dai_fmt_tr(struct static int fsl_sai_set_dai_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt) { @@ -39,7 +39,7 @@ Signed-off-by: Viorel Suman ret = fsl_sai_set_dai_fmt_tr(cpu_dai, fmt, FSL_FMT_RECEIVER); if (ret) dev_err(cpu_dai->dev, "Cannot set rx format: %d\n", ret); -@@ -974,6 +983,9 @@ static int fsl_sai_probe(struct platform +@@ -975,6 +984,9 @@ static int fsl_sai_probe(struct platform return -EINVAL; } diff --git a/target/linux/layerscape/patches-5.4/801-audio-0024-MLK-14847-Revert-ASoC-fsl-sai-set-xCR4-xCR5-xMR-for-.patch b/target/linux/layerscape/patches-5.4/801-audio-0024-MLK-14847-Revert-ASoC-fsl-sai-set-xCR4-xCR5-xMR-for-.patch index 1edd4a35ea..d7b01df073 100644 --- a/target/linux/layerscape/patches-5.4/801-audio-0024-MLK-14847-Revert-ASoC-fsl-sai-set-xCR4-xCR5-xMR-for-.patch +++ b/target/linux/layerscape/patches-5.4/801-audio-0024-MLK-14847-Revert-ASoC-fsl-sai-set-xCR4-xCR5-xMR-for-.patch @@ -21,7 +21,7 @@ Signed-off-by: Mihai Serban --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c -@@ -507,35 +507,6 @@ static int fsl_sai_hw_params(struct snd_ +@@ -508,35 +508,6 @@ static int fsl_sai_hw_params(struct snd_ regmap_update_bits(sai->regmap, FSL_SAI_TCR5, FSL_SAI_CR5_WNW_MASK | FSL_SAI_CR5_W0W_MASK | FSL_SAI_CR5_FBT_MASK, val_cr5); diff --git a/target/linux/layerscape/patches-5.4/801-audio-0026-MLK-14935-ASoC-fsl_sai-Fix-mixing-initialization-dat.patch b/target/linux/layerscape/patches-5.4/801-audio-0026-MLK-14935-ASoC-fsl_sai-Fix-mixing-initialization-dat.patch index a68985fa02..1fdb99645a 100644 --- a/target/linux/layerscape/patches-5.4/801-audio-0026-MLK-14935-ASoC-fsl_sai-Fix-mixing-initialization-dat.patch +++ b/target/linux/layerscape/patches-5.4/801-audio-0026-MLK-14935-ASoC-fsl_sai-Fix-mixing-initialization-dat.patch @@ -16,7 +16,7 @@ Signed-off-by: Mihai Serban --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c -@@ -594,15 +594,14 @@ static int fsl_sai_trigger(struct snd_pc +@@ -595,15 +595,14 @@ static int fsl_sai_trigger(struct snd_pc case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_RESUME: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: diff --git a/target/linux/layerscape/patches-5.4/801-audio-0027-MLK-15140-1-ASoC-fsl_sai-support-latest-sai-module.patch b/target/linux/layerscape/patches-5.4/801-audio-0027-MLK-15140-1-ASoC-fsl_sai-support-latest-sai-module.patch index f0063453d5..49f777603a 100644 --- a/target/linux/layerscape/patches-5.4/801-audio-0027-MLK-15140-1-ASoC-fsl_sai-support-latest-sai-module.patch +++ b/target/linux/layerscape/patches-5.4/801-audio-0027-MLK-15140-1-ASoC-fsl_sai-support-latest-sai-module.patch @@ -114,7 +114,7 @@ Signed-off-by: Shengjiu Wang bool tx = fsl_dir == FSL_FMT_TRANSMITTER; u32 val_cr2 = 0, val_cr4 = 0; -@@ -324,9 +339,9 @@ static int fsl_sai_set_dai_fmt_tr(struct +@@ -325,9 +340,9 @@ static int fsl_sai_set_dai_fmt_tr(struct return -EINVAL; } @@ -126,7 +126,7 @@ Signed-off-by: Shengjiu Wang FSL_SAI_CR4_MF | FSL_SAI_CR4_FSE | FSL_SAI_CR4_FSP | FSL_SAI_CR4_FSD_MSTR, val_cr4); -@@ -362,6 +377,7 @@ static int fsl_sai_set_dai_fmt(struct sn +@@ -363,6 +378,7 @@ static int fsl_sai_set_dai_fmt(struct sn static int fsl_sai_set_bclk(struct snd_soc_dai *dai, bool tx, u32 freq) { struct fsl_sai *sai = snd_soc_dai_get_drvdata(dai); @@ -134,7 +134,7 @@ Signed-off-by: Shengjiu Wang unsigned long clk_rate; u32 savediv = 0, ratio, savesub = freq; u32 id; -@@ -424,17 +440,17 @@ static int fsl_sai_set_bclk(struct snd_s +@@ -425,17 +441,17 @@ static int fsl_sai_set_bclk(struct snd_s */ if ((sai->synchronous[TX] && !sai->synchronous[RX]) || (!tx && !sai->synchronous[RX])) { @@ -156,7 +156,7 @@ Signed-off-by: Shengjiu Wang FSL_SAI_CR2_DIV_MASK, savediv - 1); } -@@ -449,6 +465,7 @@ static int fsl_sai_hw_params(struct snd_ +@@ -450,6 +466,7 @@ static int fsl_sai_hw_params(struct snd_ struct snd_soc_dai *cpu_dai) { struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai); @@ -164,7 +164,7 @@ Signed-off-by: Shengjiu Wang bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; unsigned int channels = params_channels(params); u32 word_width = params_width(params); -@@ -501,49 +518,35 @@ static int fsl_sai_hw_params(struct snd_ +@@ -502,49 +519,35 @@ static int fsl_sai_hw_params(struct snd_ if (!sai->slave_mode[tx]) { if (!sai->synchronous[TX] && sai->synchronous[RX] && !tx) { @@ -226,7 +226,7 @@ Signed-off-by: Shengjiu Wang FSL_SAI_CR5_WNW_MASK | FSL_SAI_CR5_W0W_MASK | FSL_SAI_CR5_FBT_MASK, val_cr5); regmap_write(sai->regmap, FSL_SAI_xMR(tx), ~0UL - ((1 << channels) - 1)); -@@ -571,6 +574,7 @@ static int fsl_sai_trigger(struct snd_pc +@@ -572,6 +575,7 @@ static int fsl_sai_trigger(struct snd_pc struct snd_soc_dai *cpu_dai) { struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai); @@ -234,7 +234,7 @@ Signed-off-by: Shengjiu Wang bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; u8 channels = substream->runtime->channels; u32 xcsr, count = 100; -@@ -581,9 +585,9 @@ static int fsl_sai_trigger(struct snd_pc +@@ -582,9 +586,9 @@ static int fsl_sai_trigger(struct snd_pc * Rx sync with Tx clocks: Clear SYNC for Tx, set it for Rx. * Tx sync with Rx clocks: Clear SYNC for Rx, set it for Tx. */ @@ -246,7 +246,7 @@ Signed-off-by: Shengjiu Wang sai->synchronous[RX] ? FSL_SAI_CR2_SYNC : 0); /* -@@ -599,49 +603,50 @@ static int fsl_sai_trigger(struct snd_pc +@@ -600,49 +604,50 @@ static int fsl_sai_trigger(struct snd_pc if (tx) udelay(10); @@ -311,7 +311,7 @@ Signed-off-by: Shengjiu Wang FSL_SAI_CSR_FR, FSL_SAI_CSR_FR); /* -@@ -654,12 +659,12 @@ static int fsl_sai_trigger(struct snd_pc +@@ -655,12 +660,12 @@ static int fsl_sai_trigger(struct snd_pc if (!sai->slave_mode[tx]) { /* Software Reset for both Tx and Rx */ regmap_write(sai->regmap, @@ -328,7 +328,7 @@ Signed-off-by: Shengjiu Wang } } break; -@@ -674,6 +679,7 @@ static int fsl_sai_startup(struct snd_pc +@@ -675,6 +680,7 @@ static int fsl_sai_startup(struct snd_pc struct snd_soc_dai *cpu_dai) { struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai); @@ -336,7 +336,7 @@ Signed-off-by: Shengjiu Wang bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; int ret; -@@ -682,7 +688,8 @@ static int fsl_sai_startup(struct snd_pc +@@ -683,7 +689,8 @@ static int fsl_sai_startup(struct snd_pc else sai->is_stream_opened[tx] = true; @@ -346,7 +346,7 @@ Signed-off-by: Shengjiu Wang FSL_SAI_CR3_TRCE(sai->dataline[tx])); ret = snd_pcm_hw_constraint_list(substream->runtime, 0, -@@ -695,12 +702,14 @@ static void fsl_sai_shutdown(struct snd_ +@@ -696,12 +703,14 @@ static void fsl_sai_shutdown(struct snd_ struct snd_soc_dai *cpu_dai) { struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai); @@ -362,7 +362,7 @@ Signed-off-by: Shengjiu Wang sai->is_stream_opened[tx] = false; } } -@@ -719,17 +728,18 @@ static const struct snd_soc_dai_ops fsl_ +@@ -720,17 +729,18 @@ static const struct snd_soc_dai_ops fsl_ static int fsl_sai_dai_probe(struct snd_soc_dai *cpu_dai) { struct fsl_sai *sai = dev_get_drvdata(cpu_dai->dev); @@ -387,7 +387,7 @@ Signed-off-by: Shengjiu Wang FSL_SAI_MAXBURST_RX - 1); snd_soc_dai_init_dma_data(cpu_dai, &sai->dma_params_tx, -@@ -767,41 +777,55 @@ static const struct snd_soc_component_dr +@@ -768,41 +778,55 @@ static const struct snd_soc_component_dr .name = "fsl-sai", }; @@ -466,7 +466,7 @@ Signed-off-by: Shengjiu Wang case FSL_SAI_RDR0: case FSL_SAI_RDR1: case FSL_SAI_RFR0: -@@ -815,9 +839,13 @@ static bool fsl_sai_readable_reg(struct +@@ -816,9 +840,13 @@ static bool fsl_sai_readable_reg(struct static bool fsl_sai_volatile_reg(struct device *dev, unsigned int reg) { @@ -482,7 +482,7 @@ Signed-off-by: Shengjiu Wang case FSL_SAI_TFR0: case FSL_SAI_TFR1: case FSL_SAI_RFR0: -@@ -832,22 +860,19 @@ static bool fsl_sai_volatile_reg(struct +@@ -833,22 +861,19 @@ static bool fsl_sai_volatile_reg(struct static bool fsl_sai_writeable_reg(struct device *dev, unsigned int reg) { @@ -514,7 +514,7 @@ Signed-off-by: Shengjiu Wang case FSL_SAI_RMR: return true; default: -@@ -855,14 +880,28 @@ static bool fsl_sai_writeable_reg(struct +@@ -856,14 +881,28 @@ static bool fsl_sai_writeable_reg(struct } } @@ -546,7 +546,7 @@ Signed-off-by: Shengjiu Wang .readable_reg = fsl_sai_readable_reg, .volatile_reg = fsl_sai_volatile_reg, .writeable_reg = fsl_sai_writeable_reg, -@@ -874,6 +913,7 @@ static const struct of_device_id fsl_sai +@@ -875,6 +914,7 @@ static const struct of_device_id fsl_sai { .compatible = "fsl,imx6sx-sai", .data = &fsl_sai_imx6sx }, { .compatible = "fsl,imx6ul-sai", .data = &fsl_sai_imx6ul }, { .compatible = "fsl,imx7ulp-sai", .data = &fsl_sai_imx7ulp }, @@ -554,7 +554,7 @@ Signed-off-by: Shengjiu Wang { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, fsl_sai_ids); -@@ -889,7 +929,8 @@ static int fsl_sai_probe(struct platform +@@ -890,7 +930,8 @@ static int fsl_sai_probe(struct platform char tmp[8]; int irq, ret, i; int index; @@ -564,7 +564,7 @@ Signed-off-by: Shengjiu Wang sai = devm_kzalloc(&pdev->dev, sizeof(*sai), GFP_KERNEL); if (!sai) -@@ -909,6 +950,9 @@ static int fsl_sai_probe(struct platform +@@ -910,6 +951,9 @@ static int fsl_sai_probe(struct platform if (IS_ERR(base)) return PTR_ERR(base); @@ -574,7 +574,7 @@ Signed-off-by: Shengjiu Wang sai->regmap = devm_regmap_init_mmio_clk(&pdev->dev, "bus", base, &fsl_sai_regmap_config); -@@ -963,11 +1007,11 @@ static int fsl_sai_probe(struct platform +@@ -964,11 +1008,11 @@ static int fsl_sai_probe(struct platform } /* SAI shared interrupt */ @@ -590,7 +590,7 @@ Signed-off-by: Shengjiu Wang if (ret) { dev_err(&pdev->dev, "failed to claim irq %u\n", irq); return ret; -@@ -1091,6 +1135,7 @@ static int fsl_sai_runtime_suspend(struc +@@ -1092,6 +1136,7 @@ static int fsl_sai_runtime_suspend(struc static int fsl_sai_runtime_resume(struct device *dev) { struct fsl_sai *sai = dev_get_drvdata(dev); @@ -598,7 +598,7 @@ Signed-off-by: Shengjiu Wang int ret; ret = clk_prepare_enable(sai->bus_clk); -@@ -1116,11 +1161,11 @@ static int fsl_sai_runtime_resume(struct +@@ -1117,11 +1162,11 @@ static int fsl_sai_runtime_resume(struct PM_QOS_CPU_DMA_LATENCY, 0); regcache_cache_only(sai->regmap, false); diff --git a/target/linux/layerscape/patches-5.4/801-audio-0028-MLK-15927-1-ASoC-fsl_sai-Fix-noise-when-using-EDMA.patch b/target/linux/layerscape/patches-5.4/801-audio-0028-MLK-15927-1-ASoC-fsl_sai-Fix-noise-when-using-EDMA.patch index 71554d295a..d3ab26b7c7 100644 --- a/target/linux/layerscape/patches-5.4/801-audio-0028-MLK-15927-1-ASoC-fsl_sai-Fix-noise-when-using-EDMA.patch +++ b/target/linux/layerscape/patches-5.4/801-audio-0028-MLK-15927-1-ASoC-fsl_sai-Fix-noise-when-using-EDMA.patch @@ -72,7 +72,7 @@ Reviewed-by: Shengjiu Wang }; static const unsigned int fsl_sai_rates[] = { -@@ -692,6 +707,13 @@ static int fsl_sai_startup(struct snd_pc +@@ -693,6 +708,13 @@ static int fsl_sai_startup(struct snd_pc FSL_SAI_CR3_TRCE_MASK, FSL_SAI_CR3_TRCE(sai->dataline[tx])); @@ -86,7 +86,7 @@ Reviewed-by: Shengjiu Wang ret = snd_pcm_hw_constraint_list(substream->runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &fsl_sai_rate_constraints); -@@ -914,6 +936,7 @@ static const struct of_device_id fsl_sai +@@ -915,6 +937,7 @@ static const struct of_device_id fsl_sai { .compatible = "fsl,imx6ul-sai", .data = &fsl_sai_imx6ul }, { .compatible = "fsl,imx7ulp-sai", .data = &fsl_sai_imx7ulp }, { .compatible = "fsl,imx8mq-sai", .data = &fsl_sai_imx8mq }, diff --git a/target/linux/layerscape/patches-5.4/801-audio-0029-MLK-15960-1-ASoC-fsl_sai-update-fifo_depth-for-diffe.patch b/target/linux/layerscape/patches-5.4/801-audio-0029-MLK-15960-1-ASoC-fsl_sai-update-fifo_depth-for-diffe.patch index d2a7955cae..480ae311e4 100644 --- a/target/linux/layerscape/patches-5.4/801-audio-0029-MLK-15960-1-ASoC-fsl_sai-update-fifo_depth-for-diffe.patch +++ b/target/linux/layerscape/patches-5.4/801-audio-0029-MLK-15960-1-ASoC-fsl_sai-update-fifo_depth-for-diffe.patch @@ -32,7 +32,7 @@ Signed-off-by: Shengjiu Wang .flags = 0, .reg_offset = 0, .constrain_period_size = true, -@@ -759,10 +759,12 @@ static int fsl_sai_dai_probe(struct snd_ +@@ -760,10 +760,12 @@ static int fsl_sai_dai_probe(struct snd_ regmap_write(sai->regmap, FSL_SAI_TCSR(offset), 0); regmap_write(sai->regmap, FSL_SAI_RCSR(offset), 0); diff --git a/target/linux/layerscape/patches-5.4/801-audio-0030-MLK-15960-2-ASoC-fsl_sai-refine-the-pm-runtime-funct.patch b/target/linux/layerscape/patches-5.4/801-audio-0030-MLK-15960-2-ASoC-fsl_sai-refine-the-pm-runtime-funct.patch index 03201fea90..8eb7cb1bac 100644 --- a/target/linux/layerscape/patches-5.4/801-audio-0030-MLK-15960-2-ASoC-fsl_sai-refine-the-pm-runtime-funct.patch +++ b/target/linux/layerscape/patches-5.4/801-audio-0030-MLK-15960-2-ASoC-fsl_sai-refine-the-pm-runtime-funct.patch @@ -16,7 +16,7 @@ Signed-off-by: Shengjiu Wang --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c -@@ -1097,6 +1097,8 @@ static int fsl_sai_probe(struct platform +@@ -1098,6 +1098,8 @@ static int fsl_sai_probe(struct platform pm_runtime_enable(&pdev->dev); @@ -25,7 +25,7 @@ Signed-off-by: Shengjiu Wang ret = devm_snd_soc_register_component(&pdev->dev, &fsl_component, &sai->cpu_dai_drv, 1); if (ret) -@@ -1140,6 +1142,8 @@ static int fsl_sai_runtime_suspend(struc +@@ -1141,6 +1143,8 @@ static int fsl_sai_runtime_suspend(struc { struct fsl_sai *sai = dev_get_drvdata(dev); diff --git a/target/linux/layerscape/patches-5.4/801-audio-0031-MLK-13975-ASoC-fsl_sai-Refine-master-flag-handling.patch b/target/linux/layerscape/patches-5.4/801-audio-0031-MLK-13975-ASoC-fsl_sai-Refine-master-flag-handling.patch index cc60638f2b..643606808e 100644 --- a/target/linux/layerscape/patches-5.4/801-audio-0031-MLK-13975-ASoC-fsl_sai-Refine-master-flag-handling.patch +++ b/target/linux/layerscape/patches-5.4/801-audio-0031-MLK-13975-ASoC-fsl_sai-Refine-master-flag-handling.patch @@ -16,7 +16,7 @@ Signed-off-by: Viorel Suman --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c -@@ -368,9 +368,9 @@ static int fsl_sai_set_dai_fmt(struct sn +@@ -369,9 +369,9 @@ static int fsl_sai_set_dai_fmt(struct sn struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai); int ret; @@ -29,7 +29,7 @@ Signed-off-by: Viorel Suman ret = fsl_sai_set_dai_fmt_tr(cpu_dai, fmt, FSL_FMT_TRANSMITTER); if (ret) { -@@ -378,9 +378,9 @@ static int fsl_sai_set_dai_fmt(struct sn +@@ -379,9 +379,9 @@ static int fsl_sai_set_dai_fmt(struct sn return ret; } @@ -42,7 +42,7 @@ Signed-off-by: Viorel Suman ret = fsl_sai_set_dai_fmt_tr(cpu_dai, fmt, FSL_FMT_RECEIVER); if (ret) -@@ -1022,8 +1022,19 @@ static int fsl_sai_probe(struct platform +@@ -1023,8 +1023,19 @@ static int fsl_sai_probe(struct platform return -EINVAL; } diff --git a/target/linux/layerscape/patches-5.4/801-audio-0032-MLK-16130-1-ASoC-fsl_sai-enable-TCE-RCE-according-to.patch b/target/linux/layerscape/patches-5.4/801-audio-0032-MLK-16130-1-ASoC-fsl_sai-enable-TCE-RCE-according-to.patch index 25275a27a2..2178da53b8 100644 --- a/target/linux/layerscape/patches-5.4/801-audio-0032-MLK-16130-1-ASoC-fsl_sai-enable-TCE-RCE-according-to.patch +++ b/target/linux/layerscape/patches-5.4/801-audio-0032-MLK-16130-1-ASoC-fsl_sai-enable-TCE-RCE-according-to.patch @@ -15,7 +15,7 @@ Signed-off-by: Shengjiu Wang --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c -@@ -487,11 +487,14 @@ static int fsl_sai_hw_params(struct snd_ +@@ -488,11 +488,14 @@ static int fsl_sai_hw_params(struct snd_ u32 val_cr4 = 0, val_cr5 = 0; u32 slots = (channels == 1) ? 2 : channels; u32 slot_width = word_width; @@ -30,7 +30,7 @@ Signed-off-by: Shengjiu Wang if (sai->slot_width) slot_width = sai->slot_width; -@@ -558,6 +561,10 @@ static int fsl_sai_hw_params(struct snd_ +@@ -559,6 +562,10 @@ static int fsl_sai_hw_params(struct snd_ FSL_SAI_CR4_FCOMB_MASK, FSL_SAI_CR4_FCOMB_SOFT); } @@ -41,7 +41,7 @@ Signed-off-by: Shengjiu Wang regmap_update_bits(sai->regmap, FSL_SAI_xCR4(tx, offset), FSL_SAI_CR4_SYWD_MASK | FSL_SAI_CR4_FRSZ_MASK, val_cr4); -@@ -573,8 +580,12 @@ static int fsl_sai_hw_free(struct snd_pc +@@ -574,8 +581,12 @@ static int fsl_sai_hw_free(struct snd_pc struct snd_soc_dai *cpu_dai) { struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai); @@ -54,7 +54,7 @@ Signed-off-by: Shengjiu Wang if (!sai->slave_mode[tx] && sai->mclk_streams & BIT(substream->stream)) { clk_disable_unprepare(sai->mclk_clk[sai->mclk_id[tx]]); -@@ -694,7 +705,6 @@ static int fsl_sai_startup(struct snd_pc +@@ -695,7 +706,6 @@ static int fsl_sai_startup(struct snd_pc struct snd_soc_dai *cpu_dai) { struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai); @@ -62,7 +62,7 @@ Signed-off-by: Shengjiu Wang bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; int ret; -@@ -724,7 +734,6 @@ static void fsl_sai_shutdown(struct snd_ +@@ -725,7 +735,6 @@ static void fsl_sai_shutdown(struct snd_ struct snd_soc_dai *cpu_dai) { struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai); diff --git a/target/linux/layerscape/patches-5.4/801-audio-0033-MLK-13946-3-ASoC-fsl_sai-fix-the-xMR-setting.patch b/target/linux/layerscape/patches-5.4/801-audio-0033-MLK-13946-3-ASoC-fsl_sai-fix-the-xMR-setting.patch index c353ba4ae4..fa9ae220a2 100644 --- a/target/linux/layerscape/patches-5.4/801-audio-0033-MLK-13946-3-ASoC-fsl_sai-fix-the-xMR-setting.patch +++ b/target/linux/layerscape/patches-5.4/801-audio-0033-MLK-13946-3-ASoC-fsl_sai-fix-the-xMR-setting.patch @@ -24,7 +24,7 @@ Signed-off-by: Shengjiu Wang .fifos = 1, .fifo_depth = 64, .flags = 0, -@@ -571,7 +571,7 @@ static int fsl_sai_hw_params(struct snd_ +@@ -572,7 +572,7 @@ static int fsl_sai_hw_params(struct snd_ regmap_update_bits(sai->regmap, FSL_SAI_xCR5(tx, offset), FSL_SAI_CR5_WNW_MASK | FSL_SAI_CR5_W0W_MASK | FSL_SAI_CR5_FBT_MASK, val_cr5); @@ -33,7 +33,7 @@ Signed-off-by: Shengjiu Wang return 0; } -@@ -858,11 +858,23 @@ static bool fsl_sai_readable_reg(struct +@@ -859,11 +859,23 @@ static bool fsl_sai_readable_reg(struct switch (reg) { case FSL_SAI_TFR0: case FSL_SAI_TFR1: @@ -57,7 +57,7 @@ Signed-off-by: Shengjiu Wang case FSL_SAI_RMR: return true; default: -@@ -881,8 +893,20 @@ static bool fsl_sai_volatile_reg(struct +@@ -882,8 +894,20 @@ static bool fsl_sai_volatile_reg(struct switch (reg) { case FSL_SAI_TFR0: case FSL_SAI_TFR1: diff --git a/target/linux/layerscape/patches-5.4/801-audio-0034-MLK-13946-8-ASoC-fsl_sai-use-min-channels-slots-for-.patch b/target/linux/layerscape/patches-5.4/801-audio-0034-MLK-13946-8-ASoC-fsl_sai-use-min-channels-slots-for-.patch index ab89291189..fc90f2616f 100644 --- a/target/linux/layerscape/patches-5.4/801-audio-0034-MLK-13946-8-ASoC-fsl_sai-use-min-channels-slots-for-.patch +++ b/target/linux/layerscape/patches-5.4/801-audio-0034-MLK-13946-8-ASoC-fsl_sai-use-min-channels-slots-for-.patch @@ -15,7 +15,7 @@ Signed-off-by: Viorel Suman --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c -@@ -571,8 +571,8 @@ static int fsl_sai_hw_params(struct snd_ +@@ -572,8 +572,8 @@ static int fsl_sai_hw_params(struct snd_ regmap_update_bits(sai->regmap, FSL_SAI_xCR5(tx, offset), FSL_SAI_CR5_WNW_MASK | FSL_SAI_CR5_W0W_MASK | FSL_SAI_CR5_FBT_MASK, val_cr5); diff --git a/target/linux/layerscape/patches-5.4/801-audio-0035-MLK-16929-1-ASoC-fsl_sai-add-bitclk_freq.patch b/target/linux/layerscape/patches-5.4/801-audio-0035-MLK-16929-1-ASoC-fsl_sai-add-bitclk_freq.patch index c095f5ff35..7bdd15ccc1 100644 --- a/target/linux/layerscape/patches-5.4/801-audio-0035-MLK-16929-1-ASoC-fsl_sai-add-bitclk_freq.patch +++ b/target/linux/layerscape/patches-5.4/801-audio-0035-MLK-16929-1-ASoC-fsl_sai-add-bitclk_freq.patch @@ -30,7 +30,7 @@ Signed-off-by: Adrian Alonso ret = fsl_sai_set_dai_sysclk_tr(cpu_dai, clk_id, freq, FSL_FMT_TRANSMITTER); if (ret) { -@@ -499,7 +502,11 @@ static int fsl_sai_hw_params(struct snd_ +@@ -500,7 +503,11 @@ static int fsl_sai_hw_params(struct snd_ slot_width = sai->slot_width; if (!sai->slave_mode[tx]) { diff --git a/target/linux/layerscape/patches-5.4/801-audio-0037-MLK-16224-4-ASoC-fsl_sai-support-multi-fifo-and-DSD.patch b/target/linux/layerscape/patches-5.4/801-audio-0037-MLK-16224-4-ASoC-fsl_sai-support-multi-fifo-and-DSD.patch index c2952deaab..ee47b150c5 100644 --- a/target/linux/layerscape/patches-5.4/801-audio-0037-MLK-16224-4-ASoC-fsl_sai-support-multi-fifo-and-DSD.patch +++ b/target/linux/layerscape/patches-5.4/801-audio-0037-MLK-16224-4-ASoC-fsl_sai-support-multi-fifo-and-DSD.patch @@ -31,15 +31,7 @@ Reviewed-by: Viorel Suman --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c -@@ -267,6 +267,7 @@ static int fsl_sai_set_dai_fmt_tr(struct - if (!sai->is_lsb_first) - val_cr4 |= FSL_SAI_CR4_MF; - -+ sai->is_dsp_mode = false; - /* DAI mode */ - switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { - case SND_SOC_DAIFMT_I2S: -@@ -305,6 +306,11 @@ static int fsl_sai_set_dai_fmt_tr(struct +@@ -306,6 +306,11 @@ static int fsl_sai_set_dai_fmt_tr(struct val_cr2 |= FSL_SAI_CR2_BCP; sai->is_dsp_mode = true; break; @@ -51,7 +43,7 @@ Reviewed-by: Viorel Suman case SND_SOC_DAIFMT_RIGHT_J: /* To be done */ default: -@@ -492,12 +498,38 @@ static int fsl_sai_hw_params(struct snd_ +@@ -493,12 +498,38 @@ static int fsl_sai_hw_params(struct snd_ u32 slot_width = word_width; u32 pins; int ret; @@ -90,7 +82,7 @@ Reviewed-by: Viorel Suman if (sai->slot_width) slot_width = sai->slot_width; -@@ -527,7 +559,7 @@ static int fsl_sai_hw_params(struct snd_ +@@ -528,7 +559,7 @@ static int fsl_sai_hw_params(struct snd_ val_cr5 |= FSL_SAI_CR5_WNW(slot_width); val_cr5 |= FSL_SAI_CR5_W0W(slot_width); @@ -99,7 +91,7 @@ Reviewed-by: Viorel Suman val_cr5 |= FSL_SAI_CR5_FBT(0); else val_cr5 |= FSL_SAI_CR5_FBT(word_width - 1); -@@ -560,17 +592,71 @@ static int fsl_sai_hw_params(struct snd_ +@@ -561,17 +592,71 @@ static int fsl_sai_hw_params(struct snd_ } if (sai->soc->dataline != 0x1) { @@ -174,7 +166,7 @@ Reviewed-by: Viorel Suman regmap_update_bits(sai->regmap, FSL_SAI_xCR4(tx, offset), FSL_SAI_CR4_SYWD_MASK | FSL_SAI_CR4_FRSZ_MASK, -@@ -610,9 +696,18 @@ static int fsl_sai_trigger(struct snd_pc +@@ -611,9 +696,18 @@ static int fsl_sai_trigger(struct snd_pc unsigned char offset = sai->soc->reg_offset; bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; u8 channels = substream->runtime->channels; @@ -194,7 +186,7 @@ Reviewed-by: Viorel Suman /* * Asynchronous mode: Clear SYNC for both Tx and Rx. * Rx sync with Tx clocks: Clear SYNC for Tx, set it for Rx. -@@ -631,10 +726,19 @@ static int fsl_sai_trigger(struct snd_pc +@@ -632,10 +726,19 @@ static int fsl_sai_trigger(struct snd_pc case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_RESUME: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: @@ -218,7 +210,7 @@ Reviewed-by: Viorel Suman regmap_update_bits(sai->regmap, FSL_SAI_xCSR(tx, offset), FSL_SAI_CSR_FRDE, FSL_SAI_CSR_FRDE); -@@ -994,6 +1098,7 @@ static int fsl_sai_probe(struct platform +@@ -995,6 +1098,7 @@ static int fsl_sai_probe(struct platform char tmp[8]; int irq, ret, i; int index; @@ -226,7 +218,7 @@ Reviewed-by: Viorel Suman struct regmap_config fsl_sai_regmap_config = fsl_sai_v2_regmap_config; unsigned long irqflags = 0; -@@ -1048,6 +1153,9 @@ static int fsl_sai_probe(struct platform +@@ -1049,6 +1153,9 @@ static int fsl_sai_probe(struct platform } } @@ -236,7 +228,7 @@ Reviewed-by: Viorel Suman /*dataline mask for rx and tx*/ ret = of_property_read_u32_index(np, "fsl,dataline", 0, &sai->dataline[0]); if (ret) -@@ -1062,6 +1170,37 @@ static int fsl_sai_probe(struct platform +@@ -1063,6 +1170,37 @@ static int fsl_sai_probe(struct platform return -EINVAL; } @@ -274,7 +266,7 @@ Reviewed-by: Viorel Suman if ((of_find_property(np, "fsl,i2s-xtor", NULL) != NULL) || (of_find_property(np, "fsl,txm-rxs", NULL) != NULL)) { -@@ -1144,6 +1283,11 @@ static int fsl_sai_probe(struct platform +@@ -1145,6 +1283,11 @@ static int fsl_sai_probe(struct platform sai->dma_params_rx.maxburst = FSL_SAI_MAXBURST_RX; sai->dma_params_tx.maxburst = FSL_SAI_MAXBURST_TX; diff --git a/target/linux/layerscape/patches-5.4/805-display-0041-drm-fourcc-add-a-10bits-fully-packed-variant-of-NV12.patch b/target/linux/layerscape/patches-5.4/805-display-0041-drm-fourcc-add-a-10bits-fully-packed-variant-of-NV12.patch index 3bccbbd138..70f449dd75 100644 --- a/target/linux/layerscape/patches-5.4/805-display-0041-drm-fourcc-add-a-10bits-fully-packed-variant-of-NV12.patch +++ b/target/linux/layerscape/patches-5.4/805-display-0041-drm-fourcc-add-a-10bits-fully-packed-variant-of-NV12.patch @@ -16,7 +16,7 @@ Signed-off-by: Laurentiu Palcu --- a/drivers/gpu/drm/drm_fourcc.c +++ b/drivers/gpu/drm/drm_fourcc.c -@@ -261,6 +261,9 @@ const struct drm_format_info *__drm_form +@@ -265,6 +265,9 @@ const struct drm_format_info *__drm_form { .format = DRM_FORMAT_P016, .depth = 0, .num_planes = 2, .char_per_block = { 2, 4, 0 }, .block_w = { 1, 0, 0 }, .block_h = { 1, 0, 0 }, .hsub = 2, .vsub = 2, .is_yuv = true}, diff --git a/target/linux/layerscape/patches-5.4/819-uart-0001-tty-serial-lpuart-add-power-domain-support.patch b/target/linux/layerscape/patches-5.4/819-uart-0001-tty-serial-lpuart-add-power-domain-support.patch index 120a14c3be..9050a4df75 100644 --- a/target/linux/layerscape/patches-5.4/819-uart-0001-tty-serial-lpuart-add-power-domain-support.patch +++ b/target/linux/layerscape/patches-5.4/819-uart-0001-tty-serial-lpuart-add-power-domain-support.patch @@ -27,7 +27,7 @@ Signed-off-by: Fugang Duan #include #include #include -@@ -2394,6 +2396,54 @@ static struct uart_driver lpuart_reg = { +@@ -2420,6 +2422,54 @@ static struct uart_driver lpuart_reg = { .cons = LPUART_CONSOLE, }; @@ -82,7 +82,7 @@ Signed-off-by: Fugang Duan static int lpuart_probe(struct platform_device *pdev) { const struct of_device_id *of_id = of_match_device(lpuart_dt_ids, -@@ -2431,6 +2481,10 @@ static int lpuart_probe(struct platform_ +@@ -2457,6 +2507,10 @@ static int lpuart_probe(struct platform_ sport->port.rs485_config = lpuart_config_rs485; diff --git a/target/linux/layerscape/patches-5.4/819-uart-0002-tty-serial-fsl_lpuart-add-modem-device-reset.patch b/target/linux/layerscape/patches-5.4/819-uart-0002-tty-serial-fsl_lpuart-add-modem-device-reset.patch index 7d6efc38c5..9427ed667c 100644 --- a/target/linux/layerscape/patches-5.4/819-uart-0002-tty-serial-fsl_lpuart-add-modem-device-reset.patch +++ b/target/linux/layerscape/patches-5.4/819-uart-0002-tty-serial-fsl_lpuart-add-modem-device-reset.patch @@ -20,7 +20,7 @@ Signed-off-by: Fugang Duan #include #include #include -@@ -1552,8 +1553,17 @@ static void lpuart32_configure(struct lp +@@ -1572,8 +1573,17 @@ static void lpuart32_configure(struct lp static int lpuart32_startup(struct uart_port *port) { struct lpuart_port *sport = container_of(port, struct lpuart_port, port); diff --git a/target/linux/layerscape/patches-5.4/819-uart-0005-tty-serial-fsl_lpuart-enable-dma-mode-for-imx8qxp.patch b/target/linux/layerscape/patches-5.4/819-uart-0005-tty-serial-fsl_lpuart-enable-dma-mode-for-imx8qxp.patch index 82438c8591..23c99d19cf 100644 --- a/target/linux/layerscape/patches-5.4/819-uart-0005-tty-serial-fsl_lpuart-enable-dma-mode-for-imx8qxp.patch +++ b/target/linux/layerscape/patches-5.4/819-uart-0005-tty-serial-fsl_lpuart-enable-dma-mode-for-imx8qxp.patch @@ -351,7 +351,7 @@ Signed-off-by: Fugang Duan } static void lpuart_dma_rx_free(struct uart_port *port) -@@ -1413,8 +1525,10 @@ static void lpuart_setup_watermark(struc +@@ -1433,8 +1545,10 @@ static void lpuart_setup_watermark(struc writeb(UARTSFIFO_RXUF, sport->port.membase + UARTSFIFO); } @@ -363,7 +363,7 @@ Signed-off-by: Fugang Duan /* Restore cr2 */ writeb(cr2_saved, sport->port.membase + UARTCR2); -@@ -1435,6 +1549,7 @@ static void lpuart32_setup_watermark(str +@@ -1455,6 +1569,7 @@ static void lpuart32_setup_watermark(str { unsigned long val, ctrl; unsigned long ctrl_saved; @@ -371,7 +371,7 @@ Signed-off-by: Fugang Duan ctrl = lpuart32_read(&sport->port, UARTCTRL); ctrl_saved = ctrl; -@@ -1446,12 +1561,26 @@ static void lpuart32_setup_watermark(str +@@ -1466,12 +1581,26 @@ static void lpuart32_setup_watermark(str val = lpuart32_read(&sport->port, UARTFIFO); val |= UARTFIFO_TXFE | UARTFIFO_RXFE; val |= UARTFIFO_TXFLUSH | UARTFIFO_RXFLUSH; @@ -399,7 +399,7 @@ Signed-off-by: Fugang Duan /* Restore cr2 */ lpuart32_write(&sport->port, ctrl_saved, UARTCTRL); } -@@ -1463,17 +1592,29 @@ static void lpuart32_setup_watermark_ena +@@ -1483,17 +1612,29 @@ static void lpuart32_setup_watermark_ena lpuart32_setup_watermark(sport); temp = lpuart32_read(&sport->port, UARTCTRL); @@ -430,7 +430,7 @@ Signed-off-by: Fugang Duan static void lpuart_tx_dma_startup(struct lpuart_port *sport) { u32 uartbaud; -@@ -1537,19 +1678,23 @@ static int lpuart_startup(struct uart_po +@@ -1557,19 +1698,23 @@ static int lpuart_startup(struct uart_po return 0; } @@ -461,7 +461,7 @@ Signed-off-by: Fugang Duan if (!sport->lpuart_dma_tx_use) temp |= UARTCTRL_TIE; lpuart32_write(&sport->port, temp, UARTCTRL); -@@ -1593,12 +1738,12 @@ static int lpuart32_startup(struct uart_ +@@ -1613,12 +1758,12 @@ static int lpuart32_startup(struct uart_ spin_lock_irqsave(&sport->port.lock, flags); @@ -476,7 +476,7 @@ Signed-off-by: Fugang Duan lpuart32_configure(sport); spin_unlock_irqrestore(&sport->port.lock, flags); -@@ -1608,7 +1753,7 @@ static int lpuart32_startup(struct uart_ +@@ -1628,7 +1773,7 @@ static int lpuart32_startup(struct uart_ static void lpuart_dma_shutdown(struct lpuart_port *sport) { if (sport->lpuart_dma_rx_use) { @@ -485,7 +485,7 @@ Signed-off-by: Fugang Duan lpuart_dma_rx_free(&sport->port); sport->lpuart_dma_rx_use = false; } -@@ -1651,11 +1796,22 @@ static void lpuart32_shutdown(struct uar +@@ -1671,11 +1816,22 @@ static void lpuart32_shutdown(struct uar spin_lock_irqsave(&port->lock, flags); @@ -510,7 +510,7 @@ Signed-off-by: Fugang Duan spin_unlock_irqrestore(&port->lock, flags); -@@ -1752,10 +1908,10 @@ lpuart_set_termios(struct uart_port *por +@@ -1772,10 +1928,10 @@ lpuart_set_termios(struct uart_port *por * baud rate and restart Rx DMA path. * * Since timer function acqures sport->port.lock, need to stop before @@ -523,7 +523,7 @@ Signed-off-by: Fugang Duan lpuart_dma_rx_free(&sport->port); } -@@ -1967,10 +2123,10 @@ lpuart32_set_termios(struct uart_port *p +@@ -1987,10 +2143,10 @@ lpuart32_set_termios(struct uart_port *p * baud rate and restart Rx DMA path. * * Since timer function acqures sport->port.lock, need to stop before @@ -536,7 +536,7 @@ Signed-off-by: Fugang Duan lpuart_dma_rx_free(&sport->port); } -@@ -2483,6 +2639,10 @@ static int lpuart_probe(struct platform_ +@@ -2509,6 +2665,10 @@ static int lpuart_probe(struct platform_ sport->port.dev = &pdev->dev; sport->port.type = PORT_LPUART; sport->devtype = sdata->devtype; @@ -547,7 +547,7 @@ Signed-off-by: Fugang Duan ret = platform_get_irq(pdev, 0); if (ret < 0) return ret; -@@ -2633,7 +2793,7 @@ static int lpuart_suspend(struct device +@@ -2659,7 +2819,7 @@ static int lpuart_suspend(struct device * Rx DMA path before suspend and start Rx DMA path on resume. */ if (irq_wake) { diff --git a/target/linux/layerscape/patches-5.4/819-uart-0008-MLK-21445-serial-fsl_lpuart-do-HW-reset-for-communic.patch b/target/linux/layerscape/patches-5.4/819-uart-0008-MLK-21445-serial-fsl_lpuart-do-HW-reset-for-communic.patch index 73d80925c7..3849ac2225 100644 --- a/target/linux/layerscape/patches-5.4/819-uart-0008-MLK-21445-serial-fsl_lpuart-do-HW-reset-for-communic.patch +++ b/target/linux/layerscape/patches-5.4/819-uart-0008-MLK-21445-serial-fsl_lpuart-do-HW-reset-for-communic.patch @@ -105,7 +105,7 @@ Signed-off-by: Shrikant Bobade static void lpuart_stop_tx(struct uart_port *port) { unsigned char temp; -@@ -2726,6 +2768,10 @@ static int lpuart_probe(struct platform_ +@@ -2752,6 +2794,10 @@ static int lpuart_probe(struct platform_ if (ret) goto failed_attach_port; @@ -116,7 +116,7 @@ Signed-off-by: Shrikant Bobade uart_get_rs485_mode(&pdev->dev, &sport->port.rs485); if (sport->port.rs485.flags & SER_RS485_RX_DURING_TX) -@@ -2749,6 +2795,8 @@ static int lpuart_probe(struct platform_ +@@ -2775,6 +2821,8 @@ static int lpuart_probe(struct platform_ return 0; diff --git a/target/linux/layerscape/patches-5.4/819-uart-0009-MLK-17133-02-tty-serial-lpuart-add-runtime-pm-suppor.patch b/target/linux/layerscape/patches-5.4/819-uart-0009-MLK-17133-02-tty-serial-lpuart-add-runtime-pm-suppor.patch index afc5d3207b..201e792681 100644 --- a/target/linux/layerscape/patches-5.4/819-uart-0009-MLK-17133-02-tty-serial-lpuart-add-runtime-pm-suppor.patch +++ b/target/linux/layerscape/patches-5.4/819-uart-0009-MLK-17133-02-tty-serial-lpuart-add-runtime-pm-suppor.patch @@ -43,7 +43,7 @@ Reviewed-by: Robin Gong /* return TIOCSER_TEMT when transmitter is not busy */ static unsigned int lpuart_tx_empty(struct uart_port *port) { -@@ -2283,6 +2298,7 @@ static const struct uart_ops lpuart_pops +@@ -2309,6 +2324,7 @@ static const struct uart_ops lpuart_pops .break_ctl = lpuart_break_ctl, .startup = lpuart_startup, .shutdown = lpuart_shutdown, @@ -51,7 +51,7 @@ Reviewed-by: Robin Gong .set_termios = lpuart_set_termios, .type = lpuart_type, .request_port = lpuart_request_port, -@@ -2307,6 +2323,7 @@ static const struct uart_ops lpuart32_po +@@ -2333,6 +2349,7 @@ static const struct uart_ops lpuart32_po .break_ctl = lpuart32_break_ctl, .startup = lpuart32_startup, .shutdown = lpuart32_shutdown, @@ -59,7 +59,7 @@ Reviewed-by: Robin Gong .set_termios = lpuart32_set_termios, .type = lpuart_type, .request_port = lpuart_request_port, -@@ -2764,6 +2781,11 @@ static int lpuart_probe(struct platform_ +@@ -2790,6 +2807,11 @@ static int lpuart_probe(struct platform_ if (ret) goto failed_irq_request; @@ -71,7 +71,7 @@ Reviewed-by: Robin Gong ret = uart_add_one_port(&lpuart_reg, &sport->port); if (ret) goto failed_attach_port; -@@ -2798,6 +2820,9 @@ static int lpuart_probe(struct platform_ +@@ -2824,6 +2846,9 @@ static int lpuart_probe(struct platform_ failed_reset: uart_remove_one_port(&lpuart_reg, &sport->port); failed_attach_port: @@ -81,7 +81,7 @@ Reviewed-by: Robin Gong failed_irq_request: lpuart_disable_clks(sport); return ret; -@@ -2817,15 +2842,41 @@ static int lpuart_remove(struct platform +@@ -2843,15 +2868,41 @@ static int lpuart_remove(struct platform if (sport->dma_rx_chan) dma_release_channel(sport->dma_rx_chan); @@ -123,7 +123,7 @@ Reviewed-by: Robin Gong if (lpuart_is_32(sport)) { /* disable Rx/Tx and interrupts */ -@@ -2839,10 +2890,14 @@ static int lpuart_suspend(struct device +@@ -2865,10 +2916,14 @@ static int lpuart_suspend(struct device writeb(temp, sport->port.membase + UARTCR2); } @@ -138,7 +138,7 @@ Reviewed-by: Robin Gong if (sport->lpuart_dma_rx_use) { /* -@@ -2873,9 +2928,6 @@ static int lpuart_suspend(struct device +@@ -2899,9 +2954,6 @@ static int lpuart_suspend(struct device dmaengine_terminate_all(sport->dma_tx_chan); } @@ -148,7 +148,7 @@ Reviewed-by: Robin Gong return 0; } -@@ -2883,9 +2935,11 @@ static int lpuart_resume(struct device * +@@ -2909,9 +2961,11 @@ static int lpuart_resume(struct device * { struct lpuart_port *sport = dev_get_drvdata(dev); bool irq_wake = irqd_is_wakeup_set(irq_get_irq_data(sport->port.irq)); @@ -162,7 +162,7 @@ Reviewed-by: Robin Gong if (lpuart_is_32(sport)) lpuart32_setup_watermark_enable(sport); -@@ -2906,13 +2960,23 @@ static int lpuart_resume(struct device * +@@ -2932,13 +2986,23 @@ static int lpuart_resume(struct device * if (lpuart_is_32(sport)) lpuart32_configure(sport); @@ -188,7 +188,7 @@ Reviewed-by: Robin Gong static struct platform_driver lpuart_driver = { .probe = lpuart_probe, -@@ -2920,7 +2984,7 @@ static struct platform_driver lpuart_dri +@@ -2946,7 +3010,7 @@ static struct platform_driver lpuart_dri .driver = { .name = "fsl-lpuart", .of_match_table = lpuart_dt_ids, diff --git a/target/linux/layerscape/patches-5.4/819-uart-0010-tty-serial-lpuart-enable-wakeup-source-for-lpuart.patch b/target/linux/layerscape/patches-5.4/819-uart-0010-tty-serial-lpuart-enable-wakeup-source-for-lpuart.patch index 5a9304ce13..be1a5675a6 100644 --- a/target/linux/layerscape/patches-5.4/819-uart-0010-tty-serial-lpuart-enable-wakeup-source-for-lpuart.patch +++ b/target/linux/layerscape/patches-5.4/819-uart-0010-tty-serial-lpuart-enable-wakeup-source-for-lpuart.patch @@ -28,7 +28,7 @@ Signed-off-by: Fugang Duan #include #include #include -@@ -1719,10 +1720,23 @@ static void lpuart_rx_dma_startup(struct +@@ -1739,10 +1740,23 @@ static void lpuart_rx_dma_startup(struct } } @@ -53,7 +53,7 @@ Signed-off-by: Fugang Duan unsigned char temp; /* determine FIFO size and enable FIFO mode */ -@@ -1735,14 +1749,7 @@ static int lpuart_startup(struct uart_po +@@ -1755,14 +1769,7 @@ static int lpuart_startup(struct uart_po sport->rxfifo_size = UARTFIFO_DEPTH((temp >> UARTPFIFO_RXSIZE_OFF) & UARTPFIFO_FIFOSIZE_MASK); @@ -69,7 +69,7 @@ Signed-off-by: Fugang Duan return 0; } -@@ -1769,11 +1776,27 @@ static void lpuart32_configure(struct lp +@@ -1789,11 +1796,27 @@ static void lpuart32_configure(struct lp lpuart32_write(&sport->port, temp, UARTCTRL); } @@ -98,7 +98,7 @@ Signed-off-by: Fugang Duan unsigned long temp; int ret; -@@ -1805,17 +1828,8 @@ static int lpuart32_startup(struct uart_ +@@ -1825,17 +1848,8 @@ static int lpuart32_startup(struct uart_ sport->port.fifosize = sport->txfifo_size; } @@ -108,16 +108,16 @@ Signed-off-by: Fugang Duan - - lpuart_rx_dma_startup(sport); - lpuart_tx_dma_startup(sport); -- -- lpuart32_setup_watermark_enable(sport); -- lpuart32_configure(sport); + lpuart32_hw_setup(sport); +- lpuart32_setup_watermark_enable(sport); +- lpuart32_configure(sport); +- - spin_unlock_irqrestore(&sport->port.lock, flags); return 0; } -@@ -2867,108 +2881,205 @@ static int lpuart_runtime_resume(struct +@@ -2893,108 +2907,205 @@ static int lpuart_runtime_resume(struct return lpuart_enable_clks(sport); }; @@ -197,8 +197,7 @@ Signed-off-by: Fugang Duan - } + return false; +} - -- /* Disable Rx DMA to use UART port as wakeup source */ ++ +static int lpuart_suspend_noirq(struct device *dev) +{ + struct lpuart_port *sport = dev_get_drvdata(dev); @@ -208,7 +207,8 @@ Signed-off-by: Fugang Duan + serial_lpuart_enable_wakeup(sport, !!irq_wake); + + pinctrl_pm_select_sleep_state(dev); -+ + +- /* Disable Rx DMA to use UART port as wakeup source */ + return 0; +} + @@ -302,7 +302,7 @@ Signed-off-by: Fugang Duan + ~UARTCR5_RDMAS, sport->port.membase + UARTCR5); + } + spin_unlock_irqrestore(&sport->port.lock, flags); -+ } + } + + if (sport->lpuart_dma_tx_use) { + spin_lock_irqsave(&sport->port.lock, flags); @@ -318,7 +318,7 @@ Signed-off-by: Fugang Duan + spin_unlock_irqrestore(&sport->port.lock, flags); + sport->dma_tx_in_progress = false; + dmaengine_terminate_all(sport->dma_tx_chan); - } ++ } + } else if (pm_runtime_active(sport->port.dev)) { + lpuart_disable_clks(sport); + pm_runtime_disable(sport->port.dev); diff --git a/target/linux/layerscape/patches-5.4/819-uart-0011-serial-fsl_lpuart-enable-two-stop-bits.patch b/target/linux/layerscape/patches-5.4/819-uart-0011-serial-fsl_lpuart-enable-two-stop-bits.patch index 76a397a4a2..b32f946b01 100644 --- a/target/linux/layerscape/patches-5.4/819-uart-0011-serial-fsl_lpuart-enable-two-stop-bits.patch +++ b/target/linux/layerscape/patches-5.4/819-uart-0011-serial-fsl_lpuart-enable-two-stop-bits.patch @@ -14,7 +14,7 @@ Signed-off-by: Fugang Duan --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c -@@ -2134,11 +2134,12 @@ lpuart32_set_termios(struct uart_port *p +@@ -2154,11 +2154,12 @@ lpuart32_set_termios(struct uart_port *p { struct lpuart_port *sport = container_of(port, struct lpuart_port, port); unsigned long flags; @@ -28,7 +28,7 @@ Signed-off-by: Fugang Duan modem = lpuart32_read(&sport->port, UARTMODIR); /* * only support CS8 and CS7, and for CS7 must enable PE. -@@ -2175,7 +2176,9 @@ lpuart32_set_termios(struct uart_port *p +@@ -2195,7 +2196,9 @@ lpuart32_set_termios(struct uart_port *p } if (termios->c_cflag & CSTOPB) @@ -39,7 +39,7 @@ Signed-off-by: Fugang Duan /* parity must be enabled when CS7 to match 8-bits format */ if ((termios->c_cflag & CSIZE) == CS7) -@@ -2246,6 +2249,7 @@ lpuart32_set_termios(struct uart_port *p +@@ -2272,6 +2275,7 @@ lpuart32_set_termios(struct uart_port *p lpuart32_write(&sport->port, old_ctrl & ~(UARTCTRL_TE | UARTCTRL_RE), UARTCTRL); diff --git a/target/linux/layerscape/patches-5.4/819-uart-0013-LF-484-tty-serial-lpuart-support-UPIO_MEM32-for-lpua.patch b/target/linux/layerscape/patches-5.4/819-uart-0013-LF-484-tty-serial-lpuart-support-UPIO_MEM32-for-lpua.patch index 522d7023ca..cac8eb8d7f 100644 --- a/target/linux/layerscape/patches-5.4/819-uart-0013-LF-484-tty-serial-lpuart-support-UPIO_MEM32-for-lpua.patch +++ b/target/linux/layerscape/patches-5.4/819-uart-0013-LF-484-tty-serial-lpuart-support-UPIO_MEM32-for-lpua.patch @@ -24,7 +24,7 @@ Signed-off-by: Peng Fan --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c -@@ -2617,7 +2617,9 @@ static int __init lpuart32_early_console +@@ -2643,7 +2643,9 @@ static int __init lpuart32_early_console if (!device->port.membase) return -ENODEV; diff --git a/target/linux/mediatek/patches-5.4/0308-dts-mt7622-add-snand-support.patch b/target/linux/mediatek/patches-5.4/0308-dts-mt7622-add-snand-support.patch index b287780d6c..9f37e3d82b 100644 --- a/target/linux/mediatek/patches-5.4/0308-dts-mt7622-add-snand-support.patch +++ b/target/linux/mediatek/patches-5.4/0308-dts-mt7622-add-snand-support.patch @@ -1,6 +1,6 @@ --- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi -@@ -554,6 +554,19 @@ +@@ -555,6 +555,19 @@ status = "disabled"; }; diff --git a/target/linux/mediatek/patches-5.4/0310-dts-add-wmac-support-for-mt7622-rfb1.patch b/target/linux/mediatek/patches-5.4/0310-dts-add-wmac-support-for-mt7622-rfb1.patch index 84aed89752..f6e437b80d 100644 --- a/target/linux/mediatek/patches-5.4/0310-dts-add-wmac-support-for-mt7622-rfb1.patch +++ b/target/linux/mediatek/patches-5.4/0310-dts-add-wmac-support-for-mt7622-rfb1.patch @@ -1,6 +1,6 @@ --- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi -@@ -716,6 +716,17 @@ +@@ -717,6 +717,17 @@ status = "disabled"; }; diff --git a/target/linux/mediatek/patches-5.4/0993-arm64-dts-mediatek-Split-PCIe-node-for-MT2712-MT7622.patch b/target/linux/mediatek/patches-5.4/0993-arm64-dts-mediatek-Split-PCIe-node-for-MT2712-MT7622.patch index 3c5558b606..4fe0e0f5a0 100644 --- a/target/linux/mediatek/patches-5.4/0993-arm64-dts-mediatek-Split-PCIe-node-for-MT2712-MT7622.patch +++ b/target/linux/mediatek/patches-5.4/0993-arm64-dts-mediatek-Split-PCIe-node-for-MT2712-MT7622.patch @@ -281,7 +281,7 @@ Signed-off-by: chuanjia.liu &pio { --- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi -@@ -794,45 +794,41 @@ +@@ -795,45 +795,41 @@ #reset-cells = <1>; }; @@ -344,7 +344,7 @@ Signed-off-by: chuanjia.liu interrupt-map-mask = <0 0 0 7>; interrupt-map = <0 0 0 1 &pcie_intc0 0>, <0 0 0 2 &pcie_intc0 1>, -@@ -844,15 +840,39 @@ +@@ -845,15 +841,39 @@ #interrupt-cells = <1>; }; }; diff --git a/target/linux/mediatek/patches-5.4/1011-net-ethernet-mtk_eth_soc-add-support-for-coherent-DM.patch b/target/linux/mediatek/patches-5.4/1011-net-ethernet-mtk_eth_soc-add-support-for-coherent-DM.patch index a60a607d8b..96da4a063e 100644 --- a/target/linux/mediatek/patches-5.4/1011-net-ethernet-mtk_eth_soc-add-support-for-coherent-DM.patch +++ b/target/linux/mediatek/patches-5.4/1011-net-ethernet-mtk_eth_soc-add-support-for-coherent-DM.patch @@ -18,7 +18,7 @@ Signed-off-by: Felix Fietkau interface-type = "ace"; reg = <0x5000 0x1000>; }; -@@ -969,6 +969,8 @@ +@@ -970,6 +970,8 @@ power-domains = <&scpsys MT7622_POWER_DOMAIN_ETHSYS>; mediatek,ethsys = <ðsys>; mediatek,sgmiisys = <&sgmiisys>; diff --git a/target/linux/mediatek/patches-5.4/1012-pci-pcie-mediatek-add-support-for-coherent-DMA.patch b/target/linux/mediatek/patches-5.4/1012-pci-pcie-mediatek-add-support-for-coherent-DMA.patch index 20a67676e3..3754ad4667 100644 --- a/target/linux/mediatek/patches-5.4/1012-pci-pcie-mediatek-add-support-for-coherent-DMA.patch +++ b/target/linux/mediatek/patches-5.4/1012-pci-pcie-mediatek-add-support-for-coherent-DMA.patch @@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau --- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi -@@ -805,6 +805,8 @@ +@@ -806,6 +806,8 @@ reg = <0 0x1a143000 0 0x1000>; reg-names = "port0"; mediatek,pcie-cfg = <&pciecfg>; @@ -19,7 +19,7 @@ Signed-off-by: Felix Fietkau #address-cells = <3>; #size-cells = <2>; interrupts = ; -@@ -822,6 +824,7 @@ +@@ -823,6 +825,7 @@ bus-range = <0x00 0xff>; ranges = <0x82000000 0 0x20000000 0x0 0x20000000 0 0x8000000>; status = "disabled"; @@ -27,7 +27,7 @@ Signed-off-by: Felix Fietkau slot0: pcie@0,0 { reg = <0x0000 0 0 0 0>; -@@ -848,6 +851,8 @@ +@@ -849,6 +852,8 @@ reg = <0 0x1a145000 0 0x1000>; reg-names = "port1"; mediatek,pcie-cfg = <&pciecfg>; @@ -36,7 +36,7 @@ Signed-off-by: Felix Fietkau #address-cells = <3>; #size-cells = <2>; interrupts = ; -@@ -866,6 +871,7 @@ +@@ -867,6 +872,7 @@ bus-range = <0x00 0xff>; ranges = <0x82000000 0 0x28000000 0x0 0x28000000 0 0x8000000>; status = "disabled"; @@ -44,7 +44,7 @@ Signed-off-by: Felix Fietkau slot1: pcie@1,0 { reg = <0x0800 0 0 0 0>; -@@ -925,6 +931,11 @@ +@@ -926,6 +932,11 @@ }; }; diff --git a/target/linux/octeontx/patches-5.4/0004-PCI-add-quirk-for-Gateworks-PLX-PEX860x-switch-with-.patch b/target/linux/octeontx/patches-5.4/0004-PCI-add-quirk-for-Gateworks-PLX-PEX860x-switch-with-.patch index 9639a45c93..3621e37b78 100644 --- a/target/linux/octeontx/patches-5.4/0004-PCI-add-quirk-for-Gateworks-PLX-PEX860x-switch-with-.patch +++ b/target/linux/octeontx/patches-5.4/0004-PCI-add-quirk-for-Gateworks-PLX-PEX860x-switch-with-.patch @@ -22,7 +22,7 @@ Signed-off-by: Tim Harvey #include #include #include -@@ -5796,3 +5797,34 @@ static void nvidia_ion_ahci_fixup(struct +@@ -5819,3 +5820,34 @@ static void nvidia_ion_ahci_fixup(struct pdev->dev_flags |= PCI_DEV_FLAGS_HAS_MSI_MASKING; } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NVIDIA, 0x0ab8, nvidia_ion_ahci_fixup); diff --git a/target/linux/ramips/patches-5.4/0031-uvc-add-iPassion-iP2970-support.patch b/target/linux/ramips/patches-5.4/0031-uvc-add-iPassion-iP2970-support.patch index a6c9127601..a7a16e7144 100644 --- a/target/linux/ramips/patches-5.4/0031-uvc-add-iPassion-iP2970-support.patch +++ b/target/linux/ramips/patches-5.4/0031-uvc-add-iPassion-iP2970-support.patch @@ -13,7 +13,7 @@ Signed-off-by: John Crispin --- a/drivers/media/usb/uvc/uvc_driver.c +++ b/drivers/media/usb/uvc/uvc_driver.c -@@ -2911,6 +2911,18 @@ static const struct usb_device_id uvc_id +@@ -2919,6 +2919,18 @@ static const struct usb_device_id uvc_id .bInterfaceSubClass = 1, .bInterfaceProtocol = 0, .driver_info = UVC_INFO_META(V4L2_META_FMT_D4XX) }, @@ -34,7 +34,7 @@ Signed-off-by: John Crispin { USB_INTERFACE_INFO(USB_CLASS_VIDEO, 1, UVC_PC_PROTOCOL_15) }, --- a/drivers/media/usb/uvc/uvc_status.c +++ b/drivers/media/usb/uvc/uvc_status.c -@@ -223,6 +223,7 @@ static void uvc_status_complete(struct u +@@ -225,6 +225,7 @@ static void uvc_status_complete(struct u if (uvc_event_control(urb, status, len)) /* The URB will be resubmitted in work context. */ return; @@ -42,7 +42,7 @@ Signed-off-by: John Crispin break; } -@@ -271,6 +272,7 @@ int uvc_status_init(struct uvc_device *d +@@ -273,6 +274,7 @@ int uvc_status_init(struct uvc_device *d } pipe = usb_rcvintpipe(dev->udev, ep->desc.bEndpointAddress); @@ -214,7 +214,7 @@ Signed-off-by: John Crispin /* Mark the buffer as done if the EOF marker is set. */ if (data[1] & UVC_STREAM_EOF && buf->bytesused != 0) { uvc_trace(UVC_TRACE_FRAME, "Frame complete (EOF found).\n"); -@@ -1747,6 +1892,8 @@ static int uvc_init_video_isoc(struct uv +@@ -1749,6 +1894,8 @@ static int uvc_init_video_isoc(struct uv if (npackets == 0) return -ENOMEM; @@ -225,18 +225,16 @@ Signed-off-by: John Crispin for_each_uvc_urb(uvc_urb, stream) { --- a/drivers/media/usb/uvc/uvcvideo.h +++ b/drivers/media/usb/uvc/uvcvideo.h -@@ -199,7 +199,9 @@ - #define UVC_QUIRK_RESTORE_CTRLS_ON_INIT 0x00000400 +@@ -200,6 +200,8 @@ #define UVC_QUIRK_FORCE_Y8 0x00000800 #define UVC_QUIRK_FORCE_BPP 0x00001000 -- -+#define UVC_QUIRK_MOTION 0x00001000 -+#define UVC_QUIRK_SINGLE_ISO 0x00002000 -+ + #define UVC_QUIRK_WAKE_AUTOSUSPEND 0x00002000 ++#define UVC_QUIRK_MOTION 0x00004000 ++#define UVC_QUIRK_SINGLE_ISO 0x00008000 + /* Format flags */ #define UVC_FMT_FLAG_COMPRESSED 0x00000001 - #define UVC_FMT_FLAG_STREAM 0x00000002 -@@ -666,6 +668,7 @@ struct uvc_device { +@@ -668,6 +670,7 @@ struct uvc_device { u8 *status; struct input_dev *input; char input_phys[64]; From 2541ca616da8357b766130ed2f40dfc2d9e31f1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gonz=C3=A1lez=20Cabanelas?= Date: Thu, 16 Feb 2023 23:04:20 +0100 Subject: [PATCH 06/67] ipq40xx: Linksys MR8300: fix the USB port power MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The USB port on the MR8300 randomly fails to feed bus-powered devices. This is caused by a misconfigured pinmux. The GPIO68 should be used to enable the USB power (active low), but it's inside the NAND pinmux. This GPIO pin was found in the original firmware at a startup script in both MR8300 and EA8300. Therefore apply the fix for both boards. Signed-off-by: Daniel González Cabanelas Reviewed-by: Robert Marko (cherry picked from commit ed64c3323590e3c9fa8b423bf37689023a7a101f) Signed-off-by: Steffen Scheib --- .../files/arch/arm/boot/dts/qcom-ipq4019-xx8300.dtsi | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-xx8300.dtsi b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-xx8300.dtsi index 8f971e505c..cb75e86c74 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-xx8300.dtsi +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-xx8300.dtsi @@ -112,6 +112,16 @@ status = "okay"; }; }; + + regulator-usb-vbus { + compatible = "regulator-fixed"; + regulator-name = "USB_VBUS"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + regulator-always-on; + regulator-boot-on; + gpio = <&tlmm 68 GPIO_ACTIVE_LOW>; + }; }; @@ -280,7 +290,7 @@ pins = "gpio55", "gpio56", "gpio57", "gpio60", "gpio62", "gpio63", "gpio64", "gpio65", "gpio66", - "gpio67", "gpio68", "gpio69"; + "gpio67", "gpio69"; function = "qpic"; bias-pull-down; }; From 32621086c3b0c641609580bdf83d4c731caa7f5e Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 29 Mar 2023 17:54:19 +0200 Subject: [PATCH 07/67] mac80211, mt76: add fixes for recently discovered security issues Fixes CVE-2022-47522 Signed-off-by: Felix Fietkau (cherry picked from commit d54c91bd9ab3c54ee06923eafbd67047816a37e4) --- ...orrectly-mark-FTM-frames-non-buffera.patch | 145 +++++++++ ...mac80211-flush-queues-on-STA-removal.patch | 36 +++ ...i-mvm-support-flush-on-AP-interfaces.patch | 34 ++ ...3-wifi-mac80211-add-flush_sta-method.patch | 91 ++++++ ...ifi-mvm-support-new-flush_sta-method.patch | 53 +++ ...ss-the-dst-buffer-to-of_get_mac_addr.patch | 2 +- ...ix-encap-offload-ethernet-type-check.patch | 12 +- .../kernel/mt76/patches/110-api_update.patch | 11 + ...ifi-mt76-ignore-key-disable-commands.patch | 301 ++++++++++++++++++ 9 files changed, 676 insertions(+), 9 deletions(-) create mode 100644 package/kernel/mac80211/patches/subsys/410-wifi-ieee80211-correctly-mark-FTM-frames-non-buffera.patch create mode 100644 package/kernel/mac80211/patches/subsys/411-wifi-mac80211-flush-queues-on-STA-removal.patch create mode 100644 package/kernel/mac80211/patches/subsys/412-wifi-iwlwifi-mvm-support-flush-on-AP-interfaces.patch create mode 100644 package/kernel/mac80211/patches/subsys/413-wifi-mac80211-add-flush_sta-method.patch create mode 100644 package/kernel/mac80211/patches/subsys/414-wifi-iwlwifi-mvm-support-new-flush_sta-method.patch create mode 100644 package/kernel/mt76/patches/110-api_update.patch create mode 100644 package/kernel/mt76/patches/120-wifi-mt76-ignore-key-disable-commands.patch diff --git a/package/kernel/mac80211/patches/subsys/410-wifi-ieee80211-correctly-mark-FTM-frames-non-buffera.patch b/package/kernel/mac80211/patches/subsys/410-wifi-ieee80211-correctly-mark-FTM-frames-non-buffera.patch new file mode 100644 index 0000000000..6f72c1d5ca --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/410-wifi-ieee80211-correctly-mark-FTM-frames-non-buffera.patch @@ -0,0 +1,145 @@ +From: Johannes Berg +Date: Wed, 29 Mar 2023 16:46:26 +0200 +Subject: [PATCH] wifi: ieee80211: correctly mark FTM frames non-bufferable + +The checks of whether or not a frame is bufferable were not +taking into account that some action frames aren't, such as +FTM. Check this, which requires some changes to the function +ieee80211_is_bufferable_mmpdu() since we need the whole skb +for the checks now. + +Signed-off-by: Johannes Berg +Reviewed-by: Greenman, Gregory +Reviewed-by: Peer, Ilan +--- + +--- a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c ++++ b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c +@@ -604,8 +604,9 @@ static void iwl_mvm_skb_prepare_status(s + + static int iwl_mvm_get_ctrl_vif_queue(struct iwl_mvm *mvm, + struct ieee80211_tx_info *info, +- struct ieee80211_hdr *hdr) ++ struct sk_buff *skb) + { ++ struct ieee80211_hdr *hdr = (void *)skb->data; + struct iwl_mvm_vif *mvmvif = + iwl_mvm_vif_from_mac80211(info->control.vif); + __le16 fc = hdr->frame_control; +@@ -624,7 +625,7 @@ static int iwl_mvm_get_ctrl_vif_queue(st + * reason 7 ("Class 3 frame received from nonassociated STA"). + */ + if (ieee80211_is_mgmt(fc) && +- (!ieee80211_is_bufferable_mmpdu(fc) || ++ (!ieee80211_is_bufferable_mmpdu(skb) || + ieee80211_is_deauth(fc) || ieee80211_is_disassoc(fc))) + return mvm->probe_queue; + +@@ -742,7 +743,7 @@ int iwl_mvm_tx_skb_non_sta(struct iwl_mv + else + sta_id = mvmvif->mcast_sta.sta_id; + +- queue = iwl_mvm_get_ctrl_vif_queue(mvm, &info, hdr); ++ queue = iwl_mvm_get_ctrl_vif_queue(mvm, &info, skb); + } else if (info.control.vif->type == NL80211_IFTYPE_MONITOR) { + queue = mvm->snif_queue; + sta_id = mvm->snif_sta.sta_id; +--- a/include/linux/ieee80211.h ++++ b/include/linux/ieee80211.h +@@ -738,20 +738,6 @@ static inline bool ieee80211_is_any_null + } + + /** +- * ieee80211_is_bufferable_mmpdu - check if frame is bufferable MMPDU +- * @fc: frame control field in little-endian byteorder +- */ +-static inline bool ieee80211_is_bufferable_mmpdu(__le16 fc) +-{ +- /* IEEE 802.11-2012, definition of "bufferable management frame"; +- * note that this ignores the IBSS special case. */ +- return ieee80211_is_mgmt(fc) && +- (ieee80211_is_action(fc) || +- ieee80211_is_disassoc(fc) || +- ieee80211_is_deauth(fc)); +-} +- +-/** + * ieee80211_is_first_frag - check if IEEE80211_SCTL_FRAG is not set + * @seq_ctrl: frame sequence control bytes in little-endian byteorder + */ +@@ -3614,6 +3600,44 @@ static inline u8 *ieee80211_get_DA(struc + } + + /** ++ * ieee80211_is_bufferable_mmpdu - check if frame is bufferable MMPDU ++ * @skb: the skb to check, starting with the 802.11 header ++ */ ++static inline bool ieee80211_is_bufferable_mmpdu(struct sk_buff *skb) ++{ ++ struct ieee80211_mgmt *mgmt = (void *)skb->data; ++ __le16 fc = mgmt->frame_control; ++ ++ /* ++ * IEEE 802.11 REVme D2.0 definition of bufferable MMPDU; ++ * note that this ignores the IBSS special case. ++ */ ++ if (!ieee80211_is_mgmt(fc)) ++ return false; ++ ++ if (ieee80211_is_disassoc(fc) || ieee80211_is_deauth(fc)) ++ return true; ++ ++ if (!ieee80211_is_action(fc)) ++ return false; ++ ++ if (skb->len < offsetofend(typeof(*mgmt), u.action.u.ftm.action_code)) ++ return true; ++ ++ /* action frame - additionally check for non-bufferable FTM */ ++ ++ if (mgmt->u.action.category != WLAN_CATEGORY_PUBLIC && ++ mgmt->u.action.category != WLAN_CATEGORY_PROTECTED_DUAL_OF_ACTION) ++ return true; ++ ++ if (mgmt->u.action.u.ftm.action_code == WLAN_PUB_ACTION_FTM_REQUEST || ++ mgmt->u.action.u.ftm.action_code == WLAN_PUB_ACTION_FTM) ++ return false; ++ ++ return true; ++} ++ ++/** + * _ieee80211_is_robust_mgmt_frame - check if frame is a robust management frame + * @hdr: the frame (buffer must include at least the first octet of payload) + */ +--- a/net/mac80211/tx.c ++++ b/net/mac80211/tx.c +@@ -501,7 +501,7 @@ ieee80211_tx_h_unicast_ps_buf(struct iee + int ac = skb_get_queue_mapping(tx->skb); + + if (ieee80211_is_mgmt(hdr->frame_control) && +- !ieee80211_is_bufferable_mmpdu(hdr->frame_control)) { ++ !ieee80211_is_bufferable_mmpdu(tx->skb)) { + info->flags |= IEEE80211_TX_CTL_NO_PS_BUFFER; + return TX_CONTINUE; + } +@@ -1296,7 +1296,7 @@ static struct txq_info *ieee80211_get_tx + if (!(info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP) && + unlikely(!ieee80211_is_data_present(hdr->frame_control))) { + if ((!ieee80211_is_mgmt(hdr->frame_control) || +- ieee80211_is_bufferable_mmpdu(hdr->frame_control) || ++ ieee80211_is_bufferable_mmpdu(skb) || + vif->type == NL80211_IFTYPE_STATION) && + sta && sta->uploaded) { + /* +--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c ++++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +@@ -814,7 +814,7 @@ static void iwl_mvm_mac_tx(struct ieee80 + if ((info->control.vif->type == NL80211_IFTYPE_AP || + info->control.vif->type == NL80211_IFTYPE_ADHOC) && + ieee80211_is_mgmt(hdr->frame_control) && +- !ieee80211_is_bufferable_mmpdu(hdr->frame_control)) ++ !ieee80211_is_bufferable_mmpdu(skb)) + sta = NULL; + + /* If there is no sta, and it's not offchannel - send through AP */ diff --git a/package/kernel/mac80211/patches/subsys/411-wifi-mac80211-flush-queues-on-STA-removal.patch b/package/kernel/mac80211/patches/subsys/411-wifi-mac80211-flush-queues-on-STA-removal.patch new file mode 100644 index 0000000000..0ad02585ae --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/411-wifi-mac80211-flush-queues-on-STA-removal.patch @@ -0,0 +1,36 @@ +From: Johannes Berg +Date: Mon, 13 Mar 2023 11:42:12 +0100 +Subject: [PATCH] wifi: mac80211: flush queues on STA removal + +When we remove a station, we first make it unreachable, +then we (must) remove its keys, and then remove the +station itself. Depending on the hardware design, if +we have hardware crypto at all, frames still sitting +on hardware queues may then be transmitted without a +valid key, possibly unencrypted or with a fixed key. + +Fix this by flushing the queues when removing stations +so this cannot happen. + +Cc: stable@vger.kernel.org +Signed-off-by: Johannes Berg +Reviewed-by: Greenman, Gregory +--- + +--- a/net/mac80211/sta_info.c ++++ b/net/mac80211/sta_info.c +@@ -1066,6 +1066,14 @@ static void __sta_info_destroy_part2(str + WARN_ON_ONCE(ret); + } + ++ /* Flush queues before removing keys, as that might remove them ++ * from hardware, and then depending on the offload method, any ++ * frames sitting on hardware queues might be sent out without ++ * any encryption at all. ++ */ ++ if (local->ops->set_key) ++ ieee80211_flush_queues(local, sta->sdata, false); ++ + /* now keys can no longer be reached */ + ieee80211_free_sta_keys(local, sta); + diff --git a/package/kernel/mac80211/patches/subsys/412-wifi-iwlwifi-mvm-support-flush-on-AP-interfaces.patch b/package/kernel/mac80211/patches/subsys/412-wifi-iwlwifi-mvm-support-flush-on-AP-interfaces.patch new file mode 100644 index 0000000000..f2883fdbc8 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/412-wifi-iwlwifi-mvm-support-flush-on-AP-interfaces.patch @@ -0,0 +1,34 @@ +From: Johannes Berg +Date: Mon, 13 Mar 2023 12:02:58 +0100 +Subject: [PATCH] wifi: iwlwifi: mvm: support flush on AP interfaces + +Support TX flush on AP interfaces so that we will do a +proper flush for frames on the queue before keys are +removed. + +Signed-off-by: Johannes Berg +Reviewed-by: Greenman, Gregory +--- + +--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c ++++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +@@ -4791,9 +4791,6 @@ static void iwl_mvm_mac_flush(struct iee + return; + } + +- if (vif->type != NL80211_IFTYPE_STATION) +- return; +- + /* Make sure we're done with the deferred traffic before flushing */ + flush_work(&mvm->add_stream_wk); + +@@ -4811,9 +4808,6 @@ static void iwl_mvm_mac_flush(struct iee + if (mvmsta->vif != vif) + continue; + +- /* make sure only TDLS peers or the AP are flushed */ +- WARN_ON(i != mvmvif->ap_sta_id && !sta->tdls); +- + if (drop) { + if (iwl_mvm_flush_sta(mvm, mvmsta, false)) + IWL_ERR(mvm, "flush request fail\n"); diff --git a/package/kernel/mac80211/patches/subsys/413-wifi-mac80211-add-flush_sta-method.patch b/package/kernel/mac80211/patches/subsys/413-wifi-mac80211-add-flush_sta-method.patch new file mode 100644 index 0000000000..4ec63ae883 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/413-wifi-mac80211-add-flush_sta-method.patch @@ -0,0 +1,91 @@ +From: Johannes Berg +Date: Mon, 13 Mar 2023 11:53:51 +0100 +Subject: [PATCH] wifi: mac80211: add flush_sta method + +Some drivers like iwlwifi might have per-STA queues, so we +may want to flush/drop just those queues rather than all +when removing a station. Add a separate method for that. + +Signed-off-by: Johannes Berg +Reviewed-by: Greenman, Gregory +--- + +--- a/include/net/mac80211.h ++++ b/include/net/mac80211.h +@@ -3661,6 +3661,10 @@ enum ieee80211_reconfig_type { + * Note that vif can be NULL. + * The callback can sleep. + * ++ * @flush_sta: Flush or drop all pending frames from the hardware queue(s) for ++ * the given station, as it's about to be removed. ++ * The callback can sleep. ++ * + * @channel_switch: Drivers that need (or want) to offload the channel + * switch operation for CSAs received from the AP may implement this + * callback. They must then call ieee80211_chswitch_done() to indicate +@@ -4065,6 +4069,8 @@ struct ieee80211_ops { + #endif + void (*flush)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, + u32 queues, bool drop); ++ void (*flush_sta)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, ++ struct ieee80211_sta *sta); + void (*channel_switch)(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, + struct ieee80211_channel_switch *ch_switch); +--- a/net/mac80211/driver-ops.h ++++ b/net/mac80211/driver-ops.h +@@ -639,6 +639,21 @@ static inline void drv_flush(struct ieee + trace_drv_return_void(local); + } + ++static inline void drv_flush_sta(struct ieee80211_local *local, ++ struct ieee80211_sub_if_data *sdata, ++ struct sta_info *sta) ++{ ++ might_sleep(); ++ ++ if (sdata && !check_sdata_in_driver(sdata)) ++ return; ++ ++ trace_drv_flush_sta(local, sdata, &sta->sta); ++ if (local->ops->flush_sta) ++ local->ops->flush_sta(&local->hw, &sdata->vif, &sta->sta); ++ trace_drv_return_void(local); ++} ++ + static inline void drv_channel_switch(struct ieee80211_local *local, + struct ieee80211_sub_if_data *sdata, + struct ieee80211_channel_switch *ch_switch) +--- a/net/mac80211/sta_info.c ++++ b/net/mac80211/sta_info.c +@@ -1071,8 +1071,12 @@ static void __sta_info_destroy_part2(str + * frames sitting on hardware queues might be sent out without + * any encryption at all. + */ +- if (local->ops->set_key) +- ieee80211_flush_queues(local, sta->sdata, false); ++ if (local->ops->set_key) { ++ if (local->ops->flush_sta) ++ drv_flush_sta(local, sta->sdata, sta); ++ else ++ ieee80211_flush_queues(local, sta->sdata, false); ++ } + + /* now keys can no longer be reached */ + ieee80211_free_sta_keys(local, sta); +--- a/net/mac80211/trace.h ++++ b/net/mac80211/trace.h +@@ -1140,6 +1140,13 @@ TRACE_EVENT(drv_flush, + ) + ); + ++DEFINE_EVENT(sta_event, drv_flush_sta, ++ TP_PROTO(struct ieee80211_local *local, ++ struct ieee80211_sub_if_data *sdata, ++ struct ieee80211_sta *sta), ++ TP_ARGS(local, sdata, sta) ++); ++ + TRACE_EVENT(drv_channel_switch, + TP_PROTO(struct ieee80211_local *local, + struct ieee80211_sub_if_data *sdata, diff --git a/package/kernel/mac80211/patches/subsys/414-wifi-iwlwifi-mvm-support-new-flush_sta-method.patch b/package/kernel/mac80211/patches/subsys/414-wifi-iwlwifi-mvm-support-new-flush_sta-method.patch new file mode 100644 index 0000000000..b52bbe50b8 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/414-wifi-iwlwifi-mvm-support-new-flush_sta-method.patch @@ -0,0 +1,53 @@ +From: Johannes Berg +Date: Mon, 13 Mar 2023 12:05:35 +0100 +Subject: [PATCH] wifi: iwlwifi: mvm: support new flush_sta method + +For iwlwifi this is simple to implement, and on newer hardware +it's an improvement since we have per-station queues. + +Signed-off-by: Johannes Berg +Reviewed-by: Greenman, Gregory +--- + +--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c ++++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +@@ -4827,6 +4827,31 @@ static void iwl_mvm_mac_flush(struct iee + iwl_trans_wait_tx_queues_empty(mvm->trans, msk); + } + ++static void iwl_mvm_mac_flush_sta(struct ieee80211_hw *hw, ++ struct ieee80211_vif *vif, ++ struct ieee80211_sta *sta) ++{ ++ struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); ++ int i; ++ ++ mutex_lock(&mvm->mutex); ++ for (i = 0; i < mvm->fw->ucode_capa.num_stations; i++) { ++ struct iwl_mvm_sta *mvmsta; ++ struct ieee80211_sta *tmp; ++ ++ tmp = rcu_dereference_protected(mvm->fw_id_to_mac_id[i], ++ lockdep_is_held(&mvm->mutex)); ++ if (tmp != sta) ++ continue; ++ ++ mvmsta = iwl_mvm_sta_from_mac80211(sta); ++ ++ if (iwl_mvm_flush_sta(mvm, mvmsta, false)) ++ IWL_ERR(mvm, "flush request fail\n"); ++ } ++ mutex_unlock(&mvm->mutex); ++} ++ + static int iwl_mvm_mac_get_survey(struct ieee80211_hw *hw, int idx, + struct survey_info *survey) + { +@@ -5296,6 +5321,7 @@ const struct ieee80211_ops iwl_mvm_hw_op + .mgd_prepare_tx = iwl_mvm_mac_mgd_prepare_tx, + .mgd_protect_tdls_discover = iwl_mvm_mac_mgd_protect_tdls_discover, + .flush = iwl_mvm_mac_flush, ++ .flush_sta = iwl_mvm_mac_flush_sta, + .sched_scan_start = iwl_mvm_mac_sched_scan_start, + .sched_scan_stop = iwl_mvm_mac_sched_scan_stop, + .set_key = iwl_mvm_mac_set_key, diff --git a/package/kernel/mt76/patches/100-Revert-of-net-pass-the-dst-buffer-to-of_get_mac_addr.patch b/package/kernel/mt76/patches/100-Revert-of-net-pass-the-dst-buffer-to-of_get_mac_addr.patch index 24b1240548..ede3cca1f0 100644 --- a/package/kernel/mt76/patches/100-Revert-of-net-pass-the-dst-buffer-to-of_get_mac_addr.patch +++ b/package/kernel/mt76/patches/100-Revert-of-net-pass-the-dst-buffer-to-of_get_mac_addr.patch @@ -7,7 +7,7 @@ This reverts commit 4932c5d80153c336c77dbe8d7af9f8fdd879d01f. --- a/eeprom.c +++ b/eeprom.c -@@ -105,9 +105,15 @@ mt76_eeprom_override(struct mt76_phy *ph +@@ -107,9 +107,15 @@ mt76_eeprom_override(struct mt76_phy *ph { struct mt76_dev *dev = phy->dev; diff --git a/package/kernel/mt76/patches/101-fix-encap-offload-ethernet-type-check.patch b/package/kernel/mt76/patches/101-fix-encap-offload-ethernet-type-check.patch index d81aa4dfa3..d3deee42ce 100644 --- a/package/kernel/mt76/patches/101-fix-encap-offload-ethernet-type-check.patch +++ b/package/kernel/mt76/patches/101-fix-encap-offload-ethernet-type-check.patch @@ -17,11 +17,9 @@ Signed-off-by: Felix Fietkau drivers/net/wireless/mediatek/mt76/mt7921/mac.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) -diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c -index 5f4a0e811137..e353e8c44d6c 100644 --- a/mt7915/mac.c +++ b/mt7915/mac.c -@@ -1016,6 +1016,7 @@ mt7915_mac_write_txwi_8023(struct mt7915_dev *dev, __le32 *txwi, +@@ -977,6 +977,7 @@ mt7915_mac_write_txwi_8023(struct mt7915 u8 tid = skb->priority & IEEE80211_QOS_CTL_TID_MASK; u8 fc_type, fc_stype; @@ -29,7 +27,7 @@ index 5f4a0e811137..e353e8c44d6c 100644 bool wmm = false; u32 val; -@@ -1029,7 +1030,8 @@ mt7915_mac_write_txwi_8023(struct mt7915_dev *dev, __le32 *txwi, +@@ -990,7 +991,8 @@ mt7915_mac_write_txwi_8023(struct mt7915 val = FIELD_PREP(MT_TXD1_HDR_FORMAT, MT_HDR_FORMAT_802_3) | FIELD_PREP(MT_TXD1_TID, tid); @@ -39,11 +37,9 @@ index 5f4a0e811137..e353e8c44d6c 100644 val |= MT_TXD1_ETH_802_3; txwi[1] |= cpu_to_le32(val); -diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c -index 368e54c53ddd..ac11e8b28f13 100644 --- a/mt7921/mac.c +++ b/mt7921/mac.c -@@ -814,6 +814,7 @@ mt7921_mac_write_txwi_8023(struct mt7921_dev *dev, __le32 *txwi, +@@ -811,6 +811,7 @@ mt7921_mac_write_txwi_8023(struct mt7921 { u8 tid = skb->priority & IEEE80211_QOS_CTL_TID_MASK; u8 fc_type, fc_stype; @@ -51,7 +47,7 @@ index 368e54c53ddd..ac11e8b28f13 100644 bool wmm = false; u32 val; -@@ -827,7 +828,8 @@ mt7921_mac_write_txwi_8023(struct mt7921_dev *dev, __le32 *txwi, +@@ -824,7 +825,8 @@ mt7921_mac_write_txwi_8023(struct mt7921 val = FIELD_PREP(MT_TXD1_HDR_FORMAT, MT_HDR_FORMAT_802_3) | FIELD_PREP(MT_TXD1_TID, tid); diff --git a/package/kernel/mt76/patches/110-api_update.patch b/package/kernel/mt76/patches/110-api_update.patch new file mode 100644 index 0000000000..a42277704e --- /dev/null +++ b/package/kernel/mt76/patches/110-api_update.patch @@ -0,0 +1,11 @@ +--- a/tx.c ++++ b/tx.c +@@ -326,7 +326,7 @@ mt76_tx(struct mt76_phy *phy, struct iee + if ((dev->drv->drv_flags & MT_DRV_HW_MGMT_TXQ) && + !(info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP) && + !ieee80211_is_data(hdr->frame_control) && +- !ieee80211_is_bufferable_mmpdu(hdr->frame_control)) { ++ !ieee80211_is_bufferable_mmpdu(skb)) { + qid = MT_TXQ_PSD; + skb_set_queue_mapping(skb, qid); + } diff --git a/package/kernel/mt76/patches/120-wifi-mt76-ignore-key-disable-commands.patch b/package/kernel/mt76/patches/120-wifi-mt76-ignore-key-disable-commands.patch new file mode 100644 index 0000000000..3f97de916e --- /dev/null +++ b/package/kernel/mt76/patches/120-wifi-mt76-ignore-key-disable-commands.patch @@ -0,0 +1,301 @@ +From: Felix Fietkau +Date: Wed, 22 Mar 2023 10:17:49 +0100 +Subject: [PATCH] wifi: mt76: ignore key disable commands + +This helps avoid cleartext leakage of already queued or powersave buffered +packets, when a reassoc triggers the key deletion. + +Cc: stable@vger.kernel.org +Signed-off-by: Felix Fietkau +--- + +--- a/mt7603/main.c ++++ b/mt7603/main.c +@@ -512,15 +512,15 @@ mt7603_set_key(struct ieee80211_hw *hw, + !(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) + return -EOPNOTSUPP; + +- if (cmd == SET_KEY) { +- key->hw_key_idx = wcid->idx; +- wcid->hw_key_idx = idx; +- } else { ++ if (cmd != SET_KEY) { + if (idx == wcid->hw_key_idx) + wcid->hw_key_idx = -1; + +- key = NULL; ++ return 0; + } ++ ++ key->hw_key_idx = wcid->idx; ++ wcid->hw_key_idx = idx; + mt76_wcid_key_setup(&dev->mt76, wcid, key); + + return mt7603_wtbl_set_key(dev, wcid->idx, key); +--- a/mt7615/mac.c ++++ b/mt7615/mac.c +@@ -1231,8 +1231,7 @@ EXPORT_SYMBOL_GPL(mt7615_mac_set_rates); + static int + mt7615_mac_wtbl_update_key(struct mt7615_dev *dev, struct mt76_wcid *wcid, + struct ieee80211_key_conf *key, +- enum mt76_cipher_type cipher, u16 cipher_mask, +- enum set_key_cmd cmd) ++ enum mt76_cipher_type cipher, u16 cipher_mask) + { + u32 addr = mt7615_mac_wtbl_addr(dev, wcid->idx) + 30 * 4; + u8 data[32] = {}; +@@ -1241,27 +1240,18 @@ mt7615_mac_wtbl_update_key(struct mt7615 + return -EINVAL; + + mt76_rr_copy(dev, addr, data, sizeof(data)); +- if (cmd == SET_KEY) { +- if (cipher == MT_CIPHER_TKIP) { +- /* Rx/Tx MIC keys are swapped */ +- memcpy(data, key->key, 16); +- memcpy(data + 16, key->key + 24, 8); +- memcpy(data + 24, key->key + 16, 8); +- } else { +- if (cipher_mask == BIT(cipher)) +- memcpy(data, key->key, key->keylen); +- else if (cipher != MT_CIPHER_BIP_CMAC_128) +- memcpy(data, key->key, 16); +- if (cipher == MT_CIPHER_BIP_CMAC_128) +- memcpy(data + 16, key->key, 16); +- } ++ if (cipher == MT_CIPHER_TKIP) { ++ /* Rx/Tx MIC keys are swapped */ ++ memcpy(data, key->key, 16); ++ memcpy(data + 16, key->key + 24, 8); ++ memcpy(data + 24, key->key + 16, 8); + } else { ++ if (cipher_mask == BIT(cipher)) ++ memcpy(data, key->key, key->keylen); ++ else if (cipher != MT_CIPHER_BIP_CMAC_128) ++ memcpy(data, key->key, 16); + if (cipher == MT_CIPHER_BIP_CMAC_128) +- memset(data + 16, 0, 16); +- else if (cipher_mask) +- memset(data, 0, 16); +- if (!cipher_mask) +- memset(data, 0, sizeof(data)); ++ memcpy(data + 16, key->key, 16); + } + + mt76_wr_copy(dev, addr, data, sizeof(data)); +@@ -1272,7 +1262,7 @@ mt7615_mac_wtbl_update_key(struct mt7615 + static int + mt7615_mac_wtbl_update_pk(struct mt7615_dev *dev, struct mt76_wcid *wcid, + enum mt76_cipher_type cipher, u16 cipher_mask, +- int keyidx, enum set_key_cmd cmd) ++ int keyidx) + { + u32 addr = mt7615_mac_wtbl_addr(dev, wcid->idx), w0, w1; + +@@ -1291,9 +1281,7 @@ mt7615_mac_wtbl_update_pk(struct mt7615_ + else + w0 &= ~MT_WTBL_W0_RX_IK_VALID; + +- if (cmd == SET_KEY && +- (cipher != MT_CIPHER_BIP_CMAC_128 || +- cipher_mask == BIT(cipher))) { ++ if (cipher != MT_CIPHER_BIP_CMAC_128 || cipher_mask == BIT(cipher)) { + w0 &= ~MT_WTBL_W0_KEY_IDX; + w0 |= FIELD_PREP(MT_WTBL_W0_KEY_IDX, keyidx); + } +@@ -1310,19 +1298,10 @@ mt7615_mac_wtbl_update_pk(struct mt7615_ + + static void + mt7615_mac_wtbl_update_cipher(struct mt7615_dev *dev, struct mt76_wcid *wcid, +- enum mt76_cipher_type cipher, u16 cipher_mask, +- enum set_key_cmd cmd) ++ enum mt76_cipher_type cipher, u16 cipher_mask) + { + u32 addr = mt7615_mac_wtbl_addr(dev, wcid->idx); + +- if (!cipher_mask) { +- mt76_clear(dev, addr + 2 * 4, MT_WTBL_W2_KEY_TYPE); +- return; +- } +- +- if (cmd != SET_KEY) +- return; +- + if (cipher == MT_CIPHER_BIP_CMAC_128 && + cipher_mask & ~BIT(MT_CIPHER_BIP_CMAC_128)) + return; +@@ -1333,8 +1312,7 @@ mt7615_mac_wtbl_update_cipher(struct mt7 + + int __mt7615_mac_wtbl_set_key(struct mt7615_dev *dev, + struct mt76_wcid *wcid, +- struct ieee80211_key_conf *key, +- enum set_key_cmd cmd) ++ struct ieee80211_key_conf *key) + { + enum mt76_cipher_type cipher; + u16 cipher_mask = wcid->cipher; +@@ -1344,19 +1322,14 @@ int __mt7615_mac_wtbl_set_key(struct mt7 + if (cipher == MT_CIPHER_NONE) + return -EOPNOTSUPP; + +- if (cmd == SET_KEY) +- cipher_mask |= BIT(cipher); +- else +- cipher_mask &= ~BIT(cipher); +- +- mt7615_mac_wtbl_update_cipher(dev, wcid, cipher, cipher_mask, cmd); +- err = mt7615_mac_wtbl_update_key(dev, wcid, key, cipher, cipher_mask, +- cmd); ++ cipher_mask |= BIT(cipher); ++ mt7615_mac_wtbl_update_cipher(dev, wcid, cipher, cipher_mask); ++ err = mt7615_mac_wtbl_update_key(dev, wcid, key, cipher, cipher_mask); + if (err < 0) + return err; + + err = mt7615_mac_wtbl_update_pk(dev, wcid, cipher, cipher_mask, +- key->keyidx, cmd); ++ key->keyidx); + if (err < 0) + return err; + +@@ -1367,13 +1340,12 @@ int __mt7615_mac_wtbl_set_key(struct mt7 + + int mt7615_mac_wtbl_set_key(struct mt7615_dev *dev, + struct mt76_wcid *wcid, +- struct ieee80211_key_conf *key, +- enum set_key_cmd cmd) ++ struct ieee80211_key_conf *key) + { + int err; + + spin_lock_bh(&dev->mt76.lock); +- err = __mt7615_mac_wtbl_set_key(dev, wcid, key, cmd); ++ err = __mt7615_mac_wtbl_set_key(dev, wcid, key); + spin_unlock_bh(&dev->mt76.lock); + + return err; +--- a/mt7615/main.c ++++ b/mt7615/main.c +@@ -405,18 +405,17 @@ static int mt7615_set_key(struct ieee802 + + if (cmd == SET_KEY) + *wcid_keyidx = idx; +- else if (idx == *wcid_keyidx) +- *wcid_keyidx = -1; +- else ++ else { ++ if (idx == *wcid_keyidx) ++ *wcid_keyidx = -1; + goto out; ++ } + +- mt76_wcid_key_setup(&dev->mt76, wcid, +- cmd == SET_KEY ? key : NULL); +- ++ mt76_wcid_key_setup(&dev->mt76, wcid, key); + if (mt76_is_mmio(&dev->mt76)) +- err = mt7615_mac_wtbl_set_key(dev, wcid, key, cmd); ++ err = mt7615_mac_wtbl_set_key(dev, wcid, key); + else +- err = __mt7615_mac_wtbl_set_key(dev, wcid, key, cmd); ++ err = __mt7615_mac_wtbl_set_key(dev, wcid, key); + + out: + mt7615_mutex_release(dev); +--- a/mt7615/mt7615.h ++++ b/mt7615/mt7615.h +@@ -502,11 +502,9 @@ int mt7615_mac_write_txwi(struct mt7615_ + void mt7615_mac_set_timing(struct mt7615_phy *phy); + int __mt7615_mac_wtbl_set_key(struct mt7615_dev *dev, + struct mt76_wcid *wcid, +- struct ieee80211_key_conf *key, +- enum set_key_cmd cmd); ++ struct ieee80211_key_conf *key); + int mt7615_mac_wtbl_set_key(struct mt7615_dev *dev, struct mt76_wcid *wcid, +- struct ieee80211_key_conf *key, +- enum set_key_cmd cmd); ++ struct ieee80211_key_conf *key); + void mt7615_mac_reset_work(struct work_struct *work); + u32 mt7615_mac_get_sta_tid_sn(struct mt7615_dev *dev, int wcid, u8 tid); + +--- a/mt76x02_util.c ++++ b/mt76x02_util.c +@@ -453,20 +453,20 @@ int mt76x02_set_key(struct ieee80211_hw + msta = sta ? (struct mt76x02_sta *)sta->drv_priv : NULL; + wcid = msta ? &msta->wcid : &mvif->group_wcid; + +- if (cmd == SET_KEY) { +- key->hw_key_idx = wcid->idx; +- wcid->hw_key_idx = idx; +- if (key->flags & IEEE80211_KEY_FLAG_RX_MGMT) { +- key->flags |= IEEE80211_KEY_FLAG_SW_MGMT_TX; +- wcid->sw_iv = true; +- } +- } else { ++ if (cmd != SET_KEY) { + if (idx == wcid->hw_key_idx) { + wcid->hw_key_idx = -1; + wcid->sw_iv = false; + } + +- key = NULL; ++ return 0; ++ } ++ ++ key->hw_key_idx = wcid->idx; ++ wcid->hw_key_idx = idx; ++ if (key->flags & IEEE80211_KEY_FLAG_RX_MGMT) { ++ key->flags |= IEEE80211_KEY_FLAG_SW_MGMT_TX; ++ wcid->sw_iv = true; + } + mt76_wcid_key_setup(&dev->mt76, wcid, key); + +--- a/mt7915/main.c ++++ b/mt7915/main.c +@@ -405,16 +405,15 @@ static int mt7915_set_key(struct ieee802 + + mutex_lock(&dev->mt76.mutex); + +- if (cmd == SET_KEY) ++ if (cmd == SET_KEY) { + *wcid_keyidx = idx; +- else if (idx == *wcid_keyidx) +- *wcid_keyidx = -1; +- else ++ } else { ++ if (idx == *wcid_keyidx) ++ *wcid_keyidx = -1; + goto out; ++ } + +- mt76_wcid_key_setup(&dev->mt76, wcid, +- cmd == SET_KEY ? key : NULL); +- ++ mt76_wcid_key_setup(&dev->mt76, wcid, key); + err = mt7915_mcu_add_key(dev, vif, msta, key, cmd); + + out: +--- a/mt7921/main.c ++++ b/mt7921/main.c +@@ -441,16 +441,15 @@ static int mt7921_set_key(struct ieee802 + + mt7921_mutex_acquire(dev); + +- if (cmd == SET_KEY) ++ if (cmd == SET_KEY) { + *wcid_keyidx = idx; +- else if (idx == *wcid_keyidx) +- *wcid_keyidx = -1; +- else ++ } else { ++ if (idx == *wcid_keyidx) ++ *wcid_keyidx = -1; + goto out; ++ } + +- mt76_wcid_key_setup(&dev->mt76, wcid, +- cmd == SET_KEY ? key : NULL); +- ++ mt76_wcid_key_setup(&dev->mt76, wcid, key); + err = mt7921_mcu_add_key(dev, vif, msta, key, cmd); + if (err) + goto out; From cbe73ea33d027dbb4b2cf1eca947ae746119e7d2 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 30 Mar 2023 14:18:04 +0200 Subject: [PATCH 08/67] kernel: remove obsolete netfilter tcp window size check bypass patch On any currently supported hardware, the performance impact should not matter anymore. Signed-off-by: Felix Fietkau (cherry picked from commit 75e78bcaab847557ce1782eb2dea9dff9a029171) --- ...-netfilter_optional_tcp_window_check.patch | 73 ------------------- 1 file changed, 73 deletions(-) delete mode 100644 target/linux/generic/pending-5.4/613-netfilter_optional_tcp_window_check.patch diff --git a/target/linux/generic/pending-5.4/613-netfilter_optional_tcp_window_check.patch b/target/linux/generic/pending-5.4/613-netfilter_optional_tcp_window_check.patch deleted file mode 100644 index f6a3a82eca..0000000000 --- a/target/linux/generic/pending-5.4/613-netfilter_optional_tcp_window_check.patch +++ /dev/null @@ -1,73 +0,0 @@ -From: Felix Fietkau -Subject: netfilter: optional tcp window check - -Signed-off-by: Felix Fietkau ---- - net/netfilter/nf_conntrack_proto_tcp.c | 13 +++++++++++++ - 1 file changed, 13 insertions(+) - ---- a/net/netfilter/nf_conntrack_proto_tcp.c -+++ b/net/netfilter/nf_conntrack_proto_tcp.c -@@ -31,6 +31,9 @@ - #include - #include - -+/* Do not check the TCP window for incoming packets */ -+static int nf_ct_tcp_no_window_check __read_mostly = 1; -+ - /* "Be conservative in what you do, - be liberal in what you accept from others." - If it's non-zero, we mark only out of window RST segments as INVALID. */ -@@ -476,6 +479,9 @@ static bool tcp_in_window(const struct n - s32 receiver_offset; - bool res, in_recv_win; - -+ if (nf_ct_tcp_no_window_check) -+ return true; -+ - /* - * Get the required data from the packet. - */ -@@ -1139,7 +1145,7 @@ int nf_conntrack_tcp_packet(struct nf_co - IP_CT_TCP_FLAG_DATA_UNACKNOWLEDGED && - timeouts[new_state] > timeouts[TCP_CONNTRACK_UNACK]) - timeout = timeouts[TCP_CONNTRACK_UNACK]; -- else if (ct->proto.tcp.last_win == 0 && -+ else if (!nf_ct_tcp_no_window_check && ct->proto.tcp.last_win == 0 && - timeouts[new_state] > timeouts[TCP_CONNTRACK_RETRANS]) - timeout = timeouts[TCP_CONNTRACK_RETRANS]; - else ---- a/net/netfilter/nf_conntrack_standalone.c -+++ b/net/netfilter/nf_conntrack_standalone.c -@@ -25,6 +25,9 @@ - #include - #include - -+/* Do not check the TCP window for incoming packets */ -+static int nf_ct_tcp_no_window_check __read_mostly = 1; -+ - static bool enable_hooks __read_mostly; - MODULE_PARM_DESC(enable_hooks, "Always enable conntrack hooks"); - module_param(enable_hooks, bool, 0000); -@@ -649,6 +652,7 @@ enum nf_ct_sysctl_index { - NF_SYSCTL_CT_PROTO_TIMEOUT_GRE_STREAM, - #endif - -+ NF_SYSCTL_CT_PROTO_TCP_NO_WINDOW_CHECK, - __NF_SYSCTL_CT_LAST_SYSCTL, - }; - -@@ -969,6 +973,13 @@ static struct ctl_table nf_ct_sysctl_tab - .proc_handler = proc_dointvec_jiffies, - }, - #endif -+ [NF_SYSCTL_CT_PROTO_TCP_NO_WINDOW_CHECK] = { -+ .procname = "nf_conntrack_tcp_no_window_check", -+ .data = &nf_ct_tcp_no_window_check, -+ .maxlen = sizeof(unsigned int), -+ .mode = 0644, -+ .proc_handler = proc_dointvec, -+ }, - {} - }; - From 509363ba58e00f5650a1b8349589a44c2d38dfe7 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 29 Mar 2023 17:54:19 +0200 Subject: [PATCH 09/67] mac80211, mt76: add fixes for recently discovered security issues Fixes CVE-2022-47522 Signed-off-by: Felix Fietkau (cherry picked from commit d54c91bd9ab3c54ee06923eafbd67047816a37e4) (cherry picked from commit 4ae854d05568bc36a4df2cb6dd8fb023b5ef9944) --- ...orrectly-mark-FTM-frames-non-buffera.patch | 134 ++++++++ ...mac80211-flush-queues-on-STA-removal.patch | 36 +++ ...i-mvm-support-flush-on-AP-interfaces.patch | 34 ++ ...0-wifi-mac80211-add-flush_sta-method.patch | 91 ++++++ ...ifi-mvm-support-new-flush_sta-method.patch | 53 +++ .../subsys/997-backport-API-from-v6.1.patch | 6 +- .../kernel/mt76/patches/110-api_update.patch | 11 + ...ifi-mt76-ignore-key-disable-commands.patch | 301 ++++++++++++++++++ 8 files changed, 663 insertions(+), 3 deletions(-) create mode 100644 package/kernel/mac80211/patches/subsys/347-wifi-ieee80211-correctly-mark-FTM-frames-non-buffera.patch create mode 100644 package/kernel/mac80211/patches/subsys/348-wifi-mac80211-flush-queues-on-STA-removal.patch create mode 100644 package/kernel/mac80211/patches/subsys/349-wifi-iwlwifi-mvm-support-flush-on-AP-interfaces.patch create mode 100644 package/kernel/mac80211/patches/subsys/350-wifi-mac80211-add-flush_sta-method.patch create mode 100644 package/kernel/mac80211/patches/subsys/351-wifi-iwlwifi-mvm-support-new-flush_sta-method.patch create mode 100644 package/kernel/mt76/patches/110-api_update.patch create mode 100644 package/kernel/mt76/patches/120-wifi-mt76-ignore-key-disable-commands.patch diff --git a/package/kernel/mac80211/patches/subsys/347-wifi-ieee80211-correctly-mark-FTM-frames-non-buffera.patch b/package/kernel/mac80211/patches/subsys/347-wifi-ieee80211-correctly-mark-FTM-frames-non-buffera.patch new file mode 100644 index 0000000000..ac707de53e --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/347-wifi-ieee80211-correctly-mark-FTM-frames-non-buffera.patch @@ -0,0 +1,134 @@ +From: Johannes Berg +Date: Wed, 29 Mar 2023 16:46:26 +0200 +Subject: [PATCH] wifi: ieee80211: correctly mark FTM frames non-bufferable + +The checks of whether or not a frame is bufferable were not +taking into account that some action frames aren't, such as +FTM. Check this, which requires some changes to the function +ieee80211_is_bufferable_mmpdu() since we need the whole skb +for the checks now. + +Signed-off-by: Johannes Berg +Reviewed-by: Greenman, Gregory +Reviewed-by: Peer, Ilan +--- + +--- a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c ++++ b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c +@@ -551,8 +551,9 @@ static void iwl_mvm_skb_prepare_status(s + + static int iwl_mvm_get_ctrl_vif_queue(struct iwl_mvm *mvm, + struct ieee80211_tx_info *info, +- struct ieee80211_hdr *hdr) ++ struct sk_buff *skb) + { ++ struct ieee80211_hdr *hdr = (void *)skb->data; + struct iwl_mvm_vif *mvmvif = + iwl_mvm_vif_from_mac80211(info->control.vif); + __le16 fc = hdr->frame_control; +@@ -571,7 +572,7 @@ static int iwl_mvm_get_ctrl_vif_queue(st + * reason 7 ("Class 3 frame received from nonassociated STA"). + */ + if (ieee80211_is_mgmt(fc) && +- (!ieee80211_is_bufferable_mmpdu(fc) || ++ (!ieee80211_is_bufferable_mmpdu(skb) || + ieee80211_is_deauth(fc) || ieee80211_is_disassoc(fc))) + return mvm->probe_queue; + +@@ -689,7 +690,7 @@ int iwl_mvm_tx_skb_non_sta(struct iwl_mv + else + sta_id = mvmvif->mcast_sta.sta_id; + +- queue = iwl_mvm_get_ctrl_vif_queue(mvm, &info, hdr); ++ queue = iwl_mvm_get_ctrl_vif_queue(mvm, &info, skb); + } else if (info.control.vif->type == NL80211_IFTYPE_MONITOR) { + queue = mvm->snif_queue; + sta_id = mvm->snif_sta.sta_id; +--- a/include/linux/ieee80211.h ++++ b/include/linux/ieee80211.h +@@ -738,20 +738,6 @@ static inline bool ieee80211_is_any_null + } + + /** +- * ieee80211_is_bufferable_mmpdu - check if frame is bufferable MMPDU +- * @fc: frame control field in little-endian byteorder +- */ +-static inline bool ieee80211_is_bufferable_mmpdu(__le16 fc) +-{ +- /* IEEE 802.11-2012, definition of "bufferable management frame"; +- * note that this ignores the IBSS special case. */ +- return ieee80211_is_mgmt(fc) && +- (ieee80211_is_action(fc) || +- ieee80211_is_disassoc(fc) || +- ieee80211_is_deauth(fc)); +-} +- +-/** + * ieee80211_is_first_frag - check if IEEE80211_SCTL_FRAG is not set + * @seq_ctrl: frame sequence control bytes in little-endian byteorder + */ +@@ -3672,6 +3658,44 @@ static inline u8 *ieee80211_get_DA(struc + } + + /** ++ * ieee80211_is_bufferable_mmpdu - check if frame is bufferable MMPDU ++ * @skb: the skb to check, starting with the 802.11 header ++ */ ++static inline bool ieee80211_is_bufferable_mmpdu(struct sk_buff *skb) ++{ ++ struct ieee80211_mgmt *mgmt = (void *)skb->data; ++ __le16 fc = mgmt->frame_control; ++ ++ /* ++ * IEEE 802.11 REVme D2.0 definition of bufferable MMPDU; ++ * note that this ignores the IBSS special case. ++ */ ++ if (!ieee80211_is_mgmt(fc)) ++ return false; ++ ++ if (ieee80211_is_disassoc(fc) || ieee80211_is_deauth(fc)) ++ return true; ++ ++ if (!ieee80211_is_action(fc)) ++ return false; ++ ++ if (skb->len < offsetofend(typeof(*mgmt), u.action.u.ftm.action_code)) ++ return true; ++ ++ /* action frame - additionally check for non-bufferable FTM */ ++ ++ if (mgmt->u.action.category != WLAN_CATEGORY_PUBLIC && ++ mgmt->u.action.category != WLAN_CATEGORY_PROTECTED_DUAL_OF_ACTION) ++ return true; ++ ++ if (mgmt->u.action.u.ftm.action_code == WLAN_PUB_ACTION_FTM_REQUEST || ++ mgmt->u.action.u.ftm.action_code == WLAN_PUB_ACTION_FTM) ++ return false; ++ ++ return true; ++} ++ ++/** + * _ieee80211_is_robust_mgmt_frame - check if frame is a robust management frame + * @hdr: the frame (buffer must include at least the first octet of payload) + */ +--- a/net/mac80211/tx.c ++++ b/net/mac80211/tx.c +@@ -487,7 +487,7 @@ ieee80211_tx_h_unicast_ps_buf(struct iee + int ac = skb_get_queue_mapping(tx->skb); + + if (ieee80211_is_mgmt(hdr->frame_control) && +- !ieee80211_is_bufferable_mmpdu(hdr->frame_control)) { ++ !ieee80211_is_bufferable_mmpdu(tx->skb)) { + info->flags |= IEEE80211_TX_CTL_NO_PS_BUFFER; + return TX_CONTINUE; + } +@@ -1282,7 +1282,7 @@ static struct txq_info *ieee80211_get_tx + if (!(info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP) && + unlikely(!ieee80211_is_data_present(hdr->frame_control))) { + if ((!ieee80211_is_mgmt(hdr->frame_control) || +- ieee80211_is_bufferable_mmpdu(hdr->frame_control) || ++ ieee80211_is_bufferable_mmpdu(skb) || + vif->type == NL80211_IFTYPE_STATION) && + sta && sta->uploaded) { + /* diff --git a/package/kernel/mac80211/patches/subsys/348-wifi-mac80211-flush-queues-on-STA-removal.patch b/package/kernel/mac80211/patches/subsys/348-wifi-mac80211-flush-queues-on-STA-removal.patch new file mode 100644 index 0000000000..3e148a9d7e --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/348-wifi-mac80211-flush-queues-on-STA-removal.patch @@ -0,0 +1,36 @@ +From: Johannes Berg +Date: Mon, 13 Mar 2023 11:42:12 +0100 +Subject: [PATCH] wifi: mac80211: flush queues on STA removal + +When we remove a station, we first make it unreachable, +then we (must) remove its keys, and then remove the +station itself. Depending on the hardware design, if +we have hardware crypto at all, frames still sitting +on hardware queues may then be transmitted without a +valid key, possibly unencrypted or with a fixed key. + +Fix this by flushing the queues when removing stations +so this cannot happen. + +Cc: stable@vger.kernel.org +Signed-off-by: Johannes Berg +Reviewed-by: Greenman, Gregory +--- + +--- a/net/mac80211/sta_info.c ++++ b/net/mac80211/sta_info.c +@@ -1070,6 +1070,14 @@ static void __sta_info_destroy_part2(str + WARN_ON_ONCE(ret); + } + ++ /* Flush queues before removing keys, as that might remove them ++ * from hardware, and then depending on the offload method, any ++ * frames sitting on hardware queues might be sent out without ++ * any encryption at all. ++ */ ++ if (local->ops->set_key) ++ ieee80211_flush_queues(local, sta->sdata, false); ++ + /* now keys can no longer be reached */ + ieee80211_free_sta_keys(local, sta); + diff --git a/package/kernel/mac80211/patches/subsys/349-wifi-iwlwifi-mvm-support-flush-on-AP-interfaces.patch b/package/kernel/mac80211/patches/subsys/349-wifi-iwlwifi-mvm-support-flush-on-AP-interfaces.patch new file mode 100644 index 0000000000..0b070b144e --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/349-wifi-iwlwifi-mvm-support-flush-on-AP-interfaces.patch @@ -0,0 +1,34 @@ +From: Johannes Berg +Date: Mon, 13 Mar 2023 12:02:58 +0100 +Subject: [PATCH] wifi: iwlwifi: mvm: support flush on AP interfaces + +Support TX flush on AP interfaces so that we will do a +proper flush for frames on the queue before keys are +removed. + +Signed-off-by: Johannes Berg +Reviewed-by: Greenman, Gregory +--- + +--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c ++++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +@@ -4817,9 +4817,6 @@ static void iwl_mvm_mac_flush(struct iee + return; + } + +- if (vif->type != NL80211_IFTYPE_STATION) +- return; +- + /* Make sure we're done with the deferred traffic before flushing */ + flush_work(&mvm->add_stream_wk); + +@@ -4837,9 +4834,6 @@ static void iwl_mvm_mac_flush(struct iee + if (mvmsta->vif != vif) + continue; + +- /* make sure only TDLS peers or the AP are flushed */ +- WARN_ON(i != mvmvif->ap_sta_id && !sta->tdls); +- + if (drop) { + if (iwl_mvm_flush_sta(mvm, mvmsta, false)) + IWL_ERR(mvm, "flush request fail\n"); diff --git a/package/kernel/mac80211/patches/subsys/350-wifi-mac80211-add-flush_sta-method.patch b/package/kernel/mac80211/patches/subsys/350-wifi-mac80211-add-flush_sta-method.patch new file mode 100644 index 0000000000..ae2ef8352e --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/350-wifi-mac80211-add-flush_sta-method.patch @@ -0,0 +1,91 @@ +From: Johannes Berg +Date: Mon, 13 Mar 2023 11:53:51 +0100 +Subject: [PATCH] wifi: mac80211: add flush_sta method + +Some drivers like iwlwifi might have per-STA queues, so we +may want to flush/drop just those queues rather than all +when removing a station. Add a separate method for that. + +Signed-off-by: Johannes Berg +Reviewed-by: Greenman, Gregory +--- + +--- a/include/net/mac80211.h ++++ b/include/net/mac80211.h +@@ -3688,6 +3688,10 @@ struct ieee80211_prep_tx_info { + * Note that vif can be NULL. + * The callback can sleep. + * ++ * @flush_sta: Flush or drop all pending frames from the hardware queue(s) for ++ * the given station, as it's about to be removed. ++ * The callback can sleep. ++ * + * @channel_switch: Drivers that need (or want) to offload the channel + * switch operation for CSAs received from the AP may implement this + * callback. They must then call ieee80211_chswitch_done() to indicate +@@ -4116,6 +4120,8 @@ struct ieee80211_ops { + #endif + void (*flush)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, + u32 queues, bool drop); ++ void (*flush_sta)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, ++ struct ieee80211_sta *sta); + void (*channel_switch)(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, + struct ieee80211_channel_switch *ch_switch); +--- a/net/mac80211/driver-ops.h ++++ b/net/mac80211/driver-ops.h +@@ -639,6 +639,21 @@ static inline void drv_flush(struct ieee + trace_drv_return_void(local); + } + ++static inline void drv_flush_sta(struct ieee80211_local *local, ++ struct ieee80211_sub_if_data *sdata, ++ struct sta_info *sta) ++{ ++ might_sleep(); ++ ++ if (sdata && !check_sdata_in_driver(sdata)) ++ return; ++ ++ trace_drv_flush_sta(local, sdata, &sta->sta); ++ if (local->ops->flush_sta) ++ local->ops->flush_sta(&local->hw, &sdata->vif, &sta->sta); ++ trace_drv_return_void(local); ++} ++ + static inline void drv_channel_switch(struct ieee80211_local *local, + struct ieee80211_sub_if_data *sdata, + struct ieee80211_channel_switch *ch_switch) +--- a/net/mac80211/sta_info.c ++++ b/net/mac80211/sta_info.c +@@ -1075,8 +1075,12 @@ static void __sta_info_destroy_part2(str + * frames sitting on hardware queues might be sent out without + * any encryption at all. + */ +- if (local->ops->set_key) +- ieee80211_flush_queues(local, sta->sdata, false); ++ if (local->ops->set_key) { ++ if (local->ops->flush_sta) ++ drv_flush_sta(local, sta->sdata, sta); ++ else ++ ieee80211_flush_queues(local, sta->sdata, false); ++ } + + /* now keys can no longer be reached */ + ieee80211_free_sta_keys(local, sta); +--- a/net/mac80211/trace.h ++++ b/net/mac80211/trace.h +@@ -1140,6 +1140,13 @@ TRACE_EVENT(drv_flush, + ) + ); + ++DEFINE_EVENT(sta_event, drv_flush_sta, ++ TP_PROTO(struct ieee80211_local *local, ++ struct ieee80211_sub_if_data *sdata, ++ struct ieee80211_sta *sta), ++ TP_ARGS(local, sdata, sta) ++); ++ + TRACE_EVENT(drv_channel_switch, + TP_PROTO(struct ieee80211_local *local, + struct ieee80211_sub_if_data *sdata, diff --git a/package/kernel/mac80211/patches/subsys/351-wifi-iwlwifi-mvm-support-new-flush_sta-method.patch b/package/kernel/mac80211/patches/subsys/351-wifi-iwlwifi-mvm-support-new-flush_sta-method.patch new file mode 100644 index 0000000000..31f60ce024 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/351-wifi-iwlwifi-mvm-support-new-flush_sta-method.patch @@ -0,0 +1,53 @@ +From: Johannes Berg +Date: Mon, 13 Mar 2023 12:05:35 +0100 +Subject: [PATCH] wifi: iwlwifi: mvm: support new flush_sta method + +For iwlwifi this is simple to implement, and on newer hardware +it's an improvement since we have per-station queues. + +Signed-off-by: Johannes Berg +Reviewed-by: Greenman, Gregory +--- + +--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c ++++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +@@ -4853,6 +4853,31 @@ static void iwl_mvm_mac_flush(struct iee + iwl_trans_wait_tx_queues_empty(mvm->trans, msk); + } + ++static void iwl_mvm_mac_flush_sta(struct ieee80211_hw *hw, ++ struct ieee80211_vif *vif, ++ struct ieee80211_sta *sta) ++{ ++ struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); ++ int i; ++ ++ mutex_lock(&mvm->mutex); ++ for (i = 0; i < mvm->fw->ucode_capa.num_stations; i++) { ++ struct iwl_mvm_sta *mvmsta; ++ struct ieee80211_sta *tmp; ++ ++ tmp = rcu_dereference_protected(mvm->fw_id_to_mac_id[i], ++ lockdep_is_held(&mvm->mutex)); ++ if (tmp != sta) ++ continue; ++ ++ mvmsta = iwl_mvm_sta_from_mac80211(sta); ++ ++ if (iwl_mvm_flush_sta(mvm, mvmsta, false)) ++ IWL_ERR(mvm, "flush request fail\n"); ++ } ++ mutex_unlock(&mvm->mutex); ++} ++ + static int iwl_mvm_mac_get_survey(struct ieee80211_hw *hw, int idx, + struct survey_info *survey) + { +@@ -5366,6 +5391,7 @@ const struct ieee80211_ops iwl_mvm_hw_op + .mgd_prepare_tx = iwl_mvm_mac_mgd_prepare_tx, + .mgd_protect_tdls_discover = iwl_mvm_mac_mgd_protect_tdls_discover, + .flush = iwl_mvm_mac_flush, ++ .flush_sta = iwl_mvm_mac_flush_sta, + .sched_scan_start = iwl_mvm_mac_sched_scan_start, + .sched_scan_stop = iwl_mvm_mac_sched_scan_stop, + .set_key = iwl_mvm_mac_set_key, diff --git a/package/kernel/mac80211/patches/subsys/997-backport-API-from-v6.1.patch b/package/kernel/mac80211/patches/subsys/997-backport-API-from-v6.1.patch index 142d1b2a88..9a45d2e05a 100644 --- a/package/kernel/mac80211/patches/subsys/997-backport-API-from-v6.1.patch +++ b/package/kernel/mac80211/patches/subsys/997-backport-API-from-v6.1.patch @@ -158,7 +158,7 @@ u8 drv_priv[] __aligned(sizeof(void *)); --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h -@@ -1916,6 +1916,73 @@ struct ieee80211_he_mu_edca_param_ac_rec +@@ -1902,6 +1902,73 @@ struct ieee80211_he_mu_edca_param_ac_rec } __packed; /** @@ -232,7 +232,7 @@ * struct ieee80211_mu_edca_param_set - MU EDCA Parameter Set element * * This structure is the "MU EDCA Parameter Set element" fields as -@@ -2228,6 +2295,12 @@ int ieee80211_get_vht_max_nss(struct iee +@@ -2214,6 +2281,12 @@ int ieee80211_get_vht_max_nss(struct iee #define IEEE80211_HE_PHY_CAP9_NOMIMAL_PKT_PADDING_16US 0x80 #define IEEE80211_HE_PHY_CAP9_NOMIMAL_PKT_PADDING_RESERVED 0xc0 #define IEEE80211_HE_PHY_CAP9_NOMIMAL_PKT_PADDING_MASK 0xc0 @@ -245,7 +245,7 @@ #define IEEE80211_HE_PHY_CAP10_HE_MU_M1RU_MAX_LTF 0x01 -@@ -3982,4 +4055,7 @@ enum ieee80211_range_params_max_total_lt +@@ -4006,4 +4079,7 @@ enum ieee80211_range_params_max_total_lt IEEE80211_RANGE_PARAMS_MAX_TOTAL_LTF_UNSPECIFIED, }; diff --git a/package/kernel/mt76/patches/110-api_update.patch b/package/kernel/mt76/patches/110-api_update.patch new file mode 100644 index 0000000000..27bd6286b0 --- /dev/null +++ b/package/kernel/mt76/patches/110-api_update.patch @@ -0,0 +1,11 @@ +--- a/tx.c ++++ b/tx.c +@@ -325,7 +325,7 @@ mt76_tx(struct mt76_phy *phy, struct iee + if ((dev->drv->drv_flags & MT_DRV_HW_MGMT_TXQ) && + !(info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP) && + !ieee80211_is_data(hdr->frame_control) && +- !ieee80211_is_bufferable_mmpdu(hdr->frame_control)) { ++ !ieee80211_is_bufferable_mmpdu(skb)) { + qid = MT_TXQ_PSD; + } + diff --git a/package/kernel/mt76/patches/120-wifi-mt76-ignore-key-disable-commands.patch b/package/kernel/mt76/patches/120-wifi-mt76-ignore-key-disable-commands.patch new file mode 100644 index 0000000000..b1ebb9ee94 --- /dev/null +++ b/package/kernel/mt76/patches/120-wifi-mt76-ignore-key-disable-commands.patch @@ -0,0 +1,301 @@ +From: Felix Fietkau +Date: Wed, 22 Mar 2023 10:17:49 +0100 +Subject: [PATCH] wifi: mt76: ignore key disable commands + +This helps avoid cleartext leakage of already queued or powersave buffered +packets, when a reassoc triggers the key deletion. + +Cc: stable@vger.kernel.org +Signed-off-by: Felix Fietkau +--- + +--- a/mt7603/main.c ++++ b/mt7603/main.c +@@ -512,15 +512,15 @@ mt7603_set_key(struct ieee80211_hw *hw, + !(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) + return -EOPNOTSUPP; + +- if (cmd == SET_KEY) { +- key->hw_key_idx = wcid->idx; +- wcid->hw_key_idx = idx; +- } else { ++ if (cmd != SET_KEY) { + if (idx == wcid->hw_key_idx) + wcid->hw_key_idx = -1; + +- key = NULL; ++ return 0; + } ++ ++ key->hw_key_idx = wcid->idx; ++ wcid->hw_key_idx = idx; + mt76_wcid_key_setup(&dev->mt76, wcid, key); + + return mt7603_wtbl_set_key(dev, wcid->idx, key); +--- a/mt7615/mac.c ++++ b/mt7615/mac.c +@@ -1193,8 +1193,7 @@ EXPORT_SYMBOL_GPL(mt7615_mac_enable_rtsc + static int + mt7615_mac_wtbl_update_key(struct mt7615_dev *dev, struct mt76_wcid *wcid, + struct ieee80211_key_conf *key, +- enum mt76_cipher_type cipher, u16 cipher_mask, +- enum set_key_cmd cmd) ++ enum mt76_cipher_type cipher, u16 cipher_mask) + { + u32 addr = mt7615_mac_wtbl_addr(dev, wcid->idx) + 30 * 4; + u8 data[32] = {}; +@@ -1203,27 +1202,18 @@ mt7615_mac_wtbl_update_key(struct mt7615 + return -EINVAL; + + mt76_rr_copy(dev, addr, data, sizeof(data)); +- if (cmd == SET_KEY) { +- if (cipher == MT_CIPHER_TKIP) { +- /* Rx/Tx MIC keys are swapped */ +- memcpy(data, key->key, 16); +- memcpy(data + 16, key->key + 24, 8); +- memcpy(data + 24, key->key + 16, 8); +- } else { +- if (cipher_mask == BIT(cipher)) +- memcpy(data, key->key, key->keylen); +- else if (cipher != MT_CIPHER_BIP_CMAC_128) +- memcpy(data, key->key, 16); +- if (cipher == MT_CIPHER_BIP_CMAC_128) +- memcpy(data + 16, key->key, 16); +- } ++ if (cipher == MT_CIPHER_TKIP) { ++ /* Rx/Tx MIC keys are swapped */ ++ memcpy(data, key->key, 16); ++ memcpy(data + 16, key->key + 24, 8); ++ memcpy(data + 24, key->key + 16, 8); + } else { ++ if (cipher_mask == BIT(cipher)) ++ memcpy(data, key->key, key->keylen); ++ else if (cipher != MT_CIPHER_BIP_CMAC_128) ++ memcpy(data, key->key, 16); + if (cipher == MT_CIPHER_BIP_CMAC_128) +- memset(data + 16, 0, 16); +- else if (cipher_mask) +- memset(data, 0, 16); +- if (!cipher_mask) +- memset(data, 0, sizeof(data)); ++ memcpy(data + 16, key->key, 16); + } + + mt76_wr_copy(dev, addr, data, sizeof(data)); +@@ -1234,7 +1224,7 @@ mt7615_mac_wtbl_update_key(struct mt7615 + static int + mt7615_mac_wtbl_update_pk(struct mt7615_dev *dev, struct mt76_wcid *wcid, + enum mt76_cipher_type cipher, u16 cipher_mask, +- int keyidx, enum set_key_cmd cmd) ++ int keyidx) + { + u32 addr = mt7615_mac_wtbl_addr(dev, wcid->idx), w0, w1; + +@@ -1253,9 +1243,7 @@ mt7615_mac_wtbl_update_pk(struct mt7615_ + else + w0 &= ~MT_WTBL_W0_RX_IK_VALID; + +- if (cmd == SET_KEY && +- (cipher != MT_CIPHER_BIP_CMAC_128 || +- cipher_mask == BIT(cipher))) { ++ if (cipher != MT_CIPHER_BIP_CMAC_128 || cipher_mask == BIT(cipher)) { + w0 &= ~MT_WTBL_W0_KEY_IDX; + w0 |= FIELD_PREP(MT_WTBL_W0_KEY_IDX, keyidx); + } +@@ -1272,19 +1260,10 @@ mt7615_mac_wtbl_update_pk(struct mt7615_ + + static void + mt7615_mac_wtbl_update_cipher(struct mt7615_dev *dev, struct mt76_wcid *wcid, +- enum mt76_cipher_type cipher, u16 cipher_mask, +- enum set_key_cmd cmd) ++ enum mt76_cipher_type cipher, u16 cipher_mask) + { + u32 addr = mt7615_mac_wtbl_addr(dev, wcid->idx); + +- if (!cipher_mask) { +- mt76_clear(dev, addr + 2 * 4, MT_WTBL_W2_KEY_TYPE); +- return; +- } +- +- if (cmd != SET_KEY) +- return; +- + if (cipher == MT_CIPHER_BIP_CMAC_128 && + cipher_mask & ~BIT(MT_CIPHER_BIP_CMAC_128)) + return; +@@ -1295,8 +1274,7 @@ mt7615_mac_wtbl_update_cipher(struct mt7 + + int __mt7615_mac_wtbl_set_key(struct mt7615_dev *dev, + struct mt76_wcid *wcid, +- struct ieee80211_key_conf *key, +- enum set_key_cmd cmd) ++ struct ieee80211_key_conf *key) + { + enum mt76_cipher_type cipher; + u16 cipher_mask = wcid->cipher; +@@ -1306,19 +1284,14 @@ int __mt7615_mac_wtbl_set_key(struct mt7 + if (cipher == MT_CIPHER_NONE) + return -EOPNOTSUPP; + +- if (cmd == SET_KEY) +- cipher_mask |= BIT(cipher); +- else +- cipher_mask &= ~BIT(cipher); +- +- mt7615_mac_wtbl_update_cipher(dev, wcid, cipher, cipher_mask, cmd); +- err = mt7615_mac_wtbl_update_key(dev, wcid, key, cipher, cipher_mask, +- cmd); ++ cipher_mask |= BIT(cipher); ++ mt7615_mac_wtbl_update_cipher(dev, wcid, cipher, cipher_mask); ++ err = mt7615_mac_wtbl_update_key(dev, wcid, key, cipher, cipher_mask); + if (err < 0) + return err; + + err = mt7615_mac_wtbl_update_pk(dev, wcid, cipher, cipher_mask, +- key->keyidx, cmd); ++ key->keyidx); + if (err < 0) + return err; + +@@ -1329,13 +1302,12 @@ int __mt7615_mac_wtbl_set_key(struct mt7 + + int mt7615_mac_wtbl_set_key(struct mt7615_dev *dev, + struct mt76_wcid *wcid, +- struct ieee80211_key_conf *key, +- enum set_key_cmd cmd) ++ struct ieee80211_key_conf *key) + { + int err; + + spin_lock_bh(&dev->mt76.lock); +- err = __mt7615_mac_wtbl_set_key(dev, wcid, key, cmd); ++ err = __mt7615_mac_wtbl_set_key(dev, wcid, key); + spin_unlock_bh(&dev->mt76.lock); + + return err; +--- a/mt7615/main.c ++++ b/mt7615/main.c +@@ -391,18 +391,17 @@ static int mt7615_set_key(struct ieee802 + + if (cmd == SET_KEY) + *wcid_keyidx = idx; +- else if (idx == *wcid_keyidx) +- *wcid_keyidx = -1; +- else ++ else { ++ if (idx == *wcid_keyidx) ++ *wcid_keyidx = -1; + goto out; ++ } + +- mt76_wcid_key_setup(&dev->mt76, wcid, +- cmd == SET_KEY ? key : NULL); +- ++ mt76_wcid_key_setup(&dev->mt76, wcid, key); + if (mt76_is_mmio(&dev->mt76)) +- err = mt7615_mac_wtbl_set_key(dev, wcid, key, cmd); ++ err = mt7615_mac_wtbl_set_key(dev, wcid, key); + else +- err = __mt7615_mac_wtbl_set_key(dev, wcid, key, cmd); ++ err = __mt7615_mac_wtbl_set_key(dev, wcid, key); + + out: + mt7615_mutex_release(dev); +--- a/mt7615/mt7615.h ++++ b/mt7615/mt7615.h +@@ -491,11 +491,9 @@ int mt7615_mac_write_txwi(struct mt7615_ + void mt7615_mac_set_timing(struct mt7615_phy *phy); + int __mt7615_mac_wtbl_set_key(struct mt7615_dev *dev, + struct mt76_wcid *wcid, +- struct ieee80211_key_conf *key, +- enum set_key_cmd cmd); ++ struct ieee80211_key_conf *key); + int mt7615_mac_wtbl_set_key(struct mt7615_dev *dev, struct mt76_wcid *wcid, +- struct ieee80211_key_conf *key, +- enum set_key_cmd cmd); ++ struct ieee80211_key_conf *key); + void mt7615_mac_reset_work(struct work_struct *work); + u32 mt7615_mac_get_sta_tid_sn(struct mt7615_dev *dev, int wcid, u8 tid); + +--- a/mt76x02_util.c ++++ b/mt76x02_util.c +@@ -454,20 +454,20 @@ int mt76x02_set_key(struct ieee80211_hw + msta = sta ? (struct mt76x02_sta *)sta->drv_priv : NULL; + wcid = msta ? &msta->wcid : &mvif->group_wcid; + +- if (cmd == SET_KEY) { +- key->hw_key_idx = wcid->idx; +- wcid->hw_key_idx = idx; +- if (key->flags & IEEE80211_KEY_FLAG_RX_MGMT) { +- key->flags |= IEEE80211_KEY_FLAG_SW_MGMT_TX; +- wcid->sw_iv = true; +- } +- } else { ++ if (cmd != SET_KEY) { + if (idx == wcid->hw_key_idx) { + wcid->hw_key_idx = -1; + wcid->sw_iv = false; + } + +- key = NULL; ++ return 0; ++ } ++ ++ key->hw_key_idx = wcid->idx; ++ wcid->hw_key_idx = idx; ++ if (key->flags & IEEE80211_KEY_FLAG_RX_MGMT) { ++ key->flags |= IEEE80211_KEY_FLAG_SW_MGMT_TX; ++ wcid->sw_iv = true; + } + mt76_wcid_key_setup(&dev->mt76, wcid, key); + +--- a/mt7915/main.c ++++ b/mt7915/main.c +@@ -399,16 +399,15 @@ static int mt7915_set_key(struct ieee802 + mt7915_mcu_add_bss_info(phy, vif, true); + } + +- if (cmd == SET_KEY) ++ if (cmd == SET_KEY) { + *wcid_keyidx = idx; +- else if (idx == *wcid_keyidx) +- *wcid_keyidx = -1; +- else ++ } else { ++ if (idx == *wcid_keyidx) ++ *wcid_keyidx = -1; + goto out; ++ } + +- mt76_wcid_key_setup(&dev->mt76, wcid, +- cmd == SET_KEY ? key : NULL); +- ++ mt76_wcid_key_setup(&dev->mt76, wcid, key); + err = mt76_connac_mcu_add_key(&dev->mt76, vif, &msta->bip, + key, MCU_EXT_CMD(STA_REC_UPDATE), + &msta->wcid, cmd); +--- a/mt7921/main.c ++++ b/mt7921/main.c +@@ -568,16 +568,15 @@ static int mt7921_set_key(struct ieee802 + + mt7921_mutex_acquire(dev); + +- if (cmd == SET_KEY) ++ if (cmd == SET_KEY) { + *wcid_keyidx = idx; +- else if (idx == *wcid_keyidx) +- *wcid_keyidx = -1; +- else ++ } else { ++ if (idx == *wcid_keyidx) ++ *wcid_keyidx = -1; + goto out; ++ } + +- mt76_wcid_key_setup(&dev->mt76, wcid, +- cmd == SET_KEY ? key : NULL); +- ++ mt76_wcid_key_setup(&dev->mt76, wcid, key); + err = mt76_connac_mcu_add_key(&dev->mt76, vif, &msta->bip, + key, MCU_UNI_CMD(STA_REC_UPDATE), + &msta->wcid, cmd); From 9773b2a49eef1b4c50578b52f59c5bcf0fcc2234 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Sun, 2 Apr 2023 15:56:15 +0800 Subject: [PATCH 10/67] Revert "base-files: do not generate ULA prefix" This reverts commit ee76f4feb20a5e66b47524b185fc10ca4a01bced. Signed-off-by: Tianling Shen --- package/base-files/files/bin/config_generate | 1 + 1 file changed, 1 insertion(+) diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate index 7be6355274..a647a1edd1 100755 --- a/package/base-files/files/bin/config_generate +++ b/package/base-files/files/bin/config_generate @@ -49,6 +49,7 @@ generate_static_network() { uci -q batch <<-EOF delete network.globals set network.globals='globals' + set network.globals.ula_prefix='auto' EOF } From 77536f5c7d4f7d5e60f1d8c30f48ba1ef9b15b54 Mon Sep 17 00:00:00 2001 From: Cezary Jackiewicz Date: Sun, 27 Feb 2022 14:12:39 +0100 Subject: [PATCH 11/67] comgt: support ZTE MF286R modem The modem is based on Marvell PXA1826 and uses ACM+RNDIS interface to establish connection with custom commands specific to ZTE modems. Two variants of modems were discovered, some identifying themselves as "ZTE", and others as plain "Marvell", the chipset manufacturer. The modem itself runs a fork of OpenWrt inside, which root shell can be accessed via ADB interface. Signed-off-by: Cezary Jackiewicz Signed-off-by: Lech Perczak (cherry picked from commit e02fb42c53bad5dd36726c6ef5a46bfe31d2e400) --- package/network/utils/comgt/Makefile | 2 +- package/network/utils/comgt/files/ncm.json | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/package/network/utils/comgt/Makefile b/package/network/utils/comgt/Makefile index db5ea57473..24dae2521e 100644 --- a/package/network/utils/comgt/Makefile +++ b/package/network/utils/comgt/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=comgt PKG_VERSION:=0.32 -PKG_RELEASE:=33 +PKG_RELEASE:=34 PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tgz PKG_SOURCE_URL:=@SF/comgt diff --git a/package/network/utils/comgt/files/ncm.json b/package/network/utils/comgt/files/ncm.json index bbdb30c5ee..b6ad717529 100644 --- a/package/network/utils/comgt/files/ncm.json +++ b/package/network/utils/comgt/files/ncm.json @@ -74,5 +74,27 @@ "connect": "AT+CGACT=1,${profile}", "finalize": "AT+CGDATA=\\\"M-MBIM\\\",${profile},1", "disconnect": "AT+CGACT=0,${profile}" + }, + "\"zte": { + "initialize": [ + "AT+CFUN=1" + ], + "configure": [ + "AT+ZGDCONT=${profile},\\\"${pdptype}\\\",\\\"${apn}\\\",\\\"\\\",0,0", + "AT+ZGPCOAUTH=${profile},\\\"${username}\\\",\\\"${password}\\\",0" + ], + "connect": "AT+ZGACT=1,${profile}", + "disconnect": "AT+ZGACT=0,${profile}" + }, + "\"marvell\"": { + "initialize": [ + "AT+CFUN=1" + ], + "configure": [ + "AT+ZGDCONT=${profile},\\\"${pdptype}\\\",\\\"${apn}\\\",\\\"\\\",0,0", + "AT+ZGPCOAUTH=${profile},\\\"${username}\\\",\\\"${password}\\\",0" + ], + "connect": "AT+ZGACT=1,${profile}", + "disconnect": "AT+ZGACT=0,${profile}" } } From 83b9155a3eecb200277a93f717fdfdc9c3de4a54 Mon Sep 17 00:00:00 2001 From: Jan-Niklas Burfeind Date: Wed, 30 Nov 2022 21:35:29 +0100 Subject: [PATCH 12/67] comgt-ncm: add support for quectel modem EC200T-EU context_type is an integer mapping of pdptype: 1: IPV4 2: IPV6 3: IPV4V6 Signed-off-by: Jan-Niklas Burfeind (cherry picked from commit 13f82ce264ed2d02c66cb2cae8f013c8f64a979f) --- package/network/utils/comgt/files/ncm.json | 16 ++++++++++++++++ package/network/utils/comgt/files/ncm.sh | 6 ++++++ 2 files changed, 22 insertions(+) diff --git a/package/network/utils/comgt/files/ncm.json b/package/network/utils/comgt/files/ncm.json index b6ad717529..7d9a38fe36 100644 --- a/package/network/utils/comgt/files/ncm.json +++ b/package/network/utils/comgt/files/ncm.json @@ -75,6 +75,22 @@ "finalize": "AT+CGDATA=\\\"M-MBIM\\\",${profile},1", "disconnect": "AT+CGACT=0,${profile}" }, + "quectel": { + "initialize": [ + "AT+CFUN=1" + ], + "configure": [ + "at+qicsgp=${profile},${context_type},\\\"${apn}\\\",\\\"${username}\\\",\\\"${password}\\\",0" + ], + "modes": { + "lte": "AT+QCFG=\\\"nwscanmode\\\",3", + "umts": "AT+QCFG=\\\"nwscanmode\\\",2", + "gsm": "AT+QCFG=\\\"nwscanmode\\\",1", + "auto": "AT+QCFG=\\\"nwscanmode\\\",0" + }, + "connect": "AT+qnetdevctl=1,${profile},1", + "disconnect": "AT+qnetdevctl=0,${profile},0" + }, "\"zte": { "initialize": [ "AT+CFUN=1" diff --git a/package/network/utils/comgt/files/ncm.sh b/package/network/utils/comgt/files/ncm.sh index 6545091c82..e21479d41f 100644 --- a/package/network/utils/comgt/files/ncm.sh +++ b/package/network/utils/comgt/files/ncm.sh @@ -30,6 +30,8 @@ proto_ncm_setup() { local device apn auth username password pincode delay mode pdptype profile $PROTO_DEFAULT_OPTIONS json_get_vars device apn auth username password pincode delay mode pdptype profile $PROTO_DEFAULT_OPTIONS + local context_type + [ "$metric" = "" ] && metric="0" [ -n "$profile" ] || profile=1 @@ -37,6 +39,10 @@ proto_ncm_setup() { pdptype=$(echo "$pdptype" | awk '{print toupper($0)}') [ "$pdptype" = "IP" -o "$pdptype" = "IPV6" -o "$pdptype" = "IPV4V6" ] || pdptype="IP" + [ "$pdptype" = "IPV4V6" ] && context_type=3 + [ -z "$context_type" -a "$pdptype" = "IPV6" ] && context_type=2 + [ -n "$context_type" ] || context_type=1 + [ -n "$ctl_device" ] && device=$ctl_device [ -n "$device" ] || { From 3efa783aa97acb1b89940b7e797826dd7896b699 Mon Sep 17 00:00:00 2001 From: Mike Wilson Date: Mon, 20 Jul 2020 22:25:33 +0200 Subject: [PATCH 13/67] ncm: add error check and retry mechanism for gcom call This patch solves the problem of receiving "error" responses when initially calling gcom. This avoids unnecessary NO_DEVICE failures. A retry loop retries the call after an "error" response within the specified delay. A successful response will continue with the connection immediately without waiting for max specified delay, bringing the interface up sooner. Signed-off-by: Mike Wilson (cherry picked from commit 8f27093ce784daad5a9b1c89f51d0a76a8bbb07b) --- package/network/utils/comgt/files/ncm.sh | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/package/network/utils/comgt/files/ncm.sh b/package/network/utils/comgt/files/ncm.sh index e21479d41f..ed50f08d76 100644 --- a/package/network/utils/comgt/files/ncm.sh +++ b/package/network/utils/comgt/files/ncm.sh @@ -77,10 +77,25 @@ proto_ncm_setup() { return 1 } - [ -n "$delay" ] && sleep "$delay" - - manufacturer=$(gcom -d "$device" -s /etc/gcom/getcardinfo.gcom | awk 'NF && $0 !~ /AT\+CGMI/ { sub(/\+CGMI: /,""); print tolower($1); exit; }') - [ $? -ne 0 -o -z "$manufacturer" ] && { + start=$(date +%s) + while true; do + manufacturer=$(gcom -d "$device" -s /etc/gcom/getcardinfo.gcom | awk 'NF && $0 !~ /AT\+CGMI/ { sub(/\+CGMI: /,""); print tolower($1); exit; }') + [ "$manufacturer" = "error" ] && { + manufacturer="" + } + [ -n "$manufacturer" ] && { + break + } + [ -z "$delay" ] && { + break + } + sleep 1 + elapsed=$(($(date +%s) - start)) + [ "$elapsed" -gt "$delay" ] && { + break + } + done + [ -z "$manufacturer" ] && { echo "Failed to get modem information" proto_notify_error "$interface" GETINFO_FAILED return 1 From efd2313a5b5962eacba3780dffb483ac2bc9050d Mon Sep 17 00:00:00 2001 From: Szabolcs Hubai Date: Fri, 24 Mar 2023 22:24:26 +0100 Subject: [PATCH 14/67] comgt: add quirk for Mikrotik modems based on Mikrotik R11e-LTE6 The MikroTik R11e-LTE6 modem goes into flight mode (CFUN=4) at startup and the radio is off (*RADIOPOWER: 0): AT+RESET OK OK *SIMDETEC:2,NOS *SIMDETEC:1,SIM *ICCID: 8936500119010596302 *EUICC: 1 +MSTK: 11, D025....74F3 *ADMINDATA: 0, 2, 0 +CPIN: READY *EUICC: 1 *ECCLIST: 5, 0, 112, 0, 000, 0, 08, 0, 118, 0, 911 +CREG: 0 $CREG: 0 +CESQ: 99,99,255,255,255,255 *CESQ: 99,99,255,255,255,255,0 +CGREG: 0 +CEREG: 0 +CESQ: 99,99,255,255,255,255 *CESQ: 99,99,255,255,255,255,0 *RADIOPOWER: 0 +MMSG: 0, 0 +MMSG: 0, 0 +MMSG: 1, 0 +MPBK: 1 While the chat script is able to establish the PPP connection, it's closed instantly by the modem: LCP terminated by peer. local2.info chat[7000]: send (ATD*99***1#^M) local2.info chat[7000]: expect (CONNECT) local2.info chat[7000]: ^M local2.info chat[7000]: ATD*99***1#^M^M local2.info chat[7000]: CONNECT local2.info chat[7000]: -- got it local2.info chat[7000]: send ( ^M) daemon.info pppd[6997]: Serial connection established. kern.info kernel: [ 453.659146] 3g-mikrotik: renamed from ppp0 daemon.info pppd[6997]: Renamed interface ppp0 to 3g-mikrotik daemon.info pppd[6997]: Using interface 3g-mikrotik daemon.notice pppd[6997]: Connect: 3g-mikrotik <--> /dev/ttyACM0 daemon.info pppd[6997]: LCP terminated by peer daemon.notice pppd[6997]: Connection terminated. daemon.notice pppd[6997]: Modem hangup daemon.info pppd[6997]: Exit. daemon.notice netifd: Interface 'mikrotik' is now down Sending "AT+CFUN=1" to modem deactivates the flight mode and solves the issue: daemon.notice netifd: Interface 'mikrotik' is setting up now daemon.notice netifd: mikrotik (7051): sending -> AT+CFUN=1 daemon.notice pppd[7137]: pppd 2.4.9 started by root, uid 0 local2.info chat[7140]: abort on (BUSY) local2.info chat[7140]: abort on (NO CARRIER) local2.info chat[7140]: abort on (ERROR) local2.info chat[7140]: report (CONNECT) local2.info chat[7140]: timeout set to 10 seconds local2.info chat[7140]: send (AT&F^M) local2.info chat[7140]: expect (OK) local2.info chat[7140]: ^M local2.info chat[7140]: +CESQ: 99,99,255,255,255,255^M local2.info chat[7140]: ^M local2.info chat[7140]: *CESQ: 99,99,255,255,255,255,0^M local2.info chat[7140]: AT&F^MAT&F^M^M local2.info chat[7140]: OK local2.info chat[7140]: -- got it ... local2.info chat[7140]: send (ATD*99***1#^M) local2.info chat[7140]: expect (CONNECT) local2.info chat[7140]: ^M local2.info chat[7140]: ATD*99***1#^M^M local2.info chat[7140]: CONNECT local2.info chat[7140]: -- got it local2.info chat[7140]: send ( ^M) daemon.info pppd[7137]: Serial connection established. kern.info kernel: [ 463.094254] 3g-mikrotik: renamed from ppp0 daemon.info pppd[7137]: Renamed interface ppp0 to 3g-mikrotik daemon.info pppd[7137]: Using interface 3g-mikrotik daemon.notice pppd[7137]: Connect: 3g-mikrotik <--> /dev/ttyACM0 daemon.warn pppd[7137]: Could not determine remote IP address: defaulting to 10.64.64.64 daemon.notice pppd[7137]: local IP address 100.112.63.62 daemon.notice pppd[7137]: remote IP address 10.64.64.64 daemon.notice pppd[7137]: primary DNS address 185.29.83.64 daemon.notice pppd[7137]: secondary DNS address 185.62.131.64 daemon.notice netifd: Network device '3g-mikrotik' link is up daemon.notice netifd: Interface 'mikrotik' is now up To send this AT command to the modem the "runcommand.gcom" script dependency is moved from comgt-ncm to comgt. As the comgt-ncm package depends on comgt already, this change is a NOOP from that point of view. But from the modem's point it is a low hanging fruit as the modem is usable with installing comgt and kmod-usb-ncm packages. Signed-off-by: Szabolcs Hubai (cherry picked from commit 91eca7b04ff1309c7408baa1f1631d7623ce50cf) --- package/network/utils/comgt/Makefile | 4 ++-- package/network/utils/comgt/files/3g.sh | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/package/network/utils/comgt/Makefile b/package/network/utils/comgt/Makefile index 24dae2521e..429c938602 100644 --- a/package/network/utils/comgt/Makefile +++ b/package/network/utils/comgt/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=comgt PKG_VERSION:=0.32 -PKG_RELEASE:=34 +PKG_RELEASE:=35 PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tgz PKG_SOURCE_URL:=@SF/comgt @@ -79,6 +79,7 @@ define Package/comgt/install $(INSTALL_DATA) ./files/getcarrier.gcom $(1)/etc/gcom/getcarrier.gcom $(INSTALL_DATA) ./files/getcnum.gcom $(1)/etc/gcom/getcnum.gcom $(INSTALL_DATA) ./files/getimsi.gcom $(1)/etc/gcom/getimsi.gcom + $(INSTALL_DATA) ./files/runcommand.gcom $(1)/etc/gcom/runcommand.gcom $(INSTALL_DIR) $(1)/etc/hotplug.d/tty $(INSTALL_CONF) ./files/3g.usb $(1)/etc/hotplug.d/tty/30-3g $(INSTALL_DIR) $(1)/lib/netifd/proto @@ -96,7 +97,6 @@ endef define Package/comgt-ncm/install $(INSTALL_DIR) $(1)/etc/gcom $(INSTALL_DATA) ./files/ncm.json $(1)/etc/gcom/ncm.json - $(INSTALL_DATA) ./files/runcommand.gcom $(1)/etc/gcom/runcommand.gcom $(INSTALL_DIR) $(1)/lib/netifd/proto $(INSTALL_BIN) ./files/ncm.sh $(1)/lib/netifd/proto/ncm.sh endef diff --git a/package/network/utils/comgt/files/3g.sh b/package/network/utils/comgt/files/3g.sh index 9220cbf5a0..42ba894e59 100644 --- a/package/network/utils/comgt/files/3g.sh +++ b/package/network/utils/comgt/files/3g.sh @@ -72,6 +72,8 @@ proto_3g_setup() { *) CODE="2,2";; esac export MODE="AT^SYSCFG=${CODE},3FFFFFFF,2,4" + elif echo "$cardinfo" | grep -q "MikroTik"; then + COMMAND="AT+CFUN=1" gcom -d "$device" -s /etc/gcom/runcommand.gcom || return 1 fi if [ -n "$pincode" ]; then From 9c081a938f6946f465208a7027396345587e483f Mon Sep 17 00:00:00 2001 From: Szabolcs Hubai Date: Sat, 25 Mar 2023 00:00:27 +0100 Subject: [PATCH 15/67] comgt: ncm: support Mikrotik R11e-LTE6 modem The Mikrotik R11e-LTE6 modem is similar to ZTE MF286R modem, added earlier: it has a Marvel chip, able to work in ACM+RNDIS mode, knows ZTE specific commands, runs OpenWrt Barrier Breaker fork. While the modem is able to offer IPv6 address, the RNDIS setup is unable to complete if there is an IPv6 adress. While it works in ACM+RNDIS mode, the user experience isn't as good as with "proto 3g": the modem happily serves a local IP (192.168.1.xxx) without internet access. Of course, if the modem has enough time (for example at the second dialup), it will serve a public IP. Modifing the DHCP Lease (to a short interval before connect and back to default while finalizing) is a workaround to get a public IP at the first try. A safe workaround for this is to excercise an offline script of the pingcheck program: simply restart (ifdown - ifup) the connection. Another pitfall is that the modem writes a few messages at startup, which confuses the manufacturer detection algorithm and got disabled. daemon.notice netifd: Interface 'mikrotik' is setting up now daemon.notice netifd: mikrotik (2366): Failed to parse message data daemon.notice netifd: mikrotik (2366): WARNING: Variable 'ok' does not exist or is not an array/object daemon.notice netifd: mikrotik (2366): Unsupported modem daemon.notice netifd: mikrotik (2426): Stopping network mikrotik daemon.notice netifd: mikrotik (2426): Failed to parse message data daemon.notice netifd: mikrotik (2426): WARNING: Variable '*simdetec:1,sim' does not exist or is not an array/object daemon.notice netifd: mikrotik (2426): Unsupported modem daemon.notice netifd: Interface 'mikrotik' is now down A workaround for this is to use the "delay" option in the interface configuration. I want to thank Forum members dchard (in topic Adding support for MikroTik hAP ac3 LTE6 kit (D53GR_5HacD2HnD)) [1] and mrhaav (in topic OpenWrt X86_64 + Mikrotik R11e-LTE6) [2] for sharing their experiments and works. Another information page was found at eko.one.pl [3]. [1]: https://forum.openwrt.org/t/137555 [2]: https://forum.openwrt.org/t/151743 [3]: https://eko.one.pl/?p=modem-r11elte Signed-off-by: Szabolcs Hubai (cherry picked from commit dbd6ebd6d84b35599a0446559576df41f487200e) --- package/network/utils/comgt/files/ncm.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/package/network/utils/comgt/files/ncm.json b/package/network/utils/comgt/files/ncm.json index 7d9a38fe36..df0810ddbc 100644 --- a/package/network/utils/comgt/files/ncm.json +++ b/package/network/utils/comgt/files/ncm.json @@ -112,5 +112,17 @@ ], "connect": "AT+ZGACT=1,${profile}", "disconnect": "AT+ZGACT=0,${profile}" + }, + "\"mikrotik\"": { + "configure": [ + "AT+CFUN=4", + "AT+ZGDCONT=${profile},\\\"${pdptype}\\\",\\\"${apn}\\\",0", + "AT+ZDHCPLEASE=10", + "AT+CFUN=1" + ], + "waitforconnect": "\\\"+ZCONSTAT: 1,${context_type}\\\",\\\"+ZGIPDNS: ${context_type}\\\"", + "connect": "AT+ZGACT=1,${context_type}", + "finalize": "AT+ZDHCPLEASE=0", + "disconnect": "AT+ZGACT=0,1" } } From e6ba105d6e60d37b38ef0d8401e2266a218446cb Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Tue, 4 Apr 2023 16:35:07 +0800 Subject: [PATCH 16/67] Revert "kernel: remove obsolete netfilter tcp window size check bypass patch" Keep this for shortcut-fe. This reverts commit cbe73ea33d027dbb4b2cf1eca947ae746119e7d2. Fixes: #923 Signed-off-by: Tianling Shen --- ...-netfilter_optional_tcp_window_check.patch | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 target/linux/generic/pending-5.4/613-netfilter_optional_tcp_window_check.patch diff --git a/target/linux/generic/pending-5.4/613-netfilter_optional_tcp_window_check.patch b/target/linux/generic/pending-5.4/613-netfilter_optional_tcp_window_check.patch new file mode 100644 index 0000000000..f6a3a82eca --- /dev/null +++ b/target/linux/generic/pending-5.4/613-netfilter_optional_tcp_window_check.patch @@ -0,0 +1,73 @@ +From: Felix Fietkau +Subject: netfilter: optional tcp window check + +Signed-off-by: Felix Fietkau +--- + net/netfilter/nf_conntrack_proto_tcp.c | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +--- a/net/netfilter/nf_conntrack_proto_tcp.c ++++ b/net/netfilter/nf_conntrack_proto_tcp.c +@@ -31,6 +31,9 @@ + #include + #include + ++/* Do not check the TCP window for incoming packets */ ++static int nf_ct_tcp_no_window_check __read_mostly = 1; ++ + /* "Be conservative in what you do, + be liberal in what you accept from others." + If it's non-zero, we mark only out of window RST segments as INVALID. */ +@@ -476,6 +479,9 @@ static bool tcp_in_window(const struct n + s32 receiver_offset; + bool res, in_recv_win; + ++ if (nf_ct_tcp_no_window_check) ++ return true; ++ + /* + * Get the required data from the packet. + */ +@@ -1139,7 +1145,7 @@ int nf_conntrack_tcp_packet(struct nf_co + IP_CT_TCP_FLAG_DATA_UNACKNOWLEDGED && + timeouts[new_state] > timeouts[TCP_CONNTRACK_UNACK]) + timeout = timeouts[TCP_CONNTRACK_UNACK]; +- else if (ct->proto.tcp.last_win == 0 && ++ else if (!nf_ct_tcp_no_window_check && ct->proto.tcp.last_win == 0 && + timeouts[new_state] > timeouts[TCP_CONNTRACK_RETRANS]) + timeout = timeouts[TCP_CONNTRACK_RETRANS]; + else +--- a/net/netfilter/nf_conntrack_standalone.c ++++ b/net/netfilter/nf_conntrack_standalone.c +@@ -25,6 +25,9 @@ + #include + #include + ++/* Do not check the TCP window for incoming packets */ ++static int nf_ct_tcp_no_window_check __read_mostly = 1; ++ + static bool enable_hooks __read_mostly; + MODULE_PARM_DESC(enable_hooks, "Always enable conntrack hooks"); + module_param(enable_hooks, bool, 0000); +@@ -649,6 +652,7 @@ enum nf_ct_sysctl_index { + NF_SYSCTL_CT_PROTO_TIMEOUT_GRE_STREAM, + #endif + ++ NF_SYSCTL_CT_PROTO_TCP_NO_WINDOW_CHECK, + __NF_SYSCTL_CT_LAST_SYSCTL, + }; + +@@ -969,6 +973,13 @@ static struct ctl_table nf_ct_sysctl_tab + .proc_handler = proc_dointvec_jiffies, + }, + #endif ++ [NF_SYSCTL_CT_PROTO_TCP_NO_WINDOW_CHECK] = { ++ .procname = "nf_conntrack_tcp_no_window_check", ++ .data = &nf_ct_tcp_no_window_check, ++ .maxlen = sizeof(unsigned int), ++ .mode = 0644, ++ .proc_handler = proc_dointvec, ++ }, + {} + }; + From 81b17ed8ccc2534ab163cc25aaa36fd37109c0f8 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Tue, 4 Apr 2023 01:29:14 +0800 Subject: [PATCH 17/67] uboot-rockchip: add ROC-RK3328-CC support Add support for the Firefly ROC-RK3328-CC. Signed-off-by: Tianling Shen (cherry picked from commit d9a1c7a99a4f2443c65be2eae00bae602b5f289a) --- package/boot/uboot-rockchip/Makefile | 15 +- .../src/of-platdata/roc-cc-rk3328/dt-decl.h | 24 +++ .../src/of-platdata/roc-cc-rk3328/dt-plat.c | 189 ++++++++++++++++++ .../roc-cc-rk3328/dt-structs-gen.h | 55 +++++ 4 files changed, 282 insertions(+), 1 deletion(-) create mode 100644 package/boot/uboot-rockchip/src/of-platdata/roc-cc-rk3328/dt-decl.h create mode 100644 package/boot/uboot-rockchip/src/of-platdata/roc-cc-rk3328/dt-plat.c create mode 100644 package/boot/uboot-rockchip/src/of-platdata/roc-cc-rk3328/dt-structs-gen.h diff --git a/package/boot/uboot-rockchip/Makefile b/package/boot/uboot-rockchip/Makefile index e1bd2772b0..7cb2762b6d 100644 --- a/package/boot/uboot-rockchip/Makefile +++ b/package/boot/uboot-rockchip/Makefile @@ -72,6 +72,18 @@ define U-Boot/orangepi-r1-plus-lts-rk3328 USE_RKBIN:=1 endef +define U-Boot/roc-cc-rk3328 + BUILD_SUBTARGET:=armv8 + NAME:=ROC-RK3328-CC + BUILD_DEVICES:= \ + firefly_roc-cc + DEPENDS:=+PACKAGE_u-boot-roc-cc-rk3328:arm-trusted-firmware-rk3328 + PKG_BUILD_DEPENDS:=arm-trusted-firmware-rockchip-vendor + ATF:=rk322xh_bl31_v1.46.elf + OF_PLATDATA:=$(1) + USE_RKBIN:=1 +endef + # RK3399 boards @@ -113,7 +125,8 @@ UBOOT_TARGETS := \ nanopi-r2c-rk3328 \ nanopi-r2s-rk3328 \ orangepi-r1-plus-rk3328 \ - orangepi-r1-plus-lts-rk3328 + orangepi-r1-plus-lts-rk3328 \ + roc-cc-rk3328 UBOOT_CONFIGURE_VARS += USE_PRIVATE_LIBGCC=yes diff --git a/package/boot/uboot-rockchip/src/of-platdata/roc-cc-rk3328/dt-decl.h b/package/boot/uboot-rockchip/src/of-platdata/roc-cc-rk3328/dt-decl.h new file mode 100644 index 0000000000..72675609cd --- /dev/null +++ b/package/boot/uboot-rockchip/src/of-platdata/roc-cc-rk3328/dt-decl.h @@ -0,0 +1,24 @@ +/* + * DO NOT MODIFY + * + * Declares externs for all device/uclass instances. + * This was generated by dtoc from a .dtb (device tree binary) file. + */ + +#include +#include + +/* driver declarations - these allow DM_DRIVER_GET() to be used */ +extern U_BOOT_DRIVER(rockchip_rk3328_cru); +extern U_BOOT_DRIVER(rockchip_rk3328_dmc); +extern U_BOOT_DRIVER(rockchip_rk3288_dw_mshc); +extern U_BOOT_DRIVER(rockchip_rk3288_dw_mshc); +extern U_BOOT_DRIVER(ns16550_serial); +extern U_BOOT_DRIVER(rockchip_rk3328_grf); + +/* uclass driver declarations - needed for DM_UCLASS_DRIVER_REF() */ +extern UCLASS_DRIVER(clk); +extern UCLASS_DRIVER(mmc); +extern UCLASS_DRIVER(ram); +extern UCLASS_DRIVER(serial); +extern UCLASS_DRIVER(syscon); diff --git a/package/boot/uboot-rockchip/src/of-platdata/roc-cc-rk3328/dt-plat.c b/package/boot/uboot-rockchip/src/of-platdata/roc-cc-rk3328/dt-plat.c new file mode 100644 index 0000000000..aa03298e58 --- /dev/null +++ b/package/boot/uboot-rockchip/src/of-platdata/roc-cc-rk3328/dt-plat.c @@ -0,0 +1,189 @@ +/* + * DO NOT MODIFY + * + * Declares the U_BOOT_DRIVER() records and platform data. + * This was generated by dtoc from a .dtb (device tree binary) file. + */ + +/* Allow use of U_BOOT_DRVINFO() in this file */ +#define DT_PLAT_C + +#include +#include +#include + +/* + * driver_info declarations, ordered by 'struct driver_info' linker_list idx: + * + * idx driver_info driver + * --- -------------------- -------------------- + * 0: clock_controller_at_ff440000 rockchip_rk3328_cru + * 1: dmc rockchip_rk3328_dmc + * 2: mmc_at_ff500000 rockchip_rk3288_dw_mshc + * 3: mmc_at_ff520000 rockchip_rk3288_dw_mshc + * 4: serial_at_ff130000 ns16550_serial + * 5: syscon_at_ff100000 rockchip_rk3328_grf + * --- -------------------- -------------------- + */ + +/* + * Node /clock-controller@ff440000 index 0 + * driver rockchip_rk3328_cru parent None + */ +static struct dtd_rockchip_rk3328_cru dtv_clock_controller_at_ff440000 = { + .reg = {0xff440000, 0x1000}, + .rockchip_grf = 0x3a, +}; +U_BOOT_DRVINFO(clock_controller_at_ff440000) = { + .name = "rockchip_rk3328_cru", + .plat = &dtv_clock_controller_at_ff440000, + .plat_size = sizeof(dtv_clock_controller_at_ff440000), + .parent_idx = -1, +}; + +/* + * Node /dmc index 1 + * driver rockchip_rk3328_dmc parent None + */ +static struct dtd_rockchip_rk3328_dmc dtv_dmc = { + .reg = {0xff400000, 0x1000, 0xff780000, 0x3000, 0xff100000, 0x1000, 0xff440000, 0x1000, + 0xff720000, 0x1000, 0xff798000, 0x1000}, + .rockchip_sdram_params = {0x1, 0xa, 0x2, 0x1, 0x0, 0x0, 0x11, 0x0, + 0x11, 0x0, 0x0, 0x94291288, 0x0, 0x27, 0x462, 0x15, + 0x242, 0xff, 0x14d, 0x0, 0x1, 0x0, 0x0, 0x0, + 0x43049010, 0x64, 0x28003b, 0xd0, 0x20053, 0xd4, 0x220000, 0xd8, + 0x100, 0xdc, 0x40000, 0xe0, 0x0, 0xe4, 0x110000, 0xe8, + 0x420, 0xec, 0x400, 0xf4, 0xf011f, 0x100, 0x9060b06, 0x104, + 0x20209, 0x108, 0x505040a, 0x10c, 0x40400c, 0x110, 0x5030206, 0x114, + 0x3030202, 0x120, 0x3030b03, 0x124, 0x20208, 0x180, 0x1000040, 0x184, + 0x0, 0x190, 0x7030003, 0x198, 0x5001100, 0x1a0, 0xc0400003, 0x240, + 0x6000604, 0x244, 0x201, 0x250, 0xf00, 0x490, 0x1, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0x4, 0xc, 0x28, 0xa, 0x2c, + 0x0, 0x30, 0x9, 0xffffffff, 0xffffffff, 0x77, 0x88, 0x79, + 0x79, 0x87, 0x97, 0x87, 0x78, 0x77, 0x78, 0x87, + 0x88, 0x87, 0x87, 0x77, 0x78, 0x78, 0x78, 0x78, + 0x78, 0x78, 0x78, 0x78, 0x78, 0x69, 0x9, 0x77, + 0x78, 0x77, 0x78, 0x77, 0x78, 0x77, 0x78, 0x77, + 0x79, 0x9, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, + 0x78, 0x78, 0x78, 0x69, 0x9, 0x77, 0x78, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x79, 0x9, + 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, + 0x78, 0x69, 0x9, 0x77, 0x78, 0x77, 0x78, 0x77, + 0x78, 0x77, 0x78, 0x77, 0x79, 0x9, 0x78, 0x78, + 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x69, + 0x9, 0x77, 0x78, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x79, 0x9}, +}; +U_BOOT_DRVINFO(dmc) = { + .name = "rockchip_rk3328_dmc", + .plat = &dtv_dmc, + .plat_size = sizeof(dtv_dmc), + .parent_idx = -1, +}; + +/* + * Node /mmc@ff500000 index 2 + * driver rockchip_rk3288_dw_mshc parent None + */ +static struct dtd_rockchip_rk3288_dw_mshc dtv_mmc_at_ff500000 = { + .bus_width = 0x4, + .cap_mmc_highspeed = true, + .cap_sd_highspeed = true, + .clocks = { + {0, {317}}, + {0, {33}}, + {0, {74}}, + {0, {78}},}, + .disable_wp = true, + .fifo_depth = 0x100, + .interrupts = {0x0, 0xc, 0x4}, + .max_frequency = 0x8f0d180, + .pinctrl_0 = {0x47, 0x48, 0x49, 0x4a}, + .pinctrl_names = "default", + .reg = {0xff500000, 0x4000}, + .sd_uhs_sdr104 = true, + .sd_uhs_sdr12 = true, + .sd_uhs_sdr25 = true, + .sd_uhs_sdr50 = true, + .u_boot_spl_fifo_mode = true, + .vmmc_supply = 0x4b, + .vqmmc_supply = 0x1e, +}; +U_BOOT_DRVINFO(mmc_at_ff500000) = { + .name = "rockchip_rk3288_dw_mshc", + .plat = &dtv_mmc_at_ff500000, + .plat_size = sizeof(dtv_mmc_at_ff500000), + .parent_idx = -1, +}; + +/* + * Node /mmc@ff520000 index 3 + * driver rockchip_rk3288_dw_mshc parent None + */ +static struct dtd_rockchip_rk3288_dw_mshc dtv_mmc_at_ff520000 = { + .bus_width = 0x8, + .cap_mmc_highspeed = true, + .clocks = { + {0, {319}}, + {0, {35}}, + {0, {76}}, + {0, {80}},}, + .fifo_depth = 0x100, + .interrupts = {0x0, 0xe, 0x4}, + .max_frequency = 0x8f0d180, + .mmc_ddr_1_8v = true, + .mmc_hs200_1_8v = true, + .non_removable = true, + .pinctrl_0 = {0x4c, 0x4d, 0x4e, 0x0}, + .pinctrl_names = "default", + .reg = {0xff520000, 0x4000}, + .u_boot_spl_fifo_mode = true, + .vmmc_supply = 0x1c, + .vqmmc_supply = 0x1d, +}; +U_BOOT_DRVINFO(mmc_at_ff520000) = { + .name = "rockchip_rk3288_dw_mshc", + .plat = &dtv_mmc_at_ff520000, + .plat_size = sizeof(dtv_mmc_at_ff520000), + .parent_idx = -1, +}; + +/* + * Node /serial@ff130000 index 4 + * driver ns16550_serial parent None + */ +static struct dtd_ns16550_serial dtv_serial_at_ff130000 = { + .clock_frequency = 0x16e3600, + .clocks = { + {0, {40}}, + {0, {212}},}, + .dma_names = {"tx", "rx"}, + .dmas = {0x10, 0x6, 0x10, 0x7}, + .interrupts = {0x0, 0x39, 0x4}, + .pinctrl_0 = 0x26, + .pinctrl_names = "default", + .reg = {0xff130000, 0x100}, + .reg_io_width = 0x4, + .reg_shift = 0x2, +}; +U_BOOT_DRVINFO(serial_at_ff130000) = { + .name = "ns16550_serial", + .plat = &dtv_serial_at_ff130000, + .plat_size = sizeof(dtv_serial_at_ff130000), + .parent_idx = -1, +}; + +/* + * Node /syscon@ff100000 index 5 + * driver rockchip_rk3328_grf parent None + */ +static struct dtd_rockchip_rk3328_grf dtv_syscon_at_ff100000 = { + .reg = {0xff100000, 0x1000}, +}; +U_BOOT_DRVINFO(syscon_at_ff100000) = { + .name = "rockchip_rk3328_grf", + .plat = &dtv_syscon_at_ff100000, + .plat_size = sizeof(dtv_syscon_at_ff100000), + .parent_idx = -1, +}; + diff --git a/package/boot/uboot-rockchip/src/of-platdata/roc-cc-rk3328/dt-structs-gen.h b/package/boot/uboot-rockchip/src/of-platdata/roc-cc-rk3328/dt-structs-gen.h new file mode 100644 index 0000000000..5b729fc57f --- /dev/null +++ b/package/boot/uboot-rockchip/src/of-platdata/roc-cc-rk3328/dt-structs-gen.h @@ -0,0 +1,55 @@ +/* + * DO NOT MODIFY + * + * Defines the structs used to hold devicetree data. + * This was generated by dtoc from a .dtb (device tree binary) file. + */ + +#include +#include +struct dtd_ns16550_serial { + fdt32_t clock_frequency; + struct phandle_1_arg clocks[2]; + const char * dma_names[2]; + fdt32_t dmas[4]; + fdt32_t interrupts[3]; + fdt32_t pinctrl_0; + const char * pinctrl_names; + fdt64_t reg[2]; + fdt32_t reg_io_width; + fdt32_t reg_shift; +}; +struct dtd_rockchip_rk3288_dw_mshc { + fdt32_t bus_width; + bool cap_mmc_highspeed; + bool cap_sd_highspeed; + struct phandle_1_arg clocks[4]; + bool disable_wp; + fdt32_t fifo_depth; + fdt32_t interrupts[3]; + fdt32_t max_frequency; + bool mmc_ddr_1_8v; + bool mmc_hs200_1_8v; + bool non_removable; + fdt32_t pinctrl_0[4]; + const char * pinctrl_names; + fdt64_t reg[2]; + bool sd_uhs_sdr104; + bool sd_uhs_sdr12; + bool sd_uhs_sdr25; + bool sd_uhs_sdr50; + bool u_boot_spl_fifo_mode; + fdt32_t vmmc_supply; + fdt32_t vqmmc_supply; +}; +struct dtd_rockchip_rk3328_cru { + fdt64_t reg[2]; + fdt32_t rockchip_grf; +}; +struct dtd_rockchip_rk3328_dmc { + fdt64_t reg[12]; + fdt32_t rockchip_sdram_params[196]; +}; +struct dtd_rockchip_rk3328_grf { + fdt64_t reg[2]; +}; From bb19c0e1d8410920347836d90c24a4a545266a27 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Tue, 4 Apr 2023 01:51:27 +0800 Subject: [PATCH 18/67] rockchip: add Firefly ROC-RK3328-CC support Hardware -------- RockChip RK3328 ARM64 (4 cores) 4GB DDR4 RAM 1x 1000 Base-T 2 LEDs (POWER / USER) HDMI 2.0 3.5mm TRRS AV jack Micro-SD slot eMMC slot 1x USB 3.0 Port 2x USB 2.0 Port Signed-off-by: Tianling Shen (cherry picked from commit f05de856379977e0f48f9fcd27ec199c1bf5aa74) --- target/linux/rockchip/armv8/config-5.4 | 6 +- .../rockchip/rk3328-dram-renegade-timing.dtsi | 311 ++++++++++++++++++ target/linux/rockchip/image/armv8.mk | 9 + ...kchip-fix-sdmmc-detection-on-boot-on.patch | 28 ++ ...Enable-USB3-for-rk3328-ROC-RK3328-CC.patch | 36 ++ ...-rockchip-use-system-LED-for-OpenWrt.patch | 29 ++ .../107-nanopi-r4s-sd-signalling.patch | 10 + ...anopi-r2s-add-rk3328-dmc-relate-node.patch | 110 +++++++ 8 files changed, 537 insertions(+), 2 deletions(-) create mode 100644 target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3328-dram-renegade-timing.dtsi create mode 100644 target/linux/rockchip/patches-5.4/011-v5.5-arm64-dts-rockchip-fix-sdmmc-detection-on-boot-on.patch create mode 100644 target/linux/rockchip/patches-5.4/012-v5.14-arm64-dts-rockchip-Enable-USB3-for-rk3328-ROC-RK3328-CC.patch diff --git a/target/linux/rockchip/armv8/config-5.4 b/target/linux/rockchip/armv8/config-5.4 index 9053164809..41d4025fbe 100644 --- a/target/linux/rockchip/armv8/config-5.4 +++ b/target/linux/rockchip/armv8/config-5.4 @@ -175,6 +175,7 @@ CONFIG_GPIOLIB=y CONFIG_GPIO_DWAPB=y CONFIG_GPIO_GENERIC=y CONFIG_GPIO_GENERIC_PLATFORM=y +CONFIG_GPIO_SYSCON=y # CONFIG_HARDENED_USERCOPY is not set CONFIG_HAS_IOPORT_MAP=y CONFIG_HAVE_ARCH_MMAP_RND_COMPAT_BITS=y @@ -214,7 +215,7 @@ CONFIG_INPUT_KEYBOARD=y CONFIG_INPUT_LEDS=y CONFIG_INPUT_MATRIXKMAP=y # CONFIG_INPUT_MISC is not set -# CONFIG_INPUT_RK805_PWRKEY is not set +CONFIG_INPUT_RK805_PWRKEY=y CONFIG_IOMMU_API=y # CONFIG_IOMMU_DEBUGFS is not set # CONFIG_IOMMU_DEFAULT_PASSTHROUGH is not set @@ -242,6 +243,7 @@ CONFIG_LEDS_GPIO=y CONFIG_LEDS_PWM=y CONFIG_LEDS_SYSCON=y CONFIG_LEDS_TRIGGER_CPU=y +CONFIG_LEDS_TRIGGER_DISK=y CONFIG_LEDS_TRIGGER_PANIC=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=16 @@ -338,7 +340,7 @@ CONFIG_PHY_ROCKCHIP_PCIE=y CONFIG_PHY_ROCKCHIP_TYPEC=y CONFIG_PHY_ROCKCHIP_USB=y CONFIG_PINCTRL=y -# CONFIG_PINCTRL_RK805 is not set +CONFIG_PINCTRL_RK805=y CONFIG_PINCTRL_ROCKCHIP=y # CONFIG_PINCTRL_SINGLE is not set CONFIG_PL330_DMA=y diff --git a/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3328-dram-renegade-timing.dtsi b/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3328-dram-renegade-timing.dtsi new file mode 100644 index 0000000000..3034281530 --- /dev/null +++ b/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3328-dram-renegade-timing.dtsi @@ -0,0 +1,311 @@ +/* + * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ +#include +#include + +/ { + ddr_timing: ddr_timing { + compatible = "rockchip,ddr-timing"; + ddr3_speed_bin = ; + ddr4_speed_bin = ; + pd_idle = <0>; + sr_idle = <0>; + sr_mc_gate_idle = <0>; + srpd_lite_idle = <0>; + standby_idle = <0>; + + auto_pd_dis_freq = <1066>; + auto_sr_dis_freq = <800>; + ddr3_dll_dis_freq = <300>; + ddr4_dll_dis_freq = <625>; + phy_dll_dis_freq = <400>; + + ddr3_odt_dis_freq = <100>; + phy_ddr3_odt_dis_freq = <100>; + ddr3_drv = ; + ddr3_odt = ; + phy_ddr3_ca_drv = ; + phy_ddr3_ck_drv = ; + phy_ddr3_dq_drv = ; + phy_ddr3_odt = ; + + lpddr3_odt_dis_freq = <666>; + phy_lpddr3_odt_dis_freq = <666>; + lpddr3_drv = ; + lpddr3_odt = ; + phy_lpddr3_ca_drv = ; + phy_lpddr3_ck_drv = ; + phy_lpddr3_dq_drv = ; + phy_lpddr3_odt = ; + + lpddr4_odt_dis_freq = <800>; + phy_lpddr4_odt_dis_freq = <800>; + lpddr4_drv = ; + lpddr4_dq_odt = ; + lpddr4_ca_odt = ; + phy_lpddr4_ca_drv = ; + phy_lpddr4_ck_cs_drv = ; + phy_lpddr4_dq_drv = ; + phy_lpddr4_odt = ; + + ddr4_odt_dis_freq = <666>; + phy_ddr4_odt_dis_freq = <666>; + ddr4_drv = ; + ddr4_odt = ; + phy_ddr4_ca_drv = ; + phy_ddr4_ck_drv = ; + phy_ddr4_dq_drv = ; + phy_ddr4_odt = ; + + /* CA de-skew, one step is 47.8ps, range 0-15 */ + ddr3a1_ddr4a9_de-skew = <0>; + ddr3a0_ddr4a10_de-skew = <0>; + ddr3a3_ddr4a6_de-skew = <1>; + ddr3a2_ddr4a4_de-skew = <1>; + ddr3a5_ddr4a8_de-skew = <0>; + ddr3a4_ddr4a5_de-skew = <2>; + ddr3a7_ddr4a11_de-skew = <0>; + ddr3a6_ddr4a7_de-skew = <2>; + ddr3a9_ddr4a0_de-skew = <1>; + ddr3a8_ddr4a13_de-skew = <0>; + ddr3a11_ddr4a3_de-skew = <2>; + ddr3a10_ddr4cs0_de-skew = <0>; + ddr3a13_ddr4a2_de-skew = <1>; + ddr3a12_ddr4ba1_de-skew = <0>; + ddr3a15_ddr4odt0_de-skew = <0>; + ddr3a14_ddr4a1_de-skew = <1>; + ddr3ba1_ddr4a15_de-skew = <0>; + ddr3ba0_ddr4bg0_de-skew = <0>; + ddr3ras_ddr4cke_de-skew = <0>; + ddr3ba2_ddr4ba0_de-skew = <1>; + ddr3we_ddr4bg1_de-skew = <1>; + ddr3cas_ddr4a12_de-skew = <0>; + ddr3ckn_ddr4ckn_de-skew = <5>; + ddr3ckp_ddr4ckp_de-skew = <5>; + ddr3cke_ddr4a16_de-skew = <1>; + ddr3odt0_ddr4a14_de-skew = <0>; + ddr3cs0_ddr4act_de-skew = <1>; + ddr3reset_ddr4reset_de-skew = <0>; + ddr3cs1_ddr4cs1_de-skew = <0>; + ddr3odt1_ddr4odt1_de-skew = <0>; + + /* DATA de-skew + * RX one step is 25.1ps, range 0-15 + * TX one step is 47.8ps, range 0-15 + */ + cs0_dm0_rx_de-skew = <7>; + cs0_dm0_tx_de-skew = <8>; + cs0_dq0_rx_de-skew = <7>; + cs0_dq0_tx_de-skew = <8>; + cs0_dq1_rx_de-skew = <7>; + cs0_dq1_tx_de-skew = <8>; + cs0_dq2_rx_de-skew = <7>; + cs0_dq2_tx_de-skew = <8>; + cs0_dq3_rx_de-skew = <7>; + cs0_dq3_tx_de-skew = <8>; + cs0_dq4_rx_de-skew = <7>; + cs0_dq4_tx_de-skew = <8>; + cs0_dq5_rx_de-skew = <7>; + cs0_dq5_tx_de-skew = <8>; + cs0_dq6_rx_de-skew = <7>; + cs0_dq6_tx_de-skew = <8>; + cs0_dq7_rx_de-skew = <7>; + cs0_dq7_tx_de-skew = <8>; + cs0_dqs0_rx_de-skew = <6>; + cs0_dqs0p_tx_de-skew = <9>; + cs0_dqs0n_tx_de-skew = <9>; + + cs0_dm1_rx_de-skew = <7>; + cs0_dm1_tx_de-skew = <7>; + cs0_dq8_rx_de-skew = <7>; + cs0_dq8_tx_de-skew = <8>; + cs0_dq9_rx_de-skew = <7>; + cs0_dq9_tx_de-skew = <7>; + cs0_dq10_rx_de-skew = <7>; + cs0_dq10_tx_de-skew = <8>; + cs0_dq11_rx_de-skew = <7>; + cs0_dq11_tx_de-skew = <7>; + cs0_dq12_rx_de-skew = <7>; + cs0_dq12_tx_de-skew = <8>; + cs0_dq13_rx_de-skew = <7>; + cs0_dq13_tx_de-skew = <7>; + cs0_dq14_rx_de-skew = <7>; + cs0_dq14_tx_de-skew = <8>; + cs0_dq15_rx_de-skew = <7>; + cs0_dq15_tx_de-skew = <7>; + cs0_dqs1_rx_de-skew = <7>; + cs0_dqs1p_tx_de-skew = <9>; + cs0_dqs1n_tx_de-skew = <9>; + + cs0_dm2_rx_de-skew = <7>; + cs0_dm2_tx_de-skew = <8>; + cs0_dq16_rx_de-skew = <7>; + cs0_dq16_tx_de-skew = <8>; + cs0_dq17_rx_de-skew = <7>; + cs0_dq17_tx_de-skew = <8>; + cs0_dq18_rx_de-skew = <7>; + cs0_dq18_tx_de-skew = <8>; + cs0_dq19_rx_de-skew = <7>; + cs0_dq19_tx_de-skew = <8>; + cs0_dq20_rx_de-skew = <7>; + cs0_dq20_tx_de-skew = <8>; + cs0_dq21_rx_de-skew = <7>; + cs0_dq21_tx_de-skew = <8>; + cs0_dq22_rx_de-skew = <7>; + cs0_dq22_tx_de-skew = <8>; + cs0_dq23_rx_de-skew = <7>; + cs0_dq23_tx_de-skew = <8>; + cs0_dqs2_rx_de-skew = <6>; + cs0_dqs2p_tx_de-skew = <9>; + cs0_dqs2n_tx_de-skew = <9>; + + cs0_dm3_rx_de-skew = <7>; + cs0_dm3_tx_de-skew = <7>; + cs0_dq24_rx_de-skew = <7>; + cs0_dq24_tx_de-skew = <8>; + cs0_dq25_rx_de-skew = <7>; + cs0_dq25_tx_de-skew = <7>; + cs0_dq26_rx_de-skew = <7>; + cs0_dq26_tx_de-skew = <7>; + cs0_dq27_rx_de-skew = <7>; + cs0_dq27_tx_de-skew = <7>; + cs0_dq28_rx_de-skew = <7>; + cs0_dq28_tx_de-skew = <7>; + cs0_dq29_rx_de-skew = <7>; + cs0_dq29_tx_de-skew = <7>; + cs0_dq30_rx_de-skew = <7>; + cs0_dq30_tx_de-skew = <7>; + cs0_dq31_rx_de-skew = <7>; + cs0_dq31_tx_de-skew = <7>; + cs0_dqs3_rx_de-skew = <7>; + cs0_dqs3p_tx_de-skew = <9>; + cs0_dqs3n_tx_de-skew = <9>; + + cs1_dm0_rx_de-skew = <7>; + cs1_dm0_tx_de-skew = <8>; + cs1_dq0_rx_de-skew = <7>; + cs1_dq0_tx_de-skew = <8>; + cs1_dq1_rx_de-skew = <7>; + cs1_dq1_tx_de-skew = <8>; + cs1_dq2_rx_de-skew = <7>; + cs1_dq2_tx_de-skew = <8>; + cs1_dq3_rx_de-skew = <7>; + cs1_dq3_tx_de-skew = <8>; + cs1_dq4_rx_de-skew = <7>; + cs1_dq4_tx_de-skew = <8>; + cs1_dq5_rx_de-skew = <7>; + cs1_dq5_tx_de-skew = <8>; + cs1_dq6_rx_de-skew = <7>; + cs1_dq6_tx_de-skew = <8>; + cs1_dq7_rx_de-skew = <7>; + cs1_dq7_tx_de-skew = <8>; + cs1_dqs0_rx_de-skew = <6>; + cs1_dqs0p_tx_de-skew = <9>; + cs1_dqs0n_tx_de-skew = <9>; + + cs1_dm1_rx_de-skew = <7>; + cs1_dm1_tx_de-skew = <7>; + cs1_dq8_rx_de-skew = <7>; + cs1_dq8_tx_de-skew = <8>; + cs1_dq9_rx_de-skew = <7>; + cs1_dq9_tx_de-skew = <7>; + cs1_dq10_rx_de-skew = <7>; + cs1_dq10_tx_de-skew = <8>; + cs1_dq11_rx_de-skew = <7>; + cs1_dq11_tx_de-skew = <7>; + cs1_dq12_rx_de-skew = <7>; + cs1_dq12_tx_de-skew = <8>; + cs1_dq13_rx_de-skew = <7>; + cs1_dq13_tx_de-skew = <7>; + cs1_dq14_rx_de-skew = <7>; + cs1_dq14_tx_de-skew = <8>; + cs1_dq15_rx_de-skew = <7>; + cs1_dq15_tx_de-skew = <7>; + cs1_dqs1_rx_de-skew = <7>; + cs1_dqs1p_tx_de-skew = <9>; + cs1_dqs1n_tx_de-skew = <9>; + + cs1_dm2_rx_de-skew = <7>; + cs1_dm2_tx_de-skew = <8>; + cs1_dq16_rx_de-skew = <7>; + cs1_dq16_tx_de-skew = <8>; + cs1_dq17_rx_de-skew = <7>; + cs1_dq17_tx_de-skew = <8>; + cs1_dq18_rx_de-skew = <7>; + cs1_dq18_tx_de-skew = <8>; + cs1_dq19_rx_de-skew = <7>; + cs1_dq19_tx_de-skew = <8>; + cs1_dq20_rx_de-skew = <7>; + cs1_dq20_tx_de-skew = <8>; + cs1_dq21_rx_de-skew = <7>; + cs1_dq21_tx_de-skew = <8>; + cs1_dq22_rx_de-skew = <7>; + cs1_dq22_tx_de-skew = <8>; + cs1_dq23_rx_de-skew = <7>; + cs1_dq23_tx_de-skew = <8>; + cs1_dqs2_rx_de-skew = <6>; + cs1_dqs2p_tx_de-skew = <9>; + cs1_dqs2n_tx_de-skew = <9>; + + cs1_dm3_rx_de-skew = <7>; + cs1_dm3_tx_de-skew = <7>; + cs1_dq24_rx_de-skew = <7>; + cs1_dq24_tx_de-skew = <8>; + cs1_dq25_rx_de-skew = <7>; + cs1_dq25_tx_de-skew = <7>; + cs1_dq26_rx_de-skew = <7>; + cs1_dq26_tx_de-skew = <7>; + cs1_dq27_rx_de-skew = <7>; + cs1_dq27_tx_de-skew = <7>; + cs1_dq28_rx_de-skew = <7>; + cs1_dq28_tx_de-skew = <7>; + cs1_dq29_rx_de-skew = <7>; + cs1_dq29_tx_de-skew = <7>; + cs1_dq30_rx_de-skew = <7>; + cs1_dq30_tx_de-skew = <7>; + cs1_dq31_rx_de-skew = <7>; + cs1_dq31_tx_de-skew = <7>; + cs1_dqs3_rx_de-skew = <7>; + cs1_dqs3p_tx_de-skew = <9>; + cs1_dqs3n_tx_de-skew = <9>; + }; +}; diff --git a/target/linux/rockchip/image/armv8.mk b/target/linux/rockchip/image/armv8.mk index 133e41479a..29be80b4d6 100644 --- a/target/linux/rockchip/image/armv8.mk +++ b/target/linux/rockchip/image/armv8.mk @@ -2,6 +2,15 @@ # # Copyright (C) 2020 Tobias Maedel +define Device/firefly_roc-cc + DEVICE_VENDOR := Firefly + DEVICE_MODEL := ROC-RK3328-CC + SOC := rk3328 + UBOOT_DEVICE_NAME := roc-cc-rk3328 + IMAGE/sysupgrade.img.gz := boot-common | boot-script nanopi-r2s | pine64-bin | gzip | append-metadata +endef +TARGET_DEVICES += firefly_roc-cc + define Device/friendlyarm_nanopi-r2c DEVICE_VENDOR := FriendlyARM DEVICE_MODEL := NanoPi R2C diff --git a/target/linux/rockchip/patches-5.4/011-v5.5-arm64-dts-rockchip-fix-sdmmc-detection-on-boot-on.patch b/target/linux/rockchip/patches-5.4/011-v5.5-arm64-dts-rockchip-fix-sdmmc-detection-on-boot-on.patch new file mode 100644 index 0000000000..f1c9f640e1 --- /dev/null +++ b/target/linux/rockchip/patches-5.4/011-v5.5-arm64-dts-rockchip-fix-sdmmc-detection-on-boot-on.patch @@ -0,0 +1,28 @@ +From 75aa567803b15e679432655badf95cd30b66b930 Mon Sep 17 00:00:00 2001 +From: Peter Geis +Date: Wed, 16 Oct 2019 18:59:46 +0000 +Subject: [PATCH] arm64: dts: rockchip: fix sdmmc detection on boot on + rk3328-roc-cc + +With working GPIO, during init the GPIO state s reset. +This causes the sdmmc regulator to shut down, preventing detection. +Removing and replacing the card will allow it to be detected, but that should not be necessary. +Fix this by setting the regulator on at boot. + +Signed-off-by: Peter Geis +Link: https://lore.kernel.org/r/20191016185945.1962-1-pgwipeout@gmail.com +Signed-off-by: Heiko Stuebner +--- + arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts +@@ -35,6 +35,7 @@ + gpio = <&gpio0 RK_PD6 GPIO_ACTIVE_LOW>; + pinctrl-names = "default"; + pinctrl-0 = <&sdmmc0m1_gpio>; ++ regulator-boot-on; + regulator-name = "vcc_sd"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; diff --git a/target/linux/rockchip/patches-5.4/012-v5.14-arm64-dts-rockchip-Enable-USB3-for-rk3328-ROC-RK3328-CC.patch b/target/linux/rockchip/patches-5.4/012-v5.14-arm64-dts-rockchip-Enable-USB3-for-rk3328-ROC-RK3328-CC.patch new file mode 100644 index 0000000000..65c9cd48ba --- /dev/null +++ b/target/linux/rockchip/patches-5.4/012-v5.14-arm64-dts-rockchip-Enable-USB3-for-rk3328-ROC-RK3328-CC.patch @@ -0,0 +1,36 @@ +From 75f95927334dea863f16f4ecd29cc709edc3c6ad Mon Sep 17 00:00:00 2001 +From: Chen-Yu Tsai +Date: Tue, 4 May 2021 16:36:14 +0800 +Subject: [PATCH] arm64: dts: rockchip: Enable USB3 for rk3328 ROC-RK3328-CC + +Enable USB3 nodes for the ROC-RK3328-CC board. + +The separate power regulator is not added as it is controlled by the +same GPIO line as the existing VBUS regulators, so it is already +enabled. Also there is no port representation to tie the regulator to. + +Signed-off-by: Chen-Yu Tsai +Link: https://lore.kernel.org/r/20210504083616.9654-3-wens@kernel.org +Signed-off-by: Heiko Stuebner +--- + arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts +@@ -336,6 +336,15 @@ + status = "okay"; + }; + ++&usbdrd3 { ++ status = "okay"; ++}; ++ ++&usbdrd_dwc3 { ++ dr_mode = "host"; ++ status = "okay"; ++}; ++ + &usb_host0_ehci { + status = "okay"; + }; diff --git a/target/linux/rockchip/patches-5.4/100-rockchip-use-system-LED-for-OpenWrt.patch b/target/linux/rockchip/patches-5.4/100-rockchip-use-system-LED-for-OpenWrt.patch index d0860de8c9..1021f1fd9d 100644 --- a/target/linux/rockchip/patches-5.4/100-rockchip-use-system-LED-for-OpenWrt.patch +++ b/target/linux/rockchip/patches-5.4/100-rockchip-use-system-LED-for-OpenWrt.patch @@ -45,3 +45,32 @@ Signed-off-by: David Bauer /delete-node/ display-subsystem; gpio-leds { +--- a/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts +@@ -10,6 +10,13 @@ + model = "Firefly roc-rk3328-cc"; + compatible = "firefly,roc-rk3328-cc", "rockchip,rk3328"; + ++ aliases { ++ led-boot = &power_led; ++ led-failsafe = &power_led; ++ led-running = &power_led; ++ led-upgrade = &power_led; ++ }; ++ + chosen { + stdout-path = "serial2:1500000n8"; + }; +@@ -86,11 +93,9 @@ + leds { + compatible = "gpio-leds"; + +- power { ++ power_led: power { + label = "firefly:blue:power"; +- linux,default-trigger = "heartbeat"; + gpios = <&rk805 1 GPIO_ACTIVE_LOW>; +- default-state = "on"; + }; + + user { diff --git a/target/linux/rockchip/patches-5.4/107-nanopi-r4s-sd-signalling.patch b/target/linux/rockchip/patches-5.4/107-nanopi-r4s-sd-signalling.patch index 6bebe5f258..76da575450 100644 --- a/target/linux/rockchip/patches-5.4/107-nanopi-r4s-sd-signalling.patch +++ b/target/linux/rockchip/patches-5.4/107-nanopi-r4s-sd-signalling.patch @@ -10,6 +10,16 @@ userspace or following a kernel panic is always working. Signed-off-by: David Bauer +--- a/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts +@@ -310,7 +310,6 @@ + sd-uhs-sdr12; + sd-uhs-sdr25; + sd-uhs-sdr50; +- sd-uhs-sdr104; + vmmc-supply = <&vcc_sd>; + vqmmc-supply = <&vcc_sdio>; + status = "okay"; --- a/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts +++ b/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts @@ -141,6 +141,11 @@ diff --git a/target/linux/rockchip/patches-5.4/807-arm64-dts-nanopi-r2s-add-rk3328-dmc-relate-node.patch b/target/linux/rockchip/patches-5.4/807-arm64-dts-nanopi-r2s-add-rk3328-dmc-relate-node.patch index 091e295978..f2079d6513 100644 --- a/target/linux/rockchip/patches-5.4/807-arm64-dts-nanopi-r2s-add-rk3328-dmc-relate-node.patch +++ b/target/linux/rockchip/patches-5.4/807-arm64-dts-nanopi-r2s-add-rk3328-dmc-relate-node.patch @@ -124,3 +124,113 @@ Signed-off-by: hmz007 regulator-min-microvolt = <712500>; regulator-max-microvolt = <1450000>; regulator-ramp-delay = <12500>; +--- a/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts +@@ -4,6 +4,7 @@ + */ + + /dts-v1/; ++#include "rk3328-dram-renegade-timing.dtsi" + #include "rk3328.dtsi" + + / { +@@ -105,6 +106,72 @@ + default-state = "off"; + }; + }; ++ ++ dmc: dmc { ++ compatible = "rockchip,rk3328-dmc"; ++ devfreq-events = <&dfi>; ++ center-supply = <&vdd_logic>; ++ clocks = <&cru SCLK_DDRCLK>; ++ clock-names = "dmc_clk"; ++ operating-points-v2 = <&dmc_opp_table>; ++ ddr_timing = <&ddr_timing>; ++ upthreshold = <40>; ++ downdifferential = <20>; ++ auto-min-freq = <786000>; ++ auto-freq-en = <0>; ++ #cooling-cells = <2>; ++ status = "okay"; ++ ++ ddr_power_model: ddr_power_model { ++ compatible = "ddr_power_model"; ++ dynamic-power-coefficient = <120>; ++ static-power-coefficient = <200>; ++ ts = <32000 4700 (-80) 2>; ++ thermal-zone = "soc-thermal"; ++ }; ++ }; ++ ++ dmc_opp_table: dmc-opp-table { ++ compatible = "operating-points-v2"; ++ ++ rockchip,leakage-voltage-sel = < ++ 1 10 0 ++ 11 254 1 ++ >; ++ nvmem-cells = <&logic_leakage>; ++ nvmem-cell-names = "ddr_leakage"; ++ ++ opp-786000000 { ++ opp-hz = /bits/ 64 <786000000>; ++ opp-microvolt = <1075000>; ++ opp-microvolt-L0 = <1075000>; ++ opp-microvolt-L1 = <12000000>; ++ }; ++ opp-798000000 { ++ opp-hz = /bits/ 64 <798000000>; ++ opp-microvolt = <1075000>; ++ opp-microvolt-L0 = <1075000>; ++ opp-microvolt-L1 = <12000000>; ++ }; ++ opp-840000000 { ++ opp-hz = /bits/ 64 <840000000>; ++ opp-microvolt = <1075000>; ++ opp-microvolt-L0 = <1075000>; ++ opp-microvolt-L1 = <12000000>; ++ }; ++ opp-924000000 { ++ opp-hz = /bits/ 64 <924000000>; ++ opp-microvolt = <1100000>; ++ opp-microvolt-L0 = <1100000>; ++ opp-microvolt-L1 = <12000000>; ++ }; ++ opp-1068000000 { ++ opp-hz = /bits/ 64 <1068000000>; ++ opp-microvolt = <1175000>; ++ opp-microvolt-L0 = <1175000>; ++ opp-microvolt-L1 = <12000000>; ++ }; ++ }; + }; + + &cpu0 { +@@ -123,6 +190,10 @@ + cpu-supply = <&vdd_arm>; + }; + ++&dfi { ++ status = "okay"; ++}; ++ + &emmc { + bus-width = <8>; + cap-mmc-highspeed; +@@ -191,6 +262,7 @@ + regulators { + vdd_logic: DCDC_REG1 { + regulator-name = "vdd_logic"; ++ regulator-init-microvolt = <1075000>; + regulator-min-microvolt = <712500>; + regulator-max-microvolt = <1450000>; + regulator-always-on; +@@ -203,6 +275,7 @@ + + vdd_arm: DCDC_REG2 { + regulator-name = "vdd_arm"; ++ regulator-init-microvolt = <1225000>; + regulator-min-microvolt = <712500>; + regulator-max-microvolt = <1450000>; + regulator-always-on; From 116d3ccfd7a2b32c26eae6c17164d80139d4e7b9 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Tue, 4 Apr 2023 20:05:08 +0800 Subject: [PATCH 19/67] rockchip: fix supported device for firefly roc-rk3328-cc Signed-off-by: Tianling Shen (cherry picked from commit bed2c6c773c945a95bf2444d149defb186666c40) --- package/boot/uboot-rockchip/Makefile | 2 +- target/linux/rockchip/image/armv8.mk | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package/boot/uboot-rockchip/Makefile b/package/boot/uboot-rockchip/Makefile index 7cb2762b6d..81a10cb746 100644 --- a/package/boot/uboot-rockchip/Makefile +++ b/package/boot/uboot-rockchip/Makefile @@ -76,7 +76,7 @@ define U-Boot/roc-cc-rk3328 BUILD_SUBTARGET:=armv8 NAME:=ROC-RK3328-CC BUILD_DEVICES:= \ - firefly_roc-cc + firefly_roc-rk3328-cc DEPENDS:=+PACKAGE_u-boot-roc-cc-rk3328:arm-trusted-firmware-rk3328 PKG_BUILD_DEPENDS:=arm-trusted-firmware-rockchip-vendor ATF:=rk322xh_bl31_v1.46.elf diff --git a/target/linux/rockchip/image/armv8.mk b/target/linux/rockchip/image/armv8.mk index 29be80b4d6..d4a0aa9329 100644 --- a/target/linux/rockchip/image/armv8.mk +++ b/target/linux/rockchip/image/armv8.mk @@ -2,14 +2,15 @@ # # Copyright (C) 2020 Tobias Maedel -define Device/firefly_roc-cc +define Device/firefly_roc-rk3328-cc DEVICE_VENDOR := Firefly DEVICE_MODEL := ROC-RK3328-CC SOC := rk3328 + DEVICE_DTS := rockchip/rk3328-roc-cc UBOOT_DEVICE_NAME := roc-cc-rk3328 IMAGE/sysupgrade.img.gz := boot-common | boot-script nanopi-r2s | pine64-bin | gzip | append-metadata endef -TARGET_DEVICES += firefly_roc-cc +TARGET_DEVICES += firefly_roc-rk3328-cc define Device/friendlyarm_nanopi-r2c DEVICE_VENDOR := FriendlyARM From ece4ab706c1b2cf01a5c347b8ef6de6657177b57 Mon Sep 17 00:00:00 2001 From: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com> Date: Sun, 20 Jun 2021 15:45:22 +0800 Subject: [PATCH 20/67] ipq806x: add support for Ruijie M520 Signed-off-by: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com> --- include/image-commands.mk | 7 + target/linux/ipq806x/Makefile | 2 +- .../ipq806x/base-files/etc/board.d/02_network | 7 + .../etc/hotplug.d/firmware/11-ath10k-caldata | 16 + .../lib/preinit/05_set_iface_mac_ipq806x.sh | 5 + .../base-files/lib/upgrade/platform.sh | 3 + .../ipq806x/base-files/lib/upgrade/ruijie.sh | 54 +++ target/linux/ipq806x/config-5.4 | 2 + .../boot/dts/qcom-ipq8064-rg-mtfi-m520.dts | 326 ++++++++++++++++++ target/linux/ipq806x/image/Makefile | 17 + .../0069-arm-boot-add-dts-files.patch | 3 +- 11 files changed, 440 insertions(+), 2 deletions(-) create mode 100644 target/linux/ipq806x/base-files/lib/upgrade/ruijie.sh create mode 100644 target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-rg-mtfi-m520.dts diff --git a/include/image-commands.mk b/include/image-commands.mk index debfb5a98a..948e91cc25 100644 --- a/include/image-commands.mk +++ b/include/image-commands.mk @@ -338,6 +338,13 @@ define Build/qemu-image fi endef +define Build/qsdk-ipq-factory-mmc + $(TOPDIR)/scripts/mkits-qsdk-ipq-image.sh \ + $@.its kernel $(IMAGE_KERNEL) rootfs $(IMAGE_ROOTFS) + PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new + @mv $@.new $@ +endef + define Build/qsdk-ipq-factory-nand $(TOPDIR)/scripts/mkits-qsdk-ipq-image.sh \ $@.its ubi $@ diff --git a/target/linux/ipq806x/Makefile b/target/linux/ipq806x/Makefile index 344a88c045..c1b36b5aae 100644 --- a/target/linux/ipq806x/Makefile +++ b/target/linux/ipq806x/Makefile @@ -21,6 +21,6 @@ DEFAULT_PACKAGES += \ kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport \ kmod-phy-qcom-ipq806x-usb kmod-usb3 kmod-usb-dwc3-qcom \ kmod-ath10k-ct wpad-openssl uboot-envtools \ - autocore-arm luci-app-cpufreq + e2fsprogs autocore-arm luci-app-cpufreq $(eval $(call BuildTarget)) diff --git a/target/linux/ipq806x/base-files/etc/board.d/02_network b/target/linux/ipq806x/base-files/etc/board.d/02_network index 00fb6390cc..e35bcc7291 100755 --- a/target/linux/ipq806x/base-files/etc/board.d/02_network +++ b/target/linux/ipq806x/base-files/etc/board.d/02_network @@ -66,6 +66,13 @@ qcom,ipq8064-db149) ucidef_add_switch "switch0" \ "1:lan" "2:lan" "3:lan" "4:lan" "6u@eth1" "5:wan" "0u@eth0" ;; +ruijie,rg-mtfi-m520) + hw_mac_addr=$(mtd_get_mac_ascii PRODUCTINFO ethaddr) + ucidef_add_switch "switch0" \ + "1:lan" "6@eth1" "5:wan" "0@eth0" + ucidef_set_interface_macaddr "wan" "$hw_mac_addr" + ucidef_set_interface_macaddr "lan" "$(macaddr_add $hw_mac_addr 1)" + ;; tplink,ad7200) ucidef_add_switch "switch0" \ "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "6@eth1" "1:wan" "0@eth0" diff --git a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index abfe789ca9..cc4fbb1c7e 100644 --- a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -7,6 +7,22 @@ board=$(board_name) case "$FIRMWARE" in +"ath10k/cal-pci-0000:01:00.0.bin") + case "$board" in + ruijie,rg-mtfi-m520) + caldata_extract "ART" 0x1000 0x844 + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii PRODUCTINFO ethaddr) 2) + ;; + esac + ;; +"ath10k/cal-pci-0001:01:00.0.bin") + case "$board" in + ruijie,rg-mtfi-m520) + caldata_extract "ART" 0x5000 0x844 + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii PRODUCTINFO ethaddr) 3) + ;; + esac + ;; "ath10k/pre-cal-pci-0000:01:00.0.bin") case $board in askey,rt4230w-rev6 |\ diff --git a/target/linux/ipq806x/base-files/lib/preinit/05_set_iface_mac_ipq806x.sh b/target/linux/ipq806x/base-files/lib/preinit/05_set_iface_mac_ipq806x.sh index ca8d0b1555..569a19bac7 100644 --- a/target/linux/ipq806x/base-files/lib/preinit/05_set_iface_mac_ipq806x.sh +++ b/target/linux/ipq806x/base-files/lib/preinit/05_set_iface_mac_ipq806x.sh @@ -8,6 +8,11 @@ preinit_set_mac_address() { ip link set dev eth0 address "${lan_mac}" ip link set dev eth1 address "${wan_mac}" ;; + ruijie,rg-mtfi-m520) + base_mac=$(mtd_get_mac_ascii PRODUCTINFO ethaddr) + ip link set dev eth0 address $(macaddr_add "$base_mac" 1) + ip link set dev eth1 address $(macaddr_add "$base_mac" 2) + ;; esac } diff --git a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh index 5b6e78a7b3..57c7e627df 100644 --- a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh +++ b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh @@ -44,6 +44,9 @@ platform_do_upgrade() { linksys,ea8500) platform_do_upgrade_linksys "$1" ;; + ruijie,rg-mtfi-m520) + ruijie_do_upgrade "$1" + ;; tplink,ad7200 |\ tplink,c2600) PART_NAME="os-image:rootfs" diff --git a/target/linux/ipq806x/base-files/lib/upgrade/ruijie.sh b/target/linux/ipq806x/base-files/lib/upgrade/ruijie.sh new file mode 100644 index 0000000000..6644621715 --- /dev/null +++ b/target/linux/ipq806x/base-files/lib/upgrade/ruijie.sh @@ -0,0 +1,54 @@ +# +# Copyright (C) 2016 lede-project.org +# + +ruijie_do_flash() { + local tar_file=$1 + local kernel=$2 + local rootfs=$3 + + # keep sure its unbound + losetup --detach-all || { + echo Failed to detach all loop devices. Skip this try. + reboot -f + } + + # use the first found directory in the tar archive + local board_dir=$(tar tf $tar_file | grep -m 1 '^sysupgrade-.*/$') + board_dir=${board_dir%/} + + echo "flashing kernel to $kernel" + tar xf $tar_file ${board_dir}/kernel -O > $kernel + + echo "flashing rootfs to $rootfs" + tar xf $tar_file ${board_dir}/root -O > $rootfs + + # Cleanup + losetup -d /dev/loop0 >/dev/null 2>&1 + sync + umount -a + reboot -f +} + +ruijie_do_upgrade() { + local tar_file="$1" + local board=$(board_name) + local kernel= + local rootfs= + + case "$board" in + ruijie,rg-mtfi-m520) + kernel="/dev/mmcblk0p2" + rootfs="/dev/mmcblk0p3" + ;; + *) + return 1 + ;; + esac + + ruijie_do_flash $tar_file $kernel $rootfs + + nand_do_upgrade "$1" + + return 0 +} diff --git a/target/linux/ipq806x/config-5.4 b/target/linux/ipq806x/config-5.4 index 68ed6ec0c7..fcf1570da7 100644 --- a/target/linux/ipq806x/config-5.4 +++ b/target/linux/ipq806x/config-5.4 @@ -188,6 +188,8 @@ CONFIG_GENERIC_STRNLEN_USER=y CONFIG_GENERIC_TIME_VSYSCALL=y CONFIG_GPIOLIB=y CONFIG_GPIOLIB_IRQCHIP=y +CONFIG_GPIO_PCA953X=y +CONFIG_GPIO_PCA953X_IRQ=y CONFIG_GRO_CELLS=y CONFIG_HANDLE_DOMAIN_IRQ=y CONFIG_HARDEN_BRANCH_PREDICTOR=y diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-rg-mtfi-m520.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-rg-mtfi-m520.dts new file mode 100644 index 0000000000..8d2e35ec7d --- /dev/null +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-rg-mtfi-m520.dts @@ -0,0 +1,326 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qcom-ipq8064-v2.0.dtsi" + +#include + +/ { + model = "Ruijie RG-MTFi-M520"; + compatible = "ruijie,rg-mtfi-m520", "qcom,ipq8064"; + + memory@0 { + reg = <0x42000000 0x7e000000>; + device_type = "memory"; + }; + + aliases { + mdio-gpio0 = &mdio0; + sdcc1 = &sdcc1; + + led-boot = &led_sys; + led-failsafe = &led_sys; + led-running = &led_sys; + led-upgrade = &led_sys; + }; + + chosen { + bootargs = "root=/dev/mmcblk0p3 rootfstype=squashfs,ext4 rootwait noinitrd"; + }; + + leds { + compatible = "gpio-leds"; + + led_sys: sys { + label = "green:sys"; + gpios = <&gpio_ext 15 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + pinctrl-0 = <&button_pins>; + pinctrl-names = "default"; + + reset { + label = "reset"; + gpios = <&qcom_pinmux 54 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&qcom_pinmux { + button_pins: button_pins { + mux { + pins = "gpio54"; + function = "gpio"; + drive-strength = <2>; + bias-pull-up; + }; + }; + + mdio0_pins: mdio0_pins { + clk { + pins = "gpio1"; + input-disable; + }; + }; + + rgmii2_pins: rgmii2_pins { + tx { + pins = "gpio27", "gpio28", "gpio29", "gpio30", "gpio31", "gpio32"; + input-disable; + }; + }; + + sdcc1_pins: sdcc1_pinmux { + mux { + pins = "gpio38", "gpio39", "gpio40", "gpio41", "gpio42", + "gpio43", "gpio44", "gpio45", "gpio46", "gpio47"; + function = "sdc1"; + }; + + cmd { + pins = "gpio45"; + drive-strength = <10>; + bias-pull-up; + }; + + data { + pins = "gpio38", "gpio39", "gpio40", "gpio41", + "gpio43", "gpio44", "gpio46", "gpio47"; + drive-strength = <10>; + bias-pull-up; + }; + + clk { + pins = "gpio42"; + drive-strength = <16>; + bias-disable; + }; + }; + + spi_pins: spi_pins { + cs { + pins = "gpio20"; + drive-strength = <12>; + }; + }; +}; + +&gsbi2 { + qcom,mode = ; + status = "okay"; + + i2c@124a0000 { + status = "okay"; + + lm75@48 { + compatible = "lm75"; + reg = <0x48>; + }; + + pcf8563: rtc@51 { + compatible = "nxp,pcf8563"; + reg = <0x51>; + }; + + gpio_ext: tca9539@74 { + compatible = "ti,tca9539"; + reg = <0x74>; + + gpio-controller; + #gpio-cells = <2>; + }; + }; +}; + +&gsbi5 { + qcom,mode = ; + status = "okay"; + + spi4: spi@1a280000 { + status = "okay"; + + pinctrl-0 = <&spi_pins>; + pinctrl-names = "default"; + + cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>; + + m25p80@0 { + compatible = "s25fl256s1"; + #address-cells = <1>; + #size-cells = <1>; + spi-max-frequency = <50000000>; + reg = <0>; + + SBL1@0 { + label = "SBL1"; + reg = <0x0 0x10000>; + read-only; + }; + + MIBIB@10000 { + label = "MIBIB"; + reg = <0x10000 0x10000>; + read-only; + }; + + SBL2@20000 { + label = "SBL2"; + reg = <0x20000 0x20000>; + read-only; + }; + + SBL3@40000 { + label = "SBL3"; + reg = <0x40000 0x30000>; + read-only; + }; + + DDRCONFIG@70000 { + label = "DDRCONFIG"; + reg = <0x70000 0x10000>; + read-only; + }; + + PRODUCTINFO@80000 { + label = "PRODUCTINFO"; + reg = <0x80000 0x10000>; + read-only; + }; + + TZ@90000 { + label = "TZ"; + reg = <0x90000 0x30000>; + read-only; + }; + + RPM@c0000 { + label = "RPM"; + reg = <0xc0000 0x20000>; + read-only; + }; + + APPSBL@e0000 { + label = "APPSBL"; + reg = <0xe0000 0x80000>; + read-only; + }; + + APPSBLENV@160000 { + label = "APPSBLENV"; + reg = <0x160000 0x10000>; + read-only; + }; + + BOOTCONFIG@170000 { + label = "BOOTCONFIG"; + reg = <0x170000 0x10000>; + read-only; + }; + + ART@180000 { + label = "ART"; + reg = <0x180000 0x40000>; + read-only; + }; + }; + }; +}; + +&sata_phy { + status = "okay"; +}; + +&sata { + status = "okay"; +}; + +&usb3_0 { + status = "okay"; +}; + +&usb3_1 { + status = "okay"; +}; + +&pcie0 { + status = "okay"; + reset-gpio = <&qcom_pinmux 3 GPIO_ACTIVE_HIGH>; + pinctrl-0 = <&pcie0_pins>; + pinctrl-names = "default"; +}; + +&pcie1 { + status = "okay"; + reset-gpio = <&qcom_pinmux 48 GPIO_ACTIVE_HIGH>; + pinctrl-0 = <&pcie1_pins>; + pinctrl-names = "default"; + max-link-speed = <1>; +}; + +&mdio0 { + status = "okay"; + + pinctrl-0 = <&mdio0_pins>; + pinctrl-names = "default"; + + phy0: ethernet-phy@0 { + reg = <0>; + qca,ar8327-initvals = < + 0x00004 0x7600000 /* PAD0_MODE */ + 0x00008 0x1000000 /* PAD5_MODE */ + 0x0000c 0x80 /* PAD6_MODE */ + 0x000e4 0x6a545 /* MAC_POWER_SEL */ + 0x000e0 0xc74164de /* SGMII_CTRL */ + 0x0007c 0x4e /* PORT0_STATUS */ + 0x00094 0x4e /* PORT6_STATUS */ + >; + }; + + phy4: ethernet-phy@4 { + reg = <4>; + }; +}; + +&gmac1 { + status = "okay"; + phy-mode = "rgmii"; + qcom,id = <1>; + + pinctrl-0 = <&rgmii2_pins>; + pinctrl-names = "default"; + + fixed-link { + speed = <1000>; + full-duplex; + }; +}; + +&gmac2 { + status = "okay"; + phy-mode = "sgmii"; + qcom,id = <2>; + + fixed-link { + speed = <1000>; + full-duplex; + }; +}; + +&amba { + sdcc1: sdcc@12400000 { + status = "okay"; + pinctrl-0 = <&sdcc1_pins>; + pinctrl-names = "default"; + }; +}; + +&adm_dma { + status = "okay"; +}; + +&CPU_SPC { + status = "disabled"; +}; diff --git a/target/linux/ipq806x/image/Makefile b/target/linux/ipq806x/image/Makefile index 71d2fcf25b..6982c14f73 100644 --- a/target/linux/ipq806x/image/Makefile +++ b/target/linux/ipq806x/image/Makefile @@ -345,6 +345,23 @@ define Device/qcom_ipq8064-db149 endef TARGET_DEVICES += qcom_ipq8064-db149 +define Device/ruijie_rg-mtfi-m520 + DEVICE_VENDOR := Ruijie + DEVICE_MODEL := RG-MTFi-M520 + SOC := qcom-ipq8064 + BLOCKSIZE := 64k + KERNEL_SIZE := 4096k + KERNEL_SUFFIX := -uImage + KERNEL = kernel-bin | append-dtb | uImage none | pad-to $$(KERNEL_SIZE) + KERNEL_NAME := zImage + IMAGES += factory.bin + IMAGE/factory.bin := qsdk-ipq-factory-mmc + IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-to $$$$(BLOCKSIZE) | sysupgrade-tar rootfs=$$$$@ | append-metadata + DEVICE_PACKAGES := ath10k-firmware-qca988x-ct e2fsprogs kmod-hwmon-lm75 \ + kmod-fs-ext4 kmod-fs-f2fs kmod-rtc-pcf8563 losetup mkf2fs +endef +TARGET_DEVICES += ruijie_rg-mtfi-m520 + define Device/tplink_ad7200 $(call Device/TpSafeImage) DEVICE_VENDOR := TP-Link diff --git a/target/linux/ipq806x/patches-5.4/0069-arm-boot-add-dts-files.patch b/target/linux/ipq806x/patches-5.4/0069-arm-boot-add-dts-files.patch index ab355ac62b..b01f8e671f 100644 --- a/target/linux/ipq806x/patches-5.4/0069-arm-boot-add-dts-files.patch +++ b/target/linux/ipq806x/patches-5.4/0069-arm-boot-add-dts-files.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -842,7 +842,26 @@ dtb-$(CONFIG_ARCH_QCOM) += \ +@@ -842,7 +842,27 @@ dtb-$(CONFIG_ARCH_QCOM) += \ qcom-ipq4019-ap.dk04.1-c3.dtb \ qcom-ipq4019-ap.dk07.1-c1.dtb \ qcom-ipq4019-ap.dk07.1-c2.dtb \ @@ -26,6 +26,7 @@ Signed-off-by: John Crispin + qcom-ipq8064-mi-router-hd.dtb \ + qcom-ipq8064-r7500.dtb \ + qcom-ipq8064-r7500v2.dtb \ ++ qcom-ipq8064-rg-mtfi-m520.dtb \ + qcom-ipq8064-unifi-ac-hd.dtb \ + qcom-ipq8064-wg2600hp.dtb \ + qcom-ipq8064-wpq864.dtb \ From 6e74276e9727928ad560a7beb9a5ac59ba2f40f4 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Thu, 6 Apr 2023 03:38:05 +0800 Subject: [PATCH 21/67] autocore: remove ethinfo for ipq boards Signed-off-by: Tianling Shen --- package/emortal/autocore/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/package/emortal/autocore/Makefile b/package/emortal/autocore/Makefile index 3c53441969..3cb26b44a5 100644 --- a/package/emortal/autocore/Makefile +++ b/package/emortal/autocore/Makefile @@ -43,13 +43,16 @@ define Package/autocore/install/Default $(INSTALL_DIR) $(1)/sbin $(INSTALL_BIN) ./files/generic/cpuinfo $(1)/sbin/ - $(INSTALL_BIN) ./files/generic/ethinfo $(1)/sbin/ $(INSTALL_DIR) $(1)/usr/share/rpcd/acl.d $(CP) ./files/generic/luci-mod-status-autocore.json $(1)/usr/share/rpcd/acl.d/ +ifeq ($(filter ipq%, $(TARGETID)),) + $(INSTALL_BIN) ./files/generic/ethinfo $(1)/sbin/ + $(INSTALL_DIR) $(1)/www/luci-static/resources/view/status/include $(INSTALL_DATA) ./files/generic/21_ethinfo.js $(1)/www/luci-static/resources/view/status/include/ +endif endef define Package/autocore-arm/install From 93e9ad63c90af263f05ce9ac1d99ac832bf65bda Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Thu, 6 Apr 2023 03:43:59 +0800 Subject: [PATCH 22/67] ipq: build with automount by default Signed-off-by: Tianling Shen --- package/emortal/automount/Makefile | 1 + target/linux/ipq40xx/Makefile | 3 +-- target/linux/ipq806x/Makefile | 2 +- target/linux/ipq806x/image/Makefile | 2 +- target/linux/rockchip/Makefile | 2 +- target/linux/x86/Makefile | 14 +++++++------- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/package/emortal/automount/Makefile b/package/emortal/automount/Makefile index bf139ae216..d444ffdcde 100644 --- a/package/emortal/automount/Makefile +++ b/package/emortal/automount/Makefile @@ -20,6 +20,7 @@ define Package/automount MAINTAINER:=Lean DEPENDS:= \ +block-mount \ + +e2fsprogs \ +kmod-usb-storage \ +kmod-usb-storage-extras \ +!TARGET_ramips:kmod-usb-storage-uas \ diff --git a/target/linux/ipq40xx/Makefile b/target/linux/ipq40xx/Makefile index 5679c337e1..d71f278ce3 100644 --- a/target/linux/ipq40xx/Makefile +++ b/target/linux/ipq40xx/Makefile @@ -19,7 +19,6 @@ DEFAULT_PACKAGES += \ kmod-leds-gpio kmod-gpio-button-hotplug swconfig \ kmod-ath10k-ct wpad-openssl \ kmod-usb3 kmod-usb-dwc3 ath10k-firmware-qca4019-ct \ - e2fsprogs uboot-envtools \ - autocore-arm luci-app-cpufreq + uboot-envtools automount autocore-arm luci-app-cpufreq $(eval $(call BuildTarget)) diff --git a/target/linux/ipq806x/Makefile b/target/linux/ipq806x/Makefile index c1b36b5aae..5b70b5d5a6 100644 --- a/target/linux/ipq806x/Makefile +++ b/target/linux/ipq806x/Makefile @@ -21,6 +21,6 @@ DEFAULT_PACKAGES += \ kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport \ kmod-phy-qcom-ipq806x-usb kmod-usb3 kmod-usb-dwc3-qcom \ kmod-ath10k-ct wpad-openssl uboot-envtools \ - e2fsprogs autocore-arm luci-app-cpufreq + automount autocore-arm luci-app-cpufreq $(eval $(call BuildTarget)) diff --git a/target/linux/ipq806x/image/Makefile b/target/linux/ipq806x/image/Makefile index 6982c14f73..e9985e1549 100644 --- a/target/linux/ipq806x/image/Makefile +++ b/target/linux/ipq806x/image/Makefile @@ -358,7 +358,7 @@ define Device/ruijie_rg-mtfi-m520 IMAGE/factory.bin := qsdk-ipq-factory-mmc IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-to $$$$(BLOCKSIZE) | sysupgrade-tar rootfs=$$$$@ | append-metadata DEVICE_PACKAGES := ath10k-firmware-qca988x-ct e2fsprogs kmod-hwmon-lm75 \ - kmod-fs-ext4 kmod-fs-f2fs kmod-rtc-pcf8563 losetup mkf2fs + kmod-fs-f2fs kmod-rtc-pcf8563 losetup mkf2fs endef TARGET_DEVICES += ruijie_rg-mtfi-m520 diff --git a/target/linux/rockchip/Makefile b/target/linux/rockchip/Makefile index 711d1bc395..dd2349bff3 100644 --- a/target/linux/rockchip/Makefile +++ b/target/linux/rockchip/Makefile @@ -16,7 +16,7 @@ endef include $(INCLUDE_DIR)/target.mk DEFAULT_PACKAGES += uboot-envtools partx-utils e2fsprogs mkf2fs kmod-gpio-button-hotplug \ - automount autocore-arm fdisk e2fsprogs ethtool luci-app-cpufreq + automount autocore-arm fdisk ethtool luci-app-cpufreq KERNELNAME:=Image dtbs diff --git a/target/linux/x86/Makefile b/target/linux/x86/Makefile index d1485754ca..16d42a85bd 100644 --- a/target/linux/x86/Makefile +++ b/target/linux/x86/Makefile @@ -17,13 +17,13 @@ KERNELNAME:=bzImage include $(INCLUDE_DIR)/target.mk -DEFAULT_PACKAGES += alsa-utils partx-utils mkf2fs fdisk e2fsprogs kmod-button-hotplug kmod-usb-hid \ - kmod-e1000e kmod-i40e-vendor kmod-igb-vendor kmod-igbvf kmod-igc kmod-ixgbe-vendor \ - kmod-ixgbevf-vendor kmod-pcnet32 kmod-tulip kmod-vmxnet3 kmod-r8101 kmod-r8125 kmod-r8168 \ - kmod-8139cp kmod-8139too kmod-tg3 kmod-fs-f2fs kmod-ac97 kmod-sound-hda-core \ - kmod-sound-hda-codec-realtek kmod-sound-hda-codec-via kmod-sound-via82xx kmod-sound-hda-intel \ - kmod-sound-hda-codec-hdmi kmod-sound-i8x0 kmod-usb-audio kmod-usb-net kmod-usb-net-asix \ - kmod-usb-net-asix-ax88179 kmod-usb-net-rtl8150 kmod-usb-net-rtl8152-vendor autocore-x86 automount +DEFAULT_PACKAGES += alsa-utils partx-utils mkf2fs fdisk kmod-button-hotplug kmod-usb-hid kmod-e1000e \ + kmod-i40e-vendor kmod-igb-vendor kmod-igbvf kmod-igc kmod-ixgbe-vendor kmod-ixgbevf-vendor \ + kmod-pcnet32 kmod-tulip kmod-vmxnet3 kmod-r8101 kmod-r8125 kmod-r8168 kmod-8139cp \ + kmod-8139too kmod-tg3 kmod-fs-f2fs kmod-ac97 kmod-sound-hda-core kmod-sound-hda-codec-realtek \ + kmod-sound-hda-codec-via kmod-sound-via82xx kmod-sound-hda-intel kmod-sound-hda-codec-hdmi \ + kmod-sound-i8x0 kmod-usb-audio kmod-usb-net kmod-usb-net-asix kmod-usb-net-asix-ax88179 \ + kmod-usb-net-rtl8150 kmod-usb-net-rtl8152-vendor autocore-x86 automount $(eval $(call BuildTarget)) From 4ba71021c9a7c0e389a27c1516f820fbca5433bf Mon Sep 17 00:00:00 2001 From: Yogi Hermawan Date: Thu, 6 Apr 2023 04:59:13 +0800 Subject: [PATCH 23/67] ramips: MT7620 Add support for Bolt BL201 --- .../linux/ramips/dts/mt7620a_bolt_bl201.dts | 164 ++++++++++++++++++ target/linux/ramips/image/mt7620.mk | 9 + .../mt7620/base-files/etc/board.d/01_leds | 4 + .../mt7620/base-files/etc/board.d/02_network | 1 + 4 files changed, 178 insertions(+) create mode 100644 target/linux/ramips/dts/mt7620a_bolt_bl201.dts diff --git a/target/linux/ramips/dts/mt7620a_bolt_bl201.dts b/target/linux/ramips/dts/mt7620a_bolt_bl201.dts new file mode 100644 index 0000000000..8e09136818 --- /dev/null +++ b/target/linux/ramips/dts/mt7620a_bolt_bl201.dts @@ -0,0 +1,164 @@ +#include "mt7620a.dtsi" + +#include +#include + +/ { + compatible = "bolt,bl201", "ralink,mt7620a-soc"; + model = "Bolt BL201"; + + chosen { + bootargs = "console=ttyS0,115200"; + + led-boot = &power_red; + led-failsafe = &power_red; + led-running = &power_blue; + led-upgrade = &power_red; + label-mac-device = ðernet; + }; + + leds { + compatible = "gpio-leds"; + + wan { + label = "blue:wan"; + gpios = <&gpio1 5 GPIO_ACTIVE_LOW>; + }; + + power_red: power_red { + label = "red:power"; + gpios = <&gpio1 8 GPIO_ACTIVE_LOW>; + }; + + power_blue: power_blue { + label = "blue:power"; + gpios = <&gpio1 9 GPIO_ACTIVE_LOW>; + }; + + lte_s1_blue { + label = "blue:lte_s1"; + gpios = <&gpio1 7 GPIO_ACTIVE_LOW>; + }; + + lte_s2_blue { + label = "blue:lte_s2"; + gpios = <&gpio1 6 GPIO_ACTIVE_LOW>; + }; + + lte_s3_blue { + label = "blue:lte_s3"; + gpios = <&gpio1 10 GPIO_ACTIVE_LOW>; + }; + + lte_s4_blue { + label = "blue:lte_s4"; + gpios = <&gpio1 11 GPIO_ACTIVE_LOW>; + }; + + wps_blue { + label = "blue:wps"; + gpios = <&gpio2 22 GPIO_ACTIVE_LOW>; + }; + + lte_s1s2_red { + label = "red:lte_s1s2"; + gpios = <&gpio2 24 GPIO_ACTIVE_LOW>; + }; + + lte_s3s4_red { + label = "red:lte_s3s4"; + gpios = <&gpio2 25 GPIO_ACTIVE_LOW>; + }; + + wlan_blue { + label = "blue:wlan"; + gpios = <&gpio3 0 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio1 2 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&gpio3 { + status = "okay"; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0xf80000>; + }; + }; + }; +}; + +ðernet { + pinctrl-names = "default"; + pinctrl-0 = <&ephy_pins>; + + mtd-mac-address = <&factory 0x4>; + mediatek,portmap = "llllw"; +}; + +&wmac { + ralink,mtd-eeprom = <&factory 0x0>; + pinctrl-names = "default"; + pinctrl-0 = <&pa_pins>; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + mt76@0,0 { + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; + +&state_default { + gpio { + groups = "wled", "i2c", "uartf", "wdt"; + function = "gpio"; + }; +}; diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk index 0fd4da620a..c958764b6a 100644 --- a/target/linux/ramips/image/mt7620.mk +++ b/target/linux/ramips/image/mt7620.mk @@ -129,6 +129,15 @@ define Device/bdcom_wap2100-sk endef TARGET_DEVICES += bdcom_wap2100-sk +define Device/bolt_bl201 + SOC := mt7620a + IMAGE_SIZE := 15872k + DEVICE_VENDOR := Bolt + DEVICE_MODEL := BL201 + DEVICE_PACKAGES := kmod-mt76x2 +endef +TARGET_DEVICES += bolt_bl201 + define Device/buffalo_whr-1166d SOC := mt7620a IMAGE_SIZE := 16064k diff --git a/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds index 4fe7d2d076..0053f31a1e 100755 --- a/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds @@ -41,6 +41,10 @@ asus,rt-n14u) bdcom,wap2100-sk) ucidef_set_led_netdev "wifi_led" "wifi" "green:wlan2g" "wlan0" ;; +bolt,bl201) + ucidef_set_led_netdev "wlan0" "wlan0-link" "blue:wlan" "wlan0" + ucidef_set_led_netdev "wan" "eth0.2-link" "blue:wan" "eth0.2" "link" + ;; comfast,cf-wr800n) ucidef_set_led_netdev "lan" "lan" "white:ethernet" eth0.1 ucidef_set_led_netdev "wifi_led" "wifi" "white:wifi" "wlan0" diff --git a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network index 07b17a9daf..78c35430aa 100755 --- a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network @@ -12,6 +12,7 @@ ramips_setup_interfaces() aigale,ai-br100|\ alfa-network,ac1200rm|\ asus,rt-n12p|\ + bolt,bl201|\ dlink,dwr-116-a1|\ dlink,dwr-921-c1|\ dlink,dwr-922-e2|\ From 5dc8c8fedd80ef6e3a0f1a26fb8579a94ce3bc0c Mon Sep 17 00:00:00 2001 From: Chuanhong Guo Date: Sun, 26 Mar 2023 23:50:43 +0800 Subject: [PATCH 24/67] ramips: fix 5g mac for TOTOLINK X5000R There's no valid mac address for the second band in the eeprom. The vendor fw uses 2.4G mac + 4 as the mac for 5G radio. Do the same in our firmware. Fixes: 23be410b3d ("ramips: add support for TOTOLINK X5000R") Signed-off-by: Chuanhong Guo (cherry picked from commit 212632540043cc9b911c2efb86156479f2710836) --- .../mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac index 5eafe3dc04..62091b96bb 100644 --- a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac +++ b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac @@ -45,6 +45,10 @@ case "$board" in macaddr_setbit_la "$(mtd_get_mac_ascii Config protest_lan_mac)" \ > /sys${DEVPATH}/macaddress ;; + totolink,x5000r) + hw_mac_addr="$(mtd_get_mac_binary factory 0x4)" + [ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr 4 > /sys${DEVPATH}/macaddress + ;; yuncore,ax820) [ "$PHYNBR" = "1" ] && \ macaddr_setbit_la "$(mtd_get_mac_binary Factory 0xe000)" > /sys${DEVPATH}/macaddress From c7333b03e14bb9d81167383da9d484b2c627cfc1 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Sat, 8 Apr 2023 20:02:05 +0800 Subject: [PATCH 25/67] libressl: add tencent mirror Signed-off-by: Tianling Shen (cherry picked from commit 1f85199be639b6e7d507d9781b5c557e96cd45db) --- tools/libressl/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/libressl/Makefile b/tools/libressl/Makefile index 0679961d17..ec6f92d3e9 100644 --- a/tools/libressl/Makefile +++ b/tools/libressl/Makefile @@ -15,7 +15,8 @@ PKG_RELEASE:=1 PKG_CPE_ID:=cpe:/a:openbsd:libressl PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=http://mirror.ox.ac.uk/pub/OpenBSD/LibreSSL \ +PKG_SOURCE_URL:=https://mirrors.tencent.com/OpenBSD/LibreSSL/ \ + https://mirror.ox.ac.uk/pub/OpenBSD/LibreSSL \ http://ftp.jaist.ac.jp/pub/OpenBSD/LibreSSL \ https://ftp.openbsd.org/pub/OpenBSD/LibreSSL From bc99ce5b22963c22661b3e549c3cdc86bf52756c Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Sun, 12 Mar 2023 16:56:41 +0100 Subject: [PATCH 26/67] imagebuilder: allow to specific ROOTFS_PARTSIZE Setting this options modifies the rootfs size of created images. When installing a large number of packages it may become necessary to increase the size to have enough storage. This option is only useful for supported devices, i.e. with an attached SD Card or installed on a hard drive. Signed-off-by: Paul Spooren (cherry picked from commit 7b7edd25a571568438c886529d3443054e02f55f) --- target/imagebuilder/files/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/imagebuilder/files/Makefile b/target/imagebuilder/files/Makefile index aeae98aacd..eadb0ebe85 100644 --- a/target/imagebuilder/files/Makefile +++ b/target/imagebuilder/files/Makefile @@ -47,6 +47,7 @@ Building images: make image EXTRA_IMAGE_NAME="" # Add this to the output image filename (sanitized) make image DISABLED_SERVICES=" [ [ ..]]" # Which services in /etc/init.d/ should be disabled make image ADD_LOCAL_KEY=1 # store locally generated signing key in built images + make image ROOTFS_PARTSIZE="" # override the default rootfs partition size in MegaBytes Print manifest: List "all" packages which get installed into the image. @@ -243,7 +244,8 @@ image: $(if $(FILES),USER_FILES="$(FILES)") \ $(if $(PACKAGES),USER_PACKAGES="$(PACKAGES)") \ $(if $(BIN_DIR),BIN_DIR="$(BIN_DIR)") \ - $(if $(DISABLED_SERVICES),DISABLED_SERVICES="$(DISABLED_SERVICES)")) + $(if $(DISABLED_SERVICES),DISABLED_SERVICES="$(DISABLED_SERVICES)") \ + $(if $(ROOTFS_PARTSIZE),CONFIG_TARGET_ROOTFS_PARTSIZE="$(ROOTFS_PARTSIZE)")) manifest: FORCE $(MAKE) -s _check_profile From 9f213a85e219c94c45c15c9aa5feffadb00689ea Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sun, 9 Apr 2023 23:38:36 +0100 Subject: [PATCH 27/67] OpenWrt v21.02.6: adjust config defaults Signed-off-by: Daniel Golle --- feeds.conf.default | 9 ++++----- include/version.mk | 6 +++--- package/base-files/image-config.in | 4 ++-- version | 1 + version.date | 1 + 5 files changed, 11 insertions(+), 10 deletions(-) create mode 100644 version create mode 100644 version.date diff --git a/feeds.conf.default b/feeds.conf.default index f1827a3661..7b4bcd6128 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -1,5 +1,4 @@ -src-git-full packages https://git.openwrt.org/feed/packages.git;openwrt-21.02 -src-git-full luci https://git.openwrt.org/project/luci.git;openwrt-21.02 -src-git-full routing https://git.openwrt.org/feed/routing.git;openwrt-21.02 -src-git-full telephony https://git.openwrt.org/feed/telephony.git;openwrt-21.02 -#src-link custom /usr/src/openwrt/custom-feed +src-git-full packages https://git.openwrt.org/feed/packages.git^0b7b12d7075637d3ce3c4eb22b74b2f6d3054672 +src-git-full luci https://git.openwrt.org/project/luci.git^e98243ef9eb838cca80cdd6d1bd0cf69a509d103 +src-git-full routing https://git.openwrt.org/feed/routing.git^8071852b4556a02533cacb7a0f6a432df3507302 +src-git-full telephony https://git.openwrt.org/feed/telephony.git^920fbc5c0a2e4badf51bceff42e9a1e3eb693462 diff --git a/include/version.mk b/include/version.mk index a4b47c8a57..bc136b2c27 100644 --- a/include/version.mk +++ b/include/version.mk @@ -23,13 +23,13 @@ PKG_CONFIG_DEPENDS += \ sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1)))) VERSION_NUMBER:=$(call qstrip,$(CONFIG_VERSION_NUMBER)) -VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),21.02-SNAPSHOT) +VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),21.02.6) VERSION_CODE:=$(call qstrip,$(CONFIG_VERSION_CODE)) -VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),$(REVISION)) +VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r16842-bc99ce5b22) VERSION_REPO:=$(call qstrip,$(CONFIG_VERSION_REPO)) -VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/21.02-SNAPSHOT) +VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/21.02.6) VERSION_DIST:=$(call qstrip,$(CONFIG_VERSION_DIST)) VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),OpenWrt) diff --git a/package/base-files/image-config.in b/package/base-files/image-config.in index 1f06332b00..55913094bc 100644 --- a/package/base-files/image-config.in +++ b/package/base-files/image-config.in @@ -183,7 +183,7 @@ if VERSIONOPT config VERSION_REPO string prompt "Release repository" - default "https://downloads.openwrt.org/releases/21.02-SNAPSHOT" + default "https://downloads.openwrt.org/releases/21.02.6" help This is the repository address embedded in the image, it defaults to the trunk snapshot repo; the url may contain the following placeholders: @@ -259,7 +259,7 @@ if VERSIONOPT config VERSION_CODE_FILENAMES bool prompt "Revision code in filenames" - default y + default n help Enable this to include the revision identifier or the configured version code into the firmware image, SDK- and Image Builder archive diff --git a/version b/version new file mode 100644 index 0000000000..d11640790f --- /dev/null +++ b/version @@ -0,0 +1 @@ +r16842-bc99ce5b22 diff --git a/version.date b/version.date new file mode 100644 index 0000000000..22e64c52da --- /dev/null +++ b/version.date @@ -0,0 +1 @@ +1681043296 From f6a41570a5f6abb6ca74b957e4d226cf6c3f0c9a Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sun, 9 Apr 2023 23:38:42 +0100 Subject: [PATCH 28/67] OpenWrt v21.02.6: revert to branch defaults Signed-off-by: Daniel Golle --- feeds.conf.default | 9 +++++---- include/version.mk | 6 +++--- package/base-files/image-config.in | 4 ++-- version | 1 - version.date | 1 - 5 files changed, 10 insertions(+), 11 deletions(-) delete mode 100644 version delete mode 100644 version.date diff --git a/feeds.conf.default b/feeds.conf.default index 7b4bcd6128..f1827a3661 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -1,4 +1,5 @@ -src-git-full packages https://git.openwrt.org/feed/packages.git^0b7b12d7075637d3ce3c4eb22b74b2f6d3054672 -src-git-full luci https://git.openwrt.org/project/luci.git^e98243ef9eb838cca80cdd6d1bd0cf69a509d103 -src-git-full routing https://git.openwrt.org/feed/routing.git^8071852b4556a02533cacb7a0f6a432df3507302 -src-git-full telephony https://git.openwrt.org/feed/telephony.git^920fbc5c0a2e4badf51bceff42e9a1e3eb693462 +src-git-full packages https://git.openwrt.org/feed/packages.git;openwrt-21.02 +src-git-full luci https://git.openwrt.org/project/luci.git;openwrt-21.02 +src-git-full routing https://git.openwrt.org/feed/routing.git;openwrt-21.02 +src-git-full telephony https://git.openwrt.org/feed/telephony.git;openwrt-21.02 +#src-link custom /usr/src/openwrt/custom-feed diff --git a/include/version.mk b/include/version.mk index bc136b2c27..a4b47c8a57 100644 --- a/include/version.mk +++ b/include/version.mk @@ -23,13 +23,13 @@ PKG_CONFIG_DEPENDS += \ sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1)))) VERSION_NUMBER:=$(call qstrip,$(CONFIG_VERSION_NUMBER)) -VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),21.02.6) +VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),21.02-SNAPSHOT) VERSION_CODE:=$(call qstrip,$(CONFIG_VERSION_CODE)) -VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r16842-bc99ce5b22) +VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),$(REVISION)) VERSION_REPO:=$(call qstrip,$(CONFIG_VERSION_REPO)) -VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/21.02.6) +VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/21.02-SNAPSHOT) VERSION_DIST:=$(call qstrip,$(CONFIG_VERSION_DIST)) VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),OpenWrt) diff --git a/package/base-files/image-config.in b/package/base-files/image-config.in index 55913094bc..1f06332b00 100644 --- a/package/base-files/image-config.in +++ b/package/base-files/image-config.in @@ -183,7 +183,7 @@ if VERSIONOPT config VERSION_REPO string prompt "Release repository" - default "https://downloads.openwrt.org/releases/21.02.6" + default "https://downloads.openwrt.org/releases/21.02-SNAPSHOT" help This is the repository address embedded in the image, it defaults to the trunk snapshot repo; the url may contain the following placeholders: @@ -259,7 +259,7 @@ if VERSIONOPT config VERSION_CODE_FILENAMES bool prompt "Revision code in filenames" - default n + default y help Enable this to include the revision identifier or the configured version code into the firmware image, SDK- and Image Builder archive diff --git a/version b/version deleted file mode 100644 index d11640790f..0000000000 --- a/version +++ /dev/null @@ -1 +0,0 @@ -r16842-bc99ce5b22 diff --git a/version.date b/version.date deleted file mode 100644 index 22e64c52da..0000000000 --- a/version.date +++ /dev/null @@ -1 +0,0 @@ -1681043296 From e63b8443ab9f5edeba5b29c27f59015526cac0fd Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 13 Apr 2023 20:51:05 +0200 Subject: [PATCH 29/67] uclient: update to Git version 2023-04-13 007d94546749 uclient: cancel state change timeout in uclient_disconnect() 644d3c7e13c6 ci: improve wolfSSL test coverage dc54d2b544a1 tests: add certificate check against letsencrypt.org Signed-off-by: Matthias Schiffer (cherry picked from commit 4f1c2e8deef10e9ca34ceff5a096e62aaa668e90) --- package/libs/uclient/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/libs/uclient/Makefile b/package/libs/uclient/Makefile index 398a27bb98..d7d1f1bb1f 100644 --- a/package/libs/uclient/Makefile +++ b/package/libs/uclient/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/uclient.git -PKG_MIRROR_HASH:=7c443cac02a734dd312c65618f4de17248d188317f30a9fac192c1503b3d5c05 -PKG_SOURCE_DATE:=2021-05-14 -PKG_SOURCE_VERSION:=6a6011df3429ffa5958d12b1327eeda4fd9daa47 +PKG_MIRROR_HASH:=16c6c97f45d9737fb40628ea22ae347541a1e37d8d1576e04ffbaa5fc92f3b6d +PKG_SOURCE_DATE:=2023-04-13 +PKG_SOURCE_VERSION:=007d945467499f43656b141171d31f5643b83a6c CMAKE_INSTALL:=1 PKG_BUILD_DEPENDS:=ustream-ssl From 34d2883b9d6fd4a3b3eb39d3fa90e8c281d36448 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sat, 15 Apr 2023 01:35:17 +0100 Subject: [PATCH 30/67] kernel: backport fix for recently introduced UBI bug Import commit "ubi: Fix failure attaching when vid_hdr offset equals to (sub)page size" which did not yet make it to stable upstream Linux trees. Fixes: #12232 Fixes: #12339 Signed-off-by: Daniel Golle (cherry picked from commit aad34818b50029e07ed9221ae46f9770d6e29785) --- ...attaching-when-vid_hdr-offset-equals.patch | 69 +++++++++++++++++++ ...mtd-device-named-ubi-or-data-on-boot.patch | 4 +- 2 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 target/linux/generic/backport-5.4/430-v6.3-ubi-Fix-failure-attaching-when-vid_hdr-offset-equals.patch diff --git a/target/linux/generic/backport-5.4/430-v6.3-ubi-Fix-failure-attaching-when-vid_hdr-offset-equals.patch b/target/linux/generic/backport-5.4/430-v6.3-ubi-Fix-failure-attaching-when-vid_hdr-offset-equals.patch new file mode 100644 index 0000000000..afb8e5ee14 --- /dev/null +++ b/target/linux/generic/backport-5.4/430-v6.3-ubi-Fix-failure-attaching-when-vid_hdr-offset-equals.patch @@ -0,0 +1,69 @@ +From 1e020e1b96afdecd20680b5b5be2a6ffc3d27628 Mon Sep 17 00:00:00 2001 +From: Zhihao Cheng +Date: Mon, 6 Mar 2023 09:33:08 +0800 +Subject: [PATCH] ubi: Fix failure attaching when vid_hdr offset equals to + (sub)page size + +Following process will make ubi attaching failed since commit +1b42b1a36fc946 ("ubi: ensure that VID header offset ... size"): + +ID="0xec,0xa1,0x00,0x15" # 128M 128KB 2KB +modprobe nandsim id_bytes=$ID +flash_eraseall /dev/mtd0 +modprobe ubi mtd="0,2048" # set vid_hdr offset as 2048 (one page) +(dmesg): + ubi0 error: ubi_attach_mtd_dev [ubi]: VID header offset 2048 too large. + UBI error: cannot attach mtd0 + UBI error: cannot initialize UBI, error -22 + +Rework original solution, the key point is making sure +'vid_hdr_shift + UBI_VID_HDR_SIZE < ubi->vid_hdr_alsize', +so we should check vid_hdr_shift rather not vid_hdr_offset. +Then, ubi still support (sub)page aligined VID header offset. + +Fixes: 1b42b1a36fc946 ("ubi: ensure that VID header offset ... size") +Signed-off-by: Zhihao Cheng +Tested-by: Nicolas Schichan +Tested-by: Miquel Raynal # v5.10, v4.19 +Signed-off-by: Richard Weinberger +--- + drivers/mtd/ubi/build.c | 21 +++++++++++++++------ + 1 file changed, 15 insertions(+), 6 deletions(-) + +--- a/drivers/mtd/ubi/build.c ++++ b/drivers/mtd/ubi/build.c +@@ -644,12 +644,6 @@ static int io_init(struct ubi_device *ub + ubi->ec_hdr_alsize = ALIGN(UBI_EC_HDR_SIZE, ubi->hdrs_min_io_size); + ubi->vid_hdr_alsize = ALIGN(UBI_VID_HDR_SIZE, ubi->hdrs_min_io_size); + +- if (ubi->vid_hdr_offset && ((ubi->vid_hdr_offset + UBI_VID_HDR_SIZE) > +- ubi->vid_hdr_alsize)) { +- ubi_err(ubi, "VID header offset %d too large.", ubi->vid_hdr_offset); +- return -EINVAL; +- } +- + dbg_gen("min_io_size %d", ubi->min_io_size); + dbg_gen("max_write_size %d", ubi->max_write_size); + dbg_gen("hdrs_min_io_size %d", ubi->hdrs_min_io_size); +@@ -667,6 +661,21 @@ static int io_init(struct ubi_device *ub + ubi->vid_hdr_aloffset; + } + ++ /* ++ * Memory allocation for VID header is ubi->vid_hdr_alsize ++ * which is described in comments in io.c. ++ * Make sure VID header shift + UBI_VID_HDR_SIZE not exceeds ++ * ubi->vid_hdr_alsize, so that all vid header operations ++ * won't access memory out of bounds. ++ */ ++ if ((ubi->vid_hdr_shift + UBI_VID_HDR_SIZE) > ubi->vid_hdr_alsize) { ++ ubi_err(ubi, "Invalid VID header offset %d, VID header shift(%d)" ++ " + VID header size(%zu) > VID header aligned size(%d).", ++ ubi->vid_hdr_offset, ubi->vid_hdr_shift, ++ UBI_VID_HDR_SIZE, ubi->vid_hdr_alsize); ++ return -EINVAL; ++ } ++ + /* Similar for the data offset */ + ubi->leb_start = ubi->vid_hdr_offset + UBI_VID_HDR_SIZE; + ubi->leb_start = ALIGN(ubi->leb_start, ubi->min_io_size); diff --git a/target/linux/generic/pending-5.4/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch b/target/linux/generic/pending-5.4/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch index b21daea4f0..cc19a5e628 100644 --- a/target/linux/generic/pending-5.4/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch +++ b/target/linux/generic/pending-5.4/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch @@ -8,7 +8,7 @@ Signed-off-by: Daniel Golle --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c -@@ -1168,6 +1168,73 @@ static struct mtd_info * __init open_mtd +@@ -1177,6 +1177,73 @@ static struct mtd_info * __init open_mtd return mtd; } @@ -82,7 +82,7 @@ Signed-off-by: Daniel Golle static int __init ubi_init(void) { int err, i, k; -@@ -1251,6 +1318,12 @@ static int __init ubi_init(void) +@@ -1260,6 +1327,12 @@ static int __init ubi_init(void) } } From 3b5862cf4197da0e33bab3cd10a09dde5a46aad1 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Sat, 15 Apr 2023 19:02:12 +0800 Subject: [PATCH 31/67] bcm27xx: build with automount by default Signed-off-by: Tianling Shen (cherry picked from commit 6bed850e06996ff8218cfced9b592ed3b354bf3b) --- target/linux/bcm27xx/Makefile | 2 +- target/linux/rockchip/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/bcm27xx/Makefile b/target/linux/bcm27xx/Makefile index d89ca62f2d..7a12934202 100644 --- a/target/linux/bcm27xx/Makefile +++ b/target/linux/bcm27xx/Makefile @@ -26,7 +26,7 @@ DEFAULT_PACKAGES += \ kmod-usb-hid \ kmod-sound-core kmod-sound-arm-bcm2835 \ kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1 \ - partx-utils mkf2fs e2fsprogs \ + partx-utils mkf2fs automount \ autocore-arm luci-app-cpufreq KERNELNAME:=Image dtbs diff --git a/target/linux/rockchip/Makefile b/target/linux/rockchip/Makefile index dd2349bff3..3a4ea1ed9a 100644 --- a/target/linux/rockchip/Makefile +++ b/target/linux/rockchip/Makefile @@ -15,7 +15,7 @@ endef include $(INCLUDE_DIR)/target.mk -DEFAULT_PACKAGES += uboot-envtools partx-utils e2fsprogs mkf2fs kmod-gpio-button-hotplug \ +DEFAULT_PACKAGES += uboot-envtools partx-utils mkf2fs kmod-gpio-button-hotplug \ automount autocore-arm fdisk ethtool luci-app-cpufreq KERNELNAME:=Image dtbs From f8282da11ee77c36acb1bd94c99b76ce13257ab9 Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Tue, 4 Apr 2023 15:39:56 -0300 Subject: [PATCH 32/67] openssl: fix CVE-2023-464 and CVE-2023-465 Apply two patches fixing low-severity vulnerabilities related to certificate policies validation: - Excessive Resource Usage Verifying X.509 Policy Constraints (CVE-2023-0464) Severity: Low A security vulnerability has been identified in all supported versions of OpenSSL related to the verification of X.509 certificate chains that include policy constraints. Attackers may be able to exploit this vulnerability by creating a malicious certificate chain that triggers exponential use of computational resources, leading to a denial-of-service (DoS) attack on affected systems. Policy processing is disabled by default but can be enabled by passing the `-policy' argument to the command line utilities or by calling the `X509_VERIFY_PARAM_set1_policies()' function. - Invalid certificate policies in leaf certificates are silently ignored (CVE-2023-0465) Severity: Low Applications that use a non-default option when verifying certificates may be vulnerable to an attack from a malicious CA to circumvent certain checks. Invalid certificate policies in leaf certificates are silently ignored by OpenSSL and other certificate policy checks are skipped for that certificate. A malicious CA could use this to deliberately assert invalid certificate policies in order to circumvent policy checking on the certificate altogether. Policy processing is disabled by default but can be enabled by passing the `-policy' argument to the command line utilities or by calling the `X509_VERIFY_PARAM_set1_policies()' function. Note: OpenSSL also released a fix for low-severity security advisory CVE-2023-466. It is not included here because the fix only changes the documentation, which is not built nor included in any OpenWrt package. Due to the low-severity of these issues, there will be not be an immediate new release of OpenSSL. Signed-off-by: Eneas U de Queiroz --- package/libs/openssl/Makefile | 2 +- ...esource-use-verifying-policy-constra.patch | 214 ++++++++++++++++++ ...AG_INVALID_POLICY-is-checked-even-in.patch | 48 ++++ 3 files changed, 263 insertions(+), 1 deletion(-) create mode 100644 package/libs/openssl/patches/200-x509-excessive-resource-use-verifying-policy-constra.patch create mode 100644 package/libs/openssl/patches/210-Ensure-that-EXFLAG_INVALID_POLICY-is-checked-even-in.patch diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile index aa3dbb7877..f72ba844e7 100644 --- a/package/libs/openssl/Makefile +++ b/package/libs/openssl/Makefile @@ -11,7 +11,7 @@ PKG_NAME:=openssl PKG_BASE:=1.1.1 PKG_BUGFIX:=t PKG_VERSION:=$(PKG_BASE)$(PKG_BUGFIX) -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_USE_MIPS16:=0 ENGINES_DIR=engines-1.1 diff --git a/package/libs/openssl/patches/200-x509-excessive-resource-use-verifying-policy-constra.patch b/package/libs/openssl/patches/200-x509-excessive-resource-use-verifying-policy-constra.patch new file mode 100644 index 0000000000..a3a4de6008 --- /dev/null +++ b/package/libs/openssl/patches/200-x509-excessive-resource-use-verifying-policy-constra.patch @@ -0,0 +1,214 @@ +From 879f7080d7e141f415c79eaa3a8ac4a3dad0348b Mon Sep 17 00:00:00 2001 +From: Pauli +Date: Wed, 8 Mar 2023 15:28:20 +1100 +Subject: [PATCH] x509: excessive resource use verifying policy constraints + +A security vulnerability has been identified in all supported versions +of OpenSSL related to the verification of X.509 certificate chains +that include policy constraints. Attackers may be able to exploit this +vulnerability by creating a malicious certificate chain that triggers +exponential use of computational resources, leading to a denial-of-service +(DoS) attack on affected systems. + +Fixes CVE-2023-0464 + +Reviewed-by: Tomas Mraz +Reviewed-by: Shane Lontis +(Merged from https://github.com/openssl/openssl/pull/20569) + +diff --git a/crypto/x509v3/pcy_local.h b/crypto/x509v3/pcy_local.h +index 5daf78de45..344aa06765 100644 +--- a/crypto/x509v3/pcy_local.h ++++ b/crypto/x509v3/pcy_local.h +@@ -111,6 +111,11 @@ struct X509_POLICY_LEVEL_st { + }; + + struct X509_POLICY_TREE_st { ++ /* The number of nodes in the tree */ ++ size_t node_count; ++ /* The maximum number of nodes in the tree */ ++ size_t node_maximum; ++ + /* This is the tree 'level' data */ + X509_POLICY_LEVEL *levels; + int nlevel; +@@ -159,7 +164,8 @@ X509_POLICY_NODE *tree_find_sk(STACK_OF(X509_POLICY_NODE) *sk, + X509_POLICY_NODE *level_add_node(X509_POLICY_LEVEL *level, + X509_POLICY_DATA *data, + X509_POLICY_NODE *parent, +- X509_POLICY_TREE *tree); ++ X509_POLICY_TREE *tree, ++ int extra_data); + void policy_node_free(X509_POLICY_NODE *node); + int policy_node_match(const X509_POLICY_LEVEL *lvl, + const X509_POLICY_NODE *node, const ASN1_OBJECT *oid); +diff --git a/crypto/x509v3/pcy_node.c b/crypto/x509v3/pcy_node.c +index e2d7b15322..d574fb9d66 100644 +--- a/crypto/x509v3/pcy_node.c ++++ b/crypto/x509v3/pcy_node.c +@@ -59,10 +59,15 @@ X509_POLICY_NODE *level_find_node(const X509_POLICY_LEVEL *level, + X509_POLICY_NODE *level_add_node(X509_POLICY_LEVEL *level, + X509_POLICY_DATA *data, + X509_POLICY_NODE *parent, +- X509_POLICY_TREE *tree) ++ X509_POLICY_TREE *tree, ++ int extra_data) + { + X509_POLICY_NODE *node; + ++ /* Verify that the tree isn't too large. This mitigates CVE-2023-0464 */ ++ if (tree->node_maximum > 0 && tree->node_count >= tree->node_maximum) ++ return NULL; ++ + node = OPENSSL_zalloc(sizeof(*node)); + if (node == NULL) { + X509V3err(X509V3_F_LEVEL_ADD_NODE, ERR_R_MALLOC_FAILURE); +@@ -70,7 +75,7 @@ X509_POLICY_NODE *level_add_node(X509_POLICY_LEVEL *level, + } + node->data = data; + node->parent = parent; +- if (level) { ++ if (level != NULL) { + if (OBJ_obj2nid(data->valid_policy) == NID_any_policy) { + if (level->anyPolicy) + goto node_error; +@@ -90,7 +95,7 @@ X509_POLICY_NODE *level_add_node(X509_POLICY_LEVEL *level, + } + } + +- if (tree) { ++ if (extra_data) { + if (tree->extra_data == NULL) + tree->extra_data = sk_X509_POLICY_DATA_new_null(); + if (tree->extra_data == NULL){ +@@ -103,6 +108,7 @@ X509_POLICY_NODE *level_add_node(X509_POLICY_LEVEL *level, + } + } + ++ tree->node_count++; + if (parent) + parent->nchild++; + +diff --git a/crypto/x509v3/pcy_tree.c b/crypto/x509v3/pcy_tree.c +index 6e8322cbc5..6c7fd35405 100644 +--- a/crypto/x509v3/pcy_tree.c ++++ b/crypto/x509v3/pcy_tree.c +@@ -13,6 +13,18 @@ + + #include "pcy_local.h" + ++/* ++ * If the maximum number of nodes in the policy tree isn't defined, set it to ++ * a generous default of 1000 nodes. ++ * ++ * Defining this to be zero means unlimited policy tree growth which opens the ++ * door on CVE-2023-0464. ++ */ ++ ++#ifndef OPENSSL_POLICY_TREE_NODES_MAX ++# define OPENSSL_POLICY_TREE_NODES_MAX 1000 ++#endif ++ + /* + * Enable this to print out the complete policy tree at various point during + * evaluation. +@@ -168,6 +180,9 @@ static int tree_init(X509_POLICY_TREE **ptree, STACK_OF(X509) *certs, + return X509_PCY_TREE_INTERNAL; + } + ++ /* Limit the growth of the tree to mitigate CVE-2023-0464 */ ++ tree->node_maximum = OPENSSL_POLICY_TREE_NODES_MAX; ++ + /* + * http://tools.ietf.org/html/rfc5280#section-6.1.2, figure 3. + * +@@ -184,7 +199,7 @@ static int tree_init(X509_POLICY_TREE **ptree, STACK_OF(X509) *certs, + level = tree->levels; + if ((data = policy_data_new(NULL, OBJ_nid2obj(NID_any_policy), 0)) == NULL) + goto bad_tree; +- if (level_add_node(level, data, NULL, tree) == NULL) { ++ if (level_add_node(level, data, NULL, tree, 1) == NULL) { + policy_data_free(data); + goto bad_tree; + } +@@ -243,7 +258,8 @@ static int tree_init(X509_POLICY_TREE **ptree, STACK_OF(X509) *certs, + * Return value: 1 on success, 0 otherwise + */ + static int tree_link_matching_nodes(X509_POLICY_LEVEL *curr, +- X509_POLICY_DATA *data) ++ X509_POLICY_DATA *data, ++ X509_POLICY_TREE *tree) + { + X509_POLICY_LEVEL *last = curr - 1; + int i, matched = 0; +@@ -253,13 +269,13 @@ static int tree_link_matching_nodes(X509_POLICY_LEVEL *curr, + X509_POLICY_NODE *node = sk_X509_POLICY_NODE_value(last->nodes, i); + + if (policy_node_match(last, node, data->valid_policy)) { +- if (level_add_node(curr, data, node, NULL) == NULL) ++ if (level_add_node(curr, data, node, tree, 0) == NULL) + return 0; + matched = 1; + } + } + if (!matched && last->anyPolicy) { +- if (level_add_node(curr, data, last->anyPolicy, NULL) == NULL) ++ if (level_add_node(curr, data, last->anyPolicy, tree, 0) == NULL) + return 0; + } + return 1; +@@ -272,7 +288,8 @@ static int tree_link_matching_nodes(X509_POLICY_LEVEL *curr, + * Return value: 1 on success, 0 otherwise. + */ + static int tree_link_nodes(X509_POLICY_LEVEL *curr, +- const X509_POLICY_CACHE *cache) ++ const X509_POLICY_CACHE *cache, ++ X509_POLICY_TREE *tree) + { + int i; + +@@ -280,7 +297,7 @@ static int tree_link_nodes(X509_POLICY_LEVEL *curr, + X509_POLICY_DATA *data = sk_X509_POLICY_DATA_value(cache->data, i); + + /* Look for matching nodes in previous level */ +- if (!tree_link_matching_nodes(curr, data)) ++ if (!tree_link_matching_nodes(curr, data, tree)) + return 0; + } + return 1; +@@ -311,7 +328,7 @@ static int tree_add_unmatched(X509_POLICY_LEVEL *curr, + /* Curr may not have anyPolicy */ + data->qualifier_set = cache->anyPolicy->qualifier_set; + data->flags |= POLICY_DATA_FLAG_SHARED_QUALIFIERS; +- if (level_add_node(curr, data, node, tree) == NULL) { ++ if (level_add_node(curr, data, node, tree, 1) == NULL) { + policy_data_free(data); + return 0; + } +@@ -373,7 +390,7 @@ static int tree_link_any(X509_POLICY_LEVEL *curr, + } + /* Finally add link to anyPolicy */ + if (last->anyPolicy && +- level_add_node(curr, cache->anyPolicy, last->anyPolicy, NULL) == NULL) ++ level_add_node(curr, cache->anyPolicy, last->anyPolicy, tree, 0) == NULL) + return 0; + return 1; + } +@@ -555,7 +572,7 @@ static int tree_calculate_user_set(X509_POLICY_TREE *tree, + extra->qualifier_set = anyPolicy->data->qualifier_set; + extra->flags = POLICY_DATA_FLAG_SHARED_QUALIFIERS + | POLICY_DATA_FLAG_EXTRA_NODE; +- node = level_add_node(NULL, extra, anyPolicy->parent, tree); ++ node = level_add_node(NULL, extra, anyPolicy->parent, tree, 1); + } + if (!tree->user_policies) { + tree->user_policies = sk_X509_POLICY_NODE_new_null(); +@@ -582,7 +599,7 @@ static int tree_evaluate(X509_POLICY_TREE *tree) + + for (i = 1; i < tree->nlevel; i++, curr++) { + cache = policy_cache_set(curr->cert); +- if (!tree_link_nodes(curr, cache)) ++ if (!tree_link_nodes(curr, cache, tree)) + return X509_PCY_TREE_INTERNAL; + + if (!(curr->flags & X509_V_FLAG_INHIBIT_ANY) diff --git a/package/libs/openssl/patches/210-Ensure-that-EXFLAG_INVALID_POLICY-is-checked-even-in.patch b/package/libs/openssl/patches/210-Ensure-that-EXFLAG_INVALID_POLICY-is-checked-even-in.patch new file mode 100644 index 0000000000..ffb7317d7c --- /dev/null +++ b/package/libs/openssl/patches/210-Ensure-that-EXFLAG_INVALID_POLICY-is-checked-even-in.patch @@ -0,0 +1,48 @@ +From b013765abfa80036dc779dd0e50602c57bb3bf95 Mon Sep 17 00:00:00 2001 +From: Matt Caswell +Date: Tue, 7 Mar 2023 16:52:55 +0000 +Subject: [PATCH] Ensure that EXFLAG_INVALID_POLICY is checked even in leaf + certs + +Even though we check the leaf cert to confirm it is valid, we +later ignored the invalid flag and did not notice that the leaf +cert was bad. + +Fixes: CVE-2023-0465 + +Reviewed-by: Hugo Landau +Reviewed-by: Tomas Mraz +(Merged from https://github.com/openssl/openssl/pull/20588) + +diff --git a/crypto/x509/x509_vfy.c b/crypto/x509/x509_vfy.c +index 925fbb5412..1dfe4f9f31 100644 +--- a/crypto/x509/x509_vfy.c ++++ b/crypto/x509/x509_vfy.c +@@ -1649,18 +1649,25 @@ static int check_policy(X509_STORE_CTX *ctx) + } + /* Invalid or inconsistent extensions */ + if (ret == X509_PCY_TREE_INVALID) { +- int i; ++ int i, cbcalled = 0; + + /* Locate certificates with bad extensions and notify callback. */ +- for (i = 1; i < sk_X509_num(ctx->chain); i++) { ++ for (i = 0; i < sk_X509_num(ctx->chain); i++) { + X509 *x = sk_X509_value(ctx->chain, i); + + if (!(x->ex_flags & EXFLAG_INVALID_POLICY)) + continue; ++ cbcalled = 1; + if (!verify_cb_cert(ctx, x, i, + X509_V_ERR_INVALID_POLICY_EXTENSION)) + return 0; + } ++ if (!cbcalled) { ++ /* Should not be able to get here */ ++ X509err(X509_F_CHECK_POLICY, ERR_R_INTERNAL_ERROR); ++ return 0; ++ } ++ /* The callback ignored the error so we return success */ + return 1; + } + if (ret == X509_PCY_TREE_FAILURE) { From 49092a2ff32c91cab23791bd1b1ce250ecf717bd Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Tue, 18 Apr 2023 01:36:47 +0800 Subject: [PATCH 33/67] sunxi: build with automount by default Signed-off-by: Tianling Shen (cherry picked from commit 327536fb03ae09e5777813c02175a1269564c224) --- target/linux/sunxi/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/sunxi/Makefile b/target/linux/sunxi/Makefile index 383239d8b5..c333b96cbc 100644 --- a/target/linux/sunxi/Makefile +++ b/target/linux/sunxi/Makefile @@ -25,7 +25,7 @@ KERNELNAME:=zImage dtbs include $(INCLUDE_DIR)/target.mk DEFAULT_PACKAGES += uboot-envtools -DEFAULT_PACKAGES += partx-utils mkf2fs e2fsprogs +DEFAULT_PACKAGES += partx-utils mkf2fs automount DEFAULT_PACKAGES += autocore-arm luci-app-cpufreq $(eval $(call BuildTarget)) From 058ba4a7d1cc7a6dff7656597f41f4313975b8e2 Mon Sep 17 00:00:00 2001 From: svswmw <47269902+SVSWMW@users.noreply.github.com> Date: Tue, 18 Apr 2023 02:50:39 +0800 Subject: [PATCH 34/67] ramips: add support for ZTE E8820S Signed-off-by: Tianling Shen --- target/linux/ramips/dts/mt7621_zte_e8820s.dts | 197 ++++++++++++++++++ target/linux/ramips/image/mt7621.mk | 19 ++ .../mt7621/base-files/etc/board.d/01_leds | 4 + 3 files changed, 220 insertions(+) create mode 100644 target/linux/ramips/dts/mt7621_zte_e8820s.dts diff --git a/target/linux/ramips/dts/mt7621_zte_e8820s.dts b/target/linux/ramips/dts/mt7621_zte_e8820s.dts new file mode 100644 index 0000000000..4f00bb9d09 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_zte_e8820s.dts @@ -0,0 +1,197 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "zte,e8820s", "mediatek,mt7621-soc"; + model = "ZTE E8820S"; + + aliases { + led-boot = &led_sys; + led-failsafe = &led_sys; + led-running = &led_power; + led-upgrade = &led_power; + label-mac-device = &gmac0; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "white:power"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + + led_sys: sys { + label = "white:sys"; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + + wlan2g { + label = "white:wlan2g"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + wlan5g { + label = "white:wlan5g"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 18 GPIO_ACTIVE_HIGH>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wifi { + label = "wifi"; + gpios = <&gpio 10 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + ubi-concat { + compatible = "mtd-concat"; + devices = <&ubipart0 &ubipart1>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + ubi@0 { + label = "ubi"; + reg = <0x0 0x79c0000>; + }; + }; + }; +}; + +&nand { + status = "okay"; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x80000>; + read-only; + }; + + partition@80000 { + label = "debug"; + reg = <0x80000 0x80000>; + read-only; + }; + + factory: partition@100000 { + label = "factory"; + reg = <0x100000 0x40000>; + read-only; + }; + + partition@140000 { + label = "kernel"; + reg = <0x140000 0x400000>; + }; + + ubipart0: partition@540000 { + label = "ubipart0"; + reg = <0x540000 0x1c80000>; + }; + + partition@21c0000 { + label = "bdinfo"; + reg = <0x21c0000 0x80000>; + read-only; + }; + + ubipart1: partition@2240000 { + label = "ubipart1"; + reg = <0x2240000 0x5d40000>; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + compatible = "pci14c3,7603"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0000>; + ieee80211-freq-limit = <2400000 2500000>; + }; +}; + +&pcie1 { + wifi@0,0 { + compatible = "pci14c3,7662"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; + +&gmac0 { + mtd-mac-address = <&factory 0xe006>; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "lan1"; + }; + + port@1 { + status = "okay"; + label = "lan2"; + }; + + port@2 { + status = "okay"; + label = "lan3"; + }; + + port@3 { + status = "okay"; + label = "lan4"; + }; + + port@4 { + status = "okay"; + label = "wan"; + mtd-mac-address = <&factory 0xe000>; + }; + }; +}; + +&state_default { + gpio { + groups = "jtag", "uart2", "uart3", "wdt"; + function = "gpio"; + }; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 26bf091a89..0abdb68f83 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -1799,6 +1799,25 @@ define Device/zio_freezio endef TARGET_DEVICES += zio_freezio +define Device/zte_e8820s + $(Device/dsa-migration) + $(Device/uimage-lzma-loader) + BLOCKSIZE := 128k + PAGESIZE := 2048 + KERNEL_SIZE := 4096k + UBINIZE_OPTS := -E 5 + IMAGE_SIZE := 32768k + IMAGES += factory.bin + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata + IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \ + check-size + DEVICE_VENDOR := ZTE + DEVICE_MODEL := E8820S + DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 \ + kmod-usb-ledtrig-usbport +endef +TARGET_DEVICES += zte_e8820s + define Device/zyxel_nr7101 $(Device/dsa-migration) BLOCKSIZE := 128k diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds index c21394547f..d506f24e7a 100755 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds @@ -123,6 +123,10 @@ xiaomi,redmi-router-ac2100) youhua,wr1200js) ucidef_set_led_netdev "internet" "INTERNET" "green:wan" "wan" ;; +zte,e8820s) + ucidef_set_led_netdev "wlan2g" "WiFi 2.4GHz" "white:wlan2g" "wlan0" + ucidef_set_led_netdev "wlan5g" "WiFi 5GHz" "white:wlan5g" "wlan1" + ;; esac board_config_flush From 14f80a84492d0cef5665fa81f13ae43d1a14e88a Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Wed, 19 Apr 2023 05:47:40 +0800 Subject: [PATCH 35/67] default-settings-chn: add luci-i18n-base-zh-cn to dependencies For firmware-selector. Signed-off-by: Tianling Shen --- package/emortal/default-settings/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/emortal/default-settings/Makefile b/package/emortal/default-settings/Makefile index 492767ad48..caed1177c2 100644 --- a/package/emortal/default-settings/Makefile +++ b/package/emortal/default-settings/Makefile @@ -29,7 +29,7 @@ endef define Package/default-settings-chn $(Package/default-settings) TITLE+= (Optimize for CHN users) - DEPENDS:=+default-settings +@LUCI_LANG_zh_Hans + DEPENDS:=+default-settings +@LUCI_LANG_zh_Hans +luci-i18n-base-zh-cn endef define Build/Compile From 5c1af46f2819f9ca8db7542124fecd132dac0c41 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Sun, 23 Apr 2023 13:57:30 +0800 Subject: [PATCH 36/67] kernel: bump to 5.4.241 Removed upstreamed patches: - generic/backport-5.4/430-v6.3-ubi-Fix-failure-attaching-when-vid_hdr-offset-equals.patch - mvebu/patches-5.4/008-net-mvneta-make-tx-buffer-array-agnostic.patch Refreshed all patches. Signed-off-by: Tianling Shen --- include/kernel-5.4 | 4 +- .../802-usb-xhci-force-msi-renesas-xhci.patch | 2 +- ...smsx95xx-fix-crimes-against-truesize.patch | 4 +- ...hci_fixup_endpoint-for-interval-adju.patch | 4 +- ...support-for-performing-fake-doorbell.patch | 6 +- ...cache-support-to-handle-the-shadow-e.patch | 4 +- ...T-mm-multigenerational-lru-groundwor.patch | 4 +- ...T-mm-multigenerational-lru-mm_struct.patch | 4 +- ...attaching-when-vid_hdr-offset-equals.patch | 69 ------ ...formation-about-stacked-DSA-protocol.patch | 2 +- ...e6xxx-Add-support-for-port-mirroring.patch | 4 +- ...x-fix-broken-if-statement-because-of.patch | 2 +- .../661-use_fq_codel_by_default.patch | 2 +- ...-dsa-mv88e6xxx-disable-ATU-violation.patch | 2 +- .../hack-5.4/904-debloat_dma_buf.patch | 2 +- .../993-usb-serial-option-add-u9300.patch | 2 +- ...760-net-dsa-mv88e6xxx-fix-vlan-setup.patch | 2 +- ...equest-assisted-learning-on-CPU-port.patch | 2 +- ...rial-lpuart-add-power-domain-support.patch | 4 +- ...al-fsl_lpuart-add-modem-device-reset.patch | 2 +- ...l-fsl_lpuart-add-magic-SysRq-support.patch | 2 +- ...l_lpuart-enable-dma-mode-for-imx8qxp.patch | 38 ++-- ...rial-fsl_lpuart-enable-loopback-mode.patch | 2 +- ...-fsl_lpuart-do-HW-reset-for-communic.patch | 4 +- ...-serial-lpuart-add-runtime-pm-suppor.patch | 20 +- ...uart-enable-wakeup-source-for-lpuart.patch | 10 +- ...rial-fsl_lpuart-enable-two-stop-bits.patch | 6 +- ...l-lpuart-support-UPIO_MEM32-for-lpua.patch | 2 +- ...host-xhci-add-EH-SINGLE_STEP_SET_FEA.patch | 2 +- ...735-usb-host-add-XHCI_CDNS_HOST-flag.patch | 2 +- ...-host-xhci-add-.bus_suspend-override.patch | 2 +- ...agate-resolved-link-config-via-mac_l.patch | 2 +- ...ntroduce-mvneta_update_stats-routine.patch | 10 +- ...duce-page-pool-API-for-sw-buffer-man.patch | 12 +- ...on-build_skb-in-mvneta_rx_swbm-poll-.patch | 14 +- ...006-net-mvneta-add-basic-XDP-support.patch | 24 +- ...header-prefetch-in-mvneta_swbm_rx_fr.patch | 4 +- ...mvneta-make-tx-buffer-array-agnostic.patch | 210 ------------------ 38 files changed, 107 insertions(+), 386 deletions(-) delete mode 100644 target/linux/generic/backport-5.4/430-v6.3-ubi-Fix-failure-attaching-when-vid_hdr-offset-equals.patch delete mode 100644 target/linux/mvebu/patches-5.4/008-net-mvneta-make-tx-buffer-array-agnostic.patch diff --git a/include/kernel-5.4 b/include/kernel-5.4 index a31315270a..e281ed5868 100644 --- a/include/kernel-5.4 +++ b/include/kernel-5.4 @@ -1,2 +1,2 @@ -LINUX_VERSION-5.4 = .238 -LINUX_KERNEL_HASH-5.4.238 = 70a2b2da85598eba6a73cdc0749e441cbdf3011d9babcb7028a46aa8d98aa91f +LINUX_VERSION-5.4 = .241 +LINUX_KERNEL_HASH-5.4.241 = ffc0e0ad6f47f8b7b05148d815cbab27f44fa433f3a8ed0e372d4b8647bcea7c diff --git a/target/linux/apm821xx/patches-5.4/802-usb-xhci-force-msi-renesas-xhci.patch b/target/linux/apm821xx/patches-5.4/802-usb-xhci-force-msi-renesas-xhci.patch index 0da57d3ddd..1ab1de3f46 100644 --- a/target/linux/apm821xx/patches-5.4/802-usb-xhci-force-msi-renesas-xhci.patch +++ b/target/linux/apm821xx/patches-5.4/802-usb-xhci-force-msi-renesas-xhci.patch @@ -23,7 +23,7 @@ produce a noisy warning. xhci->quirks |= XHCI_RESET_ON_RESUME; --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c -@@ -427,10 +427,14 @@ static int xhci_try_enable_msi(struct us +@@ -431,10 +431,14 @@ static int xhci_try_enable_msi(struct us free_irq(hcd->irq, hcd); hcd->irq = 0; diff --git a/target/linux/bcm27xx/patches-5.4/950-0003-smsx95xx-fix-crimes-against-truesize.patch b/target/linux/bcm27xx/patches-5.4/950-0003-smsx95xx-fix-crimes-against-truesize.patch index 2355037880..cde0f2d2c9 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0003-smsx95xx-fix-crimes-against-truesize.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0003-smsx95xx-fix-crimes-against-truesize.patch @@ -25,7 +25,7 @@ Signed-off-by: Steve Glendinning static int __must_check __smsc95xx_read_reg(struct usbnet *dev, u32 index, u32 *data, int in_pm) { -@@ -1964,7 +1968,8 @@ static int smsc95xx_rx_fixup(struct usbn +@@ -1970,7 +1974,8 @@ static int smsc95xx_rx_fixup(struct usbn if (dev->net->features & NETIF_F_RXCSUM) smsc95xx_rx_csum_offload(skb); skb_trim(skb, skb->len - 4); /* remove fcs */ @@ -35,7 +35,7 @@ Signed-off-by: Steve Glendinning return 1; } -@@ -1982,7 +1987,8 @@ static int smsc95xx_rx_fixup(struct usbn +@@ -1988,7 +1993,8 @@ static int smsc95xx_rx_fixup(struct usbn if (dev->net->features & NETIF_F_RXCSUM) smsc95xx_rx_csum_offload(ax_skb); skb_trim(ax_skb, ax_skb->len - 4); /* remove fcs */ diff --git a/target/linux/bcm27xx/patches-5.4/950-0219-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch b/target/linux/bcm27xx/patches-5.4/950-0219-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch index 39ce3f939b..61ab2ac3f4 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0219-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0219-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch @@ -15,7 +15,7 @@ Signed-off-by: Jonathan Bell --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c -@@ -1487,6 +1487,103 @@ command_cleanup: +@@ -1491,6 +1491,103 @@ command_cleanup: } /* @@ -119,7 +119,7 @@ Signed-off-by: Jonathan Bell * non-error returns are a promise to giveback() the urb later * we drop ownership so next owner (or urb unlink) can get it */ -@@ -5402,6 +5499,7 @@ static const struct hc_driver xhci_hc_dr +@@ -5406,6 +5503,7 @@ static const struct hc_driver xhci_hc_dr .endpoint_reset = xhci_endpoint_reset, .check_bandwidth = xhci_check_bandwidth, .reset_bandwidth = xhci_reset_bandwidth, diff --git a/target/linux/bcm53xx/patches-5.4/180-usb-xhci-add-support-for-performing-fake-doorbell.patch b/target/linux/bcm53xx/patches-5.4/180-usb-xhci-add-support-for-performing-fake-doorbell.patch index dcdf48149a..a988d27753 100644 --- a/target/linux/bcm53xx/patches-5.4/180-usb-xhci-add-support-for-performing-fake-doorbell.patch +++ b/target/linux/bcm53xx/patches-5.4/180-usb-xhci-add-support-for-performing-fake-doorbell.patch @@ -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 -@@ -158,6 +158,49 @@ int xhci_start(struct xhci_hcd *xhci) +@@ -159,6 +159,49 @@ int xhci_start(struct xhci_hcd *xhci) return ret; } @@ -90,7 +90,7 @@ it on BCM4708 family. /* * Reset a halted HC. * -@@ -608,10 +651,20 @@ static int xhci_init(struct usb_hcd *hcd +@@ -612,10 +655,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; -@@ -621,6 +674,10 @@ static int xhci_run_finished(struct xhci +@@ -625,6 +678,10 @@ static int xhci_run_finished(struct xhci xhci_dbg_trace(xhci, trace_xhci_dbg_init, "Finished xhci_run for USB3 roothub"); return 0; diff --git a/target/linux/generic/backport-5.4/020-13-BACKPORT-mm-swapcache-support-to-handle-the-shadow-e.patch b/target/linux/generic/backport-5.4/020-13-BACKPORT-mm-swapcache-support-to-handle-the-shadow-e.patch index 8f409c7e36..7fe4962568 100644 --- a/target/linux/generic/backport-5.4/020-13-BACKPORT-mm-swapcache-support-to-handle-the-shadow-e.patch +++ b/target/linux/generic/backport-5.4/020-13-BACKPORT-mm-swapcache-support-to-handle-the-shadow-e.patch @@ -232,7 +232,7 @@ Tested-by: Yu Zhao SetPageWorkingset(new_page); --- a/mm/swapfile.c +++ b/mm/swapfile.c -@@ -715,6 +715,7 @@ static void add_to_avail_list(struct swa +@@ -716,6 +716,7 @@ static void add_to_avail_list(struct swa static void swap_range_free(struct swap_info_struct *si, unsigned long offset, unsigned int nr_entries) { @@ -240,7 +240,7 @@ Tested-by: Yu Zhao unsigned long end = offset + nr_entries - 1; void (*swap_slot_free_notify)(struct block_device *, unsigned long); -@@ -740,6 +741,7 @@ static void swap_range_free(struct swap_ +@@ -741,6 +742,7 @@ static void swap_range_free(struct swap_ swap_slot_free_notify(si->bdev, offset); offset++; } diff --git a/target/linux/generic/backport-5.4/020-19-BACKPORT-FROMLIST-mm-multigenerational-lru-groundwor.patch b/target/linux/generic/backport-5.4/020-19-BACKPORT-FROMLIST-mm-multigenerational-lru-groundwor.patch index 29c023714f..316e9b303b 100644 --- a/target/linux/generic/backport-5.4/020-19-BACKPORT-FROMLIST-mm-multigenerational-lru-groundwor.patch +++ b/target/linux/generic/backport-5.4/020-19-BACKPORT-FROMLIST-mm-multigenerational-lru-groundwor.patch @@ -570,7 +570,7 @@ Commit-Queue: Yu Zhao #if defined(CONFIG_NUMA_BALANCING) && !defined(LAST_CPUPID_NOT_IN_PAGE_FLAGS) --- a/mm/swapfile.c +++ b/mm/swapfile.c -@@ -2702,6 +2702,8 @@ SYSCALL_DEFINE1(swapoff, const char __us +@@ -2703,6 +2703,8 @@ SYSCALL_DEFINE1(swapoff, const char __us err = 0; atomic_inc(&proc_poll_event); wake_up_interruptible(&proc_poll_wait); @@ -579,7 +579,7 @@ Commit-Queue: Yu Zhao out_dput: filp_close(victim, NULL); -@@ -3328,6 +3330,8 @@ SYSCALL_DEFINE2(swapon, const char __use +@@ -3329,6 +3331,8 @@ SYSCALL_DEFINE2(swapon, const char __use mutex_unlock(&swapon_mutex); atomic_inc(&proc_poll_event); wake_up_interruptible(&proc_poll_wait); diff --git a/target/linux/generic/backport-5.4/020-21-BACKPORT-FROMLIST-mm-multigenerational-lru-mm_struct.patch b/target/linux/generic/backport-5.4/020-21-BACKPORT-FROMLIST-mm-multigenerational-lru-mm_struct.patch index 215e1df3d8..d5d9e522e5 100644 --- a/target/linux/generic/backport-5.4/020-21-BACKPORT-FROMLIST-mm-multigenerational-lru-mm_struct.patch +++ b/target/linux/generic/backport-5.4/020-21-BACKPORT-FROMLIST-mm-multigenerational-lru-mm_struct.patch @@ -260,7 +260,7 @@ Commit-Queue: Yu Zhao /* forking complete and child started to run, tell ptracer */ --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -3468,6 +3468,7 @@ context_switch(struct rq *rq, struct tas +@@ -3471,6 +3471,7 @@ context_switch(struct rq *rq, struct tas * finish_task_switch()'s mmdrop(). */ switch_mm_irqs_off(prev->active_mm, next->mm, next); @@ -268,7 +268,7 @@ Commit-Queue: Yu Zhao if (!prev->mm) { // from kernel /* will mmdrop() in finish_task_switch(). */ -@@ -6283,6 +6284,7 @@ void idle_task_exit(void) +@@ -6286,6 +6287,7 @@ void idle_task_exit(void) if (mm != &init_mm) { switch_mm(mm, &init_mm, current); diff --git a/target/linux/generic/backport-5.4/430-v6.3-ubi-Fix-failure-attaching-when-vid_hdr-offset-equals.patch b/target/linux/generic/backport-5.4/430-v6.3-ubi-Fix-failure-attaching-when-vid_hdr-offset-equals.patch deleted file mode 100644 index afb8e5ee14..0000000000 --- a/target/linux/generic/backport-5.4/430-v6.3-ubi-Fix-failure-attaching-when-vid_hdr-offset-equals.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 1e020e1b96afdecd20680b5b5be2a6ffc3d27628 Mon Sep 17 00:00:00 2001 -From: Zhihao Cheng -Date: Mon, 6 Mar 2023 09:33:08 +0800 -Subject: [PATCH] ubi: Fix failure attaching when vid_hdr offset equals to - (sub)page size - -Following process will make ubi attaching failed since commit -1b42b1a36fc946 ("ubi: ensure that VID header offset ... size"): - -ID="0xec,0xa1,0x00,0x15" # 128M 128KB 2KB -modprobe nandsim id_bytes=$ID -flash_eraseall /dev/mtd0 -modprobe ubi mtd="0,2048" # set vid_hdr offset as 2048 (one page) -(dmesg): - ubi0 error: ubi_attach_mtd_dev [ubi]: VID header offset 2048 too large. - UBI error: cannot attach mtd0 - UBI error: cannot initialize UBI, error -22 - -Rework original solution, the key point is making sure -'vid_hdr_shift + UBI_VID_HDR_SIZE < ubi->vid_hdr_alsize', -so we should check vid_hdr_shift rather not vid_hdr_offset. -Then, ubi still support (sub)page aligined VID header offset. - -Fixes: 1b42b1a36fc946 ("ubi: ensure that VID header offset ... size") -Signed-off-by: Zhihao Cheng -Tested-by: Nicolas Schichan -Tested-by: Miquel Raynal # v5.10, v4.19 -Signed-off-by: Richard Weinberger ---- - drivers/mtd/ubi/build.c | 21 +++++++++++++++------ - 1 file changed, 15 insertions(+), 6 deletions(-) - ---- a/drivers/mtd/ubi/build.c -+++ b/drivers/mtd/ubi/build.c -@@ -644,12 +644,6 @@ static int io_init(struct ubi_device *ub - ubi->ec_hdr_alsize = ALIGN(UBI_EC_HDR_SIZE, ubi->hdrs_min_io_size); - ubi->vid_hdr_alsize = ALIGN(UBI_VID_HDR_SIZE, ubi->hdrs_min_io_size); - -- if (ubi->vid_hdr_offset && ((ubi->vid_hdr_offset + UBI_VID_HDR_SIZE) > -- ubi->vid_hdr_alsize)) { -- ubi_err(ubi, "VID header offset %d too large.", ubi->vid_hdr_offset); -- return -EINVAL; -- } -- - dbg_gen("min_io_size %d", ubi->min_io_size); - dbg_gen("max_write_size %d", ubi->max_write_size); - dbg_gen("hdrs_min_io_size %d", ubi->hdrs_min_io_size); -@@ -667,6 +661,21 @@ static int io_init(struct ubi_device *ub - ubi->vid_hdr_aloffset; - } - -+ /* -+ * Memory allocation for VID header is ubi->vid_hdr_alsize -+ * which is described in comments in io.c. -+ * Make sure VID header shift + UBI_VID_HDR_SIZE not exceeds -+ * ubi->vid_hdr_alsize, so that all vid header operations -+ * won't access memory out of bounds. -+ */ -+ if ((ubi->vid_hdr_shift + UBI_VID_HDR_SIZE) > ubi->vid_hdr_alsize) { -+ ubi_err(ubi, "Invalid VID header offset %d, VID header shift(%d)" -+ " + VID header size(%zu) > VID header aligned size(%d).", -+ ubi->vid_hdr_offset, ubi->vid_hdr_shift, -+ UBI_VID_HDR_SIZE, ubi->vid_hdr_alsize); -+ return -EINVAL; -+ } -+ - /* Similar for the data offset */ - ubi->leb_start = ubi->vid_hdr_offset + UBI_VID_HDR_SIZE; - ubi->leb_start = ALIGN(ubi->leb_start, ubi->min_io_size); diff --git a/target/linux/generic/backport-5.4/704-v5.6-net-dsa-Get-information-about-stacked-DSA-protocol.patch b/target/linux/generic/backport-5.4/704-v5.6-net-dsa-Get-information-about-stacked-DSA-protocol.patch index 0a05721864..e8a3e67fdb 100644 --- a/target/linux/generic/backport-5.4/704-v5.6-net-dsa-Get-information-about-stacked-DSA-protocol.patch +++ b/target/linux/generic/backport-5.4/704-v5.6-net-dsa-Get-information-about-stacked-DSA-protocol.patch @@ -202,7 +202,7 @@ Signed-off-by: David S. Miller } --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c -@@ -4878,7 +4878,8 @@ static struct mv88e6xxx_chip *mv88e6xxx_ +@@ -4883,7 +4883,8 @@ static struct mv88e6xxx_chip *mv88e6xxx_ } static enum dsa_tag_protocol mv88e6xxx_get_tag_protocol(struct dsa_switch *ds, diff --git a/target/linux/generic/backport-5.4/747-v5.5-net-dsa-mv88e6xxx-Add-support-for-port-mirroring.patch b/target/linux/generic/backport-5.4/747-v5.5-net-dsa-mv88e6xxx-Add-support-for-port-mirroring.patch index 81acdaecd2..6205f83334 100644 --- a/target/linux/generic/backport-5.4/747-v5.5-net-dsa-mv88e6xxx-Add-support-for-port-mirroring.patch +++ b/target/linux/generic/backport-5.4/747-v5.5-net-dsa-mv88e6xxx-Add-support-for-port-mirroring.patch @@ -25,7 +25,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c -@@ -4929,6 +4929,80 @@ static int mv88e6xxx_port_mdb_del(struct +@@ -4934,6 +4934,80 @@ static int mv88e6xxx_port_mdb_del(struct return err; } @@ -106,7 +106,7 @@ Signed-off-by: David S. Miller static int mv88e6xxx_port_egress_floods(struct dsa_switch *ds, int port, bool unicast, bool multicast) { -@@ -4983,6 +5057,8 @@ static const struct dsa_switch_ops mv88e +@@ -4988,6 +5062,8 @@ static const struct dsa_switch_ops mv88e .port_mdb_prepare = mv88e6xxx_port_mdb_prepare, .port_mdb_add = mv88e6xxx_port_mdb_add, .port_mdb_del = mv88e6xxx_port_mdb_del, diff --git a/target/linux/generic/backport-5.4/748-v5.5-net-dsa-mv88e6xxx-fix-broken-if-statement-because-of.patch b/target/linux/generic/backport-5.4/748-v5.5-net-dsa-mv88e6xxx-fix-broken-if-statement-because-of.patch index 9985e1cf56..035e3634a2 100644 --- a/target/linux/generic/backport-5.4/748-v5.5-net-dsa-mv88e6xxx-fix-broken-if-statement-because-of.patch +++ b/target/linux/generic/backport-5.4/748-v5.5-net-dsa-mv88e6xxx-fix-broken-if-statement-because-of.patch @@ -19,7 +19,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c -@@ -4996,7 +4996,7 @@ static void mv88e6xxx_port_mirror_del(st +@@ -5001,7 +5001,7 @@ static void mv88e6xxx_port_mirror_del(st if (chip->info->ops->set_egress_port(chip, direction, dsa_upstream_port(ds, diff --git a/target/linux/generic/hack-5.4/661-use_fq_codel_by_default.patch b/target/linux/generic/hack-5.4/661-use_fq_codel_by_default.patch index 64d7684420..f52db97ff4 100644 --- a/target/linux/generic/hack-5.4/661-use_fq_codel_by_default.patch +++ b/target/linux/generic/hack-5.4/661-use_fq_codel_by_default.patch @@ -44,7 +44,7 @@ Signed-off-by: Felix Fietkau device, it has to decide which ones to send first, which ones to --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c -@@ -2283,7 +2283,7 @@ static int __init pktsched_init(void) +@@ -2286,7 +2286,7 @@ static int __init pktsched_init(void) return err; } diff --git a/target/linux/generic/hack-5.4/711-net-dsa-mv88e6xxx-disable-ATU-violation.patch b/target/linux/generic/hack-5.4/711-net-dsa-mv88e6xxx-disable-ATU-violation.patch index 1da388c862..2344db3bcb 100644 --- a/target/linux/generic/hack-5.4/711-net-dsa-mv88e6xxx-disable-ATU-violation.patch +++ b/target/linux/generic/hack-5.4/711-net-dsa-mv88e6xxx-disable-ATU-violation.patch @@ -1,6 +1,6 @@ --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c -@@ -2492,6 +2492,9 @@ static int mv88e6xxx_setup_port(struct m +@@ -2497,6 +2497,9 @@ static int mv88e6xxx_setup_port(struct m if (dsa_is_cpu_port(ds, port)) reg = 0; diff --git a/target/linux/generic/hack-5.4/904-debloat_dma_buf.patch b/target/linux/generic/hack-5.4/904-debloat_dma_buf.patch index 76032d9b82..5d4f37e070 100644 --- a/target/linux/generic/hack-5.4/904-debloat_dma_buf.patch +++ b/target/linux/generic/hack-5.4/904-debloat_dma_buf.patch @@ -54,7 +54,7 @@ Signed-off-by: Felix Fietkau +MODULE_LICENSE("GPL"); --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -2770,6 +2770,7 @@ int wake_up_state(struct task_struct *p, +@@ -2773,6 +2773,7 @@ int wake_up_state(struct task_struct *p, { return try_to_wake_up(p, state, 0); } diff --git a/target/linux/generic/hack-5.4/993-usb-serial-option-add-u9300.patch b/target/linux/generic/hack-5.4/993-usb-serial-option-add-u9300.patch index 698eea8a99..9122d85183 100644 --- a/target/linux/generic/hack-5.4/993-usb-serial-option-add-u9300.patch +++ b/target/linux/generic/hack-5.4/993-usb-serial-option-add-u9300.patch @@ -1,6 +1,6 @@ --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c -@@ -1366,6 +1366,7 @@ static const struct usb_device_id produc +@@ -1367,6 +1367,7 @@ static const struct usb_device_id produc {QMI_FIXED_INTF(0x03f0, 0x9d1d, 1)}, /* HP lt4120 Snapdragon X5 LTE */ {QMI_FIXED_INTF(0x22de, 0x9061, 3)}, /* WeTelecom WPD-600N */ {QMI_QUIRK_SET_DTR(0x1e0e, 0x9001, 5)}, /* SIMCom 7100E, 7230E, 7600E ++ */ diff --git a/target/linux/generic/pending-5.4/760-net-dsa-mv88e6xxx-fix-vlan-setup.patch b/target/linux/generic/pending-5.4/760-net-dsa-mv88e6xxx-fix-vlan-setup.patch index a49b48f744..c1ce9f066a 100644 --- a/target/linux/generic/pending-5.4/760-net-dsa-mv88e6xxx-fix-vlan-setup.patch +++ b/target/linux/generic/pending-5.4/760-net-dsa-mv88e6xxx-fix-vlan-setup.patch @@ -17,7 +17,7 @@ Signed-off-by: DENG Qingfang --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c -@@ -2663,6 +2663,7 @@ static int mv88e6xxx_setup(struct dsa_sw +@@ -2668,6 +2668,7 @@ static int mv88e6xxx_setup(struct dsa_sw chip->ds = ds; ds->slave_mii_bus = mv88e6xxx_default_mdio_bus(chip); diff --git a/target/linux/generic/pending-5.4/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch b/target/linux/generic/pending-5.4/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch index dc9e61eb9d..a9b7d784af 100644 --- a/target/linux/generic/pending-5.4/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch +++ b/target/linux/generic/pending-5.4/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch @@ -17,7 +17,7 @@ Signed-off-by: Tobias Waldekranz --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c -@@ -5083,6 +5083,7 @@ static int mv88e6xxx_register_switch(str +@@ -5088,6 +5088,7 @@ static int mv88e6xxx_register_switch(str ds->ops = &mv88e6xxx_switch_ops; ds->ageing_time_min = chip->info->age_time_coeff; ds->ageing_time_max = chip->info->age_time_coeff * U8_MAX; diff --git a/target/linux/layerscape/patches-5.4/819-uart-0001-tty-serial-lpuart-add-power-domain-support.patch b/target/linux/layerscape/patches-5.4/819-uart-0001-tty-serial-lpuart-add-power-domain-support.patch index 9050a4df75..ab1ae4c394 100644 --- a/target/linux/layerscape/patches-5.4/819-uart-0001-tty-serial-lpuart-add-power-domain-support.patch +++ b/target/linux/layerscape/patches-5.4/819-uart-0001-tty-serial-lpuart-add-power-domain-support.patch @@ -27,7 +27,7 @@ Signed-off-by: Fugang Duan #include #include #include -@@ -2420,6 +2422,54 @@ static struct uart_driver lpuart_reg = { +@@ -2426,6 +2428,54 @@ static struct uart_driver lpuart_reg = { .cons = LPUART_CONSOLE, }; @@ -82,7 +82,7 @@ Signed-off-by: Fugang Duan static int lpuart_probe(struct platform_device *pdev) { const struct of_device_id *of_id = of_match_device(lpuart_dt_ids, -@@ -2457,6 +2507,10 @@ static int lpuart_probe(struct platform_ +@@ -2463,6 +2513,10 @@ static int lpuart_probe(struct platform_ sport->port.rs485_config = lpuart_config_rs485; diff --git a/target/linux/layerscape/patches-5.4/819-uart-0002-tty-serial-fsl_lpuart-add-modem-device-reset.patch b/target/linux/layerscape/patches-5.4/819-uart-0002-tty-serial-fsl_lpuart-add-modem-device-reset.patch index 9427ed667c..0703fcb606 100644 --- a/target/linux/layerscape/patches-5.4/819-uart-0002-tty-serial-fsl_lpuart-add-modem-device-reset.patch +++ b/target/linux/layerscape/patches-5.4/819-uart-0002-tty-serial-fsl_lpuart-add-modem-device-reset.patch @@ -20,7 +20,7 @@ Signed-off-by: Fugang Duan #include #include #include -@@ -1572,8 +1573,17 @@ static void lpuart32_configure(struct lp +@@ -1578,8 +1579,17 @@ static void lpuart32_configure(struct lp static int lpuart32_startup(struct uart_port *port) { struct lpuart_port *sport = container_of(port, struct lpuart_port, port); diff --git a/target/linux/layerscape/patches-5.4/819-uart-0003-tty-serial-fsl_lpuart-add-magic-SysRq-support.patch b/target/linux/layerscape/patches-5.4/819-uart-0003-tty-serial-fsl_lpuart-add-magic-SysRq-support.patch index f1d110b69b..d5b06ee949 100644 --- a/target/linux/layerscape/patches-5.4/819-uart-0003-tty-serial-fsl_lpuart-add-magic-SysRq-support.patch +++ b/target/linux/layerscape/patches-5.4/819-uart-0003-tty-serial-fsl_lpuart-add-magic-SysRq-support.patch @@ -12,7 +12,7 @@ Signed-off-by: Fugang Duan --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c -@@ -928,7 +928,12 @@ static void lpuart32_rxint(struct lpuart +@@ -934,7 +934,12 @@ static void lpuart32_rxint(struct lpuart */ sr = lpuart32_read(&sport->port, UARTSTAT); rx = lpuart32_read(&sport->port, UARTDATA); diff --git a/target/linux/layerscape/patches-5.4/819-uart-0005-tty-serial-fsl_lpuart-enable-dma-mode-for-imx8qxp.patch b/target/linux/layerscape/patches-5.4/819-uart-0005-tty-serial-fsl_lpuart-enable-dma-mode-for-imx8qxp.patch index 23c99d19cf..6b6458d440 100644 --- a/target/linux/layerscape/patches-5.4/819-uart-0005-tty-serial-fsl_lpuart-enable-dma-mode-for-imx8qxp.patch +++ b/target/linux/layerscape/patches-5.4/819-uart-0005-tty-serial-fsl_lpuart-enable-dma-mode-for-imx8qxp.patch @@ -124,7 +124,7 @@ Signed-off-by: Fugang Duan static inline bool is_layerscape_lpuart(struct lpuart_port *sport) { -@@ -1008,19 +1031,15 @@ static irqreturn_t lpuart32_int(int irq, +@@ -1014,19 +1037,15 @@ static irqreturn_t lpuart32_int(int irq, if ((sts & UARTSTAT_TDRE) && !sport->lpuart_dma_tx_use) lpuart32_txint(sport); @@ -148,7 +148,7 @@ Signed-off-by: Fugang Duan if (lpuart_is_32(sport)) { unsigned long sr = lpuart32_read(&sport->port, UARTSTAT); -@@ -1072,8 +1091,21 @@ static void lpuart_copy_rx_to_tty(struct +@@ -1078,8 +1097,21 @@ static void lpuart_copy_rx_to_tty(struct writeb(cr2, sport->port.membase + UARTCR2); } } @@ -171,7 +171,7 @@ Signed-off-by: Fugang Duan spin_lock_irqsave(&sport->port.lock, flags); -@@ -1136,7 +1168,33 @@ static void lpuart_copy_rx_to_tty(struct +@@ -1142,7 +1174,33 @@ static void lpuart_copy_rx_to_tty(struct spin_unlock_irqrestore(&sport->port.lock, flags); tty_flip_buffer_push(port); @@ -206,7 +206,7 @@ Signed-off-by: Fugang Duan } static void lpuart_dma_rx_complete(void *arg) -@@ -1144,6 +1202,8 @@ static void lpuart_dma_rx_complete(void +@@ -1150,6 +1208,8 @@ static void lpuart_dma_rx_complete(void struct lpuart_port *sport = arg; lpuart_copy_rx_to_tty(sport); @@ -215,7 +215,7 @@ Signed-off-by: Fugang Duan } static void lpuart_timer_func(struct timer_list *t) -@@ -1151,13 +1211,78 @@ static void lpuart_timer_func(struct tim +@@ -1157,13 +1217,78 @@ static void lpuart_timer_func(struct tim struct lpuart_port *sport = from_timer(sport, t, lpuart_timer); lpuart_copy_rx_to_tty(sport); @@ -298,7 +298,7 @@ Signed-off-by: Fugang Duan int bits, baud; struct tty_port *port = &sport->port.state->port; struct tty_struct *tty = port->tty; -@@ -1177,6 +1302,18 @@ static inline int lpuart_start_rx_dma(st +@@ -1183,6 +1308,18 @@ static inline int lpuart_start_rx_dma(st sport->rx_dma_rng_buf_len = (1 << (fls(sport->rx_dma_rng_buf_len) - 1)); if (sport->rx_dma_rng_buf_len < 16) sport->rx_dma_rng_buf_len = 16; @@ -317,7 +317,7 @@ Signed-off-by: Fugang Duan ring->buf = kzalloc(sport->rx_dma_rng_buf_len, GFP_ATOMIC); if (!ring->buf) -@@ -1202,32 +1339,7 @@ static inline int lpuart_start_rx_dma(st +@@ -1208,32 +1345,7 @@ static inline int lpuart_start_rx_dma(st return ret; } @@ -351,7 +351,7 @@ Signed-off-by: Fugang Duan } static void lpuart_dma_rx_free(struct uart_port *port) -@@ -1433,8 +1545,10 @@ static void lpuart_setup_watermark(struc +@@ -1439,8 +1551,10 @@ static void lpuart_setup_watermark(struc writeb(UARTSFIFO_RXUF, sport->port.membase + UARTSFIFO); } @@ -363,7 +363,7 @@ Signed-off-by: Fugang Duan /* Restore cr2 */ writeb(cr2_saved, sport->port.membase + UARTCR2); -@@ -1455,6 +1569,7 @@ static void lpuart32_setup_watermark(str +@@ -1461,6 +1575,7 @@ static void lpuart32_setup_watermark(str { unsigned long val, ctrl; unsigned long ctrl_saved; @@ -371,7 +371,7 @@ Signed-off-by: Fugang Duan ctrl = lpuart32_read(&sport->port, UARTCTRL); ctrl_saved = ctrl; -@@ -1466,12 +1581,26 @@ static void lpuart32_setup_watermark(str +@@ -1472,12 +1587,26 @@ static void lpuart32_setup_watermark(str val = lpuart32_read(&sport->port, UARTFIFO); val |= UARTFIFO_TXFE | UARTFIFO_RXFE; val |= UARTFIFO_TXFLUSH | UARTFIFO_RXFLUSH; @@ -399,7 +399,7 @@ Signed-off-by: Fugang Duan /* Restore cr2 */ lpuart32_write(&sport->port, ctrl_saved, UARTCTRL); } -@@ -1483,17 +1612,29 @@ static void lpuart32_setup_watermark_ena +@@ -1489,17 +1618,29 @@ static void lpuart32_setup_watermark_ena lpuart32_setup_watermark(sport); temp = lpuart32_read(&sport->port, UARTCTRL); @@ -430,7 +430,7 @@ Signed-off-by: Fugang Duan static void lpuart_tx_dma_startup(struct lpuart_port *sport) { u32 uartbaud; -@@ -1557,19 +1698,23 @@ static int lpuart_startup(struct uart_po +@@ -1563,19 +1704,23 @@ static int lpuart_startup(struct uart_po return 0; } @@ -461,7 +461,7 @@ Signed-off-by: Fugang Duan if (!sport->lpuart_dma_tx_use) temp |= UARTCTRL_TIE; lpuart32_write(&sport->port, temp, UARTCTRL); -@@ -1613,12 +1758,12 @@ static int lpuart32_startup(struct uart_ +@@ -1619,12 +1764,12 @@ static int lpuart32_startup(struct uart_ spin_lock_irqsave(&sport->port.lock, flags); @@ -476,7 +476,7 @@ Signed-off-by: Fugang Duan lpuart32_configure(sport); spin_unlock_irqrestore(&sport->port.lock, flags); -@@ -1628,7 +1773,7 @@ static int lpuart32_startup(struct uart_ +@@ -1634,7 +1779,7 @@ static int lpuart32_startup(struct uart_ static void lpuart_dma_shutdown(struct lpuart_port *sport) { if (sport->lpuart_dma_rx_use) { @@ -485,7 +485,7 @@ Signed-off-by: Fugang Duan lpuart_dma_rx_free(&sport->port); sport->lpuart_dma_rx_use = false; } -@@ -1671,11 +1816,22 @@ static void lpuart32_shutdown(struct uar +@@ -1677,11 +1822,22 @@ static void lpuart32_shutdown(struct uar spin_lock_irqsave(&port->lock, flags); @@ -510,7 +510,7 @@ Signed-off-by: Fugang Duan spin_unlock_irqrestore(&port->lock, flags); -@@ -1772,10 +1928,10 @@ lpuart_set_termios(struct uart_port *por +@@ -1778,10 +1934,10 @@ lpuart_set_termios(struct uart_port *por * baud rate and restart Rx DMA path. * * Since timer function acqures sport->port.lock, need to stop before @@ -523,7 +523,7 @@ Signed-off-by: Fugang Duan lpuart_dma_rx_free(&sport->port); } -@@ -1987,10 +2143,10 @@ lpuart32_set_termios(struct uart_port *p +@@ -1993,10 +2149,10 @@ lpuart32_set_termios(struct uart_port *p * baud rate and restart Rx DMA path. * * Since timer function acqures sport->port.lock, need to stop before @@ -536,7 +536,7 @@ Signed-off-by: Fugang Duan lpuart_dma_rx_free(&sport->port); } -@@ -2509,6 +2665,10 @@ static int lpuart_probe(struct platform_ +@@ -2515,6 +2671,10 @@ static int lpuart_probe(struct platform_ sport->port.dev = &pdev->dev; sport->port.type = PORT_LPUART; sport->devtype = sdata->devtype; @@ -547,7 +547,7 @@ Signed-off-by: Fugang Duan ret = platform_get_irq(pdev, 0); if (ret < 0) return ret; -@@ -2659,7 +2819,7 @@ static int lpuart_suspend(struct device +@@ -2665,7 +2825,7 @@ static int lpuart_suspend(struct device * Rx DMA path before suspend and start Rx DMA path on resume. */ if (irq_wake) { diff --git a/target/linux/layerscape/patches-5.4/819-uart-0006-tty-serial-fsl_lpuart-enable-loopback-mode.patch b/target/linux/layerscape/patches-5.4/819-uart-0006-tty-serial-fsl_lpuart-enable-loopback-mode.patch index 7fbd1943b4..371527e77a 100644 --- a/target/linux/layerscape/patches-5.4/819-uart-0006-tty-serial-fsl_lpuart-enable-loopback-mode.patch +++ b/target/linux/layerscape/patches-5.4/819-uart-0006-tty-serial-fsl_lpuart-enable-loopback-mode.patch @@ -12,7 +12,7 @@ Signed-off-by: Fugang Duan --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c -@@ -1474,6 +1474,14 @@ static void lpuart32_set_mctrl(struct ua +@@ -1480,6 +1480,14 @@ static void lpuart32_set_mctrl(struct ua temp |= UARTMODIR_TXCTSE; lpuart32_write(port, temp, UARTMODIR); diff --git a/target/linux/layerscape/patches-5.4/819-uart-0008-MLK-21445-serial-fsl_lpuart-do-HW-reset-for-communic.patch b/target/linux/layerscape/patches-5.4/819-uart-0008-MLK-21445-serial-fsl_lpuart-do-HW-reset-for-communic.patch index 3849ac2225..d25fde1d9c 100644 --- a/target/linux/layerscape/patches-5.4/819-uart-0008-MLK-21445-serial-fsl_lpuart-do-HW-reset-for-communic.patch +++ b/target/linux/layerscape/patches-5.4/819-uart-0008-MLK-21445-serial-fsl_lpuart-do-HW-reset-for-communic.patch @@ -105,7 +105,7 @@ Signed-off-by: Shrikant Bobade static void lpuart_stop_tx(struct uart_port *port) { unsigned char temp; -@@ -2752,6 +2794,10 @@ static int lpuart_probe(struct platform_ +@@ -2758,6 +2800,10 @@ static int lpuart_probe(struct platform_ if (ret) goto failed_attach_port; @@ -116,7 +116,7 @@ Signed-off-by: Shrikant Bobade uart_get_rs485_mode(&pdev->dev, &sport->port.rs485); if (sport->port.rs485.flags & SER_RS485_RX_DURING_TX) -@@ -2775,6 +2821,8 @@ static int lpuart_probe(struct platform_ +@@ -2781,6 +2827,8 @@ static int lpuart_probe(struct platform_ return 0; diff --git a/target/linux/layerscape/patches-5.4/819-uart-0009-MLK-17133-02-tty-serial-lpuart-add-runtime-pm-suppor.patch b/target/linux/layerscape/patches-5.4/819-uart-0009-MLK-17133-02-tty-serial-lpuart-add-runtime-pm-suppor.patch index 201e792681..0c194934d2 100644 --- a/target/linux/layerscape/patches-5.4/819-uart-0009-MLK-17133-02-tty-serial-lpuart-add-runtime-pm-suppor.patch +++ b/target/linux/layerscape/patches-5.4/819-uart-0009-MLK-17133-02-tty-serial-lpuart-add-runtime-pm-suppor.patch @@ -43,7 +43,7 @@ Reviewed-by: Robin Gong /* return TIOCSER_TEMT when transmitter is not busy */ static unsigned int lpuart_tx_empty(struct uart_port *port) { -@@ -2309,6 +2324,7 @@ static const struct uart_ops lpuart_pops +@@ -2315,6 +2330,7 @@ static const struct uart_ops lpuart_pops .break_ctl = lpuart_break_ctl, .startup = lpuart_startup, .shutdown = lpuart_shutdown, @@ -51,7 +51,7 @@ Reviewed-by: Robin Gong .set_termios = lpuart_set_termios, .type = lpuart_type, .request_port = lpuart_request_port, -@@ -2333,6 +2349,7 @@ static const struct uart_ops lpuart32_po +@@ -2339,6 +2355,7 @@ static const struct uart_ops lpuart32_po .break_ctl = lpuart32_break_ctl, .startup = lpuart32_startup, .shutdown = lpuart32_shutdown, @@ -59,7 +59,7 @@ Reviewed-by: Robin Gong .set_termios = lpuart32_set_termios, .type = lpuart_type, .request_port = lpuart_request_port, -@@ -2790,6 +2807,11 @@ static int lpuart_probe(struct platform_ +@@ -2796,6 +2813,11 @@ static int lpuart_probe(struct platform_ if (ret) goto failed_irq_request; @@ -71,7 +71,7 @@ Reviewed-by: Robin Gong ret = uart_add_one_port(&lpuart_reg, &sport->port); if (ret) goto failed_attach_port; -@@ -2824,6 +2846,9 @@ static int lpuart_probe(struct platform_ +@@ -2830,6 +2852,9 @@ static int lpuart_probe(struct platform_ failed_reset: uart_remove_one_port(&lpuart_reg, &sport->port); failed_attach_port: @@ -81,7 +81,7 @@ Reviewed-by: Robin Gong failed_irq_request: lpuart_disable_clks(sport); return ret; -@@ -2843,15 +2868,41 @@ static int lpuart_remove(struct platform +@@ -2849,15 +2874,41 @@ static int lpuart_remove(struct platform if (sport->dma_rx_chan) dma_release_channel(sport->dma_rx_chan); @@ -123,7 +123,7 @@ Reviewed-by: Robin Gong if (lpuart_is_32(sport)) { /* disable Rx/Tx and interrupts */ -@@ -2865,10 +2916,14 @@ static int lpuart_suspend(struct device +@@ -2871,10 +2922,14 @@ static int lpuart_suspend(struct device writeb(temp, sport->port.membase + UARTCR2); } @@ -138,7 +138,7 @@ Reviewed-by: Robin Gong if (sport->lpuart_dma_rx_use) { /* -@@ -2899,9 +2954,6 @@ static int lpuart_suspend(struct device +@@ -2905,9 +2960,6 @@ static int lpuart_suspend(struct device dmaengine_terminate_all(sport->dma_tx_chan); } @@ -148,7 +148,7 @@ Reviewed-by: Robin Gong return 0; } -@@ -2909,9 +2961,11 @@ static int lpuart_resume(struct device * +@@ -2915,9 +2967,11 @@ static int lpuart_resume(struct device * { struct lpuart_port *sport = dev_get_drvdata(dev); bool irq_wake = irqd_is_wakeup_set(irq_get_irq_data(sport->port.irq)); @@ -162,7 +162,7 @@ Reviewed-by: Robin Gong if (lpuart_is_32(sport)) lpuart32_setup_watermark_enable(sport); -@@ -2932,13 +2986,23 @@ static int lpuart_resume(struct device * +@@ -2938,13 +2992,23 @@ static int lpuart_resume(struct device * if (lpuart_is_32(sport)) lpuart32_configure(sport); @@ -188,7 +188,7 @@ Reviewed-by: Robin Gong static struct platform_driver lpuart_driver = { .probe = lpuart_probe, -@@ -2946,7 +3010,7 @@ static struct platform_driver lpuart_dri +@@ -2952,7 +3016,7 @@ static struct platform_driver lpuart_dri .driver = { .name = "fsl-lpuart", .of_match_table = lpuart_dt_ids, diff --git a/target/linux/layerscape/patches-5.4/819-uart-0010-tty-serial-lpuart-enable-wakeup-source-for-lpuart.patch b/target/linux/layerscape/patches-5.4/819-uart-0010-tty-serial-lpuart-enable-wakeup-source-for-lpuart.patch index be1a5675a6..4c75e95fef 100644 --- a/target/linux/layerscape/patches-5.4/819-uart-0010-tty-serial-lpuart-enable-wakeup-source-for-lpuart.patch +++ b/target/linux/layerscape/patches-5.4/819-uart-0010-tty-serial-lpuart-enable-wakeup-source-for-lpuart.patch @@ -28,7 +28,7 @@ Signed-off-by: Fugang Duan #include #include #include -@@ -1739,10 +1740,23 @@ static void lpuart_rx_dma_startup(struct +@@ -1745,10 +1746,23 @@ static void lpuart_rx_dma_startup(struct } } @@ -53,7 +53,7 @@ Signed-off-by: Fugang Duan unsigned char temp; /* determine FIFO size and enable FIFO mode */ -@@ -1755,14 +1769,7 @@ static int lpuart_startup(struct uart_po +@@ -1761,14 +1775,7 @@ static int lpuart_startup(struct uart_po sport->rxfifo_size = UARTFIFO_DEPTH((temp >> UARTPFIFO_RXSIZE_OFF) & UARTPFIFO_FIFOSIZE_MASK); @@ -69,7 +69,7 @@ Signed-off-by: Fugang Duan return 0; } -@@ -1789,11 +1796,27 @@ static void lpuart32_configure(struct lp +@@ -1795,11 +1802,27 @@ static void lpuart32_configure(struct lp lpuart32_write(&sport->port, temp, UARTCTRL); } @@ -98,7 +98,7 @@ Signed-off-by: Fugang Duan unsigned long temp; int ret; -@@ -1825,17 +1848,8 @@ static int lpuart32_startup(struct uart_ +@@ -1831,17 +1854,8 @@ static int lpuart32_startup(struct uart_ sport->port.fifosize = sport->txfifo_size; } @@ -117,7 +117,7 @@ Signed-off-by: Fugang Duan return 0; } -@@ -2893,108 +2907,205 @@ static int lpuart_runtime_resume(struct +@@ -2899,108 +2913,205 @@ static int lpuart_runtime_resume(struct return lpuart_enable_clks(sport); }; diff --git a/target/linux/layerscape/patches-5.4/819-uart-0011-serial-fsl_lpuart-enable-two-stop-bits.patch b/target/linux/layerscape/patches-5.4/819-uart-0011-serial-fsl_lpuart-enable-two-stop-bits.patch index b32f946b01..6896c63be4 100644 --- a/target/linux/layerscape/patches-5.4/819-uart-0011-serial-fsl_lpuart-enable-two-stop-bits.patch +++ b/target/linux/layerscape/patches-5.4/819-uart-0011-serial-fsl_lpuart-enable-two-stop-bits.patch @@ -14,7 +14,7 @@ Signed-off-by: Fugang Duan --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c -@@ -2154,11 +2154,12 @@ lpuart32_set_termios(struct uart_port *p +@@ -2160,11 +2160,12 @@ lpuart32_set_termios(struct uart_port *p { struct lpuart_port *sport = container_of(port, struct lpuart_port, port); unsigned long flags; @@ -28,7 +28,7 @@ Signed-off-by: Fugang Duan modem = lpuart32_read(&sport->port, UARTMODIR); /* * only support CS8 and CS7, and for CS7 must enable PE. -@@ -2195,7 +2196,9 @@ lpuart32_set_termios(struct uart_port *p +@@ -2201,7 +2202,9 @@ lpuart32_set_termios(struct uart_port *p } if (termios->c_cflag & CSTOPB) @@ -39,7 +39,7 @@ Signed-off-by: Fugang Duan /* parity must be enabled when CS7 to match 8-bits format */ if ((termios->c_cflag & CSIZE) == CS7) -@@ -2272,6 +2275,7 @@ lpuart32_set_termios(struct uart_port *p +@@ -2278,6 +2281,7 @@ lpuart32_set_termios(struct uart_port *p lpuart32_write(&sport->port, old_ctrl & ~(UARTCTRL_TE | UARTCTRL_RE), UARTCTRL); diff --git a/target/linux/layerscape/patches-5.4/819-uart-0013-LF-484-tty-serial-lpuart-support-UPIO_MEM32-for-lpua.patch b/target/linux/layerscape/patches-5.4/819-uart-0013-LF-484-tty-serial-lpuart-support-UPIO_MEM32-for-lpua.patch index cac8eb8d7f..10dee071ad 100644 --- a/target/linux/layerscape/patches-5.4/819-uart-0013-LF-484-tty-serial-lpuart-support-UPIO_MEM32-for-lpua.patch +++ b/target/linux/layerscape/patches-5.4/819-uart-0013-LF-484-tty-serial-lpuart-support-UPIO_MEM32-for-lpua.patch @@ -24,7 +24,7 @@ Signed-off-by: Peng Fan --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c -@@ -2643,7 +2643,9 @@ static int __init lpuart32_early_console +@@ -2649,7 +2649,9 @@ static int __init lpuart32_early_console if (!device->port.membase) return -ENODEV; diff --git a/target/linux/layerscape/patches-5.4/820-usb-0015-MLK-17380-4-usb-host-xhci-add-EH-SINGLE_STEP_SET_FEA.patch b/target/linux/layerscape/patches-5.4/820-usb-0015-MLK-17380-4-usb-host-xhci-add-EH-SINGLE_STEP_SET_FEA.patch index 5730adcd64..8e7131fe70 100644 --- a/target/linux/layerscape/patches-5.4/820-usb-0015-MLK-17380-4-usb-host-xhci-add-EH-SINGLE_STEP_SET_FEA.patch +++ b/target/linux/layerscape/patches-5.4/820-usb-0015-MLK-17380-4-usb-host-xhci-add-EH-SINGLE_STEP_SET_FEA.patch @@ -174,7 +174,7 @@ Signed-off-by: Peter Chen * bursts that are required to move all packets in this TD. Only SuperSpeed --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c -@@ -5430,6 +5430,7 @@ static const struct hc_driver xhci_hc_dr +@@ -5434,6 +5434,7 @@ static const struct hc_driver xhci_hc_dr .disable_usb3_lpm_timeout = xhci_disable_usb3_lpm_timeout, .find_raw_port_number = xhci_find_raw_port_number, .clear_tt_buffer_complete = xhci_clear_tt_buffer_complete, diff --git a/target/linux/layerscape/patches-5.4/820-usb-0016-MLK-16735-usb-host-add-XHCI_CDNS_HOST-flag.patch b/target/linux/layerscape/patches-5.4/820-usb-0016-MLK-16735-usb-host-add-XHCI_CDNS_HOST-flag.patch index 7ca50bfb32..c9f926f4b4 100644 --- a/target/linux/layerscape/patches-5.4/820-usb-0016-MLK-16735-usb-host-add-XHCI_CDNS_HOST-flag.patch +++ b/target/linux/layerscape/patches-5.4/820-usb-0016-MLK-16735-usb-host-add-XHCI_CDNS_HOST-flag.patch @@ -21,7 +21,7 @@ Signed-off-by: Peter Chen --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c -@@ -195,7 +195,7 @@ int xhci_reset(struct xhci_hcd *xhci, u6 +@@ -196,7 +196,7 @@ int xhci_reset(struct xhci_hcd *xhci, u6 * Without this delay, the subsequent HC register access, * may result in a system hang very rarely. */ diff --git a/target/linux/layerscape/patches-5.4/820-usb-0018-MLK-18794-1-usb-host-xhci-add-.bus_suspend-override.patch b/target/linux/layerscape/patches-5.4/820-usb-0018-MLK-18794-1-usb-host-xhci-add-.bus_suspend-override.patch index 7d82cd64ee..54da44261f 100644 --- a/target/linux/layerscape/patches-5.4/820-usb-0018-MLK-18794-1-usb-host-xhci-add-.bus_suspend-override.patch +++ b/target/linux/layerscape/patches-5.4/820-usb-0018-MLK-18794-1-usb-host-xhci-add-.bus_suspend-override.patch @@ -24,7 +24,7 @@ Signed-off-by: Peter Chen --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c -@@ -5453,6 +5453,8 @@ void xhci_init_driver(struct hc_driver * +@@ -5457,6 +5457,8 @@ void xhci_init_driver(struct hc_driver * drv->reset_bandwidth = over->reset_bandwidth; if (over->update_hub_device) drv->update_hub_device = over->update_hub_device; diff --git a/target/linux/mediatek/patches-5.4/0600-net-phylink-propagate-resolved-link-config-via-mac_l.patch b/target/linux/mediatek/patches-5.4/0600-net-phylink-propagate-resolved-link-config-via-mac_l.patch index 13a9a51e34..f75c6b7d4d 100644 --- a/target/linux/mediatek/patches-5.4/0600-net-phylink-propagate-resolved-link-config-via-mac_l.patch +++ b/target/linux/mediatek/patches-5.4/0600-net-phylink-propagate-resolved-link-config-via-mac_l.patch @@ -52,7 +52,7 @@ Signed-off-by: David S. Miller when making changes to the MAC configuration. This means the --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -3655,9 +3655,11 @@ static void mvneta_mac_link_down(struct +@@ -3675,9 +3675,11 @@ static void mvneta_mac_link_down(struct mvneta_set_eee(pp, false); } diff --git a/target/linux/mvebu/patches-5.4/003-net-mvneta-introduce-mvneta_update_stats-routine.patch b/target/linux/mvebu/patches-5.4/003-net-mvneta-introduce-mvneta_update_stats-routine.patch index f6ce6163cf..cd34764c63 100644 --- a/target/linux/mvebu/patches-5.4/003-net-mvneta-introduce-mvneta_update_stats-routine.patch +++ b/target/linux/mvebu/patches-5.4/003-net-mvneta-introduce-mvneta_update_stats-routine.patch @@ -15,7 +15,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -1913,6 +1913,23 @@ static void mvneta_rxq_drop_pkts(struct +@@ -1925,6 +1925,23 @@ static void mvneta_rxq_drop_pkts(struct } } @@ -39,7 +39,7 @@ Signed-off-by: David S. Miller static inline int mvneta_rx_refill_queue(struct mvneta_port *pp, struct mvneta_rx_queue *rxq) { -@@ -2093,14 +2110,8 @@ static int mvneta_rx_swbm(struct napi_st +@@ -2105,14 +2122,8 @@ static int mvneta_rx_swbm(struct napi_st rxq->left_size = 0; } @@ -56,7 +56,7 @@ Signed-off-by: David S. Miller /* return some buffers to hardware queue, one at a time is too slow */ refill = mvneta_rx_refill_queue(pp, rxq); -@@ -2223,14 +2234,8 @@ err_drop_frame: +@@ -2235,14 +2246,8 @@ err_drop_frame: napi_gro_receive(napi, skb); } @@ -73,7 +73,7 @@ Signed-off-by: David S. Miller /* Update rxq management counters */ mvneta_rxq_desc_num_update(pp, rxq, rx_done, rx_done); -@@ -2476,7 +2481,6 @@ static netdev_tx_t mvneta_tx(struct sk_b +@@ -2497,7 +2502,6 @@ static netdev_tx_t mvneta_tx(struct sk_b out: if (frags > 0) { @@ -81,7 +81,7 @@ Signed-off-by: David S. Miller struct netdev_queue *nq = netdev_get_tx_queue(dev, txq_id); netdev_tx_sent_queue(nq, len); -@@ -2491,10 +2495,7 @@ out: +@@ -2512,10 +2516,7 @@ out: else txq->pending += frags; diff --git a/target/linux/mvebu/patches-5.4/004-net-mvneta-introduce-page-pool-API-for-sw-buffer-man.patch b/target/linux/mvebu/patches-5.4/004-net-mvneta-introduce-page-pool-API-for-sw-buffer-man.patch index fbcae20f74..09050d55fa 100644 --- a/target/linux/mvebu/patches-5.4/004-net-mvneta-introduce-page-pool-API-for-sw-buffer-man.patch +++ b/target/linux/mvebu/patches-5.4/004-net-mvneta-introduce-page-pool-API-for-sw-buffer-man.patch @@ -43,7 +43,7 @@ Signed-off-by: David S. Miller /* Registers */ #define MVNETA_RXQ_CONFIG_REG(q) (0x1400 + ((q) << 2)) -@@ -607,6 +608,10 @@ struct mvneta_rx_queue { +@@ -621,6 +622,10 @@ struct mvneta_rx_queue { u32 pkts_coal; u32 time_coal; @@ -54,7 +54,7 @@ Signed-off-by: David S. Miller /* Virtual address of the RX buffer */ void **buf_virt_addr; -@@ -1825,23 +1830,21 @@ static int mvneta_rx_refill(struct mvnet +@@ -1837,23 +1842,21 @@ static int mvneta_rx_refill(struct mvnet struct mvneta_rx_queue *rxq, gfp_t gfp_mask) { @@ -86,7 +86,7 @@ Signed-off-by: David S. Miller return 0; } -@@ -1907,10 +1910,12 @@ static void mvneta_rxq_drop_pkts(struct +@@ -1919,10 +1922,12 @@ static void mvneta_rxq_drop_pkts(struct if (!data || !(rx_desc->buf_phys_addr)) continue; @@ -102,7 +102,7 @@ Signed-off-by: David S. Miller } static void -@@ -2047,8 +2052,7 @@ static int mvneta_rx_swbm(struct napi_st +@@ -2059,8 +2064,7 @@ static int mvneta_rx_swbm(struct napi_st skb_add_rx_frag(rxq->skb, frag_num, page, frag_offset, frag_size, PAGE_SIZE); @@ -112,7 +112,7 @@ Signed-off-by: David S. Miller rxq->left_size -= frag_size; } } else { -@@ -2078,9 +2082,7 @@ static int mvneta_rx_swbm(struct napi_st +@@ -2090,9 +2094,7 @@ static int mvneta_rx_swbm(struct napi_st frag_offset, frag_size, PAGE_SIZE); @@ -123,7 +123,7 @@ Signed-off-by: David S. Miller rxq->left_size -= frag_size; } } /* Middle or Last descriptor */ -@@ -2847,11 +2849,54 @@ static int mvneta_poll(struct napi_struc +@@ -2868,11 +2870,54 @@ static int mvneta_poll(struct napi_struc return rx_done; } diff --git a/target/linux/mvebu/patches-5.4/005-net-mvneta-rely-on-build_skb-in-mvneta_rx_swbm-poll-.patch b/target/linux/mvebu/patches-5.4/005-net-mvneta-rely-on-build_skb-in-mvneta_rx_swbm-poll-.patch index 4d9539adbb..390cbf02e9 100644 --- a/target/linux/mvebu/patches-5.4/005-net-mvneta-rely-on-build_skb-in-mvneta_rx_swbm-poll-.patch +++ b/target/linux/mvebu/patches-5.4/005-net-mvneta-rely-on-build_skb-in-mvneta_rx_swbm-poll-.patch @@ -39,7 +39,7 @@ Signed-off-by: David S. Miller #define IS_TSO_HEADER(txq, addr) \ ((addr >= txq->tso_hdrs_phys) && \ (addr < txq->tso_hdrs_phys + txq->size * TSO_HEADER_SIZE)) -@@ -650,7 +655,6 @@ static int txq_number = 8; +@@ -664,7 +669,6 @@ static int txq_number = 8; static int rxq_def; static int rx_copybreak __read_mostly = 256; @@ -47,7 +47,7 @@ Signed-off-by: David S. Miller /* HW BM need that each port be identify by a unique ID */ static int global_port_id; -@@ -1842,7 +1846,7 @@ static int mvneta_rx_refill(struct mvnet +@@ -1854,7 +1858,7 @@ static int mvneta_rx_refill(struct mvnet phys_addr = page_pool_get_dma_addr(page) + pp->rx_offset_correction; dma_dir = page_pool_get_dma_dir(rxq->page_pool); dma_sync_single_for_device(pp->dev->dev.parent, phys_addr, @@ -56,7 +56,7 @@ Signed-off-by: David S. Miller mvneta_rx_desc_fill(rx_desc, phys_addr, page, rxq); return 0; -@@ -1960,30 +1964,102 @@ int mvneta_rx_refill_queue(struct mvneta +@@ -1972,30 +1976,102 @@ int mvneta_rx_refill_queue(struct mvneta return i; } @@ -169,7 +169,7 @@ Signed-off-by: David S. Miller index = rx_desc - rxq->descs; page = (struct page *)rxq->buf_virt_addr[index]; -@@ -1991,100 +2067,30 @@ static int mvneta_rx_swbm(struct napi_st +@@ -2003,100 +2079,30 @@ static int mvneta_rx_swbm(struct napi_st /* Prefetch header */ prefetch(data); @@ -275,7 +275,7 @@ Signed-off-by: David S. Miller } /* Middle or Last descriptor */ if (!(rx_status & MVNETA_RXD_LAST_DESC)) -@@ -2109,7 +2115,6 @@ static int mvneta_rx_swbm(struct napi_st +@@ -2121,7 +2127,6 @@ static int mvneta_rx_swbm(struct napi_st /* clean uncomplete skb pointer in queue */ rxq->skb = NULL; @@ -283,7 +283,7 @@ Signed-off-by: David S. Miller } if (rcvd_pkts) -@@ -2970,7 +2975,7 @@ static void mvneta_rxq_hw_init(struct mv +@@ -2991,7 +2996,7 @@ static void mvneta_rxq_hw_init(struct mv /* Set Offset */ mvneta_rxq_offset_set(pp, rxq, 0); mvneta_rxq_buf_size_set(pp, rxq, PAGE_SIZE < SZ_64K ? @@ -292,7 +292,7 @@ Signed-off-by: David S. Miller MVNETA_RX_BUF_SIZE(pp->pkt_size)); mvneta_rxq_bm_disable(pp, rxq); mvneta_rxq_fill(pp, rxq, rxq->size); -@@ -4715,7 +4720,7 @@ static int mvneta_probe(struct platform_ +@@ -4735,7 +4740,7 @@ static int mvneta_probe(struct platform_ SET_NETDEV_DEV(dev, &pdev->dev); pp->id = global_port_id++; diff --git a/target/linux/mvebu/patches-5.4/006-net-mvneta-add-basic-XDP-support.patch b/target/linux/mvebu/patches-5.4/006-net-mvneta-add-basic-XDP-support.patch index 4e42bf9307..04b685deef 100644 --- a/target/linux/mvebu/patches-5.4/006-net-mvneta-add-basic-XDP-support.patch +++ b/target/linux/mvebu/patches-5.4/006-net-mvneta-add-basic-XDP-support.patch @@ -75,7 +75,7 @@ Signed-off-by: David S. Miller /* Core clock */ struct clk *clk; /* AXI clock */ -@@ -1965,10 +1975,50 @@ int mvneta_rx_refill_queue(struct mvneta +@@ -1977,10 +1987,50 @@ int mvneta_rx_refill_queue(struct mvneta } static int @@ -127,7 +127,7 @@ Signed-off-by: David S. Miller { unsigned char *data = page_address(page); int data_len = -MVNETA_MH_SIZE, len; -@@ -1988,7 +2038,26 @@ mvneta_swbm_rx_frame(struct mvneta_port +@@ -2000,7 +2050,26 @@ mvneta_swbm_rx_frame(struct mvneta_port rx_desc->buf_phys_addr, len, dma_dir); @@ -155,7 +155,7 @@ Signed-off-by: David S. Miller if (unlikely(!rxq->skb)) { netdev_err(dev, "Can't allocate skb on queue %d\n", -@@ -1999,8 +2068,9 @@ mvneta_swbm_rx_frame(struct mvneta_port +@@ -2011,8 +2080,9 @@ mvneta_swbm_rx_frame(struct mvneta_port } page_pool_release_page(rxq->page_pool, page); @@ -167,7 +167,7 @@ Signed-off-by: David S. Miller mvneta_rx_csum(pp, rx_desc->status, rxq->skb); rxq->left_size = rx_desc->data_size - len; -@@ -2034,7 +2104,7 @@ mvneta_swbm_add_rx_fragment(struct mvnet +@@ -2046,7 +2116,7 @@ mvneta_swbm_add_rx_fragment(struct mvnet /* refill descriptor with new buffer later */ skb_add_rx_frag(rxq->skb, skb_shinfo(rxq->skb)->nr_frags, @@ -176,7 +176,7 @@ Signed-off-by: David S. Miller PAGE_SIZE); } page_pool_release_page(rxq->page_pool, page); -@@ -2049,11 +2119,18 @@ static int mvneta_rx_swbm(struct napi_st +@@ -2061,11 +2131,18 @@ static int mvneta_rx_swbm(struct napi_st { int rcvd_pkts = 0, rcvd_bytes = 0, rx_proc = 0; struct net_device *dev = pp->dev; @@ -195,7 +195,7 @@ Signed-off-by: David S. Miller /* Fairness NAPI loop */ while (rx_proc < budget && rx_proc < rx_todo) { struct mvneta_rx_desc *rx_desc = mvneta_rxq_next_desc_get(rxq); -@@ -2081,7 +2158,8 @@ static int mvneta_rx_swbm(struct napi_st +@@ -2093,7 +2170,8 @@ static int mvneta_rx_swbm(struct napi_st continue; } @@ -205,7 +205,7 @@ Signed-off-by: David S. Miller if (err) continue; } else { -@@ -2116,6 +2194,10 @@ static int mvneta_rx_swbm(struct napi_st +@@ -2128,6 +2206,10 @@ static int mvneta_rx_swbm(struct napi_st /* clean uncomplete skb pointer in queue */ rxq->skb = NULL; } @@ -216,7 +216,7 @@ Signed-off-by: David S. Miller if (rcvd_pkts) mvneta_update_stats(pp, rcvd_pkts, rcvd_bytes, false); -@@ -2857,13 +2939,14 @@ static int mvneta_poll(struct napi_struc +@@ -2878,13 +2960,14 @@ static int mvneta_poll(struct napi_struc static int mvneta_create_page_pool(struct mvneta_port *pp, struct mvneta_rx_queue *rxq, int size) { @@ -232,7 +232,7 @@ Signed-off-by: David S. Miller }; int err; -@@ -3366,6 +3449,11 @@ static int mvneta_change_mtu(struct net_ +@@ -3386,6 +3469,11 @@ static int mvneta_change_mtu(struct net_ mtu = ALIGN(MVNETA_RX_PKT_SIZE(mtu), 8); } @@ -244,7 +244,7 @@ Signed-off-by: David S. Miller dev->mtu = mtu; if (!netif_running(dev)) { -@@ -4036,6 +4124,47 @@ static int mvneta_ioctl(struct net_devic +@@ -4056,6 +4144,47 @@ static int mvneta_ioctl(struct net_devic return phylink_mii_ioctl(pp->phylink, ifr, cmd); } @@ -292,7 +292,7 @@ Signed-off-by: David S. Miller /* Ethtool methods */ /* Set link ksettings (phy address, speed) for ethtools */ -@@ -4432,6 +4561,7 @@ static const struct net_device_ops mvnet +@@ -4452,6 +4581,7 @@ static const struct net_device_ops mvnet .ndo_fix_features = mvneta_fix_features, .ndo_get_stats64 = mvneta_get_stats64, .ndo_do_ioctl = mvneta_ioctl, @@ -300,7 +300,7 @@ Signed-off-by: David S. Miller }; static const struct ethtool_ops mvneta_eth_tool_ops = { -@@ -4720,7 +4850,7 @@ static int mvneta_probe(struct platform_ +@@ -4740,7 +4870,7 @@ static int mvneta_probe(struct platform_ SET_NETDEV_DEV(dev, &pdev->dev); pp->id = global_port_id++; diff --git a/target/linux/mvebu/patches-5.4/007-net-mvneta-move-header-prefetch-in-mvneta_swbm_rx_fr.patch b/target/linux/mvebu/patches-5.4/007-net-mvneta-move-header-prefetch-in-mvneta_swbm_rx_fr.patch index e075796e41..3cd7ac771f 100644 --- a/target/linux/mvebu/patches-5.4/007-net-mvneta-move-header-prefetch-in-mvneta_swbm_rx_fr.patch +++ b/target/linux/mvebu/patches-5.4/007-net-mvneta-move-header-prefetch-in-mvneta_swbm_rx_fr.patch @@ -16,7 +16,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -2038,6 +2038,9 @@ mvneta_swbm_rx_frame(struct mvneta_port +@@ -2050,6 +2050,9 @@ mvneta_swbm_rx_frame(struct mvneta_port rx_desc->buf_phys_addr, len, dma_dir); @@ -26,7 +26,7 @@ Signed-off-by: David S. Miller xdp->data_hard_start = data; xdp->data = data + MVNETA_SKB_HEADROOM + MVNETA_MH_SIZE; xdp->data_end = xdp->data + data_len; -@@ -2135,14 +2138,10 @@ static int mvneta_rx_swbm(struct napi_st +@@ -2147,14 +2150,10 @@ static int mvneta_rx_swbm(struct napi_st while (rx_proc < budget && rx_proc < rx_todo) { struct mvneta_rx_desc *rx_desc = mvneta_rxq_next_desc_get(rxq); u32 rx_status, index; diff --git a/target/linux/mvebu/patches-5.4/008-net-mvneta-make-tx-buffer-array-agnostic.patch b/target/linux/mvebu/patches-5.4/008-net-mvneta-make-tx-buffer-array-agnostic.patch deleted file mode 100644 index 4698c23be4..0000000000 --- a/target/linux/mvebu/patches-5.4/008-net-mvneta-make-tx-buffer-array-agnostic.patch +++ /dev/null @@ -1,210 +0,0 @@ -From 9e58c8b410650b5a6eb5b8fad8474bd8425a4023 Mon Sep 17 00:00:00 2001 -From: Lorenzo Bianconi -Date: Sat, 19 Oct 2019 10:13:26 +0200 -Subject: [PATCH 6/7] net: mvneta: make tx buffer array agnostic - -Allow tx buffer array to contain both skb and xdp buffers in order to -enable xdp frame recycling adding XDP_TX verdict support - -Signed-off-by: Lorenzo Bianconi -Signed-off-by: David S. Miller ---- - drivers/net/ethernet/marvell/mvneta.c | 66 +++++++++++++++++---------- - 1 file changed, 43 insertions(+), 23 deletions(-) - ---- a/drivers/net/ethernet/marvell/mvneta.c -+++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -565,6 +565,20 @@ struct mvneta_rx_desc { - }; - #endif - -+enum mvneta_tx_buf_type { -+ MVNETA_TYPE_SKB, -+ MVNETA_TYPE_XDP_TX, -+ MVNETA_TYPE_XDP_NDO, -+}; -+ -+struct mvneta_tx_buf { -+ enum mvneta_tx_buf_type type; -+ union { -+ struct xdp_frame *xdpf; -+ struct sk_buff *skb; -+ }; -+}; -+ - struct mvneta_tx_queue { - /* Number of this TX queue, in the range 0-7 */ - u8 id; -@@ -580,8 +594,8 @@ struct mvneta_tx_queue { - int tx_stop_threshold; - int tx_wake_threshold; - -- /* Array of transmitted skb */ -- struct sk_buff **tx_skb; -+ /* Array of transmitted buffers */ -+ struct mvneta_tx_buf *buf; - - /* Index of last TX DMA descriptor that was inserted */ - int txq_put_index; -@@ -1793,14 +1807,9 @@ static void mvneta_txq_bufs_free(struct - int i; - - for (i = 0; i < num; i++) { -+ struct mvneta_tx_buf *buf = &txq->buf[txq->txq_get_index]; - struct mvneta_tx_desc *tx_desc = txq->descs + - txq->txq_get_index; -- struct sk_buff *skb = txq->tx_skb[txq->txq_get_index]; -- -- if (skb) { -- bytes_compl += skb->len; -- pkts_compl++; -- } - - mvneta_txq_inc_get(txq); - -@@ -1808,9 +1817,12 @@ static void mvneta_txq_bufs_free(struct - dma_unmap_single(pp->dev->dev.parent, - tx_desc->buf_phys_addr, - tx_desc->data_size, DMA_TO_DEVICE); -- if (!skb) -+ if (!buf->skb) - continue; -- dev_kfree_skb_any(skb); -+ -+ bytes_compl += buf->skb->len; -+ pkts_compl++; -+ dev_kfree_skb_any(buf->skb); - } - - netdev_tx_completed_queue(nq, pkts_compl, bytes_compl); -@@ -2335,16 +2347,19 @@ static inline void - mvneta_tso_put_hdr(struct sk_buff *skb, - struct mvneta_port *pp, struct mvneta_tx_queue *txq) - { -- struct mvneta_tx_desc *tx_desc; - int hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb); -+ struct mvneta_tx_buf *buf = &txq->buf[txq->txq_put_index]; -+ struct mvneta_tx_desc *tx_desc; - -- txq->tx_skb[txq->txq_put_index] = NULL; - tx_desc = mvneta_txq_next_desc_get(txq); - tx_desc->data_size = hdr_len; - tx_desc->command = mvneta_skb_tx_csum(pp, skb); - tx_desc->command |= MVNETA_TXD_F_DESC; - tx_desc->buf_phys_addr = txq->tso_hdrs_phys + - txq->txq_put_index * TSO_HEADER_SIZE; -+ buf->type = MVNETA_TYPE_SKB; -+ buf->skb = NULL; -+ - mvneta_txq_inc_put(txq); - } - -@@ -2353,6 +2368,7 @@ mvneta_tso_put_data(struct net_device *d - struct sk_buff *skb, char *data, int size, - bool last_tcp, bool is_last) - { -+ struct mvneta_tx_buf *buf = &txq->buf[txq->txq_put_index]; - struct mvneta_tx_desc *tx_desc; - - tx_desc = mvneta_txq_next_desc_get(txq); -@@ -2366,7 +2382,8 @@ mvneta_tso_put_data(struct net_device *d - } - - tx_desc->command = 0; -- txq->tx_skb[txq->txq_put_index] = NULL; -+ buf->type = MVNETA_TYPE_SKB; -+ buf->skb = NULL; - - if (last_tcp) { - /* last descriptor in the TCP packet */ -@@ -2374,7 +2391,7 @@ mvneta_tso_put_data(struct net_device *d - - /* last descriptor in SKB */ - if (is_last) -- txq->tx_skb[txq->txq_put_index] = skb; -+ buf->skb = skb; - } - mvneta_txq_inc_put(txq); - return 0; -@@ -2459,6 +2476,7 @@ static int mvneta_tx_frag_process(struct - int i, nr_frags = skb_shinfo(skb)->nr_frags; - - for (i = 0; i < nr_frags; i++) { -+ struct mvneta_tx_buf *buf = &txq->buf[txq->txq_put_index]; - skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; - void *addr = skb_frag_address(frag); - -@@ -2478,12 +2496,13 @@ static int mvneta_tx_frag_process(struct - if (i == nr_frags - 1) { - /* Last descriptor */ - tx_desc->command = MVNETA_TXD_L_DESC | MVNETA_TXD_Z_PAD; -- txq->tx_skb[txq->txq_put_index] = skb; -+ buf->skb = skb; - } else { - /* Descriptor in the middle: Not First, Not Last */ - tx_desc->command = 0; -- txq->tx_skb[txq->txq_put_index] = NULL; -+ buf->skb = NULL; - } -+ buf->type = MVNETA_TYPE_SKB; - mvneta_txq_inc_put(txq); - } - -@@ -2511,6 +2530,7 @@ static netdev_tx_t mvneta_tx(struct sk_b - struct mvneta_port *pp = netdev_priv(dev); - u16 txq_id = skb_get_queue_mapping(skb); - struct mvneta_tx_queue *txq = &pp->txqs[txq_id]; -+ struct mvneta_tx_buf *buf = &txq->buf[txq->txq_put_index]; - struct mvneta_tx_desc *tx_desc; - int len = skb->len; - int frags = 0; -@@ -2543,16 +2563,17 @@ static netdev_tx_t mvneta_tx(struct sk_b - goto out; - } - -+ buf->type = MVNETA_TYPE_SKB; - if (frags == 1) { - /* First and Last descriptor */ - tx_cmd |= MVNETA_TXD_FLZ_DESC; - tx_desc->command = tx_cmd; -- txq->tx_skb[txq->txq_put_index] = skb; -+ buf->skb = skb; - mvneta_txq_inc_put(txq); - } else { - /* First but not Last */ - tx_cmd |= MVNETA_TXD_F_DESC; -- txq->tx_skb[txq->txq_put_index] = NULL; -+ buf->skb = NULL; - mvneta_txq_inc_put(txq); - tx_desc->command = tx_cmd; - /* Continue with other skb fragments */ -@@ -3138,9 +3159,8 @@ static int mvneta_txq_sw_init(struct mvn - - txq->last_desc = txq->size - 1; - -- txq->tx_skb = kmalloc_array(txq->size, sizeof(*txq->tx_skb), -- GFP_KERNEL); -- if (!txq->tx_skb) { -+ txq->buf = kmalloc_array(txq->size, sizeof(*txq->buf), GFP_KERNEL); -+ if (!txq->buf) { - dma_free_coherent(pp->dev->dev.parent, - txq->size * MVNETA_DESC_ALIGNED_SIZE, - txq->descs, txq->descs_phys); -@@ -3152,7 +3172,7 @@ static int mvneta_txq_sw_init(struct mvn - txq->size * TSO_HEADER_SIZE, - &txq->tso_hdrs_phys, GFP_KERNEL); - if (!txq->tso_hdrs) { -- kfree(txq->tx_skb); -+ kfree(txq->buf); - dma_free_coherent(pp->dev->dev.parent, - txq->size * MVNETA_DESC_ALIGNED_SIZE, - txq->descs, txq->descs_phys); -@@ -3207,7 +3227,7 @@ static void mvneta_txq_sw_deinit(struct - { - struct netdev_queue *nq = netdev_get_tx_queue(pp->dev, txq->id); - -- kfree(txq->tx_skb); -+ kfree(txq->buf); - - if (txq->tso_hdrs) - dma_free_coherent(pp->dev->dev.parent, From 57a6d97ddf8f6541a52e0f8fad8c6f47685a1bc3 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Thu, 27 Apr 2023 23:08:10 +0200 Subject: [PATCH 37/67] OpenWrt v21.02.7: adjust config defaults Signed-off-by: Hauke Mehrtens --- feeds.conf.default | 9 ++++----- include/version.mk | 6 +++--- package/base-files/image-config.in | 4 ++-- version | 1 + version.date | 1 + 5 files changed, 11 insertions(+), 10 deletions(-) create mode 100644 version create mode 100644 version.date diff --git a/feeds.conf.default b/feeds.conf.default index f1827a3661..aa577f3fa3 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -1,5 +1,4 @@ -src-git-full packages https://git.openwrt.org/feed/packages.git;openwrt-21.02 -src-git-full luci https://git.openwrt.org/project/luci.git;openwrt-21.02 -src-git-full routing https://git.openwrt.org/feed/routing.git;openwrt-21.02 -src-git-full telephony https://git.openwrt.org/feed/telephony.git;openwrt-21.02 -#src-link custom /usr/src/openwrt/custom-feed +src-git-full packages https://git.openwrt.org/feed/packages.git^48242ee7a190db7740f7b9b3ef1debfa4d5857f6 +src-git-full luci https://git.openwrt.org/project/luci.git^e98243ef9eb838cca80cdd6d1bd0cf69a509d103 +src-git-full routing https://git.openwrt.org/feed/routing.git^8071852b4556a02533cacb7a0f6a432df3507302 +src-git-full telephony https://git.openwrt.org/feed/telephony.git^920fbc5c0a2e4badf51bceff42e9a1e3eb693462 diff --git a/include/version.mk b/include/version.mk index a4b47c8a57..5ef11bc1b6 100644 --- a/include/version.mk +++ b/include/version.mk @@ -23,13 +23,13 @@ PKG_CONFIG_DEPENDS += \ sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1)))) VERSION_NUMBER:=$(call qstrip,$(CONFIG_VERSION_NUMBER)) -VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),21.02-SNAPSHOT) +VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),21.02.7) VERSION_CODE:=$(call qstrip,$(CONFIG_VERSION_CODE)) -VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),$(REVISION)) +VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r16847-f8282da11e) VERSION_REPO:=$(call qstrip,$(CONFIG_VERSION_REPO)) -VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/21.02-SNAPSHOT) +VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/21.02.7) VERSION_DIST:=$(call qstrip,$(CONFIG_VERSION_DIST)) VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),OpenWrt) diff --git a/package/base-files/image-config.in b/package/base-files/image-config.in index 1f06332b00..5113ce942c 100644 --- a/package/base-files/image-config.in +++ b/package/base-files/image-config.in @@ -183,7 +183,7 @@ if VERSIONOPT config VERSION_REPO string prompt "Release repository" - default "https://downloads.openwrt.org/releases/21.02-SNAPSHOT" + default "https://downloads.openwrt.org/releases/21.02.7" help This is the repository address embedded in the image, it defaults to the trunk snapshot repo; the url may contain the following placeholders: @@ -259,7 +259,7 @@ if VERSIONOPT config VERSION_CODE_FILENAMES bool prompt "Revision code in filenames" - default y + default n help Enable this to include the revision identifier or the configured version code into the firmware image, SDK- and Image Builder archive diff --git a/version b/version new file mode 100644 index 0000000000..53ee0e771d --- /dev/null +++ b/version @@ -0,0 +1 @@ +r16847-f8282da11e diff --git a/version.date b/version.date new file mode 100644 index 0000000000..37937b5acf --- /dev/null +++ b/version.date @@ -0,0 +1 @@ +1681737336 From 6a12ecbd6dd61bb9da35d75735e1280313659a20 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Thu, 27 Apr 2023 23:08:18 +0200 Subject: [PATCH 38/67] OpenWrt v21.02.7: revert to branch defaults Signed-off-by: Hauke Mehrtens --- feeds.conf.default | 9 +++++---- include/version.mk | 6 +++--- package/base-files/image-config.in | 4 ++-- version | 1 - version.date | 1 - 5 files changed, 10 insertions(+), 11 deletions(-) delete mode 100644 version delete mode 100644 version.date diff --git a/feeds.conf.default b/feeds.conf.default index aa577f3fa3..f1827a3661 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -1,4 +1,5 @@ -src-git-full packages https://git.openwrt.org/feed/packages.git^48242ee7a190db7740f7b9b3ef1debfa4d5857f6 -src-git-full luci https://git.openwrt.org/project/luci.git^e98243ef9eb838cca80cdd6d1bd0cf69a509d103 -src-git-full routing https://git.openwrt.org/feed/routing.git^8071852b4556a02533cacb7a0f6a432df3507302 -src-git-full telephony https://git.openwrt.org/feed/telephony.git^920fbc5c0a2e4badf51bceff42e9a1e3eb693462 +src-git-full packages https://git.openwrt.org/feed/packages.git;openwrt-21.02 +src-git-full luci https://git.openwrt.org/project/luci.git;openwrt-21.02 +src-git-full routing https://git.openwrt.org/feed/routing.git;openwrt-21.02 +src-git-full telephony https://git.openwrt.org/feed/telephony.git;openwrt-21.02 +#src-link custom /usr/src/openwrt/custom-feed diff --git a/include/version.mk b/include/version.mk index 5ef11bc1b6..a4b47c8a57 100644 --- a/include/version.mk +++ b/include/version.mk @@ -23,13 +23,13 @@ PKG_CONFIG_DEPENDS += \ sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1)))) VERSION_NUMBER:=$(call qstrip,$(CONFIG_VERSION_NUMBER)) -VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),21.02.7) +VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),21.02-SNAPSHOT) VERSION_CODE:=$(call qstrip,$(CONFIG_VERSION_CODE)) -VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r16847-f8282da11e) +VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),$(REVISION)) VERSION_REPO:=$(call qstrip,$(CONFIG_VERSION_REPO)) -VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/21.02.7) +VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/21.02-SNAPSHOT) VERSION_DIST:=$(call qstrip,$(CONFIG_VERSION_DIST)) VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),OpenWrt) diff --git a/package/base-files/image-config.in b/package/base-files/image-config.in index 5113ce942c..1f06332b00 100644 --- a/package/base-files/image-config.in +++ b/package/base-files/image-config.in @@ -183,7 +183,7 @@ if VERSIONOPT config VERSION_REPO string prompt "Release repository" - default "https://downloads.openwrt.org/releases/21.02.7" + default "https://downloads.openwrt.org/releases/21.02-SNAPSHOT" help This is the repository address embedded in the image, it defaults to the trunk snapshot repo; the url may contain the following placeholders: @@ -259,7 +259,7 @@ if VERSIONOPT config VERSION_CODE_FILENAMES bool prompt "Revision code in filenames" - default n + default y help Enable this to include the revision identifier or the configured version code into the firmware image, SDK- and Image Builder archive diff --git a/version b/version deleted file mode 100644 index 53ee0e771d..0000000000 --- a/version +++ /dev/null @@ -1 +0,0 @@ -r16847-f8282da11e diff --git a/version.date b/version.date deleted file mode 100644 index 37937b5acf..0000000000 --- a/version.date +++ /dev/null @@ -1 +0,0 @@ -1681737336 From f6932e9bd52faa4ccb2bcb40d301f6fc403c13f0 Mon Sep 17 00:00:00 2001 From: Glen Huang Date: Sat, 22 Apr 2023 13:22:28 +0800 Subject: [PATCH 39/67] scripts/feeds: use partial clone for src-git-full Partial clone is much faster without clipping history Signed-off-by: Glen Huang [also apply to include/download.mk] Signed-off-by: Tianling Shen (cherry picked from commit 31514777275184fd0f41d7af9eb1a92ecff37802) --- include/download.mk | 4 ++-- scripts/feeds | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/download.mk b/include/download.mk index 99a3e0140d..45c6f43944 100644 --- a/include/download.mk +++ b/include/download.mk @@ -203,9 +203,9 @@ define DownloadMethod/rawgit cd $(TMP_DIR)/dl && \ rm -rf $(SUBDIR) && \ [ \! -d $(SUBDIR) ] && \ - git clone $(OPTS) $(URL) $(SUBDIR) && \ + git clone --filter=blob:none $(OPTS) $(URL) $(SUBDIR) && \ (cd $(SUBDIR) && git checkout $(VERSION) && \ - git submodule update --init --recursive) && \ + git submodule update --init --recursive --filter=blob:none) && \ echo "Packing checkout..." && \ export TAR_TIMESTAMP=`cd $(SUBDIR) && git log -1 --format='@%ct'` && \ rm -rf $(SUBDIR)/.git && \ diff --git a/scripts/feeds b/scripts/feeds index 499354391b..e972a7d654 100755 --- a/scripts/feeds +++ b/scripts/feeds @@ -164,9 +164,9 @@ my %update_method = ( 'controldir' => ".git", 'revision' => "git rev-parse --short HEAD | tr -d '\n'"}, 'src-git-full' => { - 'init' => "git clone '%s' '%s'", - 'init_branch' => "git clone --branch '%s' '%s' '%s'", - 'init_commit' => "git clone '%s' '%s' && cd '%s' && git checkout -b '%s' '%s' && cd -", + 'init' => "git clone --filter=blob:none '%s' '%s'", + 'init_branch' => "git clone --filter=blob:none --branch '%s' '%s' '%s'", + 'init_commit' => "git clone --filter=blob:none '%s' '%s' && cd '%s' && git checkout -b '%s' '%s' && cd -", 'update' => "git pull --ff-only", 'update_force' => "git pull --ff-only || (git reset --hard HEAD; git pull --ff-only; exit 1)", 'post_update' => "git submodule update --init --recursive", From faf8290e537ff0dd031859c29cbeb5de4a0dac1e Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Sat, 29 Apr 2023 11:23:25 +0800 Subject: [PATCH 40/67] kernel: bump to 5.4.242 Refreshed all patches. Signed-off-by: Tianling Shen --- include/kernel-5.4 | 4 ++-- ...scsi-core-Add-sysfs-attributes-for-VPD-pages-0h-and-.patch | 2 +- target/linux/generic/hack-5.4/721-phy_packets.patch | 4 ++-- .../953-net-patch-linux-kernel-to-support-shortcut-fe.patch | 2 +- target/linux/generic/pending-5.4/655-increase_skb_pad.patch | 2 +- .../680-NET-skip-GRO-for-foreign-MAC-addresses.patch | 2 +- .../patches-5.4/303-core-0001-net-readd-skb_recycle.patch | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/kernel-5.4 b/include/kernel-5.4 index e281ed5868..fbf5667648 100644 --- a/include/kernel-5.4 +++ b/include/kernel-5.4 @@ -1,2 +1,2 @@ -LINUX_VERSION-5.4 = .241 -LINUX_KERNEL_HASH-5.4.241 = ffc0e0ad6f47f8b7b05148d815cbab27f44fa433f3a8ed0e372d4b8647bcea7c +LINUX_VERSION-5.4 = .242 +LINUX_KERNEL_HASH-5.4.242 = 142f9aed1c9f2e409dd72c5c490ad824dddf31f955ed2097d5989c4b5074fc28 diff --git a/target/linux/generic/backport-5.4/800-v5.5-scsi-core-Add-sysfs-attributes-for-VPD-pages-0h-and-.patch b/target/linux/generic/backport-5.4/800-v5.5-scsi-core-Add-sysfs-attributes-for-VPD-pages-0h-and-.patch index d963222639..6c31c41c68 100644 --- a/target/linux/generic/backport-5.4/800-v5.5-scsi-core-Add-sysfs-attributes-for-VPD-pages-0h-and-.patch +++ b/target/linux/generic/backport-5.4/800-v5.5-scsi-core-Add-sysfs-attributes-for-VPD-pages-0h-and-.patch @@ -18,7 +18,7 @@ Signed-off-by: Martin K. Petersen --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c -@@ -465,10 +465,14 @@ void scsi_attach_vpd(struct scsi_device +@@ -472,10 +472,14 @@ void scsi_attach_vpd(struct scsi_device return; for (i = 4; i < vpd_buf->len; i++) { diff --git a/target/linux/generic/hack-5.4/721-phy_packets.patch b/target/linux/generic/hack-5.4/721-phy_packets.patch index 3df66bc4df..91fd4ee7bd 100644 --- a/target/linux/generic/hack-5.4/721-phy_packets.patch +++ b/target/linux/generic/hack-5.4/721-phy_packets.patch @@ -56,7 +56,7 @@ Signed-off-by: Felix Fietkau */ --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -2694,6 +2694,10 @@ static inline int pskb_trim(struct sk_bu +@@ -2695,6 +2695,10 @@ static inline int pskb_trim(struct sk_bu return (len < skb->len) ? __pskb_trim(skb, len) : 0; } @@ -67,7 +67,7 @@ Signed-off-by: Felix Fietkau /** * pskb_trim_unique - remove end from a paged unique (not cloned) buffer * @skb: buffer to alter -@@ -2825,16 +2829,6 @@ static inline struct sk_buff *dev_alloc_ +@@ -2826,16 +2830,6 @@ static inline struct sk_buff *dev_alloc_ } diff --git a/target/linux/generic/hack-5.4/953-net-patch-linux-kernel-to-support-shortcut-fe.patch b/target/linux/generic/hack-5.4/953-net-patch-linux-kernel-to-support-shortcut-fe.patch index cb3198fc6d..113afa80b9 100644 --- a/target/linux/generic/hack-5.4/953-net-patch-linux-kernel-to-support-shortcut-fe.patch +++ b/target/linux/generic/hack-5.4/953-net-patch-linux-kernel-to-support-shortcut-fe.patch @@ -12,7 +12,7 @@ struct list_head *br_ip_list); --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -828,6 +828,10 @@ struct sk_buff { +@@ -829,6 +829,10 @@ struct sk_buff { __u8 scm_io_uring:1; __u8 gro_skip:1; diff --git a/target/linux/generic/pending-5.4/655-increase_skb_pad.patch b/target/linux/generic/pending-5.4/655-increase_skb_pad.patch index 16c65ce3f7..3ca190f0aa 100644 --- a/target/linux/generic/pending-5.4/655-increase_skb_pad.patch +++ b/target/linux/generic/pending-5.4/655-increase_skb_pad.patch @@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -2660,7 +2660,7 @@ static inline int pskb_network_may_pull( +@@ -2661,7 +2661,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 diff --git a/target/linux/generic/pending-5.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/pending-5.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch index bec6787dc8..ff99f60fb9 100644 --- a/target/linux/generic/pending-5.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch +++ b/target/linux/generic/pending-5.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch @@ -22,7 +22,7 @@ Signed-off-by: Felix Fietkau #endif --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -826,6 +826,7 @@ struct sk_buff { +@@ -827,6 +827,7 @@ struct sk_buff { __u8 decrypted:1; #endif __u8 scm_io_uring:1; diff --git a/target/linux/layerscape/patches-5.4/303-core-0001-net-readd-skb_recycle.patch b/target/linux/layerscape/patches-5.4/303-core-0001-net-readd-skb_recycle.patch index f77b067f16..b2c992a94c 100644 --- a/target/linux/layerscape/patches-5.4/303-core-0001-net-readd-skb_recycle.patch +++ b/target/linux/layerscape/patches-5.4/303-core-0001-net-readd-skb_recycle.patch @@ -14,7 +14,7 @@ Signed-off-by: Madalin Bucur --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -1031,6 +1031,7 @@ void skb_dump(const char *level, const s +@@ -1032,6 +1032,7 @@ void skb_dump(const char *level, const s void skb_tx_error(struct sk_buff *skb); void consume_skb(struct sk_buff *skb); void __consume_stateless_skb(struct sk_buff *skb); From d113f64e8e3d03c107f869f681f6261bb4aa4d70 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Sat, 29 Apr 2023 11:41:12 +0800 Subject: [PATCH 41/67] scripts/feeds: use partial clone for git submodule update Signed-off-by: Tianling Shen (cherry picked from commit b6cc644e1f6a6a9824d85ea4fdb7c058339e923c) --- scripts/feeds | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/feeds b/scripts/feeds index e972a7d654..52d09134ab 100755 --- a/scripts/feeds +++ b/scripts/feeds @@ -160,7 +160,7 @@ my %update_method = ( 'init_commit' => "git clone '%s' '%s' && cd '%s' && git checkout -b '%s' '%s' && cd -", 'update' => "git pull --ff-only", 'update_force' => "git pull --ff-only || (git reset --hard HEAD; git pull --ff-only; exit 1)", - 'post_update' => "git submodule update --init --recursive", + 'post_update' => "git submodule update --init --recursive --filter=blob:none", 'controldir' => ".git", 'revision' => "git rev-parse --short HEAD | tr -d '\n'"}, 'src-git-full' => { @@ -169,7 +169,7 @@ my %update_method = ( 'init_commit' => "git clone --filter=blob:none '%s' '%s' && cd '%s' && git checkout -b '%s' '%s' && cd -", 'update' => "git pull --ff-only", 'update_force' => "git pull --ff-only || (git reset --hard HEAD; git pull --ff-only; exit 1)", - 'post_update' => "git submodule update --init --recursive", + 'post_update' => "git submodule update --init --recursive --filter=blob:none", 'controldir' => ".git", 'revision' => "git rev-parse --short HEAD | tr -d '\n'"}, 'src-gitsvn' => { From a5e4185f46f8f8f4cab33ea9c47d88c27060d40e Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Sat, 29 Apr 2023 12:29:15 +0800 Subject: [PATCH 42/67] Revert "scripts/feeds: use partial clone for git submodule update" Unfortunately this feature requires very recent git version. This reverts commit b6cc644e1f6a6a9824d85ea4fdb7c058339e923c. Signed-off-by: Tianling Shen (cherry picked from commit 98bb1a63441ae7a3427b5d080a37960171cca7e1) --- include/download.mk | 2 +- scripts/feeds | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/download.mk b/include/download.mk index 45c6f43944..8e4dd3158c 100644 --- a/include/download.mk +++ b/include/download.mk @@ -205,7 +205,7 @@ define DownloadMethod/rawgit [ \! -d $(SUBDIR) ] && \ git clone --filter=blob:none $(OPTS) $(URL) $(SUBDIR) && \ (cd $(SUBDIR) && git checkout $(VERSION) && \ - git submodule update --init --recursive --filter=blob:none) && \ + git submodule update --init --recursive) && \ echo "Packing checkout..." && \ export TAR_TIMESTAMP=`cd $(SUBDIR) && git log -1 --format='@%ct'` && \ rm -rf $(SUBDIR)/.git && \ diff --git a/scripts/feeds b/scripts/feeds index 52d09134ab..e972a7d654 100755 --- a/scripts/feeds +++ b/scripts/feeds @@ -160,7 +160,7 @@ my %update_method = ( 'init_commit' => "git clone '%s' '%s' && cd '%s' && git checkout -b '%s' '%s' && cd -", 'update' => "git pull --ff-only", 'update_force' => "git pull --ff-only || (git reset --hard HEAD; git pull --ff-only; exit 1)", - 'post_update' => "git submodule update --init --recursive --filter=blob:none", + 'post_update' => "git submodule update --init --recursive", 'controldir' => ".git", 'revision' => "git rev-parse --short HEAD | tr -d '\n'"}, 'src-git-full' => { @@ -169,7 +169,7 @@ my %update_method = ( 'init_commit' => "git clone --filter=blob:none '%s' '%s' && cd '%s' && git checkout -b '%s' '%s' && cd -", 'update' => "git pull --ff-only", 'update_force' => "git pull --ff-only || (git reset --hard HEAD; git pull --ff-only; exit 1)", - 'post_update' => "git submodule update --init --recursive --filter=blob:none", + 'post_update' => "git submodule update --init --recursive", 'controldir' => ".git", 'revision' => "git rev-parse --short HEAD | tr -d '\n'"}, 'src-gitsvn' => { From 002f71defd2fc519c2c1b3b8be82bc2dbd9f7f7b Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Sun, 30 Apr 2023 14:52:53 +0800 Subject: [PATCH 43/67] uboot-rockchip: add NanoPi R4SE support Add support for the FriendlyARM NanoPi R4SE. Signed-off-by: Tianling Shen (cherry picked from commit 133ee76af2a82456c882578056664766cd14b6ef) --- package/boot/uboot-rockchip/Makefile | 12 +++ ...rock64pro-disable-CONFIG_USE_PREBOOT.patch | 4 +- ...328-Add-support-for-Orangepi-R1-Plus.patch | 4 +- ...Add-support-for-FriendlyARM-NanoPi-R.patch | 11 -- ...Add-support-for-FriendlyARM-NanoPi-R.patch | 101 ++++++++++++++++++ 5 files changed, 117 insertions(+), 15 deletions(-) create mode 100644 package/boot/uboot-rockchip/patches/203-rockchip-rk3399-Add-support-for-FriendlyARM-NanoPi-R.patch diff --git a/package/boot/uboot-rockchip/Makefile b/package/boot/uboot-rockchip/Makefile index 81a10cb746..277c6ba791 100644 --- a/package/boot/uboot-rockchip/Makefile +++ b/package/boot/uboot-rockchip/Makefile @@ -98,6 +98,17 @@ define U-Boot/nanopi-r4s-rk3399 USE_RKBIN:=1 endef +define U-Boot/nanopi-r4se-rk3399 + BUILD_SUBTARGET:=armv8 + NAME:=NanoPi R4SE + BUILD_DEVICES:= \ + friendlyarm_nanopi-r4se + DEPENDS:=+PACKAGE_u-boot-nanopi-r4se-rk3399:arm-trusted-firmware-rk3399 + PKG_BUILD_DEPENDS:=arm-trusted-firmware-rockchip-vendor + ATF:=rk3399_bl31_v1.35.elf + USE_RKBIN:=1 +endef + define U-Boot/rock-pi-4-rk3399 BUILD_SUBTARGET:=armv8 NAME:=Rock Pi 4 @@ -120,6 +131,7 @@ endef UBOOT_TARGETS := \ nanopi-r4s-rk3399 \ + nanopi-r4se-rk3399 \ rock-pi-4-rk3399 \ rockpro64-rk3399 \ nanopi-r2c-rk3328 \ diff --git a/package/boot/uboot-rockchip/patches/101-rock64pro-disable-CONFIG_USE_PREBOOT.patch b/package/boot/uboot-rockchip/patches/101-rock64pro-disable-CONFIG_USE_PREBOOT.patch index f630818358..174c9ea29c 100644 --- a/package/boot/uboot-rockchip/patches/101-rock64pro-disable-CONFIG_USE_PREBOOT.patch +++ b/package/boot/uboot-rockchip/patches/101-rock64pro-disable-CONFIG_USE_PREBOOT.patch @@ -17,9 +17,9 @@ Signed-off-by: Marty Jones --- a/configs/rockpro64-rk3399_defconfig +++ b/configs/rockpro64-rk3399_defconfig -@@ -12,7 +12,6 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y +@@ -12,7 +12,6 @@ CONFIG_DEBUG_UART_CLOCK=24000000 + CONFIG_SPL_SPI_FLASH_SUPPORT=y CONFIG_SPL_SPI_SUPPORT=y - CONFIG_DEFAULT_DEVICE_TREE="rk3399-rockpro64" CONFIG_DEBUG_UART=y -CONFIG_USE_PREBOOT=y CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-rockpro64.dtb" diff --git a/package/boot/uboot-rockchip/patches/200-rockchip-rk3328-Add-support-for-Orangepi-R1-Plus.patch b/package/boot/uboot-rockchip/patches/200-rockchip-rk3328-Add-support-for-Orangepi-R1-Plus.patch index de94544e15..32fc939f72 100644 --- a/package/boot/uboot-rockchip/patches/200-rockchip-rk3328-Add-support-for-Orangepi-R1-Plus.patch +++ b/package/boot/uboot-rockchip/patches/200-rockchip-rk3328-Add-support-for-Orangepi-R1-Plus.patch @@ -10,7 +10,7 @@ rk3328-rock-pi-e.dtb --- /dev/null +++ b/arch/arm/dts/rk3328-orangepi-r1-plus-u-boot.dtsi -@@ -0,0 +1,1 @@ +@@ -0,0 +1 @@ +#include "rk3328-nanopi-r2s-u-boot.dtsi" --- /dev/null +++ b/arch/arm/dts/rk3328-orangepi-r1-plus.dts @@ -55,7 +55,7 @@ +}; --- a/board/rockchip/evb_rk3328/MAINTAINERS +++ b/board/rockchip/evb_rk3328/MAINTAINERS -@@ -12,6 +12,13 @@ F: configs/nanopi-r2s-rk3328_defconfig +@@ -12,6 +12,13 @@ F: configs/nanopi-r2s-rk3328_defcon F: arch/arm/dts/rk3328-nanopi-r2s-u-boot.dtsi F: arch/arm/dts/rk3328-nanopi-r2s.dts diff --git a/package/boot/uboot-rockchip/patches/201-rockchip-rk3328-Add-support-for-FriendlyARM-NanoPi-R.patch b/package/boot/uboot-rockchip/patches/201-rockchip-rk3328-Add-support-for-FriendlyARM-NanoPi-R.patch index 2e3dc1740d..d757d2ac3b 100644 --- a/package/boot/uboot-rockchip/patches/201-rockchip-rk3328-Add-support-for-FriendlyARM-NanoPi-R.patch +++ b/package/boot/uboot-rockchip/patches/201-rockchip-rk3328-Add-support-for-FriendlyARM-NanoPi-R.patch @@ -1,5 +1,3 @@ -diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile -index d3e89ca3ba..d5f64ac432 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -108,6 +108,7 @@ dtb-$(CONFIG_ROCKCHIP_RK3308) += \ @@ -10,9 +8,6 @@ index d3e89ca3ba..d5f64ac432 100644 rk3328-nanopi-r2s.dtb \ rk3328-orangepi-r1-plus.dtb \ rk3328-roc-cc.dtb \ -diff --git a/arch/arm/dts/rk3328-nanopi-r2c-u-boot.dtsi b/arch/arm/dts/rk3328-nanopi-r2c-u-boot.dtsi -new file mode 100644 -index 0000000000..c2e86d0f0e --- /dev/null +++ b/arch/arm/dts/rk3328-nanopi-r2c-u-boot.dtsi @@ -0,0 +1,7 @@ @@ -23,9 +18,6 @@ index 0000000000..c2e86d0f0e + */ + +#include "rk3328-nanopi-r2s-u-boot.dtsi" -diff --git a/arch/arm/dts/rk3328-nanopi-r2c.dts b/arch/arm/dts/rk3328-nanopi-r2c.dts -new file mode 100644 -index 0000000000..adf91a0306 --- /dev/null +++ b/arch/arm/dts/rk3328-nanopi-r2c.dts @@ -0,0 +1,47 @@ @@ -76,9 +68,6 @@ index 0000000000..adf91a0306 +&wan_led { + label = "nanopi-r2c:green:wan"; +}; -diff --git a/configs/nanopi-r2c-rk3328_defconfig b/configs/nanopi-r2c-rk3328_defconfig -new file mode 100644 -index 0000000000..7bc7a3274f --- /dev/null +++ b/configs/nanopi-r2c-rk3328_defconfig @@ -0,0 +1,98 @@ diff --git a/package/boot/uboot-rockchip/patches/203-rockchip-rk3399-Add-support-for-FriendlyARM-NanoPi-R.patch b/package/boot/uboot-rockchip/patches/203-rockchip-rk3399-Add-support-for-FriendlyARM-NanoPi-R.patch new file mode 100644 index 0000000000..54928de906 --- /dev/null +++ b/package/boot/uboot-rockchip/patches/203-rockchip-rk3399-Add-support-for-FriendlyARM-NanoPi-R.patch @@ -0,0 +1,101 @@ +--- a/arch/arm/dts/Makefile ++++ b/arch/arm/dts/Makefile +@@ -137,6 +137,7 @@ dtb-$(CONFIG_ROCKCHIP_RK3399) += \ + rk3399-nanopi-m4b.dtb \ + rk3399-nanopi-neo4.dtb \ + rk3399-nanopi-r4s.dtb \ ++ rk3399-nanopi-r4se.dtb \ + rk3399-orangepi.dtb \ + rk3399-pinebook-pro.dtb \ + rk3399-puma-haikou.dtb \ +--- /dev/null ++++ b/arch/arm/dts/rk3399-nanopi-r4se-u-boot.dtsi +@@ -0,0 +1,3 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++ ++#include "rk3399-nanopi-r4s-u-boot.dtsi" +--- /dev/null ++++ b/arch/arm/dts/rk3399-nanopi-r4se.dts +@@ -0,0 +1,17 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT) ++ ++/dts-v1/; ++#include "rk3399-nanopi-r4s.dts" ++ ++/ { ++ model = "FriendlyElec NanoPi R4SE"; ++ compatible = "friendlyarm,nanopi-r4se", "rockchip,rk3399"; ++}; ++ ++&emmc_phy { ++ status = "okay"; ++}; ++ ++&sdhci { ++ status = "okay"; ++}; +--- /dev/null ++++ b/configs/nanopi-r4se-rk3399_defconfig +@@ -0,0 +1,62 @@ ++CONFIG_ARM=y ++CONFIG_ARCH_ROCKCHIP=y ++CONFIG_SYS_TEXT_BASE=0x00200000 ++CONFIG_NR_DRAM_BANKS=1 ++CONFIG_ENV_OFFSET=0x3F8000 ++CONFIG_DEFAULT_DEVICE_TREE="rk3399-nanopi-r4se" ++CONFIG_ROCKCHIP_RK3399=y ++CONFIG_TARGET_EVB_RK3399=y ++CONFIG_DEBUG_UART_BASE=0xFF1A0000 ++CONFIG_DEBUG_UART_CLOCK=24000000 ++CONFIG_DEBUG_UART=y ++CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-nanopi-r4se.dtb" ++CONFIG_DISPLAY_BOARDINFO_LATE=y ++# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set ++CONFIG_SPL_STACK_R=y ++CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x10000 ++CONFIG_TPL=y ++CONFIG_CMD_BOOTZ=y ++CONFIG_CMD_GPT=y ++CONFIG_CMD_MMC=y ++CONFIG_CMD_USB=y ++# CONFIG_CMD_SETEXPR is not set ++CONFIG_CMD_TIME=y ++CONFIG_SPL_OF_CONTROL=y ++CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" ++CONFIG_ENV_IS_IN_MMC=y ++CONFIG_SYS_RELOC_GD_ENV_ADDR=y ++CONFIG_ROCKCHIP_GPIO=y ++CONFIG_SYS_I2C_ROCKCHIP=y ++CONFIG_MMC_DW=y ++CONFIG_MMC_DW_ROCKCHIP=y ++CONFIG_MMC_SDHCI=y ++CONFIG_MMC_SDHCI_ROCKCHIP=y ++CONFIG_DM_ETH=y ++CONFIG_ETH_DESIGNWARE=y ++CONFIG_GMAC_ROCKCHIP=y ++CONFIG_PMIC_RK8XX=y ++CONFIG_REGULATOR_PWM=y ++CONFIG_REGULATOR_RK8XX=y ++CONFIG_PWM_ROCKCHIP=y ++CONFIG_RAM_RK3399_LPDDR4=y ++CONFIG_BAUDRATE=1500000 ++CONFIG_DEBUG_UART_SHIFT=2 ++CONFIG_SYSRESET=y ++CONFIG_USB=y ++CONFIG_USB_XHCI_HCD=y ++CONFIG_USB_XHCI_DWC3=y ++CONFIG_USB_EHCI_HCD=y ++CONFIG_USB_EHCI_GENERIC=y ++CONFIG_USB_KEYBOARD=y ++CONFIG_USB_HOST_ETHER=y ++CONFIG_USB_ETHER_ASIX=y ++CONFIG_USB_ETHER_ASIX88179=y ++CONFIG_USB_ETHER_MCS7830=y ++CONFIG_USB_ETHER_RTL8152=y ++CONFIG_USB_ETHER_SMSC95XX=y ++CONFIG_DM_VIDEO=y ++CONFIG_DISPLAY=y ++CONFIG_VIDEO_ROCKCHIP=y ++CONFIG_DISPLAY_ROCKCHIP_HDMI=y ++CONFIG_SPL_TINY_MEMSET=y ++CONFIG_ERRNO_STR=y From 6e54cb5d37c3bab6accba0b4179066be19bdc5fa Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Sun, 30 Apr 2023 14:55:59 +0800 Subject: [PATCH 44/67] rockchip: add NanoPi R4SE The FriendlyARM NanoPi R4SE is a minor variant of R4S with a on-board eMMC. Signed-off-by: Tianling Shen (cherry picked from commit 1ef239173c8728e28ee913a333944c5f78276915) --- .../armv8/base-files/etc/board.d/01_leds | 3 +- .../armv8/base-files/etc/board.d/02_network | 5 ++++ .../etc/hotplug.d/net/40-net-smp-affinity | 3 +- target/linux/rockchip/image/armv8.mk | 10 +++++++ ...Add-support-for-FriendlyARM-NanoPi-R.patch | 30 +++++++++++++++++++ 5 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 target/linux/rockchip/patches-5.4/205-rockchip-rk3399-Add-support-for-FriendlyARM-NanoPi-R.patch diff --git a/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds b/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds index 11f32ca2a5..f82e4ffc52 100755 --- a/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds +++ b/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds @@ -16,7 +16,8 @@ xunlong,orangepi-r1-plus-lts) ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth0" ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth1" ;; -friendlyarm,nanopi-r4s) +friendlyarm,nanopi-r4s|\ +friendlyarm,nanopi-r4se) ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth0" ucidef_set_led_netdev "lan" "LAN" "green:lan" "eth1" ;; diff --git a/target/linux/rockchip/armv8/base-files/etc/board.d/02_network b/target/linux/rockchip/armv8/base-files/etc/board.d/02_network index f988b38101..77fa899d1e 100755 --- a/target/linux/rockchip/armv8/base-files/etc/board.d/02_network +++ b/target/linux/rockchip/armv8/base-files/etc/board.d/02_network @@ -11,6 +11,7 @@ rockchip_setup_interfaces() friendlyarm,nanopi-r2c|\ friendlyarm,nanopi-r2s|\ friendlyarm,nanopi-r4s|\ + friendlyarm,nanopi-r4se|\ xunlong,orangepi-r1-plus|\ xunlong,orangepi-r1-plus-lts) ucidef_set_interfaces_lan_wan 'eth1' 'eth0' @@ -68,6 +69,10 @@ rockchip_setup_macs() wan_mac=$(nanopi_r4s_get_mac wan) lan_mac=$(nanopi_r4s_get_mac lan) ;; + friendlyarm,nanopi-r4se) + wan_mac=$(generate_mac_from_mmc_cid mmcblk2) + lan_mac=$(macaddr_add "$wan_mac" 1) + ;; xunlong,orangepi-r1-plus|\ xunlong,orangepi-r1-plus-lts) lan_mac=$(cat /sys/class/net/eth1/address) diff --git a/target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity b/target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity index bb119b9185..009355f6bb 100644 --- a/target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity +++ b/target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity @@ -36,7 +36,8 @@ xunlong,orangepi-r1-plus-lts) set_interface_core 2 "eth0" set_interface_core 4 "eth1" "xhci-hcd:usb3" ;; -friendlyarm,nanopi-r4s) +friendlyarm,nanopi-r4s|\ +friendlyarm,nanopi-r4se) set_interface_core 10 "eth0" set_interface_core 20 "eth1" ;; diff --git a/target/linux/rockchip/image/armv8.mk b/target/linux/rockchip/image/armv8.mk index d4a0aa9329..8315b87756 100644 --- a/target/linux/rockchip/image/armv8.mk +++ b/target/linux/rockchip/image/armv8.mk @@ -42,6 +42,16 @@ define Device/friendlyarm_nanopi-r4s endef TARGET_DEVICES += friendlyarm_nanopi-r4s +define Device/friendlyarm_nanopi-r4se + DEVICE_VENDOR := FriendlyARM + DEVICE_MODEL := NanoPi R4SE + SOC := rk3399 + UBOOT_DEVICE_NAME := nanopi-r4se-rk3399 + IMAGE/sysupgrade.img.gz := boot-common | boot-script nanopi-r4s | pine64-bin | gzip | append-metadata + DEVICE_PACKAGES := kmod-r8168 -urngd +endef +TARGET_DEVICES += friendlyarm_nanopi-r4se + define Device/pine64_rockpro64 DEVICE_VENDOR := Pine64 DEVICE_MODEL := RockPro64 diff --git a/target/linux/rockchip/patches-5.4/205-rockchip-rk3399-Add-support-for-FriendlyARM-NanoPi-R.patch b/target/linux/rockchip/patches-5.4/205-rockchip-rk3399-Add-support-for-FriendlyARM-NanoPi-R.patch new file mode 100644 index 0000000000..e90e3567fe --- /dev/null +++ b/target/linux/rockchip/patches-5.4/205-rockchip-rk3399-Add-support-for-FriendlyARM-NanoPi-R.patch @@ -0,0 +1,30 @@ +--- a/arch/arm64/boot/dts/rockchip/Makefile ++++ b/arch/arm64/boot/dts/rockchip/Makefile +@@ -29,6 +29,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-na + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopi-m4.dtb + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopi-neo4.dtb + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopi-r4s.dtb ++dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopi-r4se.dtb + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-orangepi.dtb + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-puma-haikou.dtb + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-roc-pc.dtb +--- /dev/null ++++ b/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4se.dts +@@ -0,0 +1,17 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT) ++ ++/dts-v1/; ++#include "rk3399-nanopi-r4s.dts" ++ ++/ { ++ model = "FriendlyElec NanoPi R4SE"; ++ compatible = "friendlyarm,nanopi-r4se", "rockchip,rk3399"; ++}; ++ ++&emmc_phy { ++ status = "okay"; ++}; ++ ++&sdhci { ++ status = "okay"; ++}; From 6fce75899632b46632c3bad68b0c5470365588af Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Mon, 1 May 2023 14:42:53 +0800 Subject: [PATCH 45/67] ImmortalWrt v21.02.6: adjust config defaults Signed-off-by: Tianling Shen --- feeds.conf.default | 8 ++++---- include/version.mk | 6 +++--- package/base-files/image-config.in | 4 ++-- version | 1 + version.date | 1 + 5 files changed, 11 insertions(+), 9 deletions(-) create mode 100644 version create mode 100644 version.date diff --git a/feeds.conf.default b/feeds.conf.default index 9eece6fea2..70f5f786a2 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -1,4 +1,4 @@ -src-git-full packages https://github.com/immortalwrt/packages.git;openwrt-21.02 -src-git-full luci https://github.com/immortalwrt/luci.git;openwrt-21.02 -src-git-full routing https://github.com/openwrt/routing.git;openwrt-21.02 -src-git-full telephony https://github.com/openwrt/telephony.git;openwrt-21.02 +src-git-full packages https://github.com/immortalwrt/packages.git^78236a450b95e62d515cfe8ae26345c6ab7e4580 +src-git-full luci https://github.com/immortalwrt/luci.git^09e14b2b116e3f59b9d8e40448841b368e525aef +src-git-full routing https://github.com/openwrt/routing.git^8071852b4556a02533cacb7a0f6a432df3507302 +src-git-full telephony https://github.com/openwrt/telephony.git^920fbc5c0a2e4badf51bceff42e9a1e3eb693462 diff --git a/include/version.mk b/include/version.mk index 187a7322ec..5c2d91ba09 100644 --- a/include/version.mk +++ b/include/version.mk @@ -23,13 +23,13 @@ PKG_CONFIG_DEPENDS += \ sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1)))) VERSION_NUMBER:=$(call qstrip,$(CONFIG_VERSION_NUMBER)) -VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),21.02-SNAPSHOT) +VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),21.02.6) VERSION_CODE:=$(call qstrip,$(CONFIG_VERSION_CODE)) -VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),$(REVISION)) +VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r20007-6e54cb5d37) VERSION_REPO:=$(call qstrip,$(CONFIG_VERSION_REPO)) -VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.immortalwrt.org/releases/21.02-SNAPSHOT) +VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.immortalwrt.org/releases/21.02.6) VERSION_DIST:=$(call qstrip,$(CONFIG_VERSION_DIST)) VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),ImmortalWrt) diff --git a/package/base-files/image-config.in b/package/base-files/image-config.in index 9e1e3ca805..d55ed88fe3 100644 --- a/package/base-files/image-config.in +++ b/package/base-files/image-config.in @@ -183,7 +183,7 @@ if VERSIONOPT config VERSION_REPO string prompt "Release repository" - default "https://downloads.immortalwrt.org/releases/21.02-SNAPSHOT" + default "https://downloads.immortalwrt.org/releases/21.02.6" help This is the repository address embedded in the image, it defaults to the trunk snapshot repo; the url may contain the following placeholders: @@ -259,7 +259,7 @@ if VERSIONOPT config VERSION_CODE_FILENAMES bool prompt "Revision code in filenames" - default y + default n help Enable this to include the revision identifier or the configured version code into the firmware image, SDK- and Image Builder archive diff --git a/version b/version new file mode 100644 index 0000000000..d147b98198 --- /dev/null +++ b/version @@ -0,0 +1 @@ +r20007-6e54cb5d37 diff --git a/version.date b/version.date new file mode 100644 index 0000000000..bc40a602c6 --- /dev/null +++ b/version.date @@ -0,0 +1 @@ +1682857418 From 6114723dd10d5739a35ee378f56b0efc6f388867 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Mon, 1 May 2023 14:42:56 +0800 Subject: [PATCH 46/67] ImmortalWrt v21.02.6: revert to branch defaults Signed-off-by: Tianling Shen --- feeds.conf.default | 8 ++++---- include/version.mk | 6 +++--- package/base-files/image-config.in | 4 ++-- version | 1 - version.date | 1 - 5 files changed, 9 insertions(+), 11 deletions(-) delete mode 100644 version delete mode 100644 version.date diff --git a/feeds.conf.default b/feeds.conf.default index 70f5f786a2..9eece6fea2 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -1,4 +1,4 @@ -src-git-full packages https://github.com/immortalwrt/packages.git^78236a450b95e62d515cfe8ae26345c6ab7e4580 -src-git-full luci https://github.com/immortalwrt/luci.git^09e14b2b116e3f59b9d8e40448841b368e525aef -src-git-full routing https://github.com/openwrt/routing.git^8071852b4556a02533cacb7a0f6a432df3507302 -src-git-full telephony https://github.com/openwrt/telephony.git^920fbc5c0a2e4badf51bceff42e9a1e3eb693462 +src-git-full packages https://github.com/immortalwrt/packages.git;openwrt-21.02 +src-git-full luci https://github.com/immortalwrt/luci.git;openwrt-21.02 +src-git-full routing https://github.com/openwrt/routing.git;openwrt-21.02 +src-git-full telephony https://github.com/openwrt/telephony.git;openwrt-21.02 diff --git a/include/version.mk b/include/version.mk index 5c2d91ba09..187a7322ec 100644 --- a/include/version.mk +++ b/include/version.mk @@ -23,13 +23,13 @@ PKG_CONFIG_DEPENDS += \ sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1)))) VERSION_NUMBER:=$(call qstrip,$(CONFIG_VERSION_NUMBER)) -VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),21.02.6) +VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),21.02-SNAPSHOT) VERSION_CODE:=$(call qstrip,$(CONFIG_VERSION_CODE)) -VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r20007-6e54cb5d37) +VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),$(REVISION)) VERSION_REPO:=$(call qstrip,$(CONFIG_VERSION_REPO)) -VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.immortalwrt.org/releases/21.02.6) +VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.immortalwrt.org/releases/21.02-SNAPSHOT) VERSION_DIST:=$(call qstrip,$(CONFIG_VERSION_DIST)) VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),ImmortalWrt) diff --git a/package/base-files/image-config.in b/package/base-files/image-config.in index d55ed88fe3..9e1e3ca805 100644 --- a/package/base-files/image-config.in +++ b/package/base-files/image-config.in @@ -183,7 +183,7 @@ if VERSIONOPT config VERSION_REPO string prompt "Release repository" - default "https://downloads.immortalwrt.org/releases/21.02.6" + default "https://downloads.immortalwrt.org/releases/21.02-SNAPSHOT" help This is the repository address embedded in the image, it defaults to the trunk snapshot repo; the url may contain the following placeholders: @@ -259,7 +259,7 @@ if VERSIONOPT config VERSION_CODE_FILENAMES bool prompt "Revision code in filenames" - default n + default y help Enable this to include the revision identifier or the configured version code into the firmware image, SDK- and Image Builder archive diff --git a/version b/version deleted file mode 100644 index d147b98198..0000000000 --- a/version +++ /dev/null @@ -1 +0,0 @@ -r20007-6e54cb5d37 diff --git a/version.date b/version.date deleted file mode 100644 index bc40a602c6..0000000000 --- a/version.date +++ /dev/null @@ -1 +0,0 @@ -1682857418 From c694aa33262e6d923d28f8f4bb2186484b0138dc Mon Sep 17 00:00:00 2001 From: Nian Bohung Date: Wed, 3 Nov 2021 09:32:22 -0700 Subject: [PATCH 47/67] linux-firmware: add firmware for intel ax200 Signed-off-by: Nian Bohung (cherry picked from commit 454ebdf1c98317790a103b4497d45b7ad2133fe0) --- package/firmware/linux-firmware/intel.mk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/package/firmware/linux-firmware/intel.mk b/package/firmware/linux-firmware/intel.mk index 923701c703..968c61f64c 100644 --- a/package/firmware/linux-firmware/intel.mk +++ b/package/firmware/linux-firmware/intel.mk @@ -7,6 +7,13 @@ define Package/ibt-firmware/install endef $(eval $(call BuildPackage,ibt-firmware)) +Package/iwlwifi-firmware-ax200 = $(call Package/firmware-default,Intel AX200 firmware) +define Package/iwlwifi-firmware-ax200/install + $(INSTALL_DIR) $(1)/lib/firmware + $(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-cc-a0-62.ucode $(1)/lib/firmware +endef +$(eval $(call BuildPackage,iwlwifi-firmware-ax200)) + Package/iwl3945-firmware = $(call Package/firmware-default,Intel IWL3945 firmware) define Package/iwl3945-firmware/install $(INSTALL_DIR) $(1)/lib/firmware From c74408987170fa1495463e128773e6cf278a67e2 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Mon, 8 May 2023 21:43:25 +0800 Subject: [PATCH 48/67] rockchip: reduce default CMA size to 16 MB Signed-off-by: Tianling Shen --- target/linux/rockchip/armv8/config-5.4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/rockchip/armv8/config-5.4 b/target/linux/rockchip/armv8/config-5.4 index 41d4025fbe..c37db74d06 100644 --- a/target/linux/rockchip/armv8/config-5.4 +++ b/target/linux/rockchip/armv8/config-5.4 @@ -75,7 +75,7 @@ CONFIG_CMA_ALIGNMENT=8 CONFIG_CMA_AREAS=7 # CONFIG_CMA_DEBUG is not set # CONFIG_CMA_DEBUGFS is not set -CONFIG_CMA_SIZE_MBYTES=64 +CONFIG_CMA_SIZE_MBYTES=16 # CONFIG_CMA_SIZE_SEL_MAX is not set CONFIG_CMA_SIZE_SEL_MBYTES=y # CONFIG_CMA_SIZE_SEL_MIN is not set From 47a7e9ae6f25a6b4d99762bd9f8ca6717bd9d4e4 Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Tue, 9 May 2023 21:39:58 +0200 Subject: [PATCH 49/67] build: generate index.json The index.json file lies next to Packages index files and contains a json dict with the package architecture and a dict of package names and versions. This can be used for downstream project to know what packages in which versions are available. Signed-off-by: Paul Spooren (cherry picked from commit 218ce40cd738f3373438aab82467807a8707fb9c) --- package/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package/Makefile b/package/Makefile index 209be34674..4b8df7f484 100644 --- a/package/Makefile +++ b/package/Makefile @@ -92,6 +92,10 @@ $(curdir)/index: FORCE $(call ERROR_MESSAGE,WARNING: Applying padding in $$d/Packages to workaround usign SHA-512 bug!); \ { echo ""; echo ""; } >> Packages;; \ esac; \ + echo -n '{"architecture": "$(ARCH_PACKAGES)", "packages":{' > index.json; \ + sed -n -e 's/^Package: \(.*\)$$/"\1":/p' -e 's/^Version: \(.*\)$$/"\1",/p' Packages | tr '\n' ' ' >> index.json; \ + echo '}}' >> index.json; \ + sed -i 's/, }}/}}/' index.json; \ gzip -9nc Packages > Packages.gz; \ ); done ifdef CONFIG_SIGNED_PACKAGES From 7e8f2a2d6a21955abc2b6cee363b14c769dcab5b Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Wed, 10 May 2023 11:15:29 +0800 Subject: [PATCH 50/67] README: use partial clone Signed-off-by: Tianling Shen (cherry picked from commit 6fc6d068740d158151e6e6297e41a3ee0c9434ff) --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0ace3f5d2e..76995e7754 100644 --- a/README.md +++ b/README.md @@ -45,15 +45,15 @@ To build your own firmware you need a GNU/Linux, BSD or MacOSX system (case sens ``` Note: - - For the for love of god please do __not__ use ROOT user to build your image. + - Do everything as an unprivileged user, not root, without sudo. - Using CPUs based on other architectures should be fine to compile ImmortalWrt, but more hacks are needed - No warranty at all. - - You must __not__ have spaces in PATH or in the work folders on the drive. + - You must __not__ have spaces or non-ascii characters in PATH or in the work folders on the drive. - If you're using Windows Subsystem for Linux (or WSL), removing Windows folders from PATH is required, please see [Build system setup WSL](https://openwrt.org/docs/guide-developer/build-system/wsl) documentation. - Using macOS as the host build OS is __not__ recommended. No warranty at all. You can get tips from [Build system setup macOS](https://openwrt.org/docs/guide-developer/build-system/buildroot.exigence.macosx) documentation. - For more details, please see [Build system setup](https://openwrt.org/docs/guide-developer/build-system/install-buildsystem) documentation. ### Quickstart - 1. Run `git clone -b --single-branch https://github.com/immortalwrt/immortalwrt` to clone the source code. + 1. Run `git clone -b --single-branch --filter=blob:none https://github.com/immortalwrt/immortalwrt` to clone the source code. 2. Run `cd immortalwrt` to enter source directory. 3. Run `./scripts/feeds update -a` to obtain all the latest package definitions defined in feeds.conf / feeds.conf.default 4. Run `./scripts/feeds install -a` to install symlinks for all obtained packages into package/feeds/ From 32e60759e699472f1d664893d64d216058f5309b Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Wed, 10 May 2023 23:33:42 +0800 Subject: [PATCH 51/67] default-settings: add luci to dependency Signed-off-by: Tianling Shen (cherry picked from commit 650f5eacd4db46283a300b625dd140d13e8c99dc) --- package/emortal/default-settings/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/package/emortal/default-settings/Makefile b/package/emortal/default-settings/Makefile index caed1177c2..16398e16bc 100644 --- a/package/emortal/default-settings/Makefile +++ b/package/emortal/default-settings/Makefile @@ -22,6 +22,7 @@ define Package/default-settings SECTION:=luci CATEGORY:=LuCI TITLE:=LuCI support for Default Settings + DEPENDS:=+luci PKGARCH:=all DEPENDS:=+luci-lib-base endef From 25f66d9c49f4f508dba5ad3a6f9b59e9f395b81a Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Fri, 19 May 2023 14:46:43 +0800 Subject: [PATCH 52/67] kernel: bump to 5.4.243 Manually rebased: * bcm27xx/patches-5.4/950-0052-firmware-bcm2835-Support-ARCH_BCM270x.patch * bcm27xx/patches-5.4/950-0642-media-uapi-Add-MEDIA_BUS_FMT_SENSOR_DATA-media-bus-f.patch * bcm27xx/patches-5.4/950-0653-Revert-firmware-raspberrypi-register-clk-device.patch Refreshed all patches. Signed-off-by: Tianling Shen --- include/kernel-5.4 | 4 +- ...0013-firmware-Updated-mailbox-header.patch | 2 +- ...-0027-mm-Remove-the-PFN-busy-warning.patch | 2 +- ...irmware-bcm2835-Support-ARCH_BCM270x.patch | 20 +++++----- ...ware-Export-the-general-transaction-.patch | 4 +- ...pberrypi-Notify-firmware-of-a-reboot.patch | 6 +-- ...rypi-Add-backward-compatible-get_thr.patch | 12 +++--- ...rypi-Report-the-fw-variant-during-pr.patch | 4 +- ...lise-rpi-firmware-before-clk-bcm2835.patch | 2 +- ...EDIA_BUS_FMT_SENSOR_DATA-media-bus-f.patch | 17 ++++---- ...ware-raspberrypi-register-clk-device.patch | 16 ++++---- ...rypi-Add-support-for-tryonce-reboot-.patch | 4 +- ...formation-about-stacked-DSA-protocol.patch | 2 +- ...e6xxx-Add-support-for-port-mirroring.patch | 4 +- ...x-fix-broken-if-statement-because-of.patch | 2 +- .../993-usb-serial-option-add-u9300.patch | 4 +- ...e_mem_map-with-ARCH_PFN_OFFSET-calcu.patch | 2 +- .../pending-5.4/630-packet_socket_type.patch | 16 ++++---- ...w_table-add-hardware-offload-support.patch | 6 +-- ...equest-assisted-learning-on-CPU-port.patch | 2 +- .../0072-add-ipq806x-with-no-clocks.patch | 2 +- ...hc-poll-ESDHC_FLUSH_ASYNC_FIFO-bit-u.patch | 6 +-- ...-of-esdhc-convert-to-use-esdhc_tunin.patch | 6 +-- ...-of-esdhc-update-tuning-erratum-A-00.patch | 6 +-- ...l_lpuart-enable-dma-mode-for-imx8qxp.patch | 2 +- ...Add-cache-type-configuration-support.patch | 2 +- ...usb-dwc3-Add-cache-type-configuratio.patch | 2 +- ...3-Add-cache-type-configuration-suppo.patch | 2 +- ...0-v5.6-crypto-backport-inside-secure.patch | 40 +++++++++---------- ...03-crypto-fix-eip97-cache-incoherent.patch | 2 +- .../patches-5.4/0900-bt-mtk-serial-fix.patch | 4 +- 31 files changed, 102 insertions(+), 103 deletions(-) diff --git a/include/kernel-5.4 b/include/kernel-5.4 index fbf5667648..2e0463537b 100644 --- a/include/kernel-5.4 +++ b/include/kernel-5.4 @@ -1,2 +1,2 @@ -LINUX_VERSION-5.4 = .242 -LINUX_KERNEL_HASH-5.4.242 = 142f9aed1c9f2e409dd72c5c490ad824dddf31f955ed2097d5989c4b5074fc28 +LINUX_VERSION-5.4 = .243 +LINUX_KERNEL_HASH-5.4.243 = c3cf664feeeee47e0f0c45c53705568f73692c37a3ff7f11c1b15e59610feb04 diff --git a/target/linux/bcm27xx/patches-5.4/950-0013-firmware-Updated-mailbox-header.patch b/target/linux/bcm27xx/patches-5.4/950-0013-firmware-Updated-mailbox-header.patch index 4c149e7825..e353521987 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0013-firmware-Updated-mailbox-header.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0013-firmware-Updated-mailbox-header.patch @@ -18,7 +18,7 @@ Subject: [PATCH] firmware: Updated mailbox header struct rpi_firmware; enum rpi_firmware_property_status { -@@ -159,5 +161,6 @@ static inline struct rpi_firmware *rpi_f +@@ -169,5 +171,6 @@ static inline struct rpi_firmware *devm_ return NULL; } #endif diff --git a/target/linux/bcm27xx/patches-5.4/950-0027-mm-Remove-the-PFN-busy-warning.patch b/target/linux/bcm27xx/patches-5.4/950-0027-mm-Remove-the-PFN-busy-warning.patch index 9000b5c0ed..d924a133c6 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0027-mm-Remove-the-PFN-busy-warning.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0027-mm-Remove-the-PFN-busy-warning.patch @@ -14,7 +14,7 @@ Signed-off-by: Eric Anholt --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -8566,8 +8566,6 @@ int alloc_contig_range(unsigned long sta +@@ -8582,8 +8582,6 @@ int alloc_contig_range(unsigned long sta /* Make sure the range is really isolated. */ if (test_pages_isolated(outer_start, end, false)) { diff --git a/target/linux/bcm27xx/patches-5.4/950-0052-firmware-bcm2835-Support-ARCH_BCM270x.patch b/target/linux/bcm27xx/patches-5.4/950-0052-firmware-bcm2835-Support-ARCH_BCM270x.patch index a561e589db..2f6c37cce3 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0052-firmware-bcm2835-Support-ARCH_BCM270x.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0052-firmware-bcm2835-Support-ARCH_BCM270x.patch @@ -27,8 +27,8 @@ Signed-off-by: Noralf Trønnes --- a/drivers/firmware/raspberrypi.c +++ b/drivers/firmware/raspberrypi.c -@@ -29,6 +29,8 @@ struct rpi_firmware { - u32 enabled; +@@ -32,6 +32,8 @@ struct rpi_firmware { + struct kref consumers; }; +static struct platform_device *g_pdev; @@ -36,32 +36,32 @@ Signed-off-by: Noralf Trønnes static DEFINE_MUTEX(transaction_lock); static void response_callback(struct mbox_client *cl, void *msg) -@@ -238,6 +240,7 @@ static int rpi_firmware_probe(struct pla - init_completion(&fw->c); +@@ -269,6 +271,7 @@ static int rpi_firmware_probe(struct pla + kref_init(&fw->consumers); platform_set_drvdata(pdev, fw); + g_pdev = pdev; rpi_firmware_print_firmware_revision(fw); rpi_register_hwmon_driver(dev, fw); -@@ -265,6 +268,7 @@ static int rpi_firmware_remove(struct pl - platform_device_unregister(rpi_clk); +@@ -297,6 +300,7 @@ static int rpi_firmware_remove(struct pl rpi_clk = NULL; - mbox_free_channel(fw->chan); + + rpi_firmware_put(fw); + g_pdev = NULL; return 0; } -@@ -277,7 +281,7 @@ static int rpi_firmware_remove(struct pl +@@ -311,7 +315,7 @@ static int rpi_firmware_remove(struct pl */ struct rpi_firmware *rpi_firmware_get(struct device_node *firmware_node) { - struct platform_device *pdev = of_find_device_by_node(firmware_node); + struct platform_device *pdev = g_pdev; + struct rpi_firmware *fw; if (!pdev) - return NULL; -@@ -301,7 +305,18 @@ static struct platform_driver rpi_firmwa +@@ -365,7 +369,18 @@ static struct platform_driver rpi_firmwa .shutdown = rpi_firmware_shutdown, .remove = rpi_firmware_remove, }; diff --git a/target/linux/bcm27xx/patches-5.4/950-0094-raspberrypi-firmware-Export-the-general-transaction-.patch b/target/linux/bcm27xx/patches-5.4/950-0094-raspberrypi-firmware-Export-the-general-transaction-.patch index 02f1a6ffd4..b00f45f3db 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0094-raspberrypi-firmware-Export-the-general-transaction-.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0094-raspberrypi-firmware-Export-the-general-transaction-.patch @@ -13,7 +13,7 @@ Signed-off-by: Eric Anholt --- a/drivers/firmware/raspberrypi.c +++ b/drivers/firmware/raspberrypi.c -@@ -43,7 +43,7 @@ static void response_callback(struct mbo +@@ -46,7 +46,7 @@ static void response_callback(struct mbo * Sends a request to the firmware through the BCM2835 mailbox driver, * and synchronously waits for the reply. */ @@ -22,7 +22,7 @@ Signed-off-by: Eric Anholt rpi_firmware_transaction(struct rpi_firmware *fw, u32 chan, u32 data) { u32 message = MBOX_MSG(chan, data); -@@ -68,6 +68,7 @@ rpi_firmware_transaction(struct rpi_firm +@@ -71,6 +71,7 @@ rpi_firmware_transaction(struct rpi_firm return ret; } diff --git a/target/linux/bcm27xx/patches-5.4/950-0114-firmware-raspberrypi-Notify-firmware-of-a-reboot.patch b/target/linux/bcm27xx/patches-5.4/950-0114-firmware-raspberrypi-Notify-firmware-of-a-reboot.patch index 1db30c9cc1..947bce99a7 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0114-firmware-raspberrypi-Notify-firmware-of-a-reboot.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0114-firmware-raspberrypi-Notify-firmware-of-a-reboot.patch @@ -13,7 +13,7 @@ Signed-off-by: Phil Elwell --- a/drivers/firmware/raspberrypi.c +++ b/drivers/firmware/raspberrypi.c -@@ -12,6 +12,7 @@ +@@ -13,6 +13,7 @@ #include #include #include @@ -21,7 +21,7 @@ Signed-off-by: Phil Elwell #include #define MBOX_MSG(chan, data28) (((data28) & ~0xf) | ((chan) & 0xf)) -@@ -177,6 +178,26 @@ int rpi_firmware_property(struct rpi_fir +@@ -180,6 +181,26 @@ int rpi_firmware_property(struct rpi_fir } EXPORT_SYMBOL_GPL(rpi_firmware_property); @@ -48,7 +48,7 @@ Signed-off-by: Phil Elwell static void rpi_firmware_print_firmware_revision(struct rpi_firmware *fw) { -@@ -307,15 +328,32 @@ static struct platform_driver rpi_firmwa +@@ -371,15 +392,32 @@ static struct platform_driver rpi_firmwa .remove = rpi_firmware_remove, }; diff --git a/target/linux/bcm27xx/patches-5.4/950-0123-firmware-raspberrypi-Add-backward-compatible-get_thr.patch b/target/linux/bcm27xx/patches-5.4/950-0123-firmware-raspberrypi-Add-backward-compatible-get_thr.patch index 6049c55acb..b842e4b2b2 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0123-firmware-raspberrypi-Add-backward-compatible-get_thr.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0123-firmware-raspberrypi-Add-backward-compatible-get_thr.patch @@ -16,15 +16,15 @@ Signed-off-by: Stefan Wahren --- a/drivers/firmware/raspberrypi.c +++ b/drivers/firmware/raspberrypi.c -@@ -28,6 +28,7 @@ struct rpi_firmware { - struct mbox_chan *chan; /* The property channel. */ - struct completion c; +@@ -31,6 +31,7 @@ struct rpi_firmware { u32 enabled; + + struct kref consumers; + u32 get_throttled; }; static struct platform_device *g_pdev; -@@ -174,6 +175,12 @@ int rpi_firmware_property(struct rpi_fir +@@ -177,6 +178,12 @@ int rpi_firmware_property(struct rpi_fir kfree(data); @@ -37,7 +37,7 @@ Signed-off-by: Stefan Wahren return ret; } EXPORT_SYMBOL_GPL(rpi_firmware_property); -@@ -198,6 +205,27 @@ static int rpi_firmware_notify_reboot(st +@@ -201,6 +208,27 @@ static int rpi_firmware_notify_reboot(st return 0; } @@ -65,7 +65,7 @@ Signed-off-by: Stefan Wahren static void rpi_firmware_print_firmware_revision(struct rpi_firmware *fw) { -@@ -230,6 +258,11 @@ rpi_register_hwmon_driver(struct device +@@ -233,6 +261,11 @@ rpi_register_hwmon_driver(struct device rpi_hwmon = platform_device_register_data(dev, "raspberrypi-hwmon", -1, NULL, 0); diff --git a/target/linux/bcm27xx/patches-5.4/950-0131-firmware-raspberrypi-Report-the-fw-variant-during-pr.patch b/target/linux/bcm27xx/patches-5.4/950-0131-firmware-raspberrypi-Report-the-fw-variant-during-pr.patch index c0d3eb0d67..6531b4c516 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0131-firmware-raspberrypi-Report-the-fw-variant-during-pr.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0131-firmware-raspberrypi-Report-the-fw-variant-during-pr.patch @@ -27,7 +27,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/firmware/raspberrypi.c +++ b/drivers/firmware/raspberrypi.c -@@ -229,21 +229,55 @@ static const struct attribute_group rpi_ +@@ -232,21 +232,55 @@ static const struct attribute_group rpi_ static void rpi_firmware_print_firmware_revision(struct rpi_firmware *fw) { @@ -90,7 +90,7 @@ Signed-off-by: Dave Stevenson } static void -@@ -298,6 +332,7 @@ static int rpi_firmware_probe(struct pla +@@ -329,6 +363,7 @@ static int rpi_firmware_probe(struct pla g_pdev = pdev; rpi_firmware_print_firmware_revision(fw); diff --git a/target/linux/bcm27xx/patches-5.4/950-0389-Initialise-rpi-firmware-before-clk-bcm2835.patch b/target/linux/bcm27xx/patches-5.4/950-0389-Initialise-rpi-firmware-before-clk-bcm2835.patch index ec26bfbb7d..81ed8a96cf 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0389-Initialise-rpi-firmware-before-clk-bcm2835.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0389-Initialise-rpi-firmware-before-clk-bcm2835.patch @@ -36,7 +36,7 @@ Co-authored-by: Phil Elwell MODULE_DESCRIPTION("BCM2835 clock driver"); --- a/drivers/firmware/raspberrypi.c +++ b/drivers/firmware/raspberrypi.c -@@ -416,7 +416,7 @@ out2: +@@ -480,7 +480,7 @@ out2: out1: return ret; } diff --git a/target/linux/bcm27xx/patches-5.4/950-0642-media-uapi-Add-MEDIA_BUS_FMT_SENSOR_DATA-media-bus-f.patch b/target/linux/bcm27xx/patches-5.4/950-0642-media-uapi-Add-MEDIA_BUS_FMT_SENSOR_DATA-media-bus-f.patch index 65162cc5d5..42abcfca1c 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0642-media-uapi-Add-MEDIA_BUS_FMT_SENSOR_DATA-media-bus-f.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0642-media-uapi-Add-MEDIA_BUS_FMT_SENSOR_DATA-media-bus-f.patch @@ -15,11 +15,10 @@ Signed-off-by: Naushir Patuck --- a/Documentation/media/uapi/v4l/subdev-formats.rst +++ b/Documentation/media/uapi/v4l/subdev-formats.rst -@@ -7794,3 +7794,36 @@ formats. - - 0x5001 - - Interleaved raw UYVY and JPEG image format with embedded meta-data - used by Samsung S3C73MX camera sensors. -+ +@@ -7821,3 +7821,35 @@ The following table lists the existing m + both sides of the link and the bus format is a fixed + metadata format that is not configurable from userspace. + Width and height will be set to 0 for this format. + + +.. _v4l2-mbus-sensor-data: @@ -54,11 +53,11 @@ Signed-off-by: Naushir Patuck + --- a/include/uapi/linux/media-bus-format.h +++ b/include/uapi/linux/media-bus-format.h -@@ -155,4 +155,7 @@ - /* HSV - next is 0x6002 */ - #define MEDIA_BUS_FMT_AHSV8888_1X32 0x6001 +@@ -163,4 +163,7 @@ + */ + #define MEDIA_BUS_FMT_METADATA_FIXED 0x7001 +/* Sensor ancillary metadata formats - next is 0x7002 */ -+#define MEDIA_BUS_FMT_SENSOR_DATA 0x7001 ++#define MEDIA_BUS_FMT_SENSOR_DATA 0x7002 + #endif /* __LINUX_MEDIA_BUS_FORMAT_H */ diff --git a/target/linux/bcm27xx/patches-5.4/950-0653-Revert-firmware-raspberrypi-register-clk-device.patch b/target/linux/bcm27xx/patches-5.4/950-0653-Revert-firmware-raspberrypi-register-clk-device.patch index 01533d1f3f..2cfeabf004 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0653-Revert-firmware-raspberrypi-register-clk-device.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0653-Revert-firmware-raspberrypi-register-clk-device.patch @@ -18,7 +18,7 @@ Signed-off-by: Phil Elwell --- a/drivers/firmware/raspberrypi.c +++ b/drivers/firmware/raspberrypi.c -@@ -21,7 +21,6 @@ +@@ -22,7 +22,6 @@ #define MBOX_CHAN_PROPERTY 8 static struct platform_device *rpi_hwmon; @@ -26,7 +26,7 @@ Signed-off-by: Phil Elwell struct rpi_firmware { struct mbox_client cl; -@@ -299,12 +298,6 @@ rpi_register_hwmon_driver(struct device +@@ -302,12 +301,6 @@ rpi_register_hwmon_driver(struct device } } @@ -36,10 +36,10 @@ Signed-off-by: Phil Elwell - -1, NULL, 0); -} - - static int rpi_firmware_probe(struct platform_device *pdev) + static void rpi_firmware_delete(struct kref *kref) { - struct device *dev = &pdev->dev; -@@ -334,7 +327,6 @@ static int rpi_firmware_probe(struct pla + struct rpi_firmware *fw = container_of(kref, struct rpi_firmware, +@@ -365,7 +358,6 @@ static int rpi_firmware_probe(struct pla rpi_firmware_print_firmware_revision(fw); rpi_firmware_print_firmware_hash(fw); rpi_register_hwmon_driver(dev, fw); @@ -47,12 +47,12 @@ Signed-off-by: Phil Elwell return 0; } -@@ -355,8 +347,6 @@ static int rpi_firmware_remove(struct pl +@@ -386,8 +378,6 @@ static int rpi_firmware_remove(struct pl platform_device_unregister(rpi_hwmon); rpi_hwmon = NULL; - platform_device_unregister(rpi_clk); - rpi_clk = NULL; - mbox_free_channel(fw->chan); - g_pdev = NULL; + rpi_firmware_put(fw); + g_pdev = NULL; diff --git a/target/linux/bcm27xx/patches-5.4/950-1009-firmware-raspberrypi-Add-support-for-tryonce-reboot-.patch b/target/linux/bcm27xx/patches-5.4/950-1009-firmware-raspberrypi-Add-support-for-tryonce-reboot-.patch index 4d7a83f02b..6a25337143 100644 --- a/target/linux/bcm27xx/patches-5.4/950-1009-firmware-raspberrypi-Add-support-for-tryonce-reboot-.patch +++ b/target/linux/bcm27xx/patches-5.4/950-1009-firmware-raspberrypi-Add-support-for-tryonce-reboot-.patch @@ -20,7 +20,7 @@ mechanism to be implemented for OS upgrades. --- a/drivers/firmware/raspberrypi.c +++ b/drivers/firmware/raspberrypi.c -@@ -190,6 +190,7 @@ static int rpi_firmware_notify_reboot(st +@@ -193,6 +193,7 @@ static int rpi_firmware_notify_reboot(st { struct rpi_firmware *fw; struct platform_device *pdev = g_pdev; @@ -28,7 +28,7 @@ mechanism to be implemented for OS upgrades. if (!pdev) return 0; -@@ -198,8 +199,28 @@ static int rpi_firmware_notify_reboot(st +@@ -201,8 +202,28 @@ static int rpi_firmware_notify_reboot(st if (!fw) return 0; diff --git a/target/linux/generic/backport-5.4/704-v5.6-net-dsa-Get-information-about-stacked-DSA-protocol.patch b/target/linux/generic/backport-5.4/704-v5.6-net-dsa-Get-information-about-stacked-DSA-protocol.patch index e8a3e67fdb..4ec12dabb5 100644 --- a/target/linux/generic/backport-5.4/704-v5.6-net-dsa-Get-information-about-stacked-DSA-protocol.patch +++ b/target/linux/generic/backport-5.4/704-v5.6-net-dsa-Get-information-about-stacked-DSA-protocol.patch @@ -202,7 +202,7 @@ Signed-off-by: David S. Miller } --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c -@@ -4883,7 +4883,8 @@ static struct mv88e6xxx_chip *mv88e6xxx_ +@@ -4884,7 +4884,8 @@ static struct mv88e6xxx_chip *mv88e6xxx_ } static enum dsa_tag_protocol mv88e6xxx_get_tag_protocol(struct dsa_switch *ds, diff --git a/target/linux/generic/backport-5.4/747-v5.5-net-dsa-mv88e6xxx-Add-support-for-port-mirroring.patch b/target/linux/generic/backport-5.4/747-v5.5-net-dsa-mv88e6xxx-Add-support-for-port-mirroring.patch index 6205f83334..7cf5fc5893 100644 --- a/target/linux/generic/backport-5.4/747-v5.5-net-dsa-mv88e6xxx-Add-support-for-port-mirroring.patch +++ b/target/linux/generic/backport-5.4/747-v5.5-net-dsa-mv88e6xxx-Add-support-for-port-mirroring.patch @@ -25,7 +25,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c -@@ -4934,6 +4934,80 @@ static int mv88e6xxx_port_mdb_del(struct +@@ -4935,6 +4935,80 @@ static int mv88e6xxx_port_mdb_del(struct return err; } @@ -106,7 +106,7 @@ Signed-off-by: David S. Miller static int mv88e6xxx_port_egress_floods(struct dsa_switch *ds, int port, bool unicast, bool multicast) { -@@ -4988,6 +5062,8 @@ static const struct dsa_switch_ops mv88e +@@ -4989,6 +5063,8 @@ static const struct dsa_switch_ops mv88e .port_mdb_prepare = mv88e6xxx_port_mdb_prepare, .port_mdb_add = mv88e6xxx_port_mdb_add, .port_mdb_del = mv88e6xxx_port_mdb_del, diff --git a/target/linux/generic/backport-5.4/748-v5.5-net-dsa-mv88e6xxx-fix-broken-if-statement-because-of.patch b/target/linux/generic/backport-5.4/748-v5.5-net-dsa-mv88e6xxx-fix-broken-if-statement-because-of.patch index 035e3634a2..bc2a4085c0 100644 --- a/target/linux/generic/backport-5.4/748-v5.5-net-dsa-mv88e6xxx-fix-broken-if-statement-because-of.patch +++ b/target/linux/generic/backport-5.4/748-v5.5-net-dsa-mv88e6xxx-fix-broken-if-statement-because-of.patch @@ -19,7 +19,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c -@@ -5001,7 +5001,7 @@ static void mv88e6xxx_port_mirror_del(st +@@ -5002,7 +5002,7 @@ static void mv88e6xxx_port_mirror_del(st if (chip->info->ops->set_egress_port(chip, direction, dsa_upstream_port(ds, diff --git a/target/linux/generic/hack-5.4/993-usb-serial-option-add-u9300.patch b/target/linux/generic/hack-5.4/993-usb-serial-option-add-u9300.patch index 9122d85183..dbe1e1cf55 100644 --- a/target/linux/generic/hack-5.4/993-usb-serial-option-add-u9300.patch +++ b/target/linux/generic/hack-5.4/993-usb-serial-option-add-u9300.patch @@ -18,7 +18,7 @@ /* 4G Systems products */ /* This one was sold as the VW and Skoda "Carstick LTE" */ -@@ -612,6 +613,16 @@ static void option_instat_callback(struc +@@ -617,6 +618,16 @@ static void option_instat_callback(struc /* Device needs ZLP */ #define ZLP BIT(17) @@ -35,7 +35,7 @@ static const struct usb_device_id option_ids[] = { { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, -@@ -646,6 +657,8 @@ static const struct usb_device_id option +@@ -651,6 +662,8 @@ static const struct usb_device_id option { USB_DEVICE(QUANTA_VENDOR_ID, QUANTA_PRODUCT_GLE) }, { USB_DEVICE(QUANTA_VENDOR_ID, 0xea42), .driver_info = RSVD(4) }, diff --git a/target/linux/generic/pending-5.4/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch b/target/linux/generic/pending-5.4/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch index 680ea7e9b8..fcf3aa035a 100644 --- a/target/linux/generic/pending-5.4/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch +++ b/target/linux/generic/pending-5.4/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch @@ -71,7 +71,7 @@ Signed-off-by: Tobias Wolf --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -6931,7 +6931,7 @@ static void __ref alloc_node_mem_map(str +@@ -6947,7 +6947,7 @@ static void __ref alloc_node_mem_map(str mem_map = NODE_DATA(0)->node_mem_map; #if defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP) || defined(CONFIG_FLATMEM) if (page_to_pfn(mem_map) != pgdat->node_start_pfn) diff --git a/target/linux/generic/pending-5.4/630-packet_socket_type.patch b/target/linux/generic/pending-5.4/630-packet_socket_type.patch index 38323ab5f0..848042bcd6 100644 --- a/target/linux/generic/pending-5.4/630-packet_socket_type.patch +++ b/target/linux/generic/pending-5.4/630-packet_socket_type.patch @@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau #define PACKET_FANOUT_LB 1 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c -@@ -1801,6 +1801,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1802,6 +1802,7 @@ static int packet_rcv_spkt(struct sk_buf { struct sock *sk; struct sockaddr_pkt *spkt; @@ -38,7 +38,7 @@ Signed-off-by: Felix Fietkau /* * When we registered the protocol we saved the socket in the data -@@ -1808,6 +1809,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1809,6 +1810,7 @@ static int packet_rcv_spkt(struct sk_buf */ sk = pt->af_packet_priv; @@ -46,7 +46,7 @@ Signed-off-by: Felix Fietkau /* * Yank back the headers [hope the device set this -@@ -1820,7 +1822,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1821,7 +1823,7 @@ static int packet_rcv_spkt(struct sk_buf * so that this procedure is noop. */ @@ -55,7 +55,7 @@ Signed-off-by: Felix Fietkau goto out; if (!net_eq(dev_net(dev), sock_net(sk))) -@@ -2068,12 +2070,12 @@ static int packet_rcv(struct sk_buff *sk +@@ -2069,12 +2071,12 @@ static int packet_rcv(struct sk_buff *sk unsigned int snaplen, res; bool is_drop_n_account = false; @@ -71,7 +71,7 @@ Signed-off-by: Felix Fietkau if (!net_eq(dev_net(dev), sock_net(sk))) goto drop; -@@ -2199,12 +2201,12 @@ static int tpacket_rcv(struct sk_buff *s +@@ -2200,12 +2202,12 @@ static int tpacket_rcv(struct sk_buff *s BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h2)) != 32); BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h3)) != 48); @@ -87,7 +87,7 @@ Signed-off-by: Felix Fietkau if (!net_eq(dev_net(dev), sock_net(sk))) goto drop; -@@ -3310,6 +3312,7 @@ static int packet_create(struct net *net +@@ -3313,6 +3315,7 @@ static int packet_create(struct net *net mutex_init(&po->pg_vec_lock); po->rollover = NULL; po->prot_hook.func = packet_rcv; @@ -96,7 +96,7 @@ Signed-off-by: Felix Fietkau if (sock->type == SOCK_PACKET) po->prot_hook.func = packet_rcv_spkt; @@ -3952,6 +3955,16 @@ packet_setsockopt(struct socket *sock, i - po->xmit = val ? packet_direct_xmit : dev_queue_xmit; + WRITE_ONCE(po->xmit, val ? packet_direct_xmit : dev_queue_xmit); return 0; } + case PACKET_RECV_TYPE: @@ -128,7 +128,7 @@ Signed-off-by: Felix Fietkau break; --- a/net/packet/internal.h +++ b/net/packet/internal.h -@@ -136,6 +136,7 @@ struct packet_sock { +@@ -135,6 +135,7 @@ struct packet_sock { int (*xmit)(struct sk_buff *skb); struct packet_type prot_hook ____cacheline_aligned_in_smp; atomic_t tp_drops ____cacheline_aligned_in_smp; diff --git a/target/linux/generic/pending-5.4/640-netfilter-nf_flow_table-add-hardware-offload-support.patch b/target/linux/generic/pending-5.4/640-netfilter-nf_flow_table-add-hardware-offload-support.patch index 88d2cb10ad..0eec482784 100644 --- a/target/linux/generic/pending-5.4/640-netfilter-nf_flow_table-add-hardware-offload-support.patch +++ b/target/linux/generic/pending-5.4/640-netfilter-nf_flow_table-add-hardware-offload-support.patch @@ -506,7 +506,7 @@ Signed-off-by: Pablo Neira Ayuso +MODULE_ALIAS("nf-flow-table-hw"); --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c -@@ -5758,6 +5758,13 @@ static int nf_tables_flowtable_parse_hoo +@@ -5770,6 +5770,13 @@ static int nf_tables_flowtable_parse_hoo if (err < 0) return err; @@ -520,7 +520,7 @@ Signed-off-by: Pablo Neira Ayuso ops = kcalloc(n, sizeof(struct nf_hook_ops), GFP_KERNEL); if (!ops) return -ENOMEM; -@@ -5888,10 +5895,19 @@ static int nf_tables_newflowtable(struct +@@ -5900,10 +5907,19 @@ static int nf_tables_newflowtable(struct } flowtable->data.type = type; @@ -540,7 +540,7 @@ Signed-off-by: Pablo Neira Ayuso err = nf_tables_flowtable_parse_hook(&ctx, nla[NFTA_FLOWTABLE_HOOK], flowtable); if (err < 0) -@@ -6017,7 +6033,8 @@ static int nf_tables_fill_flowtable_info +@@ -6029,7 +6045,8 @@ static int nf_tables_fill_flowtable_info nla_put_string(skb, NFTA_FLOWTABLE_NAME, flowtable->name) || nla_put_be32(skb, NFTA_FLOWTABLE_USE, htonl(flowtable->use)) || nla_put_be64(skb, NFTA_FLOWTABLE_HANDLE, cpu_to_be64(flowtable->handle), diff --git a/target/linux/generic/pending-5.4/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch b/target/linux/generic/pending-5.4/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch index a9b7d784af..13267a4002 100644 --- a/target/linux/generic/pending-5.4/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch +++ b/target/linux/generic/pending-5.4/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch @@ -17,7 +17,7 @@ Signed-off-by: Tobias Waldekranz --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c -@@ -5088,6 +5088,7 @@ static int mv88e6xxx_register_switch(str +@@ -5089,6 +5089,7 @@ static int mv88e6xxx_register_switch(str ds->ops = &mv88e6xxx_switch_ops; ds->ageing_time_min = chip->info->age_time_coeff; ds->ageing_time_max = chip->info->age_time_coeff * U8_MAX; diff --git a/target/linux/ipq806x/patches-5.4/0072-add-ipq806x-with-no-clocks.patch b/target/linux/ipq806x/patches-5.4/0072-add-ipq806x-with-no-clocks.patch index b7cebd9d39..50848c27a7 100644 --- a/target/linux/ipq806x/patches-5.4/0072-add-ipq806x-with-no-clocks.patch +++ b/target/linux/ipq806x/patches-5.4/0072-add-ipq806x-with-no-clocks.patch @@ -1,6 +1,6 @@ --- a/drivers/firmware/qcom_scm.c +++ b/drivers/firmware/qcom_scm.c -@@ -598,6 +598,7 @@ static const struct of_device_id qcom_sc +@@ -597,6 +597,7 @@ static const struct of_device_id qcom_sc SCM_HAS_BUS_CLK) }, { .compatible = "qcom,scm-ipq4019" }, diff --git a/target/linux/layerscape/patches-5.4/816-sdhc-0001-mmc-sdhci-of-esdhc-poll-ESDHC_FLUSH_ASYNC_FIFO-bit-u.patch b/target/linux/layerscape/patches-5.4/816-sdhc-0001-mmc-sdhci-of-esdhc-poll-ESDHC_FLUSH_ASYNC_FIFO-bit-u.patch index 35f4c1bf84..73441a6c9d 100644 --- a/target/linux/layerscape/patches-5.4/816-sdhc-0001-mmc-sdhci-of-esdhc-poll-ESDHC_FLUSH_ASYNC_FIFO-bit-u.patch +++ b/target/linux/layerscape/patches-5.4/816-sdhc-0001-mmc-sdhci-of-esdhc-poll-ESDHC_FLUSH_ASYNC_FIFO-bit-u.patch @@ -14,7 +14,7 @@ Signed-off-by: Yangbo Lu --- a/drivers/mmc/host/sdhci-of-esdhc.c +++ b/drivers/mmc/host/sdhci-of-esdhc.c -@@ -596,6 +596,32 @@ static void esdhc_clock_enable(struct sd +@@ -594,6 +594,32 @@ static void esdhc_clock_enable(struct sd } } @@ -47,7 +47,7 @@ Signed-off-by: Yangbo Lu static void esdhc_of_set_clock(struct sdhci_host *host, unsigned int clock) { struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); -@@ -688,9 +714,7 @@ static void esdhc_of_set_clock(struct sd +@@ -686,9 +712,7 @@ static void esdhc_of_set_clock(struct sd sdhci_writel(host, temp | ESDHC_HS400_WNDW_ADJUST, ESDHC_TBCTL); esdhc_clock_enable(host, false); @@ -58,7 +58,7 @@ Signed-off-by: Yangbo Lu } /* Wait max 20 ms */ -@@ -893,10 +917,7 @@ static void esdhc_tuning_block_enable(st +@@ -891,10 +915,7 @@ static void esdhc_tuning_block_enable(st u32 val; esdhc_clock_enable(host, false); diff --git a/target/linux/layerscape/patches-5.4/816-sdhc-0002-LF-605-mmc-sdhci-of-esdhc-convert-to-use-esdhc_tunin.patch b/target/linux/layerscape/patches-5.4/816-sdhc-0002-LF-605-mmc-sdhci-of-esdhc-convert-to-use-esdhc_tunin.patch index 66518ca01e..e9149b8a5e 100644 --- a/target/linux/layerscape/patches-5.4/816-sdhc-0002-LF-605-mmc-sdhci-of-esdhc-convert-to-use-esdhc_tunin.patch +++ b/target/linux/layerscape/patches-5.4/816-sdhc-0002-LF-605-mmc-sdhci-of-esdhc-convert-to-use-esdhc_tunin.patch @@ -15,7 +15,7 @@ Acked-by: Adrian Hunter --- a/drivers/mmc/host/sdhci-of-esdhc.c +++ b/drivers/mmc/host/sdhci-of-esdhc.c -@@ -929,20 +929,11 @@ static void esdhc_tuning_block_enable(st +@@ -927,20 +927,11 @@ static void esdhc_tuning_block_enable(st esdhc_clock_enable(host, true); } @@ -37,7 +37,7 @@ Acked-by: Adrian Hunter /* Write TBCTL[11:8]=4'h8 */ val = sdhci_readl(host, ESDHC_TBCTL); val &= ~(0xf << 8); -@@ -961,6 +952,25 @@ static void esdhc_prepare_sw_tuning(stru +@@ -959,6 +950,25 @@ static void esdhc_prepare_sw_tuning(stru val = sdhci_readl(host, ESDHC_TBSTAT); val = sdhci_readl(host, ESDHC_TBSTAT); @@ -63,7 +63,7 @@ Acked-by: Adrian Hunter /* Reset data lines by setting ESDHCCTL[RSTD] */ sdhci_reset(host, SDHCI_RESET_DATA); /* Write 32'hFFFF_FFFF to IRQSTAT register */ -@@ -971,10 +981,8 @@ static void esdhc_prepare_sw_tuning(stru +@@ -969,10 +979,8 @@ static void esdhc_prepare_sw_tuning(stru * then program TBPTR[TB_WNDW_END_PTR] = 4 * div_ratio * and program TBPTR[TB_WNDW_START_PTR] = 8 * div_ratio. */ diff --git a/target/linux/layerscape/patches-5.4/816-sdhc-0003-LF-605-mmc-sdhci-of-esdhc-update-tuning-erratum-A-00.patch b/target/linux/layerscape/patches-5.4/816-sdhc-0003-LF-605-mmc-sdhci-of-esdhc-update-tuning-erratum-A-00.patch index f9722b3698..c2475244b8 100644 --- a/target/linux/layerscape/patches-5.4/816-sdhc-0003-LF-605-mmc-sdhci-of-esdhc-update-tuning-erratum-A-00.patch +++ b/target/linux/layerscape/patches-5.4/816-sdhc-0003-LF-605-mmc-sdhci-of-esdhc-update-tuning-erratum-A-00.patch @@ -20,7 +20,7 @@ Acked-by: Adrian Hunter --- a/drivers/mmc/host/sdhci-of-esdhc.c +++ b/drivers/mmc/host/sdhci-of-esdhc.c -@@ -895,20 +895,20 @@ static int esdhc_signal_voltage_switch(s +@@ -893,20 +893,20 @@ static int esdhc_signal_voltage_switch(s } static struct soc_device_attribute soc_tuning_erratum_type1[] = { @@ -51,7 +51,7 @@ Acked-by: Adrian Hunter { }, }; -@@ -976,13 +976,13 @@ static void esdhc_prepare_sw_tuning(stru +@@ -974,13 +974,13 @@ static void esdhc_prepare_sw_tuning(stru /* Write 32'hFFFF_FFFF to IRQSTAT register */ sdhci_writel(host, 0xFFFFFFFF, SDHCI_INT_STATUS); @@ -68,7 +68,7 @@ Acked-by: Adrian Hunter *window_start = 8 * esdhc->div_ratio; *window_end = 4 * esdhc->div_ratio; } else { -@@ -1066,6 +1066,19 @@ static int esdhc_execute_tuning(struct m +@@ -1064,6 +1064,19 @@ static int esdhc_execute_tuning(struct m if (ret) break; diff --git a/target/linux/layerscape/patches-5.4/819-uart-0005-tty-serial-fsl_lpuart-enable-dma-mode-for-imx8qxp.patch b/target/linux/layerscape/patches-5.4/819-uart-0005-tty-serial-fsl_lpuart-enable-dma-mode-for-imx8qxp.patch index 6b6458d440..9291439d2c 100644 --- a/target/linux/layerscape/patches-5.4/819-uart-0005-tty-serial-fsl_lpuart-enable-dma-mode-for-imx8qxp.patch +++ b/target/linux/layerscape/patches-5.4/819-uart-0005-tty-serial-fsl_lpuart-enable-dma-mode-for-imx8qxp.patch @@ -299,7 +299,7 @@ Signed-off-by: Fugang Duan struct tty_port *port = &sport->port.state->port; struct tty_struct *tty = port->tty; @@ -1183,6 +1308,18 @@ static inline int lpuart_start_rx_dma(st - sport->rx_dma_rng_buf_len = (1 << (fls(sport->rx_dma_rng_buf_len) - 1)); + sport->rx_dma_rng_buf_len = (1 << fls(sport->rx_dma_rng_buf_len)); if (sport->rx_dma_rng_buf_len < 16) sport->rx_dma_rng_buf_len = 16; +} diff --git a/target/linux/layerscape/patches-5.4/820-usb-0011-usb-dwc3-Add-cache-type-configuration-support.patch b/target/linux/layerscape/patches-5.4/820-usb-0011-usb-dwc3-Add-cache-type-configuration-support.patch index 6429d816ac..c76ac325de 100644 --- a/target/linux/layerscape/patches-5.4/820-usb-0011-usb-dwc3-Add-cache-type-configuration-support.patch +++ b/target/linux/layerscape/patches-5.4/820-usb-0011-usb-dwc3-Add-cache-type-configuration-support.patch @@ -109,7 +109,7 @@ Reviewed-by: Jun Li usb_phy_set_suspend(dwc->usb2_phy, 0); usb_phy_set_suspend(dwc->usb3_phy, 0); ret = phy_power_on(dwc->usb2_generic_phy); -@@ -1938,12 +1990,9 @@ static const struct dev_pm_ops dwc3_dev_ +@@ -1935,12 +1987,9 @@ static const struct dev_pm_ops dwc3_dev_ #ifdef CONFIG_OF static const struct of_device_id of_dwc3_match[] = { diff --git a/target/linux/layerscape/patches-5.4/820-usb-0024-LF-387-1-Revert-usb-dwc3-Add-cache-type-configuratio.patch b/target/linux/layerscape/patches-5.4/820-usb-0024-LF-387-1-Revert-usb-dwc3-Add-cache-type-configuratio.patch index f486134c7c..93fe0cf795 100644 --- a/target/linux/layerscape/patches-5.4/820-usb-0024-LF-387-1-Revert-usb-dwc3-Add-cache-type-configuratio.patch +++ b/target/linux/layerscape/patches-5.4/820-usb-0024-LF-387-1-Revert-usb-dwc3-Add-cache-type-configuratio.patch @@ -81,7 +81,7 @@ Signed-off-by: Ran Wang usb_phy_set_suspend(dwc->usb2_phy, 0); usb_phy_set_suspend(dwc->usb3_phy, 0); ret = phy_power_on(dwc->usb2_generic_phy); -@@ -1990,9 +1938,12 @@ static const struct dev_pm_ops dwc3_dev_ +@@ -1987,9 +1935,12 @@ static const struct dev_pm_ops dwc3_dev_ #ifdef CONFIG_OF static const struct of_device_id of_dwc3_match[] = { diff --git a/target/linux/layerscape/patches-5.4/820-usb-0025-LF-387-4-usb-dwc3-Add-cache-type-configuration-suppo.patch b/target/linux/layerscape/patches-5.4/820-usb-0025-LF-387-4-usb-dwc3-Add-cache-type-configuration-suppo.patch index 5697ceedbc..31c49ccb4c 100644 --- a/target/linux/layerscape/patches-5.4/820-usb-0025-LF-387-4-usb-dwc3-Add-cache-type-configuration-suppo.patch +++ b/target/linux/layerscape/patches-5.4/820-usb-0025-LF-387-4-usb-dwc3-Add-cache-type-configuration-suppo.patch @@ -108,7 +108,7 @@ Reviewed-by: Jun Li usb_phy_set_suspend(dwc->usb2_phy, 0); usb_phy_set_suspend(dwc->usb3_phy, 0); ret = phy_power_on(dwc->usb2_generic_phy); -@@ -1938,12 +1989,16 @@ static const struct dev_pm_ops dwc3_dev_ +@@ -1935,12 +1986,16 @@ static const struct dev_pm_ops dwc3_dev_ #ifdef CONFIG_OF static const struct of_device_id of_dwc3_match[] = { diff --git a/target/linux/mediatek/patches-5.4/0500-v5.6-crypto-backport-inside-secure.patch b/target/linux/mediatek/patches-5.4/0500-v5.6-crypto-backport-inside-secure.patch index 7cd172b753..8ffa2dfc1c 100644 --- a/target/linux/mediatek/patches-5.4/0500-v5.6-crypto-backport-inside-secure.patch +++ b/target/linux/mediatek/patches-5.4/0500-v5.6-crypto-backport-inside-secure.patch @@ -362,7 +362,7 @@ EIP197_HIA_RDR(priv, ring) + EIP197_HIA_xDR_PROC_COUNT); /* If the number of requests overflowed the counter, try to proceed more -@@ -1171,6 +1216,44 @@ static struct safexcel_alg_template *saf +@@ -1176,6 +1221,44 @@ static struct safexcel_alg_template *saf &safexcel_alg_xts_aes, &safexcel_alg_gcm, &safexcel_alg_ccm, @@ -407,7 +407,7 @@ }; static int safexcel_register_algorithms(struct safexcel_crypto_priv *priv) -@@ -1240,30 +1323,30 @@ static void safexcel_unregister_algorith +@@ -1245,30 +1328,30 @@ static void safexcel_unregister_algorith static void safexcel_configure(struct safexcel_crypto_priv *priv) { @@ -457,7 +457,7 @@ } static void safexcel_init_register_offsets(struct safexcel_crypto_priv *priv) -@@ -1309,7 +1392,7 @@ static int safexcel_probe_generic(void * +@@ -1314,7 +1397,7 @@ static int safexcel_probe_generic(void * int is_pci_dev) { struct device *dev = priv->dev; @@ -466,7 +466,7 @@ int i, ret, hwctg; priv->context_pool = dmam_pool_create("safexcel-context", dev, -@@ -1371,13 +1454,16 @@ static int safexcel_probe_generic(void * +@@ -1376,13 +1459,16 @@ static int safexcel_probe_generic(void * */ version = readl(EIP197_GLOBAL(priv) + EIP197_VERSION); if (((priv->flags & SAFEXCEL_HW_EIP197) && @@ -484,7 +484,7 @@ return -ENODEV; } -@@ -1385,6 +1471,14 @@ static int safexcel_probe_generic(void * +@@ -1390,6 +1476,14 @@ static int safexcel_probe_generic(void * hwctg = version >> 28; peid = version & 255; @@ -499,7 +499,7 @@ /* Detect EIP96 packet engine and version */ version = readl(EIP197_PE(priv) + EIP197_PE_EIP96_VERSION(0)); if (EIP197_REG_LO16(version) != EIP96_VERSION_LE) { -@@ -1393,10 +1487,13 @@ static int safexcel_probe_generic(void * +@@ -1398,10 +1492,13 @@ static int safexcel_probe_generic(void * } priv->hwconfig.pever = EIP197_VERSION_MASK(version); @@ -513,7 +513,7 @@ priv->hwconfig.hwdataw = (hiaopt >> EIP197_HWDATAW_OFFSET) & EIP197_HWDATAW_MASK; priv->hwconfig.hwcfsize = ((hiaopt >> EIP197_CFSIZE_OFFSET) & -@@ -1405,6 +1502,19 @@ static int safexcel_probe_generic(void * +@@ -1410,6 +1507,19 @@ static int safexcel_probe_generic(void * priv->hwconfig.hwrfsize = ((hiaopt >> EIP197_RFSIZE_OFFSET) & EIP197_RFSIZE_MASK) + EIP197_RFSIZE_ADJUST; @@ -533,7 +533,7 @@ } else { /* EIP97 */ priv->hwconfig.hwdataw = (hiaopt >> EIP197_HWDATAW_OFFSET) & -@@ -1413,6 +1523,23 @@ static int safexcel_probe_generic(void * +@@ -1418,6 +1528,23 @@ static int safexcel_probe_generic(void * EIP97_CFSIZE_MASK; priv->hwconfig.hwrfsize = (hiaopt >> EIP97_RFSIZE_OFFSET) & EIP97_RFSIZE_MASK; @@ -557,7 +557,7 @@ } /* Get supported algorithms from EIP96 transform engine */ -@@ -1420,10 +1547,12 @@ static int safexcel_probe_generic(void * +@@ -1425,10 +1552,12 @@ static int safexcel_probe_generic(void * EIP197_PE_EIP96_OPTIONS(0)); /* Print single info line describing what we just detected */ @@ -574,7 +574,7 @@ priv->hwconfig.algo_flags); safexcel_configure(priv); -@@ -1547,7 +1676,6 @@ static void safexcel_hw_reset_rings(stru +@@ -1571,7 +1700,6 @@ static void safexcel_hw_reset_rings(stru } } @@ -582,15 +582,15 @@ /* for Device Tree platform driver */ static int safexcel_probe(struct platform_device *pdev) -@@ -1625,6 +1753,7 @@ static int safexcel_remove(struct platfo +@@ -1649,6 +1777,7 @@ static int safexcel_remove(struct platfo safexcel_unregister_algorithms(priv); safexcel_hw_reset_rings(priv); + clk_disable_unprepare(priv->reg_clk); clk_disable_unprepare(priv->clk); - for (i = 0; i < priv->config.rings; i++) -@@ -1668,9 +1797,7 @@ static struct platform_driver crypto_sa + for (i = 0; i < priv->config.rings; i++) { +@@ -1694,9 +1823,7 @@ static struct platform_driver crypto_sa .of_match_table = safexcel_of_match_table, }, }; @@ -600,7 +600,7 @@ /* PCIE devices - i.e. Inside Secure development boards */ static int safexcel_pci_probe(struct pci_dev *pdev, -@@ -1761,7 +1888,7 @@ static int safexcel_pci_probe(struct pci +@@ -1787,7 +1914,7 @@ static int safexcel_pci_probe(struct pci return rc; } @@ -609,7 +609,7 @@ { struct safexcel_crypto_priv *priv = pci_get_drvdata(pdev); int i; -@@ -1791,54 +1918,32 @@ static struct pci_driver safexcel_pci_dr +@@ -1817,54 +1944,32 @@ static struct pci_driver safexcel_pci_dr .probe = safexcel_pci_probe, .remove = safexcel_pci_remove, }; @@ -3371,7 +3371,7 @@ }; struct safexcel_work_data { -@@ -654,6 +721,12 @@ enum safexcel_eip_version { +@@ -657,6 +724,12 @@ enum safexcel_eip_version { /* Priority we use for advertising our algorithms */ #define SAFEXCEL_CRA_PRIORITY 300 @@ -3384,7 +3384,7 @@ /* EIP algorithm presence flags */ enum safexcel_eip_algorithms { SAFEXCEL_ALG_BC0 = BIT(5), -@@ -697,16 +770,23 @@ struct safexcel_register_offsets { +@@ -700,16 +773,23 @@ struct safexcel_register_offsets { enum safexcel_flags { EIP197_TRC_CACHE = BIT(0), SAFEXCEL_HW_EIP197 = BIT(1), @@ -3408,7 +3408,7 @@ }; struct safexcel_crypto_priv { -@@ -778,7 +858,7 @@ struct safexcel_inv_result { +@@ -781,7 +861,7 @@ struct safexcel_inv_result { void safexcel_dequeue(struct safexcel_crypto_priv *priv, int ring); int safexcel_rdesc_check_errors(struct safexcel_crypto_priv *priv, @@ -3417,7 +3417,7 @@ void safexcel_complete(struct safexcel_crypto_priv *priv, int ring); int safexcel_invalidate_cache(struct crypto_async_request *async, struct safexcel_crypto_priv *priv, -@@ -797,7 +877,8 @@ struct safexcel_command_desc *safexcel_a +@@ -800,7 +880,8 @@ struct safexcel_command_desc *safexcel_a bool first, bool last, dma_addr_t data, u32 len, u32 full_data_len, @@ -3427,7 +3427,7 @@ struct safexcel_result_desc *safexcel_add_rdesc(struct safexcel_crypto_priv *priv, int ring_id, bool first, bool last, -@@ -853,5 +934,43 @@ extern struct safexcel_alg_template safe +@@ -856,5 +937,43 @@ extern struct safexcel_alg_template safe extern struct safexcel_alg_template safexcel_alg_xts_aes; extern struct safexcel_alg_template safexcel_alg_gcm; extern struct safexcel_alg_template safexcel_alg_ccm; diff --git a/target/linux/mediatek/patches-5.4/0503-crypto-fix-eip97-cache-incoherent.patch b/target/linux/mediatek/patches-5.4/0503-crypto-fix-eip97-cache-incoherent.patch index 5bc0fd0b7d..887fa2e38e 100644 --- a/target/linux/mediatek/patches-5.4/0503-crypto-fix-eip97-cache-incoherent.patch +++ b/target/linux/mediatek/patches-5.4/0503-crypto-fix-eip97-cache-incoherent.patch @@ -1,6 +1,6 @@ --- a/drivers/crypto/inside-secure/safexcel.h +++ b/drivers/crypto/inside-secure/safexcel.h -@@ -722,6 +722,9 @@ enum safexcel_eip_version { +@@ -725,6 +725,9 @@ enum safexcel_eip_version { /* Priority we use for advertising our algorithms */ #define SAFEXCEL_CRA_PRIORITY 300 diff --git a/target/linux/mediatek/patches-5.4/0900-bt-mtk-serial-fix.patch b/target/linux/mediatek/patches-5.4/0900-bt-mtk-serial-fix.patch index a25c845ffc..2e9f3a3259 100644 --- a/target/linux/mediatek/patches-5.4/0900-bt-mtk-serial-fix.patch +++ b/target/linux/mediatek/patches-5.4/0900-bt-mtk-serial-fix.patch @@ -10,7 +10,7 @@ #define UART_BUG_TXEN (1 << 1) /* UART has buggy TX IIR status */ --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c -@@ -291,7 +291,7 @@ static const struct serial8250_config ua +@@ -292,7 +292,7 @@ static const struct serial8250_config ua .tx_loadsz = 16, .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT, @@ -19,7 +19,7 @@ }, [PORT_NPCM] = { .name = "Nuvoton 16550", -@@ -2615,6 +2615,11 @@ serial8250_do_set_termios(struct uart_po +@@ -2625,6 +2625,11 @@ serial8250_do_set_termios(struct uart_po unsigned long flags; unsigned int baud, quot, frac = 0; From 175c24ea94540fcb7d805dd5d5eebebfa0367e31 Mon Sep 17 00:00:00 2001 From: Yogi Hermawan <53725693+yHpgi@users.noreply.github.com> Date: Sun, 28 May 2023 19:21:01 +0700 Subject: [PATCH 53/67] ramips: fix bolt bl201 dts and update some device related value 1. add bolt_bl201 LED aliases 2. fix bolt_bl201 restart key gpio 3. make bolt_bl201 bootloader read-only 4. add bolt_bl201 partition settings 5. fix bolt_bl201 wrong gpio group 6. update bolt_bl201 LED and network switch settings (cherry picked from commit 35751576f31aaf493a77436b879131f03fc15c82) --- .../linux/ramips/dts/mt7620a_bolt_bl201.dts | 45 ++++++++++++++++--- .../mt7620/base-files/etc/board.d/02_network | 2 +- 2 files changed, 41 insertions(+), 6 deletions(-) diff --git a/target/linux/ramips/dts/mt7620a_bolt_bl201.dts b/target/linux/ramips/dts/mt7620a_bolt_bl201.dts index 8e09136818..63fb0acf68 100644 --- a/target/linux/ramips/dts/mt7620a_bolt_bl201.dts +++ b/target/linux/ramips/dts/mt7620a_bolt_bl201.dts @@ -81,12 +81,24 @@ reset { label = "reset"; - gpios = <&gpio1 2 GPIO_ACTIVE_LOW>; + gpios = <&gpio1 26 GPIO_ACTIVE_LOW>; linux,code = ; }; }; }; +&gpio0 { + status = "okay"; +}; + +&gpio1 { + status = "okay"; +}; + +&gpio2 { + status = "okay"; +}; + &gpio3 { status = "okay"; }; @@ -107,12 +119,12 @@ partition@0 { label = "u-boot"; reg = <0x0 0x30000>; + read-only; }; partition@30000 { label = "u-boot-env"; reg = <0x30000 0x10000>; - read-only; }; factory: partition@40000 { @@ -126,15 +138,38 @@ label = "firmware"; reg = <0x50000 0xf80000>; }; + + partition@fd0000 { + label = "crash"; + reg = <0xfd0000 0x10000>; + }; + + partition@fe0000 { + label = "reserved"; + reg = <0xfe0000 0x10000>; + read-only; + }; + + partition@ff0000 { + label = "Bdata"; + reg = <0xff0000 0x10000>; + }; }; }; }; +&ehci { + status = "okay"; +}; + +&ohci { + status = "okay"; +}; + ðernet { pinctrl-names = "default"; - pinctrl-0 = <&ephy_pins>; - mtd-mac-address = <&factory 0x4>; + mtd-mac-address = <&factory 0x28>; mediatek,portmap = "llllw"; }; @@ -158,7 +193,7 @@ &state_default { gpio { - groups = "wled", "i2c", "uartf", "wdt"; + groups = "i2c", "uartf", "rgmii1", "rgmii2", "ephy", "wled", "nd_sd"; function = "gpio"; }; }; diff --git a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network index 78c35430aa..391dd91489 100755 --- a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network @@ -12,7 +12,6 @@ ramips_setup_interfaces() aigale,ai-br100|\ alfa-network,ac1200rm|\ asus,rt-n12p|\ - bolt,bl201|\ dlink,dwr-116-a1|\ dlink,dwr-921-c1|\ dlink,dwr-922-e2|\ @@ -35,6 +34,7 @@ ramips_setup_interfaces() "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "6@eth0" ;; alfa-network,r36m-e4g|\ + bolt,bl201|\ zbtlink,zbt-we1026-h-32m) ucidef_add_switch "switch0" \ "3:lan" "4:wan" "6@eth0" From 739fd7532fc030ac0e72e5e744939e111dd95b43 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Wed, 24 May 2023 16:13:57 +0800 Subject: [PATCH 54/67] kernel: netdevices: add Intel Ethernet Network Adapter E810 support Signed-off-by: Tianling Shen --- package/kernel/linux/modules/netdevices.mk | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/package/kernel/linux/modules/netdevices.mk b/package/kernel/linux/modules/netdevices.mk index 975d639816..17acf1fa06 100644 --- a/package/kernel/linux/modules/netdevices.mk +++ b/package/kernel/linux/modules/netdevices.mk @@ -744,6 +744,22 @@ endef $(eval $(call KernelPackage,iavf)) +define KernelPackage/ice + SUBMENU:=$(NETWORK_DEVICES_MENU) + TITLE:=Intel(R) Ethernet Controller E810 Series support + DEPENDS:=@PCI_SUPPORT +kmod-ptp + KCONFIG:=CONFIG_ICE + FILES:=$(LINUX_DIR)/drivers/net/ethernet/intel/ice/ice.ko + AUTOLOAD:=$(call AutoProbe,ice) +endef + +define KernelPackage/ice/description + Kernel modules for Intel(R) Ethernet Controller E810 Series +endef + +$(eval $(call KernelPackage,ice)) + + define KernelPackage/b44 TITLE:=Broadcom 44xx driver KCONFIG:=CONFIG_B44 From f9e0e9d8413c868b738d38a0fa9bf51a717a0cc3 Mon Sep 17 00:00:00 2001 From: Vieno Hakkerinen Date: Tue, 20 Apr 2021 15:37:44 +0200 Subject: [PATCH 55/67] kernel: netdev: add qlcnic Add driver for QLogic QLE8240 and QLE8242 Converged Ethernet devices. Signed-off-by: Vieno Hakkerinen --- package/kernel/linux/modules/netdevices.mk | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/package/kernel/linux/modules/netdevices.mk b/package/kernel/linux/modules/netdevices.mk index 17acf1fa06..8534f4bcf2 100644 --- a/package/kernel/linux/modules/netdevices.mk +++ b/package/kernel/linux/modules/netdevices.mk @@ -1214,6 +1214,26 @@ endef $(eval $(call KernelPackage,mlx5-core)) +define KernelPackage/qlcnic + SUBMENU:=$(NETWORK_DEVICES_MENU) + DEPENDS:=@PCI_SUPPORT +kmod-hwmon-core + TITLE:=QLogic QLE8240 and QLE8242 device support + KCONFIG:= \ + CONFIG_QLCNIC \ + CONFIG_QLCNIC_HWMON=y \ + CONFIG_QLCNIC_SRIOV=y + FILES:=$(LINUX_DIR)/drivers/net/ethernet/qlogic/qlcnic/qlcnic.ko + AUTOLOAD:=$(call AutoProbe,qlcnic) +endef + +define KernelPackage/qlcnic/description + This driver supports QLogic QLE8240 and QLE8242 Converged Ethernet + devices. +endef + +$(eval $(call KernelPackage,qlcnic)) + + define KernelPackage/sfp SUBMENU:=$(NETWORK_DEVICES_MENU) TITLE:=SFP cage support From 294ae1013b07cfdeab4dff5c9fd9a83168493240 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Wed, 24 May 2023 16:08:30 +0800 Subject: [PATCH 56/67] kernel: netdevices: add QLogic FastLinQ Ethernet NIC device support Signed-off-by: Tianling Shen --- package/kernel/linux/modules/netdevices.mk | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/package/kernel/linux/modules/netdevices.mk b/package/kernel/linux/modules/netdevices.mk index 8534f4bcf2..aba0eb4e11 100644 --- a/package/kernel/linux/modules/netdevices.mk +++ b/package/kernel/linux/modules/netdevices.mk @@ -1234,6 +1234,30 @@ endef $(eval $(call KernelPackage,qlcnic)) +define KernelPackage/qede + SUBMENU:=$(NETWORK_DEVICES_MENU) + DEPENDS:=@PCI_SUPPORT +kmod-ptp +kmod-lib-crc8 +kmod-lib-zlib-inflate + TITLE:=QLogic FastLinQ 10/25/40/100Gb Ethernet NIC device support + KCONFIG:= \ + CONFIG_QED \ + CONFIG_QED_SRIOV=y \ + CONFIG_QEDE \ + CONFIG_QEDF=n \ + CONFIG_QEDI=n + FILES:= \ + $(LINUX_DIR)/drivers/net/ethernet/qlogic/qed/qed.ko \ + $(LINUX_DIR)/drivers/net/ethernet/qlogic/qede/qede.ko + AUTOLOAD:=$(call AutoProbe,qed qede) +endef + +define KernelPackage/qede/description + This driver supports QLogic FastLinQ 25/40/100Gb Ethernet NIC + devices. +endef + +$(eval $(call KernelPackage,qede)) + + define KernelPackage/sfp SUBMENU:=$(NETWORK_DEVICES_MENU) TITLE:=SFP cage support From eccc9ff34c36a573246f61a31033705e8d61d0e9 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Mon, 29 May 2023 17:18:37 +0800 Subject: [PATCH 57/67] ice: add vendor driver from intel Signed-off-by: Tianling Shen --- package/kernel/ice/Makefile | 44 +++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 package/kernel/ice/Makefile diff --git a/package/kernel/ice/Makefile b/package/kernel/ice/Makefile new file mode 100644 index 0000000000..1b17b7640f --- /dev/null +++ b/package/kernel/ice/Makefile @@ -0,0 +1,44 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# Copyright (C) 2023 ImmortalWrt.org + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=ice +PKG_VERSION:=1.11.14 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/e1000/ice%20stable/$(PKG_VERSION)/ +PKG_HASH:=6419424dd82163d5965f646ec5c826c6706d93e6d3b5c33e2a4f8cef9070a812 + +PKG_MAINTAINER:=Tianling Shen +PKG_LICENSE:=GPL-2.0-only +PKG_LICENSE_FILES:=COPYING + +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define KernelPackage/ice-vendor + SUBMENU:=Network Devices + TITLE:=Intel(R) Ethernet Controller E810 Family support (vendor driver) + VERSION:=$(LINUX_VERSION)+$(PKG_VERSION)-$(BOARD)-$(PKG_RELEASE) + DEPENDS:=@PCI_SUPPORT +kmod-ptp @TARGET_x86 + CONFLICTS:=kmod-ice + FILES:=$(PKG_BUILD_DIR)/src/ice.ko + AUTOLOAD:=$(call AutoProbe,ice) +endef + +define KernelPackage/ice-vendor/description + Kernel modules for Intel(R) Ethernet Controller E810 Series +endef + +define Build/Compile + +$(KERNEL_MAKE) $(PKG_JOBS) \ + M=$(PKG_BUILD_DIR)/src \ + modules +endef + +$(eval $(call KernelPackage,ice-vendor)) From d7d319a6d2049846b479a26a4e4359534fba387c Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Mon, 29 May 2023 18:09:18 +0800 Subject: [PATCH 58/67] kernel: netdevices: enable e-switch support for mlx5 by default Signed-off-by: Tianling Shen (cherry picked from commit acf1d35ae066bc04ded6ef870af6768cf7554710) --- package/kernel/linux/modules/netdevices.mk | 2 +- target/linux/x86/config-5.4 | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/package/kernel/linux/modules/netdevices.mk b/package/kernel/linux/modules/netdevices.mk index aba0eb4e11..20b56b29f0 100644 --- a/package/kernel/linux/modules/netdevices.mk +++ b/package/kernel/linux/modules/netdevices.mk @@ -1196,7 +1196,7 @@ define KernelPackage/mlx5-core CONFIG_MLX5_EN_IPSEC=n \ CONFIG_MLX5_EN_RXNFC=y \ CONFIG_MLX5_EN_TLS=n \ - CONFIG_MLX5_ESWITCH=n \ + CONFIG_MLX5_ESWITCH=y \ CONFIG_MLX5_FPGA=n \ CONFIG_MLX5_FPGA_IPSEC=n \ CONFIG_MLX5_FPGA_TLS=n \ diff --git a/target/linux/x86/config-5.4 b/target/linux/x86/config-5.4 index 6676f9501a..2a3936b8d8 100644 --- a/target/linux/x86/config-5.4 +++ b/target/linux/x86/config-5.4 @@ -354,6 +354,7 @@ CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y CONFIG_NEED_SG_DMA_LENGTH=y # CONFIG_NET5501 is not set # CONFIG_NET_NS is not set +CONFIG_NET_SWITCHDEV=y CONFIG_NLS=y # CONFIG_NOHIGHMEM is not set CONFIG_NR_CPUS=1 From d3af1f168bb8ba33c2468b0f98536f2d25a0d0b6 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Tue, 30 May 2023 16:24:50 +0800 Subject: [PATCH 59/67] kernel: netdevices: add missing Kconfig to mlx5-core Signed-off-by: Tianling Shen (cherry picked from commit e218aa41d621bfd3de17709266c886f05a13035f) --- package/kernel/linux/modules/netdevices.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/package/kernel/linux/modules/netdevices.mk b/package/kernel/linux/modules/netdevices.mk index 20b56b29f0..ebfac1490a 100644 --- a/package/kernel/linux/modules/netdevices.mk +++ b/package/kernel/linux/modules/netdevices.mk @@ -1202,6 +1202,7 @@ define KernelPackage/mlx5-core CONFIG_MLX5_FPGA_TLS=n \ CONFIG_MLX5_MPFS=y \ CONFIG_MLX5_SW_STEERING=n \ + CONFIG_MLX5_CLS_ACT=n \ CONFIG_MLX5_TC_CT=n \ CONFIG_MLX5_TLS=n AUTOLOAD:=$(call AutoProbe,mlx5_core) From 17c880c00563cdde06413e8b6e7127871116cd05 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Fri, 26 May 2023 12:09:47 +0800 Subject: [PATCH 60/67] ca-certificates: Update to version 20230311 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update the ca-certificates and ca-bundle package from version 20211016 to version 20230311. Use TAR_OPTIONS instead of hacking Build/Prepare, refresh patches. Debian change-log entry [1]: |[...] |[ Đoàn Trần Công Danh ] |* ca-certificates: compat with non-GNU mktemp (closes: #1000847) | |[ Ilya Lipnitskiy ] |* certdata2pem.py: use UTC time when checking cert validity | |[ Julien Cristau ] |* Update Mozilla certificate authority bundle to version 2.60 | The following certificate authorities were added (+): | + "Autoridad de Certificacion Firmaprofesional CIF A62634068" | + "Certainly Root E1" | + "Certainly Root R1" | + "D-TRUST BR Root CA 1 2020" | + "D-TRUST EV Root CA 1 2020" | + "DigiCert TLS ECC P384 Root G5" | + "DigiCert TLS RSA4096 Root G5" | + "E-Tugra Global Root CA ECC v3" | + "E-Tugra Global Root CA RSA v3" | + "HARICA TLS ECC Root CA 2021" | + "HARICA TLS RSA Root CA 2021" | + "HiPKI Root CA - G1" | + "ISRG Root X2" | + "Security Communication ECC RootCA1" | + "Security Communication RootCA3" | + "Telia Root CA v2" | + "TunTrust Root CA" | + "vTrus ECC Root CA" | + "vTrus Root CA" | The following certificate authorities were removed (-): | - "Cybertrust Global Root" (expired) | - "EC-ACC" | - "GlobalSign Root CA - R2" (expired) | - "Hellenic Academic and Research Institutions RootCA 2011" | - "Network Solutions Certificate Authority" | - "Staat der Nederlanden EV Root CA" (expired) |* Drop trailing space from debconf template causing misformatting | (closes: #980821) | |[ Wataru Ashihara ] |* Make certdata2pem.py compatible with cryptography >= 35 (closes: #1008244) |[...] [1]: https://metadata.ftp-master.debian.org/changelogs/main/c/ca-certificates/ca-certificates_20230311_changelog Signed-off-by: Tianling Shen (cherry picked from commit 7c83b6ac8656f9a3b005554d25857e8ed5faf3f6) --- package/system/ca-certificates/Makefile | 14 +++++--------- ...ates-fix-python3-cryptography-woes-in-cer.patch | 8 ++++---- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/package/system/ca-certificates/Makefile b/package/system/ca-certificates/Makefile index ba76664339..0d626750f0 100644 --- a/package/system/ca-certificates/Makefile +++ b/package/system/ca-certificates/Makefile @@ -7,17 +7,20 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ca-certificates -PKG_VERSION:=20211016 +PKG_VERSION:=20230311 PKG_RELEASE:=1 PKG_MAINTAINER:= PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/c/ca-certificates -PKG_HASH:=2ae9b6dc5f40c25d6d7fe55e07b54f12a8967d1955d3b7b2f42ee46266eeef88 +PKG_HASH:=83de934afa186e279d1ed08ea0d73f5cf43a6fbfb5f00874b6db3711c64576f3 PKG_INSTALL:=1 include $(INCLUDE_DIR)/package.mk +TAR_OPTIONS+= --strip-components 1 +TAR_CMD=$(HOST_TAR) -C $(1) $(TAR_OPTIONS) + define Package/ca-certificates SECTION:=base CATEGORY:=Base system @@ -34,13 +37,6 @@ define Package/ca-bundle PROVIDES:=ca-certs endef -define Build/Prepare - $(DECOMPRESS_CMD) $(HOST_TAR) -C $(PKG_BUILD_DIR) $(TAR_OPTIONS) - $(Build/Patch) -endef - -MAKE_PATH := work - define Build/Install mkdir -p \ $(PKG_INSTALL_DIR)/usr/sbin \ diff --git a/package/system/ca-certificates/patches/0001-ca-certificates-fix-python3-cryptography-woes-in-cer.patch b/package/system/ca-certificates/patches/0001-ca-certificates-fix-python3-cryptography-woes-in-cer.patch index add01f42c0..09092617f1 100644 --- a/package/system/ca-certificates/patches/0001-ca-certificates-fix-python3-cryptography-woes-in-cer.patch +++ b/package/system/ca-certificates/patches/0001-ca-certificates-fix-python3-cryptography-woes-in-cer.patch @@ -18,8 +18,8 @@ Reported-by: Chen Minqiang Reported-by: Shane Synan Signed-off-by: Christian Lamparter --- ---- a/work/mozilla/certdata2pem.py -+++ b/work/mozilla/certdata2pem.py +--- a/mozilla/certdata2pem.py ++++ b/mozilla/certdata2pem.py @@ -21,16 +21,12 @@ # USA. @@ -42,8 +42,8 @@ Signed-off-by: Christian Lamparter if not obj['CKA_LABEL'] in trust or not trust[obj['CKA_LABEL']]: continue - -- cert = x509.load_der_x509_certificate(obj['CKA_VALUE']) -- if cert.not_valid_after < datetime.datetime.now(): +- cert = x509.load_der_x509_certificate(bytes(obj['CKA_VALUE'])) +- if cert.not_valid_after < datetime.datetime.utcnow(): - print('!'*74) - print('Trusted but expired certificate found: %s' % obj['CKA_LABEL']) - print('!'*74) From 8715c83b9de3a197100f0bd0e73f244976b4763f Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Thu, 1 Jun 2023 16:33:24 +0800 Subject: [PATCH 61/67] openssl: bump to 1.1.1u Changes between 1.1.1t and 1.1.1u [30 May 2023] *) Mitigate for the time it takes for `OBJ_obj2txt` to translate gigantic OBJECT IDENTIFIER sub-identifiers to canonical numeric text form. OBJ_obj2txt() would translate any size OBJECT IDENTIFIER to canonical numeric text form. For gigantic sub-identifiers, this would take a very long time, the time complexity being O(n^2) where n is the size of that sub-identifier. (CVE-2023-2650) To mitigitate this, `OBJ_obj2txt()` will only translate an OBJECT IDENTIFIER to canonical numeric text form if the size of that OBJECT IDENTIFIER is 586 bytes or less, and fail otherwise. The basis for this restriction is RFC 2578 (STD 58), section 3.5. OBJECT IDENTIFIER values, which stipulates that OBJECT IDENTIFIERS may have at most 128 sub-identifiers, and that the maximum value that each sub- identifier may have is 2^32-1 (4294967295 decimal). For each byte of every sub-identifier, only the 7 lower bits are part of the value, so the maximum amount of bytes that an OBJECT IDENTIFIER with these restrictions may occupy is 32 * 128 / 7, which is approximately 586 bytes. Ref: https://datatracker.ietf.org/doc/html/rfc2578#section-3.5 [Richard Levitte] *) Reworked the Fix for the Timing Oracle in RSA Decryption (CVE-2022-4304). The previous fix for this timing side channel turned out to cause a severe 2-3x performance regression in the typical use case compared to 1.1.1s. The new fix uses existing constant time code paths, and restores the previous performance level while fully eliminating all existing timing side channels. The fix was developed by Bernd Edlinger with testing support by Hubert Kario. [Bernd Edlinger] *) Corrected documentation of X509_VERIFY_PARAM_add0_policy() to mention that it does not enable policy checking. Thanks to David Benjamin for discovering this issue. (CVE-2023-0466) [Tomas Mraz] *) Fixed an issue where invalid certificate policies in leaf certificates are silently ignored by OpenSSL and other certificate policy checks are skipped for that certificate. A malicious CA could use this to deliberately assert invalid certificate policies in order to circumvent policy checking on the certificate altogether. (CVE-2023-0465) [Matt Caswell] *) Limited the number of nodes created in a policy tree to mitigate against CVE-2023-0464. The default limit is set to 1000 nodes, which should be sufficient for most installations. If required, the limit can be adjusted by setting the OPENSSL_POLICY_TREE_NODES_MAX build time define to a desired maximum number of nodes or zero to allow unlimited growth. (CVE-2023-0464) [Paul Dale] Removed upstreamed patches. Signed-off-by: Tianling Shen --- package/libs/openssl/Makefile | 6 +- ...esource-use-verifying-policy-constra.patch | 214 ------------------ ...AG_INVALID_POLICY-is-checked-even-in.patch | 48 ---- 3 files changed, 3 insertions(+), 265 deletions(-) delete mode 100644 package/libs/openssl/patches/200-x509-excessive-resource-use-verifying-policy-constra.patch delete mode 100644 package/libs/openssl/patches/210-Ensure-that-EXFLAG_INVALID_POLICY-is-checked-even-in.patch diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile index 31ae1931a7..9ccdb72d2a 100644 --- a/package/libs/openssl/Makefile +++ b/package/libs/openssl/Makefile @@ -9,9 +9,9 @@ include $(TOPDIR)/rules.mk PKG_NAME:=openssl PKG_BASE:=1.1.1 -PKG_BUGFIX:=t +PKG_BUGFIX:=u PKG_VERSION:=$(PKG_BASE)$(PKG_BUGFIX) -PKG_RELEASE:=2 +PKG_RELEASE:=1 PKG_USE_MIPS16:=0 ENGINES_DIR=engines-1.1 @@ -28,7 +28,7 @@ PKG_SOURCE_URL:= \ ftp://ftp.pca.dfn.de/pub/tools/net/openssl/source/ \ ftp://ftp.pca.dfn.de/pub/tools/net/openssl/source/old/$(PKG_BASE)/ -PKG_HASH:=8dee9b24bdb1dcbf0c3d1e9b02fb8f6bf22165e807f45adeb7c9677536859d3b +PKG_HASH:=e2f8d84b523eecd06c7be7626830370300fbcc15386bf5142d72758f6963ebc6 PKG_LICENSE:=OpenSSL PKG_LICENSE_FILES:=LICENSE diff --git a/package/libs/openssl/patches/200-x509-excessive-resource-use-verifying-policy-constra.patch b/package/libs/openssl/patches/200-x509-excessive-resource-use-verifying-policy-constra.patch deleted file mode 100644 index a3a4de6008..0000000000 --- a/package/libs/openssl/patches/200-x509-excessive-resource-use-verifying-policy-constra.patch +++ /dev/null @@ -1,214 +0,0 @@ -From 879f7080d7e141f415c79eaa3a8ac4a3dad0348b Mon Sep 17 00:00:00 2001 -From: Pauli -Date: Wed, 8 Mar 2023 15:28:20 +1100 -Subject: [PATCH] x509: excessive resource use verifying policy constraints - -A security vulnerability has been identified in all supported versions -of OpenSSL related to the verification of X.509 certificate chains -that include policy constraints. Attackers may be able to exploit this -vulnerability by creating a malicious certificate chain that triggers -exponential use of computational resources, leading to a denial-of-service -(DoS) attack on affected systems. - -Fixes CVE-2023-0464 - -Reviewed-by: Tomas Mraz -Reviewed-by: Shane Lontis -(Merged from https://github.com/openssl/openssl/pull/20569) - -diff --git a/crypto/x509v3/pcy_local.h b/crypto/x509v3/pcy_local.h -index 5daf78de45..344aa06765 100644 ---- a/crypto/x509v3/pcy_local.h -+++ b/crypto/x509v3/pcy_local.h -@@ -111,6 +111,11 @@ struct X509_POLICY_LEVEL_st { - }; - - struct X509_POLICY_TREE_st { -+ /* The number of nodes in the tree */ -+ size_t node_count; -+ /* The maximum number of nodes in the tree */ -+ size_t node_maximum; -+ - /* This is the tree 'level' data */ - X509_POLICY_LEVEL *levels; - int nlevel; -@@ -159,7 +164,8 @@ X509_POLICY_NODE *tree_find_sk(STACK_OF(X509_POLICY_NODE) *sk, - X509_POLICY_NODE *level_add_node(X509_POLICY_LEVEL *level, - X509_POLICY_DATA *data, - X509_POLICY_NODE *parent, -- X509_POLICY_TREE *tree); -+ X509_POLICY_TREE *tree, -+ int extra_data); - void policy_node_free(X509_POLICY_NODE *node); - int policy_node_match(const X509_POLICY_LEVEL *lvl, - const X509_POLICY_NODE *node, const ASN1_OBJECT *oid); -diff --git a/crypto/x509v3/pcy_node.c b/crypto/x509v3/pcy_node.c -index e2d7b15322..d574fb9d66 100644 ---- a/crypto/x509v3/pcy_node.c -+++ b/crypto/x509v3/pcy_node.c -@@ -59,10 +59,15 @@ X509_POLICY_NODE *level_find_node(const X509_POLICY_LEVEL *level, - X509_POLICY_NODE *level_add_node(X509_POLICY_LEVEL *level, - X509_POLICY_DATA *data, - X509_POLICY_NODE *parent, -- X509_POLICY_TREE *tree) -+ X509_POLICY_TREE *tree, -+ int extra_data) - { - X509_POLICY_NODE *node; - -+ /* Verify that the tree isn't too large. This mitigates CVE-2023-0464 */ -+ if (tree->node_maximum > 0 && tree->node_count >= tree->node_maximum) -+ return NULL; -+ - node = OPENSSL_zalloc(sizeof(*node)); - if (node == NULL) { - X509V3err(X509V3_F_LEVEL_ADD_NODE, ERR_R_MALLOC_FAILURE); -@@ -70,7 +75,7 @@ X509_POLICY_NODE *level_add_node(X509_POLICY_LEVEL *level, - } - node->data = data; - node->parent = parent; -- if (level) { -+ if (level != NULL) { - if (OBJ_obj2nid(data->valid_policy) == NID_any_policy) { - if (level->anyPolicy) - goto node_error; -@@ -90,7 +95,7 @@ X509_POLICY_NODE *level_add_node(X509_POLICY_LEVEL *level, - } - } - -- if (tree) { -+ if (extra_data) { - if (tree->extra_data == NULL) - tree->extra_data = sk_X509_POLICY_DATA_new_null(); - if (tree->extra_data == NULL){ -@@ -103,6 +108,7 @@ X509_POLICY_NODE *level_add_node(X509_POLICY_LEVEL *level, - } - } - -+ tree->node_count++; - if (parent) - parent->nchild++; - -diff --git a/crypto/x509v3/pcy_tree.c b/crypto/x509v3/pcy_tree.c -index 6e8322cbc5..6c7fd35405 100644 ---- a/crypto/x509v3/pcy_tree.c -+++ b/crypto/x509v3/pcy_tree.c -@@ -13,6 +13,18 @@ - - #include "pcy_local.h" - -+/* -+ * If the maximum number of nodes in the policy tree isn't defined, set it to -+ * a generous default of 1000 nodes. -+ * -+ * Defining this to be zero means unlimited policy tree growth which opens the -+ * door on CVE-2023-0464. -+ */ -+ -+#ifndef OPENSSL_POLICY_TREE_NODES_MAX -+# define OPENSSL_POLICY_TREE_NODES_MAX 1000 -+#endif -+ - /* - * Enable this to print out the complete policy tree at various point during - * evaluation. -@@ -168,6 +180,9 @@ static int tree_init(X509_POLICY_TREE **ptree, STACK_OF(X509) *certs, - return X509_PCY_TREE_INTERNAL; - } - -+ /* Limit the growth of the tree to mitigate CVE-2023-0464 */ -+ tree->node_maximum = OPENSSL_POLICY_TREE_NODES_MAX; -+ - /* - * http://tools.ietf.org/html/rfc5280#section-6.1.2, figure 3. - * -@@ -184,7 +199,7 @@ static int tree_init(X509_POLICY_TREE **ptree, STACK_OF(X509) *certs, - level = tree->levels; - if ((data = policy_data_new(NULL, OBJ_nid2obj(NID_any_policy), 0)) == NULL) - goto bad_tree; -- if (level_add_node(level, data, NULL, tree) == NULL) { -+ if (level_add_node(level, data, NULL, tree, 1) == NULL) { - policy_data_free(data); - goto bad_tree; - } -@@ -243,7 +258,8 @@ static int tree_init(X509_POLICY_TREE **ptree, STACK_OF(X509) *certs, - * Return value: 1 on success, 0 otherwise - */ - static int tree_link_matching_nodes(X509_POLICY_LEVEL *curr, -- X509_POLICY_DATA *data) -+ X509_POLICY_DATA *data, -+ X509_POLICY_TREE *tree) - { - X509_POLICY_LEVEL *last = curr - 1; - int i, matched = 0; -@@ -253,13 +269,13 @@ static int tree_link_matching_nodes(X509_POLICY_LEVEL *curr, - X509_POLICY_NODE *node = sk_X509_POLICY_NODE_value(last->nodes, i); - - if (policy_node_match(last, node, data->valid_policy)) { -- if (level_add_node(curr, data, node, NULL) == NULL) -+ if (level_add_node(curr, data, node, tree, 0) == NULL) - return 0; - matched = 1; - } - } - if (!matched && last->anyPolicy) { -- if (level_add_node(curr, data, last->anyPolicy, NULL) == NULL) -+ if (level_add_node(curr, data, last->anyPolicy, tree, 0) == NULL) - return 0; - } - return 1; -@@ -272,7 +288,8 @@ static int tree_link_matching_nodes(X509_POLICY_LEVEL *curr, - * Return value: 1 on success, 0 otherwise. - */ - static int tree_link_nodes(X509_POLICY_LEVEL *curr, -- const X509_POLICY_CACHE *cache) -+ const X509_POLICY_CACHE *cache, -+ X509_POLICY_TREE *tree) - { - int i; - -@@ -280,7 +297,7 @@ static int tree_link_nodes(X509_POLICY_LEVEL *curr, - X509_POLICY_DATA *data = sk_X509_POLICY_DATA_value(cache->data, i); - - /* Look for matching nodes in previous level */ -- if (!tree_link_matching_nodes(curr, data)) -+ if (!tree_link_matching_nodes(curr, data, tree)) - return 0; - } - return 1; -@@ -311,7 +328,7 @@ static int tree_add_unmatched(X509_POLICY_LEVEL *curr, - /* Curr may not have anyPolicy */ - data->qualifier_set = cache->anyPolicy->qualifier_set; - data->flags |= POLICY_DATA_FLAG_SHARED_QUALIFIERS; -- if (level_add_node(curr, data, node, tree) == NULL) { -+ if (level_add_node(curr, data, node, tree, 1) == NULL) { - policy_data_free(data); - return 0; - } -@@ -373,7 +390,7 @@ static int tree_link_any(X509_POLICY_LEVEL *curr, - } - /* Finally add link to anyPolicy */ - if (last->anyPolicy && -- level_add_node(curr, cache->anyPolicy, last->anyPolicy, NULL) == NULL) -+ level_add_node(curr, cache->anyPolicy, last->anyPolicy, tree, 0) == NULL) - return 0; - return 1; - } -@@ -555,7 +572,7 @@ static int tree_calculate_user_set(X509_POLICY_TREE *tree, - extra->qualifier_set = anyPolicy->data->qualifier_set; - extra->flags = POLICY_DATA_FLAG_SHARED_QUALIFIERS - | POLICY_DATA_FLAG_EXTRA_NODE; -- node = level_add_node(NULL, extra, anyPolicy->parent, tree); -+ node = level_add_node(NULL, extra, anyPolicy->parent, tree, 1); - } - if (!tree->user_policies) { - tree->user_policies = sk_X509_POLICY_NODE_new_null(); -@@ -582,7 +599,7 @@ static int tree_evaluate(X509_POLICY_TREE *tree) - - for (i = 1; i < tree->nlevel; i++, curr++) { - cache = policy_cache_set(curr->cert); -- if (!tree_link_nodes(curr, cache)) -+ if (!tree_link_nodes(curr, cache, tree)) - return X509_PCY_TREE_INTERNAL; - - if (!(curr->flags & X509_V_FLAG_INHIBIT_ANY) diff --git a/package/libs/openssl/patches/210-Ensure-that-EXFLAG_INVALID_POLICY-is-checked-even-in.patch b/package/libs/openssl/patches/210-Ensure-that-EXFLAG_INVALID_POLICY-is-checked-even-in.patch deleted file mode 100644 index ffb7317d7c..0000000000 --- a/package/libs/openssl/patches/210-Ensure-that-EXFLAG_INVALID_POLICY-is-checked-even-in.patch +++ /dev/null @@ -1,48 +0,0 @@ -From b013765abfa80036dc779dd0e50602c57bb3bf95 Mon Sep 17 00:00:00 2001 -From: Matt Caswell -Date: Tue, 7 Mar 2023 16:52:55 +0000 -Subject: [PATCH] Ensure that EXFLAG_INVALID_POLICY is checked even in leaf - certs - -Even though we check the leaf cert to confirm it is valid, we -later ignored the invalid flag and did not notice that the leaf -cert was bad. - -Fixes: CVE-2023-0465 - -Reviewed-by: Hugo Landau -Reviewed-by: Tomas Mraz -(Merged from https://github.com/openssl/openssl/pull/20588) - -diff --git a/crypto/x509/x509_vfy.c b/crypto/x509/x509_vfy.c -index 925fbb5412..1dfe4f9f31 100644 ---- a/crypto/x509/x509_vfy.c -+++ b/crypto/x509/x509_vfy.c -@@ -1649,18 +1649,25 @@ static int check_policy(X509_STORE_CTX *ctx) - } - /* Invalid or inconsistent extensions */ - if (ret == X509_PCY_TREE_INVALID) { -- int i; -+ int i, cbcalled = 0; - - /* Locate certificates with bad extensions and notify callback. */ -- for (i = 1; i < sk_X509_num(ctx->chain); i++) { -+ for (i = 0; i < sk_X509_num(ctx->chain); i++) { - X509 *x = sk_X509_value(ctx->chain, i); - - if (!(x->ex_flags & EXFLAG_INVALID_POLICY)) - continue; -+ cbcalled = 1; - if (!verify_cb_cert(ctx, x, i, - X509_V_ERR_INVALID_POLICY_EXTENSION)) - return 0; - } -+ if (!cbcalled) { -+ /* Should not be able to get here */ -+ X509err(X509_F_CHECK_POLICY, ERR_R_INTERNAL_ERROR); -+ return 0; -+ } -+ /* The callback ignored the error so we return success */ - return 1; - } - if (ret == X509_PCY_TREE_FAILURE) { From 8d858460fe1408824019e0711db42cde94b5da3c Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Thu, 1 Jun 2023 19:58:05 +0800 Subject: [PATCH 62/67] kernel: bump to 5.4.244 Refreshed all patches. Signed-off-by: Tianling Shen --- include/kernel-5.4 | 4 ++-- ...bcmgenet-Better-coalescing-parameter-defaults.patch | 2 +- ...-plumbing-for-updating-interrupt-endpoint-int.patch | 2 +- .../950-0336-drm-v3d-The-third-IRQ-is-optional.patch | 2 +- ...50-0973-net-bcmgenet-Reset-RBUF-on-first-open.patch | 2 +- ...xtract-napi-poll-functionality-to-__napi_poll.patch | 8 ++++---- ...mplement-threaded-able-napi-poll-loop-support.patch | 10 +++++----- ...-sysfs-attribute-to-control-napi-threaded-mod.patch | 4 ++-- ...-race-between-napi-kthread-mode-and-busy-poll.patch | 6 +++--- ...-fix-hangup-on-napi_disable-for-threaded-napi.patch | 4 ++-- ...e-allow-fast-GRO-for-skbs-with-Ethernet-heade.patch | 2 +- target/linux/generic/hack-5.4/721-phy_packets.patch | 2 +- ...net-patch-linux-kernel-to-support-shortcut-fe.patch | 8 ++++---- .../generic/pending-5.4/630-packet_socket_type.patch | 10 +++++----- ...er-nf_flow_table-add-hardware-offload-support.patch | 6 +++--- .../680-NET-skip-GRO-for-foreign-MAC-addresses.patch | 10 +++++----- 16 files changed, 41 insertions(+), 41 deletions(-) diff --git a/include/kernel-5.4 b/include/kernel-5.4 index 2e0463537b..abffa8818f 100644 --- a/include/kernel-5.4 +++ b/include/kernel-5.4 @@ -1,2 +1,2 @@ -LINUX_VERSION-5.4 = .243 -LINUX_KERNEL_HASH-5.4.243 = c3cf664feeeee47e0f0c45c53705568f73692c37a3ff7f11c1b15e59610feb04 +LINUX_VERSION-5.4 = .244 +LINUX_KERNEL_HASH-5.4.244 = 90f5280e95ed7b374ad6f3979ed08008e29a051e5f372d367c06ed75b002a21b diff --git a/target/linux/bcm27xx/patches-5.4/950-0208-bcmgenet-Better-coalescing-parameter-defaults.patch b/target/linux/bcm27xx/patches-5.4/950-0208-bcmgenet-Better-coalescing-parameter-defaults.patch index 796f7dfe0a..225e7bc2b0 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0208-bcmgenet-Better-coalescing-parameter-defaults.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0208-bcmgenet-Better-coalescing-parameter-defaults.patch @@ -27,7 +27,7 @@ Signed-off-by: Phil Elwell /* Disable rate control for now */ bcmgenet_tdma_ring_writel(priv, index, flow_period_val, TDMA_FLOW_PERIOD); -@@ -3591,9 +3591,12 @@ static int bcmgenet_probe(struct platfor +@@ -3592,9 +3592,12 @@ static int bcmgenet_probe(struct platfor netif_set_real_num_rx_queues(priv->dev, priv->hw_params->rx_queues + 1); /* Set default coalescing parameters */ diff --git a/target/linux/bcm27xx/patches-5.4/950-0218-usb-add-plumbing-for-updating-interrupt-endpoint-int.patch b/target/linux/bcm27xx/patches-5.4/950-0218-usb-add-plumbing-for-updating-interrupt-endpoint-int.patch index 5837187b26..530805e355 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0218-usb-add-plumbing-for-updating-interrupt-endpoint-int.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0218-usb-add-plumbing-for-updating-interrupt-endpoint-int.patch @@ -70,7 +70,7 @@ Signed-off-by: Jonathan Bell * @dev: the device whose endpoint is being disabled --- a/include/linux/usb.h +++ b/include/linux/usb.h -@@ -1821,6 +1821,8 @@ extern int usb_clear_halt(struct usb_dev +@@ -1826,6 +1826,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); diff --git a/target/linux/bcm27xx/patches-5.4/950-0336-drm-v3d-The-third-IRQ-is-optional.patch b/target/linux/bcm27xx/patches-5.4/950-0336-drm-v3d-The-third-IRQ-is-optional.patch index 7d4b6bb4d9..4026b200d1 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0336-drm-v3d-The-third-IRQ-is-optional.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0336-drm-v3d-The-third-IRQ-is-optional.patch @@ -13,7 +13,7 @@ Signed-off-by: Phil Elwell --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c -@@ -3490,7 +3490,7 @@ static int bcmgenet_probe(struct platfor +@@ -3491,7 +3491,7 @@ static int bcmgenet_probe(struct platfor priv = netdev_priv(dev); priv->irq0 = platform_get_irq(pdev, 0); priv->irq1 = platform_get_irq(pdev, 1); diff --git a/target/linux/bcm27xx/patches-5.4/950-0973-net-bcmgenet-Reset-RBUF-on-first-open.patch b/target/linux/bcm27xx/patches-5.4/950-0973-net-bcmgenet-Reset-RBUF-on-first-open.patch index c66ce3c0a2..18b92656ea 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0973-net-bcmgenet-Reset-RBUF-on-first-open.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0973-net-bcmgenet-Reset-RBUF-on-first-open.patch @@ -59,7 +59,7 @@ Signed-off-by: Phil Elwell /* Reinitialize TDMA and RDMA and SW housekeeping */ ret = bcmgenet_init_dma(priv); -@@ -3682,7 +3690,7 @@ static int bcmgenet_resume(struct device +@@ -3683,7 +3691,7 @@ static int bcmgenet_resume(struct device bcmgenet_power_up(priv, GENET_POWER_WOL_MAGIC); /* Disable RX/TX DMA and flush TX queues */ diff --git a/target/linux/generic/backport-5.4/600-v5.12-net-extract-napi-poll-functionality-to-__napi_poll.patch b/target/linux/generic/backport-5.4/600-v5.12-net-extract-napi-poll-functionality-to-__napi_poll.patch index 34686f84a7..4392ef6f05 100644 --- a/target/linux/generic/backport-5.4/600-v5.12-net-extract-napi-poll-functionality-to-__napi_poll.patch +++ b/target/linux/generic/backport-5.4/600-v5.12-net-extract-napi-poll-functionality-to-__napi_poll.patch @@ -18,7 +18,7 @@ Signed-off-by: David S. Miller --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -6328,15 +6328,10 @@ void netif_napi_del(struct napi_struct * +@@ -6330,15 +6330,10 @@ void netif_napi_del(struct napi_struct * } EXPORT_SYMBOL(netif_napi_del); @@ -35,7 +35,7 @@ Signed-off-by: David S. Miller weight = n->weight; /* This NAPI_STATE_SCHED test is for avoiding a race -@@ -6354,7 +6349,7 @@ static int napi_poll(struct napi_struct +@@ -6356,7 +6351,7 @@ static int napi_poll(struct napi_struct WARN_ON_ONCE(work > weight); if (likely(work < weight)) @@ -44,7 +44,7 @@ Signed-off-by: David S. Miller /* Drivers must not modify the NAPI state if they * consume the entire weight. In such cases this code -@@ -6363,7 +6358,7 @@ static int napi_poll(struct napi_struct +@@ -6365,7 +6360,7 @@ static int napi_poll(struct napi_struct */ if (unlikely(napi_disable_pending(n))) { napi_complete(n); @@ -53,7 +53,7 @@ Signed-off-by: David S. Miller } if (n->gro_bitmask) { -@@ -6381,12 +6376,29 @@ static int napi_poll(struct napi_struct +@@ -6383,12 +6378,29 @@ static int napi_poll(struct napi_struct if (unlikely(!list_empty(&n->poll_list))) { pr_warn_once("%s: Budget exhausted after napi rescheduled\n", n->dev ? n->dev->name : "backlog"); diff --git a/target/linux/generic/backport-5.4/601-v5.12-net-implement-threaded-able-napi-poll-loop-support.patch b/target/linux/generic/backport-5.4/601-v5.12-net-implement-threaded-able-napi-poll-loop-support.patch index c890240915..2b3f783fa8 100644 --- a/target/linux/generic/backport-5.4/601-v5.12-net-implement-threaded-able-napi-poll-loop-support.patch +++ b/target/linux/generic/backport-5.4/601-v5.12-net-implement-threaded-able-napi-poll-loop-support.patch @@ -131,7 +131,7 @@ Signed-off-by: David S. Miller static int __dev_open(struct net_device *dev, struct netlink_ext_ack *extack) { const struct net_device_ops *ops = dev->netdev_ops; -@@ -3891,6 +3913,21 @@ int gro_normal_batch __read_mostly = 8; +@@ -3893,6 +3915,21 @@ int gro_normal_batch __read_mostly = 8; static inline void ____napi_schedule(struct softnet_data *sd, struct napi_struct *napi) { @@ -153,7 +153,7 @@ Signed-off-by: David S. Miller list_add_tail(&napi->poll_list, &sd->poll_list); __raise_softirq_irqoff(NET_RX_SOFTIRQ); } -@@ -6282,6 +6319,12 @@ void netif_napi_add(struct net_device *d +@@ -6284,6 +6321,12 @@ void netif_napi_add(struct net_device *d set_bit(NAPI_STATE_NPSVC, &napi->state); list_add_rcu(&napi->dev_list, &dev->napi_list); napi_hash_add(napi); @@ -166,7 +166,7 @@ Signed-off-by: David S. Miller } EXPORT_SYMBOL(netif_napi_add); -@@ -6298,9 +6341,28 @@ void napi_disable(struct napi_struct *n) +@@ -6300,9 +6343,28 @@ void napi_disable(struct napi_struct *n) hrtimer_cancel(&n->timer); clear_bit(NAPI_STATE_DISABLE, &n->state); @@ -195,7 +195,7 @@ Signed-off-by: David S. Miller static void flush_gro_hash(struct napi_struct *napi) { int i; -@@ -6325,6 +6387,11 @@ void netif_napi_del(struct napi_struct * +@@ -6327,6 +6389,11 @@ void netif_napi_del(struct napi_struct * flush_gro_hash(napi); napi->gro_bitmask = 0; @@ -207,7 +207,7 @@ Signed-off-by: David S. Miller } EXPORT_SYMBOL(netif_napi_del); -@@ -6404,6 +6471,51 @@ static int napi_poll(struct napi_struct +@@ -6406,6 +6473,51 @@ static int napi_poll(struct napi_struct return work; } diff --git a/target/linux/generic/backport-5.4/602-v5.12-net-add-sysfs-attribute-to-control-napi-threaded-mod.patch b/target/linux/generic/backport-5.4/602-v5.12-net-add-sysfs-attribute-to-control-napi-threaded-mod.patch index 05c40a91d5..cf957d7674 100644 --- a/target/linux/generic/backport-5.4/602-v5.12-net-add-sysfs-attribute-to-control-napi-threaded-mod.patch +++ b/target/linux/generic/backport-5.4/602-v5.12-net-add-sysfs-attribute-to-control-napi-threaded-mod.patch @@ -57,7 +57,7 @@ Signed-off-by: David S. Miller * @n: NAPI context --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -3917,8 +3917,9 @@ static inline void ____napi_schedule(str +@@ -3919,8 +3919,9 @@ static inline void ____napi_schedule(str if (test_bit(NAPI_STATE_THREADED, &napi->state)) { /* Paired with smp_mb__before_atomic() in @@ -69,7 +69,7 @@ Signed-off-by: David S. Miller * wake_up_process() when it's not NULL. */ thread = READ_ONCE(napi->thread); -@@ -6296,6 +6297,49 @@ static void init_gro_hash(struct napi_st +@@ -6298,6 +6299,49 @@ static void init_gro_hash(struct napi_st napi->gro_bitmask = 0; } diff --git a/target/linux/generic/backport-5.4/603-v5.12-net-fix-race-between-napi-kthread-mode-and-busy-poll.patch b/target/linux/generic/backport-5.4/603-v5.12-net-fix-race-between-napi-kthread-mode-and-busy-poll.patch index 103ed5713b..4b8f2352d2 100644 --- a/target/linux/generic/backport-5.4/603-v5.12-net-fix-race-between-napi-kthread-mode-and-busy-poll.patch +++ b/target/linux/generic/backport-5.4/603-v5.12-net-fix-race-between-napi-kthread-mode-and-busy-poll.patch @@ -45,7 +45,7 @@ Cc: Hannes Frederic Sowa enum gro_result { --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -3924,6 +3924,8 @@ static inline void ____napi_schedule(str +@@ -3926,6 +3926,8 @@ static inline void ____napi_schedule(str */ thread = READ_ONCE(napi->thread); if (thread) { @@ -54,7 +54,7 @@ Cc: Hannes Frederic Sowa wake_up_process(thread); return; } -@@ -6084,7 +6086,8 @@ bool napi_complete_done(struct napi_stru +@@ -6086,7 +6088,8 @@ bool napi_complete_done(struct napi_stru WARN_ON_ONCE(!(val & NAPIF_STATE_SCHED)); @@ -64,7 +64,7 @@ Cc: Hannes Frederic Sowa /* If STATE_MISSED was set, leave STATE_SCHED set, * because we will call napi->poll() one more time. -@@ -6517,16 +6520,25 @@ static int napi_poll(struct napi_struct +@@ -6519,16 +6522,25 @@ static int napi_poll(struct napi_struct static int napi_thread_wait(struct napi_struct *napi) { diff --git a/target/linux/generic/backport-5.4/604-v5.12-net-fix-hangup-on-napi_disable-for-threaded-napi.patch b/target/linux/generic/backport-5.4/604-v5.12-net-fix-hangup-on-napi_disable-for-threaded-napi.patch index a02597329b..8dcec5fca5 100644 --- a/target/linux/generic/backport-5.4/604-v5.12-net-fix-hangup-on-napi_disable-for-threaded-napi.patch +++ b/target/linux/generic/backport-5.4/604-v5.12-net-fix-hangup-on-napi_disable-for-threaded-napi.patch @@ -34,7 +34,7 @@ Signed-off-by: Jakub Kicinski --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -6524,7 +6524,7 @@ static int napi_thread_wait(struct napi_ +@@ -6526,7 +6526,7 @@ static int napi_thread_wait(struct napi_ set_current_state(TASK_INTERRUPTIBLE); @@ -43,7 +43,7 @@ Signed-off-by: Jakub Kicinski /* Testing SCHED_THREADED bit here to make sure the current * kthread owns this napi and could poll on this napi. * Testing SCHED bit is not enough because SCHED bit might be -@@ -6542,6 +6542,7 @@ static int napi_thread_wait(struct napi_ +@@ -6544,6 +6544,7 @@ static int napi_thread_wait(struct napi_ set_current_state(TASK_INTERRUPTIBLE); } __set_current_state(TASK_RUNNING); diff --git a/target/linux/generic/backport-5.4/700-v5.5-net-core-allow-fast-GRO-for-skbs-with-Ethernet-heade.patch b/target/linux/generic/backport-5.4/700-v5.5-net-core-allow-fast-GRO-for-skbs-with-Ethernet-heade.patch index b063efb859..4ed63c0601 100644 --- a/target/linux/generic/backport-5.4/700-v5.5-net-core-allow-fast-GRO-for-skbs-with-Ethernet-heade.patch +++ b/target/linux/generic/backport-5.4/700-v5.5-net-core-allow-fast-GRO-for-skbs-with-Ethernet-heade.patch @@ -66,7 +66,7 @@ Signed-off-by: David S. Miller --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -5478,8 +5478,7 @@ static inline void skb_gro_reset_offset( +@@ -5480,8 +5480,7 @@ static inline void skb_gro_reset_offset( NAPI_GRO_CB(skb)->frag0 = NULL; NAPI_GRO_CB(skb)->frag0_len = 0; diff --git a/target/linux/generic/hack-5.4/721-phy_packets.patch b/target/linux/generic/hack-5.4/721-phy_packets.patch index 91fd4ee7bd..b810c30c52 100644 --- a/target/linux/generic/hack-5.4/721-phy_packets.patch +++ b/target/linux/generic/hack-5.4/721-phy_packets.patch @@ -101,7 +101,7 @@ Signed-off-by: Felix Fietkau help --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -3223,10 +3223,20 @@ static int xmit_one(struct sk_buff *skb, +@@ -3225,10 +3225,20 @@ static int xmit_one(struct sk_buff *skb, if (dev_nit_active(dev)) dev_queue_xmit_nit(skb, dev); diff --git a/target/linux/generic/hack-5.4/953-net-patch-linux-kernel-to-support-shortcut-fe.patch b/target/linux/generic/hack-5.4/953-net-patch-linux-kernel-to-support-shortcut-fe.patch index 113afa80b9..bcf5c2cf39 100644 --- a/target/linux/generic/hack-5.4/953-net-patch-linux-kernel-to-support-shortcut-fe.patch +++ b/target/linux/generic/hack-5.4/953-net-patch-linux-kernel-to-support-shortcut-fe.patch @@ -80,7 +80,7 @@ struct net_bridge_port *p; --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -3220,9 +3220,17 @@ static int xmit_one(struct sk_buff *skb, +@@ -3222,9 +3222,17 @@ static int xmit_one(struct sk_buff *skb, unsigned int len; int rc; @@ -99,7 +99,7 @@ #ifdef CONFIG_ETHERNET_PACKET_MANGLE if (!dev->eth_mangle_tx || (skb = dev->eth_mangle_tx(dev, skb)) != NULL) -@@ -4756,6 +4764,11 @@ void netdev_rx_handler_unregister(struct +@@ -4758,6 +4766,11 @@ void netdev_rx_handler_unregister(struct } EXPORT_SYMBOL_GPL(netdev_rx_handler_unregister); @@ -111,7 +111,7 @@ /* * Limit the use of PFMEMALLOC reserves to those protocols that implement * the special handling of PFMEMALLOC skbs. -@@ -4806,6 +4819,10 @@ static int __netif_receive_skb_core(stru +@@ -4808,6 +4821,10 @@ static int __netif_receive_skb_core(stru int ret = NET_RX_DROP; __be16 type; @@ -122,7 +122,7 @@ net_timestamp_check(!READ_ONCE(netdev_tstamp_prequeue), skb); trace_netif_receive_skb(skb); -@@ -4845,6 +4862,16 @@ another_round: +@@ -4847,6 +4864,16 @@ another_round: goto out; } diff --git a/target/linux/generic/pending-5.4/630-packet_socket_type.patch b/target/linux/generic/pending-5.4/630-packet_socket_type.patch index 848042bcd6..6528e705ad 100644 --- a/target/linux/generic/pending-5.4/630-packet_socket_type.patch +++ b/target/linux/generic/pending-5.4/630-packet_socket_type.patch @@ -55,7 +55,7 @@ Signed-off-by: Felix Fietkau goto out; if (!net_eq(dev_net(dev), sock_net(sk))) -@@ -2069,12 +2071,12 @@ static int packet_rcv(struct sk_buff *sk +@@ -2067,12 +2069,12 @@ static int packet_rcv(struct sk_buff *sk unsigned int snaplen, res; bool is_drop_n_account = false; @@ -71,7 +71,7 @@ Signed-off-by: Felix Fietkau if (!net_eq(dev_net(dev), sock_net(sk))) goto drop; -@@ -2200,12 +2202,12 @@ static int tpacket_rcv(struct sk_buff *s +@@ -2198,12 +2200,12 @@ static int tpacket_rcv(struct sk_buff *s BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h2)) != 32); BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h3)) != 48); @@ -87,7 +87,7 @@ Signed-off-by: Felix Fietkau if (!net_eq(dev_net(dev), sock_net(sk))) goto drop; -@@ -3313,6 +3315,7 @@ static int packet_create(struct net *net +@@ -3311,6 +3313,7 @@ static int packet_create(struct net *net mutex_init(&po->pg_vec_lock); po->rollover = NULL; po->prot_hook.func = packet_rcv; @@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau if (sock->type == SOCK_PACKET) po->prot_hook.func = packet_rcv_spkt; -@@ -3952,6 +3955,16 @@ packet_setsockopt(struct socket *sock, i +@@ -3950,6 +3953,16 @@ packet_setsockopt(struct socket *sock, i WRITE_ONCE(po->xmit, val ? packet_direct_xmit : dev_queue_xmit); return 0; } @@ -112,7 +112,7 @@ Signed-off-by: Felix Fietkau default: return -ENOPROTOOPT; } -@@ -4008,6 +4021,13 @@ static int packet_getsockopt(struct sock +@@ -4006,6 +4019,13 @@ static int packet_getsockopt(struct sock case PACKET_VNET_HDR: val = po->has_vnet_hdr; break; diff --git a/target/linux/generic/pending-5.4/640-netfilter-nf_flow_table-add-hardware-offload-support.patch b/target/linux/generic/pending-5.4/640-netfilter-nf_flow_table-add-hardware-offload-support.patch index 0eec482784..85030c2f09 100644 --- a/target/linux/generic/pending-5.4/640-netfilter-nf_flow_table-add-hardware-offload-support.patch +++ b/target/linux/generic/pending-5.4/640-netfilter-nf_flow_table-add-hardware-offload-support.patch @@ -506,7 +506,7 @@ Signed-off-by: Pablo Neira Ayuso +MODULE_ALIAS("nf-flow-table-hw"); --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c -@@ -5770,6 +5770,13 @@ static int nf_tables_flowtable_parse_hoo +@@ -5802,6 +5802,13 @@ static int nf_tables_flowtable_parse_hoo if (err < 0) return err; @@ -520,7 +520,7 @@ Signed-off-by: Pablo Neira Ayuso ops = kcalloc(n, sizeof(struct nf_hook_ops), GFP_KERNEL); if (!ops) return -ENOMEM; -@@ -5900,10 +5907,19 @@ static int nf_tables_newflowtable(struct +@@ -5932,10 +5939,19 @@ static int nf_tables_newflowtable(struct } flowtable->data.type = type; @@ -540,7 +540,7 @@ Signed-off-by: Pablo Neira Ayuso err = nf_tables_flowtable_parse_hook(&ctx, nla[NFTA_FLOWTABLE_HOOK], flowtable); if (err < 0) -@@ -6029,7 +6045,8 @@ static int nf_tables_fill_flowtable_info +@@ -6061,7 +6077,8 @@ static int nf_tables_fill_flowtable_info nla_put_string(skb, NFTA_FLOWTABLE_NAME, flowtable->name) || nla_put_be32(skb, NFTA_FLOWTABLE_USE, htonl(flowtable->use)) || nla_put_be64(skb, NFTA_FLOWTABLE_HANDLE, cpu_to_be64(flowtable->handle), diff --git a/target/linux/generic/pending-5.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/pending-5.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch index ff99f60fb9..1cc6887797 100644 --- a/target/linux/generic/pending-5.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch +++ b/target/linux/generic/pending-5.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch @@ -32,7 +32,7 @@ Signed-off-by: Felix Fietkau __u16 tc_index; /* traffic control index */ --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -5544,6 +5544,9 @@ static enum gro_result dev_gro_receive(s +@@ -5546,6 +5546,9 @@ static enum gro_result dev_gro_receive(s int same_flow; int grow; @@ -42,7 +42,7 @@ Signed-off-by: Felix Fietkau if (netif_elide_gro(skb->dev)) goto normal; -@@ -7487,6 +7490,48 @@ static void __netdev_adjacent_dev_unlink +@@ -7489,6 +7492,48 @@ static void __netdev_adjacent_dev_unlink &upper_dev->adj_list.lower); } @@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau static int __netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev, bool master, void *upper_priv, void *upper_info, -@@ -7537,6 +7582,7 @@ static int __netdev_upper_dev_link(struc +@@ -7539,6 +7584,7 @@ static int __netdev_upper_dev_link(struc if (ret) return ret; @@ -99,7 +99,7 @@ Signed-off-by: Felix Fietkau ret = call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, &changeupper_info.info); ret = notifier_to_errno(ret); -@@ -7630,6 +7676,7 @@ void netdev_upper_dev_unlink(struct net_ +@@ -7632,6 +7678,7 @@ void netdev_upper_dev_unlink(struct net_ __netdev_adjacent_dev_unlink_neighbour(dev, upper_dev); @@ -107,7 +107,7 @@ Signed-off-by: Felix Fietkau call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, &changeupper_info.info); -@@ -8360,6 +8407,7 @@ int dev_set_mac_address(struct net_devic +@@ -8362,6 +8409,7 @@ int dev_set_mac_address(struct net_devic if (err) return err; dev->addr_assign_type = NET_ADDR_SET; From 0c9a28e9e0ecd53a4e268500cd3220a3fbef8f3b Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Fri, 2 Jun 2023 13:04:32 +0800 Subject: [PATCH 63/67] openssl: fix build for octeon Signed-off-by: Tianling Shen --- .../patches/106-Configure-fixup-for-octeon.patch | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 package/libs/openssl/patches/106-Configure-fixup-for-octeon.patch diff --git a/package/libs/openssl/patches/106-Configure-fixup-for-octeon.patch b/package/libs/openssl/patches/106-Configure-fixup-for-octeon.patch new file mode 100644 index 0000000000..3f46ff72ef --- /dev/null +++ b/package/libs/openssl/patches/106-Configure-fixup-for-octeon.patch @@ -0,0 +1,11 @@ +--- a/Configure ++++ b/Configure +@@ -1244,7 +1244,7 @@ if ($target =~ /^mingw/ && `$config{CC} + } + + if ($target =~ /linux.*-mips/ && !$disabled{asm} +- && !grep { $_ =~ /-m(ips|arch=)/ } (@{$config{CFLAGS}})) { ++ && !grep { $_ !~ /-m(ips|arch=)/ } (@{$config{CFLAGS}})) { + # minimally required architecture flags for assembly modules + my $value; + $value = '-mips2' if ($target =~ /mips32/); From 7cf66961200a6f36409255bd3182b40e90f836ec Mon Sep 17 00:00:00 2001 From: Yuteng Zhong Date: Mon, 5 Jun 2023 15:54:53 +0800 Subject: [PATCH 64/67] procd: jail: ignore missing .dynamic sect A static-linked binary doesn't have a .dynamic section, but when starting ujail with -r or -w will automatically search for PT_DYNAMIC in ELF and exit with failure if it is not found. Fixes: #970 Signed-off-by: Yuteng Zhong Signed-off-by: Tianling Shen --- ...tion-error-caused-by-unused-variable.patch | 5 --- ...ail-correctly-check-for-null-pointer.patch | 25 +++++++++++ ...03-jail-ignore-missing-.dynamic-sect.patch | 45 +++++++++++++++++++ 3 files changed, 70 insertions(+), 5 deletions(-) create mode 100644 package/system/procd/patches/0002-jail-correctly-check-for-null-pointer.patch create mode 100644 package/system/procd/patches/0003-jail-ignore-missing-.dynamic-sect.patch diff --git a/package/system/procd/patches/0001-uxc-fix-compilation-error-caused-by-unused-variable.patch b/package/system/procd/patches/0001-uxc-fix-compilation-error-caused-by-unused-variable.patch index 6c1a21ebea..6e8c30777a 100644 --- a/package/system/procd/patches/0001-uxc-fix-compilation-error-caused-by-unused-variable.patch +++ b/package/system/procd/patches/0001-uxc-fix-compilation-error-caused-by-unused-variable.patch @@ -10,8 +10,6 @@ Signed-off-by: Christian Marangi uxc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -diff --git a/uxc.c b/uxc.c -index eb40eb2..b22d838 100644 --- a/uxc.c +++ b/uxc.c @@ -80,6 +80,8 @@ static struct blob_buf conf; @@ -31,6 +29,3 @@ index eb40eb2..b22d838 100644 int signal = SIGTERM; int c; --- -2.37.2 - diff --git a/package/system/procd/patches/0002-jail-correctly-check-for-null-pointer.patch b/package/system/procd/patches/0002-jail-correctly-check-for-null-pointer.patch new file mode 100644 index 0000000000..5028e23da8 --- /dev/null +++ b/package/system/procd/patches/0002-jail-correctly-check-for-null-pointer.patch @@ -0,0 +1,25 @@ +From 24f6bc4322754a753e4e3e413659d542fa798c7b Mon Sep 17 00:00:00 2001 +From: Philipp Meier +Date: Tue, 8 Nov 2022 14:38:37 +0100 +Subject: [PATCH] jail: correctly check for null pointer + +Handle case where opts.sysctl is not used. + +Signed-off-by: Philipp Meier +--- + jail/jail.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/jail/jail.c ++++ b/jail/jail.c +@@ -213,6 +213,10 @@ static void free_hooklist(struct hook_ex + + static void free_sysctl(void) { + struct sysctl_val *cur; ++ ++ if (!opts.sysctl) ++ return; ++ + cur = *opts.sysctl; + + while (cur) { diff --git a/package/system/procd/patches/0003-jail-ignore-missing-.dynamic-sect.patch b/package/system/procd/patches/0003-jail-ignore-missing-.dynamic-sect.patch new file mode 100644 index 0000000000..486f0f839c --- /dev/null +++ b/package/system/procd/patches/0003-jail-ignore-missing-.dynamic-sect.patch @@ -0,0 +1,45 @@ +From 93b2c2d5ed4ca369a9ea48163024125b958212b5 Mon Sep 17 00:00:00 2001 +From: Yuteng Zhong +Date: Sun, 9 Oct 2022 22:53:27 +0800 +Subject: [PATCH] jail: ignore missing .dynamic sect + +A static-linked binary doesn't have a .dynamic section, but when +starting ujail with -r or -w will automatically search for PT_DYNAMIC in +ELF and exit with failure if it is not found. + +github issue: https://github.com/openwrt/openwrt/issues/10933 + +Signed-off-by: Yuteng Zhong +--- + jail/elf.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +--- a/jail/elf.c ++++ b/jail/elf.c +@@ -240,18 +240,18 @@ int elf_load_deps(const char *path, cons + + gcc_mips64_bug_work_around = 1; + #endif +- if (elf_find_section(map, PT_LOAD, &load_offset, NULL, &load_vaddr)) { +- ERROR("failed to load the .load section from %s\n", path); +- return -1; ++ if (elf_find_section(map, PT_INTERP, &interp_offset, NULL, NULL) == 0) { ++ add_path_and_deps(map+interp_offset, 1, -1, 0); + } + +- if (elf_find_section(map, PT_DYNAMIC, &dyn_offset, &dyn_size, NULL)) { +- ERROR("failed to load the .dynamic section from %s\n", path); +- return -1; ++ if (elf_find_section(map, PT_LOAD, &load_offset, NULL, &load_vaddr)) { ++ DEBUG("failed to load the .load section from %s\n", path); ++ return 0; + } + +- if (elf_find_section(map, PT_INTERP, &interp_offset, NULL, NULL) == 0) { +- add_path_and_deps(map+interp_offset, 1, -1, 0); ++ if (elf_find_section(map, PT_DYNAMIC, &dyn_offset, &dyn_size, NULL)) { ++ DEBUG("failed to load the .dynamic section from %s\n", path); ++ return 0; + } + + int clazz = map[EI_CLASS]; From 2e05d5a0362e2765fe6fb3444ada758dc5ef49f0 Mon Sep 17 00:00:00 2001 From: Jitao Lu Date: Wed, 14 Jun 2023 17:25:03 +0800 Subject: [PATCH 65/67] openssl: passing cflags to configure openssl sets additional cflags in its configuration script. We need to make it aware of our custom cflags to avoid adding conflicting cflags. Fixes: #12866 Signed-off-by: Jitao Lu (cherry picked from commit 51f57e7c2dd2799e34036ec74b3436bf490fade0) --- package/libs/openssl/Makefile | 3 ++- .../patches/106-Configure-fixup-for-octeon.patch | 11 ----------- 2 files changed, 2 insertions(+), 12 deletions(-) delete mode 100644 package/libs/openssl/patches/106-Configure-fixup-for-octeon.patch diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile index 9ccdb72d2a..bd3e18cf89 100644 --- a/package/libs/openssl/Makefile +++ b/package/libs/openssl/Makefile @@ -11,7 +11,7 @@ PKG_NAME:=openssl PKG_BASE:=1.1.1 PKG_BUGFIX:=u PKG_VERSION:=$(PKG_BASE)$(PKG_BUGFIX) -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_USE_MIPS16:=0 ENGINES_DIR=engines-1.1 @@ -338,6 +338,7 @@ define Build/Configure --libdir=lib \ --openssldir=/etc/ssl \ --cross-compile-prefix="$(TARGET_CROSS)" \ + $(TARGET_CFLAGS) \ $(TARGET_CPPFLAGS) \ $(TARGET_LDFLAGS) \ $(OPENSSL_OPTIONS) && \ diff --git a/package/libs/openssl/patches/106-Configure-fixup-for-octeon.patch b/package/libs/openssl/patches/106-Configure-fixup-for-octeon.patch deleted file mode 100644 index 3f46ff72ef..0000000000 --- a/package/libs/openssl/patches/106-Configure-fixup-for-octeon.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/Configure -+++ b/Configure -@@ -1244,7 +1244,7 @@ if ($target =~ /^mingw/ && `$config{CC} - } - - if ($target =~ /linux.*-mips/ && !$disabled{asm} -- && !grep { $_ =~ /-m(ips|arch=)/ } (@{$config{CFLAGS}})) { -+ && !grep { $_ !~ /-m(ips|arch=)/ } (@{$config{CFLAGS}})) { - # minimally required architecture flags for assembly modules - my $value; - $value = '-mips2' if ($target =~ /mips32/); From 66cf99e2e1d16bb855a382fffb8a68a57ac02078 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Sat, 17 Jun 2023 18:30:52 +0800 Subject: [PATCH 66/67] mhz: bump to latest git HEAD Signed-off-by: Tianling Shen (cherry picked from commit 1bd92542b9d6fb670847f9d14a6aa6878913a363) --- package/utils/mhz/Makefile | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/package/utils/mhz/Makefile b/package/utils/mhz/Makefile index b09d9906ab..9b6f318d69 100644 --- a/package/utils/mhz/Makefile +++ b/package/utils/mhz/Makefile @@ -5,11 +5,13 @@ PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=https://github.com/wtarreau/mhz.git -PKG_SOURCE_DATE:=2022-08-18 -PKG_SOURCE_VERSION:=6ec38cbb1371d20078a7a5059dd9faa5b281b2d9 -PKG_MIRROR_HASH:=37559cc8b5e08d23c09878d63cf81ea8d123be45408f3e76e1dc042766a746a7 +PKG_SOURCE_DATE:=2023-06-17 +PKG_SOURCE_VERSION:=11aac2399780a1f7ea9f007b14af0464797d5cf1 +PKG_MIRROR_HASH:=b3ea0c9e6f111755c4207addef0ea210ace86bc6910c959c6fc489026897676f PKG_MAINTAINER:=Robert Marko +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE include $(INCLUDE_DIR)/package.mk @@ -20,9 +22,13 @@ define Package/mhz URL:=https://github.com/wtarreau/mhz endef +define Package/mhz/description + Tool to mathematically calculate the current CPU frequency. +endef + define Package/mhz/install $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/mhz $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/mhz $(1)/usr/sbin/mhz endef $(eval $(call BuildPackage,mhz)) From 3f4a88db29673b4c9a17d80b975e6e1a41cbd9cd Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Fri, 23 Jun 2023 16:12:07 +0800 Subject: [PATCH 67/67] kernel: bump to 5.4.248 Refreshed all patches. Signed-off-by: Tianling Shen --- include/kernel-5.4 | 4 +-- ...an-up-boot_command_line-initializati.patch | 4 +-- .../910-unaligned_access_hacks.patch | 4 +-- ...043-MMC-added-alternative-MMC-driver.patch | 6 ++--- ...dded-Device-IDs-for-August-DVB-T-205.patch | 2 +- ...ce-quirks-for-Freeway-Airmouse-T3-an.patch | 2 +- ....dtbo-overlays-to-be-built-piecemeal.patch | 2 +- ...s-media-i2c-Add-IMX219-CMOS-sensor-b.patch | 2 +- ...ow-.dtbo-overlays-to-be-built-adjust.patch | 2 +- ...play-Convert-VC4-bindings-to-schemas.patch | 2 +- ...2c-Add-driver-for-Sony-IMX477-sensor.patch | 2 +- ...-dma-buf-Add-dma-buf-heaps-framework.patch | 2 +- ...s-media-i2c-Add-IMX290-CMOS-sensor-b.patch | 2 +- ...-net-WireGuard-secure-network-tunnel.patch | 2 +- ...pi-poll-functionality-to-__napi_poll.patch | 8 +++--- ...threaded-able-napi-poll-loop-support.patch | 12 ++++----- ...tribute-to-control-napi-threaded-mod.patch | 2 +- ...ween-napi-kthread-mode-and-busy-poll.patch | 4 +-- ...up-on-napi_disable-for-threaded-napi.patch | 4 +-- ...ack-sanitize-table-size-default-sett.patch | 2 +- ...ast-GRO-for-skbs-with-Ethernet-heade.patch | 2 +- .../generic/hack-5.4/259-regmap_dynamic.patch | 2 +- .../generic/hack-5.4/280-rfkill-stubs.patch | 2 +- ...t-size-the-hashtable-more-adequately.patch | 2 +- .../661-use_fq_codel_by_default.patch | 2 +- .../generic/hack-5.4/721-phy_packets.patch | 8 +++--- ...k-events-support-multiple-registrant.patch | 4 +-- ...-linux-kernel-to-support-shortcut-fe.patch | 8 +++--- .../993-usb-serial-option-add-u9300.patch | 8 +++--- .../pending-5.4/630-packet_socket_type.patch | 6 ++--- ...w_table-add-hardware-offload-support.patch | 6 ++--- ...w_table-support-hw-offload-through-v.patch | 6 ++--- ...T-skip-GRO-for-foreign-MAC-addresses.patch | 12 ++++----- ...ta-Assign-OF-node-to-the-SCSI-device.patch | 4 +-- ...4019-needs-rfs-vlan_tag-callbacks-in.patch | 4 +-- ...fsl_mc_command-struct-in-a-uapi-head.patch | 2 +- ...sl-mc-add-root-dprc-rescan-attribute.patch | 2 +- ...publish-ocelot_sys.h-to-include-soc-.patch | 2 +- ...add-tagger-for-Ocelot-Felix-switches.patch | 2 +- ...t-add-driver-for-Felix-switch-family.patch | 2 +- ...-eth-add-pfe-support-to-Kconfig-and-.patch | 2 +- ...interface-for-APP-layer-to-config-TS.patch | 4 +-- ...mple-debug-console-via-the-hyperviso.patch | 2 +- ...cure_key-Adds-the-secure-key-support.patch | 2 +- ...dds-support-for-secure-key-type-as-m.patch | 2 +- ...actor-Mobiveil-PCIe-Host-Bridge-IP-d.patch | 2 +- ...I-mobiveil-Add-the-EP-driver-support.patch | 2 +- ...-0006-config-qe-add-irq-qeic-support.patch | 2 +- ...rial-lpuart-add-power-domain-support.patch | 4 +-- ...al-fsl_lpuart-add-modem-device-reset.patch | 2 +- ...l_lpuart-enable-dma-mode-for-imx8qxp.patch | 24 ++++++++--------- ...-fsl_lpuart-do-HW-reset-for-communic.patch | 4 +-- ...-serial-lpuart-add-runtime-pm-suppor.patch | 20 +++++++------- ...uart-enable-wakeup-source-for-lpuart.patch | 26 +++++++++---------- ...rial-fsl_lpuart-enable-two-stop-bits.patch | 6 ++--- ...l-lpuart-support-UPIO_MEM32-for-lpua.patch | 2 +- ...5-usb-dwc3-add-otg-properties-update.patch | 2 +- ...an-entry-for-the-IEI-WT61P803-PUZZLE.patch | 2 +- ...an-up-boot_command_line-initializati.patch | 4 +-- ...reservation-in-bootmem_init-for-cert.patch | 6 ++--- ...-MIPS-add-bootargs-override-property.patch | 4 +-- ...013-owrt-hack-fix-mt7688-cache-issue.patch | 4 +-- 62 files changed, 142 insertions(+), 142 deletions(-) diff --git a/include/kernel-5.4 b/include/kernel-5.4 index abffa8818f..dbfc8efbd1 100644 --- a/include/kernel-5.4 +++ b/include/kernel-5.4 @@ -1,2 +1,2 @@ -LINUX_VERSION-5.4 = .244 -LINUX_KERNEL_HASH-5.4.244 = 90f5280e95ed7b374ad6f3979ed08008e29a051e5f372d367c06ed75b002a21b +LINUX_VERSION-5.4 = .248 +LINUX_KERNEL_HASH-5.4.248 = 3abed132e76c6575733acba39eaa54f6d8f4b1dc951b0e601a33959743b13e35 diff --git a/target/linux/ath79/patches-5.4/0001-MIPS-cmdline-Clean-up-boot_command_line-initializati.patch b/target/linux/ath79/patches-5.4/0001-MIPS-cmdline-Clean-up-boot_command_line-initializati.patch index eedc7498be..0a43402536 100644 --- a/target/linux/ath79/patches-5.4/0001-MIPS-cmdline-Clean-up-boot_command_line-initializati.patch +++ b/target/linux/ath79/patches-5.4/0001-MIPS-cmdline-Clean-up-boot_command_line-initializati.patch @@ -46,7 +46,7 @@ Cc: linux-mips@vger.kernel.org --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c -@@ -538,11 +538,88 @@ static void __init check_kernel_sections +@@ -539,11 +539,88 @@ static void __init check_kernel_sections } } @@ -140,7 +140,7 @@ Cc: linux-mips@vger.kernel.org /* * arch_mem_init - initialize memory management subsystem -@@ -570,48 +647,12 @@ static void __init arch_mem_init(char ** +@@ -571,48 +648,12 @@ static void __init arch_mem_init(char ** { extern void plat_mem_setup(void); diff --git a/target/linux/ath79/patches-5.4/910-unaligned_access_hacks.patch b/target/linux/ath79/patches-5.4/910-unaligned_access_hacks.patch index 5b67fcda6d..ca50a4c109 100644 --- a/target/linux/ath79/patches-5.4/910-unaligned_access_hacks.patch +++ b/target/linux/ath79/patches-5.4/910-unaligned_access_hacks.patch @@ -292,7 +292,7 @@ #endif /* _LINUX_TYPES_H */ --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c -@@ -1444,8 +1444,8 @@ struct sk_buff *inet_gro_receive(struct +@@ -1446,8 +1446,8 @@ struct sk_buff *inet_gro_receive(struct if (unlikely(ip_fast_csum((u8 *)iph, 5))) goto out_unlock; @@ -754,7 +754,7 @@ ptr = ip6hoff + sizeof(struct ipv6hdr); --- a/include/net/neighbour.h +++ b/include/net/neighbour.h -@@ -275,8 +275,10 @@ static inline bool neigh_key_eq128(const +@@ -270,8 +270,10 @@ static inline bool neigh_key_eq128(const const u32 *n32 = (const u32 *)n->primary_key; const u32 *p32 = pkey; diff --git a/target/linux/bcm27xx/patches-5.4/950-0043-MMC-added-alternative-MMC-driver.patch b/target/linux/bcm27xx/patches-5.4/950-0043-MMC-added-alternative-MMC-driver.patch index c2d725efe5..43cfc28522 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0043-MMC-added-alternative-MMC-driver.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0043-MMC-added-alternative-MMC-driver.patch @@ -222,7 +222,7 @@ Signed-off-by: Yaroslav Rosomakho static inline int mmc_blk_part_switch(struct mmc_card *card, unsigned int part_type); -@@ -2890,6 +2897,7 @@ static int mmc_blk_probe(struct mmc_card +@@ -2895,6 +2902,7 @@ static int mmc_blk_probe(struct mmc_card { struct mmc_blk_data *md, *part_md; char cap_str[10]; @@ -230,7 +230,7 @@ Signed-off-by: Yaroslav Rosomakho /* * Check that the card supports the command class(es) we need. -@@ -2897,7 +2905,16 @@ static int mmc_blk_probe(struct mmc_card +@@ -2902,7 +2910,16 @@ static int mmc_blk_probe(struct mmc_card if (!(card->csd.cmdclass & CCC_BLOCK_READ)) return -ENODEV; @@ -248,7 +248,7 @@ Signed-off-by: Yaroslav Rosomakho card->complete_wq = alloc_workqueue("mmc_complete", WQ_MEM_RECLAIM | WQ_HIGHPRI, 0); -@@ -2912,9 +2929,14 @@ static int mmc_blk_probe(struct mmc_card +@@ -2917,9 +2934,14 @@ static int mmc_blk_probe(struct mmc_card string_get_size((u64)get_capacity(md->disk), 512, STRING_UNITS_2, cap_str, sizeof(cap_str)); diff --git a/target/linux/bcm27xx/patches-5.4/950-0055-Added-Device-IDs-for-August-DVB-T-205.patch b/target/linux/bcm27xx/patches-5.4/950-0055-Added-Device-IDs-for-August-DVB-T-205.patch index f0c1896e33..87152ffe32 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0055-Added-Device-IDs-for-August-DVB-T-205.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0055-Added-Device-IDs-for-August-DVB-T-205.patch @@ -9,7 +9,7 @@ Subject: [PATCH] Added Device IDs for August DVB-T 205 --- a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c +++ b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c -@@ -1947,6 +1947,10 @@ static const struct usb_device_id rtl28x +@@ -1967,6 +1967,10 @@ static const struct usb_device_id rtl28x &rtl28xxu_props, "Compro VideoMate U650F", NULL) }, { DVB_USB_DEVICE(USB_VID_KWORLD_2, 0xd394, &rtl28xxu_props, "MaxMedia HU394-T", NULL) }, diff --git a/target/linux/bcm27xx/patches-5.4/950-0280-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch b/target/linux/bcm27xx/patches-5.4/950-0280-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch index 9d06e3c494..be7ace05e2 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0280-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0280-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch @@ -33,7 +33,7 @@ Signed-off-by: Jonathan Bell #define USB_VENDOR_ID_BELKIN 0x050d #define USB_DEVICE_ID_FLIP_KVM 0x3201 -@@ -1271,6 +1274,9 @@ +@@ -1272,6 +1275,9 @@ #define USB_VENDOR_ID_XAT 0x2505 #define USB_DEVICE_ID_XAT_CSR 0x0220 diff --git a/target/linux/bcm27xx/patches-5.4/950-0313-kbuild-Allow-.dtbo-overlays-to-be-built-piecemeal.patch b/target/linux/bcm27xx/patches-5.4/950-0313-kbuild-Allow-.dtbo-overlays-to-be-built-piecemeal.patch index d72712eb8b..50d512ba8a 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0313-kbuild-Allow-.dtbo-overlays-to-be-built-piecemeal.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0313-kbuild-Allow-.dtbo-overlays-to-be-built-piecemeal.patch @@ -24,7 +24,7 @@ Signed-off-by: Phil Elwell --- a/Makefile +++ b/Makefile -@@ -1281,6 +1281,9 @@ ifneq ($(dtstree),) +@@ -1285,6 +1285,9 @@ ifneq ($(dtstree),) %.dtb: include/config/kernel.release scripts_dtc $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@ diff --git a/target/linux/bcm27xx/patches-5.4/950-0451-media-dt-bindings-media-i2c-Add-IMX219-CMOS-sensor-b.patch b/target/linux/bcm27xx/patches-5.4/950-0451-media-dt-bindings-media-i2c-Add-IMX219-CMOS-sensor-b.patch index 09ea71185c..489ac2034c 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0451-media-dt-bindings-media-i2c-Add-IMX219-CMOS-sensor-b.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0451-media-dt-bindings-media-i2c-Add-IMX219-CMOS-sensor-b.patch @@ -139,7 +139,7 @@ Signed-off-by: Mauro Carvalho Chehab +... --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -15145,6 +15145,14 @@ S: Maintained +@@ -15138,6 +15138,14 @@ S: Maintained F: drivers/media/i2c/imx214.c F: Documentation/devicetree/bindings/media/i2c/sony,imx214.txt diff --git a/target/linux/bcm27xx/patches-5.4/950-0454-Kbuild-Allow-.dtbo-overlays-to-be-built-adjust.patch b/target/linux/bcm27xx/patches-5.4/950-0454-Kbuild-Allow-.dtbo-overlays-to-be-built-adjust.patch index e61e6e4e13..3a492cacf6 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0454-Kbuild-Allow-.dtbo-overlays-to-be-built-adjust.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0454-Kbuild-Allow-.dtbo-overlays-to-be-built-adjust.patch @@ -15,7 +15,7 @@ Signed-off-by: Nataliya Korovkina --- a/Makefile +++ b/Makefile -@@ -1281,7 +1281,7 @@ ifneq ($(dtstree),) +@@ -1285,7 +1285,7 @@ ifneq ($(dtstree),) %.dtb: include/config/kernel.release scripts_dtc $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@ diff --git a/target/linux/bcm27xx/patches-5.4/950-0532-dt-bindings-display-Convert-VC4-bindings-to-schemas.patch b/target/linux/bcm27xx/patches-5.4/950-0532-dt-bindings-display-Convert-VC4-bindings-to-schemas.patch index d9482649cc..26097dc66f 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0532-dt-bindings-display-Convert-VC4-bindings-to-schemas.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0532-dt-bindings-display-Convert-VC4-bindings-to-schemas.patch @@ -695,7 +695,7 @@ Signed-off-by: Maxime Ripard +... --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -5574,7 +5574,7 @@ T: git git://github.com/anholt/linux +@@ -5567,7 +5567,7 @@ T: git git://github.com/anholt/linux S: Supported F: drivers/gpu/drm/vc4/ F: include/uapi/drm/vc4_drm.h diff --git a/target/linux/bcm27xx/patches-5.4/950-0714-media-i2c-Add-driver-for-Sony-IMX477-sensor.patch b/target/linux/bcm27xx/patches-5.4/950-0714-media-i2c-Add-driver-for-Sony-IMX477-sensor.patch index e90c9656f2..fe18e8ef32 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0714-media-i2c-Add-driver-for-Sony-IMX477-sensor.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0714-media-i2c-Add-driver-for-Sony-IMX477-sensor.patch @@ -25,7 +25,7 @@ Signed-off-by: Naushir Patuck --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -15198,6 +15198,14 @@ T: git git://linuxtv.org/media_tree.git +@@ -15191,6 +15191,14 @@ T: git git://linuxtv.org/media_tree.git S: Maintained F: drivers/media/i2c/imx355.c diff --git a/target/linux/bcm27xx/patches-5.4/950-0722-dma-buf-Add-dma-buf-heaps-framework.patch b/target/linux/bcm27xx/patches-5.4/950-0722-dma-buf-Add-dma-buf-heaps-framework.patch index f60d402379..66ba435a69 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0722-dma-buf-Add-dma-buf-heaps-framework.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0722-dma-buf-Add-dma-buf-heaps-framework.patch @@ -54,7 +54,7 @@ Link: https://patchwork.freedesktop.org/patch/msgid/20191203172641.66642-2-john. --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -4963,6 +4963,24 @@ F: include/linux/*fence.h +@@ -4956,6 +4956,24 @@ F: include/linux/*fence.h F: Documentation/driver-api/dma-buf.rst T: git git://anongit.freedesktop.org/drm/drm-misc diff --git a/target/linux/bcm27xx/patches-5.4/950-0815-media-dt-bindings-media-i2c-Add-IMX290-CMOS-sensor-b.patch b/target/linux/bcm27xx/patches-5.4/950-0815-media-dt-bindings-media-i2c-Add-IMX290-CMOS-sensor-b.patch index 6852dbf275..92ddff187f 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0815-media-dt-bindings-media-i2c-Add-IMX290-CMOS-sensor-b.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0815-media-dt-bindings-media-i2c-Add-IMX290-CMOS-sensor-b.patch @@ -81,7 +81,7 @@ Signed-off-by: Mauro Carvalho Chehab + }; --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -15202,6 +15202,14 @@ S: Maintained +@@ -15195,6 +15195,14 @@ S: Maintained F: drivers/media/i2c/imx274.c F: Documentation/devicetree/bindings/media/i2c/imx274.txt diff --git a/target/linux/generic/backport-5.4/080-wireguard-0072-net-WireGuard-secure-network-tunnel.patch b/target/linux/generic/backport-5.4/080-wireguard-0072-net-WireGuard-secure-network-tunnel.patch index ec6d0e5092..753ce85007 100644 --- a/target/linux/generic/backport-5.4/080-wireguard-0072-net-WireGuard-secure-network-tunnel.patch +++ b/target/linux/generic/backport-5.4/080-wireguard-0072-net-WireGuard-secure-network-tunnel.patch @@ -192,7 +192,7 @@ Signed-off-by: Jason A. Donenfeld --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -17586,6 +17586,14 @@ L: linux-gpio@vger.kernel.org +@@ -17579,6 +17579,14 @@ L: linux-gpio@vger.kernel.org S: Maintained F: drivers/gpio/gpio-ws16c48.c diff --git a/target/linux/generic/backport-5.4/600-v5.12-net-extract-napi-poll-functionality-to-__napi_poll.patch b/target/linux/generic/backport-5.4/600-v5.12-net-extract-napi-poll-functionality-to-__napi_poll.patch index 4392ef6f05..ead5a3fcea 100644 --- a/target/linux/generic/backport-5.4/600-v5.12-net-extract-napi-poll-functionality-to-__napi_poll.patch +++ b/target/linux/generic/backport-5.4/600-v5.12-net-extract-napi-poll-functionality-to-__napi_poll.patch @@ -18,7 +18,7 @@ Signed-off-by: David S. Miller --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -6330,15 +6330,10 @@ void netif_napi_del(struct napi_struct * +@@ -6332,15 +6332,10 @@ void netif_napi_del(struct napi_struct * } EXPORT_SYMBOL(netif_napi_del); @@ -35,7 +35,7 @@ Signed-off-by: David S. Miller weight = n->weight; /* This NAPI_STATE_SCHED test is for avoiding a race -@@ -6356,7 +6351,7 @@ static int napi_poll(struct napi_struct +@@ -6358,7 +6353,7 @@ static int napi_poll(struct napi_struct WARN_ON_ONCE(work > weight); if (likely(work < weight)) @@ -44,7 +44,7 @@ Signed-off-by: David S. Miller /* Drivers must not modify the NAPI state if they * consume the entire weight. In such cases this code -@@ -6365,7 +6360,7 @@ static int napi_poll(struct napi_struct +@@ -6367,7 +6362,7 @@ static int napi_poll(struct napi_struct */ if (unlikely(napi_disable_pending(n))) { napi_complete(n); @@ -53,7 +53,7 @@ Signed-off-by: David S. Miller } if (n->gro_bitmask) { -@@ -6383,12 +6378,29 @@ static int napi_poll(struct napi_struct +@@ -6385,12 +6380,29 @@ static int napi_poll(struct napi_struct if (unlikely(!list_empty(&n->poll_list))) { pr_warn_once("%s: Budget exhausted after napi rescheduled\n", n->dev ? n->dev->name : "backlog"); diff --git a/target/linux/generic/backport-5.4/601-v5.12-net-implement-threaded-able-napi-poll-loop-support.patch b/target/linux/generic/backport-5.4/601-v5.12-net-implement-threaded-able-napi-poll-loop-support.patch index 2b3f783fa8..782101b75b 100644 --- a/target/linux/generic/backport-5.4/601-v5.12-net-implement-threaded-able-napi-poll-loop-support.patch +++ b/target/linux/generic/backport-5.4/601-v5.12-net-implement-threaded-able-napi-poll-loop-support.patch @@ -76,7 +76,7 @@ Signed-off-by: David S. Miller /** * napi_synchronize - wait until NAPI is not running -@@ -1792,6 +1782,8 @@ enum netdev_ml_priv_type { +@@ -1794,6 +1784,8 @@ enum netdev_ml_priv_type { * * @wol_enabled: Wake-on-LAN is enabled * @@ -85,7 +85,7 @@ Signed-off-by: David S. Miller * FIXME: cleanup struct net_device such that network protocol info * moves out. */ -@@ -2084,6 +2076,7 @@ struct net_device { +@@ -2083,6 +2075,7 @@ struct net_device { struct lock_class_key addr_list_lock_key; bool proto_down; unsigned wol_enabled:1; @@ -153,7 +153,7 @@ Signed-off-by: David S. Miller list_add_tail(&napi->poll_list, &sd->poll_list); __raise_softirq_irqoff(NET_RX_SOFTIRQ); } -@@ -6284,6 +6321,12 @@ void netif_napi_add(struct net_device *d +@@ -6286,6 +6323,12 @@ void netif_napi_add(struct net_device *d set_bit(NAPI_STATE_NPSVC, &napi->state); list_add_rcu(&napi->dev_list, &dev->napi_list); napi_hash_add(napi); @@ -166,7 +166,7 @@ Signed-off-by: David S. Miller } EXPORT_SYMBOL(netif_napi_add); -@@ -6300,9 +6343,28 @@ void napi_disable(struct napi_struct *n) +@@ -6302,9 +6345,28 @@ void napi_disable(struct napi_struct *n) hrtimer_cancel(&n->timer); clear_bit(NAPI_STATE_DISABLE, &n->state); @@ -195,7 +195,7 @@ Signed-off-by: David S. Miller static void flush_gro_hash(struct napi_struct *napi) { int i; -@@ -6327,6 +6389,11 @@ void netif_napi_del(struct napi_struct * +@@ -6329,6 +6391,11 @@ void netif_napi_del(struct napi_struct * flush_gro_hash(napi); napi->gro_bitmask = 0; @@ -207,7 +207,7 @@ Signed-off-by: David S. Miller } EXPORT_SYMBOL(netif_napi_del); -@@ -6406,6 +6473,51 @@ static int napi_poll(struct napi_struct +@@ -6408,6 +6475,51 @@ static int napi_poll(struct napi_struct return work; } diff --git a/target/linux/generic/backport-5.4/602-v5.12-net-add-sysfs-attribute-to-control-napi-threaded-mod.patch b/target/linux/generic/backport-5.4/602-v5.12-net-add-sysfs-attribute-to-control-napi-threaded-mod.patch index cf957d7674..9eb502724d 100644 --- a/target/linux/generic/backport-5.4/602-v5.12-net-add-sysfs-attribute-to-control-napi-threaded-mod.patch +++ b/target/linux/generic/backport-5.4/602-v5.12-net-add-sysfs-attribute-to-control-napi-threaded-mod.patch @@ -69,7 +69,7 @@ Signed-off-by: David S. Miller * wake_up_process() when it's not NULL. */ thread = READ_ONCE(napi->thread); -@@ -6298,6 +6299,49 @@ static void init_gro_hash(struct napi_st +@@ -6300,6 +6301,49 @@ static void init_gro_hash(struct napi_st napi->gro_bitmask = 0; } diff --git a/target/linux/generic/backport-5.4/603-v5.12-net-fix-race-between-napi-kthread-mode-and-busy-poll.patch b/target/linux/generic/backport-5.4/603-v5.12-net-fix-race-between-napi-kthread-mode-and-busy-poll.patch index 4b8f2352d2..53ec61ad48 100644 --- a/target/linux/generic/backport-5.4/603-v5.12-net-fix-race-between-napi-kthread-mode-and-busy-poll.patch +++ b/target/linux/generic/backport-5.4/603-v5.12-net-fix-race-between-napi-kthread-mode-and-busy-poll.patch @@ -54,7 +54,7 @@ Cc: Hannes Frederic Sowa wake_up_process(thread); return; } -@@ -6086,7 +6088,8 @@ bool napi_complete_done(struct napi_stru +@@ -6088,7 +6090,8 @@ bool napi_complete_done(struct napi_stru WARN_ON_ONCE(!(val & NAPIF_STATE_SCHED)); @@ -64,7 +64,7 @@ Cc: Hannes Frederic Sowa /* If STATE_MISSED was set, leave STATE_SCHED set, * because we will call napi->poll() one more time. -@@ -6519,16 +6522,25 @@ static int napi_poll(struct napi_struct +@@ -6521,16 +6524,25 @@ static int napi_poll(struct napi_struct static int napi_thread_wait(struct napi_struct *napi) { diff --git a/target/linux/generic/backport-5.4/604-v5.12-net-fix-hangup-on-napi_disable-for-threaded-napi.patch b/target/linux/generic/backport-5.4/604-v5.12-net-fix-hangup-on-napi_disable-for-threaded-napi.patch index 8dcec5fca5..40cf4672ad 100644 --- a/target/linux/generic/backport-5.4/604-v5.12-net-fix-hangup-on-napi_disable-for-threaded-napi.patch +++ b/target/linux/generic/backport-5.4/604-v5.12-net-fix-hangup-on-napi_disable-for-threaded-napi.patch @@ -34,7 +34,7 @@ Signed-off-by: Jakub Kicinski --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -6526,7 +6526,7 @@ static int napi_thread_wait(struct napi_ +@@ -6528,7 +6528,7 @@ static int napi_thread_wait(struct napi_ set_current_state(TASK_INTERRUPTIBLE); @@ -43,7 +43,7 @@ Signed-off-by: Jakub Kicinski /* Testing SCHED_THREADED bit here to make sure the current * kthread owns this napi and could poll on this napi. * Testing SCHED bit is not enough because SCHED bit might be -@@ -6544,6 +6544,7 @@ static int napi_thread_wait(struct napi_ +@@ -6546,6 +6546,7 @@ static int napi_thread_wait(struct napi_ set_current_state(TASK_INTERRUPTIBLE); } __set_current_state(TASK_RUNNING); diff --git a/target/linux/generic/backport-5.4/612-v5.15-netfilter-conntrack-sanitize-table-size-default-sett.patch b/target/linux/generic/backport-5.4/612-v5.15-netfilter-conntrack-sanitize-table-size-default-sett.patch index 1e7773c193..19d92f2d1d 100644 --- a/target/linux/generic/backport-5.4/612-v5.15-netfilter-conntrack-sanitize-table-size-default-sett.patch +++ b/target/linux/generic/backport-5.4/612-v5.15-netfilter-conntrack-sanitize-table-size-default-sett.patch @@ -58,7 +58,7 @@ Signed-off-by: Pablo Neira Ayuso 0 - disabled (default) --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c -@@ -2418,26 +2418,24 @@ int nf_conntrack_init_start(void) +@@ -2421,26 +2421,24 @@ int nf_conntrack_init_start(void) spin_lock_init(&nf_conntrack_locks[i]); if (!nf_conntrack_htable_size) { diff --git a/target/linux/generic/backport-5.4/700-v5.5-net-core-allow-fast-GRO-for-skbs-with-Ethernet-heade.patch b/target/linux/generic/backport-5.4/700-v5.5-net-core-allow-fast-GRO-for-skbs-with-Ethernet-heade.patch index 4ed63c0601..4b4a121f6c 100644 --- a/target/linux/generic/backport-5.4/700-v5.5-net-core-allow-fast-GRO-for-skbs-with-Ethernet-heade.patch +++ b/target/linux/generic/backport-5.4/700-v5.5-net-core-allow-fast-GRO-for-skbs-with-Ethernet-heade.patch @@ -66,7 +66,7 @@ Signed-off-by: David S. Miller --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -5480,8 +5480,7 @@ static inline void skb_gro_reset_offset( +@@ -5482,8 +5482,7 @@ static inline void skb_gro_reset_offset( NAPI_GRO_CB(skb)->frag0 = NULL; NAPI_GRO_CB(skb)->frag0_len = 0; diff --git a/target/linux/generic/hack-5.4/259-regmap_dynamic.patch b/target/linux/generic/hack-5.4/259-regmap_dynamic.patch index 812e182467..872c2ea01b 100644 --- a/target/linux/generic/hack-5.4/259-regmap_dynamic.patch +++ b/target/linux/generic/hack-5.4/259-regmap_dynamic.patch @@ -106,7 +106,7 @@ Signed-off-by: Felix Fietkau #include #include #include -@@ -3118,3 +3119,5 @@ static int __init regmap_initcall(void) +@@ -3120,3 +3121,5 @@ static int __init regmap_initcall(void) return 0; } postcore_initcall(regmap_initcall); diff --git a/target/linux/generic/hack-5.4/280-rfkill-stubs.patch b/target/linux/generic/hack-5.4/280-rfkill-stubs.patch index 2e48aea1cf..8715a1a5c6 100644 --- a/target/linux/generic/hack-5.4/280-rfkill-stubs.patch +++ b/target/linux/generic/hack-5.4/280-rfkill-stubs.patch @@ -26,7 +26,7 @@ Signed-off-by: John Crispin * @name: name of the struct -- the string is not copied internally --- a/net/Makefile +++ b/net/Makefile -@@ -53,7 +53,7 @@ obj-$(CONFIG_TIPC) += tipc/ +@@ -52,7 +52,7 @@ obj-$(CONFIG_TIPC) += tipc/ obj-$(CONFIG_NETLABEL) += netlabel/ obj-$(CONFIG_IUCV) += iucv/ obj-$(CONFIG_SMC) += smc/ diff --git a/target/linux/generic/hack-5.4/661-kernel-ct-size-the-hashtable-more-adequately.patch b/target/linux/generic/hack-5.4/661-kernel-ct-size-the-hashtable-more-adequately.patch index b1bb1bc2e5..7ee8d37d49 100644 --- a/target/linux/generic/hack-5.4/661-kernel-ct-size-the-hashtable-more-adequately.patch +++ b/target/linux/generic/hack-5.4/661-kernel-ct-size-the-hashtable-more-adequately.patch @@ -14,7 +14,7 @@ Signed-off-by: Rui Salvaterra --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c -@@ -2419,7 +2419,7 @@ int nf_conntrack_init_start(void) +@@ -2422,7 +2422,7 @@ int nf_conntrack_init_start(void) if (!nf_conntrack_htable_size) { nf_conntrack_htable_size diff --git a/target/linux/generic/hack-5.4/661-use_fq_codel_by_default.patch b/target/linux/generic/hack-5.4/661-use_fq_codel_by_default.patch index f52db97ff4..e0d8b3fbb0 100644 --- a/target/linux/generic/hack-5.4/661-use_fq_codel_by_default.patch +++ b/target/linux/generic/hack-5.4/661-use_fq_codel_by_default.patch @@ -44,7 +44,7 @@ Signed-off-by: Felix Fietkau device, it has to decide which ones to send first, which ones to --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c -@@ -2286,7 +2286,7 @@ static int __init pktsched_init(void) +@@ -2300,7 +2300,7 @@ static int __init pktsched_init(void) return err; } diff --git a/target/linux/generic/hack-5.4/721-phy_packets.patch b/target/linux/generic/hack-5.4/721-phy_packets.patch index b810c30c52..8f5965f2d1 100644 --- a/target/linux/generic/hack-5.4/721-phy_packets.patch +++ b/target/linux/generic/hack-5.4/721-phy_packets.patch @@ -15,7 +15,7 @@ Signed-off-by: Felix Fietkau --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h -@@ -1549,6 +1549,7 @@ enum netdev_priv_flags { +@@ -1552,6 +1552,7 @@ enum netdev_priv_flags { IFF_FAILOVER_SLAVE = 1<<28, IFF_L3MDEV_RX_HANDLER = 1<<29, IFF_LIVE_RENAME_OK = 1<<30, @@ -23,7 +23,7 @@ Signed-off-by: Felix Fietkau }; #define IFF_802_1Q_VLAN IFF_802_1Q_VLAN -@@ -1581,6 +1582,7 @@ enum netdev_priv_flags { +@@ -1584,6 +1585,7 @@ enum netdev_priv_flags { #define IFF_FAILOVER_SLAVE IFF_FAILOVER_SLAVE #define IFF_L3MDEV_RX_HANDLER IFF_L3MDEV_RX_HANDLER #define IFF_LIVE_RENAME_OK IFF_LIVE_RENAME_OK @@ -31,7 +31,7 @@ Signed-off-by: Felix Fietkau /* Specifies the type of the struct net_device::ml_priv pointer */ enum netdev_ml_priv_type { -@@ -1891,6 +1893,11 @@ struct net_device { +@@ -1893,6 +1895,11 @@ struct net_device { const struct tlsdev_ops *tlsdev_ops; #endif @@ -43,7 +43,7 @@ Signed-off-by: Felix Fietkau const struct header_ops *header_ops; unsigned int flags; -@@ -1973,6 +1980,10 @@ struct net_device { +@@ -1972,6 +1979,10 @@ struct net_device { struct mpls_dev __rcu *mpls_ptr; #endif diff --git a/target/linux/generic/hack-5.4/952-net-conntrack-events-support-multiple-registrant.patch b/target/linux/generic/hack-5.4/952-net-conntrack-events-support-multiple-registrant.patch index 2c332fa331..218f7840e8 100644 --- a/target/linux/generic/hack-5.4/952-net-conntrack-events-support-multiple-registrant.patch +++ b/target/linux/generic/hack-5.4/952-net-conntrack-events-support-multiple-registrant.patch @@ -115,7 +115,7 @@ Signed-off-by: Zhi Chen depends on NETFILTER_ADVANCED --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c -@@ -2570,6 +2570,9 @@ int nf_conntrack_init_net(struct net *ne +@@ -2573,6 +2573,9 @@ int nf_conntrack_init_net(struct net *ne nf_conntrack_helper_pernet_init(net); nf_conntrack_proto_pernet_init(net); @@ -295,7 +295,7 @@ Signed-off-by: Zhi Chen struct nf_conn *ct = item->ct; struct sk_buff *skb; unsigned int type; -@@ -3511,9 +3518,15 @@ static int ctnetlink_stat_exp_cpu(struct +@@ -3507,9 +3514,15 @@ static int ctnetlink_stat_exp_cpu(struct } #ifdef CONFIG_NF_CONNTRACK_EVENTS diff --git a/target/linux/generic/hack-5.4/953-net-patch-linux-kernel-to-support-shortcut-fe.patch b/target/linux/generic/hack-5.4/953-net-patch-linux-kernel-to-support-shortcut-fe.patch index bcf5c2cf39..bd86387fa2 100644 --- a/target/linux/generic/hack-5.4/953-net-patch-linux-kernel-to-support-shortcut-fe.patch +++ b/target/linux/generic/hack-5.4/953-net-patch-linux-kernel-to-support-shortcut-fe.patch @@ -99,7 +99,7 @@ #ifdef CONFIG_ETHERNET_PACKET_MANGLE if (!dev->eth_mangle_tx || (skb = dev->eth_mangle_tx(dev, skb)) != NULL) -@@ -4758,6 +4766,11 @@ void netdev_rx_handler_unregister(struct +@@ -4760,6 +4768,11 @@ void netdev_rx_handler_unregister(struct } EXPORT_SYMBOL_GPL(netdev_rx_handler_unregister); @@ -111,7 +111,7 @@ /* * Limit the use of PFMEMALLOC reserves to those protocols that implement * the special handling of PFMEMALLOC skbs. -@@ -4808,6 +4821,10 @@ static int __netif_receive_skb_core(stru +@@ -4810,6 +4823,10 @@ static int __netif_receive_skb_core(stru int ret = NET_RX_DROP; __be16 type; @@ -122,7 +122,7 @@ net_timestamp_check(!READ_ONCE(netdev_tstamp_prequeue), skb); trace_netif_receive_skb(skb); -@@ -4847,6 +4864,16 @@ another_round: +@@ -4849,6 +4866,16 @@ another_round: goto out; } @@ -141,7 +141,7 @@ --- a/net/Kconfig +++ b/net/Kconfig -@@ -473,3 +473,6 @@ config HAVE_CBPF_JIT +@@ -471,3 +471,6 @@ config HAVE_CBPF_JIT # Extended BPF JIT (eBPF) config HAVE_EBPF_JIT bool diff --git a/target/linux/generic/hack-5.4/993-usb-serial-option-add-u9300.patch b/target/linux/generic/hack-5.4/993-usb-serial-option-add-u9300.patch index dbe1e1cf55..bd1e3e4e48 100644 --- a/target/linux/generic/hack-5.4/993-usb-serial-option-add-u9300.patch +++ b/target/linux/generic/hack-5.4/993-usb-serial-option-add-u9300.patch @@ -1,6 +1,6 @@ --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c -@@ -1367,6 +1367,7 @@ static const struct usb_device_id produc +@@ -1369,6 +1369,7 @@ static const struct usb_device_id produc {QMI_FIXED_INTF(0x03f0, 0x9d1d, 1)}, /* HP lt4120 Snapdragon X5 LTE */ {QMI_FIXED_INTF(0x22de, 0x9061, 3)}, /* WeTelecom WPD-600N */ {QMI_QUIRK_SET_DTR(0x1e0e, 0x9001, 5)}, /* SIMCom 7100E, 7230E, 7600E ++ */ @@ -10,7 +10,7 @@ {QMI_QUIRK_SET_DTR(0x2c7c, 0x0195, 4)}, /* Quectel EG95 */ --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c -@@ -400,6 +400,7 @@ static void option_instat_callback(struc +@@ -404,6 +404,7 @@ static void option_instat_callback(struc * Mobidata, etc sell under their own brand names. */ #define LONGCHEER_VENDOR_ID 0x1c9e @@ -18,7 +18,7 @@ /* 4G Systems products */ /* This one was sold as the VW and Skoda "Carstick LTE" */ -@@ -617,6 +618,16 @@ static void option_instat_callback(struc +@@ -621,6 +622,16 @@ static void option_instat_callback(struc /* Device needs ZLP */ #define ZLP BIT(17) @@ -35,7 +35,7 @@ static const struct usb_device_id option_ids[] = { { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, -@@ -651,6 +662,8 @@ static const struct usb_device_id option +@@ -655,6 +666,8 @@ static const struct usb_device_id option { USB_DEVICE(QUANTA_VENDOR_ID, QUANTA_PRODUCT_GLE) }, { USB_DEVICE(QUANTA_VENDOR_ID, 0xea42), .driver_info = RSVD(4) }, diff --git a/target/linux/generic/pending-5.4/630-packet_socket_type.patch b/target/linux/generic/pending-5.4/630-packet_socket_type.patch index 6528e705ad..a45d505962 100644 --- a/target/linux/generic/pending-5.4/630-packet_socket_type.patch +++ b/target/linux/generic/pending-5.4/630-packet_socket_type.patch @@ -87,7 +87,7 @@ Signed-off-by: Felix Fietkau if (!net_eq(dev_net(dev), sock_net(sk))) goto drop; -@@ -3311,6 +3313,7 @@ static int packet_create(struct net *net +@@ -3313,6 +3315,7 @@ static int packet_create(struct net *net mutex_init(&po->pg_vec_lock); po->rollover = NULL; po->prot_hook.func = packet_rcv; @@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau if (sock->type == SOCK_PACKET) po->prot_hook.func = packet_rcv_spkt; -@@ -3950,6 +3953,16 @@ packet_setsockopt(struct socket *sock, i +@@ -3952,6 +3955,16 @@ packet_setsockopt(struct socket *sock, i WRITE_ONCE(po->xmit, val ? packet_direct_xmit : dev_queue_xmit); return 0; } @@ -112,7 +112,7 @@ Signed-off-by: Felix Fietkau default: return -ENOPROTOOPT; } -@@ -4006,6 +4019,13 @@ static int packet_getsockopt(struct sock +@@ -4008,6 +4021,13 @@ static int packet_getsockopt(struct sock case PACKET_VNET_HDR: val = po->has_vnet_hdr; break; diff --git a/target/linux/generic/pending-5.4/640-netfilter-nf_flow_table-add-hardware-offload-support.patch b/target/linux/generic/pending-5.4/640-netfilter-nf_flow_table-add-hardware-offload-support.patch index 85030c2f09..e29c0f941e 100644 --- a/target/linux/generic/pending-5.4/640-netfilter-nf_flow_table-add-hardware-offload-support.patch +++ b/target/linux/generic/pending-5.4/640-netfilter-nf_flow_table-add-hardware-offload-support.patch @@ -23,7 +23,7 @@ Signed-off-by: Pablo Neira Ayuso --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h -@@ -931,6 +931,13 @@ struct devlink; +@@ -934,6 +934,13 @@ struct devlink; struct tlsdev_ops; @@ -37,7 +37,7 @@ Signed-off-by: Pablo Neira Ayuso /* * This structure defines the management hooks for network devices. * The following hooks can be defined; unless noted otherwise, they are -@@ -1163,6 +1170,10 @@ struct tlsdev_ops; +@@ -1166,6 +1173,10 @@ struct tlsdev_ops; * int (*ndo_bridge_dellink)(struct net_device *dev, struct nlmsghdr *nlh, * u16 flags); * @@ -48,7 +48,7 @@ Signed-off-by: Pablo Neira Ayuso * int (*ndo_change_carrier)(struct net_device *dev, bool new_carrier); * Called to change device carrier. Soft-devices (like dummy, team, etc) * which do not represent real hardware may define this to allow their -@@ -1410,6 +1421,8 @@ struct net_device_ops { +@@ -1413,6 +1424,8 @@ struct net_device_ops { int (*ndo_bridge_dellink)(struct net_device *dev, struct nlmsghdr *nlh, u16 flags); diff --git a/target/linux/generic/pending-5.4/641-netfilter-nf_flow_table-support-hw-offload-through-v.patch b/target/linux/generic/pending-5.4/641-netfilter-nf_flow_table-support-hw-offload-through-v.patch index d766ca9140..900f272e57 100644 --- a/target/linux/generic/pending-5.4/641-netfilter-nf_flow_table-support-hw-offload-through-v.patch +++ b/target/linux/generic/pending-5.4/641-netfilter-nf_flow_table-support-hw-offload-through-v.patch @@ -15,7 +15,7 @@ Signed-off-by: Felix Fietkau --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h -@@ -932,6 +932,7 @@ struct tlsdev_ops; +@@ -935,6 +935,7 @@ struct tlsdev_ops; struct flow_offload; @@ -23,7 +23,7 @@ Signed-off-by: Felix Fietkau enum flow_offload_type { FLOW_OFFLOAD_ADD = 0, -@@ -1170,8 +1171,15 @@ enum flow_offload_type { +@@ -1173,8 +1174,15 @@ enum flow_offload_type { * int (*ndo_bridge_dellink)(struct net_device *dev, struct nlmsghdr *nlh, * u16 flags); * @@ -40,7 +40,7 @@ Signed-off-by: Felix Fietkau * Adds/deletes flow entry to/from net device flowtable. * * int (*ndo_change_carrier)(struct net_device *dev, bool new_carrier); -@@ -1421,8 +1429,11 @@ struct net_device_ops { +@@ -1424,8 +1432,11 @@ struct net_device_ops { int (*ndo_bridge_dellink)(struct net_device *dev, struct nlmsghdr *nlh, u16 flags); diff --git a/target/linux/generic/pending-5.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/pending-5.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch index 1cc6887797..f66415f08b 100644 --- a/target/linux/generic/pending-5.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch +++ b/target/linux/generic/pending-5.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch @@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h -@@ -1936,6 +1936,8 @@ struct net_device { +@@ -1938,6 +1938,8 @@ struct net_device { struct netdev_hw_addr_list mc; struct netdev_hw_addr_list dev_addrs; @@ -32,7 +32,7 @@ Signed-off-by: Felix Fietkau __u16 tc_index; /* traffic control index */ --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -5546,6 +5546,9 @@ static enum gro_result dev_gro_receive(s +@@ -5548,6 +5548,9 @@ static enum gro_result dev_gro_receive(s int same_flow; int grow; @@ -42,7 +42,7 @@ Signed-off-by: Felix Fietkau if (netif_elide_gro(skb->dev)) goto normal; -@@ -7489,6 +7492,48 @@ static void __netdev_adjacent_dev_unlink +@@ -7491,6 +7494,48 @@ static void __netdev_adjacent_dev_unlink &upper_dev->adj_list.lower); } @@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau static int __netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev, bool master, void *upper_priv, void *upper_info, -@@ -7539,6 +7584,7 @@ static int __netdev_upper_dev_link(struc +@@ -7541,6 +7586,7 @@ static int __netdev_upper_dev_link(struc if (ret) return ret; @@ -99,7 +99,7 @@ Signed-off-by: Felix Fietkau ret = call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, &changeupper_info.info); ret = notifier_to_errno(ret); -@@ -7632,6 +7678,7 @@ void netdev_upper_dev_unlink(struct net_ +@@ -7634,6 +7680,7 @@ void netdev_upper_dev_unlink(struct net_ __netdev_adjacent_dev_unlink_neighbour(dev, upper_dev); @@ -107,7 +107,7 @@ Signed-off-by: Felix Fietkau call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, &changeupper_info.info); -@@ -8362,6 +8409,7 @@ int dev_set_mac_address(struct net_devic +@@ -8364,6 +8411,7 @@ int dev_set_mac_address(struct net_devic if (err) return err; dev->addr_assign_type = NET_ADDR_SET; diff --git a/target/linux/generic/pending-5.4/820-libata-Assign-OF-node-to-the-SCSI-device.patch b/target/linux/generic/pending-5.4/820-libata-Assign-OF-node-to-the-SCSI-device.patch index c4cbaaa777..b1cf332763 100644 --- a/target/linux/generic/pending-5.4/820-libata-Assign-OF-node-to-the-SCSI-device.patch +++ b/target/linux/generic/pending-5.4/820-libata-Assign-OF-node-to-the-SCSI-device.patch @@ -41,7 +41,7 @@ ChangeLog v1->v2: #include "libata.h" #include "libata-transport.h" -@@ -4590,6 +4591,34 @@ int ata_scsi_add_hosts(struct ata_host * +@@ -4608,6 +4609,34 @@ int ata_scsi_add_hosts(struct ata_host * return rc; } @@ -76,7 +76,7 @@ ChangeLog v1->v2: void ata_scsi_scan_host(struct ata_port *ap, int sync) { int tries = 5; -@@ -4615,6 +4644,7 @@ void ata_scsi_scan_host(struct ata_port +@@ -4633,6 +4662,7 @@ void ata_scsi_scan_host(struct ata_port NULL); if (!IS_ERR(sdev)) { dev->sdev = sdev; diff --git a/target/linux/ipq40xx/patches-5.4/703-net-IPQ4019-needs-rfs-vlan_tag-callbacks-in.patch b/target/linux/ipq40xx/patches-5.4/703-net-IPQ4019-needs-rfs-vlan_tag-callbacks-in.patch index 167673bd11..a774f0e1ea 100644 --- a/target/linux/ipq40xx/patches-5.4/703-net-IPQ4019-needs-rfs-vlan_tag-callbacks-in.patch +++ b/target/linux/ipq40xx/patches-5.4/703-net-IPQ4019-needs-rfs-vlan_tag-callbacks-in.patch @@ -24,7 +24,7 @@ Reviewed-by: Grant Grundler --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h -@@ -776,6 +776,16 @@ struct xps_map { +@@ -779,6 +779,16 @@ struct xps_map { #define XPS_MIN_MAP_ALLOC ((L1_CACHE_ALIGN(offsetof(struct xps_map, queues[1])) \ - sizeof(struct xps_map)) / sizeof(u16)) @@ -41,7 +41,7 @@ Reviewed-by: Grant Grundler /* * This structure holds all XPS maps for device. Maps are indexed by CPU. */ -@@ -1379,6 +1389,9 @@ struct net_device_ops { +@@ -1382,6 +1392,9 @@ struct net_device_ops { const struct sk_buff *skb, u16 rxq_index, u32 flow_id); diff --git a/target/linux/layerscape/patches-5.4/701-net-0130-bus-fsl-mc-move-fsl_mc_command-struct-in-a-uapi-head.patch b/target/linux/layerscape/patches-5.4/701-net-0130-bus-fsl-mc-move-fsl_mc_command-struct-in-a-uapi-head.patch index 335ec7108c..3db8a74a3b 100644 --- a/target/linux/layerscape/patches-5.4/701-net-0130-bus-fsl-mc-move-fsl_mc_command-struct-in-a-uapi-head.patch +++ b/target/linux/layerscape/patches-5.4/701-net-0130-bus-fsl-mc-move-fsl_mc_command-struct-in-a-uapi-head.patch @@ -16,7 +16,7 @@ Signed-off-by: Ioana Ciornei --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -13437,6 +13437,8 @@ S: Maintained +@@ -13430,6 +13430,8 @@ S: Maintained F: drivers/bus/fsl-mc/ F: Documentation/devicetree/bindings/misc/fsl,qoriq-mc.txt F: Documentation/networking/device_drivers/freescale/dpaa2/overview.rst diff --git a/target/linux/layerscape/patches-5.4/701-net-0132-bus-fsl-mc-add-root-dprc-rescan-attribute.patch b/target/linux/layerscape/patches-5.4/701-net-0132-bus-fsl-mc-add-root-dprc-rescan-attribute.patch index 9062346821..af3ae792ea 100644 --- a/target/linux/layerscape/patches-5.4/701-net-0132-bus-fsl-mc-add-root-dprc-rescan-attribute.patch +++ b/target/linux/layerscape/patches-5.4/701-net-0132-bus-fsl-mc-add-root-dprc-rescan-attribute.patch @@ -31,7 +31,7 @@ Signed-off-by: Ioana Ciornei +Users: Userspace drivers and management tools --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -13439,6 +13439,7 @@ F: Documentation/devicetree/bindings/mis +@@ -13432,6 +13432,7 @@ F: Documentation/devicetree/bindings/mis F: Documentation/networking/device_drivers/freescale/dpaa2/overview.rst F: Documentation/networking/dpaa2/overview.rst F: include/uapi/linux/fsl_mc.h diff --git a/target/linux/layerscape/patches-5.4/701-net-0261-net-mscc-ocelot-publish-ocelot_sys.h-to-include-soc-.patch b/target/linux/layerscape/patches-5.4/701-net-0261-net-mscc-ocelot-publish-ocelot_sys.h-to-include-soc-.patch index 98556523e3..353c4f8cd1 100644 --- a/target/linux/layerscape/patches-5.4/701-net-0261-net-mscc-ocelot-publish-ocelot_sys.h-to-include-soc-.patch +++ b/target/linux/layerscape/patches-5.4/701-net-0261-net-mscc-ocelot-publish-ocelot_sys.h-to-include-soc-.patch @@ -24,7 +24,7 @@ Signed-off-by: David S. Miller --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -10825,6 +10825,7 @@ M: Microchip Linux Driver Support --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -17357,6 +17357,13 @@ S: Maintained +@@ -17350,6 +17350,13 @@ S: Maintained F: drivers/input/serio/userio.c F: include/uapi/linux/userio.h diff --git a/target/linux/layerscape/patches-5.4/701-net-0263-net-dsa-ocelot-add-driver-for-Felix-switch-family.patch b/target/linux/layerscape/patches-5.4/701-net-0263-net-dsa-ocelot-add-driver-for-Felix-switch-family.patch index b0831675a7..04d0a092de 100644 --- a/target/linux/layerscape/patches-5.4/701-net-0263-net-dsa-ocelot-add-driver-for-Felix-switch-family.patch +++ b/target/linux/layerscape/patches-5.4/701-net-0263-net-dsa-ocelot-add-driver-for-Felix-switch-family.patch @@ -57,7 +57,7 @@ Signed-off-by: David S. Miller --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -17362,6 +17362,7 @@ M: Vladimir Oltean L: netdev@vger.kernel.org S: Maintained diff --git a/target/linux/layerscape/patches-5.4/701-net-0323-staging-fsl_ppfe-eth-add-pfe-support-to-Kconfig-and-.patch b/target/linux/layerscape/patches-5.4/701-net-0323-staging-fsl_ppfe-eth-add-pfe-support-to-Kconfig-and-.patch index 7d071397f0..c266fd7ec4 100644 --- a/target/linux/layerscape/patches-5.4/701-net-0323-staging-fsl_ppfe-eth-add-pfe-support-to-Kconfig-and-.patch +++ b/target/linux/layerscape/patches-5.4/701-net-0323-staging-fsl_ppfe-eth-add-pfe-support-to-Kconfig-and-.patch @@ -15,7 +15,7 @@ Signed-off-by: Dong Aisheng --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -6575,6 +6575,14 @@ F: drivers/ptp/ptp_qoriq_debugfs.c +@@ -6568,6 +6568,14 @@ F: drivers/ptp/ptp_qoriq_debugfs.c F: include/linux/fsl/ptp_qoriq.h F: Documentation/devicetree/bindings/ptp/ptp-qoriq.txt diff --git a/target/linux/layerscape/patches-5.4/701-net-0334-net-tsn-netlink-interface-for-APP-layer-to-config-TS.patch b/target/linux/layerscape/patches-5.4/701-net-0334-net-tsn-netlink-interface-for-APP-layer-to-config-TS.patch index 33de677930..1cdd45e186 100644 --- a/target/linux/layerscape/patches-5.4/701-net-0334-net-tsn-netlink-interface-for-APP-layer-to-config-TS.patch +++ b/target/linux/layerscape/patches-5.4/701-net-0334-net-tsn-netlink-interface-for-APP-layer-to-config-TS.patch @@ -1370,7 +1370,7 @@ Signed-off-by: Po Liu +#endif /* _UAPI_GENL_TSN_H */ --- a/net/Kconfig +++ b/net/Kconfig -@@ -240,6 +240,7 @@ source "net/ieee802154/Kconfig" +@@ -238,6 +238,7 @@ source "net/ieee802154/Kconfig" source "net/mac802154/Kconfig" source "net/sched/Kconfig" source "net/dcb/Kconfig" @@ -1380,7 +1380,7 @@ Signed-off-by: Po Liu source "net/openvswitch/Kconfig" --- a/net/Makefile +++ b/net/Makefile -@@ -59,6 +59,9 @@ obj-$(CONFIG_CAIF) += caif/ +@@ -58,6 +58,9 @@ obj-$(CONFIG_CAIF) += caif/ ifneq ($(CONFIG_DCB),) obj-y += dcb/ endif diff --git a/target/linux/layerscape/patches-5.4/809-jailhouse-0020-jailhouse-Add-simple-debug-console-via-the-hyperviso.patch b/target/linux/layerscape/patches-5.4/809-jailhouse-0020-jailhouse-Add-simple-debug-console-via-the-hyperviso.patch index 72f3048d8f..d9db5af68d 100644 --- a/target/linux/layerscape/patches-5.4/809-jailhouse-0020-jailhouse-Add-simple-debug-console-via-the-hyperviso.patch +++ b/target/linux/layerscape/patches-5.4/809-jailhouse-0020-jailhouse-Add-simple-debug-console-via-the-hyperviso.patch @@ -21,7 +21,7 @@ From http://git.kiszka.org/?p=linux.git;a=shortlog;h=refs/heads/queues/jailhouse --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -8773,6 +8773,7 @@ L: jailhouse-dev@googlegroups.com +@@ -8766,6 +8766,7 @@ L: jailhouse-dev@googlegroups.com S: Maintained F: arch/x86/kernel/jailhouse.c F: arch/x86/include/asm/jailhouse_para.h diff --git a/target/linux/layerscape/patches-5.4/810-keys-0001-security-keys-secure_key-Adds-the-secure-key-support.patch b/target/linux/layerscape/patches-5.4/810-keys-0001-security-keys-secure_key-Adds-the-secure-key-support.patch index 65b996d879..89b0cd3cc0 100644 --- a/target/linux/layerscape/patches-5.4/810-keys-0001-security-keys-secure_key-Adds-the-secure-key-support.patch +++ b/target/linux/layerscape/patches-5.4/810-keys-0001-security-keys-secure_key-Adds-the-secure-key-support.patch @@ -100,7 +100,7 @@ Reviewed-by: Sahil Malhotra + $ keyctl load secure kmk-master "load 'cat secure_key.blob'" @u --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -9074,6 +9074,17 @@ F: include/keys/trusted-type.h +@@ -9067,6 +9067,17 @@ F: include/keys/trusted-type.h F: security/keys/trusted.c F: include/keys/trusted.h diff --git a/target/linux/layerscape/patches-5.4/810-keys-0002-encrypted_keys-Adds-support-for-secure-key-type-as-m.patch b/target/linux/layerscape/patches-5.4/810-keys-0002-encrypted_keys-Adds-support-for-secure-key-type-as-m.patch index ed2eaa8a61..392e884268 100644 --- a/target/linux/layerscape/patches-5.4/810-keys-0002-encrypted_keys-Adds-support-for-secure-key-type-as-m.patch +++ b/target/linux/layerscape/patches-5.4/810-keys-0002-encrypted_keys-Adds-support-for-secure-key-type-as-m.patch @@ -23,7 +23,7 @@ Reviewed-by: Sahil Malhotra --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -9084,6 +9084,7 @@ F: include/keys/secure-type.h +@@ -9077,6 +9077,7 @@ F: include/keys/secure-type.h F: security/keys/secure_key.c F: security/keys/securekey_desc.c F: security/keys/securekey_desc.h diff --git a/target/linux/layerscape/patches-5.4/812-pcie-0009-PCI-mobiveil-Refactor-Mobiveil-PCIe-Host-Bridge-IP-d.patch b/target/linux/layerscape/patches-5.4/812-pcie-0009-PCI-mobiveil-Refactor-Mobiveil-PCIe-Host-Bridge-IP-d.patch index acbf2fe35a..81b1634036 100644 --- a/target/linux/layerscape/patches-5.4/812-pcie-0009-PCI-mobiveil-Refactor-Mobiveil-PCIe-Host-Bridge-IP-d.patch +++ b/target/linux/layerscape/patches-5.4/812-pcie-0009-PCI-mobiveil-Refactor-Mobiveil-PCIe-Host-Bridge-IP-d.patch @@ -34,7 +34,7 @@ Reviewed-by: Subrahmanya Lingappa --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -12503,7 +12503,7 @@ M: Hou Zhiqiang +@@ -12496,7 +12496,7 @@ M: Hou Zhiqiang L: linux-pci@vger.kernel.org S: Supported F: Documentation/devicetree/bindings/pci/mobiveil-pcie.txt diff --git a/target/linux/layerscape/patches-5.4/812-pcie-0016-PCI-mobiveil-Add-the-EP-driver-support.patch b/target/linux/layerscape/patches-5.4/812-pcie-0016-PCI-mobiveil-Add-the-EP-driver-support.patch index 5182eed992..f80c9786b5 100644 --- a/target/linux/layerscape/patches-5.4/812-pcie-0016-PCI-mobiveil-Add-the-EP-driver-support.patch +++ b/target/linux/layerscape/patches-5.4/812-pcie-0016-PCI-mobiveil-Add-the-EP-driver-support.patch @@ -20,7 +20,7 @@ Signed-off-by: Hou Zhiqiang --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -12500,6 +12500,7 @@ F: drivers/ntb/hw/mscc/ +@@ -12493,6 +12493,7 @@ F: drivers/ntb/hw/mscc/ PCI DRIVER FOR MOBIVEIL PCIE IP M: Karthikeyan Mitran M: Hou Zhiqiang diff --git a/target/linux/layerscape/patches-5.4/814-qe-0006-config-qe-add-irq-qeic-support.patch b/target/linux/layerscape/patches-5.4/814-qe-0006-config-qe-add-irq-qeic-support.patch index babf74329b..7cf961f8d0 100644 --- a/target/linux/layerscape/patches-5.4/814-qe-0006-config-qe-add-irq-qeic-support.patch +++ b/target/linux/layerscape/patches-5.4/814-qe-0006-config-qe-add-irq-qeic-support.patch @@ -12,7 +12,7 @@ Signed-off-by: Zhao Qiang --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -6597,6 +6597,12 @@ F: drivers/soc/fsl/qe/ +@@ -6590,6 +6590,12 @@ F: drivers/soc/fsl/qe/ F: include/soc/fsl/*qe*.h F: include/soc/fsl/*ucc*.h diff --git a/target/linux/layerscape/patches-5.4/819-uart-0001-tty-serial-lpuart-add-power-domain-support.patch b/target/linux/layerscape/patches-5.4/819-uart-0001-tty-serial-lpuart-add-power-domain-support.patch index ab1ae4c394..b6eb920aa8 100644 --- a/target/linux/layerscape/patches-5.4/819-uart-0001-tty-serial-lpuart-add-power-domain-support.patch +++ b/target/linux/layerscape/patches-5.4/819-uart-0001-tty-serial-lpuart-add-power-domain-support.patch @@ -27,7 +27,7 @@ Signed-off-by: Fugang Duan #include #include #include -@@ -2426,6 +2428,54 @@ static struct uart_driver lpuart_reg = { +@@ -2428,6 +2430,54 @@ static struct uart_driver lpuart_reg = { .cons = LPUART_CONSOLE, }; @@ -82,7 +82,7 @@ Signed-off-by: Fugang Duan static int lpuart_probe(struct platform_device *pdev) { const struct of_device_id *of_id = of_match_device(lpuart_dt_ids, -@@ -2463,6 +2513,10 @@ static int lpuart_probe(struct platform_ +@@ -2465,6 +2515,10 @@ static int lpuart_probe(struct platform_ sport->port.rs485_config = lpuart_config_rs485; diff --git a/target/linux/layerscape/patches-5.4/819-uart-0002-tty-serial-fsl_lpuart-add-modem-device-reset.patch b/target/linux/layerscape/patches-5.4/819-uart-0002-tty-serial-fsl_lpuart-add-modem-device-reset.patch index 0703fcb606..f9a9b8c4d8 100644 --- a/target/linux/layerscape/patches-5.4/819-uart-0002-tty-serial-fsl_lpuart-add-modem-device-reset.patch +++ b/target/linux/layerscape/patches-5.4/819-uart-0002-tty-serial-fsl_lpuart-add-modem-device-reset.patch @@ -20,7 +20,7 @@ Signed-off-by: Fugang Duan #include #include #include -@@ -1578,8 +1579,17 @@ static void lpuart32_configure(struct lp +@@ -1580,8 +1581,17 @@ static void lpuart32_configure(struct lp static int lpuart32_startup(struct uart_port *port) { struct lpuart_port *sport = container_of(port, struct lpuart_port, port); diff --git a/target/linux/layerscape/patches-5.4/819-uart-0005-tty-serial-fsl_lpuart-enable-dma-mode-for-imx8qxp.patch b/target/linux/layerscape/patches-5.4/819-uart-0005-tty-serial-fsl_lpuart-enable-dma-mode-for-imx8qxp.patch index 9291439d2c..8d0bb53fc6 100644 --- a/target/linux/layerscape/patches-5.4/819-uart-0005-tty-serial-fsl_lpuart-enable-dma-mode-for-imx8qxp.patch +++ b/target/linux/layerscape/patches-5.4/819-uart-0005-tty-serial-fsl_lpuart-enable-dma-mode-for-imx8qxp.patch @@ -351,7 +351,7 @@ Signed-off-by: Fugang Duan } static void lpuart_dma_rx_free(struct uart_port *port) -@@ -1439,8 +1551,10 @@ static void lpuart_setup_watermark(struc +@@ -1441,8 +1553,10 @@ static void lpuart_setup_watermark(struc writeb(UARTSFIFO_RXUF, sport->port.membase + UARTSFIFO); } @@ -363,7 +363,7 @@ Signed-off-by: Fugang Duan /* Restore cr2 */ writeb(cr2_saved, sport->port.membase + UARTCR2); -@@ -1461,6 +1575,7 @@ static void lpuart32_setup_watermark(str +@@ -1463,6 +1577,7 @@ static void lpuart32_setup_watermark(str { unsigned long val, ctrl; unsigned long ctrl_saved; @@ -371,7 +371,7 @@ Signed-off-by: Fugang Duan ctrl = lpuart32_read(&sport->port, UARTCTRL); ctrl_saved = ctrl; -@@ -1472,12 +1587,26 @@ static void lpuart32_setup_watermark(str +@@ -1474,12 +1589,26 @@ static void lpuart32_setup_watermark(str val = lpuart32_read(&sport->port, UARTFIFO); val |= UARTFIFO_TXFE | UARTFIFO_RXFE; val |= UARTFIFO_TXFLUSH | UARTFIFO_RXFLUSH; @@ -399,7 +399,7 @@ Signed-off-by: Fugang Duan /* Restore cr2 */ lpuart32_write(&sport->port, ctrl_saved, UARTCTRL); } -@@ -1489,17 +1618,29 @@ static void lpuart32_setup_watermark_ena +@@ -1491,17 +1620,29 @@ static void lpuart32_setup_watermark_ena lpuart32_setup_watermark(sport); temp = lpuart32_read(&sport->port, UARTCTRL); @@ -430,7 +430,7 @@ Signed-off-by: Fugang Duan static void lpuart_tx_dma_startup(struct lpuart_port *sport) { u32 uartbaud; -@@ -1563,19 +1704,23 @@ static int lpuart_startup(struct uart_po +@@ -1565,19 +1706,23 @@ static int lpuart_startup(struct uart_po return 0; } @@ -461,7 +461,7 @@ Signed-off-by: Fugang Duan if (!sport->lpuart_dma_tx_use) temp |= UARTCTRL_TIE; lpuart32_write(&sport->port, temp, UARTCTRL); -@@ -1619,12 +1764,12 @@ static int lpuart32_startup(struct uart_ +@@ -1621,12 +1766,12 @@ static int lpuart32_startup(struct uart_ spin_lock_irqsave(&sport->port.lock, flags); @@ -476,7 +476,7 @@ Signed-off-by: Fugang Duan lpuart32_configure(sport); spin_unlock_irqrestore(&sport->port.lock, flags); -@@ -1634,7 +1779,7 @@ static int lpuart32_startup(struct uart_ +@@ -1636,7 +1781,7 @@ static int lpuart32_startup(struct uart_ static void lpuart_dma_shutdown(struct lpuart_port *sport) { if (sport->lpuart_dma_rx_use) { @@ -485,7 +485,7 @@ Signed-off-by: Fugang Duan lpuart_dma_rx_free(&sport->port); sport->lpuart_dma_rx_use = false; } -@@ -1677,11 +1822,22 @@ static void lpuart32_shutdown(struct uar +@@ -1679,11 +1824,22 @@ static void lpuart32_shutdown(struct uar spin_lock_irqsave(&port->lock, flags); @@ -510,7 +510,7 @@ Signed-off-by: Fugang Duan spin_unlock_irqrestore(&port->lock, flags); -@@ -1778,10 +1934,10 @@ lpuart_set_termios(struct uart_port *por +@@ -1780,10 +1936,10 @@ lpuart_set_termios(struct uart_port *por * baud rate and restart Rx DMA path. * * Since timer function acqures sport->port.lock, need to stop before @@ -523,7 +523,7 @@ Signed-off-by: Fugang Duan lpuart_dma_rx_free(&sport->port); } -@@ -1993,10 +2149,10 @@ lpuart32_set_termios(struct uart_port *p +@@ -1995,10 +2151,10 @@ lpuart32_set_termios(struct uart_port *p * baud rate and restart Rx DMA path. * * Since timer function acqures sport->port.lock, need to stop before @@ -536,7 +536,7 @@ Signed-off-by: Fugang Duan lpuart_dma_rx_free(&sport->port); } -@@ -2515,6 +2671,10 @@ static int lpuart_probe(struct platform_ +@@ -2517,6 +2673,10 @@ static int lpuart_probe(struct platform_ sport->port.dev = &pdev->dev; sport->port.type = PORT_LPUART; sport->devtype = sdata->devtype; @@ -547,7 +547,7 @@ Signed-off-by: Fugang Duan ret = platform_get_irq(pdev, 0); if (ret < 0) return ret; -@@ -2665,7 +2825,7 @@ static int lpuart_suspend(struct device +@@ -2667,7 +2827,7 @@ static int lpuart_suspend(struct device * Rx DMA path before suspend and start Rx DMA path on resume. */ if (irq_wake) { diff --git a/target/linux/layerscape/patches-5.4/819-uart-0008-MLK-21445-serial-fsl_lpuart-do-HW-reset-for-communic.patch b/target/linux/layerscape/patches-5.4/819-uart-0008-MLK-21445-serial-fsl_lpuart-do-HW-reset-for-communic.patch index d25fde1d9c..507a1cf697 100644 --- a/target/linux/layerscape/patches-5.4/819-uart-0008-MLK-21445-serial-fsl_lpuart-do-HW-reset-for-communic.patch +++ b/target/linux/layerscape/patches-5.4/819-uart-0008-MLK-21445-serial-fsl_lpuart-do-HW-reset-for-communic.patch @@ -105,7 +105,7 @@ Signed-off-by: Shrikant Bobade static void lpuart_stop_tx(struct uart_port *port) { unsigned char temp; -@@ -2758,6 +2800,10 @@ static int lpuart_probe(struct platform_ +@@ -2760,6 +2802,10 @@ static int lpuart_probe(struct platform_ if (ret) goto failed_attach_port; @@ -116,7 +116,7 @@ Signed-off-by: Shrikant Bobade uart_get_rs485_mode(&pdev->dev, &sport->port.rs485); if (sport->port.rs485.flags & SER_RS485_RX_DURING_TX) -@@ -2781,6 +2827,8 @@ static int lpuart_probe(struct platform_ +@@ -2783,6 +2829,8 @@ static int lpuart_probe(struct platform_ return 0; diff --git a/target/linux/layerscape/patches-5.4/819-uart-0009-MLK-17133-02-tty-serial-lpuart-add-runtime-pm-suppor.patch b/target/linux/layerscape/patches-5.4/819-uart-0009-MLK-17133-02-tty-serial-lpuart-add-runtime-pm-suppor.patch index 0c194934d2..6f3cebf087 100644 --- a/target/linux/layerscape/patches-5.4/819-uart-0009-MLK-17133-02-tty-serial-lpuart-add-runtime-pm-suppor.patch +++ b/target/linux/layerscape/patches-5.4/819-uart-0009-MLK-17133-02-tty-serial-lpuart-add-runtime-pm-suppor.patch @@ -43,7 +43,7 @@ Reviewed-by: Robin Gong /* return TIOCSER_TEMT when transmitter is not busy */ static unsigned int lpuart_tx_empty(struct uart_port *port) { -@@ -2315,6 +2330,7 @@ static const struct uart_ops lpuart_pops +@@ -2317,6 +2332,7 @@ static const struct uart_ops lpuart_pops .break_ctl = lpuart_break_ctl, .startup = lpuart_startup, .shutdown = lpuart_shutdown, @@ -51,7 +51,7 @@ Reviewed-by: Robin Gong .set_termios = lpuart_set_termios, .type = lpuart_type, .request_port = lpuart_request_port, -@@ -2339,6 +2355,7 @@ static const struct uart_ops lpuart32_po +@@ -2341,6 +2357,7 @@ static const struct uart_ops lpuart32_po .break_ctl = lpuart32_break_ctl, .startup = lpuart32_startup, .shutdown = lpuart32_shutdown, @@ -59,7 +59,7 @@ Reviewed-by: Robin Gong .set_termios = lpuart32_set_termios, .type = lpuart_type, .request_port = lpuart_request_port, -@@ -2796,6 +2813,11 @@ static int lpuart_probe(struct platform_ +@@ -2798,6 +2815,11 @@ static int lpuart_probe(struct platform_ if (ret) goto failed_irq_request; @@ -71,7 +71,7 @@ Reviewed-by: Robin Gong ret = uart_add_one_port(&lpuart_reg, &sport->port); if (ret) goto failed_attach_port; -@@ -2830,6 +2852,9 @@ static int lpuart_probe(struct platform_ +@@ -2832,6 +2854,9 @@ static int lpuart_probe(struct platform_ failed_reset: uart_remove_one_port(&lpuart_reg, &sport->port); failed_attach_port: @@ -81,7 +81,7 @@ Reviewed-by: Robin Gong failed_irq_request: lpuart_disable_clks(sport); return ret; -@@ -2849,15 +2874,41 @@ static int lpuart_remove(struct platform +@@ -2851,15 +2876,41 @@ static int lpuart_remove(struct platform if (sport->dma_rx_chan) dma_release_channel(sport->dma_rx_chan); @@ -123,7 +123,7 @@ Reviewed-by: Robin Gong if (lpuart_is_32(sport)) { /* disable Rx/Tx and interrupts */ -@@ -2871,10 +2922,14 @@ static int lpuart_suspend(struct device +@@ -2873,10 +2924,14 @@ static int lpuart_suspend(struct device writeb(temp, sport->port.membase + UARTCR2); } @@ -138,7 +138,7 @@ Reviewed-by: Robin Gong if (sport->lpuart_dma_rx_use) { /* -@@ -2905,9 +2960,6 @@ static int lpuart_suspend(struct device +@@ -2907,9 +2962,6 @@ static int lpuart_suspend(struct device dmaengine_terminate_all(sport->dma_tx_chan); } @@ -148,7 +148,7 @@ Reviewed-by: Robin Gong return 0; } -@@ -2915,9 +2967,11 @@ static int lpuart_resume(struct device * +@@ -2917,9 +2969,11 @@ static int lpuart_resume(struct device * { struct lpuart_port *sport = dev_get_drvdata(dev); bool irq_wake = irqd_is_wakeup_set(irq_get_irq_data(sport->port.irq)); @@ -162,7 +162,7 @@ Reviewed-by: Robin Gong if (lpuart_is_32(sport)) lpuart32_setup_watermark_enable(sport); -@@ -2938,13 +2992,23 @@ static int lpuart_resume(struct device * +@@ -2940,13 +2994,23 @@ static int lpuart_resume(struct device * if (lpuart_is_32(sport)) lpuart32_configure(sport); @@ -188,7 +188,7 @@ Reviewed-by: Robin Gong static struct platform_driver lpuart_driver = { .probe = lpuart_probe, -@@ -2952,7 +3016,7 @@ static struct platform_driver lpuart_dri +@@ -2954,7 +3018,7 @@ static struct platform_driver lpuart_dri .driver = { .name = "fsl-lpuart", .of_match_table = lpuart_dt_ids, diff --git a/target/linux/layerscape/patches-5.4/819-uart-0010-tty-serial-lpuart-enable-wakeup-source-for-lpuart.patch b/target/linux/layerscape/patches-5.4/819-uart-0010-tty-serial-lpuart-enable-wakeup-source-for-lpuart.patch index 4c75e95fef..58f61ae24e 100644 --- a/target/linux/layerscape/patches-5.4/819-uart-0010-tty-serial-lpuart-enable-wakeup-source-for-lpuart.patch +++ b/target/linux/layerscape/patches-5.4/819-uart-0010-tty-serial-lpuart-enable-wakeup-source-for-lpuart.patch @@ -28,7 +28,7 @@ Signed-off-by: Fugang Duan #include #include #include -@@ -1745,10 +1746,23 @@ static void lpuart_rx_dma_startup(struct +@@ -1747,10 +1748,23 @@ static void lpuart_rx_dma_startup(struct } } @@ -53,7 +53,7 @@ Signed-off-by: Fugang Duan unsigned char temp; /* determine FIFO size and enable FIFO mode */ -@@ -1761,14 +1775,7 @@ static int lpuart_startup(struct uart_po +@@ -1763,14 +1777,7 @@ static int lpuart_startup(struct uart_po sport->rxfifo_size = UARTFIFO_DEPTH((temp >> UARTPFIFO_RXSIZE_OFF) & UARTPFIFO_FIFOSIZE_MASK); @@ -69,7 +69,7 @@ Signed-off-by: Fugang Duan return 0; } -@@ -1795,11 +1802,27 @@ static void lpuart32_configure(struct lp +@@ -1797,11 +1804,27 @@ static void lpuart32_configure(struct lp lpuart32_write(&sport->port, temp, UARTCTRL); } @@ -98,7 +98,7 @@ Signed-off-by: Fugang Duan unsigned long temp; int ret; -@@ -1831,17 +1854,8 @@ static int lpuart32_startup(struct uart_ +@@ -1833,17 +1856,8 @@ static int lpuart32_startup(struct uart_ sport->port.fifosize = sport->txfifo_size; } @@ -108,16 +108,16 @@ Signed-off-by: Fugang Duan - - lpuart_rx_dma_startup(sport); - lpuart_tx_dma_startup(sport); -+ lpuart32_hw_setup(sport); - +- - lpuart32_setup_watermark_enable(sport); - lpuart32_configure(sport); -- ++ lpuart32_hw_setup(sport); + - spin_unlock_irqrestore(&sport->port.lock, flags); return 0; } -@@ -2899,108 +2913,205 @@ static int lpuart_runtime_resume(struct +@@ -2901,108 +2915,205 @@ static int lpuart_runtime_resume(struct return lpuart_enable_clks(sport); }; @@ -197,7 +197,8 @@ Signed-off-by: Fugang Duan - } + return false; +} -+ + +- /* Disable Rx DMA to use UART port as wakeup source */ +static int lpuart_suspend_noirq(struct device *dev) +{ + struct lpuart_port *sport = dev_get_drvdata(dev); @@ -207,8 +208,7 @@ Signed-off-by: Fugang Duan + serial_lpuart_enable_wakeup(sport, !!irq_wake); + + pinctrl_pm_select_sleep_state(dev); - -- /* Disable Rx DMA to use UART port as wakeup source */ ++ + return 0; +} + @@ -302,7 +302,7 @@ Signed-off-by: Fugang Duan + ~UARTCR5_RDMAS, sport->port.membase + UARTCR5); + } + spin_unlock_irqrestore(&sport->port.lock, flags); - } ++ } + + if (sport->lpuart_dma_tx_use) { + spin_lock_irqsave(&sport->port.lock, flags); @@ -318,7 +318,7 @@ Signed-off-by: Fugang Duan + spin_unlock_irqrestore(&sport->port.lock, flags); + sport->dma_tx_in_progress = false; + dmaengine_terminate_all(sport->dma_tx_chan); -+ } + } + } else if (pm_runtime_active(sport->port.dev)) { + lpuart_disable_clks(sport); + pm_runtime_disable(sport->port.dev); diff --git a/target/linux/layerscape/patches-5.4/819-uart-0011-serial-fsl_lpuart-enable-two-stop-bits.patch b/target/linux/layerscape/patches-5.4/819-uart-0011-serial-fsl_lpuart-enable-two-stop-bits.patch index 6896c63be4..e047a05574 100644 --- a/target/linux/layerscape/patches-5.4/819-uart-0011-serial-fsl_lpuart-enable-two-stop-bits.patch +++ b/target/linux/layerscape/patches-5.4/819-uart-0011-serial-fsl_lpuart-enable-two-stop-bits.patch @@ -14,7 +14,7 @@ Signed-off-by: Fugang Duan --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c -@@ -2160,11 +2160,12 @@ lpuart32_set_termios(struct uart_port *p +@@ -2162,11 +2162,12 @@ lpuart32_set_termios(struct uart_port *p { struct lpuart_port *sport = container_of(port, struct lpuart_port, port); unsigned long flags; @@ -28,7 +28,7 @@ Signed-off-by: Fugang Duan modem = lpuart32_read(&sport->port, UARTMODIR); /* * only support CS8 and CS7, and for CS7 must enable PE. -@@ -2201,7 +2202,9 @@ lpuart32_set_termios(struct uart_port *p +@@ -2203,7 +2204,9 @@ lpuart32_set_termios(struct uart_port *p } if (termios->c_cflag & CSTOPB) @@ -39,7 +39,7 @@ Signed-off-by: Fugang Duan /* parity must be enabled when CS7 to match 8-bits format */ if ((termios->c_cflag & CSIZE) == CS7) -@@ -2278,6 +2281,7 @@ lpuart32_set_termios(struct uart_port *p +@@ -2280,6 +2283,7 @@ lpuart32_set_termios(struct uart_port *p lpuart32_write(&sport->port, old_ctrl & ~(UARTCTRL_TE | UARTCTRL_RE), UARTCTRL); diff --git a/target/linux/layerscape/patches-5.4/819-uart-0013-LF-484-tty-serial-lpuart-support-UPIO_MEM32-for-lpua.patch b/target/linux/layerscape/patches-5.4/819-uart-0013-LF-484-tty-serial-lpuart-support-UPIO_MEM32-for-lpua.patch index 10dee071ad..90de7c7c83 100644 --- a/target/linux/layerscape/patches-5.4/819-uart-0013-LF-484-tty-serial-lpuart-support-UPIO_MEM32-for-lpua.patch +++ b/target/linux/layerscape/patches-5.4/819-uart-0013-LF-484-tty-serial-lpuart-support-UPIO_MEM32-for-lpua.patch @@ -24,7 +24,7 @@ Signed-off-by: Peng Fan --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c -@@ -2649,7 +2649,9 @@ static int __init lpuart32_early_console +@@ -2651,7 +2651,9 @@ static int __init lpuart32_early_console if (!device->port.membase) return -ENODEV; diff --git a/target/linux/layerscape/patches-5.4/820-usb-0005-usb-dwc3-add-otg-properties-update.patch b/target/linux/layerscape/patches-5.4/820-usb-0005-usb-dwc3-add-otg-properties-update.patch index ccb90f4973..9082390788 100644 --- a/target/linux/layerscape/patches-5.4/820-usb-0005-usb-dwc3-add-otg-properties-update.patch +++ b/target/linux/layerscape/patches-5.4/820-usb-0005-usb-dwc3-add-otg-properties-update.patch @@ -54,7 +54,7 @@ Signed-off-by: Peter Chen * All 3.1 IP version constants are greater than the 3.0 IP --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c -@@ -3710,6 +3710,10 @@ int dwc3_gadget_init(struct dwc3 *dwc) +@@ -3711,6 +3711,10 @@ int dwc3_gadget_init(struct dwc3 *dwc) dwc->gadget.sg_supported = true; dwc->gadget.name = "dwc3-gadget"; dwc->gadget.lpm_capable = true; diff --git a/target/linux/mvebu/patches-5.4/907-MAINTAINERS-Add-an-entry-for-the-IEI-WT61P803-PUZZLE.patch b/target/linux/mvebu/patches-5.4/907-MAINTAINERS-Add-an-entry-for-the-IEI-WT61P803-PUZZLE.patch index 830cf33ce4..2ba8bac6fd 100644 --- a/target/linux/mvebu/patches-5.4/907-MAINTAINERS-Add-an-entry-for-the-IEI-WT61P803-PUZZLE.patch +++ b/target/linux/mvebu/patches-5.4/907-MAINTAINERS-Add-an-entry-for-the-IEI-WT61P803-PUZZLE.patch @@ -16,7 +16,7 @@ Cc: Robert Marko --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -7929,6 +7929,22 @@ F: include/net/cfg802154.h +@@ -7922,6 +7922,22 @@ F: include/net/cfg802154.h F: include/net/ieee802154_netdev.h F: Documentation/networking/ieee802154.rst diff --git a/target/linux/ramips/patches-5.4/0001-MIPS-cmdline-Clean-up-boot_command_line-initializati.patch b/target/linux/ramips/patches-5.4/0001-MIPS-cmdline-Clean-up-boot_command_line-initializati.patch index eedc7498be..0a43402536 100644 --- a/target/linux/ramips/patches-5.4/0001-MIPS-cmdline-Clean-up-boot_command_line-initializati.patch +++ b/target/linux/ramips/patches-5.4/0001-MIPS-cmdline-Clean-up-boot_command_line-initializati.patch @@ -46,7 +46,7 @@ Cc: linux-mips@vger.kernel.org --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c -@@ -538,11 +538,88 @@ static void __init check_kernel_sections +@@ -539,11 +539,88 @@ static void __init check_kernel_sections } } @@ -140,7 +140,7 @@ Cc: linux-mips@vger.kernel.org /* * arch_mem_init - initialize memory management subsystem -@@ -570,48 +647,12 @@ static void __init arch_mem_init(char ** +@@ -571,48 +648,12 @@ static void __init arch_mem_init(char ** { extern void plat_mem_setup(void); diff --git a/target/linux/ramips/patches-5.4/0003-MIPS-Fix-memory-reservation-in-bootmem_init-for-cert.patch b/target/linux/ramips/patches-5.4/0003-MIPS-Fix-memory-reservation-in-bootmem_init-for-cert.patch index 63429f49b0..6a7545b4b6 100644 --- a/target/linux/ramips/patches-5.4/0003-MIPS-Fix-memory-reservation-in-bootmem_init-for-cert.patch +++ b/target/linux/ramips/patches-5.4/0003-MIPS-Fix-memory-reservation-in-bootmem_init-for-cert.patch @@ -16,7 +16,7 @@ Signed-off-by: Tobias Wolf --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c -@@ -287,6 +287,8 @@ static unsigned long __init init_initrd( +@@ -288,6 +288,8 @@ static unsigned long __init init_initrd( * Initialize the bootmem allocator. It also setup initrd related data * if needed. */ @@ -25,7 +25,7 @@ Signed-off-by: Tobias Wolf #if defined(CONFIG_SGI_IP27) || (defined(CONFIG_CPU_LOONGSON3) && defined(CONFIG_NUMA)) static void __init bootmem_init(void) -@@ -325,7 +327,7 @@ static void __init bootmem_init(void) +@@ -326,7 +328,7 @@ static void __init bootmem_init(void) /* * Reserve any memory between the start of RAM and PHYS_OFFSET */ @@ -34,7 +34,7 @@ Signed-off-by: Tobias Wolf memblock_reserve(PHYS_OFFSET, ramstart - PHYS_OFFSET); if (PFN_UP(ramstart) > ARCH_PFN_OFFSET) { -@@ -386,8 +388,6 @@ static void __init bootmem_init(void) +@@ -387,8 +389,6 @@ static void __init bootmem_init(void) #endif /* CONFIG_SGI_IP27 */ diff --git a/target/linux/ramips/patches-5.4/0010-MIPS-add-bootargs-override-property.patch b/target/linux/ramips/patches-5.4/0010-MIPS-add-bootargs-override-property.patch index c19a0fb480..41c057f876 100644 --- a/target/linux/ramips/patches-5.4/0010-MIPS-add-bootargs-override-property.patch +++ b/target/linux/ramips/patches-5.4/0010-MIPS-add-bootargs-override-property.patch @@ -17,7 +17,7 @@ Signed-off-by: David Bauer --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c -@@ -571,8 +571,28 @@ static int __init bootcmdline_scan_chose +@@ -572,8 +572,28 @@ static int __init bootcmdline_scan_chose return 1; } @@ -46,7 +46,7 @@ Signed-off-by: David Bauer bool dt_bootargs = false; /* -@@ -586,6 +606,14 @@ static void __init bootcmdline_init(char +@@ -587,6 +607,14 @@ static void __init bootcmdline_init(char } /* diff --git a/target/linux/ramips/patches-5.4/0013-owrt-hack-fix-mt7688-cache-issue.patch b/target/linux/ramips/patches-5.4/0013-owrt-hack-fix-mt7688-cache-issue.patch index bedea14506..55a8f7831e 100644 --- a/target/linux/ramips/patches-5.4/0013-owrt-hack-fix-mt7688-cache-issue.patch +++ b/target/linux/ramips/patches-5.4/0013-owrt-hack-fix-mt7688-cache-issue.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c -@@ -723,8 +723,6 @@ static void __init arch_mem_init(char ** +@@ -724,8 +724,6 @@ static void __init arch_mem_init(char ** memblock_reserve(crashk_res.start, crashk_res.end - crashk_res.start + 1); #endif @@ -19,7 +19,7 @@ Signed-off-by: John Crispin /* * In order to reduce the possibility of kernel panic when failed to * get IO TLB memory under CONFIG_SWIOTLB, it is better to allocate -@@ -841,6 +839,7 @@ void __init setup_arch(char **cmdline_p) +@@ -842,6 +840,7 @@ void __init setup_arch(char **cmdline_p) cpu_cache_init(); paging_init();