[Skiboot] [PATCH 2/5] chip: Add support for discovering chips on mambo

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


Currently the only way for skiboot to discover chips is by looking for xscom
nodes. But on mambo it's currently not possible to create multiple xscom nodes,
which means we can only simulate a single chip system.

However it seems we can fairly cleanly add support for a special mambo chip
node, and use that to instantiate multiple chips.

Add a check in init_chip() that we're not clobbering an already initialised
chip, now that we have two places that initialise chips.

Signed-off-by: Michael Ellerman <mpe at ellerman.id.au>
---
 core/chip.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/core/chip.c b/core/chip.c
index 3550804383dc..c18ac4971473 100644
--- a/core/chip.c
+++ b/core/chip.c
@@ -78,6 +78,7 @@ static void init_chip(struct dt_node *dn)
 
 	id = dt_get_chip_id(dn);
 	assert(id < MAX_CHIPS);
+	assert(chips[id] == NULL);
 
 	chip = zalloc(sizeof(struct proc_chip));
 	assert(chip);
@@ -108,7 +109,11 @@ void init_chips(void)
 			| QUIRK_NO_F000F | QUIRK_NO_PBA | QUIRK_NO_OCC_IRQ
 			| QUIRK_NO_DIRECT_CTL | QUIRK_NO_RNG;
 		prlog(PR_NOTICE, "CHIP: Detected Mambo simulator\n");
+
+		dt_for_each_compatible(dt_root, xn, "ibm,mambo-chip")
+			init_chip(xn);
 	}
+
 	/* Detect simics */
 	if (dt_find_by_path(dt_root, "/simics")) {
 		proc_chip_quirks |= QUIRK_SIMICS
-- 
2.7.4



More information about the Skiboot mailing list