From: Maxime Ripard <maxime.ripard@free-electrons.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 06/17] dm: Add callback to modify the device tree
Date: Mon, 5 Dec 2016 10:47:57 +0100 [thread overview]
Message-ID: <20161205094757.damhb63ge3ofc2ax@lukather> (raw)
In-Reply-To: <25acf6b1-1e28-bd22-4345-4534deec2026@denx.de>
On Thu, Dec 01, 2016 at 09:39:14AM +0100, Stefan Roese wrote:
> (Adding Simon and Maxim to Cc)
>
> On 23.11.2016 16:12, Mario Six wrote:
> > Certain boards come in different variations by way of utilizing daughter
> > boards, for example. These boards might contain additional chips, which
> > are added to the main board's busses, e.g. I2C.
> >
> > The device tree support for such boards would either, quite naturally,
> > employ the overlay mechanism to add such chips to the tree, or would use
> > one large default device tree, and delete the devices that are actually
> > not present.
> >
> > Regardless of approach, even on the U-Boot level, a modification of the
> > device tree is a prerequisite to have such modular families of boards
> > supported properly.
> >
> > Therefore, we add an option to make the U-Boot device tree (the actual
> > copy later used by the driver model) writeable, and add a callback
> > method that allows boards to modify the device tree at an early stage,
> > at which, hopefully, also the application of device tree overlays will
> > be possible.
> >
> > Signed-off-by: Mario Six <mario.six@gdsys.cc>
>
> I didn't follow DT overlay lately closely especially not in U-Boot.
> Simon, Maxim could you please take a look at this patch and comment
> on its necessity?
>
> > ---
> > common/board_f.c | 3 +++
> > dts/Kconfig | 10 ++++++++++
> > include/asm-generic/global_data.h | 4 ++++
> > include/common.h | 1 +
> > 4 files changed, 18 insertions(+)
> >
> > diff --git a/common/board_f.c b/common/board_f.c
> > index 4b74835..cda5aae 100644
> > --- a/common/board_f.c
> > +++ b/common/board_f.c
> > @@ -1034,6 +1034,9 @@ static init_fnc_t init_sequence_f[] = {
> > #ifdef CONFIG_SYS_EXTBDINFO
> > setup_board_extra,
> > #endif
> > +#ifdef CONFIG_OF_BOARD_FIXUP
> > + board_fix_fdt,
> > +#endif
> > INIT_FUNC_WATCHDOG_RESET
> > reloc_fdt,
> > setup_reloc,
> > diff --git a/dts/Kconfig b/dts/Kconfig
> > index 4b7d8b1..3f64eda 100644
> > --- a/dts/Kconfig
> > +++ b/dts/Kconfig
> > @@ -14,6 +14,16 @@ config OF_CONTROL
> > This feature provides for run-time configuration of U-Boot
> > via a flattened device tree.
> >
> > +config OF_BOARD_FIXUP
> > + bool "Board-specific manipulation of Device Tree"
> > + help
> > + In certain circumstances it is necessary to be able to modify
> > + U-Boot's device tree (e.g. to delete device from it). This option
> > + make the Device Tree writeable and provides a board-specific
> > + "board_fix_fdt" callback (called during pre-relocation time), which
> > + enables the board initialization to modifiy the Device Tree. The
> > + modified copy is subsequently used by U-Boot after relocation.
> > +
Judging from the help, I guess this is going to be applied even before
the device model initialization. Since our plan is to eventually
switch to the device model, and you'll probably need someway to detect
which adjustments you need to make (using a GPIO, some bus, etc.)
which is probably going to be backed by a device model
driver. Wouldn't that introduce a chicken and egg issue?
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161205/7d6cfdcd/attachment.sig>
next prev parent reply other threads:[~2016-12-05 9:47 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-23 15:12 [U-Boot] [PATCH 00/17] arm: mvebu: Add gdsys ControlCenter-Compact board Mario Six
2016-11-23 15:12 ` [U-Boot] [PATCH 01/17] pci: mvebu: Fix Armada 38x support Mario Six
2016-11-23 15:12 ` [U-Boot] [PATCH 02/17] arm: mvebu: Add gpio support Mario Six
2016-12-01 8:26 ` Stefan Roese
2016-11-23 15:12 ` [U-Boot] [PATCH 03/17] net: phy: Support Marvell 88E1680 Mario Six
2016-11-29 23:00 ` Joe Hershberger
2016-12-01 11:01 ` Dirk Eibach
2016-11-23 15:12 ` [U-Boot] [PATCH 04/17] mvebu: Add board_pex_config() Mario Six
2016-12-01 8:30 ` Stefan Roese
2016-12-01 10:55 ` Dirk Eibach
2016-11-23 15:12 ` [U-Boot] [PATCH 05/17] arm: mvebu: spl.c: Remove useless gd declaration Mario Six
2016-11-23 15:12 ` [U-Boot] [PATCH 06/17] dm: Add callback to modify the device tree Mario Six
2016-12-01 8:39 ` Stefan Roese
2016-12-05 6:24 ` Simon Glass
2016-12-05 15:32 ` Mario Six
2016-12-07 3:47 ` Simon Glass
2016-12-05 9:47 ` Maxime Ripard [this message]
2016-11-23 15:12 ` [U-Boot] [PATCH 07/17] lib: tpm: Add command to flush resources Mario Six
2016-12-01 8:42 ` Stefan Roese
2016-12-05 6:24 ` Simon Glass
2016-12-05 14:50 ` Mario Six
2016-11-23 15:12 ` [U-Boot] [PATCH 08/17] tools: kwbimage: Fix dest addr Mario Six
2016-11-23 15:12 ` [U-Boot] [PATCH 09/17] tools: kwbimage: Fix style violations Mario Six
2016-11-23 15:12 ` [U-Boot] [PATCH 10/17] tools: kwbimage: Fix arithmetic with void pointers Mario Six
2016-11-23 15:12 ` [U-Boot] [PATCH 11/17] tools: kwbimage: Reduce scope of variables Mario Six
2016-11-23 15:12 ` [U-Boot] [PATCH 12/17] tools: kwbimage: Remove unused parameter Mario Six
2016-11-23 15:12 ` [U-Boot] [PATCH 13/17] tools: kwbimage: Factor out add_binary_header_v1 Mario Six
2016-11-23 15:12 ` [U-Boot] [PATCH 14/17] tools: kwbimage: Refactor line parsing and fix error Mario Six
2016-11-23 15:12 ` [U-Boot] [PATCH 15/17] arm: mvebu: Implement secure boot Mario Six
2016-12-01 9:15 ` Stefan Roese
2016-12-07 7:23 ` Mario Six
2016-11-23 15:12 ` [U-Boot] [PATCH 16/17] arm: mvebu: Add gdsys ControlCenter-Compact board Mario Six
2016-12-01 9:57 ` Stefan Roese
2016-12-02 9:34 ` Mario Six
2016-11-23 15:12 ` [U-Boot] [PATCH 17/17] controlcenterdc: Make secure boot available Mario Six
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=20161205094757.damhb63ge3ofc2ax@lukather \
--to=maxime.ripard@free-electrons.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox