Skip to content

Commit

Permalink
Make flush_dcache_range available even with USE_BUILTIN_STARTUP. …
Browse files Browse the repository at this point in the history
…Remove unused variable.
  • Loading branch information
dgarske committed Dec 20, 2024
1 parent 14183c9 commit 0bda487
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 28 deletions.
2 changes: 0 additions & 2 deletions hal/zynq.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,6 @@ static inline int qspi_dmaisr_wait(uint32_t wait_mask, uint32_t wait_val)

static int qspi_gen_fifo_write(uint32_t reg_genfifo)
{
uint32_t reg_cfg;

/* wait until the gen FIFO is not full to write */
if (qspi_isr_wait(GQSPI_IXR_GEN_FIFO_NOT_FULL, 0)) {
return GQSPI_CODE_TIMEOUT;
Expand Down
53 changes: 27 additions & 26 deletions src/boot_aarch64_start.S
Original file line number Diff line number Diff line change
Expand Up @@ -462,32 +462,6 @@ invalidatecaches_end:
ret


/*
* void flush_dcache_range(start, end)
*
* clean & invalidate data cache in the range
*
* x0: start address
* x1: end address
*/
.global flush_dcache_range
flush_dcache_range:
mrs x3, ctr_el0
lsr x3, x3, #16
and x3, x3, #0xf
mov x2, #4
lsl x2, x2, x3 /* cache line size */

/* x2 <- minimal cache line size in cache system */
sub x3, x2, #1
bic x0, x0, x3
1: dc civac, x0 /* clean & invalidate data or unified cache */
add x0, x0, x2
cmp x0, x1
b.lo 1b
dsb sy
ret


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


/*
* void flush_dcache_range(start, end)
*
* clean & invalidate data cache in the range
*
* x0: start address
* x1: end address
*/
.global flush_dcache_range
flush_dcache_range:
mrs x3, ctr_el0
lsr x3, x3, #16
and x3, x3, #0xf
mov x2, #4
lsl x2, x2, x3 /* cache line size */

/* x2 <- minimal cache line size in cache system */
sub x3, x2, #1
bic x0, x0, x3
1: dc civac, x0 /* clean & invalidate data or unified cache */
add x0, x0, x2
cmp x0, x1
b.lo 1b
dsb sy
ret


/* Initialize GIC 400 (GICv2) */
.global gicv2_init_secure
gicv2_init_secure:
Expand Down

0 comments on commit 0bda487

Please sign in to comment.