aboutsummaryrefslogtreecommitdiff
path: root/hw/phb3.c
diff options
context:
space:
mode:
authorChristophe Lombard <clombard@linux.vnet.ibm.com>2017-06-13 14:21:22 +0200
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-06-19 17:20:55 +1000
commit71de2375d28d8dba3b50f4857540bc68da3e5856 (patch)
tree0a57c66735a0bc93b8f2d60f36512c4bfb47f3a4 /hw/phb3.c
parente50764d4f2b11fc9e9fe0b2fd0a4617b32593bfa (diff)
downloadskiboot-71de2375d28d8dba3b50f4857540bc68da3e5856.zip
skiboot-71de2375d28d8dba3b50f4857540bc68da3e5856.tar.gz
skiboot-71de2375d28d8dba3b50f4857540bc68da3e5856.tar.bz2
capi: Handle HMI events
Find the CAPP on the chip associated with the HMI event for PHB4. The recovery mode (re-initialization of the capp, resume of functional operations) is only available with P9 DD2. A new patch will be provided to support this feature. Signed-off-by: Christophe Lombard <clombard@linux.vnet.ibm.com> Reviewed-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw/phb3.c')
-rw-r--r--hw/phb3.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/hw/phb3.c b/hw/phb3.c
index 7922098..bc04c36 100644
--- a/hw/phb3.c
+++ b/hw/phb3.c
@@ -3394,6 +3394,38 @@ static int64_t phb3_get_diag_data(struct phb *phb,
return OPAL_SUCCESS;
}
+static int64_t phb3_get_capp_info(int chip_id, struct phb *phb,
+ struct capp_info *info)
+{
+ struct phb3 *p = phb_to_phb3(phb);
+ struct proc_chip *chip = get_chip(p->chip_id);
+ uint32_t offset;
+
+ if (chip_id != p->chip_id)
+ return OPAL_PARAMETER;
+
+ if (!((1 << p->index) & chip->capp_phb3_attached_mask))
+ return OPAL_PARAMETER;
+
+ offset = PHB3_CAPP_REG_OFFSET(p);
+
+ if (PHB3_IS_NAPLES(p)) {
+ if (p->index == 0)
+ info->capp_index = 0;
+ else
+ info->capp_index = 1;
+ } else
+ info->capp_index = 0;
+ info->phb_index = p->index;
+ info->capp_fir_reg = CAPP_FIR + offset;
+ info->capp_fir_mask_reg = CAPP_FIR_MASK + offset;
+ info->capp_fir_action0_reg = CAPP_FIR_ACTION0 + offset;
+ info->capp_fir_action1_reg = CAPP_FIR_ACTION1 + offset;
+ info->capp_err_status_ctrl_reg = CAPP_ERR_STATUS_CTRL + offset;
+
+ return OPAL_SUCCESS;
+}
+
static void phb3_init_capp_regs(struct phb3 *p, bool dma_mode)
{
uint64_t reg;
@@ -3606,6 +3638,9 @@ static int64_t enable_capi_mode(struct phb3 *p, uint64_t pe_number, bool dma_mod
return OPAL_HARDWARE;
}
+ /* set callbacks to handle HMI events */
+ capi_ops.get_capp_info = &phb3_get_capp_info;
+
return OPAL_SUCCESS;
}