From f0f36bcaeb9f3cb1c208273553377615c1c5928b Mon Sep 17 00:00:00 2001 From: kettenis Date: Fri, 10 Jul 2020 14:35:01 +0000 Subject: Use OPAL_REINIT_CPUS calls during early boot to set endianness and to set the MMU to hash mode such that the full TLB is available on POWER9 CPUs. --- sys/arch/powerpc64/powerpc64/machdep.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sys/arch/powerpc64/powerpc64/machdep.c b/sys/arch/powerpc64/powerpc64/machdep.c index a8d5406f46d..0ccbd0eb3ff 100644 --- a/sys/arch/powerpc64/powerpc64/machdep.c +++ b/sys/arch/powerpc64/powerpc64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.46 2020/07/08 17:48:28 kettenis Exp $ */ +/* $OpenBSD: machdep.c,v 1.47 2020/07/10 14:35:01 kettenis Exp $ */ /* * Copyright (c) 2020 Mark Kettenis @@ -125,6 +125,16 @@ init_powernv(void *fdt, void *tocbase) fdt_node_property(node, "opal-entry-address", &prop); opal_entry = bemtoh64((uint64_t *)prop); fdt_node_property(node, "compatible", &prop); + + opal_reinit_cpus(OPAL_REINIT_CPUS_HILE_BE); + + /* + * The following call will fail on Power ISA 2.0x CPUs, + * but that is fine since they don't support Radix Tree + * translation. On Power ISA 3.0 CPUs this will make + * the full TLB available. + */ + opal_reinit_cpus(OPAL_REINIT_CPUS_MMU_HASH); } /* At this point we can call OPAL runtime services and use printf(9). */ -- cgit v1.2.3-59-g8ed1b