arch/arm/armv7: Make null dcache_apply_all macro for userspace

Make an empty macro for dcache_apply_all for code running in userspace
so that we don't hang the system.

BUG=b:161554141
TEST=Run board through a bunch of recovery cycles.

Signed-off-by: Martin Roth <martin@coreboot.org>
Change-Id: I3dc0f40dfe4d4a699528068154eee2d3c23d3d74
Reviewed-on: https://review.coreboot.org/c/coreboot/+/43787
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
This commit is contained in:
Martin Roth 2020-07-23 19:01:29 -06:00 committed by Felix Held
parent 44d5347ed1
commit fc8da0010b
1 changed files with 15 additions and 0 deletions

View File

@ -23,6 +23,19 @@
* THIS FUNCTION MUST PRESERVE THE VALUE OF r10 * THIS FUNCTION MUST PRESERVE THE VALUE OF r10
*/ */
#if ENV_USER_SPACE
/*
* Empty macro for code running in userspace. Trying to manipulate the
* cache from userspace hangs the system. To run code at a privileged level,
* the userspace code needs to execute an API call to the privileged mode
* code.
*/
.macro dcache_apply_all crm
bx lr
.endm
#else
.macro dcache_apply_all crm .macro dcache_apply_all crm
dsb dsb
mov r3, #-2 @ initialize level so that we start at 0 mov r3, #-2 @ initialize level so that we start at 0
@ -82,6 +95,8 @@
bx lr bx lr
.endm .endm
#endif /* ENV_USER_SPACE */
/* /*
* Bring an ARM processor we just gained control of (e.g. from IROM) into a * Bring an ARM processor we just gained control of (e.g. from IROM) into a
* known state regarding caches/SCTLR. Completely cleans and invalidates * known state regarding caches/SCTLR. Completely cleans and invalidates