Skip to content

Commit

Permalink
phb4: Enable PHB MMIO-0/1 Bars only when mmio window exists
Browse files Browse the repository at this point in the history
Presently phb4_probe_stack() will always enable PHB MMIO0/1 windows
even if they doesn't exist in phy_map. Hence we do some minor shuffling
in the phb4_probe_stack() so that MMIO-0/1 Bars are only enabled if
there corresponding MMIO window exists in the phy_map. In case phy_map
for an mmio window is '0' we set the corresponding BAR register to
'0'.

Signed-off-by: Vaibhav Jain <vaibhav@linux.ibm.com>
Reviewed-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
  • Loading branch information
vaibhav92 authored and stewartsmith committed Oct 16, 2018
1 parent d5ebd55 commit c8e1d61
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions hw/phb4.c
Original file line number Diff line number Diff line change
Expand Up @@ -5609,7 +5609,7 @@ static void phb4_probe_stack(struct dt_node *stk_node, uint32_t pec_index,
uint32_t pci_stack, nest_stack, etu_base, gcid, phb_num, stk_index;
uint64_t val, phb_bar = 0, irq_bar = 0, bar_en;
uint64_t mmio0_bar = 0, mmio0_bmask, mmio0_sz;
uint64_t mmio1_bar, mmio1_bmask, mmio1_sz;
uint64_t mmio1_bar = 0, mmio1_bmask, mmio1_sz;
uint64_t reg[4];
void *foo;
uint64_t mmio_win[4];
Expand Down Expand Up @@ -5668,7 +5668,6 @@ static void phb4_probe_stack(struct dt_node *stk_node, uint32_t pec_index,
mmio1_bmask = (~(mmio1_sz - 1)) & 0x00FFFFFFFFFFFFFFULL;
xscom_write(gcid, nest_stack + XPEC_NEST_STK_MMIO_BAR1, mmio1_bar << 8);
xscom_write(gcid, nest_stack + XPEC_NEST_STK_MMIO_BAR1_MASK, mmio1_bmask << 8);
bar_en |= XPEC_NEST_STK_BAR_EN_MMIO0 | XPEC_NEST_STK_BAR_EN_MMIO1;

/* Build MMIO windows list */
mmio_win_sz = 0;
Expand Down

0 comments on commit c8e1d61

Please sign in to comment.