2007-11-17 18:14:51 +01:00
|
|
|
#ifndef SPARC32_DMA_H
|
|
|
|
#define SPARC32_DMA_H
|
|
|
|
|
2017-10-14 14:22:21 +02:00
|
|
|
#include "hw/sysbus.h"
|
2017-10-14 14:22:22 +02:00
|
|
|
#include "hw/scsi/esp.h"
|
2017-10-14 14:22:22 +02:00
|
|
|
#include "hw/net/lance.h"
|
2017-10-14 14:22:21 +02:00
|
|
|
|
|
|
|
#define DMA_REGS 4
|
|
|
|
|
|
|
|
#define TYPE_SPARC32_DMA_DEVICE "sparc32-dma-device"
|
|
|
|
#define SPARC32_DMA_DEVICE(obj) OBJECT_CHECK(DMADeviceState, (obj), \
|
|
|
|
TYPE_SPARC32_DMA_DEVICE)
|
|
|
|
|
|
|
|
typedef struct DMADeviceState DMADeviceState;
|
|
|
|
|
|
|
|
struct DMADeviceState {
|
|
|
|
SysBusDevice parent_obj;
|
|
|
|
|
|
|
|
MemoryRegion iomem;
|
|
|
|
uint32_t dmaregs[DMA_REGS];
|
|
|
|
qemu_irq irq;
|
|
|
|
void *iommu;
|
|
|
|
qemu_irq gpio[2];
|
|
|
|
};
|
|
|
|
|
|
|
|
#define TYPE_SPARC32_ESPDMA_DEVICE "sparc32-espdma"
|
|
|
|
#define SPARC32_ESPDMA_DEVICE(obj) OBJECT_CHECK(ESPDMADeviceState, (obj), \
|
|
|
|
TYPE_SPARC32_ESPDMA_DEVICE)
|
|
|
|
|
|
|
|
typedef struct ESPDMADeviceState {
|
|
|
|
DMADeviceState parent_obj;
|
2017-10-14 14:22:22 +02:00
|
|
|
|
|
|
|
SysBusESPState *esp;
|
2017-10-14 14:22:21 +02:00
|
|
|
} ESPDMADeviceState;
|
|
|
|
|
|
|
|
#define TYPE_SPARC32_LEDMA_DEVICE "sparc32-ledma"
|
|
|
|
#define SPARC32_LEDMA_DEVICE(obj) OBJECT_CHECK(LEDMADeviceState, (obj), \
|
|
|
|
TYPE_SPARC32_LEDMA_DEVICE)
|
|
|
|
|
|
|
|
typedef struct LEDMADeviceState {
|
|
|
|
DMADeviceState parent_obj;
|
2017-10-14 14:22:22 +02:00
|
|
|
|
|
|
|
SysBusPCNetState *lance;
|
2017-10-14 14:22:21 +02:00
|
|
|
} LEDMADeviceState;
|
|
|
|
|
2017-10-14 14:22:22 +02:00
|
|
|
#define TYPE_SPARC32_DMA "sparc32-dma"
|
|
|
|
#define SPARC32_DMA(obj) OBJECT_CHECK(SPARC32DMAState, (obj), \
|
|
|
|
TYPE_SPARC32_DMA)
|
|
|
|
|
|
|
|
typedef struct SPARC32DMAState {
|
|
|
|
SysBusDevice parent_obj;
|
|
|
|
|
|
|
|
MemoryRegion dmamem;
|
2017-10-14 14:22:22 +02:00
|
|
|
MemoryRegion ledma_alias;
|
2017-10-14 14:22:22 +02:00
|
|
|
ESPDMADeviceState *espdma;
|
|
|
|
LEDMADeviceState *ledma;
|
|
|
|
} SPARC32DMAState;
|
|
|
|
|
2007-11-17 18:14:51 +01:00
|
|
|
/* sparc32_dma.c */
|
2012-10-23 12:30:10 +02:00
|
|
|
void ledma_memory_read(void *opaque, hwaddr addr,
|
2007-11-17 18:14:51 +01:00
|
|
|
uint8_t *buf, int len, int do_bswap);
|
2012-10-23 12:30:10 +02:00
|
|
|
void ledma_memory_write(void *opaque, hwaddr addr,
|
2007-11-17 18:14:51 +01:00
|
|
|
uint8_t *buf, int len, int do_bswap);
|
|
|
|
void espdma_memory_read(void *opaque, uint8_t *buf, int len);
|
|
|
|
void espdma_memory_write(void *opaque, uint8_t *buf, int len);
|
|
|
|
|
|
|
|
#endif
|