Skip to content

Commit fe3c659

Browse files
authored
Merge branch 'main' into add_board_lubancat_5io
2 parents 217d60a + 09c274e commit fe3c659

338 files changed

Lines changed: 74473 additions & 5 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

lib/functions/compilation/patch/drivers_network.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ driver_rtl8189ES() {
4848

4949
# Wireless drivers for Realtek 8189ES chipsets
5050

51-
if linux-version compare "${version}" ge 3.14; then
51+
if linux-version compare "${version}" ge 3.14 && linux-version compare "${version}" lt 7.2; then
5252

5353
# Attach to specific commit (was "branch:master")
5454
local rtl8189esver='commit:0a5d04114fac3c9f48a343cb905fbb6a3f9f5df5' # Commit date: 2025-09-26 (please update when updating commit ref)
@@ -99,7 +99,7 @@ driver_rtl8189FS() {
9999

100100
# Wireless drivers for Realtek 8189FS chipsets
101101

102-
if linux-version compare "${version}" ge 3.14; then
102+
if linux-version compare "${version}" ge 3.14 && linux-version compare "${version}" lt 7.2; then
103103

104104
# Attach to specific commit (was "branch:rtl8189fs")
105105
local rtl8189fsver='commit:876e627a5b6a8021700391b4249a4a31edfebe5c' # Commit date: 2025-09-26 (please update when updating commit ref)
@@ -435,7 +435,7 @@ driver_rtw88() {
435435

436436
driver_rtl8852bs() {
437437
# Wireless driver for Realtek 8852BS SDIO Wireless driver used in BananaPi F3 and Armsom Sige5
438-
if linux-version compare "${version}" ge 6.1 && [[ "${LINUXFAMILY}" == spacemit || "${LINUXFAMILY}" == rk35xx || "${LINUXFAMILY}" == rockchip64 ]]; then
438+
if linux-version compare "${version}" ge 6.1 && linux-version compare "${version}" lt 7.2 && [[ "${LINUXFAMILY}" == spacemit || "${LINUXFAMILY}" == rk35xx || "${LINUXFAMILY}" == rockchip64 ]]; then
439439

440440
# Attach to specific commit
441441
local rtl8852bs_ver='commit:35d3e2660fd912c36777cc50dd43b3fbc805d56a' # Commit date: May 17, 2026 (please update when updating commit ref)
@@ -545,7 +545,7 @@ driver_uwe5622() {
545545

546546
# Wireless drivers for Unisoc uwe5622 wireless
547547

548-
if linux-version compare "${version}" ge 5.15 && [[ "$LINUXFAMILY" == sun* || "$LINUXFAMILY" == rockchip64 || "$LINUXFAMILY" == rk35xx ]]; then
548+
if linux-version compare "${version}" ge 5.15 && linux-version compare "${version}" lt 7.2 && [[ "$LINUXFAMILY" == sun* || "$LINUXFAMILY" == rockchip64 || "$LINUXFAMILY" == rk35xx ]]; then
549549

550550
display_alert "Adding" "Drivers for Unisoc uwe5622 found on some Allwinner and Rockchip boards" "info"
551551

@@ -756,7 +756,7 @@ driver_rtl8723DS() {
756756

757757
# Wireless drivers for Realtek 8723DS chipsets
758758

759-
if linux-version compare "${version}" ge 5.0; then
759+
if linux-version compare "${version}" ge 5.0 && linux-version compare "${version}" lt 7.2; then
760760

761761
# Attach to specific commit (was "branch:master")
762762
local rtl8723dsver='commit:18a978da1cc9fdf732c082bb5142f2a7e733e352' # Commit date: 2026-05-25 (please update when updating commit ref)
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
config: # This is file 'patch/kernel/archive/rockchip64-6.19/0000.patching_config.yaml'
2+
3+
# Just some info stuff; not used by the patching scripts
4+
name: rockchip64-7.2
5+
kind: kernel
6+
type: mainline # or: vendor
7+
branch: linux-7.2.y
8+
last-known-good-tag: v7.1.2
9+
maintainers:
10+
- { github: rpardini, name: Ricardo Pardini, email: ricardo@pardini.net, armbian-forum: rpardini }
11+
- { github: paolosabatino, name: Paolo Sabatino, email: paolo.sabatino@gmail.com, armbian-forum: jock }
12+
13+
# .dts files in these directories will be copied as-is to the build tree; later ones overwrite earlier ones.
14+
# This is meant to provide a way to "add a board DTS" without having to null-patch them in.
15+
dts-directories:
16+
- { source: "dt", target: "arch/arm64/boot/dts/rockchip" }
17+
18+
# every file in these directories will be copied as-is to the build tree; later ones overwrite earlier ones
19+
# This is meant as a way to have overlays, bare, in a directory, without having to null-patch them in.
20+
# @TODO need a solution to auto-Makefile the overlays as well
21+
overlay-directories:
22+
- { source: "overlay", target: "arch/arm64/boot/dts/rockchip/overlay" }
23+
24+
# the Makefile in each of these directories will be magically patched to include the dts files copied
25+
# or patched-in; overlay subdir will be included "-y" if it exists.
26+
# No more Makefile patching needed, yay!
27+
# add-only: true - only add entries `` to the end of the Makefile and hope for the best
28+
auto-patch-dt-makefile:
29+
- { directory: "arch/arm64/boot/dts/rockchip", config-var: "CONFIG_ARCH_ROCKCHIP", add-only: true }
30+
31+
# configuration for when applying patches to git / auto-rewriting patches (development cycle helpers)
32+
patches-to-git:
33+
do-not-commit-files:
34+
- "MAINTAINERS" # constant churn, drop them. sorry.
35+
- "Documentation/devicetree/bindings/arm/rockchip.yaml" # constant churn, conflicts on every bump, drop it. sorry.
36+
do-not-commit-regexes: # Python-style regexes
37+
- "^arch/([a-zA-Z0-9]+)/boot/dts/([a-zA-Z0-9]+)/Makefile$" # ignore DT Makefile patches, we've an auto-patcher now
38+
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: retro98boy <retro98boy@qq.com>
3+
Date: Wed, 25 Feb 2026 05:18:04 +0800
4+
Subject: HACK: Ignore SError to enable rk3399 PCIe bus enumeration
5+
6+
---
7+
arch/arm64/kernel/traps.c | 19 ++++
8+
drivers/pci/controller/pcie-rockchip-host.c | 50 ++++++++++
9+
2 files changed, 69 insertions(+)
10+
11+
diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
12+
index 111111111111..222222222222 100644
13+
--- a/arch/arm64/kernel/traps.c
14+
+++ b/arch/arm64/kernel/traps.c
15+
@@ -976,8 +976,27 @@ bool arm64_is_fatal_ras_serror(struct pt_regs *regs, unsigned long esr)
16+
}
17+
}
18+
19+
+bool rk3399_pcie_ignore_serror_enabled __read_mostly = false;
20+
+EXPORT_SYMBOL(rk3399_pcie_ignore_serror_enabled);
21+
+
22+
+static int __init setup_rk3399_pcie_serror_handling(char *str)
23+
+{
24+
+ rk3399_pcie_ignore_serror_enabled = true;
25+
+ pr_info("HACK: Ignore SError to enable rk3399 PCIe bus enumeration\n");
26+
+ return 1;
27+
+}
28+
+__setup("rk3399_pcie_ignore_serror", setup_rk3399_pcie_serror_handling);
29+
+
30+
void do_serror(struct pt_regs *regs, unsigned long esr)
31+
{
32+
+ if(rk3399_pcie_ignore_serror_enabled) {
33+
+ if (esr >> ESR_ELx_EC_SHIFT == ESR_ELx_EC_SERROR) {
34+
+ pr_debug("Ignoring SError Interrupt on CPU%d\n",
35+
+ smp_processor_id());
36+
+ return;
37+
+ }
38+
+ }
39+
+
40+
/* non-RAS errors are not containable */
41+
if (!arm64_is_ras_serror(esr) || arm64_is_fatal_ras_serror(regs, esr))
42+
arm64_serror_panic(regs, esr);
43+
diff --git a/drivers/pci/controller/pcie-rockchip-host.c b/drivers/pci/controller/pcie-rockchip-host.c
44+
index 111111111111..222222222222 100644
45+
--- a/drivers/pci/controller/pcie-rockchip-host.c
46+
+++ b/drivers/pci/controller/pcie-rockchip-host.c
47+
@@ -923,8 +923,58 @@ static int rockchip_pcie_resume_noirq(struct device *dev)
48+
return err;
49+
}
50+
51+
+extern bool rk3399_pcie_ignore_serror_enabled;
52+
static int rockchip_pcie_probe(struct platform_device *pdev)
53+
{
54+
+ /*
55+
+ * When a PCIe device sends an unknown message,
56+
+ * the RK3399 triggers either a synchronous error or an SError.
57+
+ * If triggered by the A72 (via memory-mapped I/O), it results in an SError,
58+
+ * whereas the A53 results in a synchronous error.
59+
+ * To allow the RK3399 to continue PCIe enumeration, we can hijack and ignore these errors.
60+
+ * Since hijacking SErrors is simpler—requiring only a modification to the do_serror function,
61+
+ * we should pin the PCIe probe process to CPU4 (A72).
62+
+ * More detail, see:
63+
+ * https://forum.pine64.org/showthread.php?tid=6329&pid=65064
64+
+ * https://lore.kernel.org/linux-pci/CAMdYzYoTwjKz4EN8PtD5pZfu3+SX+68JL+dfvmCrSnLL=K6Few@mail.gmail.com/
65+
+ * https://lkml.org/lkml/2020/4/27/1041
66+
+ */
67+
+ if (rk3399_pcie_ignore_serror_enabled) {
68+
+ int try_count = 0;
69+
+ unsigned long start_jiffies = jiffies;
70+
+ int max_retries = 50; // Wait for a maximum of 50 × 10 = 500ms
71+
+
72+
+ dev_info(&pdev->dev, "Checking CPU4 availability...\n");
73+
+
74+
+ while (!cpu_online(4) && try_count < max_retries) {
75+
+ try_count++;
76+
+ dev_info(&pdev->dev,
77+
+ "Wait CPU4: try=%d, elapsed=%u ms\n",
78+
+ try_count,
79+
+ jiffies_to_msecs(jiffies - start_jiffies));
80+
+ msleep(10);
81+
+ }
82+
+
83+
+ if (cpu_online(4)) {
84+
+ struct cpumask mask;
85+
+ cpumask_clear(&mask);
86+
+ cpumask_set_cpu(4, &mask);
87+
+
88+
+ if (set_cpus_allowed_ptr(current, &mask) == 0) {
89+
+ dev_info(
90+
+ &pdev->dev,
91+
+ "Success: Probe migrated to CPU4 at try %d (%u ms)\n",
92+
+ try_count,
93+
+ jiffies_to_msecs(jiffies -
94+
+ start_jiffies));
95+
+ }
96+
+ } else {
97+
+ dev_err(&pdev->dev,
98+
+ "Fail: CPU4 timeout after %d tries. Probing on CPU%d\n",
99+
+ try_count, smp_processor_id());
100+
+ }
101+
+ }
102+
+
103+
struct rockchip_pcie *rockchip;
104+
struct device *dev = &pdev->dev;
105+
struct pci_host_bridge *bridge;
106+
--
107+
Armbian
108+

0 commit comments

Comments
 (0)