Skip to content

Commit 4c93c7b

Browse files
committed
Suport disabling the lower half of the instruction cache.
1 parent 74ecf85 commit 4c93c7b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

core/spiflash-cache-enable.S

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
rboot_megabyte:
2323
.byte RBOOT_MEGABYTE_DEFAULT
2424

25+
.global enable_low_icache
26+
enable_low_icache:
27+
.byte 1
28+
2529
.section .data
2630
.local cache_return_save
2731
.align 4
@@ -44,7 +48,8 @@ Cache_Read_Enable:
4448
/* map the first megabyte of flash */
4549
movi a2, 0
4650
movi a3, 0
47-
movi a4, 1
51+
movi a4, enable_low_icache
52+
l8ui a4, a4, 0
4853
call0 rom_Cache_Read_Enable
4954

5055
movi a3, RBOOT_CONFIG_BASE
@@ -67,7 +72,8 @@ Cache_Read_Enable:
6772
l32i a4, a4, 0
6873
extui a2, a4, 0, 1 /* a2 is now lsb of a4 (odd/even) */
6974
srli a3, a4, 1 /* a3 is half value of mb */
70-
movi a4, 1
75+
movi a4, enable_low_icache
76+
l8ui a4, a4, 0
7177
call0 rom_Cache_Read_Enable
7278
movi a0, cache_return_save /* restore a0 return address */
7379
l32i a0, a0, 0

0 commit comments

Comments
 (0)