2017-04-05 14:41:27 +02:00
|
|
|
/*
|
|
|
|
* QEMU PowerPC PowerNV Emulation of a few OCC related registers
|
|
|
|
*
|
|
|
|
* Copyright (c) 2015-2017, IBM Corporation.
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2019-03-15 15:51:21 +01:00
|
|
|
|
|
|
|
#ifndef PPC_PNV_OCC_H
|
|
|
|
#define PPC_PNV_OCC_H
|
2017-04-05 14:41:27 +02:00
|
|
|
|
2017-05-10 08:46:01 +02:00
|
|
|
#include "hw/ppc/pnv_psi.h"
|
|
|
|
|
2017-04-05 14:41:27 +02:00
|
|
|
#define TYPE_PNV_OCC "pnv-occ"
|
|
|
|
#define PNV_OCC(obj) OBJECT_CHECK(PnvOCC, (obj), TYPE_PNV_OCC)
|
2019-03-07 23:35:41 +01:00
|
|
|
#define TYPE_PNV8_OCC TYPE_PNV_OCC "-POWER8"
|
|
|
|
#define PNV8_OCC(obj) OBJECT_CHECK(PnvOCC, (obj), TYPE_PNV8_OCC)
|
2019-03-07 23:35:42 +01:00
|
|
|
#define TYPE_PNV9_OCC TYPE_PNV_OCC "-POWER9"
|
|
|
|
#define PNV9_OCC(obj) OBJECT_CHECK(PnvOCC, (obj), TYPE_PNV9_OCC)
|
2017-04-05 14:41:27 +02:00
|
|
|
|
|
|
|
typedef struct PnvOCC {
|
|
|
|
DeviceState xd;
|
|
|
|
|
|
|
|
/* OCC Misc interrupt */
|
|
|
|
uint64_t occmisc;
|
|
|
|
|
|
|
|
PnvPsi *psi;
|
|
|
|
|
|
|
|
MemoryRegion xscom_regs;
|
2019-09-12 11:30:53 +02:00
|
|
|
MemoryRegion sram_regs;
|
2017-04-05 14:41:27 +02:00
|
|
|
} PnvOCC;
|
|
|
|
|
2019-03-07 23:35:41 +01:00
|
|
|
#define PNV_OCC_CLASS(klass) \
|
|
|
|
OBJECT_CLASS_CHECK(PnvOCCClass, (klass), TYPE_PNV_OCC)
|
|
|
|
#define PNV_OCC_GET_CLASS(obj) \
|
|
|
|
OBJECT_GET_CLASS(PnvOCCClass, (obj), TYPE_PNV_OCC)
|
|
|
|
|
|
|
|
typedef struct PnvOCCClass {
|
|
|
|
DeviceClass parent_class;
|
|
|
|
|
|
|
|
int xscom_size;
|
2019-09-12 11:30:53 +02:00
|
|
|
int sram_size;
|
2019-03-07 23:35:41 +01:00
|
|
|
const MemoryRegionOps *xscom_ops;
|
2019-09-12 11:30:53 +02:00
|
|
|
const MemoryRegionOps *sram_ops;
|
2019-03-07 23:35:41 +01:00
|
|
|
int psi_irq;
|
|
|
|
} PnvOCCClass;
|
|
|
|
|
2019-03-15 15:51:21 +01:00
|
|
|
#endif /* PPC_PNV_OCC_H */
|