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

2017-07-04 Thread Philipp Tomsich



On Tue, 6 Jun 2017, Paweł Jarosz 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 0x6000
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.

Adding this few lines of code here meets these conditions.

Signed-off-by: Paweł Jarosz 
Acked-by: Philipp Tomsich 
---
arch/arm/cpu/armv7/start.S | 13 +
1 file changed, 13 insertions(+)

diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
index f06fd28..73e03d9 100644
--- a/arch/arm/cpu/armv7/start.S
+++ b/arch/arm/cpu/armv7/start.S
@@ -36,6 +36,19 @@
#endif

reset:
+
+#if defined(CONFIG_ROCKCHIP_RK3066) && defined(CONFIG_TPL_BUILD)
+   ldr r3, =0x10080900
+   ldr r0, [r3]
+   cmp r0, #1
+   movne   r0, #1
+   strne   r0, [r3]
+   beq out_of_bootrom
+   bx  lr
+out_of_bootrom:
+   mov r0, #0
+   str r0, [r3]
+#endif


I don't like us adding device-specific code to armv7/start.S.
Can you try to handle this in the boot0 hook (device-specific) or somewhere 
else (more suitable/chip-specific)?



/* Allow the board to save important registers */
b   save_boot_params
save_boot_params_ret:


___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


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

2017-06-25 Thread Philipp Tomsich
> 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 0x6000
> 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.
> 
> Adding this few lines of code here meets these conditions.
> 
> Signed-off-by: Paweł Jarosz 
> ---
>  arch/arm/cpu/armv7/start.S | 13 +
>  1 file changed, 13 insertions(+)
> 

Acked-by: Philipp Tomsich 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot