Skip to content
This repository has been archived by the owner on Jun 2, 2024. It is now read-only.

Commit

Permalink
arm: omap3: Directly use SMC starfive-tech#1 in lowlevel_init.S
Browse files Browse the repository at this point in the history
Since commit de39dc7 ("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 starfive-tech#1".

Since commit 51d0638 ("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 <[email protected]>
  • Loading branch information
pali authored and trini committed Apr 25, 2023
1 parent 51e0cac commit 7add479
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions arch/arm/mach-omap2/omap3/lowlevel_init.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)

Expand Down

0 comments on commit 7add479

Please sign in to comment.