public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [RFC PATCH 0/7] reboard: Introduce generic relocation feature
@ 2011-11-21 23:57 Simon Glass
  2011-11-21 23:57 ` [U-Boot] [RFC PATCH 1/7] reboard: define CONFIG_SYS_LEGACY_BOARD everywhere Simon Glass
                   ` (8 more replies)
  0 siblings, 9 replies; 47+ messages in thread
From: Simon Glass @ 2011-11-21 23:57 UTC (permalink / raw)
  To: u-boot

This is the second patch series aiming to unify the various board.c files
in each architecture into a single one. This series creates a libboard
library and implements relocation in it. It then moves ARM over to use
this framework, as an example.

On ARM the relocation code is duplicated for each CPU yet it
is the same. We can bring this up to the arch level. But since (I believe)
Elf relocation is basically the same process for all archs, there is no
reason not to bring it up to the generic level.

This series establishes a new libboard library in the board/ subdir and
puts some relocation code in it. Each architecture which uses this
framework needs to provide a function called arch_elf_relocate_entry()
which processes a single relocation entry. If there is concern about
calling a function for all 2000-odd relocations then I can change this.

For ARM, a new arch/arm/lib/proc.S file is created, which holds generic
ARM assembler code (things that cannot be written in C and are common
functions used by all ARM CPUs). This helps reduce duplication. Interrupt
handling code and perhaps even some startup code can move there later.

It may be useful for other architectures to have a similar file.

This series moves ARM over to use this framework. Overall this means that
two new files are required 'early' in boot: board/reloc.c and
arch/arm/lib/proc.S.  This is tricky mainly due to SPL. I believe that
we may need to adjust link scripts to put these two files early in the
link scripts also. But I am not sure about this and can't actually find
a problem as yet. I would much prefer to solve this with a new section
name like .text.early if we can.

(I should really cc all arch maintainers but I think in that case I get
an error from the list server. Not sure what the limit is.)

Comments please...


Simon Glass (7):
  reboard: define CONFIG_SYS_LEGACY_BOARD everywhere
  reboard: Add generic link symbols
  reboard: Add generic relocation feature
  reboard: arm: Add relocation function
  reboard: arm: Add processor function library
  reboard: arm: Move over to generic relocation
  reboard: arm: Remove unused code in start.S

 Makefile                                    |    1 +
 README                                      |    5 +
 arch/arm/cpu/arm1136/start.S                |  121 ----------------
 arch/arm/cpu/arm1176/start.S                |  202 ---------------------------
 arch/arm/cpu/arm720t/start.S                |  115 ---------------
 arch/arm/cpu/arm920t/start.S                |  123 ----------------
 arch/arm/cpu/arm925t/start.S                |  123 ----------------
 arch/arm/cpu/arm926ejs/start.S              |  130 -----------------
 arch/arm/cpu/arm946es/start.S               |  118 ----------------
 arch/arm/cpu/arm_intcm/start.S              |  123 ----------------
 arch/arm/cpu/armv7/start.S                  |  126 -----------------
 arch/arm/cpu/ixp/start.S                    |  115 ---------------
 arch/arm/cpu/lh7a40x/start.S                |  112 ---------------
 arch/arm/cpu/pxa/start.S                    |  122 ----------------
 arch/arm/cpu/s3c44b0/start.S                |  115 ---------------
 arch/arm/cpu/sa1100/start.S                 |  112 ---------------
 arch/arm/lib/Makefile                       |    5 +
 arch/arm/lib/arch_reloc.c                   |   47 ++++++
 arch/arm/lib/proc.S                         |   35 +++++
 arch/avr32/config.mk                        |    3 +
 arch/blackfin/config.mk                     |    3 +
 arch/m68k/config.mk                         |    3 +
 arch/microblaze/config.mk                   |    3 +
 arch/mips/config.mk                         |    3 +
 arch/nds32/config.mk                        |    3 +
 arch/nios2/config.mk                        |    3 +
 arch/powerpc/config.mk                      |    3 +
 arch/sandbox/config.mk                      |    3 +
 arch/sh/config.mk                           |    3 +
 arch/sparc/config.mk                        |    3 +
 arch/x86/config.mk                          |    3 +
 board/Makefile                              |   45 ++++++
 board/reloc.c                               |  101 +++++++++++++
 include/asm-generic/link_symbols.h          |   38 +++++
 include/common.h                            |    2 +-
 include/reloc.h                             |   37 +++++
 nand_spl/board/freescale/mx31pdk/Makefile   |    8 +-
 nand_spl/board/freescale/mx31pdk/u-boot.lds |    1 +
 nand_spl/board/karo/tx25/Makefile           |    8 +-
 nand_spl/board/karo/tx25/u-boot.lds         |    1 +
 spl/Makefile                                |    1 +
 41 files changed, 368 insertions(+), 1760 deletions(-)
 create mode 100644 arch/arm/lib/arch_reloc.c
 create mode 100644 arch/arm/lib/proc.S
 create mode 100644 board/Makefile
 create mode 100644 board/reloc.c
 create mode 100644 include/asm-generic/link_symbols.h
 create mode 100644 include/reloc.h

