diff mbox

[U-Boot,v2,20/22] x86: Disable CAR before relocation on platforms that need it

Message ID 1420154295-16633-21-git-send-email-sjg@chromium.org
State Accepted
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass Jan. 1, 2015, 11:18 p.m. UTC
For platforms with CAR we should disable it before relocation. Check if
this function is available and call it if so.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v2:
- Use a simple call instruction to call car_uninit

 arch/x86/cpu/start.S | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Bin Meng Jan. 4, 2015, 3:53 a.m. UTC | #1
Hi Simon,

On Fri, Jan 2, 2015 at 7:18 AM, Simon Glass <sjg@chromium.org> wrote:
> For platforms with CAR we should disable it before relocation. Check if
> this function is available and call it if so.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
> Changes in v2:
> - Use a simple call instruction to call car_uninit
>
>  arch/x86/cpu/start.S | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/arch/x86/cpu/start.S b/arch/x86/cpu/start.S
> index 125782c..be8a2dc 100644
> --- a/arch/x86/cpu/start.S
> +++ b/arch/x86/cpu/start.S
> @@ -205,6 +205,15 @@ board_init_f_r_trampoline:
>         /* Setup global descriptor table so gd->xyz works */
>         call    setup_gdt
>
> +       /* Set if we need to disable CAR */
> +.weak  car_uninit
> +       movl    $car_uninit, %eax
> +       cmpl    $0, %eax
> +       jz      1f
> +
> +       /* Pass return address in ebx */

The comment need to be fixed, or just simply remove this.

> +       call    car_uninit
> +1:
>         /* Re-enter U-Boot by calling board_init_f_r */
>         call    board_init_f_r
>
> --

Regards,
Bin
Simon Glass Jan. 5, 2015, 5:41 p.m. UTC | #2
On 3 January 2015 at 20:53, Bin Meng <bmeng.cn@gmail.com> wrote:
> Hi Simon,
>
> On Fri, Jan 2, 2015 at 7:18 AM, Simon Glass <sjg@chromium.org> wrote:
>> For platforms with CAR we should disable it before relocation. Check if
>> this function is available and call it if so.
>>
>> Signed-off-by: Simon Glass <sjg@chromium.org>
>> ---
>>
>> Changes in v2:
>> - Use a simple call instruction to call car_uninit
>>
>>  arch/x86/cpu/start.S | 9 +++++++++
>>  1 file changed, 9 insertions(+)
>>
>> diff --git a/arch/x86/cpu/start.S b/arch/x86/cpu/start.S
>> index 125782c..be8a2dc 100644
>> --- a/arch/x86/cpu/start.S
>> +++ b/arch/x86/cpu/start.S
>> @@ -205,6 +205,15 @@ board_init_f_r_trampoline:
>>         /* Setup global descriptor table so gd->xyz works */
>>         call    setup_gdt
>>
>> +       /* Set if we need to disable CAR */
>> +.weak  car_uninit
>> +       movl    $car_uninit, %eax
>> +       cmpl    $0, %eax
>> +       jz      1f
>> +
>> +       /* Pass return address in ebx */
>
> The comment need to be fixed, or just simply remove this.

Applied to u-boot-x86/next.

(With comment removed)
diff mbox

Patch

diff --git a/arch/x86/cpu/start.S b/arch/x86/cpu/start.S
index 125782c..be8a2dc 100644
--- a/arch/x86/cpu/start.S
+++ b/arch/x86/cpu/start.S
@@ -205,6 +205,15 @@  board_init_f_r_trampoline:
 	/* Setup global descriptor table so gd->xyz works */
 	call	setup_gdt
 
+	/* Set if we need to disable CAR */
+.weak	car_uninit
+	movl	$car_uninit, %eax
+	cmpl	$0, %eax
+	jz	1f
+
+	/* Pass return address in ebx */
+	call	car_uninit
+1:
 	/* Re-enter U-Boot by calling board_init_f_r */
 	call	board_init_f_r