public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] rockchip: rk3288: Change method of loading u-boot
@ 2016-06-12  3:56 Ziyuan Xu
  2016-06-12  4:29 ` Eddie Cai
  0 siblings, 1 reply; 4+ messages in thread
From: Ziyuan Xu @ 2016-06-12  3:56 UTC (permalink / raw)
  To: u-boot

If we would like to boot from SD card, we have to implement mmc driver
in SPL stage, and get a slightly larger spl binrary. RK3288's bootrom
code has the ability to load spl and u-boot. This patch tasks maskrom to
load u-boot.

Loading sequence after rework:
bootrom ==> spl ==> bootrom ==> u-boot

Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
---
 arch/arm/mach-rockchip/rk3288/save_boot_param.S | 32 +++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 arch/arm/mach-rockchip/rk3288/save_boot_param.S

diff --git a/arch/arm/mach-rockchip/rk3288/save_boot_param.S b/arch/arm/mach-rockchip/rk3288/save_boot_param.S
new file mode 100644
index 0000000..778ec83
--- /dev/null
+++ b/arch/arm/mach-rockchip/rk3288/save_boot_param.S
@@ -0,0 +1,32 @@
+/*
+ * (C) Copyright 2015 Google, Inc
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#include <linux/linkage.h>
+
+.globl	SAVE_SP_ADDR
+SAVE_SP_ADDR:
+	.word 0
+
+/*
+ * void save_boot_params
+ *
+ * Save sp, lr, r1~r12
+ */
+ENTRY(save_boot_params)
+	push	{r1-r12, lr}
+	ldr	r0, =SAVE_SP_ADDR
+	str	sp, [r0]
+	b	save_boot_params_ret		@ back to my caller
+ENDPROC(save_boot_params)
+
+
+.globl back_to_bootrom
+ENTRY(back_to_bootrom)
+	ldr	r0, =SAVE_SP_ADDR
+	ldr	sp, [r0]
+	mov	r0, #0
+	pop	{r1-r12, pc}
+ENDPROC(back_to_bootrom)
-- 
1.9.1

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

* [U-Boot] [PATCH] rockchip: rk3288: Change method of loading u-boot
  2016-06-12  3:56 Ziyuan Xu
@ 2016-06-12  4:29 ` Eddie Cai
  0 siblings, 0 replies; 4+ messages in thread
From: Eddie Cai @ 2016-06-12  4:29 UTC (permalink / raw)
  To: u-boot

Hi

2016-06-12 11:56 GMT+08:00 Ziyuan Xu <xzy.xu@rock-chips.com>:

> If we would like to boot from SD card, we have to implement mmc driver
> in SPL stage, and get a slightly larger spl binrary. RK3288's bootrom
> code has the ability to load spl and u-boot. This patch tasks maskrom to
> load u-boot.
>
> Loading sequence after rework:
> bootrom ==> spl ==> bootrom ==> u-boot
>
> Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
> ---
>  arch/arm/mach-rockchip/rk3288/save_boot_param.S | 32
> +++++++++++++++++++++++++
>  1 file changed, 32 insertions(+)
>  create mode 100644 arch/arm/mach-rockchip/rk3288/save_boot_param.S
>
> diff --git a/arch/arm/mach-rockchip/rk3288/save_boot_param.S
> b/arch/arm/mach-rockchip/rk3288/save_boot_param.S
> new file mode 100644
> index 0000000..778ec83
> --- /dev/null
> +++ b/arch/arm/mach-rockchip/rk3288/save_boot_param.S
> @@ -0,0 +1,32 @@
> +/*
> + * (C) Copyright 2015 Google, Inc
>
Should be "Copyright 2016 Rockchip Electronics Co., Ltd"

> + *
> + * SPDX-License-Identifier:     GPL-2.0+
> + */
> +
> +#include <linux/linkage.h>
> +
> +.globl SAVE_SP_ADDR
> +SAVE_SP_ADDR:
> +       .word 0
> +
> +/*
> + * void save_boot_params
> + *
> + * Save sp, lr, r1~r12
> + */
> +ENTRY(save_boot_params)
> +       push    {r1-r12, lr}
> +       ldr     r0, =SAVE_SP_ADDR
> +       str     sp, [r0]
> +       b       save_boot_params_ret            @ back to my caller
> +ENDPROC(save_boot_params)
> +
> +
> +.globl back_to_bootrom
> +ENTRY(back_to_bootrom)
> +       ldr     r0, =SAVE_SP_ADDR
> +       ldr     sp, [r0]
> +       mov     r0, #0
> +       pop     {r1-r12, pc}
> +ENDPROC(back_to_bootrom)
> --
> 1.9.1
>
>
>
>


