From c8e1d61ae2c94d3ac5d4598800f793b313726b2a Mon Sep 17 00:00:00 2001 From: Vaibhav Jain Date: Thu, 23 Aug 2018 15:37:49 +0530 Subject: phb4: Enable PHB MMIO-0/1 Bars only when mmio window exists 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 Reviewed-by: Oliver O'Halloran Signed-off-by: Stewart Smith --- hw/phb4.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/phb4.c b/hw/phb4.c index 803caa9..6798363 100644 --- a/hw/phb4.c +++ b/hw/phb4.c @@ -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]; @@ -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; -- cgit v1.1