]> git.proxmox.com Git - mirror_qemu.git/blame - include/hw/ppc/pnv_xscom.h
ppc/pnv: add XSCOM infrastructure
[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 */
19#ifndef _PPC_PNV_XSCOM_H
20#define _PPC_PNV_XSCOM_H
21
22#include "qom/object.h"
23
24typedef struct PnvChip PnvChip;
25
26typedef struct PnvXScomInterface {
27 Object parent;
28} PnvXScomInterface;
29
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)
38
39typedef struct PnvXScomInterfaceClass {
40 InterfaceClass parent;
41 int (*populate)(PnvXScomInterface *dev, void *fdt, int offset);
42} PnvXScomInterfaceClass;
43
44extern void pnv_xscom_realize(PnvChip *chip, Error **errp);
45extern int pnv_xscom_populate(PnvChip *chip, void *fdt, int offset);
46
47extern void pnv_xscom_add_subregion(PnvChip *chip, hwaddr offset,
48 MemoryRegion *mr);
49extern 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);
55
56#endif /* _PPC_PNV_XSCOM_H */