Skip to content

Commit 09af39f

Browse files
committed
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 <[email protected]>
1 parent 0b53725 commit 09af39f

File tree

5 files changed

+10
-2
lines changed

5 files changed

+10
-2
lines changed

arch/xtensa/boot/boot-elf/bootstrap.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,14 @@ _bootparam:
4242

4343
.align 4
4444
_SetupMMU:
45+
#if XCHAL_HAVE_WINDOWED
4546
movi a0, 0
4647
wsr a0, windowbase
4748
rsync
4849
movi a0, 1
4950
wsr a0, windowstart
5051
rsync
52+
#endif
5153
movi a0, 0x1F
5254
wsr a0, ps
5355
rsync

arch/xtensa/boot/boot-redboot/bootstrap.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ _start:
5656
movi a4, 1
5757
wsr a4, ps
5858
rsync
59-
59+
#if XCHAL_HAVE_WINDOWED
6060
rsr a5, windowbase
6161
ssl a5
6262
sll a4, a4
6363
wsr a4, windowstart
6464
rsync
65-
65+
#endif
6666
movi a4, KERNEL_PS_WOE_MASK
6767
wsr a4, ps
6868
rsync

arch/xtensa/kernel/align.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@
5858
* BE shift left / mask 0 0 X X
5959
*/
6060

61+
#if XCHAL_HAVE_WINDOWED
6162
#define UNALIGNED_USER_EXCEPTION
63+
#endif
6264

6365
#if XCHAL_HAVE_BE
6466

arch/xtensa/kernel/entry.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -940,12 +940,14 @@ unrecoverable_text:
940940

941941
ENTRY(unrecoverable_exception)
942942

943+
#if XCHAL_HAVE_WINDOWED
943944
movi a0, 1
944945
movi a1, 0
945946

946947
wsr a0, windowstart
947948
wsr a1, windowbase
948949
rsync
950+
#endif
949951

950952
movi a1, KERNEL_PS_WOE_MASK | LOCKLEVEL
951953
wsr a1, ps

arch/xtensa/kernel/head.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,13 @@ _SetupOCD:
6767
* xt-gdb to single step via DEBUG exceptions received directly
6868
* by ocd.
6969
*/
70+
#if XCHAL_HAVE_WINDOWED
7071
movi a1, 1
7172
movi a0, 0
7273
wsr a1, windowstart
7374
wsr a0, windowbase
7475
rsync
76+
#endif
7577

7678
movi a1, LOCKLEVEL
7779
wsr a1, ps

0 commit comments

Comments
 (0)