2016-10-22 12:46:42 +03:00
|
|
|
/*
|
|
|
|
* QEMU PowerPC PowerNV LPC controller
|
|
|
|
*
|
|
|
|
* Copyright (c) 2016, IBM Corporation.
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2019-03-15 17:51:21 +03:00
|
|
|
|
|
|
|
#ifndef PPC_PNV_LPC_H
|
|
|
|
#define PPC_PNV_LPC_H
|
2016-10-22 12:46:42 +03:00
|
|
|
|
2017-05-10 09:46:01 +03:00
|
|
|
#include "hw/ppc/pnv_psi.h"
|
|
|
|
|
2016-10-22 12:46:42 +03:00
|
|
|
#define TYPE_PNV_LPC "pnv-lpc"
|
|
|
|
#define PNV_LPC(obj) \
|
|
|
|
OBJECT_CHECK(PnvLpcController, (obj), TYPE_PNV_LPC)
|
2019-03-08 01:35:37 +03:00
|
|
|
#define TYPE_PNV8_LPC TYPE_PNV_LPC "-POWER8"
|
|
|
|
#define PNV8_LPC(obj) OBJECT_CHECK(PnvLpcController, (obj), TYPE_PNV8_LPC)
|
2016-10-22 12:46:42 +03:00
|
|
|
|
2019-03-08 01:35:39 +03:00
|
|
|
#define TYPE_PNV9_LPC TYPE_PNV_LPC "-POWER9"
|
|
|
|
#define PNV9_LPC(obj) OBJECT_CHECK(PnvLpcController, (obj), TYPE_PNV9_LPC)
|
|
|
|
|
2016-10-22 12:46:42 +03:00
|
|
|
typedef struct PnvLpcController {
|
|
|
|
DeviceState parent;
|
|
|
|
|
|
|
|
uint64_t eccb_stat_reg;
|
|
|
|
uint32_t eccb_data_reg;
|
|
|
|
|
|
|
|
/* OPB bus */
|
|
|
|
MemoryRegion opb_mr;
|
|
|
|
AddressSpace opb_as;
|
|
|
|
|
|
|
|
/* ISA IO and Memory space */
|
|
|
|
MemoryRegion isa_io;
|
|
|
|
MemoryRegion isa_mem;
|
2018-06-11 20:12:10 +03:00
|
|
|
MemoryRegion isa_fw;
|
2016-10-22 12:46:42 +03:00
|
|
|
|
|
|
|
/* Windows from OPB to ISA (aliases) */
|
|
|
|
MemoryRegion opb_isa_io;
|
|
|
|
MemoryRegion opb_isa_mem;
|
|
|
|
MemoryRegion opb_isa_fw;
|
|
|
|
|
|
|
|
/* Registers */
|
|
|
|
MemoryRegion lpc_hc_regs;
|
|
|
|
MemoryRegion opb_master_regs;
|
|
|
|
|
|
|
|
/* OPB Master LS registers */
|
2019-03-08 01:35:40 +03:00
|
|
|
uint32_t opb_irq_route0;
|
|
|
|
uint32_t opb_irq_route1;
|
2016-10-22 12:46:42 +03:00
|
|
|
uint32_t opb_irq_stat;
|
|
|
|
uint32_t opb_irq_mask;
|
|
|
|
uint32_t opb_irq_pol;
|
|
|
|
uint32_t opb_irq_input;
|
|
|
|
|
|
|
|
/* LPC HC registers */
|
|
|
|
uint32_t lpc_hc_fw_seg_idsel;
|
|
|
|
uint32_t lpc_hc_fw_rd_acc_size;
|
|
|
|
uint32_t lpc_hc_irqser_ctrl;
|
|
|
|
uint32_t lpc_hc_irqmask;
|
|
|
|
uint32_t lpc_hc_irqstat;
|
|
|
|
uint32_t lpc_hc_error_addr;
|
|
|
|
|
|
|
|
/* XSCOM registers */
|
|
|
|
MemoryRegion xscom_regs;
|
2017-04-11 18:29:59 +03:00
|
|
|
|
|
|
|
/* PSI to generate interrupts */
|
|
|
|
PnvPsi *psi;
|
2016-10-22 12:46:42 +03:00
|
|
|
} PnvLpcController;
|
|
|
|
|
2019-03-08 01:35:37 +03:00
|
|
|
#define PNV_LPC_CLASS(klass) \
|
|
|
|
OBJECT_CLASS_CHECK(PnvLpcClass, (klass), TYPE_PNV_LPC)
|
|
|
|
#define PNV_LPC_GET_CLASS(obj) \
|
|
|
|
OBJECT_GET_CLASS(PnvLpcClass, (obj), TYPE_PNV_LPC)
|
|
|
|
|
|
|
|
typedef struct PnvLpcClass {
|
|
|
|
DeviceClass parent_class;
|
|
|
|
|
|
|
|
int psi_irq;
|
|
|
|
|
|
|
|
DeviceRealize parent_realize;
|
|
|
|
} PnvLpcClass;
|
|
|
|
|
2019-03-08 01:35:39 +03:00
|
|
|
/*
|
|
|
|
* Old compilers error on typdef forward declarations. Keep them happy.
|
|
|
|
*/
|
|
|
|
struct PnvChip;
|
|
|
|
|
2018-06-15 18:25:34 +03:00
|
|
|
ISABus *pnv_lpc_isa_create(PnvLpcController *lpc, bool use_cpld, Error **errp);
|
2019-03-08 01:35:39 +03:00
|
|
|
int pnv_dt_lpc(struct PnvChip *chip, void *fdt, int root_offset);
|
2017-04-11 18:29:59 +03:00
|
|
|
|
2019-03-15 17:51:21 +03:00
|
|
|
#endif /* PPC_PNV_LPC_H */
|