2019-07-01 19:26:18 +03:00
|
|
|
/*
|
|
|
|
* ASPEED XDMA Controller
|
|
|
|
* Eddie James <eajames@linux.ibm.com>
|
|
|
|
*
|
|
|
|
* Copyright (C) 2019 IBM Corp.
|
2021-02-01 23:01:47 +03:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
2019-07-01 19:26:18 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ASPEED_XDMA_H
|
|
|
|
#define ASPEED_XDMA_H
|
|
|
|
|
|
|
|
#include "hw/sysbus.h"
|
2020-09-03 23:43:22 +03:00
|
|
|
#include "qom/object.h"
|
2019-07-01 19:26:18 +03:00
|
|
|
|
|
|
|
#define TYPE_ASPEED_XDMA "aspeed.xdma"
|
2021-05-01 11:03:52 +03:00
|
|
|
#define TYPE_ASPEED_2400_XDMA TYPE_ASPEED_XDMA "-ast2400"
|
|
|
|
#define TYPE_ASPEED_2500_XDMA TYPE_ASPEED_XDMA "-ast2500"
|
|
|
|
#define TYPE_ASPEED_2600_XDMA TYPE_ASPEED_XDMA "-ast2600"
|
|
|
|
OBJECT_DECLARE_TYPE(AspeedXDMAState, AspeedXDMAClass, ASPEED_XDMA)
|
2019-07-01 19:26:18 +03:00
|
|
|
|
|
|
|
#define ASPEED_XDMA_NUM_REGS (ASPEED_XDMA_REG_SIZE / sizeof(uint32_t))
|
|
|
|
#define ASPEED_XDMA_REG_SIZE 0x7C
|
|
|
|
|
2020-09-03 23:43:22 +03:00
|
|
|
struct AspeedXDMAState {
|
2019-07-01 19:26:18 +03:00
|
|
|
SysBusDevice parent;
|
|
|
|
|
|
|
|
MemoryRegion iomem;
|
|
|
|
qemu_irq irq;
|
|
|
|
|
|
|
|
char bmc_cmdq_readp_set;
|
|
|
|
uint32_t regs[ASPEED_XDMA_NUM_REGS];
|
2020-09-03 23:43:22 +03:00
|
|
|
};
|
2019-07-01 19:26:18 +03:00
|
|
|
|
2021-05-01 11:03:52 +03:00
|
|
|
struct AspeedXDMAClass {
|
|
|
|
SysBusDeviceClass parent_class;
|
|
|
|
|
|
|
|
uint8_t cmdq_endp;
|
|
|
|
uint8_t cmdq_wrp;
|
|
|
|
uint8_t cmdq_rdp;
|
|
|
|
uint8_t intr_ctrl;
|
|
|
|
uint32_t intr_ctrl_mask;
|
|
|
|
uint8_t intr_status;
|
|
|
|
uint32_t intr_complete;
|
|
|
|
};
|
|
|
|
|
2019-07-01 19:26:18 +03:00
|
|
|
#endif /* ASPEED_XDMA_H */
|