diff options
author | Russell Currey <ruscur@russell.cc> | 2017-04-19 15:14:08 +1000 |
---|---|---|
committer | Michael Neuling <mikey@neuling.org> | 2017-04-19 17:36:48 +1000 |
commit | f32ad58f981866c9550477e3aab7a1a7347bc019 (patch) | |
tree | 55f0f863052222d2da3d9cebee31ebd887b65b72 /hw | |
parent | 70bc11c40d57e9cb17999a55df8033a482211f23 (diff) | |
download | skiboot-f32ad58f981866c9550477e3aab7a1a7347bc019.zip skiboot-f32ad58f981866c9550477e3aab7a1a7347bc019.tar.gz skiboot-f32ad58f981866c9550477e3aab7a1a7347bc019.tar.bz2 |
phb4: Make M32 segment mappings two-to-one
PHB4 is currently configured to use half the available PEs due to DD1
limitations, with windows configured to allocate two segments per PE.
phb4_map_pe_mmio_window() currently expects segment numbers to map one-to-one
with PE numbers, so correct phb_map_pe_mmio_window() to use the two-to-one
mapping.
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Russell Currey <ruscur@russell.cc>
Signed-off-by: Michael Neuling <mikey@neuling.org>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/phb4.c | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -1164,7 +1164,7 @@ static int64_t phb4_map_pe_mmio_window(struct phb *phb, uint16_t segment_num) { struct phb4 *p = phb_to_phb4(phb); - uint64_t mbt0, mbt1, mdt; + uint64_t mbt0, mbt1, mdt0, mdt1; if (pe_number >= p->num_pes) return OPAL_PARAMETER; @@ -1183,11 +1183,15 @@ static int64_t phb4_map_pe_mmio_window(struct phb *phb, if (window_num != 0 || segment_num >= p->max_num_pes) return OPAL_PARAMETER; - mdt = p->mdt_cache[segment_num]; - mdt = SETFIELD(IODA3_MDT_PE_A, mdt, pe_number); - p->mdt_cache[segment_num] = mdt; - phb4_ioda_sel(p, IODA3_TBL_MDT, segment_num, false); - out_be64(p->regs + PHB_IODA_DATA0, mdt); + mdt0 = p->mdt_cache[segment_num << 1]; + mdt1 = p->mdt_cache[(segment_num << 1) + 1]; + mdt0 = SETFIELD(IODA3_MDT_PE_A, mdt0, pe_number); + mdt1 = SETFIELD(IODA3_MDT_PE_A, mdt1, pe_number); + p->mdt_cache[segment_num << 1] = mdt0; + p->mdt_cache[(segment_num << 1) + 1] = mdt1; + phb4_ioda_sel(p, IODA3_TBL_MDT, segment_num << 1, true); + out_be64(p->regs + PHB_IODA_DATA0, mdt0); + out_be64(p->regs + PHB_IODA_DATA0, mdt1); break; case OPAL_M64_WINDOW_TYPE: if (window_num == 0 || window_num >= p->mbt_size) |