diff options
author | Andreas Färber <afaerber@suse.de> | 2013-01-23 23:04:00 +0000 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2013-01-25 22:02:54 +0100 |
commit | 95ed3b7cf1677dc9f995a6e1fcc7bf377cf94a0e (patch) | |
tree | 6bd33b1eceaa32b1559d7502028aab68d3f3e226 /hw/ppc/mac.h | |
parent | d8c6d07fdff2523ca78f95c7d8a7fe90ee7ea5a7 (diff) |
mac_nvram: QOM'ify MacIO NVRAM
It was not qdev'ified before. Turn it into a SysBusDevice and
initialize it via static properties.
Prepare Old World specific MacIO state and embed the NVRAM state there.
Drop macio_nvram_setup_bar() in favor of sysbus_mmio_map() or
direct use of Memory API.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'hw/ppc/mac.h')
-rw-r--r-- | hw/ppc/mac.h | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/hw/ppc/mac.h b/hw/ppc/mac.h index 6441794600..581e95cf7c 100644 --- a/hw/ppc/mac.h +++ b/hw/ppc/mac.h @@ -26,6 +26,7 @@ #define __PPC_MAC_H__ #include "exec/memory.h" +#include "hw/sysbus.h" /* SMP is not enabled, for now */ #define MAX_CPUS 1 @@ -49,7 +50,7 @@ void cuda_init (MemoryRegion **cuda_mem, qemu_irq irq); #define TYPE_NEWWORLD_MACIO "macio-newworld" void macio_init(PCIDevice *dev, MemoryRegion *pic_mem, MemoryRegion *dbdma_mem, - MemoryRegion *cuda_mem, void *nvram, + MemoryRegion *cuda_mem, int nb_ide, MemoryRegion **ide_mem, MemoryRegion *escc_mem); /* Heathrow PIC */ @@ -71,12 +72,22 @@ PCIBus *pci_pmac_u3_init(qemu_irq *pic, MemoryRegion *address_space_io); /* Mac NVRAM */ -typedef struct MacIONVRAMState MacIONVRAMState; +#define TYPE_MACIO_NVRAM "macio-nvram" +#define MACIO_NVRAM(obj) \ + OBJECT_CHECK(MacIONVRAMState, (obj), TYPE_MACIO_NVRAM) + +typedef struct MacIONVRAMState { + /*< private >*/ + SysBusDevice parent_obj; + /*< public >*/ + + uint32_t size; + uint32_t it_shift; + + MemoryRegion mem; + uint8_t *data; +} MacIONVRAMState; -MacIONVRAMState *macio_nvram_init (hwaddr size, - unsigned int it_shift); -void macio_nvram_setup_bar(MacIONVRAMState *s, MemoryRegion *bar, - hwaddr mem_base); void pmac_format_nvram_partition (MacIONVRAMState *nvr, int len); uint8_t macio_nvram_read(MacIONVRAMState *s, uint32_t addr); void macio_nvram_write(MacIONVRAMState *s, uint32_t addr, uint8_t val); |