From 18236cb2b464cfbf7ea8485e11e05716690ffb2e Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sat, 31 May 2025 02:20:16 +0800 Subject: [PATCH] rockchip: fix build with kernel 6.12 --- ...icro-stmmac-Add-SGMII-QSGMII-support.patch | 6 +-- .../312-02-v6.13-rk3576-otp-support.patch | 48 ------------------- .../312-04-v6.13-rk3576-otp-support.patch | 36 -------------- 3 files changed, 3 insertions(+), 87 deletions(-) delete mode 100644 target/linux/rockchip/patches-6.12/312-02-v6.13-rk3576-otp-support.patch delete mode 100644 target/linux/rockchip/patches-6.12/312-04-v6.13-rk3576-otp-support.patch diff --git a/target/linux/rockchip/patches-6.12/113-ethernet-stmicro-stmmac-Add-SGMII-QSGMII-support.patch b/target/linux/rockchip/patches-6.12/113-ethernet-stmicro-stmmac-Add-SGMII-QSGMII-support.patch index 2609b6734..3671c243e 100644 --- a/target/linux/rockchip/patches-6.12/113-ethernet-stmicro-stmmac-Add-SGMII-QSGMII-support.patch +++ b/target/linux/rockchip/patches-6.12/113-ethernet-stmicro-stmmac-Add-SGMII-QSGMII-support.patch @@ -260,9 +260,9 @@ Signed-off-by: David Wu struct regulator *ldo = bsp_priv->regulator; int ret; @@ -1832,6 +2002,18 @@ static struct rk_priv_data *rk_gmac_setu - "rockchip,grf"); - bsp_priv->php_grf = syscon_regmap_lookup_by_phandle(dev->of_node, - "rockchip,php-grf"); + return ERR_CAST(bsp_priv->php_grf); + } + } + bsp_priv->xpcs = syscon_regmap_lookup_by_phandle(dev->of_node, + "rockchip,xpcs"); + if (!IS_ERR(bsp_priv->xpcs)) { diff --git a/target/linux/rockchip/patches-6.12/312-02-v6.13-rk3576-otp-support.patch b/target/linux/rockchip/patches-6.12/312-02-v6.13-rk3576-otp-support.patch deleted file mode 100644 index 41d1ecb7f..000000000 --- a/target/linux/rockchip/patches-6.12/312-02-v6.13-rk3576-otp-support.patch +++ /dev/null @@ -1,48 +0,0 @@ -The RK3588 has an offset into the OTP area where the readable area begins -and automatically adds this to the start address. -Other variants are very much similar to rk3588, just with a different -offset, so move that value into variant-data. - -To match the size in bytes, store this value also in bytes and not in -number of blocks. - -Signed-off-by: Heiko Stuebner ---- - drivers/nvmem/rockchip-otp.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - ---- a/drivers/nvmem/rockchip-otp.c -+++ b/drivers/nvmem/rockchip-otp.c -@@ -59,7 +59,6 @@ - #define RK3588_OTPC_AUTO_EN 0x08 - #define RK3588_OTPC_INT_ST 0x84 - #define RK3588_OTPC_DOUT0 0x20 --#define RK3588_NO_SECURE_OFFSET 0x300 - #define RK3588_NBYTES 4 - #define RK3588_BURST_NUM 1 - #define RK3588_BURST_SHIFT 8 -@@ -69,6 +68,7 @@ - - struct rockchip_data { - int size; -+ int read_offset; - const char * const *clks; - int num_clks; - nvmem_reg_read_t reg_read; -@@ -196,7 +196,7 @@ static int rk3588_otp_read(void *context - addr_start = round_down(offset, RK3588_NBYTES) / RK3588_NBYTES; - addr_end = round_up(offset + bytes, RK3588_NBYTES) / RK3588_NBYTES; - addr_len = addr_end - addr_start; -- addr_start += RK3588_NO_SECURE_OFFSET; -+ addr_start += otp->data->read_offset / RK3588_NBYTES; - - buf = kzalloc(array_size(addr_len, RK3588_NBYTES), GFP_KERNEL); - if (!buf) -@@ -280,6 +280,7 @@ static const char * const rk3588_otp_clo - - static const struct rockchip_data rk3588_data = { - .size = 0x400, -+ .read_offset = 0xc00, - .clks = rk3588_otp_clocks, - .num_clks = ARRAY_SIZE(rk3588_otp_clocks), - .reg_read = rk3588_otp_read, diff --git a/target/linux/rockchip/patches-6.12/312-04-v6.13-rk3576-otp-support.patch b/target/linux/rockchip/patches-6.12/312-04-v6.13-rk3576-otp-support.patch deleted file mode 100644 index 7bd6a15d2..000000000 --- a/target/linux/rockchip/patches-6.12/312-04-v6.13-rk3576-otp-support.patch +++ /dev/null @@ -1,36 +0,0 @@ -The variant works very similar to the rk3588, just with a different -read-offset and size. - -Signed-off-by: Heiko Stuebner ---- - drivers/nvmem/rockchip-otp.c | 12 ++++++++++++ - 1 file changed, 12 insertions(+) - ---- a/drivers/nvmem/rockchip-otp.c -+++ b/drivers/nvmem/rockchip-otp.c -@@ -274,6 +274,14 @@ static const struct rockchip_data px30_d - .reg_read = px30_otp_read, - }; - -+static const struct rockchip_data rk3576_data = { -+ .size = 0x100, -+ .read_offset = 0x700, -+ .clks = px30_otp_clocks, -+ .num_clks = ARRAY_SIZE(px30_otp_clocks), -+ .reg_read = rk3588_otp_read, -+}; -+ - static const char * const rk3588_otp_clocks[] = { - "otp", "apb_pclk", "phy", "arb", - }; -@@ -296,6 +304,10 @@ static const struct of_device_id rockchi - .data = &px30_data, - }, - { -+ .compatible = "rockchip,rk3576-otp", -+ .data = &rk3576_data, -+ }, -+ { - .compatible = "rockchip,rk3588-otp", - .data = &rk3588_data, - },