diff options
author | Michael Ellerman <mpe@ellerman.id.au> | 2017-06-08 22:54:18 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-06-14 17:25:25 +1000 |
commit | 8f997dcf36679e7d3d2b194352868212d9be32d3 (patch) | |
tree | 0f4ebd70afe7fa11708273494840af3362621b21 /core/chip.c | |
parent | cbccfaf929264c84dc021e456844eca9446677e7 (diff) | |
download | skiboot-8f997dcf36679e7d3d2b194352868212d9be32d3.zip skiboot-8f997dcf36679e7d3d2b194352868212d9be32d3.tar.gz skiboot-8f997dcf36679e7d3d2b194352868212d9be32d3.tar.bz2 |
chip: Add support for discovering chips on mambo
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@ellerman.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core/chip.c')
-rw-r--r-- | core/chip.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/core/chip.c b/core/chip.c index 3550804..c18ac49 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 |