Skip to content

Commit e9aa9c7

Browse files
committed
Merge branch 'omap-for-v5.13/ti-sysc' into fixes
2 parents fc85dc4 + db8e712 commit e9aa9c7

File tree

6 files changed

+123
-24
lines changed

6 files changed

+123
-24
lines changed

arch/arm/mach-omap2/pdata-quirks.c

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -569,10 +569,29 @@ static void pdata_quirks_check(struct pdata_init *quirks)
569569
}
570570
}
571571

572-
void __init pdata_quirks_init(const struct of_device_id *omap_dt_match_table)
572+
static const char * const pdata_quirks_init_nodes[] = {
573+
"prcm",
574+
"prm",
575+
};
576+
577+
static void __init
578+
pdata_quirks_init_clocks(const struct of_device_id *omap_dt_match_table)
573579
{
574580
struct device_node *np;
581+
int i;
582+
583+
for (i = 0; i < ARRAY_SIZE(pdata_quirks_init_nodes); i++) {
584+
np = of_find_node_by_name(NULL, pdata_quirks_init_nodes[i]);
585+
if (!np)
586+
continue;
575587

588+
of_platform_populate(np, omap_dt_match_table,
589+
omap_auxdata_lookup, NULL);
590+
}
591+
}
592+
593+
void __init pdata_quirks_init(const struct of_device_id *omap_dt_match_table)
594+
{
576595
/*
577596
* We still need this for omap2420 and omap3 PM to work, others are
578597
* using drivers/misc/sram.c already.
@@ -585,13 +604,7 @@ void __init pdata_quirks_init(const struct of_device_id *omap_dt_match_table)
585604
omap3_mcbsp_init();
586605
pdata_quirks_check(auxdata_quirks);
587606

588-
/* Populate always-on PRCM in l4_wkup to probe l4_wkup */
589-
np = of_find_node_by_name(NULL, "prcm");
590-
if (!np)
591-
np = of_find_node_by_name(NULL, "prm");
592-
if (np)
593-
of_platform_populate(np, omap_dt_match_table,
594-
omap_auxdata_lookup, NULL);
607+
pdata_quirks_init_clocks(omap_dt_match_table);
595608

596609
of_platform_populate(NULL, omap_dt_match_table,
597610
omap_auxdata_lookup, NULL);

drivers/bus/ti-sysc.c

Lines changed: 79 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ static int sysc_add_named_clock_from_child(struct sysc *ddata,
288288
* limit for clk_get(). If cl ever needs to be freed, it should be done
289289
* with clkdev_drop().
290290
*/
291-
cl = kcalloc(1, sizeof(*cl), GFP_KERNEL);
291+
cl = kzalloc(sizeof(*cl), GFP_KERNEL);
292292
if (!cl)
293293
return -ENOMEM;
294294

@@ -635,6 +635,51 @@ static int sysc_parse_and_check_child_range(struct sysc *ddata)
635635
return 0;
636636
}
637637

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+
638683
static struct device_node *stdout_path;
639684

640685
static void sysc_init_stdout_path(struct sysc *ddata)
@@ -856,15 +901,19 @@ static int sysc_map_and_check_registers(struct sysc *ddata)
856901
struct device_node *np = ddata->dev->of_node;
857902
int error;
858903

859-
if (!of_get_property(np, "reg", NULL))
860-
return 0;
861-
862904
error = sysc_parse_and_check_child_range(ddata);
863905
if (error)
864906
return error;
865907

908+
error = sysc_defer_non_critical(ddata);
909+
if (error)
910+
return error;
911+
866912
sysc_check_children(ddata);
867913

914+
if (!of_get_property(np, "reg", NULL))
915+
return 0;
916+
868917
error = sysc_parse_registers(ddata);
869918
if (error)
870919
return error;
@@ -1410,6 +1459,8 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = {
14101459
SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_SWSUP_MSTANDBY),
14111460
SYSC_QUIRK("tptc", 0, 0, -ENODEV, -ENODEV, 0x40007c00, 0xffffffff,
14121461
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),
14131464
SYSC_QUIRK("usb_host_hs", 0, 0, 0x10, 0x14, 0x50700100, 0xffffffff,
14141465
SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_SWSUP_MSTANDBY),
14151466
SYSC_QUIRK("usb_host_hs", 0, 0, 0x10, -ENODEV, 0x50700101, 0xffffffff,
@@ -1447,12 +1498,16 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = {
14471498
SYSC_QUIRK("dwc3", 0, 0, 0x10, -ENODEV, 0x500a0200, 0xffffffff, 0),
14481499
SYSC_QUIRK("d2d", 0x4a0b6000, 0, 0x10, 0x14, 0x00000010, 0xffffffff, 0),
14491500
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),
14501504
SYSC_QUIRK("epwmss", 0, 0, 0x4, -ENODEV, 0x47400001, 0xffffffff, 0),
14511505
SYSC_QUIRK("gpu", 0, 0x1fc00, 0x1fc10, -ENODEV, 0, 0, 0),
14521506
SYSC_QUIRK("gpu", 0, 0xfe00, 0xfe10, -ENODEV, 0x40000000 , 0xffffffff, 0),
14531507
SYSC_QUIRK("hdmi", 0, 0, 0x10, -ENODEV, 0x50031d00, 0xffffffff, 0),
14541508
SYSC_QUIRK("hsi", 0, 0, 0x10, 0x14, 0x50043101, 0xffffffff, 0),
14551509
SYSC_QUIRK("iss", 0, 0, 0x10, -ENODEV, 0x40000101, 0xffffffff, 0),
1510+
SYSC_QUIRK("keypad", 0x4a31c000, 0, 0x10, 0x14, 0x00000020, 0xffffffff, 0),
14561511
SYSC_QUIRK("mcasp", 0, 0, 0x4, -ENODEV, 0x44306302, 0xffffffff, 0),
14571512
SYSC_QUIRK("mcasp", 0, 0, 0x4, -ENODEV, 0x44307b02, 0xffffffff, 0),
14581513
SYSC_QUIRK("mcbsp", 0, -ENODEV, 0x8c, -ENODEV, 0, 0, 0),
@@ -1464,6 +1519,8 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = {
14641519
SYSC_QUIRK("ocp2scp", 0, 0, -ENODEV, -ENODEV, 0x50060007, 0xffffffff, 0),
14651520
SYSC_QUIRK("padconf", 0, 0, 0x10, -ENODEV, 0x4fff0800, 0xffffffff, 0),
14661521
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),
14671524
SYSC_QUIRK("prcm", 0, 0, -ENODEV, -ENODEV, 0x40000100, 0xffffffff, 0),
14681525
SYSC_QUIRK("prcm", 0, 0, -ENODEV, -ENODEV, 0x00004102, 0xffffffff, 0),
14691526
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,
15921649
case SOC_UNKNOWN:
15931650
default:
15941651
return 0;
1595-
};
1652+
}
15961653

