Skip to content

Commit a8707f5

Browse files
sreMarc Zyngier
authored andcommitted
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 <[email protected]> Signed-off-by: XiaoDong Huang <[email protected]> Co-developed-by: Kever Yang <[email protected]> Signed-off-by: Kever Yang <[email protected]> Co-developed-by: Lucas Tanure <[email protected]> Signed-off-by: Lucas Tanure <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 35727af commit a8707f5

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed

Documentation/arm64/silicon-errata.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,9 @@ stable kernels.
207207
+----------------+-----------------+-----------------+-----------------------------+
208208
| Qualcomm Tech. | Kryo4xx Gold | N/A | ARM64_ERRATUM_1286807 |
209209
+----------------+-----------------+-----------------+-----------------------------+
210+
+----------------+-----------------+-----------------+-----------------------------+
211+
| Rockchip | RK3588 | #3588001 | ROCKCHIP_ERRATUM_3588001 |
212+
+----------------+-----------------+-----------------+-----------------------------+
210213

211214
+----------------+-----------------+-----------------+-----------------------------+
212215
| Fujitsu | A64FX | E#010001 | FUJITSU_ERRATUM_010001 |

arch/arm64/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,6 +1150,16 @@ config NVIDIA_CARMEL_CNP_ERRATUM
11501150

11511151
If unsure, say Y.
11521152

1153+
config ROCKCHIP_ERRATUM_3588001
1154+
bool "Rockchip 3588001: GIC600 can not support shareability attributes"
1155+
default y
1156+
help
1157+
The Rockchip RK3588 GIC600 SoC integration does not support ACE/ACE-lite.
1158+
This means, that its sharability feature may not be used, even though it
1159+
is supported by the IP itself.
1160+
1161+
If unsure, say Y.
1162+
11531163
config SOCIONEXT_SYNQUACER_PREITS
11541164
bool "Socionext Synquacer: Workaround for GICv3 pre-ITS"
11551165
default y

drivers/irqchip/irq-gic-v3-its.c

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,11 @@
4242
#define ITS_FLAGS_CMDQ_NEEDS_FLUSHING (1ULL << 0)
4343
#define ITS_FLAGS_WORKAROUND_CAVIUM_22375 (1ULL << 1)
4444
#define ITS_FLAGS_WORKAROUND_CAVIUM_23144 (1ULL << 2)
45+
#define ITS_FLAGS_FORCE_NON_SHAREABLE (1ULL << 3)
4546

4647
#define RDIST_FLAGS_PROPBASE_NEEDS_FLUSHING (1 << 0)
4748
#define RDIST_FLAGS_RD_TABLES_PREALLOCATED (1 << 1)
49+
#define RDIST_FLAGS_FORCE_NON_SHAREABLE (1 << 2)
4850

4951
#define RD_LOCAL_LPI_ENABLED BIT(0)
5052
#define RD_LOCAL_PENDTABLE_PREALLOCATED BIT(1)
@@ -2359,6 +2361,9 @@ static int its_setup_baser(struct its_node *its, struct its_baser *baser,
23592361
its_write_baser(its, baser, val);
23602362
tmp = baser->val;
23612363

2364+
if (its->flags & ITS_FLAGS_FORCE_NON_SHAREABLE)
2365+
tmp &= ~GITS_BASER_SHAREABILITY_MASK;
2366+
23622367
if ((val ^ tmp) & GITS_BASER_SHAREABILITY_MASK) {
23632368
/*
23642369
* Shareability didn't stick. Just use
@@ -3096,6 +3101,9 @@ static void its_cpu_init_lpis(void)
30963101
gicr_write_propbaser(val, rbase + GICR_PROPBASER);
30973102
tmp = gicr_read_propbaser(rbase + GICR_PROPBASER);
30983103

3104+
if (gic_rdists->flags & RDIST_FLAGS_FORCE_NON_SHAREABLE)
3105+
tmp &= ~GICR_PROPBASER_SHAREABILITY_MASK;
3106+
30993107
if ((tmp ^ val) & GICR_PROPBASER_SHAREABILITY_MASK) {
31003108
if (!(tmp & GICR_PROPBASER_SHAREABILITY_MASK)) {
31013109
/*
@@ -3120,6 +3128,9 @@ static void its_cpu_init_lpis(void)
31203128
gicr_write_pendbaser(val, rbase + GICR_PENDBASER);
31213129
tmp = gicr_read_pendbaser(rbase + GICR_PENDBASER);
31223130

3131+
if (gic_rdists->flags & RDIST_FLAGS_FORCE_NON_SHAREABLE)
3132+
tmp &= ~GICR_PENDBASER_SHAREABILITY_MASK;
3133+
31233134
if (!(tmp & GICR_PENDBASER_SHAREABILITY_MASK)) {
31243135
/*
31253136
* The HW reports non-shareable, we must remove the
@@ -4710,6 +4721,19 @@ static bool __maybe_unused its_enable_quirk_hip07_161600802(void *data)
47104721
return true;
47114722
}
47124723

4724+
static bool __maybe_unused its_enable_rk3588001(void *data)
4725+
{
4726+
struct its_node *its = data;
4727+
4728+
if (!of_machine_is_compatible("rockchip,rk3588"))
4729+
return false;
4730+
4731+
its->flags |= ITS_FLAGS_FORCE_NON_SHAREABLE;
4732+
gic_rdists->flags |= RDIST_FLAGS_FORCE_NON_SHAREABLE;
4733+
4734+
return true;
4735+
}
4736+
47134737
static const struct gic_quirk its_quirks[] = {
47144738
#ifdef CONFIG_CAVIUM_ERRATUM_22375
47154739
{
@@ -4755,6 +4779,14 @@ static const struct gic_quirk its_quirks[] = {
47554779
.mask = 0xffffffff,
47564780
.init = its_enable_quirk_hip07_161600802,
47574781
},
4782+
#endif
4783+
#ifdef CONFIG_ROCKCHIP_ERRATUM_3588001
4784+
{
4785+
.desc = "ITS: Rockchip erratum RK3588001",
4786+
.iidr = 0x0201743b,
4787+
.mask = 0xffffffff,
4788+
.init = its_enable_rk3588001,
4789+
},
47584790
#endif
47594791
{
47604792
}
@@ -5096,6 +5128,9 @@ static int __init its_probe_one(struct resource *res,
50965128
gits_write_cbaser(baser, its->base + GITS_CBASER);
50975129
tmp = gits_read_cbaser(its->base + GITS_CBASER);
50985130

5131+
if (its->flags & ITS_FLAGS_FORCE_NON_SHAREABLE)
5132+
tmp &= ~GITS_CBASER_SHAREABILITY_MASK;
5133+
50995134
if ((tmp ^ baser) & GITS_CBASER_SHAREABILITY_MASK) {
51005135
if (!(tmp & GITS_CBASER_SHAREABILITY_MASK)) {
51015136
/*

0 commit comments

Comments
 (0)