[PATCH 12/18] arm64: setup: Use nGnRnE IO mappings for fixmap on Apple platforms

Arnd Bergmann arnd at kernel.org
Thu Feb 4 17:25:56 EST 2021


On Thu, Feb 4, 2021 at 9:39 PM Hector Martin <marcan at marcan.st> wrote:
>
> This is a hack. I do not expect this to be merged as-is.
>
> The problem: on Apple ARM platforms, SoC MMIO needs to use nGnRnE
> mappings: writes using nGnRE are blackholed. This seems to be by design,
> and there doesn't seem to be any fabric configuration or other bit we
> can flip to make the problem go away.
>
> Particularly tricky is that this affects earlycon, which uses fixmap,
> which all gets initialized before any of the usual cpufeatures /
> alternatives stuff. So we need to take care of fixmap very early.
>
> Options I can think of:
>
> (1) Unconditionally use nGnRnE on all platforms for fixmap IO. Maybe
>     this is actually fine? I suspect it might break some PCI-based
>     earlycons?
>
> (2) Deal with this special case in the earlycon code, since that seems
>     to be the only user that matters on these platforms. Since the
>     IO mapping is done in earlycon.c, this will require some cooperation
>     with samsung_tty.c so earlycon knows when it needs to do this. Note
>     that doing it with DT properties will break cmdline-only earlycon
>     config (which otherwise works fine on this driver).
>
> (3) This patch, but do something saner, like use a specific DT flag to
>     trigger this mode instead of a platform match.
>
> Any other ideas?

I think we should decide the approach for the normal ioremap()
path first. Once we have solved that, there is likely an obvious
answer for this one as well.

My feeling is that we'll end up with (2).

        Arnd



More information about the linux-arm-kernel mailing list