[Skiboot] [PATCH 4/5] core: Move enable_mambo_console() into chip initialisation

Michael Ellerman mpe at ellerman.id.au
Thu Jun 8 22:54:20 AEST 2017


Rather than having a wart in main_cpu_entry() that initialises the mambo
console, we can move it into init_chips() which is where we discover that we're
on mambo.

This also means we don't need to check the quirk again, and has the added bonus
that an assert in chip initialisation (which follows immediately) will actually
produce output.

Signed-off-by: Michael Ellerman <mpe at ellerman.id.au>
---
 core/chip.c | 4 ++++
 core/init.c | 6 ------
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/core/chip.c b/core/chip.c
index c18ac4971473..e06a9bcb137b 100644
--- a/core/chip.c
+++ b/core/chip.c
@@ -17,6 +17,7 @@
 
 #include <skiboot.h>
 #include <chip.h>
+#include <console.h>
 #include <device.h>
 #include <timebase.h>
 
@@ -108,6 +109,9 @@ void init_chips(void)
 		proc_chip_quirks |= QUIRK_NO_CHIPTOD | QUIRK_MAMBO_CALLOUTS
 			| QUIRK_NO_F000F | QUIRK_NO_PBA | QUIRK_NO_OCC_IRQ
 			| QUIRK_NO_DIRECT_CTL | QUIRK_NO_RNG;
+
+		enable_mambo_console();
+
 		prlog(PR_NOTICE, "CHIP: Detected Mambo simulator\n");
 
 		dt_for_each_compatible(dt_root, xn, "ibm,mambo-chip")
diff --git a/core/init.c b/core/init.c
index 42b713b09e59..a5a0f1095225 100644
--- a/core/init.c
+++ b/core/init.c
@@ -870,12 +870,6 @@ void __noreturn __nomcount main_cpu_entry(const void *fdt)
 	 */
 	init_chips();
 
-	/* If we detect the mambo simulator, we can enable its special console
-	 * early on. Do that now.
-	 */
-	if (chip_quirk(QUIRK_MAMBO_CALLOUTS))
-		enable_mambo_console();
-
 	xscom_init();
 	mfsi_init();
 
-- 
2.7.4



More information about the Skiboot mailing list