building RaspPi Images
Warner Losh
imp at bsdimp.com
Sun Feb 10 14:56:16 UTC 2013
On Feb 10, 2013, at 1:20 AM, Andrew Turner wrote:
> On Sun, 10 Feb 2013 00:47:38 -0700
> Warner Losh <imp at bsdimp.com> wrote:
>
>>
>> On Feb 10, 2013, at 12:18 AM, Tim Kientzle wrote:
>>
>>> On Feb 9, 2013, at 11:07 PM, Warner Losh wrote:
>>>
>>>>> * For RPi, this already happens: the first-stage boot
>>>>> loads a DTB, ubldr uses "fdt addr" to access that DTB
>>>>> in a known location and then passes it to the kernel.
>>>>
>>>> Doesn't the RPi's boot loader give our /boot/loader enough info to
>>>> get this without the fdt addr command?
>>>
>>> I haven't dug into this yet, but there's a mismatch somewhere
>>> between the RPi first-stage boot loader, U-Boot, and our ubldr.
>>>
>>> I briefly tried loading our kernel straight from the RPi
>>> first stage boot loader (dropping U-Boot and ubldr
>>> phases) but didn't get very far with it.
>>
>> Our ubldr currently ignores r2 on boot, and tries to get the FDT via
>> a different uboot interface, but I'm thinking that part is broken...
>
> As I understand it ubldr is an elf image. We use the bootelf command
> from U-Boot to jump into it. This command executes entry(argc, argv);
> to run ubldr. As argc is an int and argv is a pointer these will be in
> r0 and r1 respectively, as such is shouldn't look at r2.
Right, we're doing it wrong. Or rather, we're using the standalone interface when we should be using the linux interface. The stand alone interface should, in theory, provide us with the DTB, but the code that is in ubldr doesn't seem to be reliably getitng this image. If we can't get it reliably from the standalone interface, we should switch to the linux interface, where it should be trivial to get it.
> It looks like ubldr doesn't look at argc and argv, and should have no
> need to unless we decide to have it take the address of the dtb on the
> command line, or have some other data passed in from U-Boot.
uboot is supposed pass dtb to us. We're using the self-hosted interface, rather than the linux interface, to boot. uboot is supposed to have a jump table that we find and use to get the dtb from it, but that code seems to not be working reliably. uboot gives linux images the DTB w/o any problem today, but you have to run mkimage to get the image file to load into uboot for that to work.
We sure shouldn't be passing an address of the dtb via a command line argument.
Warner
More information about the freebsd-arm
mailing list