ppc/pnv: reduce stack->stack_no usage
commit6f506c90c3e1814a4a7df5be8d08782c06226820
authorDaniel Henrique Barboza <danielhb413@gmail.com>
Tue, 18 Jan 2022 11:56:31 +0000 (18 12:56 +0100)
committerCédric Le Goater <clg@kaod.org>
Tue, 18 Jan 2022 11:56:31 +0000 (18 12:56 +0100)
tree77f1b82b39ed945e9b826e890517eab8b4572280
parentd2704eb3fd5093224fb14ecbfdc916d42d42416b
ppc/pnv: reduce stack->stack_no usage

'stack->stack_no' represents the order that a stack appears in its PEC.
Its primary use is in XSCOM address space calculation in
pnv_phb4_xscom_realize() when calculating the memory region offset.

This attribute is redundant with phb->phb_id, which is calculated via
pnv_phb4_pec_get_phb_id() using stack->stack_no information. It'll also
be awkward to assign it when dealing with PECs and PHBs only in a future
patch.

A new pnv_phb4_get_phb_stack_no() helper is introduced to eliminate most
of the stack->stack_no uses we have. The only use left after this patch
is during pnv_pec_stk_default_phb_realize() when calculating phb_id,
which will also handled in the next patches.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20220114180719.52117-3-danielhb413@gmail.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
hw/pci-host/pnv_phb4.c