diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2014-09-30 15:34:44 +1000 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2014-09-30 15:34:44 +1000 |
commit | 5212faa417612ba0d3ba23cf10ec6e756d4af04c (patch) | |
tree | 5fc41a04e31b2574e72a64bacf3dc5b995c826c9 | |
parent | a3be370710b06df32768f09d3d0e412b91797c73 (diff) | |
download | skiboot-5212faa417612ba0d3ba23cf10ec6e756d4af04c.zip skiboot-5212faa417612ba0d3ba23cf10ec6e756d4af04c.tar.gz skiboot-5212faa417612ba0d3ba23cf10ec6e756d4af04c.tar.bz2 |
phb3/capi: Some tweaks to the new CAPI interfaces
Use real functionality based flags instead of a mode list in the DT
and other cleanups & missing bits (this one actually builds !)
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r-- | hw/phb3.c | 13 | ||||
-rw-r--r-- | include/opal.h | 17 |
2 files changed, 18 insertions, 12 deletions
@@ -2950,21 +2950,21 @@ static int64_t phb3_set_capi_mode(struct phb *phb, uint64_t mode, return OPAL_BUSY; } - if (mode == OPAL_PHB_MODE_PCIE) + if (mode == OPAL_PHB_CAPI_MODE_PCIE) return OPAL_UNSUPPORTED; - if (mode == OPAL_PHB_MODE_SNOOP_OFF) { + if (mode == OPAL_PHB_CAPI_MODE_SNOOP_OFF) { xscom_write(p->chip_id, SNOOP_CAPI_CONFIG, 0x0000000000000000); return OPAL_SUCCESS; } - if (mode == OPAL_PHB_MODE_SNOOP_ON) { + if (mode == OPAL_PHB_CAPI_MODE_SNOOP_ON) { xscom_write(p->chip_id, CAPP_ERR_STATUS_CTRL, 0x0000000000000000); xscom_write(p->chip_id, SNOOP_CAPI_CONFIG, 0xA1F0000000000000); return OPAL_SUCCESS; } - if (mode != OPAL_PHB_MODE_CAPI) + if (mode != OPAL_PHB_CAPI_MODE_CAPI) return OPAL_UNSUPPORTED; xscom_read(p->chip_id, 0x9013c03, ®); @@ -4173,9 +4173,8 @@ static void phb3_probe_pbcq(struct dt_node *pbcq) } max_link_speed = dt_prop_get_u32_def(pbcq, "ibm,max-link-speed", 3); dt_add_property_cells(np, "ibm,max-link-speed", max_link_speed); - dt_add_property_cells(np, "ibm,capi-modes", OPAL_PHB_MODE_CAPI | - OPAL_PHB_MODE_SNOOP_ON | - OPAL_PHB_MODE_SNOOP_OFF); + dt_add_property_cells(np, "ibm,capi-flags", + OPAL_PHB_CAPI_FLAG_SNOOP_CONTROL); add_chip_dev_associativity(np); } diff --git a/include/opal.h b/include/opal.h index 7046fb2..fb0cee4 100644 --- a/include/opal.h +++ b/include/opal.h @@ -624,6 +624,7 @@ enum OpalHMI_ErrType { OpalHMI_ERROR_SCOM_FIR, OpalHMI_ERROR_DEBUG_TRIG_FIR, OpalHMI_ERROR_HYP_RESOURCE, + OpalHMI_ERROR_CAPP_RECOVERY, }; struct OpalHMIEvent { @@ -871,11 +872,17 @@ struct opal_sg_list { #define OPAL_DUMP_REGION_OS_START 0x80 #define OPAL_DUMP_REGION_OS_END 0xFF -/* CAPI flags */ -#define OPAL_PHB_MODE_PCIE 0x00000000 -#define OPAL_PHB_MODE_CAPI 0x00000001 -#define OPAL_PHB_MODE_SNOOP_OFF 0x00000002 -#define OPAL_PHB_MODE_SNOOP_ON 0x00000004 +/* CAPI modes for PHB */ +enum { + OPAL_PHB_CAPI_MODE_PCIE = 0, + OPAL_PHB_CAPI_MODE_CAPI = 1, + OPAL_PHB_CAPI_MODE_SNOOP_OFF = 2, + OPAL_PHB_CAPI_MODE_SNOOP_ON = 3, +}; + +/* CAPI feature flags (in device-tree) */ +#define OPAL_PHB_CAPI_FLAG_SNOOP_CONTROL 0x00000001 +#define OPAL_PHB_CAPI_FLAG_REVERT_TO_PCIE 0x00000002 /****** Internal **********/ #include <skiboot.h> |