board_f: Make relocation functions generic
This header file is used by three archs. It could be used by all of them since relocation is a common function. Move it into a generic file. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
		
							parent
							
								
									96d4b75c0d
								
							
						
					
					
						commit
						e47b2d674f
					
				|  | @ -1,16 +0,0 @@ | ||||||
| /*
 |  | ||||||
|  * 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 */ |  | ||||||
|  | @ -1,17 +0,0 @@ | ||||||
| /*
 |  | ||||||
|  * (C) Copyright 2011 |  | ||||||
|  * Graeme Russ, <graeme.russ@gmail.com> |  | ||||||
|  * |  | ||||||
|  * SPDX-License-Identifier:	GPL-2.0+ |  | ||||||
|  */ |  | ||||||
| 
 |  | ||||||
| #ifndef _RELOCATE_H_ |  | ||||||
| #define _RELOCATE_H_ |  | ||||||
| 
 |  | ||||||
| #include <common.h> |  | ||||||
| 
 |  | ||||||
| int copy_uboot_to_ram(void); |  | ||||||
| int clear_bss(void); |  | ||||||
| int do_elf_reloc_fixups(void); |  | ||||||
| 
 |  | ||||||
| #endif	/* !_RELOCATE_H_ */ |  | ||||||
|  | @ -17,8 +17,8 @@ | ||||||
| 
 | 
 | ||||||
| #include <common.h> | #include <common.h> | ||||||
| #include <inttypes.h> | #include <inttypes.h> | ||||||
|  | #include <relocate.h> | ||||||
| #include <asm/u-boot-x86.h> | #include <asm/u-boot-x86.h> | ||||||
| #include <asm/relocate.h> |  | ||||||
| #include <asm/sections.h> | #include <asm/sections.h> | ||||||
| #include <elf.h> | #include <elf.h> | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,14 +0,0 @@ | ||||||
| /*
 |  | ||||||
|  * Copyright (C) 2016 Cadence Design Systems Inc. |  | ||||||
|  * |  | ||||||
|  * SPDX-License-Identifier:	GPL-2.0+ |  | ||||||
|  */ |  | ||||||
| 
 |  | ||||||
| #ifndef _ASM_XTENSA_RELOCATE_H |  | ||||||
| #define _ASM_XTENSA_RELOCATE_H |  | ||||||
| 
 |  | ||||||
| #include <common.h> |  | ||||||
| 
 |  | ||||||
| int clear_bss(void); |  | ||||||
| 
 |  | ||||||
| #endif	/* _ASM_XTENSA_RELOCATE_H */ |  | ||||||
|  | @ -4,7 +4,7 @@ | ||||||
|  * SPDX-License-Identifier:	GPL-2.0+ |  * SPDX-License-Identifier:	GPL-2.0+ | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| #include <asm/relocate.h> | #include <relocate.h> | ||||||
| #include <asm/sections.h> | #include <asm/sections.h> | ||||||
| #include <asm/string.h> | #include <asm/string.h> | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -39,6 +39,7 @@ | ||||||
| 
 | 
 | ||||||
| #include <os.h> | #include <os.h> | ||||||
| #include <post.h> | #include <post.h> | ||||||
|  | #include <relocate.h> | ||||||
| #include <spi.h> | #include <spi.h> | ||||||
| #include <status_led.h> | #include <status_led.h> | ||||||
| #include <timer.h> | #include <timer.h> | ||||||
|  | @ -47,9 +48,6 @@ | ||||||
| #include <watchdog.h> | #include <watchdog.h> | ||||||
| #include <asm/io.h> | #include <asm/io.h> | ||||||
| #include <asm/sections.h> | #include <asm/sections.h> | ||||||
| #if defined(CONFIG_X86) || defined(CONFIG_ARC) || defined(CONFIG_XTENSA) |  | ||||||
| #include <asm/relocate.h> |  | ||||||
| #endif |  | ||||||
| #include <dm/root.h> | #include <dm/root.h> | ||||||
| #include <linux/errno.h> | #include <linux/errno.h> | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -0,0 +1,39 @@ | ||||||
|  | /*
 | ||||||
|  |  * (C) Copyright 2011 | ||||||
|  |  * Graeme Russ, <graeme.russ@gmail.com> | ||||||
|  |  * | ||||||
|  |  * SPDX-License-Identifier:	GPL-2.0+ | ||||||
|  |  */ | ||||||
|  | 
 | ||||||
|  | #ifndef _RELOCATE_H_ | ||||||
|  | #define _RELOCATE_H_ | ||||||
|  | 
 | ||||||
|  | #include <common.h> | ||||||
|  | 
 | ||||||
|  | /**
 | ||||||
|  |  * copy_uboot_to_ram() - Copy U-Boot to its new relocated position | ||||||
|  |  * | ||||||
|  |  * @return 0 if OK, -ve on error | ||||||
|  |  */ | ||||||
|  | int copy_uboot_to_ram(void); | ||||||
|  | 
 | ||||||
|  | /**
 | ||||||
|  |  * clear_bss() - Clear the BSS (Blocked Start by Symbol) segment | ||||||
|  |  * | ||||||
|  |  * This clears the memory used by global variables | ||||||
|  |  * | ||||||
|  |  * @return 0 if OK, -ve on error | ||||||
|  |  */ | ||||||
|  | int clear_bss(void); | ||||||
|  | 
 | ||||||
|  | /**
 | ||||||
|  |  * do_elf_reloc_fixups() - Fix up ELF relocations in the relocated code | ||||||
|  |  * | ||||||
|  |  * This processes the relocation tables to ensure that the code can run in its | ||||||
|  |  * new location. | ||||||
|  |  * | ||||||
|  |  * @return 0 if OK, -ve on error | ||||||
|  |  */ | ||||||
|  | int do_elf_reloc_fixups(void); | ||||||
|  | 
 | ||||||
|  | #endif	/* _RELOCATE_H_ */ | ||||||
		Loading…
	
		Reference in New Issue