[U-Boot] [PATCH] Handle most LDSCRIPT setting centrally

Wolfgang Denk wd at denx.de
Sat Apr 30 01:00:16 CEST 2011


Dear Scott Wood,

In message <20110406233136.GA13709 at schlenkerla.am.freescale.net> you wrote:
> Currently, some linker scripts are found by common code in config.mk.
> Some are found using CONFIG_SYS_LDSCRIPT, but the code for that is
> sometimes in arch config.mk and sometimes in board config.mk.  Some
> are found using an arch-specific rule for looking in CPUDIR, etc.
> 
> Further, the powerpc config.mk rule relied on CONFIG_NAND_SPL
> when it really wanted CONFIG_NAND_U_BOOT -- which covered up the fact
> that not all NAND_U_BOOT builds actually wanted CPUDIR/u-boot-nand.lds.
> 
> Replace all of this -- except for a handful of boards that are actually
> selecting a linker script in a unique way -- with centralized ldscript
> finding.
> 
> If board code specifies LDSCRIPT, that will be used.
> Otherwise, if CONFIG_SYS_LDSCRIPT is specified, that will be used.
> 
> If neither of these are specified, then the central config.mk will
> check for the existence of the following, in order:
> 
> $(TOPDIR)/board/$(BOARDDIR)/u-boot-nand.lds (only if CONFIG_NAND_U_BOOT)
> $(TOPDIR)/$(CPUDIR)/u-boot-nand.lds (only if CONFIG_NAND_U_BOOT)
> $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds
> $(TOPDIR)/$(CPUDIR)/u-boot.lds
> 
> Some boards (sc3, cm5200, munices) provided their own u-boot.lds that
> were dead code, because they were overridden by a CPUDIR u-boot.lds under
> the old powerpc rules.  These boards' own u-boot.lds have bitrotted and
> no longer work -- these lds files have been removed.
> 
> Signed-off-by: Scott Wood <scottwood at freescale.com>
> ---
> "./MAKEALL ppc" had identical output with and without this patch.
> 
> I tried building some arm boards, but couldn't find any that built for
> me even without this patch.  They didn't appear to fail differently with
> it, though.
> 
>  arch/arm/config.mk                     |    1 -
>  arch/i386/config.mk                    |    1 -
>  arch/nios2/config.mk                   |    2 -
>  arch/powerpc/config.mk                 |   11 ---
>  arch/sh/config.mk                      |    6 --
>  board/actux1/config.mk                 |    2 -
>  board/actux2/config.mk                 |    2 -
>  board/actux3/config.mk                 |    2 -
>  board/altera/nios2-generic/config.mk   |    2 -
>  board/amcc/acadia/config.mk            |    7 --
>  board/amcc/bamboo/config.mk            |    7 --
>  board/amcc/canyonlands/config.mk       |    7 --
>  board/amcc/kilauea/config.mk           |    7 --
>  board/amcc/sequoia/config.mk           |    7 --
>  board/atmel/atstk1000/config.mk        |    1 -
>  board/avnet/fx12mm/config.mk           |   29 ------
>  board/avnet/v5fx30teval/config.mk      |   29 ------
>  board/cm5200/u-boot.lds                |  120 --------------------------
>  board/cogent/config.mk                 |    2 -
>  board/earthlcd/favr-32-ezkit/config.mk |    1 -
>  board/freescale/mx31ads/config.mk      |    2 -
>  board/hymod/config.mk                  |    2 -
>  board/munices/u-boot.lds               |  120 --------------------------
>  board/samsung/smdk6400/config.mk       |    2 -
>  board/sc3/u-boot.lds                   |  147 --------------------------------
>  board/trab/config.mk                   |    2 -
>  board/xilinx/ml507/config.mk           |    4 -
>  board/xilinx/ppc405-generic/config.mk  |    4 -
>  board/xilinx/ppc440-generic/config.mk  |    4 -
>  config.mk                              |   33 ++++++-
>  30 files changed, 28 insertions(+), 538 deletions(-)
>  delete mode 100644 board/avnet/fx12mm/config.mk
>  delete mode 100644 board/avnet/v5fx30teval/config.mk
>  delete mode 100644 board/cm5200/u-boot.lds
>  delete mode 100644 board/munices/u-boot.lds
>  delete mode 100644 board/sc3/u-boot.lds
>  delete mode 100644 board/xilinx/ml507/config.mk
>  delete mode 100644 board/xilinx/ppc405-generic/config.mk
>  delete mode 100644 board/xilinx/ppc440-generic/config.mk

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Imagination is more important than knowledge.      -- Albert Einstein


More information about the U-Boot mailing list