aboutsummaryrefslogtreecommitdiff
path: root/include/hw/ssi
diff options
context:
space:
mode:
Diffstat (limited to 'include/hw/ssi')
-rw-r--r--include/hw/ssi/aspeed_smc.h18
-rw-r--r--include/hw/ssi/imx_spi.h9
-rw-r--r--include/hw/ssi/mss-spi.h9
-rw-r--r--include/hw/ssi/pl022.h9
-rw-r--r--include/hw/ssi/ssi.h11
-rw-r--r--include/hw/ssi/stm32f2xx_spi.h10
-rw-r--r--include/hw/ssi/xilinx_spips.h32
7 files changed, 52 insertions, 46 deletions
diff --git a/include/hw/ssi/aspeed_smc.h b/include/hw/ssi/aspeed_smc.h
index 6fbbb238f1..8e023d8ff6 100644
--- a/include/hw/ssi/aspeed_smc.h
+++ b/include/hw/ssi/aspeed_smc.h
@@ -27,6 +27,7 @@
#include "hw/ssi/ssi.h"
#include "hw/sysbus.h"
+#include "qom/object.h"
typedef struct AspeedSegments {
hwaddr addr;
@@ -67,20 +68,19 @@ typedef struct AspeedSMCFlash {
} AspeedSMCFlash;
#define TYPE_ASPEED_SMC "aspeed.smc"
-#define ASPEED_SMC(obj) OBJECT_CHECK(AspeedSMCState, (obj), TYPE_ASPEED_SMC)
-#define ASPEED_SMC_CLASS(klass) \
- OBJECT_CLASS_CHECK(AspeedSMCClass, (klass), TYPE_ASPEED_SMC)
-#define ASPEED_SMC_GET_CLASS(obj) \
- OBJECT_GET_CLASS(AspeedSMCClass, (obj), TYPE_ASPEED_SMC)
+typedef struct AspeedSMCClass AspeedSMCClass;
+typedef struct AspeedSMCState AspeedSMCState;
+DECLARE_OBJ_CHECKERS(AspeedSMCState, AspeedSMCClass,
+ ASPEED_SMC, TYPE_ASPEED_SMC)
-typedef struct AspeedSMCClass {
+struct AspeedSMCClass {
SysBusDevice parent_obj;
const AspeedSMCController *ctrl;
-} AspeedSMCClass;
+};
#define ASPEED_SMC_R_MAX (0x100 / 4)
-typedef struct AspeedSMCState {
+struct AspeedSMCState {
SysBusDevice parent_obj;
const AspeedSMCController *ctrl;
@@ -117,6 +117,6 @@ typedef struct AspeedSMCState {
uint8_t snoop_index;
uint8_t snoop_dummies;
-} AspeedSMCState;
+};
#endif /* ASPEED_SMC_H */
diff --git a/include/hw/ssi/imx_spi.h b/include/hw/ssi/imx_spi.h
index 7103953581..874fea492d 100644
--- a/include/hw/ssi/imx_spi.h
+++ b/include/hw/ssi/imx_spi.h
@@ -14,6 +14,7 @@
#include "hw/ssi/ssi.h"
#include "qemu/bitops.h"
#include "qemu/fifo32.h"
+#include "qom/object.h"
#define ECSPI_FIFO_SIZE 64
@@ -77,9 +78,11 @@
#define EXTRACT(value, name) extract32(value, name##_SHIFT, name##_LENGTH)
#define TYPE_IMX_SPI "imx.spi"
-#define IMX_SPI(obj) OBJECT_CHECK(IMXSPIState, (obj), TYPE_IMX_SPI)
+typedef struct IMXSPIState IMXSPIState;
+DECLARE_INSTANCE_CHECKER(IMXSPIState, IMX_SPI,
+ TYPE_IMX_SPI)
-typedef struct IMXSPIState {
+struct IMXSPIState {
/* <private> */
SysBusDevice parent_obj;
@@ -98,6 +101,6 @@ typedef struct IMXSPIState {
Fifo32 tx_fifo;
int16_t burst_length;
-} IMXSPIState;
+};
#endif /* IMX_SPI_H */
diff --git a/include/hw/ssi/mss-spi.h b/include/hw/ssi/mss-spi.h
index f0cf3243e0..7c16cf6b49 100644
--- a/include/hw/ssi/mss-spi.h
+++ b/include/hw/ssi/mss-spi.h
@@ -28,13 +28,16 @@
#include "hw/sysbus.h"
#include "hw/ssi/ssi.h"
#include "qemu/fifo32.h"
+#include "qom/object.h"
#define TYPE_MSS_SPI "mss-spi"
-#define MSS_SPI(obj) OBJECT_CHECK(MSSSpiState, (obj), TYPE_MSS_SPI)
+typedef struct MSSSpiState MSSSpiState;
+DECLARE_INSTANCE_CHECKER(MSSSpiState, MSS_SPI,
+ TYPE_MSS_SPI)
#define R_SPI_MAX 16
-typedef struct MSSSpiState {
+struct MSSSpiState {
SysBusDevice parent_obj;
MemoryRegion mmio;
@@ -53,6 +56,6 @@ typedef struct MSSSpiState {
bool enabled;
uint32_t regs[R_SPI_MAX];
-} MSSSpiState;
+};
#endif /* HW_MSS_SPI_H */
diff --git a/include/hw/ssi/pl022.h b/include/hw/ssi/pl022.h
index a080519366..1f5da7cc44 100644
--- a/include/hw/ssi/pl022.h
+++ b/include/hw/ssi/pl022.h
@@ -22,11 +22,14 @@
#define HW_SSI_PL022_H
#include "hw/sysbus.h"
+#include "qom/object.h"
#define TYPE_PL022 "pl022"
-#define PL022(obj) OBJECT_CHECK(PL022State, (obj), TYPE_PL022)
+typedef struct PL022State PL022State;
+DECLARE_INSTANCE_CHECKER(PL022State, PL022,
+ TYPE_PL022)
-typedef struct PL022State {
+struct PL022State {
SysBusDevice parent_obj;
MemoryRegion iomem;
@@ -46,6 +49,6 @@ typedef struct PL022State {
uint16_t rx_fifo[8];
qemu_irq irq;
SSIBus *ssi;
-} PL022State;
+};
#endif
diff --git a/include/hw/ssi/ssi.h b/include/hw/ssi/ssi.h
index eac168aa1d..4fe1d85136 100644
--- a/include/hw/ssi/ssi.h
+++ b/include/hw/ssi/ssi.h
@@ -12,18 +12,13 @@
#define QEMU_SSI_H
#include "hw/qdev-core.h"
+#include "qom/object.h"
-typedef struct SSISlave SSISlave;
-typedef struct SSISlaveClass SSISlaveClass;
typedef enum SSICSMode SSICSMode;
#define TYPE_SSI_SLAVE "ssi-slave"
-#define SSI_SLAVE(obj) \
- OBJECT_CHECK(SSISlave, (obj), TYPE_SSI_SLAVE)
-#define SSI_SLAVE_CLASS(klass) \
- OBJECT_CLASS_CHECK(SSISlaveClass, (klass), TYPE_SSI_SLAVE)
-#define SSI_SLAVE_GET_CLASS(obj) \
- OBJECT_GET_CLASS(SSISlaveClass, (obj), TYPE_SSI_SLAVE)
+OBJECT_DECLARE_TYPE(SSISlave, SSISlaveClass,
+ ssi_slave, SSI_SLAVE)
#define SSI_GPIO_CS "ssi-gpio-cs"
diff --git a/include/hw/ssi/stm32f2xx_spi.h b/include/hw/ssi/stm32f2xx_spi.h
index e24b007abf..4bb36d04ed 100644
--- a/include/hw/ssi/stm32f2xx_spi.h
+++ b/include/hw/ssi/stm32f2xx_spi.h
@@ -27,6 +27,7 @@
#include "hw/sysbus.h"
#include "hw/ssi/ssi.h"
+#include "qom/object.h"
#define STM_SPI_CR1 0x00
#define STM_SPI_CR2 0x04
@@ -44,10 +45,11 @@
#define STM_SPI_SR_RXNE 1
#define TYPE_STM32F2XX_SPI "stm32f2xx-spi"
-#define STM32F2XX_SPI(obj) \
- OBJECT_CHECK(STM32F2XXSPIState, (obj), TYPE_STM32F2XX_SPI)
+typedef struct STM32F2XXSPIState STM32F2XXSPIState;
+DECLARE_INSTANCE_CHECKER(STM32F2XXSPIState, STM32F2XX_SPI,
+ TYPE_STM32F2XX_SPI)
-typedef struct {
+struct STM32F2XXSPIState {
/* <private> */
SysBusDevice parent_obj;
@@ -66,6 +68,6 @@ typedef struct {
qemu_irq irq;
SSIBus *ssi;
-} STM32F2XXSPIState;
+};
#endif /* HW_STM32F2XX_SPI_H */
diff --git a/include/hw/ssi/xilinx_spips.h b/include/hw/ssi/xilinx_spips.h
index 6a39b55a7b..b1ab347617 100644
--- a/include/hw/ssi/xilinx_spips.h
+++ b/include/hw/ssi/xilinx_spips.h
@@ -29,6 +29,7 @@
#include "qemu/fifo32.h"
#include "hw/stream.h"
#include "hw/sysbus.h"
+#include "qom/object.h"
typedef struct XilinxSPIPS XilinxSPIPS;
@@ -85,16 +86,17 @@ struct XilinxSPIPS {
bool man_start_com;
};
-typedef struct {
+struct XilinxQSPIPS {
XilinxSPIPS parent_obj;
uint8_t lqspi_buf[LQSPI_CACHE_SIZE];
hwaddr lqspi_cached_addr;
Error *migration_blocker;
bool mmio_execution_enabled;
-} XilinxQSPIPS;
+};
+typedef struct XilinxQSPIPS XilinxQSPIPS;
-typedef struct {
+struct XlnxZynqMPQSPIPS {
XilinxQSPIPS parent_obj;
StreamSlave *dma;
@@ -117,32 +119,30 @@ typedef struct {
bool man_start_com_g;
uint32_t dma_burst_size;
uint8_t dma_buf[QSPI_DMA_MAX_BURST_SIZE];
-} XlnxZynqMPQSPIPS;
+};
+typedef struct XlnxZynqMPQSPIPS XlnxZynqMPQSPIPS;
-typedef struct XilinxSPIPSClass {
+struct XilinxSPIPSClass {
SysBusDeviceClass parent_class;
const MemoryRegionOps *reg_ops;
uint32_t rx_fifo_size;
uint32_t tx_fifo_size;
-} XilinxSPIPSClass;
+};
+typedef struct XilinxSPIPSClass XilinxSPIPSClass;
#define TYPE_XILINX_SPIPS "xlnx.ps7-spi"
#define TYPE_XILINX_QSPIPS "xlnx.ps7-qspi"
#define TYPE_XLNX_ZYNQMP_QSPIPS "xlnx.usmp-gqspi"
-#define XILINX_SPIPS(obj) \
- OBJECT_CHECK(XilinxSPIPS, (obj), TYPE_XILINX_SPIPS)
-#define XILINX_SPIPS_CLASS(klass) \
- OBJECT_CLASS_CHECK(XilinxSPIPSClass, (klass), TYPE_XILINX_SPIPS)
-#define XILINX_SPIPS_GET_CLASS(obj) \
- OBJECT_GET_CLASS(XilinxSPIPSClass, (obj), TYPE_XILINX_SPIPS)
+DECLARE_OBJ_CHECKERS(XilinxSPIPS, XilinxSPIPSClass,
+ XILINX_SPIPS, TYPE_XILINX_SPIPS)
-#define XILINX_QSPIPS(obj) \
- OBJECT_CHECK(XilinxQSPIPS, (obj), TYPE_XILINX_QSPIPS)
+DECLARE_INSTANCE_CHECKER(XilinxQSPIPS, XILINX_QSPIPS,
+ TYPE_XILINX_QSPIPS)
-#define XLNX_ZYNQMP_QSPIPS(obj) \
- OBJECT_CHECK(XlnxZynqMPQSPIPS, (obj), TYPE_XLNX_ZYNQMP_QSPIPS)
+DECLARE_INSTANCE_CHECKER(XlnxZynqMPQSPIPS, XLNX_ZYNQMP_QSPIPS,
+ TYPE_XLNX_ZYNQMP_QSPIPS)
#endif /* XILINX_SPIPS_H */