diff mbox

[U-Boot] Nokia RX-51: Do not call secure PPA routine on non secure devices

Message ID 1420708300-16435-1-git-send-email-pali.rohar@gmail.com
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Pali Rohár Jan. 8, 2015, 9:11 a.m. UTC
Since commit 41623c91b09a0c865fab41acdaff30f060f29ad6 u-boot running in qemu is
crashing in function do_omap3_emu_romcode_call(). RX-51 board uses this function
for Cortex-A8 errata 430973 workaround (Set IBE bit in ACR) which is needed only
on real secure device and not in qemu.

This board patch just disable calling secure PPA routine on non secure devices.
Qemu implements GP device and with this patch u-boot is working in qemu again.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
---
 board/nokia/rx51/rx51.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Pavel Machek Jan. 8, 2015, 2:02 p.m. UTC | #1
On Thu 2015-01-08 10:11:40, Pali Rohár wrote:
> Since commit 41623c91b09a0c865fab41acdaff30f060f29ad6 u-boot running in qemu is
> crashing in function do_omap3_emu_romcode_call(). RX-51 board uses this function
> for Cortex-A8 errata 430973 workaround (Set IBE bit in ACR) which is needed only
> on real secure device and not in qemu.
> 
> This board patch just disable calling secure PPA routine on non secure devices.
> Qemu implements GP device and with this patch u-boot is working in qemu again.
> 
> Signed-off-by: Pali Rohár <pali.rohar@gmail.com>

Acked-by: Pavel Machek <pavel@ucw.cz>

> ---
>  board/nokia/rx51/rx51.c |    6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/board/nokia/rx51/rx51.c b/board/nokia/rx51/rx51.c
> index b6b8ad6..08fcaf2 100644
> --- a/board/nokia/rx51/rx51.c
> +++ b/board/nokia/rx51/rx51.c
> @@ -422,8 +422,12 @@ int misc_init_r(void)
>  	/*
>  	 * Cortex-A8(r1p0..r1p2) errata 430973 workaround
>  	 * Set IBE bit in Auxiliary Control Register
> +	 *
> +	 * Call this routine only on real secure device
> +	 * Qemu does not implement secure PPA and crash
>  	 */
> -	omap3_update_aux_cr_secure_rx51(1 << 6, 0);
> +	if (get_device_type() == HS_DEVICE)
> +		omap3_update_aux_cr_secure_rx51(1 << 6, 0);
>  
>  	return 0;
>  }
Georges Savoundararadj Jan. 8, 2015, 9:53 p.m. UTC | #2
Hi Pali Rohár,

Have you tested this patch on a secure device (as the nokia n900)?

Regards,

Georges

Le 08/01/2015 10:11, Pali Rohár a écrit :
> Since commit 41623c91b09a0c865fab41acdaff30f060f29ad6 u-boot running in qemu is
> crashing in function do_omap3_emu_romcode_call(). RX-51 board uses this function
> for Cortex-A8 errata 430973 workaround (Set IBE bit in ACR) which is needed only
> on real secure device and not in qemu.
>
> This board patch just disable calling secure PPA routine on non secure devices.
> Qemu implements GP device and with this patch u-boot is working in qemu again.
>
> Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> ---
>   board/nokia/rx51/rx51.c |    6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/board/nokia/rx51/rx51.c b/board/nokia/rx51/rx51.c
> index b6b8ad6..08fcaf2 100644
> --- a/board/nokia/rx51/rx51.c
> +++ b/board/nokia/rx51/rx51.c
> @@ -422,8 +422,12 @@ int misc_init_r(void)
>   	/*
>   	 * Cortex-A8(r1p0..r1p2) errata 430973 workaround
>   	 * Set IBE bit in Auxiliary Control Register
> +	 *
> +	 * Call this routine only on real secure device
> +	 * Qemu does not implement secure PPA and crash
>   	 */
> -	omap3_update_aux_cr_secure_rx51(1 << 6, 0);
> +	if (get_device_type() == HS_DEVICE)
> +		omap3_update_aux_cr_secure_rx51(1 << 6, 0);
>   
>   	return 0;
>   }
Tom Rini Jan. 12, 2015, 8:11 p.m. UTC | #3
On Thu, Jan 08, 2015 at 10:11:40AM +0100, Pali Rohár wrote:

