Skip to content

Commit 5e46a48

Browse files
author
Marc Zyngier
committed
irqchip/gic-v4.1: Map the ITS SGIR register page
One of the new features of GICv4.1 is to allow virtual SGIs to be directly signaled to a VPE. For that, the ITS has grown a new 64kB page containing only a single register that is used to signal a SGI to a given VPE. Add a second mapping covering this new 64kB range, and take this opportunity to limit the original mapping to 64kB, which is enough to cover the span of the ITS registers. Signed-off-by: Marc Zyngier <[email protected]> Reviewed-by: Zenghui Yu <[email protected]> Reviewed-by: Eric Auger <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 3c40706 commit 5e46a48

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

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

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ struct its_node {
9696
struct mutex dev_alloc_lock;
9797
struct list_head entry;
9898
void __iomem *base;
99+
void __iomem *sgir_base;
99100
phys_addr_t phys_base;
100101
struct its_cmd_block *cmd_base;
101102
struct its_cmd_block *cmd_write;
@@ -4456,7 +4457,7 @@ static int __init its_probe_one(struct resource *res,
44564457
struct page *page;
44574458
int err;
44584459

4459-
its_base = ioremap(res->start, resource_size(res));
4460+
its_base = ioremap(res->start, SZ_64K);
44604461
if (!its_base) {
44614462
pr_warn("ITS@%pa: Unable to map ITS registers\n", &res->start);
44624463
return -ENOMEM;
@@ -4507,6 +4508,13 @@ static int __init its_probe_one(struct resource *res,
45074508

45084509
if (is_v4_1(its)) {
45094510
u32 svpet = FIELD_GET(GITS_TYPER_SVPET, typer);
4511+
4512+
its->sgir_base = ioremap(res->start + SZ_128K, SZ_64K);
4513+
if (!its->sgir_base) {
4514+
err = -ENOMEM;
4515+
goto out_free_its;
4516+
}
4517+
45104518
its->mpidr = readl_relaxed(its_base + GITS_MPIDR);
45114519

45124520
pr_info("ITS@%pa: Using GICv4.1 mode %08x %08x\n",
@@ -4520,7 +4528,7 @@ static int __init its_probe_one(struct resource *res,
45204528
get_order(ITS_CMD_QUEUE_SZ));
45214529
if (!page) {
45224530
err = -ENOMEM;
4523-
goto out_free_its;
4531+
goto out_unmap_sgir;
45244532
}
45254533
its->cmd_base = (void *)page_address(page);
45264534
its->cmd_write = its->cmd_base;
@@ -4587,6 +4595,9 @@ static int __init its_probe_one(struct resource *res,
45874595
its_free_tables(its);
45884596
out_free_cmd:
45894597
free_pages((unsigned long)its->cmd_base, get_order(ITS_CMD_QUEUE_SZ));
4598+
out_unmap_sgir:
4599+
if (its->sgir_base)
4600+
iounmap(its->sgir_base);
45904601
out_free_its:
45914602
kfree(its);
45924603
out_unmap:

0 commit comments

Comments
 (0)