mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-25 14:10:43 +00:00
83d290c56f
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
56 lines
1.2 KiB
C
56 lines
1.2 KiB
C
// SPDX-License-Identifier: GPL-2.0+
|
|
/*
|
|
* (C) Copyright 2010,2011
|
|
* Vladimir Khusainov, Emcraft Systems, vlad@emcraft.com
|
|
*
|
|
* (C) Copyright 2015
|
|
* Kamil Lulko, <kamil.lulko@gmail.com>
|
|
*/
|
|
|
|
#include <common.h>
|
|
#include <asm/io.h>
|
|
#include <asm/armv7m.h>
|
|
|
|
/*
|
|
* This is called right before passing control to
|
|
* the Linux kernel point.
|
|
*/
|
|
int cleanup_before_linux(void)
|
|
{
|
|
/*
|
|
* this function is called just before we call linux
|
|
* it prepares the processor for linux
|
|
*
|
|
* disable interrupt and turn off caches etc ...
|
|
*/
|
|
disable_interrupts();
|
|
/*
|
|
* turn off D-cache
|
|
* dcache_disable() in turn flushes the d-cache
|
|
* MPU is still enabled & can't be disabled as the u-boot
|
|
* code might be running in sdram which by default is not
|
|
* executable area.
|
|
*/
|
|
dcache_disable();
|
|
/* invalidate to make sure no cache line gets dirty between
|
|
* dcache flushing and disabling dcache */
|
|
invalidate_dcache_all();
|
|
|
|
icache_disable();
|
|
invalidate_icache_all();
|
|
|
|
return 0;
|
|
}
|
|
|
|
/*
|
|
* Perform the low-level reset.
|
|
*/
|
|
void reset_cpu(ulong addr)
|
|
{
|
|
/*
|
|
* Perform reset but keep priority group unchanged.
|
|
*/
|
|
writel((V7M_AIRCR_VECTKEY << V7M_AIRCR_VECTKEY_SHIFT)
|
|
| (V7M_SCB->aircr & V7M_AIRCR_PRIGROUP_MSK)
|
|
| V7M_AIRCR_SYSRESET, &V7M_SCB->aircr);
|
|
}
|