1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20#ifndef PPC_PNV_LPC_H
21#define PPC_PNV_LPC_H
22
23#include "exec/memory.h"
24#include "hw/ppc/pnv.h"
25#include "hw/qdev-core.h"
26
27#define TYPE_PNV_LPC "pnv-lpc"
28typedef struct PnvLpcClass PnvLpcClass;
29typedef struct PnvLpcController PnvLpcController;
30DECLARE_OBJ_CHECKERS(PnvLpcController, PnvLpcClass,
31 PNV_LPC, TYPE_PNV_LPC)
32#define TYPE_PNV8_LPC TYPE_PNV_LPC "-POWER8"
33DECLARE_INSTANCE_CHECKER(PnvLpcController, PNV8_LPC,
34 TYPE_PNV8_LPC)
35
36#define TYPE_PNV9_LPC TYPE_PNV_LPC "-POWER9"
37DECLARE_INSTANCE_CHECKER(PnvLpcController, PNV9_LPC,
38 TYPE_PNV9_LPC)
39
40#define TYPE_PNV10_LPC TYPE_PNV_LPC "-POWER10"
41DECLARE_INSTANCE_CHECKER(PnvLpcController, PNV10_LPC,
42 TYPE_PNV10_LPC)
43
44struct PnvLpcController {
45 DeviceState parent;
46
47 uint64_t eccb_stat_reg;
48 uint32_t eccb_data_reg;
49
50
51 MemoryRegion opb_mr;
52 AddressSpace opb_as;
53
54
55 MemoryRegion isa_io;
56 MemoryRegion isa_mem;
57 MemoryRegion isa_fw;
58
59
60 MemoryRegion opb_isa_io;
61 MemoryRegion opb_isa_mem;
62 MemoryRegion opb_isa_fw;
63
64
65 MemoryRegion lpc_hc_regs;
66 MemoryRegion opb_master_regs;
67
68
69 uint32_t opb_irq_route0;
70 uint32_t opb_irq_route1;
71 uint32_t opb_irq_stat;
72 uint32_t opb_irq_mask;
73 uint32_t opb_irq_pol;
74 uint32_t opb_irq_input;
75
76
77 uint32_t lpc_hc_fw_seg_idsel;
78 uint32_t lpc_hc_fw_rd_acc_size;
79 uint32_t lpc_hc_irqser_ctrl;
80 uint32_t lpc_hc_irqmask;
81 uint32_t lpc_hc_irqstat;
82 uint32_t lpc_hc_error_addr;
83
84
85 MemoryRegion xscom_regs;
86
87
88 qemu_irq psi_irq;
89};
90
91struct PnvLpcClass {
92 DeviceClass parent_class;
93
94 DeviceRealize parent_realize;
95};
96
97ISABus *pnv_lpc_isa_create(PnvLpcController *lpc, bool use_cpld, Error **errp);
98int pnv_dt_lpc(PnvChip *chip, void *fdt, int root_offset,
99 uint64_t lpcm_addr, uint64_t lpcm_size);
100
101#endif
102