mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <sha@pengutronix.de>
To: Michael Riesch <michael.riesch@wolfvision.net>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH v3 0/7] support overlays to the barebox live tree
Date: Thu, 16 Mar 2023 09:58:38 +0100	[thread overview]
Message-ID: <20230316085838.GQ7446@pengutronix.de> (raw)
In-Reply-To: <7488559d-b9bc-0482-0732-8ab1d794f3fa@wolfvision.net>

On Wed, Mar 15, 2023 at 05:09:47PM +0100, Michael Riesch wrote:
> Hi Sascha,
> 
> On 3/10/23 10:42, Sascha Hauer wrote:
> > Support for applying a device tree overlay to the barebox live tree
> > is already present. This series adds a few missing pieces:
> > 
> > - add support for applying overlays to the live tree from the command
> >   line
> > - add support for adding new I2C/SPI devices via overlays
> > - add Makefile magic to build dtbo files and dtbo.o files to include
> >   into the barebox binary from dtso files
> > 
> > Changes since v2:
> > - Don't build compressed dtbo files
> > - Do not build overlays for PBL
> > - rename symbols to __dtbo_ to avoid possible name clashes
> > 
> > Changes since v1:
> > - add a device_rescan() static inline wrapper
> > - add missing call to of_i2c_register_devices() in i2c_add_numbered_adapter()
> > - replace device_detect with device_rescan in of_device_create_on_demand()
> > 
> > Sascha Hauer (7):
> >   kbuild: Add target to build dtb overlay files
> >   driver: Add rescan hook to struct device
> >   i2c: implement rescan
> >   spi: Directly register SPI device
> >   spi: reduce scope of 'chip'
> >   spi: implement rescan
> >   of_overlay: Add option to apply overlay to live tree
> > 
> >  commands/of_overlay.c  | 38 ++++++++++++++++++++++++++++++++++----
> >  drivers/i2c/i2c.c      | 24 +++++++++---------------
> >  drivers/of/platform.c  | 12 +++++-------
> >  drivers/spi/spi.c      | 29 ++++++++++++++++++++++++-----
> >  include/driver.h       |  6 ++++++
> >  scripts/Makefile.build |  2 ++
> >  scripts/Makefile.lib   | 10 +++++++++-
> >  scripts/gen-dtbo-s     | 14 ++++++++++++++
> >  8 files changed, 103 insertions(+), 32 deletions(-)
> >  create mode 100755 scripts/gen-dtbo-s
> > 
> 
> With this series I can apply a device tree overlay, but a node with a
> "fixed-clock" does not lead to a corresponding clock showing up in clk_dump.
> 
> Any idea what went wrong here?

The fixed-clock is initialized with CLK_OF_DECLARE which results in a
linker list which is iterated over in of_clk_init() which is called
in an initcall during barebox startup.

The clocks registered via CLK_OF_DECLARE do not have a device associated
with them. The clocks also do not have a link to the device node they
provide the clock for, also the device node doesn't have a link to the
clock. This means we currently have no idea whether there already is
a clock registered for a particular node or if the node has just been
added by an overlay. There seems to be some work necessary to get this
working.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



      reply	other threads:[~2023-03-16  9:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-10  9:42 Sascha Hauer
2023-03-10  9:42 ` [PATCH v3 1/7] kbuild: Add target to build dtb overlay files Sascha Hauer
2023-03-10  9:42 ` [PATCH v3 2/7] driver: Add rescan hook to struct device Sascha Hauer
2023-03-10  9:42 ` [PATCH v3 3/7] i2c: implement rescan Sascha Hauer
2023-03-10  9:42 ` [PATCH v3 4/7] spi: Directly register SPI device Sascha Hauer
2023-03-10  9:42 ` [PATCH v3 5/7] spi: reduce scope of 'chip' Sascha Hauer
2023-03-10  9:42 ` [PATCH v3 6/7] spi: implement rescan Sascha Hauer
2023-03-10  9:42 ` [PATCH v3 7/7] of_overlay: Add option to apply overlay to live tree Sascha Hauer
2023-03-14 14:59   ` Michael Riesch
2023-03-14 15:49     ` Sascha Hauer
2023-03-14 16:03       ` Michael Riesch
2023-03-15 16:09 ` [PATCH v3 0/7] support overlays to the barebox " Michael Riesch
2023-03-16  8:58   ` Sascha Hauer [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=20230316085838.GQ7446@pengutronix.de \
    --to=sha@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=michael.riesch@wolfvision.net \
    /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