mirror of
https://github.com/qemu/qemu.git
synced 2026-02-04 05:35:39 +00:00
hw/ppc: Add pnv_spi vmstate support
- Add support for needed PnvSpi structure variables Reviewed-by: Michael Kowal <kowal@linux.ibm.com> Reviewed-by: Aditya Gupta <adityag@linux.ibm.com> Reviewed-by: Chalapathi V <chalapathi.v@linux.ibm.com> Signed-off-by: Caleb Schlossin <calebs@linux.ibm.com> Link: https://lore.kernel.org/qemu-devel/20260105160138.3242709-3-calebs@linux.ibm.com Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
This commit is contained in:
committed by
Harsh Prateek Bora
parent
ffc83d0ffd
commit
555fd783ef
@@ -13,6 +13,7 @@
|
||||
#include "hw/ssi/pnv_spi.h"
|
||||
#include "hw/ssi/pnv_spi_regs.h"
|
||||
#include "hw/ssi/ssi.h"
|
||||
#include "migration/vmstate.h"
|
||||
#include <libfdt.h>
|
||||
#include "hw/core/irq.h"
|
||||
#include "trace.h"
|
||||
@@ -1199,6 +1200,31 @@ static int pnv_spi_dt_xscom(PnvXScomInterface *dev, void *fdt,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const VMStateDescription pnv_spi_vmstate = {
|
||||
.name = TYPE_PNV_SPI,
|
||||
.version_id = 1,
|
||||
.fields = (const VMStateField[]) {
|
||||
VMSTATE_UINT8(fail_count, PnvSpi),
|
||||
VMSTATE_UINT8(transfer_len, PnvSpi),
|
||||
VMSTATE_UINT8(responder_select, PnvSpi),
|
||||
VMSTATE_BOOL(shift_n1_done, PnvSpi),
|
||||
VMSTATE_UINT8(loop_counter_1, PnvSpi),
|
||||
VMSTATE_UINT8(loop_counter_2, PnvSpi),
|
||||
VMSTATE_UINT8(N1_bits, PnvSpi),
|
||||
VMSTATE_UINT8(N2_bits, PnvSpi),
|
||||
VMSTATE_UINT8(N1_bytes, PnvSpi),
|
||||
VMSTATE_UINT8(N2_bytes, PnvSpi),
|
||||
VMSTATE_UINT8(N1_tx, PnvSpi),
|
||||
VMSTATE_UINT8(N2_tx, PnvSpi),
|
||||
VMSTATE_UINT8(N1_rx, PnvSpi),
|
||||
VMSTATE_UINT8(N2_rx, PnvSpi),
|
||||
VMSTATE_UINT64_ARRAY(regs, PnvSpi, PNV_SPI_REGS),
|
||||
VMSTATE_UINT8_ARRAY(seq_op, PnvSpi, PNV_SPI_REG_SIZE),
|
||||
VMSTATE_UINT64(status, PnvSpi),
|
||||
VMSTATE_END_OF_LIST(),
|
||||
},
|
||||
};
|
||||
|
||||
static void pnv_spi_class_init(ObjectClass *klass, const void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
@@ -1209,6 +1235,7 @@ static void pnv_spi_class_init(ObjectClass *klass, const void *data)
|
||||
dc->desc = "PowerNV SPI";
|
||||
dc->realize = pnv_spi_realize;
|
||||
device_class_set_legacy_reset(dc, do_reset);
|
||||
dc->vmsd = &pnv_spi_vmstate;
|
||||
device_class_set_props(dc, pnv_spi_properties);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user