aboutsummaryrefslogtreecommitdiff
path: root/include/hw/sparc/sparc32_dma.h
blob: 9c80ef54ff628fa12818b66c872a131d9ec905e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#ifndef SPARC32_DMA_H
#define SPARC32_DMA_H

#include "hw/sysbus.h"
#include "hw/scsi/esp.h"
#include "hw/net/lance.h"
#include "qom/object.h"

#define DMA_REGS 4

#define TYPE_SPARC32_DMA_DEVICE "sparc32-dma-device"
typedef struct DMADeviceState DMADeviceState;
#define SPARC32_DMA_DEVICE(obj) OBJECT_CHECK(DMADeviceState, (obj), \
                                             TYPE_SPARC32_DMA_DEVICE)


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"
typedef struct ESPDMADeviceState ESPDMADeviceState;
#define SPARC32_ESPDMA_DEVICE(obj) OBJECT_CHECK(ESPDMADeviceState, (obj), \
                                                TYPE_SPARC32_ESPDMA_DEVICE)

struct ESPDMADeviceState {
    DMADeviceState parent_obj;

    SysBusESPState *esp;
};

#define TYPE_SPARC32_LEDMA_DEVICE "sparc32-ledma"
typedef struct LEDMADeviceState LEDMADeviceState;
#define SPARC32_LEDMA_DEVICE(obj) OBJECT_CHECK(LEDMADeviceState, (obj), \
                                               TYPE_SPARC32_LEDMA_DEVICE)

struct LEDMADeviceState {
    DMADeviceState parent_obj;

    SysBusPCNetState *lance;
};

#define TYPE_SPARC32_DMA "sparc32-dma"
typedef struct SPARC32DMAState SPARC32DMAState;
#define SPARC32_DMA(obj) OBJECT_CHECK(SPARC32DMAState, (obj), \
                                      TYPE_SPARC32_DMA)

struct SPARC32DMAState {
    SysBusDevice parent_obj;

    MemoryRegion dmamem;
    MemoryRegion ledma_alias;
    ESPDMADeviceState *espdma;
    LEDMADeviceState *ledma;
};

/* sparc32_dma.c */
void ledma_memory_read(void *opaque, hwaddr addr,
                       uint8_t *buf, int len, int do_bswap);
void ledma_memory_write(void *opaque, hwaddr addr,
                        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