aboutsummaryrefslogtreecommitdiff
path: root/hw/phb4.c
diff options
context:
space:
mode:
authorChristophe Lombard <clombard@linux.vnet.ibm.com>2018-07-05 14:15:23 +0200
committerStewart Smith <stewart@linux.ibm.com>2018-07-10 23:46:20 -0500
commitbfb78e7bc262409ef59067ef554719e85f86c4fb (patch)
treec358fff496642ca80a855d094b6d71433be160fc /hw/phb4.c
parent966a2839484f164979c5118e52928f8509b4982b (diff)
downloadskiboot-bfb78e7bc262409ef59067ef554719e85f86c4fb.zip
skiboot-bfb78e7bc262409ef59067ef554719e85f86c4fb.tar.gz
skiboot-bfb78e7bc262409ef59067ef554719e85f86c4fb.tar.bz2
capi: Select the correct IODA table entry for the mbt cache.
With the current code, the capi mmio window is not correctly configured in the IODA table entry. The first entry (generally the non-prefetchable BAR) is overwrriten. This patch sets the capi window bar at the right place. Signed-off-by: Christophe Lombard <clombard@linux.vnet.ibm.com> Reviewed-by: Vaibhav Jain <vaibhav@linux.ibm.com> Reviewed-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com> Acked-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com> (cherry picked from commit 98182a960c5ffd53eed139668e686bc5af6e2e5f) Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'hw/phb4.c')
-rw-r--r--hw/phb4.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/hw/phb4.c b/hw/phb4.c
index 807f1db..7566c02 100644
--- a/hw/phb4.c
+++ b/hw/phb4.c
@@ -3906,7 +3906,7 @@ static int64_t enable_capi_mode(struct phb4 *p, uint64_t pe_number,
{
uint64_t reg, start_addr, end_addr, stq_eng, dma_eng;
uint64_t mbt0, mbt1;
- int i, entf = -1;
+ int i, window_num = -1;
/* CAPP Control Register */
xscom_read(p->chip_id, p->pe_xscom + XPEC_NEST_CAPP_CNTL, &reg);
@@ -4050,20 +4050,20 @@ static int64_t enable_capi_mode(struct phb4 *p, uint64_t pe_number,
break;
/* search a free entry */
- if ((entf == -1) &&
+ if ((window_num == -1) &&
((!(p->mbt_cache[i][0] & IODA3_MBT0_ENABLE)) &&
(!(p->mbt_cache[i][1] & IODA3_MBT1_ENABLE))))
- entf = i;
+ window_num = i;
}
- if (entf >= 0 && i == p->mbt_size) {
+ if (window_num >= 0 && i == p->mbt_size) {
/* no capi mmio window found, so add it */
- p->mbt_cache[entf][0] = mbt0;
- p->mbt_cache[entf][1] = mbt1;
+ p->mbt_cache[window_num][0] = mbt0;
+ p->mbt_cache[window_num][1] = mbt1;
- phb4_ioda_sel(p, IODA3_TBL_MBT, 0, true);
- out_be64(p->regs + PHB_IODA_DATA0, p->mbt_cache[entf][0]);
- out_be64(p->regs + PHB_IODA_DATA0, p->mbt_cache[entf][1]);
+ phb4_ioda_sel(p, IODA3_TBL_MBT, window_num << 1, true);
+ out_be64(p->regs + PHB_IODA_DATA0, mbt0);
+ out_be64(p->regs + PHB_IODA_DATA0, mbt1);
} else if (i == p->mbt_size) {
/* mbt cache full, this case should never happen */
PHBERR(p, "CAPP: Failed to add CAPI mmio window\n");