1 /* SPDX-License-Identifier: GPL-2.0+ */
4 #include <linux/linkage.h>
7 * BootROM loads the header part of kwbimage into L2 cache. BIN header usually
8 * contains U-Boot SPL, optionally it can also contain additional arguments.
9 * The number of these arguments is in r0, pointer to the argument array in r1.
10 * BootROM expects executable BIN header code to return to address stored in lr.
11 * Other registers (r2 - r12) must be preserved. We save all registers to the
12 * address of CONFIG_SPL_STACK + 4. BIN header arguments (passed via r0 and r1)
13 * are currently not used by U-Boot SPL binary.
15 ENTRY(save_boot_params)
16 stmfd sp!, {r0 - r12, lr} /* @ save registers on stack */
17 ldr r12, =(CONFIG_SPL_STACK + 4)
19 b save_boot_params_ret
20 ENDPROC(save_boot_params)
22 ENTRY(return_to_bootrom)
23 ldr r12, =(CONFIG_SPL_STACK + 4)
25 ldmfd sp!, {r0 - r12, lr} /* @ restore registers from stack */
26 mov r0, #0x0 /* @ return value: 0x0 NO_ERR */
27 bx lr /* @ return to bootrom */
28 ENDPROC(return_to_bootrom)
31 * cache_inv - invalidate Cache line
35 .type cache_inv, %function
40 mcr p15, 0, r0, c7, c6, 1
47 * flush_l1_v6 - l1 cache clean invalidate
51 .type flush_l1_v6, %function
56 mcr p15, 0, r0, c7, c10, 5 /* @ data memory barrier */
57 mcr p15, 0, r0, c7, c14, 1 /* @ clean & invalidate D line */
58 mcr p15, 0, r0, c7, c10, 4 /* @ data sync barrier */
65 * flush_l1_v7 - l1 cache clean invalidate
69 .type flush_l1_v7, %function
74 dmb /* @data memory barrier */
75 mcr p15, 0, r0, c7, c14, 1 /* @ clean & invalidate D line */
76 dsb /* @data sync barrier */