Re: [PATCH v4 3/4] irqchip: GIC: Convert to EOImode == 1

From: Marc Zyngier
Date: Thu Sep 10 2015 - 05:54:38 EST


Hi Julian,

On 09/09/15 20:23, Julien Grall wrote:
> Hi,
>
> I've been trying the latest linus/master (a794b4f), which include this
> patch, as baremetal kernel on X-gene. This is failing on early boot
> without much log.
>
> After bisecting the tree, I found the error coming from this patch.
> While this patch is valid, it made me remembered that X-Gene (at least
> the first version) as an odd GICv2.
>
> The GICC is divided in 2 area of 4K, each one aligned at a 64KB address.
> This means that, the address of GICC_DIR won't be 0x1000 but 0x10000.

Not really. I already mentioned that one a while ago:

http://lists.infradead.org/pipermail/linux-arm-kernel/2015-March/332249.html

The first page of GIC is aliased over the first 64kB, and the second
page aliased over the second 64kB. So you get a consistent mapping if
you use (base + 0xF000) to address GICC. Also, the DT that's in
mainline is showing a 4kB CPU interface, which doesn't enable
EOImode==1. You must be using a firmware that's newer than mine, since
I'm perfectly able to boot my Mustang with these patches.

> We had the same issue on Xen when we did the first port of X-gene [1].
> Although, we choose to add a quirk in Xen for this platform in order to
> map contiguously in the virtual memory the 2 part of GICC.
>
> Note that, back then, Ian suggested to extend the bindings to support a
> such platform [2]. AFAICT, there was no follow-up on it.

The main problem here is not to update the binding, but the fact that
you *cannot* update the DT on x-gene (the firmware will replace your
GIC node with what it thinks it is), and the APM guys can't be bothered
to fix their stuff.

In the meantime, can you give the following patch a shot? My Mustang is
wired to a 4kB CPU interface, so I'll need your help to test it.

Thanks,

M.