1 #ifndef SPARC32_DMA_H 2 #define SPARC32_DMA_H 3 4 #include "hw/sysbus.h" 5 #include "hw/scsi/esp.h" 6 #include "hw/net/lance.h" 7 #include "qom/object.h" 8 9 #define DMA_REGS 4 10 11 #define TYPE_SPARC32_DMA_DEVICE "sparc32-dma-device" 12 typedef struct DMADeviceState DMADeviceState; 13 DECLARE_INSTANCE_CHECKER(DMADeviceState, SPARC32_DMA_DEVICE, 14 TYPE_SPARC32_DMA_DEVICE) 15 16 17 struct DMADeviceState { 18 SysBusDevice parent_obj; 19 20 MemoryRegion iomem; 21 uint32_t dmaregs[DMA_REGS]; 22 qemu_irq irq; 23 void *iommu; 24 qemu_irq gpio[2]; 25 }; 26 27 #define TYPE_SPARC32_ESPDMA_DEVICE "sparc32-espdma" 28 typedef struct ESPDMADeviceState ESPDMADeviceState; 29 DECLARE_INSTANCE_CHECKER(ESPDMADeviceState, SPARC32_ESPDMA_DEVICE, 30 TYPE_SPARC32_ESPDMA_DEVICE) 31 32 struct ESPDMADeviceState { 33 DMADeviceState parent_obj; 34 35 SysBusESPState *esp; 36 }; 37 38 #define TYPE_SPARC32_LEDMA_DEVICE "sparc32-ledma" 39 typedef struct LEDMADeviceState LEDMADeviceState; 40 DECLARE_INSTANCE_CHECKER(LEDMADeviceState, SPARC32_LEDMA_DEVICE, 41 TYPE_SPARC32_LEDMA_DEVICE) 42 43 struct LEDMADeviceState { 44 DMADeviceState parent_obj; 45 46 SysBusPCNetState *lance; 47 }; 48 49 #define TYPE_SPARC32_DMA "sparc32-dma" 50 typedef struct SPARC32DMAState SPARC32DMAState; 51 DECLARE_INSTANCE_CHECKER(SPARC32DMAState, SPARC32_DMA, 52 TYPE_SPARC32_DMA) 53 54 struct SPARC32DMAState { 55 SysBusDevice parent_obj; 56 57 MemoryRegion dmamem; 58 MemoryRegion ledma_alias; 59 ESPDMADeviceState *espdma; 60 LEDMADeviceState *ledma; 61 }; 62 63 /* sparc32_dma.c */ 64 void ledma_memory_read(void *opaque, hwaddr addr, 65 uint8_t *buf, int len, int do_bswap); 66 void ledma_memory_write(void *opaque, hwaddr addr, 67 uint8_t *buf, int len, int do_bswap); 68 void espdma_memory_read(void *opaque, uint8_t *buf, int len); 69 void espdma_memory_write(void *opaque, uint8_t *buf, int len); 70 71 #endif 72