Skip to content

Commit

Permalink
core: Move enable_mambo_console() into chip initialisation
Browse files Browse the repository at this point in the history
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@ellerman.id.au>
[stewart@linux.vnet.ibm.com: fix make check by adding no-op stub]
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
  • Loading branch information
mpe authored and stewartsmith committed Jun 15, 2017
1 parent 385a690 commit 223c49e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 4 additions & 0 deletions core/chip.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#include <skiboot.h>
#include <chip.h>
#include <console.h>
#include <device.h>
#include <timebase.h>

Expand Down Expand Up @@ -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")
Expand Down
6 changes: 0 additions & 6 deletions core/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -869,12 +869,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();

Expand Down
1 change: 1 addition & 0 deletions hdata/test/stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,5 @@ NOOP_STUB(early_uart_init);
NOOP_STUB(mem_reserve_fw);
NOOP_STUB(mem_reserve_hwbuf);
NOOP_STUB(add_chip_dev_associativity);
NOOP_STUB(enable_mambo_console);

0 comments on commit 223c49e

Please sign in to comment.