Skip to content

Commit 2d81e1b

Browse files
digetxKAGA-KOKO
authored andcommitted
irqchip/gic-v3: Add Rockchip 3568002 erratum workaround
Rockchip RK3566/RK3568 GIC600 integration has DDR addressing limited to the first 32bit of physical address space. Rockchip assigned Erratum ID #3568002 for this issue. Add driver quirk for this Rockchip GIC Erratum. Note, that the 0x0201743b GIC600 ID is not Rockchip-specific and is common for many ARM GICv3 implementations. Hence, there is an extra of_machine_is_compatible() check. Signed-off-by: Dmitry Osipenko <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/all/[email protected]
1 parent 896f8e4 commit 2d81e1b

File tree

3 files changed

+33
-1
lines changed

3 files changed

+33
-1
lines changed

Documentation/arch/arm64/silicon-errata.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,8 @@ stable kernels.
284284
+----------------+-----------------+-----------------+-----------------------------+
285285
| Rockchip | RK3588 | #3588001 | ROCKCHIP_ERRATUM_3588001 |
286286
+----------------+-----------------+-----------------+-----------------------------+
287+
| Rockchip | RK3568 | #3568002 | ROCKCHIP_ERRATUM_3568002 |
288+
+----------------+-----------------+-----------------+-----------------------------+
287289
+----------------+-----------------+-----------------+-----------------------------+
288290
| Fujitsu | A64FX | E#010001 | FUJITSU_ERRATUM_010001 |
289291
+----------------+-----------------+-----------------+-----------------------------+

arch/arm64/Kconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1303,6 +1303,15 @@ config NVIDIA_CARMEL_CNP_ERRATUM
13031303

13041304
If unsure, say Y.
13051305

1306+
config ROCKCHIP_ERRATUM_3568002
1307+
bool "Rockchip 3568002: GIC600 can not access physical addresses higher than 4GB"
1308+
default y
1309+
help
1310+
The Rockchip RK3566 and RK3568 GIC600 SoC integrations have AXI
1311+
addressing limited to the first 32bit of physical address space.
1312+
1313+
If unsure, say Y.
1314+
13061315
config ROCKCHIP_ERRATUM_3588001
13071316
bool "Rockchip 3588001: GIC600 can not support shareability attributes"
13081317
default y

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

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,13 +205,15 @@ static DEFINE_IDA(its_vpeid_ida);
205205
#define gic_data_rdist_rd_base() (gic_data_rdist()->rd_base)
206206
#define gic_data_rdist_vlpi_base() (gic_data_rdist_rd_base() + SZ_128K)
207207

208+
static gfp_t gfp_flags_quirk;
209+
208210
static struct page *its_alloc_pages_node(int node, gfp_t gfp,
209211
unsigned int order)
210212
{
211213
struct page *page;
212214
int ret = 0;
213215

214-
page = alloc_pages_node(node, gfp, order);
216+
page = alloc_pages_node(node, gfp | gfp_flags_quirk, order);
215217

216218
if (!page)
217219
return NULL;
@@ -4887,6 +4889,17 @@ static bool __maybe_unused its_enable_quirk_hip09_162100801(void *data)
48874889
return true;
48884890
}
48894891

4892+
static bool __maybe_unused its_enable_rk3568002(void *data)
4893+
{
4894+
if (!of_machine_is_compatible("rockchip,rk3566") &&
4895+
!of_machine_is_compatible("rockchip,rk3568"))
4896+
return false;
4897+
4898+
gfp_flags_quirk |= GFP_DMA32;
4899+
4900+
return true;
4901+
}
4902+
48904903
static const struct gic_quirk its_quirks[] = {
48914904
#ifdef CONFIG_CAVIUM_ERRATUM_22375
48924905
{
@@ -4954,6 +4967,14 @@ static const struct gic_quirk its_quirks[] = {
49544967
.property = "dma-noncoherent",
49554968
.init = its_set_non_coherent,
49564969
},
4970+
#ifdef CONFIG_ROCKCHIP_ERRATUM_3568002
4971+
{
4972+
.desc = "ITS: Rockchip erratum RK3568002",
4973+
.iidr = 0x0201743b,
4974+
.mask = 0xffffffff,
4975+
.init = its_enable_rk3568002,
4976+
},
4977+
#endif
49574978
{
49584979
}
49594980
};

0 commit comments

Comments
 (0)