ppc/pnv: Compute the PHB index from the PHB4 PEC model
commitaa8cc84d88945088e4588aeaa31573fb4ed3b27a
authorCédric Le Goater <clg@kaod.org>
Fri, 17 Dec 2021 16:57:19 +0000 (17 17:57 +0100)
committerCédric Le Goater <clg@kaod.org>
Fri, 17 Dec 2021 16:57:19 +0000 (17 17:57 +0100)
tree710d4901bf8de76b88f650ba09ca37ae9d70c2a6
parentcf0ee6955cc2f7f256e44c4f8198f69aae6ea39c
ppc/pnv: Compute the PHB index from the PHB4 PEC model

Use the num_stacks class attribute to compute the PHB index depending
on the PEC index :

  * PEC0 provides 1 PHB  (PHB0)
  * PEC1 provides 2 PHBs (PHB1 and PHB2)
  * PEC2 provides 3 PHBs (PHB3, PHB4 and PHB5)

The routine pnv_pec_phb_offset() is a bit complex but it also prepares
ground for PHB5 which has a different layout of stacks: 3 per PECs.

Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20211213132830.108372-12-clg@kaod.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
hw/pci-host/pnv_phb4_pec.c
hw/ppc/pnv.c