From: Alexandru Gagniuc <alex.g@adaptrum.com>
To: p.zabel@pengutronix.de
Cc: linux-kernel@vger.kernel.org,
Michal Simek <michal.simek@xilinx.com>,
soren.brinkmann@xilinx.com, linux-arm-kernel@lists.infradead.org,
jun.nie@linaro.org, baoyou.xie@linaro.org,
maxime.ripard@free-electrons.com, wens@csie.org,
mcoquelin.stm32@gmail.com,
Alexandre TORGUE <alexandre.torgue@st.com>,
narmstrong@baylibre.com, carlo@caione.org, khilman@baylibre.com
Subject: simple-reset to de-duplicate reset drivers
Date: Thu, 10 Aug 2017 17:16:12 -0700 [thread overview]
Message-ID: <f7918041-49ac-e878-d402-fae953d50035@adaptrum.com> (raw)
Hi,
I was looking at implementing a reset driver for our in-house SoC. It's
essentially a long bitfield, each bit controlling one sort of reset.
That seems to be surprisingly common. I've identified the following
drivers which control a very similar reset:
* reset-zynq
* reset-zx2967
* reset-sunxi
* reset-stm32
* reset-socfpga
* reset-oxynas
* reset-meson
* reset-berlin
All of these have in common some form of another of:
int bank = id / BITS_PER_LONG;
int offset = id % BITS_PER_LONG;
It doesn't make sense to me why all these would be duplicated for every
reset controller. I think it would make sense to have a common driver to
handle these simple resets -- call it "simple-reset". I'm thinking of
something similar to drivers/tty/serial/8250, where the following
parameters can be specified:
- reg-offset
- reg-shift
- reg-io-width
I think a generic "simple-reset" driver which is configurable by a
similar set of parameters would be a suitable replacement for all the
aforementioned drivers. As far as our SoC goes, I've just added
compatible = "st,stm32-rcc";
to our devicetree, and I already have a fully-working reset driver. Do
you think we should proceed in the direction of "simple-reset", and what
other features do you estimate we'll need?
Alex
next reply other threads:[~2017-08-11 0:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-11 0:16 Alexandru Gagniuc [this message]
2017-08-11 8:19 ` Philipp Zabel
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=f7918041-49ac-e878-d402-fae953d50035@adaptrum.com \
--to=alex.g@adaptrum.com \
--cc=alexandre.torgue@st.com \
--cc=baoyou.xie@linaro.org \
--cc=carlo@caione.org \
--cc=jun.nie@linaro.org \
--cc=khilman@baylibre.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maxime.ripard@free-electrons.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=michal.simek@xilinx.com \
--cc=narmstrong@baylibre.com \
--cc=p.zabel@pengutronix.de \
--cc=soren.brinkmann@xilinx.com \
--cc=wens@csie.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
all inboxes | Powered by JetHome®