@@ -1245,6 +1245,32 @@ static int iproc_pcie_map_dma_ranges(struct iproc_pcie *pcie)
1245
1245
return ret ;
1246
1246
}
1247
1247
1248
+ static void iproc_pcie_invalidate_mapping (struct iproc_pcie * pcie )
1249
+ {
1250
+ struct iproc_pcie_ib * ib = & pcie -> ib ;
1251
+ struct iproc_pcie_ob * ob = & pcie -> ob ;
1252
+ int idx ;
1253
+
1254
+ if (pcie -> ep_is_internal )
1255
+ return ;
1256
+
1257
+ if (pcie -> need_ob_cfg ) {
1258
+ /* iterate through all OARR mapping regions */
1259
+ for (idx = ob -> nr_windows - 1 ; idx >= 0 ; idx -- ) {
1260
+ iproc_pcie_write_reg (pcie ,
1261
+ MAP_REG (IPROC_PCIE_OARR0 , idx ), 0 );
1262
+ }
1263
+ }
1264
+
1265
+ if (pcie -> need_ib_cfg ) {
1266
+ /* iterate through all IARR mapping regions */
1267
+ for (idx = 0 ; idx < ib -> nr_regions ; idx ++ ) {
1268
+ iproc_pcie_write_reg (pcie ,
1269
+ MAP_REG (IPROC_PCIE_IARR0 , idx ), 0 );
1270
+ }
1271
+ }
1272
+ }
1273
+
1248
1274
static int iproce_pcie_get_msi (struct iproc_pcie * pcie ,
1249
1275
struct device_node * msi_node ,
1250
1276
u64 * msi_addr )
@@ -1517,6 +1543,8 @@ int iproc_pcie_setup(struct iproc_pcie *pcie, struct list_head *res)
1517
1543
iproc_pcie_perst_ctrl (pcie , true);
1518
1544
iproc_pcie_perst_ctrl (pcie , false);
1519
1545
1546
+ iproc_pcie_invalidate_mapping (pcie );
1547
+
1520
1548
if (pcie -> need_ob_cfg ) {
1521
1549
ret = iproc_pcie_map_ranges (pcie , res );
1522
1550
if (ret ) {
0 commit comments