15971654
/* Remap the whole module range to be able to reset dispc outputs */
15981655
devm_iounmap(ddata->dev, ddata->module_va);
@@ -2802,6 +2859,7 @@ static int sysc_init_soc(struct sysc *ddata)
28022859
const struct soc_device_attribute *match;
28032860
struct ti_sysc_platform_data *pdata;
28042861
unsigned long features = 0;
2862+
struct device_node *np;
28052863

28062864
if (sysc_soc)
28072865
return 0;
@@ -2822,6 +2880,21 @@ static int sysc_init_soc(struct sysc *ddata)
28222880
if (match && match->data)
28232881
sysc_soc->soc = (int)match->data;
28242882

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+
28252898
/* Ignore devices that are not available on HS and EMU SoCs */
28262899
if (!sysc_soc->general_purpose) {
28272900
switch (sysc_soc->soc) {
@@ -2830,7 +2903,7 @@ static int sysc_init_soc(struct sysc *ddata)
28302903
break;
28312904
default:
28322905
break;
2833-
};
2906+
}
28342907
}
28352908

28362909
match = soc_device_match(sysc_soc_feat_match);

drivers/clk/ti/clk-54xx.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ static const struct omap_clkctrl_reg_data omap5_l3main1_clkctrl_regs[] __initcon
156156

157157
static const struct omap_clkctrl_reg_data omap5_l3main2_clkctrl_regs[] __initconst = {
158158
{ OMAP5_L3_MAIN_2_CLKCTRL, NULL, 0, "l3_iclk_div" },
159+
{ OMAP5_L3_MAIN_2_GPMC_CLKCTRL, NULL, CLKF_HW_SUP, "l3_iclk_div" },
160+
{ OMAP5_L3_MAIN_2_OCMC_RAM_CLKCTRL, NULL, CLKF_HW_SUP, "l3_iclk_div" },
159161
{ 0 },
160162
};
161163

drivers/pci/controller/dwc/pci-dra7xx.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -443,8 +443,8 @@ static const struct dw_pcie_ep_ops pcie_ep_ops = {
443443
.get_features = dra7xx_pcie_get_features,
444444
};
445445

446-
static int __init dra7xx_add_pcie_ep(struct dra7xx_pcie *dra7xx,
447-
struct platform_device *pdev)
446+
static int dra7xx_add_pcie_ep(struct dra7xx_pcie *dra7xx,
447+
struct platform_device *pdev)
448448
{
449449
int ret;
450450
struct dw_pcie_ep *ep;
@@ -472,8 +472,8 @@ static int __init dra7xx_add_pcie_ep(struct dra7xx_pcie *dra7xx,
472472
return 0;
473473
}
474474

475-
static int __init dra7xx_add_pcie_port(struct dra7xx_pcie *dra7xx,
476-
struct platform_device *pdev)
475+
static int dra7xx_add_pcie_port(struct dra7xx_pcie *dra7xx,
476+
struct platform_device *pdev)
477477
{
478478
int ret;
479479
struct dw_pcie *pci = dra7xx->pci;
@@ -682,7 +682,7 @@ static int dra7xx_pcie_configure_two_lane(struct device *dev,
682682
return 0;
683683
}
684684

685-
static int __init dra7xx_pcie_probe(struct platform_device *pdev)
685+
static int dra7xx_pcie_probe(struct platform_device *pdev)
686686
{
687687
u32 reg;
688688
int ret;
@@ -938,6 +938,7 @@ static const struct dev_pm_ops dra7xx_pcie_pm_ops = {
938938
};
939939

940940
static struct platform_driver dra7xx_pcie_driver = {
941+
.probe = dra7xx_pcie_probe,
941942
.driver = {
942943
.name = "dra7-pcie",
943944
.of_match_table = of_dra7xx_pcie_match,
@@ -946,4 +947,4 @@ static struct platform_driver dra7xx_pcie_driver = {
946947
},
947948
.shutdown = dra7xx_pcie_shutdown,
948949
};
949-
builtin_platform_driver_probe(dra7xx_pcie_driver, dra7xx_pcie_probe);
950+
builtin_platform_driver(dra7xx_pcie_driver);

drivers/soc/ti/omap_prm.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ struct omap_reset_data {
8888
#define OMAP_PRM_HAS_RSTCTRL BIT(0)
8989
#define OMAP_PRM_HAS_RSTST BIT(1)
9090
#define OMAP_PRM_HAS_NO_CLKDM BIT(2)
91+
#define OMAP_PRM_RET_WHEN_IDLE BIT(3)
9192

9293
#define OMAP_PRM_HAS_RESETS (OMAP_PRM_HAS_RSTCTRL | OMAP_PRM_HAS_RSTST)
9394

@@ -174,7 +175,8 @@ static const struct omap_prm_data omap4_prm_data[] = {
174175
.name = "core", .base = 0x4a306700,
175176
.pwrstctrl = 0x0, .pwrstst = 0x4, .dmap = &omap_prm_reton,
176177
.rstctrl = 0x210, .rstst = 0x214, .clkdm_name = "ducati",
177-
.rstmap = rst_map_012
178+
.rstmap = rst_map_012,
179+
.flags = OMAP_PRM_RET_WHEN_IDLE,
178180
},
179181
{
180182
.name = "ivahd", .base = 0x4a306f00,
@@ -199,7 +201,8 @@ static const struct omap_prm_data omap4_prm_data[] = {
199201
},
200202
{
201203
.name = "l4per", .base = 0x4a307400,
202-
.pwrstctrl = 0x0, .pwrstst = 0x4, .dmap = &omap_prm_reton
204+
.pwrstctrl = 0x0, .pwrstst = 0x4, .dmap = &omap_prm_reton,
205+
.flags = OMAP_PRM_RET_WHEN_IDLE,
203206
},
204207
{
205208
.name = "cefuse", .base = 0x4a307600,
@@ -517,7 +520,7 @@ static int omap_prm_domain_power_on(struct generic_pm_domain *domain)
517520
{
518521
struct omap_prm_domain *prmd;
519522
int ret;
520-
u32 v;
523+
u32 v, mode;
521524

522525
prmd = genpd_to_prm_domain(domain);
523526
if (!prmd->cap)
@@ -530,7 +533,12 @@ static int omap_prm_domain_power_on(struct generic_pm_domain *domain)
530533
else
531534
v = readl_relaxed(prmd->prm->base + prmd->pwrstctrl);
532535

533-
writel_relaxed(v | OMAP_PRMD_ON_ACTIVE,
536+
if (prmd->prm->data->flags & OMAP_PRM_RET_WHEN_IDLE)
537+
mode = OMAP_PRMD_RETENTION;
538+
else
539+
mode = OMAP_PRMD_ON_ACTIVE;
540+
541+
writel_relaxed((v & ~PRM_POWERSTATE_MASK) | mode,
534542
prmd->prm->base + prmd->pwrstctrl);
535543

536544
/* wait for the transition bit to get cleared */

include/dt-bindings/clock/omap5.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232

3333
/* l3main2 clocks */
3434
#define OMAP5_L3_MAIN_2_CLKCTRL OMAP5_CLKCTRL_INDEX(0x20)
35+
#define OMAP5_L3_MAIN_2_GPMC_CLKCTRL OMAP5_CLKCTRL_INDEX(0x28)
36+
#define OMAP5_L3_MAIN_2_OCMC_RAM_CLKCTRL OMAP5_CLKCTRL_INDEX(0x30)
3537

3638
/* ipu clocks */
3739
#define OMAP5_MMU_IPU_CLKCTRL OMAP5_CLKCTRL_INDEX(0x20)

0 commit comments

Comments
 (0)