All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [U-Boot, v2, 4/4] syscon: add Linux-compatible syscon API
Date: Mon, 7 May 2018 20:45:31 -0400	[thread overview]
Message-ID: <20180508004531.GP12235@bill-the-cat.ec.rr.com> (raw)
In-Reply-To: <1524107644-28849-5-git-send-email-yamada.masahiro@socionext.com>

On Thu, Apr 19, 2018 at 12:14:04PM +0900, Masahiro Yamada wrote:

> The syscon implementation in U-Boot is different from that in Linux.
> Thus, DT files imported from Linux do not work for U-Boot.
> 
> In U-Boot driver model, each node is bound to a dedicated driver
> that is the most compatible to it.  This design gets along with the
> concept of DT, and the syscon in Linux originally worked like that.
> 
> However, Linux commit bdb0066df96e ("mfd: syscon: Decouple syscon
> interface from platform devices") changed the behavior because it is
> useful to let a device bind to another driver, but still work as a
> syscon provider.
> 
> That change had happened before U-Boot initially supported the syscon
> driver by commit 6f98b7504f70 ("dm: Add support for generic system
> controllers (syscon)").  So, the U-Boot's syscon works differently
> from the beginning.  I'd say this is mis-implementation given that
> DT is not oriented to a particular project, but Linux is the canon
> of DT in practice.
> 
> The problem typically arises in the combination of "syscon" and
> "simple-mfd" compatibles.
> 
> In Linux, they are orthogonal, i.e., the order between "syscon" and
> "simple-mfd" does not matter at all.
> 
> Assume the following compatible.
> 
>    compatible = "foo,bar-syscon", "syscon", "simple-mfd";
> 
> In U-Boot, this device node is bound to the syscon driver
> (driver/core/syscon-uclass.c) since the "syscon" is found to be the
> most compatible.  Then, syscon_get_regmap() succeeds.
> 
> However,
> 
>    compatible = "foo,bar-syscon", "simple-mfd", "syscon";
> 
> does not work because this node is bound to the simple-bus driver
> (drivers/core/simple-bus.c) in favor of "simple-mfd" compatible.
> The compatible string "syscon" is just dismissed.
> 
> Moreover,
> 
>    compatible = "foo,bar-syscon", "syscon";
> 
> works like the first case because the syscon driver populates the
> child devices.  This is wrong because populating children is the job
> of "simple-mfd" (or "simple-bus").
> 
> This commit ports syscon_node_to_regmap() from Linux.  This API
> does not require the given node to be bound to a driver in any way.
> 
> Reported-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180507/366579f7/attachment.sig>

      reply	other threads:[~2018-05-08  0:45 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-19  3:14 [U-Boot] [PATCH v2 0/4] Add Linux-compatible syscon_to_regmap API Masahiro Yamada
2018-04-19  3:14 ` [U-Boot] [PATCH v2 1/4] regmap: clean up regmap allocation Masahiro Yamada
2018-04-23  4:30   ` Masahiro Yamada
2018-05-08  0:45   ` [U-Boot] [U-Boot,v2,1/4] " Tom Rini
2018-04-19  3:14 ` [U-Boot] [PATCH v2 2/4] dm: ofnode: add ofnode_device_is_compatible() helper Masahiro Yamada
2018-04-26 14:40   ` Simon Glass
2018-04-26 16:03     ` Masahiro Yamada
2018-04-30 23:12       ` Simon Glass
2018-05-08  0:45   ` [U-Boot] [U-Boot, v2, " Tom Rini
2018-04-19  3:14 ` [U-Boot] [PATCH v2 3/4] regmap: change regmap_init_mem() to take ofnode instead udevice Masahiro Yamada
2018-04-26 14:40   ` Simon Glass
2018-05-08  0:45   ` [U-Boot] [U-Boot, v2, " Tom Rini
2018-04-19  3:14 ` [U-Boot] [PATCH v2 4/4] syscon: add Linux-compatible syscon API Masahiro Yamada
2018-05-08  0:45   ` Tom Rini [this message]

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=20180508004531.GP12235@bill-the-cat.ec.rr.com \
    --to=trini@konsulko.com \
    --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 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.