> Since commit 41623c91b09a0c865fab41acdaff30f060f29ad6 u-boot running in qemu is
> crashing in function do_omap3_emu_romcode_call(). RX-51 board uses this function
> for Cortex-A8 errata 430973 workaround (Set IBE bit in ACR) which is needed only
> on real secure device and not in qemu.
> 
> This board patch just disable calling secure PPA routine on non secure devices.
> Qemu implements GP device and with this patch u-boot is working in qemu again.
> 
> Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> Acked-by: Pavel Machek <pavel@ucw.cz>

Applied to u-boot/master, thanks!
Pali Rohár Jan. 15, 2015, 8:49 a.m. UTC | #4
Yes, and it is working (linux kernel was booted without problem).

On Thursday 08 January 2015 22:53:18 Georges Savoundararadj 
wrote:
> Hi Pali Rohár,
> 
> Have you tested this patch on a secure device (as the nokia
> n900)?
> 
> Regards,
> 
> Georges
> 
> Le 08/01/2015 10:11, Pali Rohár a écrit :
> > Since commit 41623c91b09a0c865fab41acdaff30f060f29ad6 u-boot
> > running in qemu is crashing in function
> > do_omap3_emu_romcode_call(). RX-51 board uses this function
> > for Cortex-A8 errata 430973 workaround (Set IBE bit in ACR)
> > which is needed only on real secure device and not in qemu.
> > 
> > This board patch just disable calling secure PPA routine on
> > non secure devices. Qemu implements GP device and with this
> > patch u-boot is working in qemu again.
> > 
> > Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> > ---
> > 
> >   board/nokia/rx51/rx51.c |    6 +++++-
> >   1 file changed, 5 insertions(+), 1 deletion(-)
> > 
> > diff --git a/board/nokia/rx51/rx51.c
> > b/board/nokia/rx51/rx51.c index b6b8ad6..08fcaf2 100644
> > --- a/board/nokia/rx51/rx51.c
> > +++ b/board/nokia/rx51/rx51.c
> > @@ -422,8 +422,12 @@ int misc_init_r(void)
> > 
> >   	/*
> >   	
> >   	 * Cortex-A8(r1p0..r1p2) errata 430973 workaround
> >   	 * Set IBE bit in Auxiliary Control Register
> > 
> > +	 *
> > +	 * Call this routine only on real secure device
> > +	 * Qemu does not implement secure PPA and crash
> > 
> >   	 */
> > 
> > -	omap3_update_aux_cr_secure_rx51(1 << 6, 0);
> > +	if (get_device_type() == HS_DEVICE)
> > +		omap3_update_aux_cr_secure_rx51(1 << 6, 0);
> > 
> >   	return 0;
> >   
> >   }
diff mbox

Patch

diff --git a/board/nokia/rx51/rx51.c b/board/nokia/rx51/rx51.c
index b6b8ad6..08fcaf2 100644
--- a/board/nokia/rx51/rx51.c
+++ b/board/nokia/rx51/rx51.c
@@ -422,8 +422,12 @@  int misc_init_r(void)
 	/*
 	 * Cortex-A8(r1p0..r1p2) errata 430973 workaround
 	 * Set IBE bit in Auxiliary Control Register
+	 *
+	 * Call this routine only on real secure device
+	 * Qemu does not implement secure PPA and crash
 	 */
-	omap3_update_aux_cr_secure_rx51(1 << 6, 0);
+	if (get_device_type() == HS_DEVICE)
+		omap3_update_aux_cr_secure_rx51(1 << 6, 0);
 
 	return 0;
 }