-- 
Eddie

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

* [U-Boot] [PATCH] rockchip: rk3288: Change method of loading u-boot
@ 2016-06-12  5:46 Eddie Cai
  2016-06-12  5:50 ` Ziyuan Xu
  0 siblings, 1 reply; 4+ messages in thread
From: Eddie Cai @ 2016-06-12  5:46 UTC (permalink / raw)
  To: u-boot

Why not move arch/arm/mach-rockchip/rk3036/save_boot_param.S to
arch/arm/mach-rockchip/save_boot_param.S. Then use it directly?

2016-06-12 12:29 GMT+08:00 Eddie Cai <eddie.cai@rock-chips.com>:
>
> Hi
>
> 2016-06-12 11:56 GMT+08:00 Ziyuan Xu <xzy.xu@rock-chips.com>:
>>
>> If we would like to boot from SD card, we have to implement mmc driver
>> in SPL stage, and get a slightly larger spl binrary. RK3288's bootrom
>> code has the ability to load spl and u-boot. This patch tasks maskrom to
>> load u-boot.
>>
>> Loading sequence after rework:
>> bootrom ==> spl ==> bootrom ==> u-boot
>>
>> Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
>> ---
>>  arch/arm/mach-rockchip/rk3288/save_boot_param.S | 32 +++++++++++++++++++++++++
>>  1 file changed, 32 insertions(+)
>>  create mode 100644 arch/arm/mach-rockchip/rk3288/save_boot_param.S
>>
>> diff --git a/arch/arm/mach-rockchip/rk3288/save_boot_param.S b/arch/arm/mach-rockchip/rk3288/save_boot_param.S
>> new file mode 100644
>> index 0000000..778ec83
>> --- /dev/null
>> +++ b/arch/arm/mach-rockchip/rk3288/save_boot_param.S
>> @@ -0,0 +1,32 @@
>> +/*
>> + * (C) Copyright 2015 Google, Inc
>
> Should be "Copyright 2016 Rockchip Electronics Co., Ltd"
>>
>> + *
>> + * SPDX-License-Identifier:     GPL-2.0+
>> + */
>> +
>> +#include <linux/linkage.h>
>> +
>> +.globl SAVE_SP_ADDR
>> +SAVE_SP_ADDR:
>> +       .word 0
>> +
>> +/*
>> + * void save_boot_params
>> + *
>> + * Save sp, lr, r1~r12
>> + */
>> +ENTRY(save_boot_params)
>> +       push    {r1-r12, lr}
>> +       ldr     r0, =SAVE_SP_ADDR
>> +       str     sp, [r0]
>> +       b       save_boot_params_ret            @ back to my caller
>> +ENDPROC(save_boot_params)
>> +
>> +
>> +.globl back_to_bootrom
>> +ENTRY(back_to_bootrom)
>> +       ldr     r0, =SAVE_SP_ADDR
>> +       ldr     sp, [r0]
>> +       mov     r0, #0
>> +       pop     {r1-r12, pc}
>> +ENDPROC(back_to_bootrom)
>> --
>> 1.9.1
>>
>>
>>
>
>
>
> --
> Eddie




-- 
Eddie

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

* [U-Boot] [PATCH] rockchip: rk3288: Change method of loading u-boot
  2016-06-12  5:46 [U-Boot] [PATCH] rockchip: rk3288: Change method of loading u-boot Eddie Cai
@ 2016-06-12  5:50 ` Ziyuan Xu
  0 siblings, 0 replies; 4+ messages in thread
