2 * Arm IoT Kit security controller
4 * Copyright (c) 2018 Linaro Limited
5 * Written by Peter Maydell
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 or
9 * (at your option) any later version.
12 #include "qemu/osdep.h"
14 #include "qemu/module.h"
15 #include "qapi/error.h"
17 #include "hw/sysbus.h"
18 #include "migration/vmstate.h"
19 #include "hw/registerfields.h"
21 #include "hw/misc/iotkit-secctl.h"
23 /* Registers in the secure privilege control block */
24 REG32(SECRESPCFG
, 0x10)
26 REG32(SECMPCINTSTATUS
, 0x1c)
27 REG32(SECPPCINTSTAT
, 0x20)
28 REG32(SECPPCINTCLR
, 0x24)
29 REG32(SECPPCINTEN
, 0x28)
30 REG32(SECMSCINTSTAT
, 0x30)
31 REG32(SECMSCINTCLR
, 0x34)
32 REG32(SECMSCINTEN
, 0x38)
33 REG32(BRGINTSTAT
, 0x40)
34 REG32(BRGINTCLR
, 0x44)
36 REG32(AHBNSPPC0
, 0x50)
37 REG32(AHBNSPPCEXP0
, 0x60)
38 REG32(AHBNSPPCEXP1
, 0x64)
39 REG32(AHBNSPPCEXP2
, 0x68)
40 REG32(AHBNSPPCEXP3
, 0x6c)
41 REG32(APBNSPPC0
, 0x70)
42 REG32(APBNSPPC1
, 0x74)
43 REG32(APBNSPPCEXP0
, 0x80)
44 REG32(APBNSPPCEXP1
, 0x84)
45 REG32(APBNSPPCEXP2
, 0x88)
46 REG32(APBNSPPCEXP3
, 0x8c)
47 REG32(AHBSPPPC0
, 0x90)
48 REG32(AHBSPPPCEXP0
, 0xa0)
49 REG32(AHBSPPPCEXP1
, 0xa4)
50 REG32(AHBSPPPCEXP2
, 0xa8)
51 REG32(AHBSPPPCEXP3
, 0xac)
52 REG32(APBSPPPC0
, 0xb0)
53 REG32(APBSPPPC1
, 0xb4)
54 REG32(APBSPPPCEXP0
, 0xc0)
55 REG32(APBSPPPCEXP1
, 0xc4)
56 REG32(APBSPPPCEXP2
, 0xc8)
57 REG32(APBSPPPCEXP3
, 0xcc)
72 /* Registers in the non-secure privilege control block */
73 REG32(AHBNSPPPC0
, 0x90)
74 REG32(AHBNSPPPCEXP0
, 0xa0)
75 REG32(AHBNSPPPCEXP1
, 0xa4)
76 REG32(AHBNSPPPCEXP2
, 0xa8)
77 REG32(AHBNSPPPCEXP3
, 0xac)
78 REG32(APBNSPPPC0
, 0xb0)
79 REG32(APBNSPPPC1
, 0xb4)
80 REG32(APBNSPPPCEXP0
, 0xc0)
81 REG32(APBNSPPPCEXP1
, 0xc4)
82 REG32(APBNSPPPCEXP2
, 0xc8)
83 REG32(APBNSPPPCEXP3
, 0xcc)
84 /* PID and CID registers are also present in the NS block */
86 static const uint8_t iotkit_secctl_s_idregs
[] = {
87 0x04, 0x00, 0x00, 0x00,
88 0x52, 0xb8, 0x0b, 0x00,
89 0x0d, 0xf0, 0x05, 0xb1,
92 static const uint8_t iotkit_secctl_ns_idregs
[] = {
93 0x04, 0x00, 0x00, 0x00,
94 0x53, 0xb8, 0x0b, 0x00,
95 0x0d, 0xf0, 0x05, 0xb1,
98 /* The register sets for the various PPCs (AHB internal, APB internal,
99 * AHB expansion, APB expansion) are all set up so that they are
100 * in 16-aligned blocks so offsets 0xN0, 0xN4, 0xN8, 0xNC are PPCs
101 * 0, 1, 2, 3 of that type, so we can convert a register address offset
102 * into an an index into a PPC array easily.
104 static inline int offset_to_ppc_idx(uint32_t offset
)
106 return extract32(offset
, 2, 2);
109 typedef void PerPPCFunction(IoTKitSecCtlPPC
*ppc
);
111 static void foreach_ppc(IoTKitSecCtl
*s
, PerPPCFunction
*fn
)
115 for (i
= 0; i
< IOTS_NUM_APB_PPC
; i
++) {
118 for (i
= 0; i
< IOTS_NUM_APB_EXP_PPC
; i
++) {
121 for (i
= 0; i
< IOTS_NUM_AHB_EXP_PPC
; i
++) {
126 static MemTxResult
iotkit_secctl_s_read(void *opaque
, hwaddr addr
,
128 unsigned size
, MemTxAttrs attrs
)
131 uint32_t offset
= addr
& ~0x3;
132 IoTKitSecCtl
*s
= IOTKIT_SECCTL(opaque
);
145 case A_SECMPCINTSTATUS
:
148 case A_SECPPCINTSTAT
:
149 r
= s
->secppcintstat
;
155 /* QEMU's bus fabric can never report errors as it doesn't buffer
156 * writes, so we never report bridge interrupts.
167 r
= s
->ahbexp
[offset_to_ppc_idx(offset
)].ns
;
171 r
= s
->apb
[offset_to_ppc_idx(offset
)].ns
;
177 r
= s
->apbexp
[offset_to_ppc_idx(offset
)].ns
;
183 r
= s
->apbexp
[offset_to_ppc_idx(offset
)].sp
;
187 r
= s
->apb
[offset_to_ppc_idx(offset
)].sp
;
193 r
= s
->apbexp
[offset_to_ppc_idx(offset
)].sp
;
195 case A_SECMSCINTSTAT
:
196 r
= s
->secmscintstat
;
216 r
= iotkit_secctl_s_idregs
[(offset
- A_PID4
) / 4];
221 qemu_log_mask(LOG_GUEST_ERROR
,
222 "IotKit SecCtl S block read: write-only offset 0x%x\n",
227 qemu_log_mask(LOG_GUEST_ERROR
,
228 "IotKit SecCtl S block read: bad offset 0x%x\n", offset
);
234 /* None of our registers are access-sensitive, so just pull the right
235 * byte out of the word read result.
237 r
= extract32(r
, (addr
& 3) * 8, size
* 8);
240 trace_iotkit_secctl_s_read(offset
, r
, size
);
245 static void iotkit_secctl_update_ppc_ap(IoTKitSecCtlPPC
*ppc
)
249 for (i
= 0; i
< ppc
->numports
; i
++) {
252 if (extract32(ppc
->ns
, i
, 1)) {
253 v
= extract32(ppc
->nsp
, i
, 1);
255 v
= extract32(ppc
->sp
, i
, 1);
257 qemu_set_irq(ppc
->ap
[i
], v
);
261 static void iotkit_secctl_ppc_ns_write(IoTKitSecCtlPPC
*ppc
, uint32_t value
)
265 ppc
->ns
= value
& MAKE_64BIT_MASK(0, ppc
->numports
);
266 for (i
= 0; i
< ppc
->numports
; i
++) {
267 qemu_set_irq(ppc
->nonsec
[i
], extract32(ppc
->ns
, i
, 1));
269 iotkit_secctl_update_ppc_ap(ppc
);
272 static void iotkit_secctl_ppc_sp_write(IoTKitSecCtlPPC
*ppc
, uint32_t value
)
274 ppc
->sp
= value
& MAKE_64BIT_MASK(0, ppc
->numports
);
275 iotkit_secctl_update_ppc_ap(ppc
);
278 static void iotkit_secctl_ppc_nsp_write(IoTKitSecCtlPPC
*ppc
, uint32_t value
)
280 ppc
->nsp
= value
& MAKE_64BIT_MASK(0, ppc
->numports
);
281 iotkit_secctl_update_ppc_ap(ppc
);
284 static void iotkit_secctl_ppc_update_irq_clear(IoTKitSecCtlPPC
*ppc
)
286 uint32_t value
= ppc
->parent
->secppcintstat
;
288 qemu_set_irq(ppc
->irq_clear
, extract32(value
, ppc
->irq_bit_offset
, 1));
291 static void iotkit_secctl_ppc_update_irq_enable(IoTKitSecCtlPPC
*ppc
)
293 uint32_t value
= ppc
->parent
->secppcinten
;
295 qemu_set_irq(ppc
->irq_enable
, extract32(value
, ppc
->irq_bit_offset
, 1));
298 static void iotkit_secctl_update_mscexp_irqs(qemu_irq
*msc_irqs
, uint32_t value
)
302 for (i
= 0; i
< IOTS_NUM_EXP_MSC
; i
++) {
303 qemu_set_irq(msc_irqs
[i
], extract32(value
, i
+ 16, 1));
307 static void iotkit_secctl_update_msc_irq(IoTKitSecCtl
*s
)
309 /* Update the combined MSC IRQ, based on S_MSCEXP_STATUS and S_MSCEXP_EN */
310 bool level
= s
->secmscintstat
& s
->secmscinten
;
312 qemu_set_irq(s
->msc_irq
, level
);
315 static MemTxResult
iotkit_secctl_s_write(void *opaque
, hwaddr addr
,
317 unsigned size
, MemTxAttrs attrs
)
319 IoTKitSecCtl
*s
= IOTKIT_SECCTL(opaque
);
320 uint32_t offset
= addr
;
321 IoTKitSecCtlPPC
*ppc
;
323 trace_iotkit_secctl_s_write(offset
, value
, size
);
326 /* Byte and halfword writes are ignored */
327 qemu_log_mask(LOG_GUEST_ERROR
,
328 "IotKit SecCtl S block write: bad size, ignored\n");
334 s
->nsccfg
= value
& 3;
335 qemu_set_irq(s
->nsc_cfg_irq
, s
->nsccfg
);
339 s
->secrespcfg
= value
;
340 qemu_set_irq(s
->sec_resp_cfg
, s
->secrespcfg
);
343 s
->secppcintstat
&= ~(value
& 0x00f000f3);
344 foreach_ppc(s
, iotkit_secctl_ppc_update_irq_clear
);
347 s
->secppcinten
= value
& 0x00f000f3;
348 foreach_ppc(s
, iotkit_secctl_ppc_update_irq_enable
);
353 s
->brginten
= value
& 0xffff0000;
359 ppc
= &s
->ahbexp
[offset_to_ppc_idx(offset
)];
360 iotkit_secctl_ppc_ns_write(ppc
, value
);
364 ppc
= &s
->apb
[offset_to_ppc_idx(offset
)];
365 iotkit_secctl_ppc_ns_write(ppc
, value
);
371 ppc
= &s
->apbexp
[offset_to_ppc_idx(offset
)];
372 iotkit_secctl_ppc_ns_write(ppc
, value
);
378 ppc
= &s
->ahbexp
[offset_to_ppc_idx(offset
)];
379 iotkit_secctl_ppc_sp_write(ppc
, value
);
383 ppc
= &s
->apb
[offset_to_ppc_idx(offset
)];
384 iotkit_secctl_ppc_sp_write(ppc
, value
);
390 ppc
= &s
->apbexp
[offset_to_ppc_idx(offset
)];
391 iotkit_secctl_ppc_sp_write(ppc
, value
);
394 iotkit_secctl_update_mscexp_irqs(s
->mscexp_clear
, value
);
397 s
->secmscinten
= value
;
398 iotkit_secctl_update_msc_irq(s
);
402 iotkit_secctl_update_mscexp_irqs(s
->mscexp_ns
, value
);
404 case A_SECMPCINTSTATUS
:
405 case A_SECPPCINTSTAT
:
406 case A_SECMSCINTSTAT
:
422 qemu_log_mask(LOG_GUEST_ERROR
,
423 "IoTKit SecCtl S block write: "
424 "read-only offset 0x%x\n", offset
);
427 qemu_log_mask(LOG_GUEST_ERROR
,
428 "IotKit SecCtl S block write: bad offset 0x%x\n",
436 static MemTxResult
iotkit_secctl_ns_read(void *opaque
, hwaddr addr
,
438 unsigned size
, MemTxAttrs attrs
)
440 IoTKitSecCtl
*s
= IOTKIT_SECCTL(opaque
);
442 uint32_t offset
= addr
& ~0x3;
448 case A_AHBNSPPPCEXP0
:
449 case A_AHBNSPPPCEXP1
:
450 case A_AHBNSPPPCEXP2
:
451 case A_AHBNSPPPCEXP3
:
452 r
= s
->ahbexp
[offset_to_ppc_idx(offset
)].nsp
;
456 r
= s
->apb
[offset_to_ppc_idx(offset
)].nsp
;
458 case A_APBNSPPPCEXP0
:
459 case A_APBNSPPPCEXP1
:
460 case A_APBNSPPPCEXP2
:
461 case A_APBNSPPPCEXP3
:
462 r
= s
->apbexp
[offset_to_ppc_idx(offset
)].nsp
;
476 r
= iotkit_secctl_ns_idregs
[(offset
- A_PID4
) / 4];
479 qemu_log_mask(LOG_GUEST_ERROR
,
480 "IotKit SecCtl NS block write: bad offset 0x%x\n",
487 /* None of our registers are access-sensitive, so just pull the right
488 * byte out of the word read result.
490 r
= extract32(r
, (addr
& 3) * 8, size
* 8);
493 trace_iotkit_secctl_ns_read(offset
, r
, size
);
498 static MemTxResult
iotkit_secctl_ns_write(void *opaque
, hwaddr addr
,
500 unsigned size
, MemTxAttrs attrs
)
502 IoTKitSecCtl
*s
= IOTKIT_SECCTL(opaque
);
503 uint32_t offset
= addr
;
504 IoTKitSecCtlPPC
*ppc
;
506 trace_iotkit_secctl_ns_write(offset
, value
, size
);
509 /* Byte and halfword writes are ignored */
510 qemu_log_mask(LOG_GUEST_ERROR
,
511 "IotKit SecCtl NS block write: bad size, ignored\n");
516 case A_AHBNSPPPCEXP0
:
517 case A_AHBNSPPPCEXP1
:
518 case A_AHBNSPPPCEXP2
:
519 case A_AHBNSPPPCEXP3
:
520 ppc
= &s
->ahbexp
[offset_to_ppc_idx(offset
)];
521 iotkit_secctl_ppc_nsp_write(ppc
, value
);
525 ppc
= &s
->apb
[offset_to_ppc_idx(offset
)];
526 iotkit_secctl_ppc_nsp_write(ppc
, value
);
528 case A_APBNSPPPCEXP0
:
529 case A_APBNSPPPCEXP1
:
530 case A_APBNSPPPCEXP2
:
531 case A_APBNSPPPCEXP3
:
532 ppc
= &s
->apbexp
[offset_to_ppc_idx(offset
)];
533 iotkit_secctl_ppc_nsp_write(ppc
, value
);
548 qemu_log_mask(LOG_GUEST_ERROR
,
549 "IoTKit SecCtl NS block write: "
550 "read-only offset 0x%x\n", offset
);
553 qemu_log_mask(LOG_GUEST_ERROR
,
554 "IotKit SecCtl NS block write: bad offset 0x%x\n",
562 static const MemoryRegionOps iotkit_secctl_s_ops
= {
563 .read_with_attrs
= iotkit_secctl_s_read
,
564 .write_with_attrs
= iotkit_secctl_s_write
,
565 .endianness
= DEVICE_LITTLE_ENDIAN
,
566 .valid
.min_access_size
= 1,
567 .valid
.max_access_size
= 4,
568 .impl
.min_access_size
= 1,
569 .impl
.max_access_size
= 4,
572 static const MemoryRegionOps iotkit_secctl_ns_ops
= {
573 .read_with_attrs
= iotkit_secctl_ns_read
,
574 .write_with_attrs
= iotkit_secctl_ns_write
,
575 .endianness
= DEVICE_LITTLE_ENDIAN
,
576 .valid
.min_access_size
= 1,
577 .valid
.max_access_size
= 4,
578 .impl
.min_access_size
= 1,
579 .impl
.max_access_size
= 4,
582 static void iotkit_secctl_reset_ppc(IoTKitSecCtlPPC
*ppc
)
589 static void iotkit_secctl_reset(DeviceState
*dev
)
591 IoTKitSecCtl
*s
= IOTKIT_SECCTL(dev
);
593 s
->secppcintstat
= 0;
599 foreach_ppc(s
, iotkit_secctl_reset_ppc
);
602 static void iotkit_secctl_mpc_status(void *opaque
, int n
, int level
)
604 IoTKitSecCtl
*s
= IOTKIT_SECCTL(opaque
);
606 s
->mpcintstatus
= deposit32(s
->mpcintstatus
, n
, 1, !!level
);
609 static void iotkit_secctl_mpcexp_status(void *opaque
, int n
, int level
)
611 IoTKitSecCtl
*s
= IOTKIT_SECCTL(opaque
);
613 s
->mpcintstatus
= deposit32(s
->mpcintstatus
, n
+ 16, 1, !!level
);
616 static void iotkit_secctl_mscexp_status(void *opaque
, int n
, int level
)
618 IoTKitSecCtl
*s
= IOTKIT_SECCTL(opaque
);
620 s
->secmscintstat
= deposit32(s
->secmscintstat
, n
+ 16, 1, !!level
);
621 iotkit_secctl_update_msc_irq(s
);
624 static void iotkit_secctl_ppc_irqstatus(void *opaque
, int n
, int level
)
626 IoTKitSecCtlPPC
*ppc
= opaque
;
627 IoTKitSecCtl
*s
= IOTKIT_SECCTL(ppc
->parent
);
628 int irqbit
= ppc
->irq_bit_offset
+ n
;
630 s
->secppcintstat
= deposit32(s
->secppcintstat
, irqbit
, 1, level
);
633 static void iotkit_secctl_init_ppc(IoTKitSecCtl
*s
,
634 IoTKitSecCtlPPC
*ppc
,
640 DeviceState
*dev
= DEVICE(s
);
642 ppc
->numports
= numports
;
643 ppc
->irq_bit_offset
= irq_bit_offset
;
646 gpioname
= g_strdup_printf("%s_nonsec", name
);
647 qdev_init_gpio_out_named(dev
, ppc
->nonsec
, gpioname
, numports
);
649 gpioname
= g_strdup_printf("%s_ap", name
);
650 qdev_init_gpio_out_named(dev
, ppc
->ap
, gpioname
, numports
);
652 gpioname
= g_strdup_printf("%s_irq_enable", name
);
653 qdev_init_gpio_out_named(dev
, &ppc
->irq_enable
, gpioname
, 1);
655 gpioname
= g_strdup_printf("%s_irq_clear", name
);
656 qdev_init_gpio_out_named(dev
, &ppc
->irq_clear
, gpioname
, 1);
658 gpioname
= g_strdup_printf("%s_irq_status", name
);
659 qdev_init_gpio_in_named_with_opaque(dev
, iotkit_secctl_ppc_irqstatus
,
664 static void iotkit_secctl_init(Object
*obj
)
666 IoTKitSecCtl
*s
= IOTKIT_SECCTL(obj
);
667 SysBusDevice
*sbd
= SYS_BUS_DEVICE(obj
);
668 DeviceState
*dev
= DEVICE(obj
);
671 iotkit_secctl_init_ppc(s
, &s
->apb
[0], "apb_ppc0",
672 IOTS_APB_PPC0_NUM_PORTS
, 0);
673 iotkit_secctl_init_ppc(s
, &s
->apb
[1], "apb_ppc1",
674 IOTS_APB_PPC1_NUM_PORTS
, 1);
676 for (i
= 0; i
< IOTS_NUM_APB_EXP_PPC
; i
++) {
677 IoTKitSecCtlPPC
*ppc
= &s
->apbexp
[i
];
678 char *ppcname
= g_strdup_printf("apb_ppcexp%d", i
);
679 iotkit_secctl_init_ppc(s
, ppc
, ppcname
, IOTS_PPC_NUM_PORTS
, 4 + i
);
682 for (i
= 0; i
< IOTS_NUM_AHB_EXP_PPC
; i
++) {
683 IoTKitSecCtlPPC
*ppc
= &s
->ahbexp
[i
];
684 char *ppcname
= g_strdup_printf("ahb_ppcexp%d", i
);
685 iotkit_secctl_init_ppc(s
, ppc
, ppcname
, IOTS_PPC_NUM_PORTS
, 20 + i
);
689 qdev_init_gpio_out_named(dev
, &s
->sec_resp_cfg
, "sec_resp_cfg", 1);
690 qdev_init_gpio_out_named(dev
, &s
->nsc_cfg_irq
, "nsc_cfg", 1);
692 qdev_init_gpio_in_named(dev
, iotkit_secctl_mpc_status
, "mpc_status",
694 qdev_init_gpio_in_named(dev
, iotkit_secctl_mpcexp_status
,
695 "mpcexp_status", IOTS_NUM_EXP_MPC
);
697 qdev_init_gpio_in_named(dev
, iotkit_secctl_mscexp_status
,
698 "mscexp_status", IOTS_NUM_EXP_MSC
);
699 qdev_init_gpio_out_named(dev
, s
->mscexp_clear
, "mscexp_clear",
701 qdev_init_gpio_out_named(dev
, s
->mscexp_ns
, "mscexp_ns",
703 qdev_init_gpio_out_named(dev
, &s
->msc_irq
, "msc_irq", 1);
705 memory_region_init_io(&s
->s_regs
, obj
, &iotkit_secctl_s_ops
,
706 s
, "iotkit-secctl-s-regs", 0x1000);
707 memory_region_init_io(&s
->ns_regs
, obj
, &iotkit_secctl_ns_ops
,
708 s
, "iotkit-secctl-ns-regs", 0x1000);
709 sysbus_init_mmio(sbd
, &s
->s_regs
);
710 sysbus_init_mmio(sbd
, &s
->ns_regs
);
713 static const VMStateDescription iotkit_secctl_ppc_vmstate
= {
714 .name
= "iotkit-secctl-ppc",
716 .minimum_version_id
= 1,
717 .fields
= (VMStateField
[]) {
718 VMSTATE_UINT32(ns
, IoTKitSecCtlPPC
),
719 VMSTATE_UINT32(sp
, IoTKitSecCtlPPC
),
720 VMSTATE_UINT32(nsp
, IoTKitSecCtlPPC
),
721 VMSTATE_END_OF_LIST()
725 static const VMStateDescription iotkit_secctl_mpcintstatus_vmstate
= {
726 .name
= "iotkit-secctl-mpcintstatus",
728 .minimum_version_id
= 1,
729 .fields
= (VMStateField
[]) {
730 VMSTATE_UINT32(mpcintstatus
, IoTKitSecCtl
),
731 VMSTATE_END_OF_LIST()
735 static bool needed_always(void *opaque
)
740 static const VMStateDescription iotkit_secctl_msc_vmstate
= {
741 .name
= "iotkit-secctl/msc",
743 .minimum_version_id
= 1,
744 .needed
= needed_always
,
745 .fields
= (VMStateField
[]) {
746 VMSTATE_UINT32(secmscintstat
, IoTKitSecCtl
),
747 VMSTATE_UINT32(secmscinten
, IoTKitSecCtl
),
748 VMSTATE_UINT32(nsmscexp
, IoTKitSecCtl
),
749 VMSTATE_END_OF_LIST()
753 static const VMStateDescription iotkit_secctl_vmstate
= {
754 .name
= "iotkit-secctl",
756 .minimum_version_id
= 1,
757 .fields
= (VMStateField
[]) {
758 VMSTATE_UINT32(secppcintstat
, IoTKitSecCtl
),
759 VMSTATE_UINT32(secppcinten
, IoTKitSecCtl
),
760 VMSTATE_UINT32(secrespcfg
, IoTKitSecCtl
),
761 VMSTATE_UINT32(nsccfg
, IoTKitSecCtl
),
762 VMSTATE_UINT32(brginten
, IoTKitSecCtl
),
763 VMSTATE_STRUCT_ARRAY(apb
, IoTKitSecCtl
, IOTS_NUM_APB_PPC
, 1,
764 iotkit_secctl_ppc_vmstate
, IoTKitSecCtlPPC
),
765 VMSTATE_STRUCT_ARRAY(apbexp
, IoTKitSecCtl
, IOTS_NUM_APB_EXP_PPC
, 1,
766 iotkit_secctl_ppc_vmstate
, IoTKitSecCtlPPC
),
767 VMSTATE_STRUCT_ARRAY(ahbexp
, IoTKitSecCtl
, IOTS_NUM_AHB_EXP_PPC
, 1,
768 iotkit_secctl_ppc_vmstate
, IoTKitSecCtlPPC
),
769 VMSTATE_END_OF_LIST()
771 .subsections
= (const VMStateDescription
*[]) {
772 &iotkit_secctl_mpcintstatus_vmstate
,
773 &iotkit_secctl_msc_vmstate
,
778 static void iotkit_secctl_class_init(ObjectClass
*klass
, void *data
)
780 DeviceClass
*dc
= DEVICE_CLASS(klass
);
782 dc
->vmsd
= &iotkit_secctl_vmstate
;
783 dc
->reset
= iotkit_secctl_reset
;
786 static const TypeInfo iotkit_secctl_info
= {
787 .name
= TYPE_IOTKIT_SECCTL
,
788 .parent
= TYPE_SYS_BUS_DEVICE
,
789 .instance_size
= sizeof(IoTKitSecCtl
),
790 .instance_init
= iotkit_secctl_init
,
791 .class_init
= iotkit_secctl_class_init
,
794 static void iotkit_secctl_register_types(void)
796 type_register_static(&iotkit_secctl_info
);
799 type_init(iotkit_secctl_register_types
);