1 // SPDX-License-Identifier: GPL-2.0+
3 * (C) Copyright 2010,2011
4 * Vladimir Khusainov, Emcraft Systems, vlad@emcraft.com
7 * Kamil Lulko, <kamil.lulko@gmail.com>
14 #include <asm/armv7m.h>
17 * This is called right before passing control to
18 * the Linux kernel point.
20 int cleanup_before_linux(void)
23 * this function is called just before we call linux
24 * it prepares the processor for linux
26 * disable interrupt and turn off caches etc ...
31 * dcache_disable() in turn flushes the d-cache
32 * MPU is still enabled & can't be disabled as the u-boot
33 * code might be running in sdram which by default is not
37 /* invalidate to make sure no cache line gets dirty between
38 * dcache flushing and disabling dcache */
39 invalidate_dcache_all();
42 invalidate_icache_all();
48 * Perform the low-level reset.
50 void reset_cpu(ulong addr)
53 * Perform reset but keep priority group unchanged.
55 writel((V7M_AIRCR_VECTKEY << V7M_AIRCR_VECTKEY_SHIFT)
56 | (V7M_SCB->aircr & V7M_AIRCR_PRIGROUP_MSK)
57 | V7M_AIRCR_SYSRESET, &V7M_SCB->aircr);