2017-04-05 15:41:26 +03:00
|
|
|
/*
|
|
|
|
* QEMU PowerPC PowerNV Processor Service Interface (PSI) model
|
|
|
|
*
|
2022-03-23 10:28:42 +03:00
|
|
|
* Copyright (c) 2015-2022, IBM Corporation.
|
2017-04-05 15:41:26 +03:00
|
|
|
*
|
|
|
|
* 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:26 +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_PSI_H
|
|
|
|
#define PPC_PNV_PSI_H
|
2017-04-05 15:41:26 +03:00
|
|
|
|
|
|
|
#include "hw/sysbus.h"
|
|
|
|
#include "hw/ppc/xics.h"
|
2019-03-08 01:35:35 +03:00
|
|
|
#include "hw/ppc/xive.h"
|
2022-12-22 15:08:11 +03:00
|
|
|
#include "hw/qdev-core.h"
|
2017-04-05 15:41:26 +03:00
|
|
|
|
|
|
|
#define TYPE_PNV_PSI "pnv-psi"
|
2020-09-01 00:07:37 +03:00
|
|
|
OBJECT_DECLARE_TYPE(PnvPsi, PnvPsiClass,
|
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_PSI)
|
2017-04-05 15:41:26 +03:00
|
|
|
|
|
|
|
#define PSIHB_XSCOM_MAX 0x20
|
|
|
|
|
2020-09-03 23:43:22 +03:00
|
|
|
struct PnvPsi {
|
2020-06-09 15:23:32 +03:00
|
|
|
DeviceState parent;
|
2017-04-05 15:41:26 +03:00
|
|
|
|
|
|
|
MemoryRegion regs_mr;
|
|
|
|
uint64_t bar;
|
|
|
|
|
|
|
|
/* FSP region not supported */
|
|
|
|
/* MemoryRegion fsp_mr; */
|
|
|
|
uint64_t fsp_bar;
|
|
|
|
|
|
|
|
/* Interrupt generation */
|
2019-01-02 08:57:39 +03:00
|
|
|
qemu_irq *qirqs;
|
2017-04-05 15:41:26 +03:00
|
|
|
|
|
|
|
/* Registers */
|
|
|
|
uint64_t regs[PSIHB_XSCOM_MAX];
|
|
|
|
|
|
|
|
MemoryRegion xscom_regs;
|
2020-09-03 23:43:22 +03:00
|
|
|
};
|
2017-04-05 15:41:26 +03:00
|
|
|
|
2019-03-08 01:35:34 +03:00
|
|
|
#define TYPE_PNV8_PSI TYPE_PNV_PSI "-POWER8"
|
2020-09-16 21:25:19 +03:00
|
|
|
OBJECT_DECLARE_SIMPLE_TYPE(Pnv8Psi, PNV8_PSI)
|
2019-03-08 01:35:34 +03:00
|
|
|
|
2020-09-03 23:43:22 +03:00
|
|
|
struct Pnv8Psi {
|
2019-03-08 01:35:34 +03:00
|
|
|
PnvPsi parent;
|
|
|
|
|
|
|
|
ICSState ics;
|
2020-09-03 23:43:22 +03:00
|
|
|
};
|
2019-03-08 01:35:34 +03:00
|
|
|
|
2019-03-08 01:35:35 +03:00
|
|
|
#define TYPE_PNV9_PSI TYPE_PNV_PSI "-POWER9"
|
2020-09-16 21:25:19 +03:00
|
|
|
OBJECT_DECLARE_SIMPLE_TYPE(Pnv9Psi, PNV9_PSI)
|
2019-03-08 01:35:35 +03:00
|
|
|
|
2020-09-03 23:43:22 +03:00
|
|
|
struct Pnv9Psi {
|
2019-03-08 01:35:35 +03:00
|
|
|
PnvPsi parent;
|
|
|
|
|
|
|
|
XiveSource source;
|
2020-09-03 23:43:22 +03:00
|
|
|
};
|
2019-03-08 01:35:35 +03:00
|
|
|
|
2019-12-05 21:44:53 +03:00
|
|
|
#define TYPE_PNV10_PSI TYPE_PNV_PSI "-POWER10"
|
|
|
|
|
2019-03-08 01:35:34 +03:00
|
|
|
|
2020-09-03 23:43:22 +03:00
|
|
|
struct PnvPsiClass {
|
2019-03-08 01:35:34 +03:00
|
|
|
SysBusDeviceClass parent_class;
|
|
|
|
|
|
|
|
uint32_t xscom_pcba;
|
|
|
|
uint32_t xscom_size;
|
|
|
|
uint64_t bar_mask;
|
2019-12-13 14:59:39 +03:00
|
|
|
const char *compat;
|
|
|
|
int compat_size;
|
2020-09-03 23:43:22 +03:00
|
|
|
};
|
2019-03-08 01:35:34 +03:00
|
|
|
|
2017-04-05 15:41:26 +03:00
|
|
|
/* The PSI and FSP interrupts are muxed on the same IRQ number */
|
|
|
|
typedef enum PnvPsiIrq {
|
|
|
|
PSIHB_IRQ_FSP, /* internal use only */
|
|
|
|
PSIHB_IRQ_OCC,
|
|
|
|
PSIHB_IRQ_FSI,
|
|
|
|
PSIHB_IRQ_LPC_I2C,
|
|
|
|
PSIHB_IRQ_LOCAL_ERR,
|
|
|
|
PSIHB_IRQ_EXTERNAL,
|
|
|
|
} PnvPsiIrq;
|
|
|
|
|
|
|
|
#define PSI_NUM_INTERRUPTS 6
|
|
|
|
|
2019-03-08 01:35:35 +03:00
|
|
|
/* P9 PSI Interrupts */
|
|
|
|
#define PSIHB9_IRQ_PSI 0
|
|
|
|
#define PSIHB9_IRQ_OCC 1
|
|
|
|
#define PSIHB9_IRQ_FSI 2
|
|
|
|
#define PSIHB9_IRQ_LPCHC 3
|
|
|
|
#define PSIHB9_IRQ_LOCAL_ERR 4
|
|
|
|
#define PSIHB9_IRQ_GLOBAL_ERR 5
|
|
|
|
#define PSIHB9_IRQ_TPM 6
|
|
|
|
#define PSIHB9_IRQ_LPC_SIRQ0 7
|
|
|
|
#define PSIHB9_IRQ_LPC_SIRQ1 8
|
|
|
|
#define PSIHB9_IRQ_LPC_SIRQ2 9
|
|
|
|
#define PSIHB9_IRQ_LPC_SIRQ3 10
|
|
|
|
#define PSIHB9_IRQ_SBE_I2C 11
|
|
|
|
#define PSIHB9_IRQ_DIO 12
|
|
|
|
#define PSIHB9_IRQ_PSU 13
|
|
|
|
#define PSIHB9_NUM_IRQS 14
|
|
|
|
|
|
|
|
void pnv_psi_pic_print_info(Pnv9Psi *psi, Monitor *mon);
|
|
|
|
|
2019-03-15 17:51:21 +03:00
|
|
|
#endif /* PPC_PNV_PSI_H */
|