Message ID | 20220111005558.549685-6-danielhb413@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | user creatable pnv-phb4 devices | expand |
On 1/11/22 01:55, Daniel Henrique Barboza wrote: > Its only callers are inside pnv_phb4.c. > > Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: Cédric Le Goater <clg@kaod.org> Thanks, C. > --- > hw/pci-host/pnv_phb4.c | 52 +++++++++++++++++----------------- > include/hw/pci-host/pnv_phb4.h | 1 - > 2 files changed, 26 insertions(+), 27 deletions(-) > > diff --git a/hw/pci-host/pnv_phb4.c b/hw/pci-host/pnv_phb4.c > index 10f8d6a919..34c43bd0f5 100644 > --- a/hw/pci-host/pnv_phb4.c > +++ b/hw/pci-host/pnv_phb4.c > @@ -868,6 +868,32 @@ static uint64_t pnv_pec_stk_nest_xscom_read(void *opaque, hwaddr addr, > return stack->nest_regs[reg]; > } > > +static void pnv_phb4_update_regions(PnvPhb4PecStack *stack) > +{ > + PnvPHB4 *phb = stack->phb; > + > + /* Unmap first always */ > + if (memory_region_is_mapped(&phb->mr_regs)) { > + memory_region_del_subregion(&stack->phbbar, &phb->mr_regs); > + } > + if (memory_region_is_mapped(&phb->xsrc.esb_mmio)) { > + memory_region_del_subregion(&stack->intbar, &phb->xsrc.esb_mmio); > + } > + > + /* Map registers if enabled */ > + if (memory_region_is_mapped(&stack->phbbar)) { > + memory_region_add_subregion(&stack->phbbar, 0, &phb->mr_regs); > + } > + > + /* Map ESB if enabled */ > + if (memory_region_is_mapped(&stack->intbar)) { > + memory_region_add_subregion(&stack->intbar, 0, &phb->xsrc.esb_mmio); > + } > + > + /* Check/update m32 */ > + pnv_phb4_check_all_mbt(phb); > +} > + > static void pnv_pec_stk_update_map(PnvPhb4PecStack *stack) > { > PnvPhb4PecState *pec = stack->pec; > @@ -1797,32 +1823,6 @@ static void pnv_phb4_register_types(void) > > type_init(pnv_phb4_register_types); > > -void pnv_phb4_update_regions(PnvPhb4PecStack *stack) > -{ > - PnvPHB4 *phb = stack->phb; > - > - /* Unmap first always */ > - if (memory_region_is_mapped(&phb->mr_regs)) { > - memory_region_del_subregion(&stack->phbbar, &phb->mr_regs); > - } > - if (memory_region_is_mapped(&phb->xsrc.esb_mmio)) { > - memory_region_del_subregion(&stack->intbar, &phb->xsrc.esb_mmio); > - } > - > - /* Map registers if enabled */ > - if (memory_region_is_mapped(&stack->phbbar)) { > - memory_region_add_subregion(&stack->phbbar, 0, &phb->mr_regs); > - } > - > - /* Map ESB if enabled */ > - if (memory_region_is_mapped(&stack->intbar)) { > - memory_region_add_subregion(&stack->intbar, 0, &phb->xsrc.esb_mmio); > - } > - > - /* Check/update m32 */ > - pnv_phb4_check_all_mbt(phb); > -} > - > void pnv_phb4_pic_print_info(PnvPHB4 *phb, Monitor *mon) > { > uint32_t offset = phb->regs[PHB_INT_NOTIFY_INDEX >> 3]; > diff --git a/include/hw/pci-host/pnv_phb4.h b/include/hw/pci-host/pnv_phb4.h > index 82f054cf21..4b7ce8a723 100644 > --- a/include/hw/pci-host/pnv_phb4.h > +++ b/include/hw/pci-host/pnv_phb4.h > @@ -131,7 +131,6 @@ struct PnvPHB4 { > }; > > void pnv_phb4_pic_print_info(PnvPHB4 *phb, Monitor *mon); > -void pnv_phb4_update_regions(PnvPhb4PecStack *stack); > int pnv_phb4_pec_get_phb_id(PnvPhb4PecState *pec, int stack_index); > extern const MemoryRegionOps pnv_phb4_xscom_ops; > >
diff --git a/hw/pci-host/pnv_phb4.c b/hw/pci-host/pnv_phb4.c index 10f8d6a919..34c43bd0f5 100644 --- a/hw/pci-host/pnv_phb4.c +++ b/hw/pci-host/pnv_phb4.c @@ -868,6 +868,32 @@ static uint64_t pnv_pec_stk_nest_xscom_read(void *opaque, hwaddr addr, return stack->nest_regs[reg]; } +static void pnv_phb4_update_regions(PnvPhb4PecStack *stack) +{ + PnvPHB4 *phb = stack->phb; + + /* Unmap first always */ + if (memory_region_is_mapped(&phb->mr_regs)) { + memory_region_del_subregion(&stack->phbbar, &phb->mr_regs); + } + if (memory_region_is_mapped(&phb->xsrc.esb_mmio)) { + memory_region_del_subregion(&stack->intbar, &phb->xsrc.esb_mmio); + } + + /* Map registers if enabled */ + if (memory_region_is_mapped(&stack->phbbar)) { + memory_region_add_subregion(&stack->phbbar, 0, &phb->mr_regs); + } + + /* Map ESB if enabled */ + if (memory_region_is_mapped(&stack->intbar)) { + memory_region_add_subregion(&stack->intbar, 0, &phb->xsrc.esb_mmio); + } + + /* Check/update m32 */ + pnv_phb4_check_all_mbt(phb); +} + static void pnv_pec_stk_update_map(PnvPhb4PecStack *stack) { PnvPhb4PecState *pec = stack->pec; @@ -1797,32 +1823,6 @@ static void pnv_phb4_register_types(void) type_init(pnv_phb4_register_types); -void pnv_phb4_update_regions(PnvPhb4PecStack *stack) -{ - PnvPHB4 *phb = stack->phb; - - /* Unmap first always */ - if (memory_region_is_mapped(&phb->mr_regs)) { - memory_region_del_subregion(&stack->phbbar, &phb->mr_regs); - } - if (memory_region_is_mapped(&phb->xsrc.esb_mmio)) { - memory_region_del_subregion(&stack->intbar, &phb->xsrc.esb_mmio); - } - - /* Map registers if enabled */ - if (memory_region_is_mapped(&stack->phbbar)) { - memory_region_add_subregion(&stack->phbbar, 0, &phb->mr_regs); - } - - /* Map ESB if enabled */ - if (memory_region_is_mapped(&stack->intbar)) { - memory_region_add_subregion(&stack->intbar, 0, &phb->xsrc.esb_mmio); - } - - /* Check/update m32 */ - pnv_phb4_check_all_mbt(phb); -} - void pnv_phb4_pic_print_info(PnvPHB4 *phb, Monitor *mon) { uint32_t offset = phb->regs[PHB_INT_NOTIFY_INDEX >> 3]; diff --git a/include/hw/pci-host/pnv_phb4.h b/include/hw/pci-host/pnv_phb4.h index 82f054cf21..4b7ce8a723 100644 --- a/include/hw/pci-host/pnv_phb4.h +++ b/include/hw/pci-host/pnv_phb4.h @@ -131,7 +131,6 @@ struct PnvPHB4 { }; void pnv_phb4_pic_print_info(PnvPHB4 *phb, Monitor *mon); -void pnv_phb4_update_regions(PnvPhb4PecStack *stack); int pnv_phb4_pec_get_phb_id(PnvPhb4PecState *pec, int stack_index); extern const MemoryRegionOps pnv_phb4_xscom_ops;
Its only callers are inside pnv_phb4.c. Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- hw/pci-host/pnv_phb4.c | 52 +++++++++++++++++----------------- include/hw/pci-host/pnv_phb4.h | 1 - 2 files changed, 26 insertions(+), 27 deletions(-)