public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Jerry Van Baren <gerald.vanbaren@ge.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH] fdt: add fdtcmd env var to allow post processing of device tree before boot
Date: Mon, 04 Aug 2008 16:44:47 -0400	[thread overview]
Message-ID: <48976A3F.8060207@ge.com> (raw)
In-Reply-To: <9D5A1BB4-1E4A-445C-A6F8-126443832561@kernel.crashing.org>

Kumar Gala wrote:
> 
> On Aug 4, 2008, at 3:19 PM, Jerry Van Baren wrote:
> 
>> Kumar Gala wrote:
>>> On Aug 4, 2008, at 1:56 PM, Wolfgang Denk wrote:
>>>> In message 
>>>> <Pine.LNX.4.64.0808041346350.3885@blarg.am.freescale.net>  you wrote:
>>>>> Added the 'fdtcmd' environment variable as a way to provide 'fdt'  
>>>>> commands
>>>>> that the user can supply to manipulate the device tree after  
>>>>> ft_board_setup()
>>>>> and before the tree is handled to the kernel.
>>>> Where exactly is the needed, i. e. which spoecific situation  do  you
>>>> have  in  mind  where  this function cannot be implemented as part of
>>>> either a "preboot" or a standard "bootcmd" command sequence?
>>> The situation is if we are fixing up or adding properties or nodes 
>>> via  the ft_board_setup() how do I go about modifying that before 
>>> the  device tree is handed to the kernel.
>>> An example would be if we start adding the i2c node via code in 
>>> u-boot  and after we have done that we want to add a frequency 
>>> property at  runtime w/o changing the u-boot code.
>>> - k
>>
>> My original way long ago initial cut didn't do the board and /chosen 
>> fixups as part of the bootm execution.  My original intent was that we 
>> would run "fdt chosen" and "fdt bd" and whatever else was necessary 
>> before running "bootm", including addressing Kumar's need.
>>
>> Unfortunately, it would have also broken backwards compatibility and 
>> so the concept was sacrificed for backwards compatibility.  :-/
>>
>> Is there a better way of doing this... perhaps have a flag that says 
>> if "fdt chosen" and/or "fdt bd" is run, don't re-run it as part of 
>> bootm? Maybe have an env variable that suppressed the calling of "fdt 
>> chosen" and "fdt bd" in bootm ("nofdtfixup"?)?  Still ugly, but it 
>> would maintain backwards compatibility but also allow us finer grained 
>> control of when "fdt chosen" and "fdt bd" (add "fdt cpu"?) is run and 
>> allow our users to wedge additional fdt stuff in the boot sequence.
> 
> Is that really any better than having the ability to "execute" an 
> environment variable that has 'fdt' commands in it as part of bootm?
> 
> - k

I don't like it that bootm is calling out to all sorts of functions that 
could better be scripted.  It complicates the bootm code (badly!), it 
prevents users from doing clever things (because it hard codes the calls 
and sequences of the calls to loosely related functions), and it 
violates the unix principle of doing only one thing and doing it well 
(bootm code is one big ugly awkward swissarmyknife[tm] tool).

Best regards,
gvb

P.S. This battle was probably lost many years ago, but it still makes me 
feel better to pound the desk and shout.  Oh-oh, people are looking...

  reply	other threads:[~2008-08-04 20:44 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-04 18:46 [U-Boot-Users] [PATCH] fdt: add fdtcmd env var to allow post processing of device tree before boot Kumar Gala
2008-08-04 18:56 ` Wolfgang Denk
2008-08-04 19:49   ` Kumar Gala
2008-08-04 20:19     ` Jerry Van Baren
2008-08-04 20:24       ` Kumar Gala
2008-08-04 20:44         ` Jerry Van Baren [this message]
2008-08-04 20:52           ` Kumar Gala
2008-08-04 21:04           ` Wolfgang Denk
2008-08-04 20:27     ` Wolfgang Denk
2008-08-04 20:50       ` Kumar Gala
2008-08-04 20:55         ` Scott Wood
2008-08-04 22:18           ` Kumar Gala
2008-08-04 22:21             ` Scott Wood
2008-08-04 22:53             ` Wolfgang Denk
2008-08-04 21:07         ` Wolfgang Denk
2008-08-04 22:23           ` Kumar Gala

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=48976A3F.8060207@ge.com \
    --to=gerald.vanbaren@ge.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