Skip to content

Commit f39157b

Browse files
author
Marc Zyngier
committed
Merge branch irq/gic-6.4 into irq/irqchip-next
* irq/gic-6.4: : . : Collection of GIC/GICv3 fixes and cleanups : : - Workaround for the nvidia T241 chip that gets confused : in 3 and 4 socket configurations, leading to the GIC : malfunctionning in some contexts : : - Drop support for non-firmware driven GIC configurarations : now that the old ARM11MP Cavium board is gone : : - Workaround for the Rockchip 3588 chip that doesn't : correctly deal with the shareability attributes. : . irqchip/gic-v3: Add Rockchip 3588001 erratum workaround irqchip/gicv3: Workaround for NVIDIA erratum T241-FABRIC-4 irqchip/gic: Drop support for board files Signed-off-by: Marc Zyngier <[email protected]>
2 parents 197b6b6 + a8707f5 commit f39157b

File tree

10 files changed

+208
-97
lines changed

10 files changed

+208
-97
lines changed

Documentation/arm64/silicon-errata.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,8 @@ stable kernels.
172172
+----------------+-----------------+-----------------+-----------------------------+
173173
| NVIDIA | Carmel Core | N/A | NVIDIA_CARMEL_CNP_ERRATUM |
174174
+----------------+-----------------+-----------------+-----------------------------+
175+
| NVIDIA | T241 GICv3/4.x | T241-FABRIC-4 | N/A |
176+
+----------------+-----------------+-----------------+-----------------------------+
175177
+----------------+-----------------+-----------------+-----------------------------+
176178
| Freescale/NXP | LS2080A/LS1043A | A-008585 | FSL_ERRATUM_A008585 |
177179
+----------------+-----------------+-----------------+-----------------------------+
@@ -205,6 +207,9 @@ stable kernels.
205207
+----------------+-----------------+-----------------+-----------------------------+
206208
| Qualcomm Tech. | Kryo4xx Gold | N/A | ARM64_ERRATUM_1286807 |
207209
+----------------+-----------------+-----------------+-----------------------------+
210+
+----------------+-----------------+-----------------+-----------------------------+
211+
| Rockchip | RK3588 | #3588001 | ROCKCHIP_ERRATUM_3588001 |
212+
+----------------+-----------------+-----------------+-----------------------------+
208213

209214
+----------------+-----------------+-----------------+-----------------------------+
210215
| 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/firmware/smccc/smccc.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,32 @@ static enum arm_smccc_conduit smccc_conduit = SMCCC_CONDUIT_NONE;
1717

1818
bool __ro_after_init smccc_trng_available = false;
1919
u64 __ro_after_init smccc_has_sve_hint = false;
20+
s32 __ro_after_init smccc_soc_id_version = SMCCC_RET_NOT_SUPPORTED;
21+
s32 __ro_after_init smccc_soc_id_revision = SMCCC_RET_NOT_SUPPORTED;
2022

2123
void __init arm_smccc_version_init(u32 version, enum arm_smccc_conduit conduit)
2224
{
25+
struct arm_smccc_res res;
26+
2327
smccc_version = version;
2428
smccc_conduit = conduit;
2529

2630
smccc_trng_available = smccc_probe_trng();
2731
if (IS_ENABLED(CONFIG_ARM64_SVE) &&
2832
smccc_version >= ARM_SMCCC_VERSION_1_3)
2933
smccc_has_sve_hint = true;
34+
35+
if ((smccc_version >= ARM_SMCCC_VERSION_1_2) &&
36+
(smccc_conduit != SMCCC_CONDUIT_NONE)) {
37+
arm_smccc_1_1_invoke(ARM_SMCCC_ARCH_FEATURES_FUNC_ID,
38+
ARM_SMCCC_ARCH_SOC_ID, &res);
39+
if ((s32)res.a0 >= 0) {
40+
arm_smccc_1_1_invoke(ARM_SMCCC_ARCH_SOC_ID, 0, &res);
41+
smccc_soc_id_version = (s32)res.a0;
42+
arm_smccc_1_1_invoke(ARM_SMCCC_ARCH_SOC_ID, 1, &res);
43+
smccc_soc_id_revision = (s32)res.a0;
44+
}
45+
}
3046
}
3147