From: Ziyuan Xu @ 2016-06-12  5:50 UTC (permalink / raw)
  To: u-boot



On 2016?06?12? 13:46, Eddie Cai wrote:
> Why not move arch/arm/mach-rockchip/rk3036/save_boot_param.S to
> arch/arm/mach-rockchip/save_boot_param.S. Then use it directly?
>
> 2016-06-12 12:29 GMT+08:00 Eddie Cai <eddie.cai@rock-chips.com>:

Okay, it's make sense to me.

>> Hi
>>
>> 2016-06-12 11:56 GMT+08:00 Ziyuan Xu <xzy.xu@rock-chips.com>:
>>> If we would like to boot from SD card, we have to implement mmc driver
>>> in SPL stage, and get a slightly larger spl binrary. RK3288's bootrom
>>> code has the ability to load spl and u-boot. This patch tasks maskrom to
>>> load u-boot.
>>>
>>> Loading sequence after rework:
>>> bootrom ==> spl ==> bootrom ==> u-boot
>>>
>>> Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
>>> ---
>>>   arch/arm/mach-rockchip/rk3288/save_boot_param.S | 32 +++++++++++++++++++++++++
>>>   1 file changed, 32 insertions(+)
>>>   create mode 100644 arch/arm/mach-rockchip/rk3288/save_boot_param.S
>>>
>>> diff --git a/arch/arm/mach-rockchip/rk3288/save_boot_param.S b/arch/arm/mach-rockchip/rk3288/save_boot_param.S
>>> new file mode 100644
>>> index 0000000..778ec83
>>> --- /dev/null
>>> +++ b/arch/arm/mach-rockchip/rk3288/save_boot_param.S
>>> @@ -0,0 +1,32 @@
>>> +/*
>>> + * (C) Copyright 2015 Google, Inc
>> Should be "Copyright 2016 Rockchip Electronics Co., Ltd"

Fix it next patch.
BTW, I'm sorry that I forget to add other changes, please ignore this 
patch, I will re-send other one.


>>> + *
>>> + * SPDX-License-Identifier:     GPL-2.0+
>>> + */
>>> +
>>> +#include <linux/linkage.h>
>>> +
>>> +.globl SAVE_SP_ADDR
>>> +SAVE_SP_ADDR:
>>> +       .word 0
>>> +
>>> +/*
>>> + * void save_boot_params
>>> + *
>>> + * Save sp, lr, r1~r12
>>> + */
>>> +ENTRY(save_boot_params)
>>> +       push    {r1-r12, lr}
>>> +       ldr     r0, =SAVE_SP_ADDR
>>> +       str     sp, [r0]
>>> +       b       save_boot_params_ret            @ back to my caller
>>> +ENDPROC(save_boot_params)
>>> +
>>> +
>>> +.globl back_to_bootrom
>>> +ENTRY(back_to_bootrom)
>>> +       ldr     r0, =SAVE_SP_ADDR
>>> +       ldr     sp, [r0]
>>> +       mov     r0, #0
>>> +       pop     {r1-r12, pc}
>>> +ENDPROC(back_to_bootrom)
>>> --
>>> 1.9.1
>>>
>>>
>>>
>>
>>
>> --
>> Eddie
>
>
>

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

end of thread, other threads:[~2016-06-12  5:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-12  5:46 [U-Boot] [PATCH] rockchip: rk3288: Change method of loading u-boot Eddie Cai
2016-06-12  5:50 ` Ziyuan Xu
  -- strict thread matches above, loose matches on Subject: below --
2016-06-12  3:56 Ziyuan Xu
2016-06-12  4:29 ` Eddie Cai

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