diff options
author | Michael Neuling <mikey@neuling.org> | 2017-10-23 21:22:18 +1100 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-10-23 12:37:52 -0500 |
commit | 1554038d4c368e2df5fb0982d8c450b26a755244 (patch) | |
tree | de74d46a2924ab348f384e5891fb01afeeceeffa | |
parent | de00950c6fa89f8e42bf96c88615e90a69f10381 (diff) | |
download | skiboot-1554038d4c368e2df5fb0982d8c450b26a755244.zip skiboot-1554038d4c368e2df5fb0982d8c450b26a755244.tar.gz skiboot-1554038d4c368e2df5fb0982d8c450b26a755244.tar.bz2 |
phb4: Use phb4_ioda_sel() more
Use phb4_ioda_sel() in phb4_read_phb_status() rather than re-implementing it.
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r-- | hw/phb4.c | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -1795,7 +1795,6 @@ static void phb4_read_phb_status(struct phb4 *p, { uint16_t val = 0; uint32_t i; - uint64_t val64 = 0; uint64_t *pPEST; memset(stat, 0, sizeof(struct OpalIoPhb4ErrorData)); @@ -1905,17 +1904,13 @@ static void phb4_read_phb_status(struct phb4 *p, * resident tables. */ pPEST = (uint64_t *)p->tbl_pest; - val64 = PHB_IODA_AD_AUTOINC; - val64 = SETFIELD(PHB_IODA_AD_TSEL, val64, IODA3_TBL_PESTA); - phb4_write_reg_asb(p, PHB_IODA_ADDR, val64); + phb4_ioda_sel(p, IODA3_TBL_PESTA, 0, true); for (i = 0; i < OPAL_PHB4_NUM_PEST_REGS; i++) { stat->pestA[i] = phb4_read_reg_asb(p, PHB_IODA_DATA0); stat->pestA[i] |= pPEST[2 * i]; } - val64 = PHB_IODA_AD_AUTOINC; - val64 = SETFIELD(PHB_IODA_AD_TSEL, val64, IODA3_TBL_PESTB); - phb4_write_reg_asb(p, PHB_IODA_ADDR, val64); + phb4_ioda_sel(p, IODA3_TBL_PESTB, 0, true); for (i = 0; i < OPAL_PHB4_NUM_PEST_REGS; i++) { stat->pestB[i] = phb4_read_reg_asb(p, PHB_IODA_DATA0); stat->pestB[i] |= pPEST[2 * i + 1]; |