Merge tag 'pull-loongarch-20241016' of https://gitlab.com/gaosong/qemu into staging
[qemu/armbru.git] / include / hw / ppc / pnv_sbe.h
blobb6b378ad14c7da22658407213e137a214d2bc464
1 /*
2 * QEMU PowerPC PowerNV Emulation of some SBE behaviour
4 * Copyright (c) 2022, IBM Corporation.
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
20 #ifndef PPC_PNV_SBE_H
21 #define PPC_PNV_SBE_H
23 #include "exec/memory.h"
24 #include "hw/qdev-core.h"
26 #define TYPE_PNV_SBE "pnv-sbe"
27 OBJECT_DECLARE_TYPE(PnvSBE, PnvSBEClass, PNV_SBE)
28 #define TYPE_PNV9_SBE TYPE_PNV_SBE "-POWER9"
29 DECLARE_INSTANCE_CHECKER(PnvSBE, PNV9_SBE, TYPE_PNV9_SBE)
30 #define TYPE_PNV10_SBE TYPE_PNV_SBE "-POWER10"
31 DECLARE_INSTANCE_CHECKER(PnvSBE, PNV10_SBE, TYPE_PNV10_SBE)
33 struct PnvSBE {
34 DeviceState xd;
36 uint64_t mbox[8];
37 uint64_t sbe_doorbell;
38 uint64_t host_doorbell;
40 qemu_irq psi_irq;
41 QEMUTimer *timer;
43 MemoryRegion xscom_mbox_regs;
44 MemoryRegion xscom_ctrl_regs;
47 struct PnvSBEClass {
48 DeviceClass parent_class;
50 int xscom_ctrl_size;
51 int xscom_mbox_size;
52 const MemoryRegionOps *xscom_ctrl_ops;
53 const MemoryRegionOps *xscom_mbox_ops;
56 #endif /* PPC_PNV_SBE_H */