[U-Boot] [PATCH 12/13] armv7: support rk3066 early back to bootrom in start.S

Paweł Jarosz paweljarosz3691 at gmail.com
Fri Jun 9 12:31:51 UTC 2017



W dniu 09.06.2017 o 13:46, Heiko Stuebner pisze:
> Am Mittwoch, 7. Juni 2017, 17:37:13 CEST schrieb Paweł Jarosz:
>> Hi Simon,
>>
>>
>> W dniu 06.06.2017 o 23:10, Simon Glass pisze:
>>> Hi Pawel,
>>>
>>> On 6 June 2017 at 12:53, Paweł Jarosz <paweljarosz3691 at gmail.com> wrote:
>>>> Rockchip bootrom first reads 1KB data from nand at offset 0x10080C00 and
>>>> executes it. Then waits for back to bootrom and loads another 32KB to sram
>>>> which also executes. Sdram initialisation code needs to be in one of these two
>>>> steps. Then bootloader loads another ~200KB of data at offset 0x60000000
>>>> and jumps to it.
>>>>
>>>> 32KB of data is a little low for tpl + spl part and ~200KB data is to low for
>>>> u-boot part(for example to boot from mmc you need to disable usb support.
>>>>
>>>> My solution to size problem is to move sdram initialisation code to tpl stage,
>>>> move spl part to third stage(reading 200KB data) and add support for loading
>>>> u-boot by spl from ext2/4, fat partitions.
>>>>
>>>> But moving sdram initialisation code to tpl increases size of tpl above 1KB
>>>> (first boot stage). Solution to this is to add code which will be below 1KB
>>>> offset in tpl binary and do back to bootrom at very beginning of the tpl
>>>> execution.
>>> So do you mean that TPL starts and then loads more of itself? Why not
>>> put SDRAM init in SPL? You say above that 32KB is 'too low', but It's
>>> not clear why.
>> Ad.1 No. Tpl starts and at the first execution returns to bootrom.
>> Bootrom then loads
>> rest of the tpl (31KB) and executes it for a second time.
>>
>> Ad.2,3 Due to size issues (200KB limit) i needed to move main u-boot to
>> mmc. To load u-boot from
>> mmc by SPL (there is 32KB bootrom limit, not enough space for mmc
>> support) i moved SPL to sdram.
>> Code executed in sdram can't mess with sdram settings because it will
>> hang the board. Sdram setup
>> needs to be done by code in SRAM (tpl).
> At least the rk3288-Firefly was able to also have mmc stack in the SPL in
> the past, without requiring the back_to_bootrom at all. So question would
> be why this doesn't fit anymore, or on the rk3066 specifically.
>
> Also, it seems like I got my hands on a preliminary (linux/mtd) nand driver
> (rk3228 but cursory glance at the registers suggests that it may actually
> work on previous socs down to the rk3066 as well) and it may be possible
> to adapt that for uboot, therefore making the spl able to also load the
> full u-boot from without needing back_to_bootrom.
>
>
> Heiko
I was not able to get mmc support on rk3066 in spl in ~31kb (32kb - 1kb 
for tpl)size limit.
One (or two i didn't check how much) back to bootrom is required on 
rk3066. If not done bootrom stays in weird state and halts on bringup 
secondary cpu in kernel. So it's rk3066 specific.

Paweł


More information about the U-Boot mailing list