xref: /qemu/include/hw/ppc/pnv_occ.h (revision 6598a70d00cd3a58acbd290d52067902c64d4480)
10722d05aSBenjamin Herrenschmidt /*
20722d05aSBenjamin Herrenschmidt  * QEMU PowerPC PowerNV Emulation of a few OCC related registers
30722d05aSBenjamin Herrenschmidt  *
40722d05aSBenjamin Herrenschmidt  * Copyright (c) 2015-2017, IBM Corporation.
50722d05aSBenjamin Herrenschmidt  *
60722d05aSBenjamin Herrenschmidt  * This library is free software; you can redistribute it and/or
70722d05aSBenjamin Herrenschmidt  * modify it under the terms of the GNU Lesser General Public
80722d05aSBenjamin Herrenschmidt  * License as published by the Free Software Foundation; either
90722d05aSBenjamin Herrenschmidt  * version 2 of the License, or (at your option) any later version.
100722d05aSBenjamin Herrenschmidt  *
110722d05aSBenjamin Herrenschmidt  * This library is distributed in the hope that it will be useful,
120722d05aSBenjamin Herrenschmidt  * but WITHOUT ANY WARRANTY; without even the implied warranty of
130722d05aSBenjamin Herrenschmidt  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
140722d05aSBenjamin Herrenschmidt  * Lesser General Public License for more details.
150722d05aSBenjamin Herrenschmidt  *
160722d05aSBenjamin Herrenschmidt  * You should have received a copy of the GNU Lesser General Public
170722d05aSBenjamin Herrenschmidt  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
180722d05aSBenjamin Herrenschmidt  */
190722d05aSBenjamin Herrenschmidt #ifndef _PPC_PNV_OCC_H
200722d05aSBenjamin Herrenschmidt #define _PPC_PNV_OCC_H
210722d05aSBenjamin Herrenschmidt 
22eaf87a39SDavid Gibson #include "hw/ppc/pnv_psi.h"
23eaf87a39SDavid Gibson 
240722d05aSBenjamin Herrenschmidt #define TYPE_PNV_OCC "pnv-occ"
250722d05aSBenjamin Herrenschmidt #define PNV_OCC(obj) OBJECT_CHECK(PnvOCC, (obj), TYPE_PNV_OCC)
263233838cSCédric Le Goater #define TYPE_PNV8_OCC TYPE_PNV_OCC "-POWER8"
273233838cSCédric Le Goater #define PNV8_OCC(obj) OBJECT_CHECK(PnvOCC, (obj), TYPE_PNV8_OCC)
28*6598a70dSCédric Le Goater #define TYPE_PNV9_OCC TYPE_PNV_OCC "-POWER9"
29*6598a70dSCédric Le Goater #define PNV9_OCC(obj) OBJECT_CHECK(PnvOCC, (obj), TYPE_PNV9_OCC)
300722d05aSBenjamin Herrenschmidt 
310722d05aSBenjamin Herrenschmidt typedef struct PnvOCC {
320722d05aSBenjamin Herrenschmidt     DeviceState xd;
330722d05aSBenjamin Herrenschmidt 
340722d05aSBenjamin Herrenschmidt     /* OCC Misc interrupt */
350722d05aSBenjamin Herrenschmidt     uint64_t occmisc;
360722d05aSBenjamin Herrenschmidt 
370722d05aSBenjamin Herrenschmidt     PnvPsi *psi;
380722d05aSBenjamin Herrenschmidt 
390722d05aSBenjamin Herrenschmidt     MemoryRegion xscom_regs;
400722d05aSBenjamin Herrenschmidt } PnvOCC;
410722d05aSBenjamin Herrenschmidt 
423233838cSCédric Le Goater #define PNV_OCC_CLASS(klass) \
433233838cSCédric Le Goater      OBJECT_CLASS_CHECK(PnvOCCClass, (klass), TYPE_PNV_OCC)
443233838cSCédric Le Goater #define PNV_OCC_GET_CLASS(obj) \
453233838cSCédric Le Goater      OBJECT_GET_CLASS(PnvOCCClass, (obj), TYPE_PNV_OCC)
463233838cSCédric Le Goater 
473233838cSCédric Le Goater typedef struct PnvOCCClass {
483233838cSCédric Le Goater     DeviceClass parent_class;
493233838cSCédric Le Goater 
503233838cSCédric Le Goater     int xscom_size;
513233838cSCédric Le Goater     const MemoryRegionOps *xscom_ops;
523233838cSCédric Le Goater     int psi_irq;
533233838cSCédric Le Goater } PnvOCCClass;
543233838cSCédric Le Goater 
550722d05aSBenjamin Herrenschmidt #endif /* _PPC_PNV_OCC_H */
56