From: Maxime Ripard <maxime.ripard@free-electrons.com>
To: Houcheng Lin <houcheng@gmail.com>
Cc: linus.walleij@linaro.org, gnurou@gmail.com,
grant.likely@linaro.org, robh+dt@kernel.org,
dbaryshkov@gmail.com, dwmw2@infradead.org,
p.zabel@pengutronix.de, stephen.gallimore@st.com,
srinivas.kandagatla@st.com, ulf.hansson@linaro.org,
sre@kernel.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org, linux-doc@vger.kernel.org
Subject: Re: [RFC PATCH v3] reset: Add a defer reset object to send board specific reset
Date: Fri, 20 Jun 2014 11:35:20 +0200 [thread overview]
Message-ID: <20140620093520.GZ19730@lukather> (raw)
In-Reply-To: <1403098673-3058-1-git-send-email-houcheng@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2746 bytes --]
On Wed, Jun 18, 2014 at 09:37:53PM +0800, Houcheng Lin wrote:
> The Problem
> -----------
> The reset signal on a hardware board is send either:
> - during machine initialization
> - during bus master's initialization
>
> In some hardware design, devices on bus need a non-standard and extra reset
> signal after bus is initialied. Most reason is to wake up device from hanging
> state.
>
> The board spefic reset code can not be put into machine init code, as it is
> too early. This code can not also be put onto chip's driver, as it is board
> specific and not suitable for a common chip driver.
I don't see why not. I don't get the difference with an optional
regulator, or an optional GPIO, or whatever. And there's already some
support for such a case, with reset_control_get_optional.
>
> Defer Reset Object
> ------------------
> The defer reset object is to resolve this issue, developer can put a defer-
> reset device on the board's dts file and enable DEFER RESET OBJECT CONFIG.
> During driver init-calls, a defer-reset object is created and issue reset signal
> after the enclosing device is initialized.
>
> This eliminate the need to rewrite a driver module with only one purpose: sending
> a board specific reset. This also allow mainstream kernel to support many boards
> that modify the common drivers to send board specific reset. Configuring defer-reset
> device in dts leave the board specific reset rules on board level and simple to
> maintain.
>
> Example dts File
> ----------------
> Example 1:
> defer_reset_vbus {
> compatible = "defer-reset";
> reset-gpios = <&gpx3 5 GPIO_ACTIVE_LOW>;
This doesn't follow the generic reset bindings.
> duration = <5>;
> };
>
> Example 2:
> defer_reset_vbus {
> compatible = "defer-reset";
> reset-gpios = <&gpx3 5 GPIO_ACTIVE_HIGH>;
> duration = <0>;
> };
>
> Block Diagram of dts File
> -------------------------
> +-------------------------------------+
> | usb-ehci-chip@1211000 |
> | +-------------------------+ |
> | | defer-reset(gpx3) | |
> | +-------------------------+ |
> +-------------------------------------+
And this goes against the current way of doing things, with the resets
property holding a phandle.
Why not just having something like:
usb {
compatible = "whatever";
resets = <&rst_gpio <duration>>;
}
Which uses the generic bindings, and doesn't require anything fancy
either in the driver or the DT.
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2014-06-20 9:35 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-18 13:37 [RFC PATCH v3] reset: Add a defer reset object to send board specific reset Houcheng Lin
2014-06-20 9:35 ` Maxime Ripard [this message]
2014-07-07 12:38 ` Linus Walleij
2014-07-10 22:00 ` Houcheng Lin
2014-07-08 7:52 ` Linus Walleij
2014-07-08 8:05 ` Maxime Ripard
2014-07-08 9:38 ` Linus Walleij
2014-08-08 14:23 ` Philipp Zabel
2014-08-11 17:33 ` Maxime Ripard
2014-08-14 9:36 ` Philipp Zabel
2014-08-14 10:47 ` Maxime Ripard
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=20140620093520.GZ19730@lukather \
--to=maxime.ripard@free-electrons.com \
--cc=dbaryshkov@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=dwmw2@infradead.org \
--cc=gnurou@gmail.com \
--cc=grant.likely@linaro.org \
--cc=houcheng@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=robh+dt@kernel.org \
--cc=sre@kernel.org \
--cc=srinivas.kandagatla@st.com \
--cc=stephen.gallimore@st.com \
--cc=ulf.hansson@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).