ppc/pnv: turn chip8->phbs[] into a PnvPHB* array
commit0d512c7120a2638da242436d45bd8a82ffffe27a
authorDaniel Henrique Barboza <danielhb413@gmail.com>
Thu, 11 Aug 2022 16:39:44 +0000 (11 13:39 -0300)
committerDaniel Henrique Barboza <danielhb413@gmail.com>
Wed, 31 Aug 2022 17:08:06 +0000 (31 14:08 -0300)
tree69f4f218e1e4bd7fb880c3da32dffb2c2d8f22f1
parentba47c3a4f888e99dedde1fed740927e973f9bc32
ppc/pnv: turn chip8->phbs[] into a PnvPHB* array

When enabling user created PHBs (a change reverted by commit 9c10d86fee)
we were handling PHBs created by default versus by the user in different
manners. The only difference between these PHBs is that one will have a
valid phb3->chip that is assigned during pnv_chip_power8_realize(),
while the user created needs to search which chip it belongs to.

Aside from that there shouldn't be any difference. Making the default
PHBs behave in line with the user created ones will make it easier to
re-introduce them later on. It will also make the code easier to follow
since we are dealing with them in equal manner.

The first step is to turn chip8->phbs[] into a PnvPHB3 pointer array.
This will allow us to assign user created PHBs into it later on. The way
we initilize the default case is now more in line with that would happen
with the user created case: the object is created, parented by the chip
because pnv_xscom_dt() relies on it, and then assigned to the array.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Frederic Barrat <fbarrat@linux.ibm.com>
Message-Id: <20220811163950.578927-6-danielhb413@gmail.com>
hw/ppc/pnv.c
include/hw/ppc/pnv.h