public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH u-boot] arm: omap3: Directly use SMC #1 in lowlevel_init.S
@ 2023-04-13 20:34 Pali Rohár
  2023-04-26 12:29 ` Tom Rini
  0 siblings, 1 reply; 2+ messages in thread
From: Pali Rohár @ 2023-04-13 20:34 UTC (permalink / raw)
  To: u-boot; +Cc: Adam Ford

Since commit de39dc71625d ("arm: armv7-a: Compile and tune for armv7-a
instead of armv5") is used -march=armv7-a option for Omap3 platforms.

With directive ".arch_extension sec" it is possible for -march=armv7-a to
directly use ARM SMC instruction.

So enable ".arch_extension sec" in Omap3 lowlevel_init.S and replace hand
assembled ".word 0xe1600071" by "SMC #1".

Since commit 51d063865064 ("arm: omap-common: add secure smc entry") same
pattern is already used in arch/arm/cpu/armv7/omap-common/lowlevel_init.S.

Signed-off-by: Pali Rohár <pali@kernel.org>
---
 arch/arm/mach-omap2/omap3/lowlevel_init.S | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-omap2/omap3/lowlevel_init.S b/arch/arm/mach-omap2/omap3/lowlevel_init.S
index ab7cdcf3d42e..1ab9472e1987 100644
--- a/arch/arm/mach-omap2/omap3/lowlevel_init.S
+++ b/arch/arm/mach-omap2/omap3/lowlevel_init.S
@@ -15,13 +15,14 @@
 #include <asm/arch/clocks_omap3.h>
 #include <linux/linkage.h>
 
+.arch_extension sec
+
 /*
  * Funtion for making PPA HAL API calls in secure devices
  * Input:
  *	R0 - Service ID
  *	R1 - paramer list
  */
-/* TODO: Re-evaluate the comment at the end regarding armv5 vs armv7 */
 ENTRY(do_omap3_emu_romcode_call)
 	PUSH {r4-r12, lr} @ Save all registers from ROM code!
 	MOV r12, r0	@ Copy the Secure Service ID in R12
@@ -32,8 +33,7 @@ ENTRY(do_omap3_emu_romcode_call)
 	MOV r6, #0xFF	@ Indicate new Task call
 	mcr     p15, 0, r0, c7, c10, 4	@ DSB
 	mcr     p15, 0, r0, c7, c10, 5	@ DMB
-	.word	0xe1600071	@ SMC #1 to call PPA service - hand assembled
-				@ because we use -march=armv5
+	SMC     #1	@ Call PPA service
 	POP {r4-r12, pc}
 ENDPROC(do_omap3_emu_romcode_call)
 
-- 
2.20.1


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

* Re: [PATCH u-boot] arm: omap3: Directly use SMC #1 in lowlevel_init.S
  2023-04-13 20:34 [PATCH u-boot] arm: omap3: Directly use SMC #1 in lowlevel_init.S Pali Rohár
@ 2023-04-26 12:29 ` Tom Rini
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2023-04-26 12:29 UTC (permalink / raw)
  To: Pali Rohár; +Cc: u-boot, Adam Ford

[-- Attachment #1: Type: text/plain, Size: 713 bytes --]

On Thu, Apr 13, 2023 at 10:34:43PM +0200, Pali Rohár wrote:

> Since commit de39dc71625d ("arm: armv7-a: Compile and tune for armv7-a
> instead of armv5") is used -march=armv7-a option for Omap3 platforms.
> 
> With directive ".arch_extension sec" it is possible for -march=armv7-a to
> directly use ARM SMC instruction.
> 
> So enable ".arch_extension sec" in Omap3 lowlevel_init.S and replace hand
> assembled ".word 0xe1600071" by "SMC #1".
> 
> Since commit 51d063865064 ("arm: omap-common: add secure smc entry") same
> pattern is already used in arch/arm/cpu/armv7/omap-common/lowlevel_init.S.
> 
> Signed-off-by: Pali Rohár <pali@kernel.org>

Applied to u-boot/master, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

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

end of thread, other threads:[~2023-04-26 12:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-13 20:34 [PATCH u-boot] arm: omap3: Directly use SMC #1 in lowlevel_init.S Pali Rohár
2023-04-26 12:29 ` Tom Rini

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