mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 10:13:56 -06:00
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>
This commit is contained in:
parent
d8c6d07fdf
commit
95ed3b7cf1
5 changed files with 103 additions and 42 deletions
23
hw/ppc/mac.h
23
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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue