@@ -196,8 +196,6 @@ static inline void brcm_pcie_bridge_sw_init_set_generic(struct brcm_pcie *pcie,
196
196
static inline void brcm_pcie_perst_set_4908 (struct brcm_pcie * pcie , u32 val );
197
197
static inline void brcm_pcie_perst_set_7278 (struct brcm_pcie * pcie , u32 val );
198
198
static inline void brcm_pcie_perst_set_generic (struct brcm_pcie * pcie , u32 val );
199
- static int brcm_pcie_linkup (struct brcm_pcie * pcie );
200
- static int brcm_pcie_add_bus (struct pci_bus * bus );
201
199
202
200
enum {
203
201
RGR1_SW_INIT_1 ,
@@ -331,8 +329,6 @@ struct brcm_pcie {
331
329
u32 hw_rev ;
332
330
void (* perst_set )(struct brcm_pcie * pcie , u32 val );
333
331
void (* bridge_sw_init_set )(struct brcm_pcie * pcie , u32 val );
334
- bool refusal_mode ;
335
- struct subdev_regulators * sr ;
336
332
};
337
333
338
334
static inline bool is_bmips (const struct brcm_pcie * pcie )
@@ -501,34 +497,6 @@ static int pci_subdev_regulators_add_bus(struct pci_bus *bus)
501
497
return 0 ;
502
498
}
503
499
504
- static int brcm_pcie_add_bus (struct pci_bus * bus )
505
- {
506
- struct device * dev = & bus -> dev ;
507
- struct brcm_pcie * pcie = (struct brcm_pcie * ) bus -> sysdata ;
508
- int ret ;
509
-
510
- if (!dev -> of_node || !bus -> parent || !pci_is_root_bus (bus -> parent ))
511
- return 0 ;
512
-
513
- ret = pci_subdev_regulators_add_bus (bus );
514
- if (ret )
515
- return ret ;
516
-
517
- /* Grab the regulators for suspend/resume */
518
- pcie -> sr = bus -> dev .driver_data ;
519
-
520
- /*
521
- * If we have failed linkup there is no point to return an error as
522
- * currently it will cause a WARNING() from pci_alloc_child_bus().
523
- * We return 0 and turn on the "refusal_mode" so that any further
524
- * accesses to the pci_dev just get 0xffffffff
525
- */
526
- if (brcm_pcie_linkup (pcie ) != 0 )
527
- pcie -> refusal_mode = true;
528
-
529
- return 0 ;
530
- }
531
-
532
500
static void pci_subdev_regulators_remove_bus (struct pci_bus * bus )
533
501
{
534
502
struct device * dev = & bus -> dev ;
@@ -857,18 +825,6 @@ static void __iomem *brcm_pcie_map_conf(struct pci_bus *bus, unsigned int devfn,
857
825
/* Accesses to the RC go right to the RC registers if slot==0 */
858
826
if (pci_is_root_bus (bus ))
859
827
return PCI_SLOT (devfn ) ? NULL : base + where ;
860
- if (pcie -> refusal_mode ) {
861
- /*
862
- * At this point we do not have link. There will be a CPU
863
- * abort -- a quirk with this controller --if Linux tries
864
- * to read any config-space registers besides those
865
- * targeting the host bridge. To prevent this we hijack
866
- * the address to point to a safe access that will return
867
- * 0xffffffff.
868
- */
869
- writel (0xffffffff , base + PCIE_MISC_RC_BAR2_CONFIG_HI );
870
- return base + PCIE_MISC_RC_BAR2_CONFIG_HI + (where & 0x3 );
871
- }
872
828
873
829
/* For devices, write to the config space index register */
874
830
idx = PCIE_ECAM_OFFSET (bus -> number , devfn , 0 );
@@ -897,7 +853,7 @@ static struct pci_ops brcm_pcie_ops = {
897
853
.map_bus = brcm_pcie_map_conf ,
898
854
.read = pci_generic_config_read ,
899
855
.write = pci_generic_config_write ,
900
- .add_bus = brcm_pcie_add_bus ,
856
+ .add_bus = pci_subdev_regulators_add_bus ,
901
857
.remove_bus = pci_subdev_regulators_remove_bus ,
902
858
};
903
859
@@ -1370,14 +1326,6 @@ static int brcm_pcie_suspend(struct device *dev)
1370
1326
return ret ;
1371
1327
}
1372
1328
1373
- if (pcie -> sr ) {
1374
- ret = regulator_bulk_disable (pcie -> sr -> num_supplies , pcie -> sr -> supplies );
1375
- if (ret ) {
1376
- dev_err (dev , "Could not turn off regulators\n" );
1377
- reset_control_reset (pcie -> rescal );
1378
- return ret ;
1379
- }
1380
- }
1381
1329
clk_disable_unprepare (pcie -> clk );
1382
1330
1383
1331
return 0 ;
@@ -1395,17 +1343,9 @@ static int brcm_pcie_resume(struct device *dev)
1395
1343
if (ret )
1396
1344
return ret ;
1397
1345
1398
- if (pcie -> sr ) {
1399
- ret = regulator_bulk_enable (pcie -> sr -> num_supplies , pcie -> sr -> supplies );
1400
- if (ret ) {
1401
- dev_err (dev , "Could not turn on regulators\n" );
1402
- goto err_disable_clk ;
1403
- }
1404
- }
1405
-
1406
1346
ret = reset_control_reset (pcie -> rescal );
1407
1347
if (ret )
1408
- goto err_regulator ;
1348
+ goto err_disable_clk ;
1409
1349
1410
1350
ret = brcm_phy_start (pcie );
1411
1351
if (ret )
@@ -1437,9 +1377,6 @@ static int brcm_pcie_resume(struct device *dev)
1437
1377
1438
1378
err_reset :
1439
1379
reset_control_rearm (pcie -> rescal );
1440
- err_regulator :
1441
- if (pcie -> sr )
1442
- regulator_bulk_disable (pcie -> sr -> num_supplies , pcie -> sr -> supplies );
1443
1380
err_disable_clk :
1444
1381
clk_disable_unprepare (pcie -> clk );
1445
1382
return ret ;
@@ -1571,17 +1508,7 @@ static int brcm_pcie_probe(struct platform_device *pdev)
1571
1508
1572
1509
platform_set_drvdata (pdev , pcie );
1573
1510
1574
- ret = pci_host_probe (bridge );
1575
- if (!ret && !brcm_pcie_link_up (pcie ))
1576
- ret = - ENODEV ;
1577
-
1578
- if (ret ) {
1579
- brcm_pcie_remove (pdev );
1580
- return ret ;
1581
- }
1582
-
1583
- return 0 ;
1584
-
1511
+ return pci_host_probe (bridge );
1585
1512
fail :
1586
1513
__brcm_pcie_remove (pcie );
1587
1514
return ret ;
@@ -1590,8 +1517,8 @@ static int brcm_pcie_probe(struct platform_device *pdev)
1590
1517
MODULE_DEVICE_TABLE (of , brcm_pcie_match );
1591
1518
1592
1519
static const struct dev_pm_ops brcm_pcie_pm_ops = {
1593
- .suspend_noirq = brcm_pcie_suspend ,
1594
- .resume_noirq = brcm_pcie_resume ,
1520
+ .suspend = brcm_pcie_suspend ,
1521
+ .resume = brcm_pcie_resume ,
1595
1522
};
1596
1523
1597
1524
static struct platform_driver brcm_pcie_driver = {
0 commit comments