* [Query] Does u-boot processes dtb file
@ 2012-09-14 6:58 Viresh Kumar
2012-09-14 7:08 ` Dirk Behme
0 siblings, 1 reply; 5+ messages in thread
From: Viresh Kumar @ 2012-09-14 6:58 UTC (permalink / raw)
To: linux-arm-kernel
Hi Arnd,
Sorry for the stupid question, but somebody asked this to me and i wasn't sure
about it.
We boot with dtb from u-boot using following command:
bootm <uImage addr> <initrd addr> <dtb addr>
Does u-boot do anything special or simply passes address of dtb in r2 to kernel?
i.e. if i do bootm <uImage addr> and stop my kernel early using a debugger,
update r2 with dtb address, will it work the same way?
OR
Does any bootloader needs some special code for handling dtb's?
--
viresh
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Query] Does u-boot processes dtb file
2012-09-14 6:58 [Query] Does u-boot processes dtb file Viresh Kumar
@ 2012-09-14 7:08 ` Dirk Behme
2012-09-14 7:16 ` Viresh Kumar
0 siblings, 1 reply; 5+ messages in thread
From: Dirk Behme @ 2012-09-14 7:08 UTC (permalink / raw)
To: linux-arm-kernel
On 14.09.2012 08:58, Viresh Kumar wrote:
> Hi Arnd,
>
>
> Sorry for the stupid question, but somebody asked this to me and i wasn't sure
> about it.
>
> We boot with dtb from u-boot using following command:
> bootm <uImage addr> <initrd addr> <dtb addr>
>
> Does u-boot do anything special or simply passes address of dtb in r2 to kernel?
>
> i.e. if i do bootm <uImage addr> and stop my kernel early using a debugger,
> update r2 with dtb address, will it work the same way?
>
> OR
>
> Does any bootloader needs some special code for handling dtb's?
Working with U-Boot, to my understanding U-Boot modifies ('patches') the
dtb read from the boot device before passing it to the kernel. It e.g.
adds the kernel command line and the memory size you specify in U-Boot
to the dtb.
Best regards
Dirk
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Query] Does u-boot processes dtb file
2012-09-14 7:08 ` Dirk Behme
@ 2012-09-14 7:16 ` Viresh Kumar
2012-09-14 7:35 ` Dirk Behme
0 siblings, 1 reply; 5+ messages in thread
From: Viresh Kumar @ 2012-09-14 7:16 UTC (permalink / raw)
To: linux-arm-kernel
On 14 September 2012 12:38, Dirk Behme <dirk.behme@de.bosch.com> wrote:
> Working with U-Boot, to my understanding U-Boot modifies ('patches') the dtb
> read from the boot device before passing it to the kernel. It e.g. adds the
> kernel command line and the memory size you specify in U-Boot to the dtb.
Thanks for your response.
But, if this information is also embedded in the dts earlier, will my workaround
of filling r2 work?
Is filling bootargs and memory size the only stuff or some other things too?
--
viresh
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Query] Does u-boot processes dtb file
2012-09-14 7:16 ` Viresh Kumar
@ 2012-09-14 7:35 ` Dirk Behme
2012-09-14 9:16 ` Stefan Roese
0 siblings, 1 reply; 5+ messages in thread
From: Dirk Behme @ 2012-09-14 7:35 UTC (permalink / raw)
To: linux-arm-kernel
On 14.09.2012 09:16, Viresh Kumar wrote:
> On 14 September 2012 12:38, Dirk Behme <dirk.behme@de.bosch.com> wrote:
>> Working with U-Boot, to my understanding U-Boot modifies ('patches') the dtb
>> read from the boot device before passing it to the kernel. It e.g. adds the
>> kernel command line and the memory size you specify in U-Boot to the dtb.
>
> Thanks for your response.
>
> But, if this information is also embedded in the dts earlier, will my workaround
> of filling r2 work?
I think so, but I never tried it. It's on my todo list to try this ;) If
you add all the information needed in the dts file and the resulting dtb
file is identical to the 'patched' dtb U-Boot passes to the kernel,
there should be no difference (?).
> Is filling bootargs and memory size the only stuff or some other things too?
I'm not totally sure on this. You could debug this: (a) Take the dtb
file from your boot device. (b) dump the dtb file U-Boot passes to the
kernel (i.e. do a memory dump from the pointer U-Boot passes in r2).
Compare (a) and (b) with a binary diff.
Best regards
Dirk
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Query] Does u-boot processes dtb file
2012-09-14 7:35 ` Dirk Behme
@ 2012-09-14 9:16 ` Stefan Roese
0 siblings, 0 replies; 5+ messages in thread
From: Stefan Roese @ 2012-09-14 9:16 UTC (permalink / raw)
To: linux-arm-kernel
On 09/14/2012 09:35 AM, Dirk Behme wrote:
> On 14.09.2012 09:16, Viresh Kumar wrote:
>> On 14 September 2012 12:38, Dirk Behme <dirk.behme@de.bosch.com> wrote:
>>> Working with U-Boot, to my understanding U-Boot modifies ('patches') the dtb
>>> read from the boot device before passing it to the kernel. It e.g. adds the
>>> kernel command line and the memory size you specify in U-Boot to the dtb.
>>
>> Thanks for your response.
>>
>> But, if this information is also embedded in the dts earlier, will my workaround
>> of filling r2 work?
>
> I think so, but I never tried it. It's on my todo list to try this ;) If
> you add all the information needed in the dts file and the resulting dtb
> file is identical to the 'patched' dtb U-Boot passes to the kernel,
> there should be no difference (?).
Yes, this should work. As a matter of fact, we are using this
pre-patched dtb method for booting directly from the SPL U-Boot version
(small, limited U-Boot version) into the Linux kernel (skipping the
full-blown U-Boot with the dtb patching upon bootm).
>> Is filling bootargs and memory size the only stuff or some other things too?
>
> I'm not totally sure on this. You could debug this: (a) Take the dtb
> file from your boot device. (b) dump the dtb file U-Boot passes to the
> kernel (i.e. do a memory dump from the pointer U-Boot passes in r2).
> Compare (a) and (b) with a binary diff.
The DT properties that are "patched" differ from platform to platform.
Some also insert dynamically detected clock speeds. Also the board
specific MAC address is often inserted into the dtb. But for basic
kernel bootup, memsize and bootargs are definitely the most important ones.
You could also use U-Boot on the board (if available) to prepare/patch
the dtb via the "fdt" commands. If you have questions on this, please
ask on the u-boot list.
Cheers,
Stefan
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-09-14 9:16 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-14 6:58 [Query] Does u-boot processes dtb file Viresh Kumar
2012-09-14 7:08 ` Dirk Behme
2012-09-14 7:16 ` Viresh Kumar
2012-09-14 7:35 ` Dirk Behme
2012-09-14 9:16 ` Stefan Roese
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).