[Skiboot] [PATCH v2] phb4: Enable PHB MMIO-0/1 Bars only when mmio window exists

Vaibhav Jain vaibhav at linux.ibm.com
Thu Aug 23 20:07:49 AEST 2018


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 at linux.ibm.com>
---
Change-log

v2	-> Re-factored the patch to make sure bar registers are set to
	'0' if the corresponding mmio window doesn't exist. [Oliver]
---
 hw/phb4.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/hw/phb4.c b/hw/phb4.c
index d1245dce..2ecd80e7 100644
--- a/hw/phb4.c
+++ b/hw/phb4.c
@@ -5537,7 +5537,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];
@@ -5587,7 +5587,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;
-- 
2.17.1



More information about the Skiboot mailing list