2017-04-05 15:41:27 +03: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 17:51:21 +03:00
|
|
|
|
|
|
|
#ifndef PPC_PNV_OCC_H
|
|
|
|
#define PPC_PNV_OCC_H
|
2017-04-05 15:41:27 +03:00
|
|
|
|
2017-05-10 09:46:01 +03:00
|
|
|
#include "hw/ppc/pnv_psi.h"
|
|
|
|
|
2017-04-05 15:41:27 +03:00
|
|
|
#define TYPE_PNV_OCC "pnv-occ"
|
|
|
|
#define PNV_OCC(obj) OBJECT_CHECK(PnvOCC, (obj), TYPE_PNV_OCC)
|
2019-03-08 01:35:41 +03:00
|
|
|
#define TYPE_PNV8_OCC TYPE_PNV_OCC "-POWER8"
|
|
|
|
#define PNV8_OCC(obj) OBJECT_CHECK(PnvOCC, (obj), TYPE_PNV8_OCC)
|
2019-03-08 01:35:42 +03:00
|
|
|
#define TYPE_PNV9_OCC TYPE_PNV_OCC "-POWER9"
|
|
|
|
#define PNV9_OCC(obj) OBJECT_CHECK(PnvOCC, (obj), TYPE_PNV9_OCC)
|
2017-04-05 15:41:27 +03:00
|
|
|
|
|
|
|
typedef struct PnvOCC {
|
|
|
|
DeviceState xd;
|
|
|
|
|
|
|
|
/* OCC Misc interrupt */
|
|
|
|
uint64_t occmisc;
|
|
|
|
|
|
|
|
PnvPsi *psi;
|
|
|
|
|
|
|
|
MemoryRegion xscom_regs;
|
2019-09-12 12:30:53 +03:00
|
|
|
MemoryRegion sram_regs;
|
2017-04-05 15:41:27 +03:00
|
|
|
} PnvOCC;
|
|
|
|
|
2019-03-08 01:35:41 +03: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 12:30:53 +03:00
|
|
|
int sram_size;
|
2019-03-08 01:35:41 +03:00
|
|
|
const MemoryRegionOps *xscom_ops;
|
2019-09-12 12:30:53 +03:00
|
|
|
const MemoryRegionOps *sram_ops;
|
2019-03-08 01:35:41 +03:00
|
|
|
int psi_irq;
|
|
|
|
} PnvOCCClass;
|
|
|
|
|
2019-03-15 17:51:21 +03:00
|
|
|
#endif /* PPC_PNV_OCC_H */
|