-- 
1.7.3.1

^ permalink raw reply	[flat|nested] 47+ messages in thread

end of thread, other threads:[~2011-12-09  3:42 UTC | newest]

Thread overview: 47+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-21 23:57 [U-Boot] [RFC PATCH 0/7] reboard: Introduce generic relocation feature Simon Glass
2011-11-21 23:57 ` [U-Boot] [RFC PATCH 1/7] reboard: define CONFIG_SYS_LEGACY_BOARD everywhere Simon Glass
2011-11-29  3:11   ` Mike Frysinger
2011-11-29 20:08     ` Simon Glass
2011-11-29 21:40       ` Mike Frysinger
2011-11-29 22:09         ` Simon Glass
2011-11-29 23:19           ` Mike Frysinger
2011-11-29 23:40             ` Simon Glass
2011-12-07  8:15               ` Albert ARIBAUD
2011-12-07 16:28                 ` Simon Glass
2011-12-05  6:42           ` Aneesh V
2011-11-21 23:57 ` [U-Boot] [RFC PATCH 2/7] reboard: Add generic link symbols Simon Glass
2011-11-29  2:59   ` Mike Frysinger
2011-12-07 22:37     ` Simon Glass
2011-11-21 23:57 ` [U-Boot] [RFC PATCH 3/7] reboard: Add generic relocation feature Simon Glass
2011-11-29  3:07   ` Mike Frysinger
2011-11-29 22:15     ` Simon Glass
2011-11-29 23:00       ` Graeme Russ
2011-11-29 23:20       ` Mike Frysinger
2011-11-29 23:41         ` Simon Glass
2011-11-29 23:49           ` Graeme Russ
2011-11-30  2:58             ` Mike Frysinger
2011-12-07  7:38               ` Albert ARIBAUD
2011-12-08  0:35                 ` Mike Frysinger
2011-12-09  3:36                   ` Simon Glass
2011-12-07 22:45     ` Simon Glass
2011-12-07 22:54       ` Graeme Russ
2011-12-07 22:55         ` Simon Glass
2011-11-21 23:57 ` [U-Boot] [RFC PATCH 4/7] reboard: arm: Add relocation function Simon Glass
2011-11-21 23:57 ` [U-Boot] [RFC PATCH 5/7] reboard: arm: Add processor function library Simon Glass
2011-11-29  3:12   ` Mike Frysinger
2011-12-07  7:44   ` Albert ARIBAUD
2011-12-07 16:24     ` Simon Glass
2011-11-21 23:57 ` [U-Boot] [RFC PATCH 6/7] reboard: arm: Move over to generic relocation Simon Glass
2011-11-29  3:14   ` Mike Frysinger
2011-12-09  3:41     ` Simon Glass
2011-11-21 23:58 ` [U-Boot] [RFC PATCH 7/7] reboard: arm: Remove unused code in start.S Simon Glass
2011-11-29  3:15   ` Mike Frysinger
2011-12-09  3:42     ` Simon Glass
2011-11-28 23:45 ` [U-Boot] [RFC PATCH 0/7] reboard: Introduce generic relocation feature Tom Rini
2011-12-07  1:56   ` Simon Glass
2011-12-07  2:56     ` Graeme Russ
2011-12-07  3:25       ` Simon Glass
2011-12-07  3:36         ` Graeme Russ
2011-12-07 23:29   ` Simon Glass
2011-12-07  8:10 ` Albert ARIBAUD
2011-12-09  3:34   ` Simon Glass

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox