Skip to content

Commit

Permalink
ARM: omap2: support deasserting reset from dts
Browse files Browse the repository at this point in the history
  • Loading branch information
mvduin authored and RobertCNelson committed Mar 8, 2022
1 parent b88589f commit 63f18e4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Documentation/devicetree/bindings/arm/omap/omap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ Optional properties:
- ti,no-reset-on-init: When present, the module should not be reset at init
- ti,no-idle-on-init: When present, the module should not be idled at init
- ti,no-idle: When present, the module is never allowed to idle.
- ti,deassert-hard-reset: list of hwmod and hardware reset line name pairs
(ascii strings) to be deasserted upon device instantiation.

Example:

Expand Down
24 changes: 22 additions & 2 deletions arch/arm/mach-omap2/omap_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ static int omap_device_build_from_dt(struct platform_device *pdev)
struct omap_hwmod *oh;
struct device_node *node = pdev->dev.of_node;
struct resource res;
const char *oh_name;
int oh_cnt, i, ret = 0;
const char *oh_name, *rst_name;
int oh_cnt, dstr_cnt, i, ret = 0;
bool device_active = false, skip_pm_domain = false;

oh_cnt = of_property_count_strings(node, "ti,hwmods");
Expand Down Expand Up @@ -189,6 +189,26 @@ static int omap_device_build_from_dt(struct platform_device *pdev)
ret = PTR_ERR(od);
goto odbfd_exit1;
}
dstr_cnt =
of_property_count_strings(node, "ti,deassert-hard-reset");
if (dstr_cnt > 0) {
for (i = 0; i < dstr_cnt; i += 2) {
of_property_read_string_index(
node, "ti,deassert-hard-reset", i,
&oh_name);
of_property_read_string_index(
node, "ti,deassert-hard-reset", i+1,
&rst_name);
oh = omap_hwmod_lookup(oh_name);
if (!oh) {
dev_warn(&pdev->dev,
"Cannot parse deassert property for '%s'\n",
oh_name);
break;
}
omap_hwmod_deassert_hardreset(oh, rst_name);
}
}

/* Fix up missing resource names */
for (i = 0; i < pdev->num_resources; i++) {
Expand Down

0 comments on commit 63f18e4

Please sign in to comment.