diff options
author | Patrick Wildt <patrick@cvs.openbsd.org> | 2024-06-19 22:10:46 +0000 |
---|---|---|
committer | Patrick Wildt <patrick@cvs.openbsd.org> | 2024-06-19 22:10:46 +0000 |
commit | 742d318c40f8408b5a9ce5cff1b005e5be8bb987 (patch) | |
tree | 5c0cc273a9b84477a52e26b1dccca427c2f6ab40 /sys/arch/arm64 | |
parent | 921e1dfbcfa2137ad399f83712d0361d82cb192c (diff) |
The GICv3 redistributor spacing on the X1E80100 (Snapdragon X Elite)
does not follow the regular scheme and needs to be read out of the
redistributor-stride property.
ok kettenis@
Diffstat (limited to 'sys/arch/arm64')
-rw-r--r-- | sys/arch/arm64/dev/agintc.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/sys/arch/arm64/dev/agintc.c b/sys/arch/arm64/dev/agintc.c index fbd2ec77d9d..e0fe1de31fb 100644 --- a/sys/arch/arm64/dev/agintc.c +++ b/sys/arch/arm64/dev/agintc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: agintc.c,v 1.56 2024/05/13 01:15:50 jsg Exp $ */ +/* $OpenBSD: agintc.c,v 1.57 2024/06/19 22:10:45 patrick Exp $ */ /* * Copyright (c) 2007, 2009, 2011, 2017 Dale Rahn <drahn@dalerahn.com> * Copyright (c) 2018 Mark Kettenis <kettenis@openbsd.org> @@ -312,6 +312,7 @@ agintc_attach(struct device *parent, struct device *self, void *aux) uint32_t pmr, oldpmr; uint32_t ctrl, bits; uint32_t affinity; + uint64_t redist_stride; int i, nbits, nintr; int offset, nredist; #ifdef MULTIPROCESSOR @@ -434,15 +435,20 @@ agintc_attach(struct device *parent, struct device *self, void *aux) /* find the redistributors. */ offset = 0; + redist_stride = OF_getpropint64(faa->fa_node, "redistributor-stride", 0); for (nredist = 0; ; nredist++) { - int32_t sz = (64 * 1024 * 2); uint64_t typer; + int32_t sz; typer = bus_space_read_8(sc->sc_iot, sc->sc_redist_base, offset + GICR_TYPER); - if (typer & GICR_TYPER_VLPIS) - sz += (64 * 1024 * 2); + if (redist_stride == 0) { + sz = (64 * 1024 * 2); + if (typer & GICR_TYPER_VLPIS) + sz += (64 * 1024 * 2); + } else + sz = redist_stride; #ifdef DEBUG_AGINTC printf("probing redistributor %d %x\n", nredist, offset); @@ -466,14 +472,18 @@ agintc_attach(struct device *parent, struct device *self, void *aux) /* submap and configure the redistributors. */ offset = 0; for (nredist = 0; nredist < sc->sc_num_redist; nredist++) { - int32_t sz = (64 * 1024 * 2); uint64_t typer; + int32_t sz; typer = bus_space_read_8(sc->sc_iot, sc->sc_redist_base, offset + GICR_TYPER); - if (typer & GICR_TYPER_VLPIS) - sz += (64 * 1024 * 2); + if (redist_stride == 0) { + sz = (64 * 1024 * 2); + if (typer & GICR_TYPER_VLPIS) + sz += (64 * 1024 * 2); + } else + sz = redist_stride; affinity = bus_space_read_8(sc->sc_iot, sc->sc_redist_base, offset + GICR_TYPER) >> 32; |