rockchip: replace local gic its hack with upstream solution
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
parent
7e06e74137
commit
3faa54bb9d
@ -557,6 +557,7 @@ CONFIG_RELOCATABLE=y
|
||||
CONFIG_RESET_CONTROLLER=y
|
||||
CONFIG_RESET_SCMI=y
|
||||
CONFIG_RFS_ACCEL=y
|
||||
CONFIG_ROCKCHIP_ERRATUM_3588001=y
|
||||
CONFIG_ROCKCHIP_GRF=y
|
||||
CONFIG_ROCKCHIP_IODOMAIN=y
|
||||
CONFIG_ROCKCHIP_IOMMU=y
|
||||
|
||||
@ -0,0 +1,152 @@
|
||||
From a8707f5538846611c90116c14f72539ad5fb37da Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Reichel <sebastian.reichel@collabora.com>
|
||||
Date: Tue, 18 Apr 2023 16:21:08 +0200
|
||||
Subject: [PATCH] irqchip/gic-v3: Add Rockchip 3588001 erratum workaround
|
||||
|
||||
Rockchip RK3588/RK3588s GIC600 integration does not support the
|
||||
sharability feature. Rockchip assigned Erratum ID #3588001 for this
|
||||
issue.
|
||||
|
||||
Note, that the 0x0201743b ID is not Rockchip specific and thus
|
||||
there is an extra of_machine_is_compatible() check.
|
||||
|
||||
The flags are named FORCE_NON_SHAREABLE to be vendor agnostic,
|
||||
since apparently similar integration design errors exist in other
|
||||
platforms and they can reuse the same flag.
|
||||
|
||||
Co-developed-by: XiaoDong Huang <derrick.huang@rock-chips.com>
|
||||
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
|
||||
Co-developed-by: Kever Yang <kever.yang@rock-chips.com>
|
||||
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
|
||||
Co-developed-by: Lucas Tanure <lucas.tanure@collabora.com>
|
||||
Signed-off-by: Lucas Tanure <lucas.tanure@collabora.com>
|
||||
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
|
||||
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
|
||||
Signed-off-by: Marc Zyngier <maz@kernel.org>
|
||||
Link: https://lore.kernel.org/r/20230418142109.49762-2-sebastian.reichel@collabora.com
|
||||
---
|
||||
Documentation/arm64/silicon-errata.rst | 3 +++
|
||||
arch/arm64/Kconfig | 10 ++++++++
|
||||
drivers/irqchip/irq-gic-v3-its.c | 35 ++++++++++++++++++++++++++
|
||||
3 files changed, 48 insertions(+)
|
||||
|
||||
--- a/Documentation/arm64/silicon-errata.rst
|
||||
+++ b/Documentation/arm64/silicon-errata.rst
|
||||
@@ -217,6 +217,9 @@ stable kernels.
|
||||
+----------------+-----------------+-----------------+-----------------------------+
|
||||
| Qualcomm Tech. | Kryo4xx Gold | N/A | ARM64_ERRATUM_1286807 |
|
||||
+----------------+-----------------+-----------------+-----------------------------+
|
||||
++----------------+-----------------+-----------------+-----------------------------+
|
||||
+| Rockchip | RK3588 | #3588001 | ROCKCHIP_ERRATUM_3588001 |
|
||||
++----------------+-----------------+-----------------+-----------------------------+
|
||||
|
||||
+----------------+-----------------+-----------------+-----------------------------+
|
||||
| Fujitsu | A64FX | E#010001 | FUJITSU_ERRATUM_010001 |
|
||||
--- a/arch/arm64/Kconfig
|
||||
+++ b/arch/arm64/Kconfig
|
||||
@@ -1160,6 +1160,16 @@ config NVIDIA_CARMEL_CNP_ERRATUM
|
||||
|
||||
If unsure, say Y.
|
||||
|
||||
+config ROCKCHIP_ERRATUM_3588001
|
||||
+ bool "Rockchip 3588001: GIC600 can not support shareability attributes"
|
||||
+ default y
|
||||
+ help
|
||||
+ The Rockchip RK3588 GIC600 SoC integration does not support ACE/ACE-lite.
|
||||
+ This means, that its sharability feature may not be used, even though it
|
||||
+ is supported by the IP itself.
|
||||
+
|
||||
+ If unsure, say Y.
|
||||
+
|
||||
config SOCIONEXT_SYNQUACER_PREITS
|
||||
bool "Socionext Synquacer: Workaround for GICv3 pre-ITS"
|
||||
default y
|
||||
--- a/drivers/irqchip/irq-gic-v3-its.c
|
||||
+++ b/drivers/irqchip/irq-gic-v3-its.c
|
||||
@@ -42,9 +42,11 @@
|
||||
#define ITS_FLAGS_CMDQ_NEEDS_FLUSHING (1ULL << 0)
|
||||
#define ITS_FLAGS_WORKAROUND_CAVIUM_22375 (1ULL << 1)
|
||||
#define ITS_FLAGS_WORKAROUND_CAVIUM_23144 (1ULL << 2)
|
||||
+#define ITS_FLAGS_FORCE_NON_SHAREABLE (1ULL << 3)
|
||||
|
||||
#define RDIST_FLAGS_PROPBASE_NEEDS_FLUSHING (1 << 0)
|
||||
#define RDIST_FLAGS_RD_TABLES_PREALLOCATED (1 << 1)
|
||||
+#define RDIST_FLAGS_FORCE_NON_SHAREABLE (1 << 2)
|
||||
|
||||
#define RD_LOCAL_LPI_ENABLED BIT(0)
|
||||
#define RD_LOCAL_PENDTABLE_PREALLOCATED BIT(1)
|
||||
@@ -2384,6 +2386,9 @@ retry_baser:
|
||||
its_write_baser(its, baser, val);
|
||||
tmp = baser->val;
|
||||
|
||||
+ if (its->flags & ITS_FLAGS_FORCE_NON_SHAREABLE)
|
||||
+ tmp &= ~GITS_BASER_SHAREABILITY_MASK;
|
||||
+
|
||||
if ((val ^ tmp) & GITS_BASER_SHAREABILITY_MASK) {
|
||||
/*
|
||||
* Shareability didn't stick. Just use
|
||||
@@ -3121,6 +3126,9 @@ static void its_cpu_init_lpis(void)
|
||||
gicr_write_propbaser(val, rbase + GICR_PROPBASER);
|
||||
tmp = gicr_read_propbaser(rbase + GICR_PROPBASER);
|
||||
|
||||
+ if (gic_rdists->flags & RDIST_FLAGS_FORCE_NON_SHAREABLE)
|
||||
+ tmp &= ~GICR_PROPBASER_SHAREABILITY_MASK;
|
||||
+
|
||||
if ((tmp ^ val) & GICR_PROPBASER_SHAREABILITY_MASK) {
|
||||
if (!(tmp & GICR_PROPBASER_SHAREABILITY_MASK)) {
|
||||
/*
|
||||
@@ -3145,6 +3153,9 @@ static void its_cpu_init_lpis(void)
|
||||
gicr_write_pendbaser(val, rbase + GICR_PENDBASER);
|
||||
tmp = gicr_read_pendbaser(rbase + GICR_PENDBASER);
|
||||
|
||||
+ if (gic_rdists->flags & RDIST_FLAGS_FORCE_NON_SHAREABLE)
|
||||
+ tmp &= ~GICR_PENDBASER_SHAREABILITY_MASK;
|
||||
+
|
||||
if (!(tmp & GICR_PENDBASER_SHAREABILITY_MASK)) {
|
||||
/*
|
||||
* The HW reports non-shareable, we must remove the
|
||||
@@ -4731,6 +4742,19 @@ static bool __maybe_unused its_enable_qu
|
||||
return true;
|
||||
}
|
||||
|
||||
+static bool __maybe_unused its_enable_rk3588001(void *data)
|
||||
+{
|
||||
+ struct its_node *its = data;
|
||||
+
|
||||
+ if (!of_machine_is_compatible("rockchip,rk3588"))
|
||||
+ return false;
|
||||
+
|
||||
+ its->flags |= ITS_FLAGS_FORCE_NON_SHAREABLE;
|
||||
+ gic_rdists->flags |= RDIST_FLAGS_FORCE_NON_SHAREABLE;
|
||||
+
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
static const struct gic_quirk its_quirks[] = {
|
||||
#ifdef CONFIG_CAVIUM_ERRATUM_22375
|
||||
{
|
||||
@@ -4777,6 +4801,14 @@ static const struct gic_quirk its_quirks
|
||||
.init = its_enable_quirk_hip07_161600802,
|
||||
},
|
||||
#endif
|
||||
+#ifdef CONFIG_ROCKCHIP_ERRATUM_3588001
|
||||
+ {
|
||||
+ .desc = "ITS: Rockchip erratum RK3588001",
|
||||
+ .iidr = 0x0201743b,
|
||||
+ .mask = 0xffffffff,
|
||||
+ .init = its_enable_rk3588001,
|
||||
+ },
|
||||
+#endif
|
||||
{
|
||||
}
|
||||
};
|
||||
@@ -5116,6 +5148,9 @@ static int __init its_probe_one(struct r
|
||||
gits_write_cbaser(baser, its->base + GITS_CBASER);
|
||||
tmp = gits_read_cbaser(its->base + GITS_CBASER);
|
||||
|
||||
+ if (its->flags & ITS_FLAGS_FORCE_NON_SHAREABLE)
|
||||
+ tmp &= ~GITS_CBASER_SHAREABILITY_MASK;
|
||||
+
|
||||
if ((tmp ^ baser) & GITS_CBASER_SHAREABILITY_MASK) {
|
||||
if (!(tmp & GITS_CBASER_SHAREABILITY_MASK)) {
|
||||
/*
|
||||
@ -0,0 +1,33 @@
|
||||
From 567f67acac94e7bbc4cb4b71ff9773555d02609a Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Reichel <sebastian.reichel@collabora.com>
|
||||
Date: Mon, 3 Jul 2023 18:41:29 +0200
|
||||
Subject: [PATCH] irqchip/gic-v3: Enable Rockchip 3588001 erratum workaround
|
||||
for RK3588S
|
||||
|
||||
Commit a8707f553884 ("irqchip/gic-v3: Add Rockchip 3588001 erratum
|
||||
workaround") mentioned RK3588S (the slimmed down variant of RK3588)
|
||||
being affected, but did not check for its compatible value. Thus the
|
||||
quirk is not applied on RK3588S. Since the GIC ITS node got added to the
|
||||
upstream DT, boards using RK3588S are no longer booting without this
|
||||
quirk being applied.
|
||||
|
||||
Fixes: 06cdac8e8407 ("arm64: dts: rockchip: add GIC ITS support to rk3588")
|
||||
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
|
||||
Signed-off-by: Marc Zyngier <maz@kernel.org>
|
||||
Link: https://lore.kernel.org/r/20230703164129.193991-1-sebastian.reichel@collabora.com
|
||||
---
|
||||
drivers/irqchip/irq-gic-v3-its.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/irqchip/irq-gic-v3-its.c
|
||||
+++ b/drivers/irqchip/irq-gic-v3-its.c
|
||||
@@ -4746,7 +4746,8 @@ static bool __maybe_unused its_enable_rk
|
||||
{
|
||||
struct its_node *its = data;
|
||||
|
||||
- if (!of_machine_is_compatible("rockchip,rk3588"))
|
||||
+ if (!of_machine_is_compatible("rockchip,rk3588") &&
|
||||
+ !of_machine_is_compatible("rockchip,rk3588s"))
|
||||
return false;
|
||||
|
||||
its->flags |= ITS_FLAGS_FORCE_NON_SHAREABLE;
|
||||
@ -0,0 +1,67 @@
|
||||
From d3badb15613c14dd35d3495b1dde5c90fcd616dd Mon Sep 17 00:00:00 2001
|
||||
From: Fang Xiang <fangxiang3@xiaomi.com>
|
||||
Date: Mon, 30 Oct 2023 16:32:56 +0800
|
||||
Subject: [PATCH] irqchip/gic-v3-its: Flush ITS tables correctly in
|
||||
non-coherent GIC designs
|
||||
|
||||
In non-coherent GIC designs, the ITS tables must be flushed before writing
|
||||
to the GITS_BASER<n> registers, otherwise the ITS could read dirty tables,
|
||||
which results in unpredictable behavior.
|
||||
|
||||
Flush the tables right at the begin of its_setup_baser() to prevent that.
|
||||
|
||||
[ tglx: Massage changelog ]
|
||||
|
||||
Fixes: a8707f553884 ("irqchip/gic-v3: Add Rockchip 3588001 erratum workaround")
|
||||
Suggested-by: Marc Zyngier <maz@kernel.org>
|
||||
Signed-off-by: Fang Xiang <fangxiang3@xiaomi.com>
|
||||
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
|
||||
Reviewed-by: Marc Zyngier <maz@kernel.org>
|
||||
Link: https://lore.kernel.org/r/20231030083256.4345-1-fangxiang3@xiaomi.com
|
||||
---
|
||||
drivers/irqchip/irq-gic-v3-its.c | 16 ++++++++++------
|
||||
1 file changed, 10 insertions(+), 6 deletions(-)
|
||||
|
||||
--- a/drivers/irqchip/irq-gic-v3-its.c
|
||||
+++ b/drivers/irqchip/irq-gic-v3-its.c
|
||||
@@ -2383,12 +2383,12 @@ retry_baser:
|
||||
break;
|
||||
}
|
||||
|
||||
+ if (!shr)
|
||||
+ gic_flush_dcache_to_poc(base, PAGE_ORDER_TO_SIZE(order));
|
||||
+
|
||||
its_write_baser(its, baser, val);
|
||||
tmp = baser->val;
|
||||
|
||||
- if (its->flags & ITS_FLAGS_FORCE_NON_SHAREABLE)
|
||||
- tmp &= ~GITS_BASER_SHAREABILITY_MASK;
|
||||
-
|
||||
if ((val ^ tmp) & GITS_BASER_SHAREABILITY_MASK) {
|
||||
/*
|
||||
* Shareability didn't stick. Just use
|
||||
@@ -2398,10 +2398,9 @@ retry_baser:
|
||||
* non-cacheable as well.
|
||||
*/
|
||||
shr = tmp & GITS_BASER_SHAREABILITY_MASK;
|
||||
- if (!shr) {
|
||||
+ if (!shr)
|
||||
cache = GITS_BASER_nC;
|
||||
- gic_flush_dcache_to_poc(base, PAGE_ORDER_TO_SIZE(order));
|
||||
- }
|
||||
+
|
||||
goto retry_baser;
|
||||
}
|
||||
|
||||
@@ -2613,6 +2612,11 @@ static int its_alloc_tables(struct its_n
|
||||
/* erratum 24313: ignore memory access type */
|
||||
cache = GITS_BASER_nCnB;
|
||||
|
||||
+ if (its->flags & ITS_FLAGS_FORCE_NON_SHAREABLE) {
|
||||
+ cache = GITS_BASER_nC;
|
||||
+ shr = 0;
|
||||
+ }
|
||||
+
|
||||
for (i = 0; i < GITS_BASER_NR_REGS; i++) {
|
||||
struct its_baser *baser = its->tables + i;
|
||||
u64 val = its_read_baser(its, baser);
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
||||
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
||||
@@ -7114,6 +7114,7 @@ int stmmac_dvr_probe(struct device *devi
|
||||
@@ -7117,6 +7117,7 @@ int stmmac_dvr_probe(struct device *devi
|
||||
{
|
||||
struct net_device *ndev = NULL;
|
||||
struct stmmac_priv *priv;
|
||||
@ -8,7 +8,7 @@
|
||||
u32 rxq;
|
||||
int i, ret = 0;
|
||||
|
||||
@@ -7122,6 +7123,9 @@ int stmmac_dvr_probe(struct device *devi
|
||||
@@ -7125,6 +7126,9 @@ int stmmac_dvr_probe(struct device *devi
|
||||
if (!ndev)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@ -1,105 +0,0 @@
|
||||
From a9d1129997cf016b24a33a822659abd13b686323 Mon Sep 17 00:00:00 2001
|
||||
From: XiaoDong Huang <derrick.huang@rock-chips.com>
|
||||
Date: Wed, 2 Dec 2020 17:30:47 +0800
|
||||
Subject: [PATCH] irqchip/gic-v3-its: add GFP_DMA32 flag for memory allocated
|
||||
for ITS in rk356x
|
||||
|
||||
Change-Id: Ic1d866733b348b86bbfdf2df4c0416a68eb422b7
|
||||
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
|
||||
---
|
||||
drivers/irqchip/irq-gic-v3-its.c | 28 ++++++++++++++++++++++++----
|
||||
1 file changed, 24 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/drivers/irqchip/irq-gic-v3-its.c
|
||||
+++ b/drivers/irqchip/irq-gic-v3-its.c
|
||||
@@ -2203,6 +2203,8 @@ static struct page *its_allocate_prop_ta
|
||||
{
|
||||
struct page *prop_page;
|
||||
|
||||
+ if (of_machine_is_compatible("rockchip,rk3568") || of_machine_is_compatible("rockchip,rk3566"))
|
||||
+ gfp_flags |= GFP_DMA32;
|
||||
prop_page = alloc_pages(gfp_flags, get_order(LPI_PROPBASE_SZ));
|
||||
if (!prop_page)
|
||||
return NULL;
|
||||
@@ -2326,6 +2328,7 @@ static int its_setup_baser(struct its_no
|
||||
u32 alloc_pages, psz;
|
||||
struct page *page;
|
||||
void *base;
|
||||
+ gfp_t gfp_flags;
|
||||
|
||||
psz = baser->psz;
|
||||
alloc_pages = (PAGE_ORDER_TO_SIZE(order) / psz);
|
||||
@@ -2337,7 +2340,10 @@ static int its_setup_baser(struct its_no
|
||||
order = get_order(GITS_BASER_PAGES_MAX * psz);
|
||||
}
|
||||
|
||||
- page = alloc_pages_node(its->numa_node, GFP_KERNEL | __GFP_ZERO, order);
|
||||
+ gfp_flags = GFP_KERNEL | __GFP_ZERO;
|
||||
+ if (of_machine_is_compatible("rockchip,rk3568") || of_machine_is_compatible("rockchip,rk3566"))
|
||||
+ gfp_flags |= GFP_DMA32;
|
||||
+ page = alloc_pages_node(its->numa_node, gfp_flags, order);
|
||||
if (!page)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -2966,6 +2972,8 @@ static struct page *its_allocate_pending
|
||||
{
|
||||
struct page *pend_page;
|
||||
|
||||
+ if (of_machine_is_compatible("rockchip,rk3568") || of_machine_is_compatible("rockchip,rk3566"))
|
||||
+ gfp_flags |= GFP_DMA32;
|
||||
pend_page = alloc_pages(gfp_flags | __GFP_ZERO,
|
||||
get_order(LPI_PENDBASE_SZ));
|
||||
if (!pend_page)
|
||||
@@ -3308,7 +3316,11 @@ static bool its_alloc_table_entry(struct
|
||||
|
||||
/* Allocate memory for 2nd level table */
|
||||
if (!table[idx]) {
|
||||
- page = alloc_pages_node(its->numa_node, GFP_KERNEL | __GFP_ZERO,
|
||||
+ gfp_t gfp_flags = GFP_KERNEL | __GFP_ZERO;
|
||||
+
|
||||
+ if (of_machine_is_compatible("rockchip,rk3568") || of_machine_is_compatible("rockchip,rk3566"))
|
||||
+ gfp_flags |= GFP_DMA32;
|
||||
+ page = alloc_pages_node(its->numa_node, gfp_flags,
|
||||
get_order(baser->psz));
|
||||
if (!page)
|
||||
return false;
|
||||
@@ -3397,6 +3409,7 @@ static struct its_device *its_create_dev
|
||||
int nr_lpis;
|
||||
int nr_ites;
|
||||
int sz;
|
||||
+ gfp_t gfp_flags;
|
||||
|
||||
if (!its_alloc_device_table(its, dev_id))
|
||||
return NULL;
|
||||
@@ -3412,7 +3425,10 @@ static struct its_device *its_create_dev
|
||||
nr_ites = max(2, nvecs);
|
||||
sz = nr_ites * (FIELD_GET(GITS_TYPER_ITT_ENTRY_SIZE, its->typer) + 1);
|
||||
sz = max(sz, ITS_ITT_ALIGN) + ITS_ITT_ALIGN - 1;
|
||||
- itt = kzalloc_node(sz, GFP_KERNEL, its->numa_node);
|
||||
+ gfp_flags = GFP_KERNEL;
|
||||
+ if (of_machine_is_compatible("rockchip,rk3568") || of_machine_is_compatible("rockchip,rk3566"))
|
||||
+ gfp_flags |= GFP_DMA32;
|
||||
+ itt = kzalloc_node(sz, gfp_flags, its->numa_node);
|
||||
if (alloc_lpis) {
|
||||
lpi_map = its_lpi_alloc(nvecs, &lpi_base, &nr_lpis);
|
||||
if (lpi_map)
|
||||
@@ -5028,6 +5044,7 @@ static int __init its_probe_one(struct r
|
||||
struct page *page;
|
||||
u32 ctlr;
|
||||
int err;
|
||||
+ gfp_t gfp_flags;
|
||||
|
||||
its_base = its_map_one(res, &err);
|
||||
if (!its_base)
|
||||
@@ -5081,7 +5098,10 @@ static int __init its_probe_one(struct r
|
||||
|
||||
its->numa_node = numa_node;
|
||||
|
||||
- page = alloc_pages_node(its->numa_node, GFP_KERNEL | __GFP_ZERO,
|
||||
+ gfp_flags = GFP_KERNEL | __GFP_ZERO;
|
||||
+ if (of_machine_is_compatible("rockchip,rk3568") || of_machine_is_compatible("rockchip,rk3566"))
|
||||
+ gfp_flags |= GFP_DMA32;
|
||||
+ page = alloc_pages_node(its->numa_node, gfp_flags,
|
||||
get_order(ITS_CMD_QUEUE_SZ));
|
||||
if (!page) {
|
||||
err = -ENOMEM;
|
||||
@ -1,58 +0,0 @@
|
||||
From 44cbfbc637028698b73628a2a635b5466eb341d5 Mon Sep 17 00:00:00 2001
|
||||
From: XiaoDong Huang <derrick.huang@rock-chips.com>
|
||||
Date: Wed, 2 Dec 2020 18:03:43 +0800
|
||||
Subject: [PATCH] irqchip/gic-v3-its: force to config its tables as
|
||||
no-inner-cache in rk356x
|
||||
|
||||
Change-Id: Idebfe94622cbb8169f4d464a3152c7828683c72c
|
||||
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
|
||||
---
|
||||
drivers/irqchip/irq-gic-v3-its.c | 16 ++++++++++++++++
|
||||
1 file changed, 16 insertions(+)
|
||||
|
||||
--- a/drivers/irqchip/irq-gic-v3-its.c
|
||||
+++ b/drivers/irqchip/irq-gic-v3-its.c
|
||||
@@ -2390,6 +2390,10 @@ retry_baser:
|
||||
its_write_baser(its, baser, val);
|
||||
tmp = baser->val;
|
||||
|
||||
+ if (of_machine_is_compatible("rockchip,rk3568") ||
|
||||
+ of_machine_is_compatible("rockchip,rk3566"))
|
||||
+ tmp &= ~GITS_BASER_SHAREABILITY_MASK;
|
||||
+
|
||||
if ((val ^ tmp) & GITS_BASER_SHAREABILITY_MASK) {
|
||||
/*
|
||||
* Shareability didn't stick. Just use
|
||||
@@ -3129,6 +3133,10 @@ static void its_cpu_init_lpis(void)
|
||||
gicr_write_propbaser(val, rbase + GICR_PROPBASER);
|
||||
tmp = gicr_read_propbaser(rbase + GICR_PROPBASER);
|
||||
|
||||
+ if (of_machine_is_compatible("rockchip,rk3568") ||
|
||||
+ of_machine_is_compatible("rockchip,rk3566"))
|
||||
+ tmp &= ~GICR_PROPBASER_SHAREABILITY_MASK;
|
||||
+
|
||||
if ((tmp ^ val) & GICR_PROPBASER_SHAREABILITY_MASK) {
|
||||
if (!(tmp & GICR_PROPBASER_SHAREABILITY_MASK)) {
|
||||
/*
|
||||
@@ -3153,6 +3161,10 @@ static void its_cpu_init_lpis(void)
|
||||
gicr_write_pendbaser(val, rbase + GICR_PENDBASER);
|
||||
tmp = gicr_read_pendbaser(rbase + GICR_PENDBASER);
|
||||
|
||||
+ if (of_machine_is_compatible("rockchip,rk3568") ||
|
||||
+ of_machine_is_compatible("rockchip,rk3566"))
|
||||
+ tmp &= ~GICR_PENDBASER_SHAREABILITY_MASK;
|
||||
+
|
||||
if (!(tmp & GICR_PENDBASER_SHAREABILITY_MASK)) {
|
||||
/*
|
||||
* The HW reports non-shareable, we must remove the
|
||||
@@ -5132,6 +5144,10 @@ static int __init its_probe_one(struct r
|
||||
gits_write_cbaser(baser, its->base + GITS_CBASER);
|
||||
tmp = gits_read_cbaser(its->base + GITS_CBASER);
|
||||
|
||||
+ if (of_machine_is_compatible("rockchip,rk3568") ||
|
||||
+ of_machine_is_compatible("rockchip,rk3566"))
|
||||
+ tmp &= ~GITS_CBASER_SHAREABILITY_MASK;
|
||||
+
|
||||
if ((tmp ^ baser) & GITS_CBASER_SHAREABILITY_MASK) {
|
||||
if (!(tmp & GITS_CBASER_SHAREABILITY_MASK)) {
|
||||
/*
|
||||
@ -1,28 +0,0 @@
|
||||
From bc0263dea7e284d67e4bbe97db3f226d353f4d39 Mon Sep 17 00:00:00 2001
|
||||
From: XiaoDong Huang <derrick.huang@rock-chips.com>
|
||||
Date: Mon, 11 Jan 2021 19:51:18 +0800
|
||||
Subject: [PATCH] irqchip/gic-v3-its: flush base table if rk356x
|
||||
|
||||
Change-Id: Ia2b0dd3d47742c43939eb99d3f8adac8e1107603
|
||||
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
|
||||
---
|
||||
drivers/irqchip/irq-gic-v3-its.c | 8 ++++++--
|
||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/drivers/irqchip/irq-gic-v3-its.c
|
||||
+++ b/drivers/irqchip/irq-gic-v3-its.c
|
||||
@@ -2391,8 +2391,12 @@ retry_baser:
|
||||
tmp = baser->val;
|
||||
|
||||
if (of_machine_is_compatible("rockchip,rk3568") ||
|
||||
- of_machine_is_compatible("rockchip,rk3566"))
|
||||
- tmp &= ~GITS_BASER_SHAREABILITY_MASK;
|
||||
+ of_machine_is_compatible("rockchip,rk3566")) {
|
||||
+ if (tmp & GITS_BASER_SHAREABILITY_MASK)
|
||||
+ tmp &= ~GITS_BASER_SHAREABILITY_MASK;
|
||||
+ else
|
||||
+ gic_flush_dcache_to_poc(base, PAGE_ORDER_TO_SIZE(order));
|
||||
+ }
|
||||
|
||||
if ((val ^ tmp) & GITS_BASER_SHAREABILITY_MASK) {
|
||||
/*
|
||||
@ -1,58 +0,0 @@
|
||||
From 0b985f29304dcb9d644174edacb67298e8049d4f Mon Sep 17 00:00:00 2001
|
||||
From: Kever Yang <kever.yang@rock-chips.com>
|
||||
Date: Thu, 18 Mar 2021 20:15:23 +0800
|
||||
Subject: [PATCH] irqchip/gic-v3-its: force to config its tables as
|
||||
no-inner-cache in rk3588
|
||||
|
||||
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
|
||||
Change-Id: I7275cbf011061f11968505a7570230d2d789e9fc
|
||||
---
|
||||
drivers/irqchip/irq-gic-v3-its.c | 24 ++++++++++++++++--------
|
||||
1 file changed, 16 insertions(+), 8 deletions(-)
|
||||
|
||||
--- a/drivers/irqchip/irq-gic-v3-its.c
|
||||
+++ b/drivers/irqchip/irq-gic-v3-its.c
|
||||
@@ -2391,7 +2391,9 @@ retry_baser:
|
||||
tmp = baser->val;
|
||||
|
||||
if (of_machine_is_compatible("rockchip,rk3568") ||
|
||||
- of_machine_is_compatible("rockchip,rk3566")) {
|
||||
+ of_machine_is_compatible("rockchip,rk3566") ||
|
||||
+ of_machine_is_compatible("rockchip,rk3588") ||
|
||||
+ of_machine_is_compatible("rockchip,rk3588s")) {
|
||||
if (tmp & GITS_BASER_SHAREABILITY_MASK)
|
||||
tmp &= ~GITS_BASER_SHAREABILITY_MASK;
|
||||
else
|
||||
@@ -3138,7 +3140,9 @@ static void its_cpu_init_lpis(void)
|
||||
tmp = gicr_read_propbaser(rbase + GICR_PROPBASER);
|
||||
|
||||
if (of_machine_is_compatible("rockchip,rk3568") ||
|
||||
- of_machine_is_compatible("rockchip,rk3566"))
|
||||
+ of_machine_is_compatible("rockchip,rk3566") ||
|
||||
+ of_machine_is_compatible("rockchip,rk3588") ||
|
||||
+ of_machine_is_compatible("rockchip,rk3588s"))
|
||||
tmp &= ~GICR_PROPBASER_SHAREABILITY_MASK;
|
||||
|
||||
if ((tmp ^ val) & GICR_PROPBASER_SHAREABILITY_MASK) {
|
||||
@@ -3166,7 +3170,9 @@ static void its_cpu_init_lpis(void)
|
||||
tmp = gicr_read_pendbaser(rbase + GICR_PENDBASER);
|
||||
|
||||
if (of_machine_is_compatible("rockchip,rk3568") ||
|
||||
- of_machine_is_compatible("rockchip,rk3566"))
|
||||
+ of_machine_is_compatible("rockchip,rk3566") ||
|
||||
+ of_machine_is_compatible("rockchip,rk3588") ||
|
||||
+ of_machine_is_compatible("rockchip,rk3588s"))
|
||||
tmp &= ~GICR_PENDBASER_SHAREABILITY_MASK;
|
||||
|
||||
if (!(tmp & GICR_PENDBASER_SHAREABILITY_MASK)) {
|
||||
@@ -5149,7 +5155,9 @@ static int __init its_probe_one(struct r
|
||||
tmp = gits_read_cbaser(its->base + GITS_CBASER);
|
||||
|
||||
if (of_machine_is_compatible("rockchip,rk3568") ||
|
||||
- of_machine_is_compatible("rockchip,rk3566"))
|
||||
+ of_machine_is_compatible("rockchip,rk3566") ||
|
||||
+ of_machine_is_compatible("rockchip,rk3588") ||
|
||||
+ of_machine_is_compatible("rockchip,rk3588s"))
|
||||
tmp &= ~GITS_CBASER_SHAREABILITY_MASK;
|
||||
|
||||
if ((tmp ^ baser) & GITS_CBASER_SHAREABILITY_MASK) {
|
||||
@ -0,0 +1,13 @@
|
||||
--- a/drivers/irqchip/irq-gic-v3-its.c
|
||||
+++ b/drivers/irqchip/irq-gic-v3-its.c
|
||||
@@ -4750,7 +4750,9 @@ static bool __maybe_unused its_enable_rk
|
||||
{
|
||||
struct its_node *its = data;
|
||||
|
||||
- if (!of_machine_is_compatible("rockchip,rk3588") &&
|
||||
+ if (!of_machine_is_compatible("rockchip,rk3566") &&
|
||||
+ !of_machine_is_compatible("rockchip,rk3568") &&
|
||||
+ !of_machine_is_compatible("rockchip,rk3588") &&
|
||||
!of_machine_is_compatible("rockchip,rk3588s"))
|
||||
return false;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user