13aa597f6SCédric Le Goater /* 23aa597f6SCédric Le Goater * QEMU PowerPC sPAPR XIVE interrupt controller model 33aa597f6SCédric Le Goater * 43aa597f6SCédric Le Goater * Copyright (c) 2017-2018, IBM Corporation. 53aa597f6SCédric Le Goater * 63aa597f6SCédric Le Goater * This code is licensed under the GPL version 2 or later. See the 73aa597f6SCédric Le Goater * COPYING file in the top-level directory. 83aa597f6SCédric Le Goater */ 93aa597f6SCédric Le Goater 103aa597f6SCédric Le Goater #ifndef PPC_SPAPR_XIVE_H 113aa597f6SCédric Le Goater #define PPC_SPAPR_XIVE_H 123aa597f6SCédric Le Goater 133aa597f6SCédric Le Goater #include "hw/ppc/xive.h" 143aa597f6SCédric Le Goater 153aa597f6SCédric Le Goater #define TYPE_SPAPR_XIVE "spapr-xive" 16*ce2918cbSDavid Gibson #define SPAPR_XIVE(obj) OBJECT_CHECK(SpaprXive, (obj), TYPE_SPAPR_XIVE) 173aa597f6SCédric Le Goater 18*ce2918cbSDavid Gibson typedef struct SpaprXive { 193aa597f6SCédric Le Goater XiveRouter parent; 203aa597f6SCédric Le Goater 213aa597f6SCédric Le Goater /* Internal interrupt source for IPIs and virtual devices */ 223aa597f6SCédric Le Goater XiveSource source; 233aa597f6SCédric Le Goater hwaddr vc_base; 243aa597f6SCédric Le Goater 253aa597f6SCédric Le Goater /* END ESB MMIOs */ 263aa597f6SCédric Le Goater XiveENDSource end_source; 273aa597f6SCédric Le Goater hwaddr end_base; 283aa597f6SCédric Le Goater 29743ed566SGreg Kurz /* DT */ 30743ed566SGreg Kurz gchar *nodename; 31743ed566SGreg Kurz 323aa597f6SCédric Le Goater /* Routing table */ 333aa597f6SCédric Le Goater XiveEAS *eat; 343aa597f6SCédric Le Goater uint32_t nr_irqs; 353aa597f6SCédric Le Goater XiveEND *endt; 363aa597f6SCédric Le Goater uint32_t nr_ends; 373aa597f6SCédric Le Goater 383aa597f6SCédric Le Goater /* TIMA mapping address */ 393aa597f6SCédric Le Goater hwaddr tm_base; 403aa597f6SCédric Le Goater MemoryRegion tm_mmio; 41*ce2918cbSDavid Gibson } SpaprXive; 423aa597f6SCédric Le Goater 43*ce2918cbSDavid Gibson bool spapr_xive_irq_claim(SpaprXive *xive, uint32_t lisn, bool lsi); 44*ce2918cbSDavid Gibson bool spapr_xive_irq_free(SpaprXive *xive, uint32_t lisn); 45*ce2918cbSDavid Gibson void spapr_xive_pic_print_info(SpaprXive *xive, Monitor *mon); 463aa597f6SCédric Le Goater 47*ce2918cbSDavid Gibson void spapr_xive_hcall_init(SpaprMachineState *spapr); 48*ce2918cbSDavid Gibson void spapr_dt_xive(SpaprMachineState *spapr, uint32_t nr_servers, void *fdt, 496e21de4aSCédric Le Goater uint32_t phandle); 50b2e22477SCédric Le Goater void spapr_xive_set_tctx_os_cam(XiveTCTX *tctx); 51*ce2918cbSDavid Gibson void spapr_xive_mmio_set_enabled(SpaprXive *xive, bool enable); 5223bcd5ebSCédric Le Goater 533aa597f6SCédric Le Goater #endif /* PPC_SPAPR_XIVE_H */ 54