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 9*f70c5966SChetan Pant * version 2.1 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 */ 19a8b991b5SMarkus Armbruster 20a8b991b5SMarkus Armbruster #ifndef PPC_PNV_OCC_H 21a8b991b5SMarkus Armbruster #define PPC_PNV_OCC_H 220722d05aSBenjamin Herrenschmidt 23eaf87a39SDavid Gibson #include "hw/ppc/pnv_psi.h" 24db1015e9SEduardo Habkost #include "qom/object.h" 25eaf87a39SDavid Gibson 260722d05aSBenjamin Herrenschmidt #define TYPE_PNV_OCC "pnv-occ" 27c821774aSEduardo Habkost OBJECT_DECLARE_TYPE(PnvOCC, PnvOCCClass, 2830b5707cSEduardo Habkost PNV_OCC) 293233838cSCédric Le Goater #define TYPE_PNV8_OCC TYPE_PNV_OCC "-POWER8" 308110fa1dSEduardo Habkost DECLARE_INSTANCE_CHECKER(PnvOCC, PNV8_OCC, 318110fa1dSEduardo Habkost TYPE_PNV8_OCC) 326598a70dSCédric Le Goater #define TYPE_PNV9_OCC TYPE_PNV_OCC "-POWER9" 338110fa1dSEduardo Habkost DECLARE_INSTANCE_CHECKER(PnvOCC, PNV9_OCC, 348110fa1dSEduardo Habkost TYPE_PNV9_OCC) 350722d05aSBenjamin Herrenschmidt 363a1b70b6SCédric Le Goater #define PNV_OCC_SENSOR_DATA_BLOCK_OFFSET 0x00580000 373a1b70b6SCédric Le Goater #define PNV_OCC_SENSOR_DATA_BLOCK_SIZE 0x00025800 383a1b70b6SCédric Le Goater 39db1015e9SEduardo Habkost struct PnvOCC { 400722d05aSBenjamin Herrenschmidt DeviceState xd; 410722d05aSBenjamin Herrenschmidt 420722d05aSBenjamin Herrenschmidt /* OCC Misc interrupt */ 430722d05aSBenjamin Herrenschmidt uint64_t occmisc; 440722d05aSBenjamin Herrenschmidt 450722d05aSBenjamin Herrenschmidt PnvPsi *psi; 460722d05aSBenjamin Herrenschmidt 470722d05aSBenjamin Herrenschmidt MemoryRegion xscom_regs; 48f3db8266SBalamuruhan S MemoryRegion sram_regs; 49db1015e9SEduardo Habkost }; 500722d05aSBenjamin Herrenschmidt 513233838cSCédric Le Goater 52db1015e9SEduardo Habkost struct PnvOCCClass { 533233838cSCédric Le Goater DeviceClass parent_class; 543233838cSCédric Le Goater 553233838cSCédric Le Goater int xscom_size; 563233838cSCédric Le Goater const MemoryRegionOps *xscom_ops; 573233838cSCédric Le Goater int psi_irq; 58db1015e9SEduardo Habkost }; 593233838cSCédric Le Goater 603a1b70b6SCédric Le Goater #define PNV_OCC_SENSOR_DATA_BLOCK_BASE(i) \ 613a1b70b6SCédric Le Goater (PNV_OCC_SENSOR_DATA_BLOCK_OFFSET + (i) * PNV_OCC_SENSOR_DATA_BLOCK_SIZE) 623a1b70b6SCédric Le Goater 63a8b991b5SMarkus Armbruster #endif /* PPC_PNV_OCC_H */ 64