Intention behind this work was elimination of as much assembly-written code as it is possible. In case of ARC we already have relocation fix-up implemented in C so why don't we use C for U-Boot copying, .bss zeroing etc. It turned out x86 uses pretty similar approach so we re-used parts of code in "board_f.c" initially implemented for x86. Now assembly usage during init is limited to stack- and frame-pointer setup before and after relocation. Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> Cc: Simon Glass <sjg@chromium.org>master
parent
8ee28251d9
commit
3fb8016360
@ -0,0 +1,12 @@ |
||||
/*
|
||||
* Copyright (C) 2013-2015 Synopsys, Inc. All rights reserved. |
||||
* |
||||
* SPDX-License-Identifier: GPL-2.0+ |
||||
*/ |
||||
|
||||
#ifndef _ASM_ARC_INIT_HELPERS_H |
||||
#define _ASM_ARC_INIT_HELPERS_H |
||||
|
||||
int init_cache_f_r(void); |
||||
|
||||
#endif /* _ASM_ARC_INIT_HELPERS_H */ |
@ -0,0 +1,16 @@ |
||||
/*
|
||||
* Copyright (C) 2013-2015 Synopsys, Inc. All rights reserved. |
||||
* |
||||
* SPDX-License-Identifier: GPL-2.0+ |
||||
*/ |
||||
|
||||
#ifndef _ASM_ARC_RELOCATE_H |
||||
#define _ASM_ARC_RELOCATE_H |
||||
|
||||
#include <common.h> |
||||
|
||||
int copy_uboot_to_ram(void); |
||||
int clear_bss(void); |
||||
int do_elf_reloc_fixups(void); |
||||
|
||||
#endif /* _ASM_ARC_RELOCATE_H */ |
@ -0,0 +1,25 @@ |
||||
/*
|
||||
* Copyright (C) 2013-2015 Synopsys, Inc. All rights reserved. |
||||
* |
||||
* SPDX-License-Identifier: GPL-2.0+ |
||||
*/ |
||||
|
||||
#include <common.h> |
||||
|
||||
DECLARE_GLOBAL_DATA_PTR; |
||||
|
||||
int init_cache_f_r(void) |
||||
{ |
||||
#ifndef CONFIG_SYS_ICACHE_OFF |
||||
icache_enable(); |
||||
/* Make sure no stale entries persist from before we disabled cache */ |
||||
invalidate_icache_all(); |
||||
#endif |
||||
|
||||
#ifndef CONFIG_SYS_DCACHE_OFF |
||||
dcache_enable(); |
||||
/* Make sure no stale entries persist from before we disabled cache */ |
||||
invalidate_dcache_all(); |
||||
#endif |
||||
return 0; |
||||
} |
Loading…
Reference in new issue