2018-08-20 12:24:33 +02:00
|
|
|
/*
|
|
|
|
* ARM PrimeCell PL080/PL081 DMA controller
|
|
|
|
*
|
|
|
|
* Copyright (c) 2006 CodeSourcery.
|
|
|
|
* Copyright (c) 2018 Linaro Limited
|
|
|
|
* Written by Paul Brook, Peter Maydell
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2 or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*/
|
|
|
|
|
2021-02-05 18:14:56 +01:00
|
|
|
/*
|
|
|
|
* This is a model of the Arm PrimeCell PL080/PL081 DMA controller:
|
2018-08-20 12:24:33 +02:00
|
|
|
* The PL080 TRM is:
|
2021-02-05 18:14:56 +01:00
|
|
|
* https://developer.arm.com/documentation/ddi0196/latest
|
2018-08-20 12:24:33 +02:00
|
|
|
* and the PL081 TRM is:
|
2021-02-05 18:14:56 +01:00
|
|
|
* https://developer.arm.com/documentation/ddi0218/latest
|
2018-08-20 12:24:33 +02:00
|
|
|
*
|
|
|
|
* QEMU interface:
|
2018-08-20 12:24:33 +02:00
|
|
|
* + sysbus IRQ 0: DMACINTR combined interrupt line
|
|
|
|
* + sysbus IRQ 1: DMACINTERR error interrupt request
|
|
|
|
* + sysbus IRQ 2: DMACINTTC count interrupt request
|
2018-08-20 12:24:33 +02:00
|
|
|
* + sysbus MMIO region 0: MemoryRegion for the device's registers
|
2018-08-20 12:24:33 +02:00
|
|
|
* + QOM property "downstream": MemoryRegion defining where DMA
|
|
|
|
* bus master transactions are made
|
2018-08-20 12:24:33 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef HW_DMA_PL080_H
|
|
|
|
#define HW_DMA_PL080_H
|
|
|
|
|
|
|
|
#include "hw/sysbus.h"
|
2020-09-03 22:43:22 +02:00
|
|
|
#include "qom/object.h"
|
2018-08-20 12:24:33 +02:00
|
|
|
|
|
|
|
#define PL080_MAX_CHANNELS 8
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
uint32_t src;
|
|
|
|
uint32_t dest;
|
|
|
|
uint32_t lli;
|
|
|
|
uint32_t ctrl;
|
|
|
|
uint32_t conf;
|
|
|
|
} pl080_channel;
|
|
|
|
|
|
|
|
#define TYPE_PL080 "pl080"
|
|
|
|
#define TYPE_PL081 "pl081"
|
2020-09-16 20:25:19 +02:00
|
|
|
OBJECT_DECLARE_SIMPLE_TYPE(PL080State, PL080)
|
2018-08-20 12:24:33 +02:00
|
|
|
|
2020-09-03 22:43:22 +02:00
|
|
|
struct PL080State {
|
2018-08-20 12:24:33 +02:00
|
|
|
SysBusDevice parent_obj;
|
|
|
|
|
|
|
|
MemoryRegion iomem;
|
|
|
|
uint8_t tc_int;
|
|
|
|
uint8_t tc_mask;
|
|
|
|
uint8_t err_int;
|
|
|
|
uint8_t err_mask;
|
|
|
|
uint32_t conf;
|
|
|
|
uint32_t sync;
|
|
|
|
uint32_t req_single;
|
|
|
|
uint32_t req_burst;
|
|
|
|
pl080_channel chan[PL080_MAX_CHANNELS];
|
|
|
|
int nchannels;
|
|
|
|
/* Flag to avoid recursive DMA invocations. */
|
|
|
|
int running;
|
|
|
|
qemu_irq irq;
|
2018-08-20 12:24:33 +02:00
|
|
|
qemu_irq interr;
|
|
|
|
qemu_irq inttc;
|
2018-08-20 12:24:33 +02:00
|
|
|
|
|
|
|
MemoryRegion *downstream;
|
|
|
|
AddressSpace downstream_as;
|
2020-09-03 22:43:22 +02:00
|
|
|
};
|
2018-08-20 12:24:33 +02:00
|
|
|
|
|
|
|
#endif
|