ppc/pnv: add XSCOM infrastructure
[qemu/ar7.git] / include / hw / ppc / pnv_xscom.h
blobee25ec455e3fc96456fac381810ae05b3f6200ec
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 PnvChip PnvChip;
26 typedef struct PnvXScomInterface {
27 Object parent;
28 } PnvXScomInterface;
30 #define TYPE_PNV_XSCOM_INTERFACE "pnv-xscom-interface"
31 #define PNV_XSCOM_INTERFACE(obj) \
32 OBJECT_CHECK(PnvXScomInterface, (obj), TYPE_PNV_XSCOM_INTERFACE)
33 #define PNV_XSCOM_INTERFACE_CLASS(klass) \
34 OBJECT_CLASS_CHECK(PnvXScomInterfaceClass, (klass), \
35 TYPE_PNV_XSCOM_INTERFACE)
36 #define PNV_XSCOM_INTERFACE_GET_CLASS(obj) \
37 OBJECT_GET_CLASS(PnvXScomInterfaceClass, (obj), TYPE_PNV_XSCOM_INTERFACE)
39 typedef struct PnvXScomInterfaceClass {
40 InterfaceClass parent;
41 int (*populate)(PnvXScomInterface *dev, void *fdt, int offset);
42 } PnvXScomInterfaceClass;
44 extern void pnv_xscom_realize(PnvChip *chip, Error **errp);
45 extern int pnv_xscom_populate(PnvChip *chip, void *fdt, int offset);
47 extern void pnv_xscom_add_subregion(PnvChip *chip, hwaddr offset,
48 MemoryRegion *mr);
49 extern void pnv_xscom_region_init(MemoryRegion *mr,
50 struct Object *owner,
51 const MemoryRegionOps *ops,
52 void *opaque,
53 const char *name,
54 uint64_t size);
56 #endif /* _PPC_PNV_XSCOM_H */