From: Rob Herring <robh@kernel.org>
To: Sven Van Asbroeck <thesven73@gmail.com>
Cc: "Sven Van Asbroeck" <svendev@arcx.com>,
"Linus Walleij" <linus.walleij@linaro.org>,
"Lee Jones" <lee.jones@linaro.org>,
"Mark Rutland" <mark.rutland@arm.com>,
"Andreas Färber" <afaerber@suse.de>,
"Thierry Reding" <treding@nvidia.com>,
"David Lechner" <david@lechnology.com>,
"Noralf Trønnes" <noralf@tronnes.org>,
"Johan Hovold" <johan@kernel.org>,
"Michal Simek" <monstr@monstr.eu>,
"Michal Vokáč" <michal.vokac@ysoft.com>,
"Arnd Bergmann" <arnd@arndb.de>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"John Garry" <john.garry@huawei.com>,
"Geert Uytterhoeven" <geert+renesas@glider.be>,
"Robin Murphy" <robin.murphy@arm.com>,
"Paul Gortmaker" <paul.gortmaker@windriver.com>,
"Sebastien Bourdelin" <sebastien.bourdelin@savoirfairelinux.com>,
"Icenowy Zheng" <icenowy@aosc.io>,
"Stuart Yoder" <stuyoder@gmail.com>,
"Maxime Ripard" <maxime.ripard@bootlin.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
devicetree@vger.kernel.org
Subject: Re: [PATCH anybus v3 1/6] misc: support the Arcx anybus bridge
Date: Tue, 6 Nov 2018 12:30:55 -0600 [thread overview]
Message-ID: <CAL_Jsq+YeW+BtVh=L8PBjXYLj9sp91BcUQrJJrwnmChRnXoK_w@mail.gmail.com> (raw)
In-Reply-To: <CAGngYiXczK6dsfyDGxe1ym-vQQfH5XS0jeEkuWW_og23JmTAZg@mail.gmail.com>
On Tue, Nov 6, 2018 at 8:46 AM Sven Van Asbroeck <thesven73@gmail.com> wrote:
>
> On Tue, Nov 6, 2018 at 8:58 AM Rob Herring <robh@kernel.org> wrote:
>
> > It doesn't really sound like the host should be in DT. The bridge
> > should register itself as an anybus provider and that should in turn
> > enable the anybus host protocol.
>
> Very good point. Just to make sure we're on the same page, could you point
> me to a relevant example where something registers as a provider?
Not sure exactly. Perhaps I2C SMBus functions that implement the
register access protocol on top of I2C bus.
> v1 of this patch did not have the host in DT. The host just required platform
> data with a regmap and a reset (the interrupt was passed via resources):
>
> struct anybuss_host_pdata {
> struct regmap *regmap;
> void (*reset)(struct device *dev, bool reset);
> };
>
> But there were problems with this approach.
A block diagram would help. Something that shows the host SoC, your
CPLD, reset, irq, etc.
> The review feedback told me that my self-rolled reset callback should really
> be a reset controller. I looked for ways to pass a handle to a reset controller
> via platform data. This has recently been introduced via:
Maybe an overkill for 1 reset.
>
> reset_controller_add_lookup()
>
> This binds a client device to a reset controller, without using the devicetree,
> so the device can grab its controller via (devm_)reset_control_get*. Great!
> But... to make the binding, you have to specify the full device names of the
> controllers and client devices. See this example from psc-da850.c:
>
> static struct reset_control_lookup da850_psc0_reset_lookup_table[] = {
> RESET_LOOKUP("da850-psc0", 15, "davinci-rproc.0", NULL),
> };
>
> I very quickly found myself in ida_simple_get() hell, trying to second-guess
> what the devices I was creating, would be called !
>
> So instead I put the host in DT, then I could easily connect the reset
> controller. This also greatly simplified the bridge driver, a lot of boilerplate
> would simply disappear.
If the host is not a h/w component, but just a s/w protocol then it
doesn't belong in DT. Perhaps it could be a library which the bridge
driver can call into.
What are the resets connected to? The slots? Maybe you should model
the slots in DT.
Rob
next prev parent reply other threads:[~2018-11-06 18:31 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-04 15:54 [PATCH anybus v3 0/6] Support HMS Profinet Card over Anybus thesven73
2018-11-04 15:54 ` [PATCH anybus v3 1/6] misc: support the Arcx anybus bridge thesven73
2018-11-05 21:20 ` Rob Herring
2018-11-05 21:50 ` Sven Van Asbroeck
2018-11-06 13:58 ` Rob Herring
2018-11-06 14:45 ` Sven Van Asbroeck
2018-11-06 18:30 ` Rob Herring [this message]
2018-11-06 20:05 ` Sven Van Asbroeck
2018-11-08 13:40 ` Arnd Bergmann
2018-11-04 15:54 ` [PATCH anybus v3 2/6] dt-bindings: Add vendor prefix for arcx / Archronix thesven73
2018-11-04 15:57 ` Andreas Färber
2018-11-05 20:44 ` Rob Herring
2018-11-04 15:54 ` [PATCH anybus v3 3/6] dt-bindings: anybus-bridge: document devicetree binding thesven73
2018-11-05 20:45 ` Rob Herring
2018-11-04 15:54 ` [PATCH anybus v3 4/6] bus: support HMS Anybus-S bus thesven73
2018-11-08 14:07 ` Arnd Bergmann
2018-11-08 15:47 ` Sven Van Asbroeck
2018-11-08 16:54 ` Arnd Bergmann
2018-11-09 16:25 ` Sven Van Asbroeck
2018-11-09 21:03 ` Arnd Bergmann
2018-11-10 10:55 ` Geert Uytterhoeven
2018-11-12 16:23 ` Sven Van Asbroeck
2018-11-04 15:55 ` [PATCH anybus v3 5/6] dt-bindings: anybuss-host: document devicetree binding thesven73
2018-11-08 14:11 ` Arnd Bergmann
2018-11-08 14:21 ` Sven Van Asbroeck
2018-11-08 14:27 ` Arnd Bergmann
2018-11-12 18:05 ` Sven Van Asbroeck
2018-11-04 15:55 ` [PATCH anybus v3 6/6] misc: support HMS Profinet IRT industrial controller thesven73
2018-11-08 14:20 ` Arnd Bergmann
2018-11-08 15:35 ` Sven Van Asbroeck
2018-11-08 16:52 ` Arnd Bergmann
2018-11-09 16:02 ` [PATCH anybus v3 0/6] Support HMS Profinet Card over Anybus Sven Van Asbroeck
2018-11-09 21:22 ` Arnd Bergmann
2018-11-09 21:46 ` Sven Van Asbroeck
2018-11-09 22:32 ` Arnd Bergmann
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='CAL_Jsq+YeW+BtVh=L8PBjXYLj9sp91BcUQrJJrwnmChRnXoK_w@mail.gmail.com' \
--to=robh@kernel.org \
--cc=afaerber@suse.de \
--cc=arnd@arndb.de \
--cc=david@lechnology.com \
--cc=devicetree@vger.kernel.org \
--cc=geert+renesas@glider.be \
--cc=gregkh@linuxfoundation.org \
--cc=icenowy@aosc.io \
--cc=johan@kernel.org \
--cc=john.garry@huawei.com \
--cc=lee.jones@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=maxime.ripard@bootlin.com \
--cc=michal.vokac@ysoft.com \
--cc=monstr@monstr.eu \
--cc=noralf@tronnes.org \
--cc=paul.gortmaker@windriver.com \
--cc=robin.murphy@arm.com \
--cc=sebastien.bourdelin@savoirfairelinux.com \
--cc=stuyoder@gmail.com \
--cc=svendev@arcx.com \
--cc=thesven73@gmail.com \
--cc=treding@nvidia.com \
/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).