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
|
2020-10-16 17:53:46 +03:00
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
2017-04-05 15:41:27 +03:00
|
|
|
*
|
|
|
|
* 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"
|
2020-09-03 23:43:22 +03:00
|
|
|
#include "qom/object.h"
|
2017-05-10 09:46:01 +03:00
|
|
|
|
2017-04-05 15:41:27 +03:00
|
|
|
#define TYPE_PNV_OCC "pnv-occ"
|
2020-09-01 00:07:37 +03:00
|
|
|
OBJECT_DECLARE_TYPE(PnvOCC, PnvOCCClass,
|
qom: Remove module_obj_name parameter from OBJECT_DECLARE* macros
One of the goals of having less boilerplate on QOM declarations
is to avoid human error. Requiring an extra argument that is
never used is an opportunity for mistakes.
Remove the unused argument from OBJECT_DECLARE_TYPE and
OBJECT_DECLARE_SIMPLE_TYPE.
Coccinelle patch used to convert all users of the macros:
@@
declarer name OBJECT_DECLARE_TYPE;
identifier InstanceType, ClassType, lowercase, UPPERCASE;
@@
OBJECT_DECLARE_TYPE(InstanceType, ClassType,
- lowercase,
UPPERCASE);
@@
declarer name OBJECT_DECLARE_SIMPLE_TYPE;
identifier InstanceType, lowercase, UPPERCASE;
@@
OBJECT_DECLARE_SIMPLE_TYPE(InstanceType,
- lowercase,
UPPERCASE);
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Acked-by: Cornelia Huck <cohuck@redhat.com>
Acked-by: Igor Mammedov <imammedo@redhat.com>
Acked-by: Paul Durrant <paul@xen.org>
Acked-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20200916182519.415636-4-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2020-09-16 21:25:17 +03:00
|
|
|
PNV_OCC)
|
2019-03-08 01:35:41 +03:00
|
|
|
#define TYPE_PNV8_OCC TYPE_PNV_OCC "-POWER8"
|
2020-09-01 00:07:33 +03:00
|
|
|
DECLARE_INSTANCE_CHECKER(PnvOCC, PNV8_OCC,
|
|
|
|
TYPE_PNV8_OCC)
|
2019-03-08 01:35:42 +03:00
|
|
|
#define TYPE_PNV9_OCC TYPE_PNV_OCC "-POWER9"
|
2020-09-01 00:07:33 +03:00
|
|
|
DECLARE_INSTANCE_CHECKER(PnvOCC, PNV9_OCC,
|
|
|
|
TYPE_PNV9_OCC)
|
2017-04-05 15:41:27 +03:00
|
|
|
|
2019-12-11 11:29:12 +03:00
|
|
|
#define PNV_OCC_SENSOR_DATA_BLOCK_OFFSET 0x00580000
|
|
|
|
#define PNV_OCC_SENSOR_DATA_BLOCK_SIZE 0x00025800
|
|
|
|
|
2020-09-03 23:43:22 +03:00
|
|
|
struct PnvOCC {
|
2017-04-05 15:41:27 +03:00
|
|
|
DeviceState xd;
|
|
|
|
|
|
|
|
/* OCC Misc interrupt */
|
|
|
|
uint64_t occmisc;
|
|
|
|
|
|
|
|
PnvPsi *psi;
|
|
|
|
|
|
|
|
MemoryRegion xscom_regs;
|
2019-09-12 12:30:53 +03:00
|
|
|
MemoryRegion sram_regs;
|
2020-09-03 23:43:22 +03:00
|
|
|
};
|
2017-04-05 15:41:27 +03:00
|
|
|
|
2019-03-08 01:35:41 +03:00
|
|
|
|
2020-09-03 23:43:22 +03:00
|
|
|
struct PnvOCCClass {
|
2019-03-08 01:35:41 +03:00
|
|
|
DeviceClass parent_class;
|
|
|
|
|
|
|
|
int xscom_size;
|
|
|
|
const MemoryRegionOps *xscom_ops;
|
|
|
|
int psi_irq;
|
2020-09-03 23:43:22 +03:00
|
|
|
};
|
2019-03-08 01:35:41 +03:00
|
|
|
|
2019-12-11 11:29:12 +03:00
|
|
|
#define PNV_OCC_SENSOR_DATA_BLOCK_BASE(i) \
|
|
|
|
(PNV_OCC_SENSOR_DATA_BLOCK_OFFSET + (i) * PNV_OCC_SENSOR_DATA_BLOCK_SIZE)
|
|
|
|
|
2019-03-15 17:51:21 +03:00
|
|
|
#endif /* PPC_PNV_OCC_H */
|