From: "Heiko Stübner" <heiko@sntech.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 2/6] dm: core: Allow multiple drivers to bind for a single node
Date: Mon, 13 Mar 2017 09:40:34 +0100 [thread overview]
Message-ID: <2314494.SWTQtCYFEE@diego> (raw)
In-Reply-To: <CAPnjgZ2ud8pWPYmvadF5AXZfsBeFWn0VA8ZopngPigs02dRw3w@mail.gmail.com>
Hi Simon,
Am Sonntag, 12. März 2017, 14:21:35 CET schrieb Simon Glass:
> On 3 March 2017 at 03:52, Dr. Philipp Tomsich
> <philipp.tomsich@theobroma-systems.com> wrote:
> > On 03 Mar 2017, at 05:52, Simon Glass <sjg@chromium.org> wrote:
> > On 22 February 2017 at 13:47, Philipp Tomsich
> > <philipp.tomsich@theobroma-systems.com> wrote:
> >
> > Currently, driver binding stops once it encounters the first
> > compatible driver that doesn't refuse to bind. However, there are
> > cases where a single node will need to be handled by multiple driver
> > classes. For those cases we provide a configurable option to continue
> > to bind after the first driver has been found.
> >
> > The first use cases for this are from the DM conversion of the sunxi
> > (Allwinner) architecture:
> > * pinctrl (UCLASS_PINCTRL) and gpio (UCLASS_GPIO) drivers need to
> >
> > bind against a single node
> >
> > * clock (UCLASS_CLK) and reset (UCLASS_RESET) drivers also need to
> >
> > bind against a single node
> >
> > Does linux work this way? Another approach would be to have a separate
> > MISC driver with two children, one pinctrl, one clk.
> >
> >
> > The linux CLK driver creates and registers a reset-controller; the PINCTRL
> > driver
> > does the same with the gpio-controller. Similar code to do this is easily
> > possible in
> > U-Boot … see sunxi_pctrl_bind_gpio(…) in [PATCH v2 1/6] of this series.
> >
> > However, binding multiple times makes for much simpler code and allows to
> > keep
> > driver data in separate drivers.
>
> My question was more whether Linux registers multiple drivers with one
> device node. It's just not something I expected.
>
> I'm not really convinced on this. It will break the current one-to-one
> relationship, and functions like device_get_child_by_of_offset(). I
> think it would be better to have a MISC driver with two children.
In the regular device model the Linux kernel also generally has a one-to-one
model. There are special cases, like clock and timer init using special
handling, or things like "syscon" which acts like more of a flag and can live
next to a regular device.
Therefore things like the Rockchip clock controller create the reset
controller included in the CRU block. A behaviour the uboot clk driver mimics.
Also doesn't allowing multiple drivers to sit on top of a node create
contention on who gets access to registers? At least in the kernel multiple
mappings of registers are generally not favoured.
Heiko
next prev parent reply other threads:[~2017-03-13 8:40 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-22 20:47 [U-Boot] [PATCH v2 0/6] sunxi: DM pinctrl implementation Philipp Tomsich
2017-02-22 20:47 ` [U-Boot] [PATCH v2 1/6] sunxi: add pinctrl (UCLASS_PINCTRL) support for sunxi Philipp Tomsich
2017-02-22 23:18 ` Maxime Ripard
2017-02-23 3:54 ` Chen-Yu Tsai
2017-02-23 18:10 ` Maxime Ripard
2017-02-22 20:47 ` [U-Boot] [PATCH v2 2/6] dm: core: Allow multiple drivers to bind for a single node Philipp Tomsich
2017-03-03 4:52 ` Simon Glass
2017-03-03 10:52 ` Dr. Philipp Tomsich
2017-03-12 20:21 ` Simon Glass
2017-03-13 8:40 ` Heiko Stübner [this message]
2017-03-20 7:08 ` Maxime Ripard
2017-03-22 13:05 ` Simon Glass
2017-02-22 20:47 ` [U-Boot] [PATCH v2 3/6] sunxi: CONFIG_DM_ALLOW_MULTIPLE_DRIVERS for gpio/pinctrl binding Philipp Tomsich
2017-02-22 20:47 ` [U-Boot] [PATCH v2 4/6] defconfig: lynx: enable CONFIG_DM_ALLOW_MULTIPLE_DRIVERS Philipp Tomsich
2017-02-22 23:19 ` Maxime Ripard
2017-02-22 20:47 ` [U-Boot] [PATCH v2 5/6] sun50i: dts: add r_pio node and pinconfig entries into r_pio and pio Philipp Tomsich
2017-02-22 20:47 ` [U-Boot] [PATCH v2 6/6] sun50i: dts: update DTS to avoid warnings Philipp Tomsich
2017-02-22 23:20 ` Maxime Ripard
2017-02-22 23:24 ` Dr. Philipp Tomsich
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=2314494.SWTQtCYFEE@diego \
--to=heiko@sntech.de \
--cc=u-boot@lists.denx.de \
/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