Skip to content

Commit 0bda487

Browse files
committed
Make flush_dcache_range available even with USE_BUILTIN_STARTUP. Remove unused variable.
1 parent 14183c9 commit 0bda487

File tree

2 files changed

+27
-28
lines changed

2 files changed

+27
-28
lines changed

hal/zynq.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,6 @@ static inline int qspi_dmaisr_wait(uint32_t wait_mask, uint32_t wait_val)
311311

312312
static int qspi_gen_fifo_write(uint32_t reg_genfifo)
313313
{
314-
uint32_t reg_cfg;
315-
316314
/* wait until the gen FIFO is not full to write */
317315
if (qspi_isr_wait(GQSPI_IXR_GEN_FIFO_NOT_FULL, 0)) {
318316
return GQSPI_CODE_TIMEOUT;

src/boot_aarch64_start.S

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -462,32 +462,6 @@ invalidatecaches_end:
462462
ret
463463

464464

465-
/*
466-
* void flush_dcache_range(start, end)
467-
*
468-
* clean & invalidate data cache in the range
469-
*
470-
* x0: start address
471-
* x1: end address
472-
*/
473-
.global flush_dcache_range
474-
flush_dcache_range:
475-
mrs x3, ctr_el0
476-
lsr x3, x3, #16
477-
and x3, x3, #0xf
478-
mov x2, #4
479-
lsl x2, x2, x3 /* cache line size */
480-
481-
/* x2 <- minimal cache line size in cache system */
482-
sub x3, x2, #1
483-
bic x0, x0, x3
484-
1: dc civac, x0 /* clean & invalidate data or unified cache */
485-
add x0, x0, x2
486-
cmp x0, x1
487-
b.lo 1b
488-
dsb sy
489-
ret
490-
491465

492466
/*
493467
* Below is the static translation page table required by MMU for Cortex-A53.
@@ -1058,6 +1032,33 @@ FPUStatus:
10581032
#endif /* !USE_BUILTIN_STARTUP */
10591033

10601034

1035+
/*
1036+
* void flush_dcache_range(start, end)
1037+
*
1038+
* clean & invalidate data cache in the range
1039+
*
1040+
* x0: start address
1041+
* x1: end address
1042+
*/
1043+
.global flush_dcache_range
1044+
flush_dcache_range:
1045+
mrs x3, ctr_el0
1046+
lsr x3, x3, #16
1047+
and x3, x3, #0xf
1048+
mov x2, #4
1049+
lsl x2, x2, x3 /* cache line size */
1050+
1051+
/* x2 <- minimal cache line size in cache system */
1052+
sub x3, x2, #1
1053+
bic x0, x0, x3
1054+
1: dc civac, x0 /* clean & invalidate data or unified cache */
1055+
add x0, x0, x2
1056+
cmp x0, x1
1057+
b.lo 1b
1058+
dsb sy
1059+
ret
1060+
1061+
10611062
/* Initialize GIC 400 (GICv2) */
10621063
.global gicv2_init_secure
10631064
gicv2_init_secure:

0 commit comments

Comments
 (0)