3248
enum arm_smccc_conduit arm_smccc_1_1_get_conduit(void)
@@ -44,6 +60,16 @@ u32 arm_smccc_get_version(void)
4460
}
4561
EXPORT_SYMBOL_GPL(arm_smccc_get_version);
4662

63+
s32 arm_smccc_get_soc_id_version(void)
64+
{
65+
return smccc_soc_id_version;
66+
}
67+
68+
s32 arm_smccc_get_soc_id_revision(void)
69+
{
70+
return smccc_soc_id_revision;
71+
}
72+
4773
static int __init smccc_devices_init(void)
4874
{
4975
struct platform_device *pdev;

drivers/firmware/smccc/soc_id.c

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -42,41 +42,23 @@ static int __init smccc_soc_init(void)
4242
if (arm_smccc_get_version() < ARM_SMCCC_VERSION_1_2)
4343
return 0;
4444

45-
if (arm_smccc_1_1_get_conduit() == SMCCC_CONDUIT_NONE) {
46-
pr_err("%s: invalid SMCCC conduit\n", __func__);
47-
return -EOPNOTSUPP;
48-
}
49-
50-
arm_smccc_1_1_invoke(ARM_SMCCC_ARCH_FEATURES_FUNC_ID,
51-
ARM_SMCCC_ARCH_SOC_ID, &res);
52-
53-
if ((int)res.a0 == SMCCC_RET_NOT_SUPPORTED) {
45+
soc_id_version = arm_smccc_get_soc_id_version();
46+
if (soc_id_version == SMCCC_RET_NOT_SUPPORTED) {
5447
pr_info("ARCH_SOC_ID not implemented, skipping ....\n");
5548
return 0;
5649
}
5750

58-
if ((int)res.a0 < 0) {
59-
pr_info("ARCH_FEATURES(ARCH_SOC_ID) returned error: %lx\n",
60-
res.a0);
61-
return -EINVAL;
62-
}
63-
64-
arm_smccc_1_1_invoke(ARM_SMCCC_ARCH_SOC_ID, 0, &res);
65-
if ((int)res.a0 < 0) {
51+
if (soc_id_version < 0) {
6652
pr_err("ARCH_SOC_ID(0) returned error: %lx\n", res.a0);
6753
return -EINVAL;
6854
}
6955

70-
soc_id_version = res.a0;
71-
72-
arm_smccc_1_1_invoke(ARM_SMCCC_ARCH_SOC_ID, 1, &res);
73-
if ((int)res.a0 < 0) {
56+
soc_id_rev = arm_smccc_get_soc_id_revision();
57+
if (soc_id_rev < 0) {
7458
pr_err("ARCH_SOC_ID(1) returned error: %lx\n", res.a0);
7559
return -EINVAL;
7660
}
7761

78-
soc_id_rev = res.a0;
79-
8062
soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL);
8163
if (!soc_dev_attr)
8264
return -ENOMEM;

drivers/irqchip/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ config IRQCHIP
77

88
config ARM_GIC
99
bool
10+
depends on OF
1011
select IRQ_DOMAIN_HIERARCHY
1112
select GENERIC_IRQ_EFFECTIVE_AFF_MASK if SMP
1213

@@ -35,6 +36,7 @@ config ARM_GIC_V3
3536
select IRQ_DOMAIN_HIERARCHY
3637
select PARTITION_PERCPU
3738
select GENERIC_IRQ_EFFECTIVE_AFF_MASK if SMP
39+
select HAVE_ARM_SMCCC_DISCOVERY
3840

3941
config ARM_GIC_V3_ITS
4042
bool

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)