aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Neuling <mikey@neuling.org>2017-10-23 21:22:18 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-10-23 12:37:52 -0500
commit1554038d4c368e2df5fb0982d8c450b26a755244 (patch)
treede74d46a2924ab348f384e5891fb01afeeceeffa
parentde00950c6fa89f8e42bf96c88615e90a69f10381 (diff)
downloadskiboot-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.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/hw/phb4.c b/hw/phb4.c
index 361edbe..0f86160 100644
--- a/hw/phb4.c
+++ b/hw/phb4.c
@@ -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];