Skip to content

Commit

Permalink
ARM: add relocation support
Browse files Browse the repository at this point in the history
!! This breaks support for all arm boards !!

To compile in old style, you must define
CONFIG_SYS_ARM_WITHOUT_RELOC or you can compile
with "CONFIG_SYS_ARM_WITHOUT_RELOC=1 ./MAKEALL board"

!! This define will be removed soon, so convert your
board to use relocation support

Portions of this work were supported by funding from
the CE Linux Forum.

Signed-off-by: Heiko Schocher <[email protected]>

Fix boot from NAND for non-ARM systems
Signed-off-by: Wolfgang Denk <[email protected]>
  • Loading branch information
hsdenx authored and wdenx committed Sep 19, 2010
1 parent 4fff329 commit f1d2b31
Show file tree
Hide file tree
Showing 13 changed files with 910 additions and 8 deletions.
8 changes: 8 additions & 0 deletions arch/arm/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ STANDALONE_LOAD_ADDR = 0xc100000
endif
endif

ifndef CONFIG_SYS_ARM_WITHOUT_RELOC
# needed for relocation
PLATFORM_RELFLAGS += -fPIC
endif

ifdef CONFIG_SYS_ARM_WITHOUT_RELOC
PLATFORM_CPPFLAGS += -DCONFIG_SYS_ARM_WITHOUT_RELOC
endif
PLATFORM_CPPFLAGS += -DCONFIG_ARM -D__ARM__

# Explicitly specifiy 32-bit ARM ISA since toolchain default can be -mthumb:
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/include/asm/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
#ifndef _ASM_CONFIG_H_
#define _ASM_CONFIG_H_

#if defined(CONFIG_SYS_ARM_WITHOUT_RELOC)
/* Relocation to SDRAM works on all ARM boards */
#define CONFIG_RELOC_FIXUP_WORKS

#endif
#endif
11 changes: 11 additions & 0 deletions arch/arm/include/asm/global_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ typedef struct global_data {
#endif
#ifdef CONFIG_FSL_ESDHC
unsigned long sdhc_clk;
#endif
#if !defined(CONFIG_SYS_ARM_WITHOUT_RELOC)
unsigned long relocaddr; /* Start address of U-Boot in RAM */
phys_size_t ram_size; /* RAM size */
unsigned long mon_len; /* monitor len */
unsigned long irq_sp; /* irq stack pointer */
unsigned long start_addr_sp; /* start_addr_stackpointer */
unsigned long reloc_off;
#if !(defined(CONFIG_SYS_NO_ICACHE) && defined(CONFIG_SYS_NO_DCACHE))
unsigned long tlb_addr;
#endif
#endif
void **jt; /* jump table */
char env_buf[32]; /* buffer for getenv() before reloc. */
Expand Down
14 changes: 13 additions & 1 deletion arch/arm/include/asm/u-boot-arm.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,20 @@
#define _U_BOOT_ARM_H_ 1

/* for the following variables, see start.S */
extern ulong _armboot_start; /* code start */
extern ulong _bss_start; /* code + data end == BSS start */
extern ulong _bss_end; /* BSS end */
extern ulong IRQ_STACK_START; /* top of IRQ stack */
extern ulong FIQ_STACK_START; /* top of FIQ stack */
#if defined(CONFIG_SYS_ARM_WITHOUT_RELOC)
extern ulong _armboot_start; /* code start */
#else
extern ulong _TEXT_BASE; /* code start */
extern ulong _datarel_start;
extern ulong _datarelrolocal_start;
extern ulong _datarellocal_start;
extern ulong _datarelro_start;
extern ulong IRQ_STACK_START_IN; /* 8 bytes in IRQ stack */
#endif

/* cpu/.../cpu.c */
int cpu_init(void);
Expand All @@ -47,6 +56,9 @@ int arch_misc_init(void);
/* board/.../... */
int board_init(void);
int dram_init (void);
#if !defined(CONFIG_SYS_ARM_WITHOUT_RELOC)
void dram_init_banksize (void);
#endif
void setup_serial_tag (struct tag **params);
void setup_revision_tag (struct tag **params);

Expand Down
Loading

0 comments on commit f1d2b31

Please sign in to comment.