xtensa: use register window specific opcodes only when present

xtensa core may be configured without register windows support, don't
use register window specific opcodes in that case. Use window register
specific opcodes to initialize hardware or reset core to a known state
regardless of the chosen ABI.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
This commit is contained in:
Max Filippov 2021-07-26 07:25:28 -07:00
parent 0b5372570b
commit 09af39f649
5 changed files with 10 additions and 2 deletions

View File

@ -42,12 +42,14 @@ _bootparam:
.align 4 .align 4
_SetupMMU: _SetupMMU:
#if XCHAL_HAVE_WINDOWED
movi a0, 0 movi a0, 0
wsr a0, windowbase wsr a0, windowbase
rsync rsync
movi a0, 1 movi a0, 1
wsr a0, windowstart wsr a0, windowstart
rsync rsync
#endif
movi a0, 0x1F movi a0, 0x1F
wsr a0, ps wsr a0, ps
rsync rsync

View File

@ -56,13 +56,13 @@ _start:
movi a4, 1 movi a4, 1
wsr a4, ps wsr a4, ps
rsync rsync
#if XCHAL_HAVE_WINDOWED
rsr a5, windowbase rsr a5, windowbase
ssl a5 ssl a5
sll a4, a4 sll a4, a4
wsr a4, windowstart wsr a4, windowstart
rsync rsync
#endif
movi a4, KERNEL_PS_WOE_MASK movi a4, KERNEL_PS_WOE_MASK
wsr a4, ps wsr a4, ps
rsync rsync

View File

@ -58,7 +58,9 @@
* BE shift left / mask 0 0 X X * BE shift left / mask 0 0 X X
*/ */
#if XCHAL_HAVE_WINDOWED
#define UNALIGNED_USER_EXCEPTION #define UNALIGNED_USER_EXCEPTION
#endif
#if XCHAL_HAVE_BE #if XCHAL_HAVE_BE

View File

@ -940,12 +940,14 @@ unrecoverable_text:
ENTRY(unrecoverable_exception) ENTRY(unrecoverable_exception)
#if XCHAL_HAVE_WINDOWED
movi a0, 1 movi a0, 1
movi a1, 0 movi a1, 0
wsr a0, windowstart wsr a0, windowstart
wsr a1, windowbase wsr a1, windowbase
rsync rsync
#endif
movi a1, KERNEL_PS_WOE_MASK | LOCKLEVEL movi a1, KERNEL_PS_WOE_MASK | LOCKLEVEL
wsr a1, ps wsr a1, ps

View File

@ -67,11 +67,13 @@ _SetupOCD:
* xt-gdb to single step via DEBUG exceptions received directly * xt-gdb to single step via DEBUG exceptions received directly
* by ocd. * by ocd.
*/ */
#if XCHAL_HAVE_WINDOWED
movi a1, 1 movi a1, 1
movi a0, 0 movi a0, 0
wsr a1, windowstart wsr a1, windowstart
wsr a0, windowbase wsr a0, windowbase
rsync rsync
#endif
movi a1, LOCKLEVEL movi a1, LOCKLEVEL
wsr a1, ps wsr a1, ps