From 858290178f222d998b6425d85cf06822467918f3 Mon Sep 17 00:00:00 2001 From: Peter Tyser Date: Mon, 21 Sep 2009 11:20:25 -0500 Subject: ppc: Enable full relocation to RAM The following changes allow U-Boot to fully relocate from flash to RAM: - Remove linker scripts' .fixup sections from the .text section - Add -mrelocatable to PLATFORM_RELFLAGS for all boards - Define CONFIG_RELOC_FIXUP_WORKS for all boards Previously, U-Boot would partially relocate, but statically initialized pointers needed to be manually relocated. Signed-off-by: Peter Tyser --- include/asm-ppc/config.h | 3 +++ include/configs/XPEDITE5170.h | 1 - include/configs/XPEDITE5200.h | 1 - include/configs/XPEDITE5370.h | 1 - 4 files changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/asm-ppc/config.h b/include/asm-ppc/config.h index e35b0b7..eba7901 100644 --- a/include/asm-ppc/config.h +++ b/include/asm-ppc/config.h @@ -47,4 +47,7 @@ #define CONFIG_MAX_CPUS 1 #endif +/* Relocation to SDRAM works on all PPC boards */ +#define CONFIG_RELOC_FIXUP_WORKS + #endif /* _ASM_CONFIG_H_ */ diff --git a/include/configs/XPEDITE5170.h b/include/configs/XPEDITE5170.h index 30642cd..1a810e4 100644 --- a/include/configs/XPEDITE5170.h +++ b/include/configs/XPEDITE5170.h @@ -36,7 +36,6 @@ #define CONFIG_SYS_BOARD_NAME "XPedite5170" #define CONFIG_LINUX_RESET_VEC 0x100 /* Reset vector used by Linux */ #define CONFIG_BOARD_EARLY_INIT_R /* Call board_pre_init */ -#define CONFIG_RELOC_FIXUP_WORKS /* Fully relocate to SDRAM */ #define CONFIG_HIGH_BATS 1 /* High BATs supported and enabled */ #define CONFIG_ALTIVEC 1 diff --git a/include/configs/XPEDITE5200.h b/include/configs/XPEDITE5200.h index d79231b..3f73780 100644 --- a/include/configs/XPEDITE5200.h +++ b/include/configs/XPEDITE5200.h @@ -37,7 +37,6 @@ #define CONFIG_XPEDITE5200 1 #define CONFIG_SYS_BOARD_NAME "XPedite5200" #define CONFIG_BOARD_EARLY_INIT_R /* Call board_pre_init */ -#define CONFIG_RELOC_FIXUP_WORKS /* Fully relocate to SDRAM */ #define CONFIG_PCI 1 /* Enable PCI/PCIE */ #define CONFIG_PCI_PNP 1 /* do pci plug-and-play */ diff --git a/include/configs/XPEDITE5370.h b/include/configs/XPEDITE5370.h index 65e1afd..26b798b 100644 --- a/include/configs/XPEDITE5370.h +++ b/include/configs/XPEDITE5370.h @@ -37,7 +37,6 @@ #define CONFIG_XPEDITE5370 1 #define CONFIG_SYS_BOARD_NAME "XPedite5370" #define CONFIG_BOARD_EARLY_INIT_R /* Call board_pre_init */ -#define CONFIG_RELOC_FIXUP_WORKS /* Fully relocate to SDRAM */ #define CONFIG_PCI 1 /* Enable PCI/PCIE */ #define CONFIG_PCI_PNP 1 /* do pci plug-and-play */ -- cgit v1.1 From b5650c5d8c99100144d8e4e9af910405f857bb7a Mon Sep 17 00:00:00 2001 From: Peter Tyser Date: Mon, 21 Sep 2009 11:20:30 -0500 Subject: ppc: Remove board-specific command table relocation fixups Signed-off-by: Peter Tyser --- include/configs/inka4x0.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/configs/inka4x0.h b/include/configs/inka4x0.h index 46606ca..14f7826 100644 --- a/include/configs/inka4x0.h +++ b/include/configs/inka4x0.h @@ -42,7 +42,6 @@ #define BOOTFLAG_WARM 0x02 /* Software reboot */ #define CONFIG_MISC_INIT_F 1 /* Use misc_init_f() */ -#define CONFIG_MISC_INIT_R 1 /* Use misc_init_r() */ #define CONFIG_HIGH_BATS 1 /* High BATs supported */ -- cgit v1.1 From 6385b28116f775da4771b768ba9bf93c3aaaf26e Mon Sep 17 00:00:00 2001 From: Peter Tyser Date: Mon, 21 Sep 2009 11:20:32 -0500 Subject: fpga: Remove relocation fixups PPC boards are the only users of the current FPGA code which is littered with manual relocation fixups. Now that proper relocation is supported for PPC boards, remove FPGA manual relocation. Signed-off-by: Peter Tyser --- include/ACEX1K.h | 4 ---- include/altera.h | 1 - include/fpga.h | 2 +- include/spartan2.h | 3 --- include/spartan3.h | 3 --- include/stratixII.h | 1 - include/virtex2.h | 3 --- include/xilinx.h | 1 - 8 files changed, 1 insertion(+), 17 deletions(-) (limited to 'include') diff --git a/include/ACEX1K.h b/include/ACEX1K.h index 354e0f0..ae20164 100644 --- a/include/ACEX1K.h +++ b/include/ACEX1K.h @@ -33,12 +33,10 @@ extern int ACEX1K_load( Altera_desc *desc, void *image, size_t size ); extern int ACEX1K_dump( Altera_desc *desc, void *buf, size_t bsize ); extern int ACEX1K_info( Altera_desc *desc ); -extern int ACEX1K_reloc( Altera_desc *desc, ulong reloc_off ); extern int CYC2_load( Altera_desc *desc, void *image, size_t size ); extern int CYC2_dump( Altera_desc *desc, void *buf, size_t bsize ); extern int CYC2_info( Altera_desc *desc ); -extern int CYC2_reloc( Altera_desc *desc, ulong reloc_off ); /* Slave Serial Implementation function table */ typedef struct { @@ -50,7 +48,6 @@ typedef struct { Altera_data_fn data; Altera_abort_fn abort; Altera_post_fn post; - int relocated; } Altera_ACEX1K_Passive_Serial_fns; /* Slave Serial Implementation function table */ @@ -62,7 +59,6 @@ typedef struct { Altera_write_fn write; Altera_abort_fn abort; Altera_post_fn post; - int relocated; } Altera_CYC2_Passive_Serial_fns; /* Device Image Sizes diff --git a/include/altera.h b/include/altera.h index 44a1ee5..bc21ddf 100644 --- a/include/altera.h +++ b/include/altera.h @@ -79,7 +79,6 @@ typedef struct { /* typedef Altera_desc */ extern int altera_load( Altera_desc *desc, void *image, size_t size ); extern int altera_dump( Altera_desc *desc, void *buf, size_t bsize ); extern int altera_info( Altera_desc *desc ); -extern int altera_reloc( Altera_desc *desc, ulong reloc_offset ); /* Board specific implementation specific function types *********************************************************************/ diff --git a/include/fpga.h b/include/fpga.h index a48b89b..84d7b9f 100644 --- a/include/fpga.h +++ b/include/fpga.h @@ -71,7 +71,7 @@ typedef struct { /* typedef fpga_desc */ /* root function definitions */ -extern void fpga_init( ulong reloc_off ); +extern void fpga_init( void ); extern int fpga_add( fpga_type devtype, void *desc ); extern int fpga_count( void ); extern int fpga_load( int devnum, void *buf, size_t bsize ); diff --git a/include/spartan2.h b/include/spartan2.h index 7327857..8959f90 100644 --- a/include/spartan2.h +++ b/include/spartan2.h @@ -30,7 +30,6 @@ extern int Spartan2_load( Xilinx_desc *desc, void *image, size_t size ); extern int Spartan2_dump( Xilinx_desc *desc, void *buf, size_t bsize ); extern int Spartan2_info( Xilinx_desc *desc ); -extern int Spartan2_reloc( Xilinx_desc *desc, ulong reloc_off ); /* Slave Parallel Implementation function table */ typedef struct { @@ -47,7 +46,6 @@ typedef struct { Xilinx_busy_fn busy; Xilinx_abort_fn abort; Xilinx_post_fn post; - int relocated; } Xilinx_Spartan2_Slave_Parallel_fns; /* Slave Serial Implementation function table */ @@ -59,7 +57,6 @@ typedef struct { Xilinx_done_fn done; Xilinx_wr_fn wr; Xilinx_post_fn post; - int relocated; } Xilinx_Spartan2_Slave_Serial_fns; /* Device Image Sizes diff --git a/include/spartan3.h b/include/spartan3.h index b0fa1cd..30b1c2d 100644 --- a/include/spartan3.h +++ b/include/spartan3.h @@ -30,7 +30,6 @@ extern int Spartan3_load( Xilinx_desc *desc, void *image, size_t size ); extern int Spartan3_dump( Xilinx_desc *desc, void *buf, size_t bsize ); extern int Spartan3_info( Xilinx_desc *desc ); -extern int Spartan3_reloc( Xilinx_desc *desc, ulong reloc_off ); /* Slave Parallel Implementation function table */ typedef struct { @@ -47,7 +46,6 @@ typedef struct { Xilinx_busy_fn busy; Xilinx_abort_fn abort; Xilinx_post_fn post; - int relocated; } Xilinx_Spartan3_Slave_Parallel_fns; /* Slave Serial Implementation function table */ @@ -59,7 +57,6 @@ typedef struct { Xilinx_done_fn done; Xilinx_wr_fn wr; Xilinx_post_fn post; - int relocated; } Xilinx_Spartan3_Slave_Serial_fns; /* Device Image Sizes diff --git a/include/stratixII.h b/include/stratixII.h index 37abd9f..b8e8457 100644 --- a/include/stratixII.h +++ b/include/stratixII.h @@ -27,6 +27,5 @@ extern int StratixII_load (Altera_desc * desc, void *image, size_t size); extern int StratixII_dump (Altera_desc * desc, void *buf, size_t bsize); extern int StratixII_info (Altera_desc * desc); -extern int StratixII_reloc (Altera_desc * desc, ulong reloc_off); #endif /* _STRATIXII_H_ */ diff --git a/include/virtex2.h b/include/virtex2.h index d116647..89d7d76 100644 --- a/include/virtex2.h +++ b/include/virtex2.h @@ -31,7 +31,6 @@ extern int Virtex2_load( Xilinx_desc *desc, void *image, size_t size ); extern int Virtex2_dump( Xilinx_desc *desc, void *buf, size_t bsize ); extern int Virtex2_info( Xilinx_desc *desc ); -extern int Virtex2_reloc( Xilinx_desc *desc, ulong reloc_off ); /* * Slave SelectMap Implementation function table. @@ -50,7 +49,6 @@ typedef struct { Xilinx_busy_fn busy; Xilinx_abort_fn abort; Xilinx_post_fn post; - int relocated; } Xilinx_Virtex2_Slave_SelectMap_fns; /* Slave Serial Implementation function table */ @@ -59,7 +57,6 @@ typedef struct { Xilinx_clk_fn clk; Xilinx_rdata_fn rdata; Xilinx_wdata_fn wdata; - int relocated; } Xilinx_Virtex2_Slave_Serial_fns; /* Device Image Sizes (in bytes) diff --git a/include/xilinx.h b/include/xilinx.h index fdc3587..d0799bc 100644 --- a/include/xilinx.h +++ b/include/xilinx.h @@ -84,7 +84,6 @@ typedef struct { /* typedef Xilinx_desc */ extern int xilinx_load( Xilinx_desc *desc, void *image, size_t size ); extern int xilinx_dump( Xilinx_desc *desc, void *buf, size_t bsize ); extern int xilinx_info( Xilinx_desc *desc ); -extern int xilinx_reloc( Xilinx_desc *desc, ulong reloc_offset ); /* Board specific implementation specific function types *********************************************************************/ -- cgit v1.1 From 3cbcfa70b116df1bbdc90ba31c61adcaec058a8a Mon Sep 17 00:00:00 2001 From: Peter Tyser Date: Mon, 21 Sep 2009 11:20:35 -0500 Subject: p3mx: Remove serial relocation fixups Signed-off-by: Peter Tyser --- include/configs/p3mx.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/configs/p3mx.h b/include/configs/p3mx.h index 5e4d30b..0749037 100644 --- a/include/configs/p3mx.h +++ b/include/configs/p3mx.h @@ -59,7 +59,6 @@ /* which initialization functions to call for this board */ #define CONFIG_SYS_BOARD_ASM_INIT 1 #define CONFIG_BOARD_EARLY_INIT_F 1 /* Call board_early_init_f */ -#define CONFIG_BOARD_EARLY_INIT_R 1 /* Call board_early_init_f */ #define CONFIG_MISC_INIT_R 1 /* Call misc_init_r() */ /*----------------------------------------------------------------------- -- cgit v1.1 From 521af04d853361b49344b61892eb0618f9f713c5 Mon Sep 17 00:00:00 2001 From: Peter Tyser Date: Mon, 21 Sep 2009 11:20:36 -0500 Subject: Conditionally perform common relocation fixups Add #ifdefs where necessary to not perform relocation fixups. This allows boards/architectures which support relocation to trim a decent chunk of code. Note that this patch doesn't add #ifdefs to architecture-specific code which does not support relocation. Signed-off-by: Peter Tyser --- include/post.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/post.h b/include/post.h index fe96312..9fcd3ce 100644 --- a/include/post.h +++ b/include/post.h @@ -73,7 +73,9 @@ void post_output_backlog ( void ); int post_run (char *name, int flags); int post_info (char *name); int post_log (char *format, ...); +#ifndef CONFIG_RELOC_FIXUP_WORKS void post_reloc (void); +#endif unsigned long post_time_ms (unsigned long base); extern struct post_test post_list[]; -- cgit v1.1 From 0630535e2d062dd73c1ceca5c6125c86d1127a49 Mon Sep 17 00:00:00 2001 From: Peter Tyser Date: Tue, 22 Sep 2009 09:27:55 -0500 Subject: arm/microblaze/nios/nios2/sh: Remove relocation fixups These architectures don't need relocation fixups, so reduce their codesize a bit by defining CONFIG_RELOC_FIXUP_WORKS. Also remove the reloc_off field from their global data structures as it is no longer needed. Note that the location of the standalone application jump table pointer in the global data structure is affected by this change, breaking execution of standalone applications compiled for previous versions of U-Boot. We will therefore increment XF_VERSION in the next commit, which also touches this area. Signed-off-by: Peter Tyser Signed-off-by: Wolfgang Denk --- include/asm-arm/config.h | 3 +++ include/asm-arm/global_data.h | 1 - include/asm-microblaze/config.h | 3 +++ include/asm-microblaze/global_data.h | 1 - include/asm-nios/config.h | 3 +++ include/asm-nios/global_data.h | 1 - include/asm-nios2/config.h | 3 +++ include/asm-nios2/global_data.h | 1 - include/asm-sh/config.h | 3 +++ include/asm-sh/global_data.h | 1 - 10 files changed, 15 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/asm-arm/config.h b/include/asm-arm/config.h index 049c44e..b76fd8e 100644 --- a/include/asm-arm/config.h +++ b/include/asm-arm/config.h @@ -21,4 +21,7 @@ #ifndef _ASM_CONFIG_H_ #define _ASM_CONFIG_H_ +/* Relocation to SDRAM works on all ARM boards */ +#define CONFIG_RELOC_FIXUP_WORKS + #endif diff --git a/include/asm-arm/global_data.h b/include/asm-arm/global_data.h index 5c56ce3..8115a24 100644 --- a/include/asm-arm/global_data.h +++ b/include/asm-arm/global_data.h @@ -38,7 +38,6 @@ typedef struct global_data { unsigned long flags; unsigned long baudrate; unsigned long have_console; /* serial_init() was called */ - unsigned long reloc_off; /* Relocation Offset */ unsigned long env_addr; /* Address of Environment struct */ unsigned long env_valid; /* Checksum of Environment valid? */ unsigned long fb_base; /* base address of frame buffer */ diff --git a/include/asm-microblaze/config.h b/include/asm-microblaze/config.h index 049c44e..8a9064b 100644 --- a/include/asm-microblaze/config.h +++ b/include/asm-microblaze/config.h @@ -21,4 +21,7 @@ #ifndef _ASM_CONFIG_H_ #define _ASM_CONFIG_H_ +/* Relocation to SDRAM works on all Microblaze boards */ +#define CONFIG_RELOC_FIXUP_WORKS + #endif diff --git a/include/asm-microblaze/global_data.h b/include/asm-microblaze/global_data.h index 3f49c34..ec7837f 100644 --- a/include/asm-microblaze/global_data.h +++ b/include/asm-microblaze/global_data.h @@ -39,7 +39,6 @@ typedef struct global_data { unsigned long flags; unsigned long baudrate; unsigned long have_console; /* serial_init() was called */ - unsigned long reloc_off; /* Relocation Offset */ unsigned long env_addr; /* Address of Environment struct */ unsigned long env_valid; /* Checksum of Environment valid? */ unsigned long fb_base; /* base address of frame buffer */ diff --git a/include/asm-nios/config.h b/include/asm-nios/config.h index 049c44e..2efe898 100644 --- a/include/asm-nios/config.h +++ b/include/asm-nios/config.h @@ -21,4 +21,7 @@ #ifndef _ASM_CONFIG_H_ #define _ASM_CONFIG_H_ +/* Relocation to SDRAM works on all NIOS boards */ +#define CONFIG_RELOC_FIXUP_WORKS + #endif diff --git a/include/asm-nios/global_data.h b/include/asm-nios/global_data.h index 4929a5b..fa54ee4 100644 --- a/include/asm-nios/global_data.h +++ b/include/asm-nios/global_data.h @@ -31,7 +31,6 @@ typedef struct global_data { unsigned long cpu_clk; /* CPU clock in Hz! */ unsigned long have_console; /* serial_init() was called */ phys_size_t ram_size; /* RAM size */ - unsigned long reloc_off; /* Relocation Offset */ unsigned long env_addr; /* Address of Environment struct */ unsigned long env_valid; /* Checksum of Environment valid */ #if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER) diff --git a/include/asm-nios2/config.h b/include/asm-nios2/config.h index 049c44e..011d603 100644 --- a/include/asm-nios2/config.h +++ b/include/asm-nios2/config.h @@ -21,4 +21,7 @@ #ifndef _ASM_CONFIG_H_ #define _ASM_CONFIG_H_ +/* Relocation to SDRAM works on all NIOS2 boards */ +#define CONFIG_RELOC_FIXUP_WORKS + #endif diff --git a/include/asm-nios2/global_data.h b/include/asm-nios2/global_data.h index db71324..34aa962 100644 --- a/include/asm-nios2/global_data.h +++ b/include/asm-nios2/global_data.h @@ -30,7 +30,6 @@ typedef struct global_data { unsigned long cpu_clk; /* CPU clock in Hz! */ unsigned long have_console; /* serial_init() was called */ phys_size_t ram_size; /* RAM size */ - unsigned long reloc_off; /* Relocation Offset */ unsigned long env_addr; /* Address of Environment struct */ unsigned long env_valid; /* Checksum of Environment valid */ #if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER) diff --git a/include/asm-sh/config.h b/include/asm-sh/config.h index 049c44e..978cc92 100644 --- a/include/asm-sh/config.h +++ b/include/asm-sh/config.h @@ -21,4 +21,7 @@ #ifndef _ASM_CONFIG_H_ #define _ASM_CONFIG_H_ +/* Relocation to SDRAM works on all sh boards */ +#define CONFIG_RELOC_FIXUP_WORKS + #endif diff --git a/include/asm-sh/global_data.h b/include/asm-sh/global_data.h index f8ade5c..c12b855 100644 --- a/include/asm-sh/global_data.h +++ b/include/asm-sh/global_data.h @@ -35,7 +35,6 @@ typedef struct global_data unsigned long cpu_clk; /* CPU clock in Hz! */ unsigned long have_console; /* serial_init() was called */ phys_size_t ram_size; /* RAM size */ - unsigned long reloc_off; /* Relocation Offset */ unsigned long env_addr; /* Address of Environment struct */ unsigned long env_valid; /* Checksum of Environment valid */ void **jt; /* Standalone app jump table */ -- cgit v1.1 From 3469424cb6d939c7aedf1e0efdec44a797c0a18c Mon Sep 17 00:00:00 2001 From: Peter Tyser Date: Mon, 21 Sep 2009 11:20:37 -0500 Subject: ppc: Remove reloc_off field from global_data structure Now that proper relocation is supported, the reloc_off field is no longer necessary. Note that the location of the standalone application jump table pointer in the global data structure is affected by this change, breaking execution of standalone applications compiled for previous versions of U-Boot. We therefore increment XF_VERSION to 6 Signed-off-by: Peter Tyser Signed-off-by: Wolfgang Denk --- include/asm-ppc/global_data.h | 2 +- include/exports.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/asm-ppc/global_data.h b/include/asm-ppc/global_data.h index db4b1ea..55e7e20 100644 --- a/include/asm-ppc/global_data.h +++ b/include/asm-ppc/global_data.h @@ -24,6 +24,7 @@ #ifndef __ASM_GBL_DATA_H #define __ASM_GBL_DATA_H +#include "config.h" #include "asm/types.h" /* @@ -124,7 +125,6 @@ typedef struct global_data { unsigned long flb_clk; #endif phys_size_t ram_size; /* RAM size */ - unsigned long reloc_off; /* Relocation Offset */ unsigned long reset_status; /* reset status register at boot */ #if defined(CONFIG_MPC83xx) unsigned long arbiter_event_attributes; diff --git a/include/exports.h b/include/exports.h index 16ea03a..2e8fd8b 100644 --- a/include/exports.h +++ b/include/exports.h @@ -47,7 +47,7 @@ enum { XF_MAX }; -#define XF_VERSION 5 +#define XF_VERSION 6 #if defined(CONFIG_I386) extern gd_t *global_data; -- cgit v1.1