ppc/pnv: add a PSI bridge model for POWER9
[qemu/ar7.git] / include / hw / ppc / pnv_xscom.h
blob403a365ed27449afc11ae4d878a0624cff0cdb75
1 /*
2 * QEMU PowerPC PowerNV XSCOM bus definitions
4 * Copyright (c) 2016, IBM Corporation.
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
19 #ifndef _PPC_PNV_XSCOM_H
20 #define _PPC_PNV_XSCOM_H
22 #include "qom/object.h"
24 typedef struct PnvXScomInterface {
25 Object parent;
26 } PnvXScomInterface;
28 #define TYPE_PNV_XSCOM_INTERFACE "pnv-xscom-interface"
29 #define PNV_XSCOM_INTERFACE(obj) \
30 OBJECT_CHECK(PnvXScomInterface, (obj), TYPE_PNV_XSCOM_INTERFACE)
31 #define PNV_XSCOM_INTERFACE_CLASS(klass) \
32 OBJECT_CLASS_CHECK(PnvXScomInterfaceClass, (klass), \
33 TYPE_PNV_XSCOM_INTERFACE)
34 #define PNV_XSCOM_INTERFACE_GET_CLASS(obj) \
35 OBJECT_GET_CLASS(PnvXScomInterfaceClass, (obj), TYPE_PNV_XSCOM_INTERFACE)
37 typedef struct PnvXScomInterfaceClass {
38 InterfaceClass parent;
39 int (*dt_xscom)(PnvXScomInterface *dev, void *fdt, int offset);
40 } PnvXScomInterfaceClass;
43 * Layout of the XSCOM PCB addresses of EX core 1 (POWER 8)
45 * GPIO 0x1100xxxx
46 * SCOM 0x1101xxxx
47 * OHA 0x1102xxxx
48 * CLOCK CTL 0x1103xxxx
49 * FIR 0x1104xxxx
50 * THERM 0x1105xxxx
51 * <reserved> 0x1106xxxx
52 * ..
53 * 0x110Exxxx
54 * PCB SLAVE 0x110Fxxxx
57 #define PNV_XSCOM_EX_CORE_BASE 0x10000000ull
59 #define PNV_XSCOM_EX_BASE(core) \
60 (PNV_XSCOM_EX_CORE_BASE | ((uint64_t)(core) << 24))
61 #define PNV_XSCOM_EX_SIZE 0x100000
63 #define PNV_XSCOM_P9_EC_BASE(core) \
64 ((uint64_t)(((core) & 0x1F) + 0x20) << 24)
65 #define PNV_XSCOM_P9_EC_SIZE 0x100000
67 #define PNV_XSCOM_LPC_BASE 0xb0020
68 #define PNV_XSCOM_LPC_SIZE 0x4
70 #define PNV_XSCOM_PSIHB_BASE 0x2010900
71 #define PNV_XSCOM_PSIHB_SIZE 0x20
73 #define PNV_XSCOM_OCC_BASE 0x0066000
74 #define PNV_XSCOM_OCC_SIZE 0x6000
76 #define PNV9_XSCOM_PSIHB_BASE 0x5012900
77 #define PNV9_XSCOM_PSIHB_SIZE 0x100
79 #define PNV9_XSCOM_XIVE_BASE 0x5013000
80 #define PNV9_XSCOM_XIVE_SIZE 0x300
82 extern void pnv_xscom_realize(PnvChip *chip, Error **errp);
83 extern int pnv_dt_xscom(PnvChip *chip, void *fdt, int offset);
85 extern void pnv_xscom_add_subregion(PnvChip *chip, hwaddr offset,
86 MemoryRegion *mr);
87 extern void pnv_xscom_region_init(MemoryRegion *mr,
88 struct Object *owner,
89 const MemoryRegionOps *ops,
90 void *opaque,
91 const char *name,
92 uint64_t size);
94 #endif /* _PPC_PNV_XSCOM_H */