Re: [U-Boot] [PATCH 2/2 v2] Blackfin: tweak embedded env config option

2009-10-01 Thread Mike Frysinger
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 000..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 += \
+   bf

Re: [U-Boot] [PATCH 2/2 v2] Blackfin: tweak embedded env config option

2009-09-23 Thread Mike Frysinger
On Tuesday 22 September 2009 16:41:45 Wolfgang Denk wrote:
> Mike Frysinger wrote:
> > > ...
> > >
> > > >  $(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.
> >
> > if you're talking about the %.ldr target, then yes, it is only for
> > Blackfin systems.  it isnt the only target-specific top level which is
> > why it's there now, but that doesnt mean it has to stay there (as well as
> > the other cruft). ive already looked at moving this to the Blackfin
> > specific config.mk, but it would require adding dummy "all" targets early
> > on in the top level Makefile and one or two subdir Makefiles.  i didnt
> > feel like dealing with people complaining about this.  although if we
> > created a new lib_$(ARCH)/targets.mk, we could push all arch-specific
> > crap there (like all the boards config targets), and only the top level
> > Makefile would include it.
> 
> I'm not asking for a general Makefile rework. But maybe we can move
> this code to some BF Makefile?

well if i'm going to do it for the Blackfin arch, i might as well generalize 
it and do it the right way the first time ...
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2 v2] Blackfin: tweak embedded env config option

2009-09-22 Thread Wolfgang Denk
Dear Mike Frysinger,

In message <200909151736.52720.vap...@gentoo.org> you wrote:
>
> > ...
> > >  $(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.
>
> if you're talking about the %.ldr target, then yes, it is only for Blackfin 
> systems.  it isnt the only target-specific top level which is why it's there 
> now, but that doesnt mean it has to stay there (as well as the other cruft).  
> ive already looked at moving this to the Blackfin specific config.mk, but it 
> would require adding dummy "all" targets early on in the top level Makefile 
> and one or two subdir Makefiles.  i didnt feel like dealing with people 
> complaining about this.  although if we created a new lib_$(ARCH)/targets.mk, 
> we could push all arch-specific crap there (like all the boards config 
> targets), and only the top level Makefile would include it.

I'm not asking for a general Makefile rework. But maybe we can move
this code to some BF Makefile?

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: w...@denx.de
"A child is a person who can't understand why someone would give away
a perfectly good kitten."   - Doug Larson
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2 v2] Blackfin: tweak embedded env config option

2009-09-15 Thread Mike Frysinger
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.

if you're talking about the %.ldr target, then yes, it is only for Blackfin 
systems.  it isnt the only target-specific top level which is why it's there 
now, but that doesnt mean it has to stay there (as well as the other cruft).  
ive already looked at moving this to the Blackfin specific config.mk, but it 
would require adding dummy "all" targets early on in the top level Makefile 
and one or two subdir Makefiles.  i didnt feel like dealing with people 
complaining about this.  although if we created a new lib_$(ARCH)/targets.mk, 
we could push all arch-specific crap there (like all the boards config 
targets), and only the top level Makefile would include it.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2 v2] Blackfin: tweak embedded env config option

2009-09-15 Thread Wolfgang Denk
Dear Mike Frysinger,

In message <1252661962-16105-1-git-send-email-vap...@gentoo.org> you 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.

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: w...@denx.de
Q:  How do you play religious roulette?
A:  You stand around in a circle  and  blaspheme  and  see  who  gets
struck by lightning first.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/2 v2] Blackfin: tweak embedded env config option

2009-09-11 Thread Mike Frysinger
Use the common config option for extracting the environment for embedding
into LDR files.

Signed-off-by: Mike Frysinger 
---
v2
- do not call envcrc in ldr target if env isnt embedded

 Makefile |2 +-
 include/configs/bf518f-ezbrd.h   |2 +-
 include/configs/bf526-ezbrd.h|2 +-
 include/configs/bf527-ezkit.h|2 +-
 include/configs/bf533-stamp.h|2 +-
 include/configs/bf537-minotaur.h |2 +-
 include/configs/bf537-pnav.h |2 +-
 include/configs/bf537-srv1.h |2 +-
 include/configs/bf537-stamp.h|2 +-
 include/configs/bf538f-ezkit.h   |2 +-
 include/configs/bf548-ezkit.h|4 ++--
 include/configs/bf561-ezkit.h|2 +-
 include/configs/cm-bf527.h   |2 +-
 include/configs/cm-bf537e.h  |2 +-
 include/configs/cm-bf537u.h  |2 +-
 include/configs/cm-bf548.h   |2 +-
 include/configs/ibf-dsp561.h |2 +-
 include/configs/tcm-bf537.h  |2 +-
 lib_blackfin/config.mk   |   10 +++---
 19 files changed, 26 insertions(+), 22 deletions(-)

