spapr: Simplify error handling in spapr_phb_realize()
[qemu/ar7.git] / include / hw / ppc / pnv_homer.h
blob1e91c950f691413dc7921683a0eda2ad1ed32d2b
1 /*
2 * QEMU PowerPC PowerNV Emulation of a few HOMER related registers
4 * Copyright (c) 2019, 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/>.
20 #ifndef PPC_PNV_HOMER_H
21 #define PPC_PNV_HOMER_H
23 #include "hw/ppc/pnv.h"
25 #define TYPE_PNV_HOMER "pnv-homer"
26 #define PNV_HOMER(obj) OBJECT_CHECK(PnvHomer, (obj), TYPE_PNV_HOMER)
27 #define TYPE_PNV8_HOMER TYPE_PNV_HOMER "-POWER8"
28 #define PNV8_HOMER(obj) OBJECT_CHECK(PnvHomer, (obj), TYPE_PNV8_HOMER)
29 #define TYPE_PNV9_HOMER TYPE_PNV_HOMER "-POWER9"
30 #define PNV9_HOMER(obj) OBJECT_CHECK(PnvHomer, (obj), TYPE_PNV9_HOMER)
32 typedef struct PnvHomer {
33 DeviceState parent;
35 struct PnvChip *chip;
36 MemoryRegion pba_regs;
37 MemoryRegion regs;
38 } PnvHomer;
40 #define PNV_HOMER_CLASS(klass) \
41 OBJECT_CLASS_CHECK(PnvHomerClass, (klass), TYPE_PNV_HOMER)
42 #define PNV_HOMER_GET_CLASS(obj) \
43 OBJECT_GET_CLASS(PnvHomerClass, (obj), TYPE_PNV_HOMER)
45 typedef struct PnvHomerClass {
46 DeviceClass parent_class;
48 int pba_size;
49 const MemoryRegionOps *pba_ops;
50 int homer_size;
51 const MemoryRegionOps *homer_ops;
53 hwaddr core_max_base;
54 } PnvHomerClass;
56 #endif /* PPC_PNV_HOMER_H */