2 * armboot - Startup Code for ARM1176 CPU-core
4 * Copyright (c) 2007 Samsung Electronics
7 * Guennadi Liakhovetki, DENX Software Engineering, <lg@denx.de>
9 * SPDX-License-Identifier: GPL-2.0+
11 * 2007-09-21 - Restructured codes by jsgood (jsgood.yang@samsung.com)
12 * 2007-09-21 - Added MoviNAND and OneNAND boot codes by
13 * jsgood (jsgood.yang@samsung.com)
14 * Base codes by scsuh (sc.suh)
17 #include <asm-offsets.h>
19 #include <linux/linkage.h>
21 #ifndef CONFIG_SYS_PHY_UBOOT_BASE
22 #define CONFIG_SYS_PHY_UBOOT_BASE CONFIG_SYS_UBOOT_BASE
26 *************************************************************************
28 * Startup Code (reset vector)
30 * do important init only if we don't start from memory!
31 * setup Memory and board specific bits prior to relocation.
32 * relocate armboot to ram
35 *************************************************************************
41 /* Allow the board to save important registers */
43 .globl save_boot_params_ret
47 * set the cpu to SVC32 mode
55 *************************************************************************
57 * CPU_init_critical registers
59 * setup important registers
62 *************************************************************************
65 * we do sys-critical inits only at reboot,
66 * not when booting from ram!
70 * When booting from NAND - it has definitely been a reset, so, no need
71 * to flush caches and disable the MMU
73 #ifndef CONFIG_SPL_BUILD
78 mcr p15, 0, r0, c7, c7, 0 /* flush v3/v4 cache */
79 mcr p15, 0, r0, c8, c7, 0 /* flush v4 TLB */
82 * disable MMU stuff and caches
84 mrc p15, 0, r0, c1, c0, 0
85 bic r0, r0, #0x00002300 @ clear bits 13, 9:8 (--V- --RS)
86 bic r0, r0, #0x00000087 @ clear bits 7, 2:0 (B--- -CAM)
87 orr r0, r0, #0x00000002 @ set bit 1 (A) Align
88 orr r0, r0, #0x00001000 @ set bit 12 (I) I-Cache
90 /* Prepare to disable the MMU */
91 adr r2, mmu_disable_phys
92 sub r2, r2, #(CONFIG_SYS_PHY_UBOOT_BASE - CONFIG_SYS_TEXT_BASE)
96 /* Run in a single cache-line */
98 mcr p15, 0, r0, c1, c0, 0
107 * Go setup Memory and board specific bits prior to relocation.
109 bl lowlevel_init /* go setup pll,mux,memory */
113 /*------------------------------------------------------------------------------*/
115 .globl c_runtime_cpu_setup
120 WEAK(save_boot_params)
121 b save_boot_params_ret /* back to my caller */
122 ENDPROC(save_boot_params)