public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] idea: fdt_checkboard
@ 2007-05-17 19:11 Timur Tabi
  2007-05-18  2:27 ` Jerry Van Baren
  0 siblings, 1 reply; 4+ messages in thread
From: Timur Tabi @ 2007-05-17 19:11 UTC (permalink / raw)
  To: u-boot

Jerry,

What do you think about implementing a board-specific function called "fdt_checkboard()"? 
  On platforms that have this function, it would be called by fdt_open_into(). 
fdt_checkboard() would scan the device tree and make sure that it's the right tree for 
this board (e.g. by checking the 'model' or 'compatible' fields), and return an error if 
it's not.

This would be helpful in eliminating the possibility of accidentally using the wrong 
device tree.  It could happen, for instance, if there are multiple device trees for a 
given board.

-- 
Timur Tabi
Linux Kernel Developer @ Freescale

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot-Users] idea: fdt_checkboard
  2007-05-17 19:11 [U-Boot-Users] idea: fdt_checkboard Timur Tabi
@ 2007-05-18  2:27 ` Jerry Van Baren
  2007-05-18  6:48   ` Wolfgang Grandegger
  2007-05-18 14:17   ` Timur Tabi
  0 siblings, 2 replies; 4+ messages in thread
From: Jerry Van Baren @ 2007-05-18  2:27 UTC (permalink / raw)
  To: u-boot

Timur Tabi wrote:
> Jerry,
> 
> What do you think about implementing a board-specific function called 
> "fdt_checkboard()"?  On platforms that have this function, it would be 
> called by fdt_open_into(). fdt_checkboard() would scan the device tree 
> and make sure that it's the right tree for this board (e.g. by checking 
> the 'model' or 'compatible' fields), and return an error if it's not.
> 
> This would be helpful in eliminating the possibility of accidentally 
> using the wrong device tree.  It could happen, for instance, if there 
> are multiple device trees for a given board.

Hi Timur,

I would rather give hush the ability to read fdt properties so that the 
logic could be scripted rather than being "hardcoded" in a C function. 
This would give some interesting capabilities, like selecting the proper 
fdt out of several in memory.

Unfortunately I'm spouting off out of ignorance, I don't know at this 
point how much effort it would take to give hush the ability to test fdt 
properties.

Best regards,
gvb

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot-Users] idea: fdt_checkboard
  2007-05-18  2:27 ` Jerry Van Baren
@ 2007-05-18  6:48   ` Wolfgang Grandegger
  2007-05-18 14:17   ` Timur Tabi
  1 sibling, 0 replies; 4+ messages in thread
From: Wolfgang Grandegger @ 2007-05-18  6:48 UTC (permalink / raw)
  To: u-boot

Jerry Van Baren wrote:
> Timur Tabi wrote:
>> Jerry,
>>
>> What do you think about implementing a board-specific function called 
>> "fdt_checkboard()"?  On platforms that have this function, it would be 
>> called by fdt_open_into(). fdt_checkboard() would scan the device tree 
>> and make sure that it's the right tree for this board (e.g. by checking 
>> the 'model' or 'compatible' fields), and return an error if it's not.
>>
>> This would be helpful in eliminating the possibility of accidentally 
>> using the wrong device tree.  It could happen, for instance, if there 
>> are multiple device trees for a given board.
> 
> Hi Timur,
> 
> I would rather give hush the ability to read fdt properties so that the 
> logic could be scripted rather than being "hardcoded" in a C function. 
> This would give some interesting capabilities, like selecting the proper 
> fdt out of several in memory.
> 
> Unfortunately I'm spouting off out of ignorance, I don't know at this 
> point how much effort it would take to give hush the ability to test fdt 
> properties.

Such scripting capabilities might be nice to have but first we need 
something more basic. We should also keep in mind that the FDT will be 
used to configure U-Boot from the early beginning. In this context a 
board specific "fdt_checkboard" function would make sense, but I prefer 
that it's already called when an address is assigned to the blob.

Wolfgang.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot-Users] idea: fdt_checkboard
  2007-05-18  2:27 ` Jerry Van Baren
  2007-05-18  6:48   ` Wolfgang Grandegger
@ 2007-05-18 14:17   ` Timur Tabi
  1 sibling, 0 replies; 4+ messages in thread
From: Timur Tabi @ 2007-05-18 14:17 UTC (permalink / raw)
  To: u-boot

Jerry Van Baren wrote:

> I would rather give hush the ability to read fdt properties so that the 
> logic could be scripted rather than being "hardcoded" in a C function. 
> This would give some interesting capabilities, like selecting the proper 
> fdt out of several in memory.

The two really aren't mutually exclusive.  Besides, fdt_checkboard() would not work in a 
hush script.  The C function would scan the device tree *and* read data from the hardware 
and compare the two.  For instance, if it says that there's a PCI device at address X, it 
should check if CFG_PCI1_MEM_PHYS is set to the same value.  These are the kinds of things 
that can only be done in C code.

-- 
Timur Tabi
Linux Kernel Developer @ Freescale

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-05-18 14:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-17 19:11 [U-Boot-Users] idea: fdt_checkboard Timur Tabi
2007-05-18  2:27 ` Jerry Van Baren
2007-05-18  6:48   ` Wolfgang Grandegger
2007-05-18 14:17   ` Timur Tabi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox