Search
SailfishOS Open Build Service
>
Projects
>
home:mike7b4
:
bbb
>
kernel-adaptation-bbb-v3.12
> 0063-ARM-omap-add-DT-support-for-deasserting-hardware-res.patch
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File 0063-ARM-omap-add-DT-support-for-deasserting-hardware-res.patch of Package kernel-adaptation-bbb-v3.12
From 6d88ef73dcb5d3744fc9993d22e643cef2bb9d5a Mon Sep 17 00:00:00 2001 From: Philippe Proulx <philippe.proulx@savoirfairelinux.com> Date: Fri, 13 Sep 2013 14:33:35 -0400 Subject: [PATCH 63/96] ARM: omap: add DT support for deasserting hardware reset lines Original author of this patch's code is: Matt Ranostay <mranostay@gmail.com> This optional binding extension allows specification of a hwmod and associate hardware reset line which should be deasserted for the device to be functional. The implementation works but is suboptimal. The problem is that this deassertion occurs before clocks are enabled and we are warned that the hard reset failed. Ideally the list of reset lines requested to be deasserted would be cached and used within the hwmod enable sequencing (instead of it just returning if any hardware reset line is asserted). This reset line deassertion step is required to use the PRU-ICSS on AM335x boards. --- .../devicetree/bindings/arm/omap/omap.txt | 2 ++ arch/arm/mach-omap2/omap_device.c | 25 ++++++++++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/arm/omap/omap.txt b/Documentation/devicetree/bindings/arm/omap/omap.txt index 91b7049..1d0a99e 100644 --- a/Documentation/devicetree/bindings/arm/omap/omap.txt +++ b/Documentation/devicetree/bindings/arm/omap/omap.txt @@ -21,6 +21,8 @@ Required properties: Optional properties: - ti,no_idle_on_suspend: When present, it prevents the PM to idle the module during suspend. +- ti,deassert-hard-reset: list of hwmod and hardware reset line name pairs + (ascii strings) to be deasserted upon device instantiation. Example: diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c index e11e481..c535103 100644 --- a/arch/arm/mach-omap2/omap_device.c +++ b/arch/arm/mach-omap2/omap_device.c @@ -127,8 +127,8 @@ static int omap_device_build_from_dt(struct platform_device *pdev) struct omap_device *od; struct omap_hwmod *oh; struct device_node *node = pdev->dev.of_node; - 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; oh_cnt = of_property_count_strings(node, "ti,hwmods"); @@ -180,6 +180,27 @@ static int omap_device_build_from_dt(struct platform_device *pdev) pm_runtime_set_active(&pdev->dev); } + 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); + } + } + odbfd_exit1: kfree(hwmods); odbfd_exit: -- 1.9.1