From a6816a42c1f40481c998177b2b88329984ed25b2 Mon Sep 17 00:00:00 2001 From: Stewart Smith Date: Mon, 20 Dec 2021 22:22:46 +1000 Subject: Add CONFIG_P8 with PHB3 behind it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We can use a base CPU of POWER9 if we don't have P8. We can also hide PHB3 code behind this, and shave 12kb off skiboot.lid.xz Reviewed-by: Dan Horák [npiggin: add cpp define, fail gracefully on P8] Signed-off-by: Stewart Smith Signed-off-by: Cédric Le Goater --- core/cpu.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'core') diff --git a/core/cpu.c b/core/cpu.c index 6756ab1..f0be580 100644 --- a/core/cpu.c +++ b/core/cpu.c @@ -1066,9 +1066,16 @@ void init_boot_cpu(void) cpu_thread_count = 1; } - if (proc_gen == proc_gen_p8 && (PVR_VERS_MAJ(mfspr(SPR_PVR)) == 1)) { - prerror("CPU: POWER8 DD1 is not supported\n"); + if (proc_gen == proc_gen_p8) { +#ifdef CONFIG_P8 + if (PVR_VERS_MAJ(mfspr(SPR_PVR)) == 1) { + prerror("CPU: POWER8 DD1 is not supported\n"); + abort(); + } +#else + prerror("CPU: POWER8 detected but CONFIG_P8 not set\n"); abort(); +#endif } if (is_power9n(pvr) && (PVR_VERS_MAJ(pvr) == 1)) { -- cgit v1.1