xref: /openbmc/qemu/include/hw/ppc/pnv_i2c.h (revision a3c3aaa846ad61b801e7196482dcf4afb8ba34e4)
1*263b81eeSCédric Le Goater /*
2*263b81eeSCédric Le Goater  * QEMU PowerPC PowerNV Processor I2C model
3*263b81eeSCédric Le Goater  *
4*263b81eeSCédric Le Goater  * Copyright (c) 2019-2023, IBM Corporation.
5*263b81eeSCédric Le Goater  *
6*263b81eeSCédric Le Goater  * SPDX-License-Identifier: GPL-2.0-or-later
7*263b81eeSCédric Le Goater  */
8*263b81eeSCédric Le Goater 
9*263b81eeSCédric Le Goater #ifndef PPC_PNV_I2C_H
10*263b81eeSCédric Le Goater #define PPC_PNV_I2C_H
11*263b81eeSCédric Le Goater 
12*263b81eeSCédric Le Goater #include "hw/ppc/pnv.h"
13*263b81eeSCédric Le Goater #include "hw/i2c/i2c.h"
14*263b81eeSCédric Le Goater #include "qemu/fifo8.h"
15*263b81eeSCédric Le Goater 
16*263b81eeSCédric Le Goater #define TYPE_PNV_I2C "pnv-i2c"
17*263b81eeSCédric Le Goater #define PNV_I2C(obj) OBJECT_CHECK(PnvI2C, (obj), TYPE_PNV_I2C)
18*263b81eeSCédric Le Goater 
19*263b81eeSCédric Le Goater #define PNV_I2C_REGS 0x20
20*263b81eeSCédric Le Goater 
21*263b81eeSCédric Le Goater typedef struct PnvI2C {
22*263b81eeSCédric Le Goater     DeviceState parent;
23*263b81eeSCédric Le Goater 
24*263b81eeSCédric Le Goater     struct PnvChip *chip;
25*263b81eeSCédric Le Goater 
26*263b81eeSCédric Le Goater     qemu_irq psi_irq;
27*263b81eeSCédric Le Goater 
28*263b81eeSCédric Le Goater     uint64_t regs[PNV_I2C_REGS];
29*263b81eeSCédric Le Goater     uint32_t engine;
30*263b81eeSCédric Le Goater     uint32_t num_busses;
31*263b81eeSCédric Le Goater     I2CBus **busses;
32*263b81eeSCédric Le Goater 
33*263b81eeSCédric Le Goater     MemoryRegion xscom_regs;
34*263b81eeSCédric Le Goater 
35*263b81eeSCédric Le Goater     Fifo8 fifo;
36*263b81eeSCédric Le Goater } PnvI2C;
37*263b81eeSCédric Le Goater 
38*263b81eeSCédric Le Goater #endif /* PPC_PNV_I2C_H */
39