On Tuesday 15 September 2009 16:49:42 Wolfgang Denk wrote:
> Mike Frysinger wrote:
> > Use the common config option for extracting the environment for embedding
> > into LDR files.
> >  $(obj)u-boot.ldr:  $(obj)u-boot
> > -           $(obj)tools/envcrc --binary > $(obj)env-ldr.o
> > +           $(CREATE_LDR_ENV)
> >             $(LDR) -T $(CONFIG_BFIN_CPU) -c $@ $< $(LDR_FLAGS)
> 
> This is all BF specific stuff, right? Maybe we should move this into
> some BF Makefile, then, instead of adding more and more references to
> magic variables that have no meaning anywhere except for BF.

here's what i'm thinking (it wont apply to mainline, so it's just an idea).
from what i can see, there shouldnt be *anything* related to Blackfin left in
the top level files now (except for MAKEALL, but that's another day).
-mike

diff --git a/Makefile b/Makefile
index 40cca2e..61210e8 100644
--- a/Makefile
+++ b/Makefile
@@ -305,16 +305,6 @@ $(obj)u-boot.srec: $(obj)u-boot
 $(obj)u-boot.bin:      $(obj)u-boot
                $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
 
-$(obj)u-boot.ldr:      $(obj)u-boot
-               $(CREATE_LDR_ENV)
-               $(LDR) -T $(CONFIG_BFIN_CPU) -c $@ $< $(LDR_FLAGS)
-
-$(obj)u-boot.ldr.hex:  $(obj)u-boot.ldr
-               $(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@ -I binary
-
-$(obj)u-boot.ldr.srec: $(obj)u-boot.ldr
-               $(OBJCOPY) ${OBJCFLAGS} -O srec $< $@ -I binary
-
 $(obj)u-boot.img:      $(obj)u-boot.bin
                ./tools/mkimage -A $(ARCH) -T firmware -C none \
                -a $(TEXT_BASE) -e 0 \
@@ -482,6 +472,9 @@ dep tags ctags etags cscope $(obj)System.map:
        @ exit 1
 endif  # config.mk
 
+# Pull in architecture-specific top level targets
+sinclude $(TOPDIR)/lib_*/targets.mk
+
 .PHONY : CHANGELOG
 CHANGELOG:
        git log --no-merges U-Boot-1_1_5.. | \
@@ -3487,30 +3480,6 @@ suzaku_config:   unconfig
        @$(MKCONFIG) -a $(@:_config=) microblaze microblaze suzaku AtmarkTechno
 
 #========================================================================
-# Blackfin
-#========================================================================
-
-# Analog Devices boards
-BFIN_BOARDS = bf518f-ezbrd bf526-ezbrd bf527-ezkit bf533-ezkit bf533-stamp \
-       bf537-pnav bf537-stamp bf538f-ezkit bf548-ezkit bf561-ezkit
-
-# Bluetechnix tinyboards
-BFIN_BOARDS += cm-bf527 cm-bf533 cm-bf537e cm-bf537u cm-bf548 cm-bf561 tcm-
bf537
-
-# Misc third party boards
-BFIN_BOARDS += bf537-minotaur bf537-srv1 blackstamp
-
-# I-SYST Micromodule
-BFIN_BOARDS += ibf-dsp561
-
-$(BFIN_BOARDS:%=%_config)      : unconfig
-       @$(MKCONFIG) $(@:_config=) blackfin blackfin $(@:_config=)
-
-$(BFIN_BOARDS):
-       $(MAKE) $...@_config
-       $(MAKE)
-
-#========================================================================
 # AVR32
 #========================================================================
 
@@ -3681,9 +3650,8 @@ clean:
               $(obj)board/netstar/{eeprom,crcek,crcit,*.srec,*.bin}      \
               $(obj)board/trab/trab_fkt   $(obj)board/voiceblue/eeprom   \
               $(obj)board/armltd/{integratorap,integratorcp}/u-boot.lds  \
-              $(obj)lib_blackfin/u-boot.lds                              \
-              $(obj)u-boot.lds                                           \
-              $(obj)cpu/blackfin/bootrom-asm-offsets.[chs]
+              $(obj)u-boot.lds
+       @rm -f $(EXTRA_CLEAN_TARGETS)
        @rm -f $(obj)include/bmp_logo.h
        @rm -f $(obj)nand_spl/{u-boot.lds,u-boot-spl,u-boot-spl.map,System.map}
        @rm -f 
$(obj)onenand_ipl/onenand-{ipl,ipl.bin,ipl-2k.bin,ipl-4k.bin,ipl.map}
diff --git a/lib_blackfin/config.mk b/lib_blackfin/config.mk
index 323d28f..ff6f45b 100644
--- a/lib_blackfin/config.mk
+++ b/lib_blackfin/config.mk
@@ -43,11 +43,6 @@ endif
 ifneq ($(CONFIG_BFIN_BOOT_MODE),BFIN_BOOT_BYPASS)
 ALL += $(obj)u-boot.ldr
 endif
-ifeq ($(CONFIG_ENV_IS_EMBEDDED_IN_LDR),y)
-CREATE_LDR_ENV = $(obj)tools/envcrc --binary > $(obj)env-ldr.o
-else
-CREATE_LDR_ENV =
-endif
 
 SYM_PREFIX = _
 
diff --git a/lib_blackfin/targets.mk b/lib_blackfin/targets.mk
new file mode 100644
index 0000000..629ace3
--- /dev/null
+++ b/lib_blackfin/targets.mk
@@ -0,0 +1,70 @@
+#
+# Blackfin specific top level targets
+#
+# Copyright (c) 2005-2009 Analog Devices Inc.
+#
+# Licensed under the GPL-2 or later.
+#
+
+
+EXTRA_CLEAN_TARGETS += \
+       $(obj)cpu/blackfin/bootrom-asm-offsets.[chs]
+
+
+#
+# Blackfin LDR targets
+#
+
+$(obj)u-boot.ldr:      $(obj)u-boot
+ifeq ($(CONFIG_ENV_IS_EMBEDDED_IN_LDR),y)
+               $(obj)tools/envcrc --binary > $(obj)env-ldr.o
+endif
+               $(LDR) -T $(CONFIG_BFIN_CPU) -c $@ $< $(LDR_FLAGS)
+
+$(obj)u-boot.ldr.hex:  $(obj)u-boot.ldr
+               $(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@ -I binary
+
+$(obj)u-boot.ldr.srec: $(obj)u-boot.ldr
+               $(OBJCOPY) ${OBJCFLAGS} -O srec $< $@ -I binary
+
+
+#
+# Blackfin boards
+#
+
+BFIN_BOARDS =
+
+# Analog Devices boards
+BFIN_BOARDS += \
+       bf518f-ezbrd \
+       bf526-ezbrd \
+       bf527-ezkit \
+       bf533-ezkit \
+       bf533-stamp \
+       bf537-pnav \
+       bf537-stamp \
+       bf538f-ezkit \
+       bf548-ezkit \
+       bf561-ezkit
+
+# Bluetechnix tinyboards
+BFIN_BOARDS += \
+       cm-bf527 \
+       cm-bf533 \
+       cm-bf537e \
+       cm-bf537u \
+       cm-bf548 \
+       cm-bf561 \
+       tcm-bf537
+
+# Misc third party boards
+BFIN_BOARDS += \
+       bf537-minotaur \
+       bf537-srv1 blackstamp
+
+# I-SYST Micromodule
+BFIN_BOARDS += \
+       ibf-dsp561
+
+$(BFIN_BOARDS:%=%_config)      : unconfig
+       @$(MKCONFIG) $(@:_config=) blackfin blackfin $(@:_config=)
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to