diff --git a/Makefile b/Makefile
index 0449a5b..046a22f 100644
--- a/Makefile
+++ b/Makefile
@@ -308,7 +308,7 @@ $(obj)u-boot.bin:   $(obj)u-boot
$(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
 
 $(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)
 
 $(obj)u-boot.ldr.hex:  $(obj)u-boot.ldr
diff --git a/include/configs/bf518f-ezbrd.h b/include/configs/bf518f-ezbrd.h
index 3db8171..8c97ee4 100644
--- a/include/configs/bf518f-ezbrd.h
+++ b/include/configs/bf518f-ezbrd.h
@@ -109,7 +109,7 @@
 #define CONFIG_ENV_SIZE0x2000
 #define CONFIG_ENV_SECT_SIZE   0x2000
 #endif
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_CUSTOM
 
 
 /*
diff --git a/include/configs/bf526-ezbrd.h b/include/configs/bf526-ezbrd.h
index 97853af..866e15a 100644
--- a/include/configs/bf526-ezbrd.h
+++ b/include/configs/bf526-ezbrd.h
@@ -126,7 +126,7 @@
 #define CONFIG_ENV_SIZE0x2000
 #define CONFIG_ENV_SECT_SIZE   0x2000
 #endif
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_CUSTOM
 
 
 /*
diff --git a/include/configs/bf527-ezkit.h b/include/configs/bf527-ezkit.h
index 0d02354..fdada41 100644
--- a/include/configs/bf527-ezkit.h
+++ b/include/configs/bf527-ezkit.h
@@ -125,7 +125,7 @@
 #define CONFIG_ENV_SIZE0x2000
 #define CONFIG_ENV_SECT_SIZE   0x2000
 #endif
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_CUSTOM
 
 
 /*
diff --git a/include/configs/bf533-stamp.h b/include/configs/bf533-stamp.h
index 4be2a5c..33f3264 100644
--- a/include/configs/bf533-stamp.h
+++ b/include/configs/bf533-stamp.h
@@ -115,7 +115,7 @@
 #if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_BYPASS)
 #define ENV_IS_EMBEDDED
 #else
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_CUSTOM
 #endif
 #ifdef ENV_IS_EMBEDDED
 /* WARNING - the following is hand-optimized to fit within
diff --git a/include/configs/bf537-minotaur.h b/include/configs/bf537-minotaur.h
index 463b7d0..0beae4b 100644
--- a/include/configs/bf537-minotaur.h
+++ b/include/configs/bf537-minotaur.h
@@ -115,7 +115,7 @@
 #define CONFIG_ENV_OFFSET  0x1
 #define CONFIG_ENV_SIZE0x1
 #define CONFIG_ENV_SECT_SIZE   0x1
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_CUSTOM
 
 
 /*
diff --git a/include/configs/bf537-pnav.h b/include/configs/bf537-pnav.h
index 0f908ef..bdf8b22 100644
--- a/include/configs/bf537-pnav.h
+++ b/include/configs/bf537-pnav.h
@@ -94,7 +94,7 @@
  * Env Storage Settings
  */
 #if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_SPI_MASTER)
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_CUSTOM
 #define CONFIG_ENV_IS_IN_SPI_FLASH
 #define CONFIG_ENV_OFFSET  0x4000
 #else
diff --git a/include/configs/bf537-srv1.h b/include/configs/bf537-srv1.h
index 7368629..f82753a 100644
--- a/include/configs/bf537-srv1.h
+++ b/include/configs/bf537-srv1.h
@@ -115,7 +115,7 @@
 #define CONFIG_ENV_OFFSET  0x1
 #define CONFIG_ENV_SIZE0x1
 #define CONFIG_ENV_SECT_SIZE   0x1
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_CUSTOM
 
 
 /*
diff --git a/include/configs/bf537-stamp.h b/include/configs/bf537-stamp.h
index 74b9ecd..aedd230 100644
--- a/include/configs/bf537-stamp.h
+++ b/include/configs/bf537-stamp.h
@@ -113,7 +113,7 @@
 #if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_BYPASS)
 #define ENV_IS_EMBEDDED
 #else
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_CUSTOM
 #endif
 #ifdef ENV_IS_EMBEDDED
 /* WARNING - the following is hand-optimized to fit within
diff --git a/include/configs/bf538f-ezkit.h b/include/configs/bf538f-ezkit.h
index 535687f..fbda43c 100644
--- a/include/configs/bf538f-ezkit.h
+++ b/include/configs/bf538f-ezkit.h
@@ -109,7 +109,7 @@
 #if (CONFIG_BFIN_