2016-10-22 11:46:42 +02:00
|
|
|
/*
|
|
|
|
* QEMU PowerPC PowerNV LPC controller
|
|
|
|
*
|
2022-03-23 08:28:43 +01:00
|
|
|
* Copyright (c) 2016-2022, IBM Corporation.
|
2016-10-22 11:46:42 +02:00
|
|
|
*
|
|
|
|
* 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
|
2020-10-16 16:53:46 +02:00
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
2016-10-22 11:46:42 +02:00
|
|
|
*
|
|
|
|
* 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 15:51:21 +01:00
|
|
|
|
|
|
|
#ifndef PPC_PNV_LPC_H
|
|
|
|
#define PPC_PNV_LPC_H
|
2016-10-22 11:46:42 +02:00
|
|
|
|
2020-09-03 22:43:22 +02:00
|
|
|
#include "qom/object.h"
|
2017-05-10 08:46:01 +02:00
|
|
|
|
2016-10-22 11:46:42 +02:00
|
|
|
#define TYPE_PNV_LPC "pnv-lpc"
|
2020-09-03 22:43:22 +02:00
|
|
|
typedef struct PnvLpcClass PnvLpcClass;
|
|
|
|
typedef struct PnvLpcController PnvLpcController;
|
2020-08-31 23:07:33 +02:00
|
|
|
DECLARE_OBJ_CHECKERS(PnvLpcController, PnvLpcClass,
|
|
|
|
PNV_LPC, TYPE_PNV_LPC)
|
2019-03-07 23:35:37 +01:00
|
|
|
#define TYPE_PNV8_LPC TYPE_PNV_LPC "-POWER8"
|
2020-08-31 23:07:33 +02:00
|
|
|
DECLARE_INSTANCE_CHECKER(PnvLpcController, PNV8_LPC,
|
|
|
|
TYPE_PNV8_LPC)
|
2016-10-22 11:46:42 +02:00
|
|
|
|
2019-03-07 23:35:39 +01:00
|
|
|
#define TYPE_PNV9_LPC TYPE_PNV_LPC "-POWER9"
|
2020-08-31 23:07:33 +02:00
|
|
|
DECLARE_INSTANCE_CHECKER(PnvLpcController, PNV9_LPC,
|
|
|
|
TYPE_PNV9_LPC)
|
2019-03-07 23:35:39 +01:00
|
|
|
|
2019-12-05 19:44:54 +01:00
|
|
|
#define TYPE_PNV10_LPC TYPE_PNV_LPC "-POWER10"
|
2020-08-31 23:07:33 +02:00
|
|
|
DECLARE_INSTANCE_CHECKER(PnvLpcController, PNV10_LPC,
|
|
|
|
TYPE_PNV10_LPC)
|
2019-12-05 19:44:54 +01:00
|
|
|
|
2020-09-03 22:43:22 +02:00
|
|
|
struct PnvLpcController {
|
2016-10-22 11:46:42 +02:00
|
|
|
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 19:12:10 +02:00
|
|
|
MemoryRegion isa_fw;
|
2016-10-22 11:46:42 +02: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-07 23:35:40 +01:00
|
|
|
uint32_t opb_irq_route0;
|
|
|
|
uint32_t opb_irq_route1;
|
2016-10-22 11:46:42 +02: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 17:29:59 +02:00
|
|
|
|
|
|
|
/* PSI to generate interrupts */
|
2022-03-23 08:28:43 +01:00
|
|
|
qemu_irq psi_irq;
|
2020-09-03 22:43:22 +02:00
|
|
|
};
|
2016-10-22 11:46:42 +02:00
|
|
|
|
2020-09-03 22:43:22 +02:00
|
|
|
struct PnvLpcClass {
|
2019-03-07 23:35:37 +01:00
|
|
|
DeviceClass parent_class;
|
|
|
|
|
|
|
|
DeviceRealize parent_realize;
|
2020-09-03 22:43:22 +02:00
|
|
|
};
|
2019-03-07 23:35:37 +01:00
|
|
|
|
2019-03-07 23:35:39 +01:00
|
|
|
/*
|
|
|
|
* Old compilers error on typdef forward declarations. Keep them happy.
|
|
|
|
*/
|
|
|
|
struct PnvChip;
|
|
|
|
|
2018-06-15 17:25:34 +02:00
|
|
|
ISABus *pnv_lpc_isa_create(PnvLpcController *lpc, bool use_cpld, Error **errp);
|
2019-12-05 19:44:54 +01:00
|
|
|
int pnv_dt_lpc(struct PnvChip *chip, void *fdt, int root_offset,
|
|
|
|
uint64_t lpcm_addr, uint64_t lpcm_size);
|
2017-04-11 17:29:59 +02:00
|
|
|
|
2019-03-15 15:51:21 +01:00
|
|
|
#endif /* PPC_PNV_LPC_H */
|