apb: remove pci_apb_init() and instantiate APB device using qdev

By making the special_base and mem_base values qdev properties, we can move
the remaining parts of pci_apb_init() into the pbm init() and realize()
functions.

This finally allows us to instantiate the APB directly using standard qdev
create/init functions in sun4u.c.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Artyom Tarasenko <atar4qemu@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
This commit is contained in:
Mark Cave-Ayland 2017-12-21 07:32:57 +00:00
parent 4272ad4018
commit cacd05805e
3 changed files with 69 additions and 67 deletions

View file

@ -62,6 +62,8 @@ typedef struct IOMMUState {
typedef struct APBState {
PCIHostState parent_obj;
hwaddr special_base;
hwaddr mem_base;
MemoryRegion apb_config;
MemoryRegion pci_config;
MemoryRegion pci_mmio;
@ -93,6 +95,4 @@ typedef struct PBMPCIBridge {
#define PBM_PCI_BRIDGE(obj) \
OBJECT_CHECK(PBMPCIBridge, (obj), TYPE_PBM_PCI_BRIDGE)
APBState *pci_apb_init(hwaddr special_base,
hwaddr mem_base);
#endif