master
h 61 lines 1.78 KB
Raw
1 /*
2 * QEMU PowerPC PowerNV Emulation of a few HOMER related registers
3 *
4 * Copyright (c) 2019, 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.1 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
20 #ifndef PPC_PNV_HOMER_H
21 #define PPC_PNV_HOMER_H
22
23 #include "hw/ppc/pnv.h"
24 #include "qom/object.h"
25
26 #define TYPE_PNV_HOMER "pnv-homer"
27 OBJECT_DECLARE_TYPE(PnvHomer, PnvHomerClass,
28 PNV_HOMER)
29 #define TYPE_PNV8_HOMER TYPE_PNV_HOMER "-POWER8"
30 DECLARE_INSTANCE_CHECKER(PnvHomer, PNV8_HOMER,
31 TYPE_PNV8_HOMER)
32 #define TYPE_PNV9_HOMER TYPE_PNV_HOMER "-POWER9"
33 DECLARE_INSTANCE_CHECKER(PnvHomer, PNV9_HOMER,
34 TYPE_PNV9_HOMER)
35 #define TYPE_PNV10_HOMER TYPE_PNV_HOMER "-POWER10"
36 DECLARE_INSTANCE_CHECKER(PnvHomer, PNV10_HOMER,
37 TYPE_PNV10_HOMER)
38
39 struct PnvHomer {
40 DeviceState parent;
41
42 PnvChip *chip;
43 MemoryRegion pba_regs;
44 MemoryRegion mem;
45 hwaddr base;
46 };
47
48
49 struct PnvHomerClass {
50 DeviceClass parent_class;
51
52 /* Get base address of HOMER memory */
53 hwaddr (*get_base)(PnvChip *chip);
54 /* Size of HOMER memory */
55 int size;
56
57 int pba_size;
58 const MemoryRegionOps *pba_ops;
59 };
60
61 #endif /* PPC_PNV_HOMER_H */