From: swarren@wwwdotorg.org (Stephen Warren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/7] reset: Add reset controller API
Date: Thu, 17 Jan 2013 09:55:20 -0700 [thread overview]
Message-ID: <50F82CF8.9090202@wwwdotorg.org> (raw)
In-Reply-To: <1358419524.2411.126.camel@pizza.hi.pengutronix.de>
On 01/17/2013 03:45 AM, Philipp Zabel wrote:
> Hi Stephen,
>
> Am Mittwoch, den 16.01.2013, 15:15 -0700 schrieb Stephen Warren:
>> On 01/16/2013 09:13 AM, Philipp Zabel wrote:
>>> This adds a simple API for devices to request being reset
>>> by separate reset controller hardware and implements the
>>> reset signal device tree binding.
>>
>>
>>> diff --git a/drivers/reset/Makefile b/drivers/reset/Makefile
>>
>>> +obj-$(CONFIG_RESET_CONTROLLER) += core.o
>>> +
>>
>> nit: blank line at EOF.
>
> Ok.
>
>>> diff --git a/drivers/reset/core.c b/drivers/reset/core.c
>>
>>> +/**
>>> + * reset_control_reset - reset the controlled device
>>> + * @rstc: reset controller
>>> + */
>>> +int reset_control_reset(struct reset_control *rstc)
>>
>> What time period is the reset signal asserted for; should there be a
>> parameter to control this?
>
> "The reset controller knows".
>
> On i.MX, the SRC does all necessary things in hardware (and optionally
> causes an interrupt to signal when it's ready - right now the SRC driver
> just polls for the reset line to deassert).
OK, I guess that does make sense. As you say, for an on-SoC reset
controller that auto-clears the reset bit, it obviously has the timing
embedded in HW, and for any other kind of reset controller, we can just
provide configuration to the controller somehow.
> For reset controllers that need to be manually asserted/deasserted, and
> still want to provide the .reset callback, we should think about some
> timing configuration. But IMHO that should be separate from the API.
>
> I've thought about adding an example gpio-reset controller driver, which
> knows about the necessary delays and just toggles gpios. This could be
> represented in the device tree as follows:
>
> gpio_reset: gpio_reset {
> compatible = "gpio-reset"
> gpios = <&gpioa 0 0>, <&gpioc 5 0>, <&gpiod 3 1>;
> reset-delays = <10>, <100>, <50>;
> #reset-cells = <1>;
> };
>
> device-to-be-reset {
> resets = <&gpio_reset 2>; /* GPIOD3, active-low, 50ms */
> };
>
> Or one could add another reset-cell to configure the delay:
>
> gpio_reset: gpio_reset {
> compatible = "gpio-reset"
> gpios = <&gpioa 0 0>, <&gpioc 5 0>, <&gpiod 3 1>;
> #reset-cells = <2>;
> };
>
> device-to-be-reset {
> resets = <&gpio_reset 2 50>; /* GPIOD3, active-low, 50ms */
> };
>
> I'd prefer the former over the latter. In any case, I think the timing
> information should reside either in the reset controller or in the
> framework.
Sure. I think the choice of properties in the controller node vs. extra
#reset-cells is probably an individual design decision for the specific
controller driver and DT binding; it would even be possible to have one
driver support either based on its #reset-cells value, but probably
over-complex and not worth doing. Although actually, when you start
thinking about DT overlays and so on, extra #reset-cells begins to make
more sense, since the values are distributed, which makes it easier to
set them from the overlay DT file...
WARNING: multiple messages have this Message-ID (diff)
From: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
To: Philipp Zabel <p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Cc: Marek Vasut <marex-ynQEQJNshbs@public.gmane.org>,
Fabio Estevam
<fabio.estevam-KZfg59tc24xl57MIdRCFDg@public.gmane.org>,
Mike Turquette
<mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH 2/7] reset: Add reset controller API
Date: Thu, 17 Jan 2013 09:55:20 -0700 [thread overview]
Message-ID: <50F82CF8.9090202@wwwdotorg.org> (raw)
In-Reply-To: <1358419524.2411.126.camel-/rZezPiN1rtR6QfukMTsflXZhhPuCNm+@public.gmane.org>
On 01/17/2013 03:45 AM, Philipp Zabel wrote:
> Hi Stephen,
>
> Am Mittwoch, den 16.01.2013, 15:15 -0700 schrieb Stephen Warren:
>> On 01/16/2013 09:13 AM, Philipp Zabel wrote:
>>> This adds a simple API for devices to request being reset
>>> by separate reset controller hardware and implements the
>>> reset signal device tree binding.
>>
>>
>>> diff --git a/drivers/reset/Makefile b/drivers/reset/Makefile
>>
>>> +obj-$(CONFIG_RESET_CONTROLLER) += core.o
>>> +
>>
>> nit: blank line at EOF.
>
> Ok.
>
>>> diff --git a/drivers/reset/core.c b/drivers/reset/core.c
>>
>>> +/**
>>> + * reset_control_reset - reset the controlled device
>>> + * @rstc: reset controller
>>> + */
>>> +int reset_control_reset(struct reset_control *rstc)
>>
>> What time period is the reset signal asserted for; should there be a
>> parameter to control this?
>
> "The reset controller knows".
>
> On i.MX, the SRC does all necessary things in hardware (and optionally
> causes an interrupt to signal when it's ready - right now the SRC driver
> just polls for the reset line to deassert).
OK, I guess that does make sense. As you say, for an on-SoC reset
controller that auto-clears the reset bit, it obviously has the timing
embedded in HW, and for any other kind of reset controller, we can just
provide configuration to the controller somehow.
> For reset controllers that need to be manually asserted/deasserted, and
> still want to provide the .reset callback, we should think about some
> timing configuration. But IMHO that should be separate from the API.
>
> I've thought about adding an example gpio-reset controller driver, which
> knows about the necessary delays and just toggles gpios. This could be
> represented in the device tree as follows:
>
> gpio_reset: gpio_reset {
> compatible = "gpio-reset"
> gpios = <&gpioa 0 0>, <&gpioc 5 0>, <&gpiod 3 1>;
> reset-delays = <10>, <100>, <50>;
> #reset-cells = <1>;
> };
>
> device-to-be-reset {
> resets = <&gpio_reset 2>; /* GPIOD3, active-low, 50ms */
> };
>
> Or one could add another reset-cell to configure the delay:
>
> gpio_reset: gpio_reset {
> compatible = "gpio-reset"
> gpios = <&gpioa 0 0>, <&gpioc 5 0>, <&gpiod 3 1>;
> #reset-cells = <2>;
> };
>
> device-to-be-reset {
> resets = <&gpio_reset 2 50>; /* GPIOD3, active-low, 50ms */
> };
>
> I'd prefer the former over the latter. In any case, I think the timing
> information should reside either in the reset controller or in the
> framework.
Sure. I think the choice of properties in the controller node vs. extra
#reset-cells is probably an individual design decision for the specific
controller driver and DT binding; it would even be possible to have one
driver support either based on its #reset-cells value, but probably
over-complex and not worth doing. Although actually, when you start
thinking about DT overlays and so on, extra #reset-cells begins to make
more sense, since the values are distributed, which makes it easier to
set them from the overlay DT file...
next prev parent reply other threads:[~2013-01-17 16:55 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-16 16:13 [RFC PATCH 0/5] Reset controller API to reset IP modules on i.MX5 and i.MX6 Philipp Zabel
2013-01-16 16:13 ` Philipp Zabel
2013-01-16 16:13 ` [PATCH 1/7] dt: describe base reset signal binding Philipp Zabel
2013-01-16 16:13 ` Philipp Zabel
2013-01-16 22:06 ` Stephen Warren
2013-01-16 22:06 ` Stephen Warren
2013-01-16 16:13 ` [PATCH 2/7] reset: Add reset controller API Philipp Zabel
2013-01-16 16:13 ` Philipp Zabel
2013-01-16 20:15 ` Sascha Hauer
2013-01-16 20:15 ` Sascha Hauer
2013-01-16 22:15 ` Stephen Warren
2013-01-16 22:15 ` Stephen Warren
2013-01-17 10:45 ` Philipp Zabel
2013-01-17 10:45 ` Philipp Zabel
2013-01-17 16:55 ` Stephen Warren [this message]
2013-01-17 16:55 ` Stephen Warren
2013-01-17 5:16 ` Shawn Guo
2013-01-17 5:16 ` Shawn Guo
2013-01-16 16:13 ` [PATCH 3/7] ARM i.MX6q: Add GPU, VPU, IPU, and OpenVG resets to System Reset Controller (SRC) Philipp Zabel
2013-01-16 16:13 ` Philipp Zabel
2013-01-17 5:31 ` Shawn Guo
2013-01-17 5:31 ` Shawn Guo
2013-01-18 19:57 ` Matt Sealey
2013-01-18 19:57 ` Matt Sealey
2013-01-21 9:52 ` Philipp Zabel
2013-01-21 9:52 ` Philipp Zabel
2013-01-21 17:47 ` Matt Sealey
2013-01-21 17:47 ` Matt Sealey
2013-01-22 7:50 ` Shawn Guo
2013-01-22 7:50 ` Shawn Guo
2013-01-16 16:13 ` [PATCH 4/7] ARM i.MX6q: Link system reset controller (SRC) to IPU in DT Philipp Zabel
2013-01-16 16:13 ` Philipp Zabel
2013-01-17 5:34 ` Shawn Guo
2013-01-17 5:34 ` Shawn Guo
2013-01-16 16:13 ` [PATCH 5/7] staging: drm/imx: Use SRC to reset IPU Philipp Zabel
2013-01-16 16:13 ` Philipp Zabel
2013-01-16 16:13 ` [PATCH 6/7] ARM i.MX5: Add System Reset Controller (SRC) support for i.MX51 and i.MX53 Philipp Zabel
2013-01-16 16:13 ` Philipp Zabel
2013-01-17 6:12 ` Shawn Guo
2013-01-17 6:12 ` Shawn Guo
2013-01-17 10:45 ` Philipp Zabel
2013-01-17 10:45 ` Philipp Zabel
2013-01-16 16:13 ` [PATCH 7/7] ARM i.MX5: Add system reset controller (SRC) to i.MX51 and i.MX53 device tree Philipp Zabel
2013-01-16 16:13 ` Philipp Zabel
2013-01-16 22:19 ` Stephen Warren
2013-01-16 22:19 ` Stephen Warren
2013-01-17 6:37 ` Shawn Guo
2013-01-17 6:37 ` Shawn Guo
2013-01-17 10:45 ` Philipp Zabel
2013-01-17 10:45 ` Philipp Zabel
2013-01-16 18:46 ` [RFC PATCH 0/5] Reset controller API to reset IP modules on i.MX5 and i.MX6 Marek Vasut
2013-01-16 18:46 ` Marek Vasut
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50F82CF8.9090202@wwwdotorg.org \
--to=swarren@wwwdotorg.org \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.