@@ -288,7 +288,7 @@ static int sysc_add_named_clock_from_child(struct sysc *ddata,
288
288
* limit for clk_get(). If cl ever needs to be freed, it should be done
289
289
* with clkdev_drop().
290
290
*/
291
- cl = kcalloc ( 1 , sizeof (* cl ), GFP_KERNEL );
291
+ cl = kzalloc ( sizeof (* cl ), GFP_KERNEL );
292
292
if (!cl )
293
293
return - ENOMEM ;
294
294
@@ -635,6 +635,51 @@ static int sysc_parse_and_check_child_range(struct sysc *ddata)
635
635
return 0 ;
636
636
}
637
637
638
+ /* Interconnect instances to probe before l4_per instances */
639
+ static struct resource early_bus_ranges [] = {
640
+ /* am3/4 l4_wkup */
641
+ { .start = 0x44c00000 , .end = 0x44c00000 + 0x300000 , },
642
+ /* omap4/5 and dra7 l4_cfg */
643
+ { .start = 0x4a000000 , .end = 0x4a000000 + 0x300000 , },
644
+ /* omap4 l4_wkup */
645
+ { .start = 0x4a300000 , .end = 0x4a300000 + 0x30000 , },
646
+ /* omap5 and dra7 l4_wkup without dra7 dcan segment */
647
+ { .start = 0x4ae00000 , .end = 0x4ae00000 + 0x30000 , },
648
+ };
649
+
650
+ static atomic_t sysc_defer = ATOMIC_INIT (10 );
651
+
652
+ /**
653
+ * sysc_defer_non_critical - defer non_critical interconnect probing
654
+ * @ddata: device driver data
655
+ *
656
+ * We want to probe l4_cfg and l4_wkup interconnect instances before any
657
+ * l4_per instances as l4_per instances depend on resources on l4_cfg and
658
+ * l4_wkup interconnects.
659
+ */
660
+ static int sysc_defer_non_critical (struct sysc * ddata )
661
+ {
662
+ struct resource * res ;
663
+ int i ;
664
+
665
+ if (!atomic_read (& sysc_defer ))
666
+ return 0 ;
667
+
668
+ for (i = 0 ; i < ARRAY_SIZE (early_bus_ranges ); i ++ ) {
669
+ res = & early_bus_ranges [i ];
670
+ if (ddata -> module_pa >= res -> start &&
671
+ ddata -> module_pa <= res -> end ) {
672
+ atomic_set (& sysc_defer , 0 );
673
+
674
+ return 0 ;
675
+ }
676
+ }
677
+
678
+ atomic_dec_if_positive (& sysc_defer );
679
+
680
+ return - EPROBE_DEFER ;
681
+ }
682
+
638
683
static struct device_node * stdout_path ;
639
684
640
685
static void sysc_init_stdout_path (struct sysc * ddata )
@@ -856,15 +901,19 @@ static int sysc_map_and_check_registers(struct sysc *ddata)
856
901
struct device_node * np = ddata -> dev -> of_node ;
857
902
int error ;
858
903
859
- if (!of_get_property (np , "reg" , NULL ))
860
- return 0 ;
861
-
862
904
error = sysc_parse_and_check_child_range (ddata );
863
905
if (error )
864
906
return error ;
865
907
908
+ error = sysc_defer_non_critical (ddata );
909
+ if (error )
910
+ return error ;
911
+
866
912
sysc_check_children (ddata );
867
913
914
+ if (!of_get_property (np , "reg" , NULL ))
915
+ return 0 ;
916
+
868
917
error = sysc_parse_registers (ddata );
869
918
if (error )
870
919
return error ;
@@ -1410,6 +1459,8 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = {
1410
1459
SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_SWSUP_MSTANDBY ),
1411
1460
SYSC_QUIRK ("tptc" , 0 , 0 , - ENODEV , - ENODEV , 0x40007c00 , 0xffffffff ,
1412
1461
SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_SWSUP_MSTANDBY ),
1462
+ SYSC_QUIRK ("sata" , 0 , 0xfc , 0x1100 , - ENODEV , 0x5e412000 , 0xffffffff ,
1463
+ SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_SWSUP_MSTANDBY ),
1413
1464
SYSC_QUIRK ("usb_host_hs" , 0 , 0 , 0x10 , 0x14 , 0x50700100 , 0xffffffff ,
1414
1465
SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_SWSUP_MSTANDBY ),
1415
1466
SYSC_QUIRK ("usb_host_hs" , 0 , 0 , 0x10 , - ENODEV , 0x50700101 , 0xffffffff ,
@@ -1447,12 +1498,16 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = {
1447
1498
SYSC_QUIRK ("dwc3" , 0 , 0 , 0x10 , - ENODEV , 0x500a0200 , 0xffffffff , 0 ),
1448
1499
SYSC_QUIRK ("d2d" , 0x4a0b6000 , 0 , 0x10 , 0x14 , 0x00000010 , 0xffffffff , 0 ),
1449
1500
SYSC_QUIRK ("d2d" , 0x4a0cd000 , 0 , 0x10 , 0x14 , 0x00000010 , 0xffffffff , 0 ),
1501
+ SYSC_QUIRK ("elm" , 0x48080000 , 0 , 0x10 , 0x14 , 0x00000020 , 0xffffffff , 0 ),
1502
+ SYSC_QUIRK ("emif" , 0 , 0 , - ENODEV , - ENODEV , 0x40441403 , 0xffff0fff , 0 ),
1503
+ SYSC_QUIRK ("emif" , 0 , 0 , - ENODEV , - ENODEV , 0x50440500 , 0xffffffff , 0 ),
1450
1504
SYSC_QUIRK ("epwmss" , 0 , 0 , 0x4 , - ENODEV , 0x47400001 , 0xffffffff , 0 ),
1451
1505
SYSC_QUIRK ("gpu" , 0 , 0x1fc00 , 0x1fc10 , - ENODEV , 0 , 0 , 0 ),
1452
1506
SYSC_QUIRK ("gpu" , 0 , 0xfe00 , 0xfe10 , - ENODEV , 0x40000000 , 0xffffffff , 0 ),
1453
1507
SYSC_QUIRK ("hdmi" , 0 , 0 , 0x10 , - ENODEV , 0x50031d00 , 0xffffffff , 0 ),
1454
1508
SYSC_QUIRK ("hsi" , 0 , 0 , 0x10 , 0x14 , 0x50043101 , 0xffffffff , 0 ),
1455
1509
SYSC_QUIRK ("iss" , 0 , 0 , 0x10 , - ENODEV , 0x40000101 , 0xffffffff , 0 ),
1510
+ SYSC_QUIRK ("keypad" , 0x4a31c000 , 0 , 0x10 , 0x14 , 0x00000020 , 0xffffffff , 0 ),
1456
1511
SYSC_QUIRK ("mcasp" , 0 , 0 , 0x4 , - ENODEV , 0x44306302 , 0xffffffff , 0 ),
1457
1512
SYSC_QUIRK ("mcasp" , 0 , 0 , 0x4 , - ENODEV , 0x44307b02 , 0xffffffff , 0 ),
1458
1513
SYSC_QUIRK ("mcbsp" , 0 , - ENODEV , 0x8c , - ENODEV , 0 , 0 , 0 ),
@@ -1464,6 +1519,8 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = {
1464
1519
SYSC_QUIRK ("ocp2scp" , 0 , 0 , - ENODEV , - ENODEV , 0x50060007 , 0xffffffff , 0 ),
1465
1520
SYSC_QUIRK ("padconf" , 0 , 0 , 0x10 , - ENODEV , 0x4fff0800 , 0xffffffff , 0 ),
1466
1521
SYSC_QUIRK ("padconf" , 0 , 0 , - ENODEV , - ENODEV , 0x40001100 , 0xffffffff , 0 ),
1522
+ SYSC_QUIRK ("pcie" , 0x51000000 , - ENODEV , - ENODEV , - ENODEV , 0 , 0 , 0 ),
1523
+ SYSC_QUIRK ("pcie" , 0x51800000 , - ENODEV , - ENODEV , - ENODEV , 0 , 0 , 0 ),
1467
1524
SYSC_QUIRK ("prcm" , 0 , 0 , - ENODEV , - ENODEV , 0x40000100 , 0xffffffff , 0 ),
1468
1525
SYSC_QUIRK ("prcm" , 0 , 0 , - ENODEV , - ENODEV , 0x00004102 , 0xffffffff , 0 ),
1469
1526
SYSC_QUIRK ("prcm" , 0 , 0 , - ENODEV , - ENODEV , 0x40000400 , 0xffffffff , 0 ),
@@ -1592,7 +1649,7 @@ static u32 sysc_quirk_dispc(struct sysc *ddata, int dispc_offset,
1592
1649
case SOC_UNKNOWN :
1593
1650
default :
1594
1651
return 0 ;
1595
- };
1652
+ }
1596
1653
1597
1654
/* Remap the whole module range to be able to reset dispc outputs */
1598
1655
devm_iounmap (ddata -> dev , ddata -> module_va );
@@ -2802,6 +2859,7 @@ static int sysc_init_soc(struct sysc *ddata)
2802
2859
const struct soc_device_attribute * match ;
2803
2860
struct ti_sysc_platform_data * pdata ;
2804
2861
unsigned long features = 0 ;
2862
+ struct device_node * np ;
2805
2863
2806
2864
if (sysc_soc )
2807
2865
return 0 ;
@@ -2822,6 +2880,21 @@ static int sysc_init_soc(struct sysc *ddata)
2822
2880
if (match && match -> data )
2823
2881
sysc_soc -> soc = (int )match -> data ;
2824
2882
2883
+ /*
2884
+ * Check and warn about possible old incomplete dtb. We now want to see
2885
+ * simple-pm-bus instead of simple-bus in the dtb for genpd using SoCs.
2886
+ */
2887
+ switch (sysc_soc -> soc ) {
2888
+ case SOC_AM3 :
2889
+ case SOC_AM4 :
2890
+ np = of_find_node_by_path ("/ocp" );
2891
+ WARN_ONCE (np && of_device_is_compatible (np , "simple-bus" ),
2892
+ "ti-sysc: Incomplete old dtb, please update\n" );
2893
+ break ;
2894
+ default :
2895
+ break ;
2896
+ }
2897
+
2825
2898
/* Ignore devices that are not available on HS and EMU SoCs */
2826
2899
if (!sysc_soc -> general_purpose ) {
2827
2900
switch (sysc_soc -> soc ) {
@@ -2830,7 +2903,7 @@ static int sysc_init_soc(struct sysc *ddata)
2830
2903
break ;
2831
2904
default :
2832
2905
break ;
2833
- };
2906
+ }
2834
2907
}
2835
2908
2836
2909
match = soc_device_match (sysc_soc_feat_match );
0 commit comments