]> git.proxmox.com Git - mirror_qemu.git/blame - include/hw/ppc/pnv_xscom.h
Merge remote-tracking branch 'remotes/vivier2/tags/trivial-branch-pull-request' into...
[mirror_qemu.git] / include / hw / ppc / pnv_xscom.h
CommitLineData
967b7523
CLG
1/*
2 * QEMU PowerPC PowerNV XSCOM bus definitions
3 *
4 * Copyright (c) 2016, IBM Corporation.
5 *
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.
10 *
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.
15 *
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/>.
18 */
a8b991b5
MA
19
20#ifndef PPC_PNV_XSCOM_H
21#define PPC_PNV_XSCOM_H
967b7523
CLG
22
23#include "qom/object.h"
24
967b7523
CLG
25typedef struct PnvXScomInterface {
26 Object parent;
27} PnvXScomInterface;
28
29#define TYPE_PNV_XSCOM_INTERFACE "pnv-xscom-interface"
30#define PNV_XSCOM_INTERFACE(obj) \
31 OBJECT_CHECK(PnvXScomInterface, (obj), TYPE_PNV_XSCOM_INTERFACE)
32#define PNV_XSCOM_INTERFACE_CLASS(klass) \
33 OBJECT_CLASS_CHECK(PnvXScomInterfaceClass, (klass), \
34 TYPE_PNV_XSCOM_INTERFACE)
35#define PNV_XSCOM_INTERFACE_GET_CLASS(obj) \
36 OBJECT_GET_CLASS(PnvXScomInterfaceClass, (obj), TYPE_PNV_XSCOM_INTERFACE)
37
38typedef struct PnvXScomInterfaceClass {
39 InterfaceClass parent;
b168a138 40 int (*dt_xscom)(PnvXScomInterface *dev, void *fdt, int offset);
967b7523
CLG
41} PnvXScomInterfaceClass;
42
24ece072 43/*
ad521238 44 * Layout of the XSCOM PCB addresses of EX core 1 (POWER 8)
24ece072
CLG
45 *
46 * GPIO 0x1100xxxx
47 * SCOM 0x1101xxxx
48 * OHA 0x1102xxxx
49 * CLOCK CTL 0x1103xxxx
50 * FIR 0x1104xxxx
51 * THERM 0x1105xxxx
52 * <reserved> 0x1106xxxx
53 * ..
54 * 0x110Exxxx
55 * PCB SLAVE 0x110Fxxxx
56 */
57
c035851a
CLG
58#define PNV_XSCOM_EX_CORE_BASE 0x10000000ull
59
60#define PNV_XSCOM_EX_BASE(core) \
61 (PNV_XSCOM_EX_CORE_BASE | ((uint64_t)(core) << 24))
62#define PNV_XSCOM_EX_SIZE 0x100000
63
a3980bf5
BH
64#define PNV_XSCOM_LPC_BASE 0xb0020
65#define PNV_XSCOM_LPC_SIZE 0x4
66
54f59d78
CLG
67#define PNV_XSCOM_PSIHB_BASE 0x2010900
68#define PNV_XSCOM_PSIHB_SIZE 0x20
69
0722d05a
BH
70#define PNV_XSCOM_OCC_BASE 0x0066000
71#define PNV_XSCOM_OCC_SIZE 0x6000
72
5dad902c
CLG
73#define PNV9_XSCOM_EC_BASE(core) \
74 ((uint64_t)(((core) & 0x1F) + 0x20) << 24)
75#define PNV9_XSCOM_EC_SIZE 0x100000
76
77#define PNV9_XSCOM_EQ_BASE(core) \
78 ((uint64_t)(((core) & 0x1C) + 0x40) << 22)
79#define PNV9_XSCOM_EQ_SIZE 0x100000
80
6598a70d
CLG
81#define PNV9_XSCOM_OCC_BASE PNV_XSCOM_OCC_BASE
82#define PNV9_XSCOM_OCC_SIZE 0x8000
83
c38536bc
CLG
84#define PNV9_XSCOM_PSIHB_BASE 0x5012900
85#define PNV9_XSCOM_PSIHB_SIZE 0x100
86
2dfa91a2
CLG
87#define PNV9_XSCOM_XIVE_BASE 0x5013000
88#define PNV9_XSCOM_XIVE_SIZE 0x300
89
709044fd 90extern void pnv_xscom_realize(PnvChip *chip, uint64_t size, Error **errp);
b168a138 91extern int pnv_dt_xscom(PnvChip *chip, void *fdt, int offset);
967b7523
CLG
92
93extern void pnv_xscom_add_subregion(PnvChip *chip, hwaddr offset,
94 MemoryRegion *mr);
95extern void pnv_xscom_region_init(MemoryRegion *mr,
96 struct Object *owner,
97 const MemoryRegionOps *ops,
98 void *opaque,
99 const char *name,
100 uint64_t size);
101
a8b991b5 102#endif /* PPC_PNV_XSCOM_H */