* [U-Boot] [PATCH/RFC] env: always build env_embedded and envcrc
@ 2009-07-27 8:31 Mike Frysinger
2009-07-27 20:52 ` Wolfgang Denk
2009-09-09 12:14 ` [U-Boot] [PATCH v2] env: only build env_embedded and envcrc when needed Mike Frysinger
0 siblings, 2 replies; 41+ messages in thread
From: Mike Frysinger @ 2009-07-27 8:31 UTC (permalink / raw)
To: u-boot
The envcrc utility is only called when it is actually needed, so having the
internal code depend on ENV_IS_EMBEDDED isn't necessary. Plus, by always
building it, external utils can manipulate the environment blob without
having to mess around with defines.
Same logic holds for env_embedded. It is already compiled for the majority
of boards into a 0 byte file, so enabling it all the time shouldn't cause
noticable change in overhead. The difference now is that we link it into
U-Boot itself only when CONFIG_ENV_IS_EMBEDDED is defined.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
common/Makefile | 7 ++-----
common/env_embedded.c | 7 -------
tools/Makefile | 10 +---------
tools/envcrc.c | 11 +----------
4 files changed, 4 insertions(+), 31 deletions(-)
diff --git a/common/Makefile b/common/Makefile
index 3781738..2ace329 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -49,12 +49,9 @@ COBJS-y += cmd_nvedit.o
# environment
COBJS-y += env_common.o
+COBJS-$(CONFIG_ENV_IS_EMBEDDED) += env_embedded.o
COBJS-$(CONFIG_ENV_IS_IN_DATAFLASH) += env_dataflash.o
COBJS-$(CONFIG_ENV_IS_IN_EEPROM) += env_eeprom.o
-COBJS-$(CONFIG_ENV_IS_EMBEDDED) += env_embedded.o
-COBJS-$(CONFIG_ENV_IS_IN_EEPROM) += env_embedded.o
-COBJS-$(CONFIG_ENV_IS_IN_FLASH) += env_embedded.o
-COBJS-$(CONFIG_ENV_IS_IN_NVRAM) += env_embedded.o
COBJS-$(CONFIG_ENV_IS_IN_FLASH) += env_flash.o
COBJS-$(CONFIG_ENV_IS_IN_MG_DISK) += env_mgdisk.o
COBJS-$(CONFIG_ENV_IS_IN_NAND) += env_nand.o
@@ -168,7 +165,7 @@ OBJS := $(addprefix $(obj),$(AOBJS) $(COBJS))
CPPFLAGS += -I..
-all: $(LIB) $(AOBJS)
+all: $(LIB) $(AOBJS) $(obj)env_embedded.o
$(LIB): $(obj).depend $(OBJS)
$(AR) $(ARFLAGS) $@ $(OBJS)
diff --git a/common/env_embedded.c b/common/env_embedded.c
index ae6cac4..e27e1cd 100644
--- a/common/env_embedded.c
+++ b/common/env_embedded.c
@@ -41,11 +41,6 @@
#endif
/*
- * Generate embedded environment table
- * inside U-Boot image, if needed.
- */
-#if defined(ENV_IS_EMBEDDED)
-/*
* Only put the environment in it's own section when we are building
* U-Boot proper. The host based program "tools/envcrc" does not need
* a seperate section. Note that ENV_CRC is only defined when building
@@ -210,5 +205,3 @@ unsigned long env_size __PPCTEXT__ = sizeof(env_t);
* Add in absolutes.
*/
GEN_ABS(env_offset, CONFIG_ENV_OFFSET);
-
-#endif /* ENV_IS_EMBEDDED */
diff --git a/tools/Makefile b/tools/Makefile
index b5a1e39..d24f114 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -68,14 +68,7 @@ include $(TOPDIR)/config.mk
# Generated executable files
BIN_FILES-$(CONFIG_CMD_LOADS) += img2srec$(SFX)
BIN_FILES-y += mkimage$(SFX)
-BIN_FILES-$(CONFIG_ENV_IS_EMBEDDED) += envcrc$(SFX)
-BIN_FILES-$(CONFIG_ENV_IS_IN_DATAFLASH) += envcrc$(SFX)
-BIN_FILES-$(CONFIG_ENV_IS_IN_EEPROM) += envcrc$(SFX)
-BIN_FILES-$(CONFIG_ENV_IS_IN_FLASH) += envcrc$(SFX)
-BIN_FILES-$(CONFIG_ENV_IS_IN_ONENAND) += envcrc$(SFX)
-BIN_FILES-$(CONFIG_ENV_IS_IN_NAND) += envcrc$(SFX)
-BIN_FILES-$(CONFIG_ENV_IS_IN_NVRAM) += envcrc$(SFX)
-BIN_FILES-$(CONFIG_ENV_IS_IN_SPI_FLASH) += envcrc$(SFX)
+BIN_FILES-y += envcrc$(SFX)
BIN_FILES-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1$(SFX)
BIN_FILES-$(CONFIG_CMD_NET) += gen_eth_addr$(SFX)
BIN_FILES-$(CONFIG_LCD_LOGO) += bmp_logo$(SFX)
@@ -93,7 +86,6 @@ EXT_OBJ_FILES-y += common/image.o
# Source files located in the tools directory
OBJ_FILES-$(CONFIG_CMD_LOADS) += img2srec.o
OBJ_FILES-y += mkimage.o
-OBJ_FILES-$(CONFIG_ENV_IS_EMBEDDED) += envcrc.o
OBJ_FILES-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1.o
OBJ_FILES-$(CONFIG_CMD_NET) += gen_eth_addr.o
OBJ_FILES-$(CONFIG_LCD_LOGO) += bmp_logo.o
diff --git a/tools/envcrc.c b/tools/envcrc.c
index 5b0f7cd..d02a7db 100644
--- a/tools/envcrc.c
+++ b/tools/envcrc.c
@@ -50,10 +50,6 @@
# if defined(CONFIG_ENV_ADDR_REDUND) && !defined(CONFIG_ENV_SIZE_REDUND)
# define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
# endif
-# if (CONFIG_ENV_ADDR >= CONFIG_SYS_MONITOR_BASE) && \
- ((CONFIG_ENV_ADDR + CONFIG_ENV_SIZE) <= (CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN))
-# define ENV_IS_EMBEDDED 1
-# endif
# if defined(CONFIG_ENV_ADDR_REDUND) || defined(CONFIG_ENV_OFFSET_REDUND)
# define CONFIG_SYS_REDUNDAND_ENVIRONMENT 1
# endif
@@ -70,14 +66,11 @@
extern uint32_t crc32 (uint32_t, const unsigned char *, unsigned int);
-#ifdef ENV_IS_EMBEDDED
extern unsigned int env_size;
extern unsigned char environment;
-#endif /* ENV_IS_EMBEDDED */
int main (int argc, char **argv)
{
-#ifdef ENV_IS_EMBEDDED
unsigned char pad = 0x00;
uint32_t crc;
unsigned char *envptr = &environment,
@@ -131,8 +124,6 @@ int main (int argc, char **argv)
} else {
printf ("0x%08X\n", crc);
}
-#else
- printf ("0\n");
-#endif
+
return EXIT_SUCCESS;
}
--
1.6.3.3
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH/RFC] env: always build env_embedded and envcrc
2009-07-27 8:31 [U-Boot] [PATCH/RFC] env: always build env_embedded and envcrc Mike Frysinger
@ 2009-07-27 20:52 ` Wolfgang Denk
2009-09-09 12:14 ` [U-Boot] [PATCH v2] env: only build env_embedded and envcrc when needed Mike Frysinger
1 sibling, 0 replies; 41+ messages in thread
From: Wolfgang Denk @ 2009-07-27 20:52 UTC (permalink / raw)
To: u-boot
Dear Mike Frysinger,
In message <1248683475-2658-1-git-send-email-vapier@gentoo.org> you wrote:
> The envcrc utility is only called when it is actually needed, so having the
> internal code depend on ENV_IS_EMBEDDED isn't necessary. Plus, by always
> building it, external utils can manipulate the environment blob without
> having to mess around with defines.
But always building some tool that is normally not needed just adds to
the compile time.
> Same logic holds for env_embedded. It is already compiled for the majority
> of boards into a 0 byte file, so enabling it all the time shouldn't cause
> noticable change in overhead. The difference now is that we link it into
> U-Boot itself only when CONFIG_ENV_IS_EMBEDDED is defined.
Again, I see added build time as a con for this patch - but I'm
failing to see any pro?
If you have "external utils" that might need this, please add a
separate Makefile target so you can build this separately, but save
all the rest of us the compile time overhead.
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
grep me no patterns and I'll tell you no lines.
^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH v2] env: only build env_embedded and envcrc when needed
2009-07-27 8:31 [U-Boot] [PATCH/RFC] env: always build env_embedded and envcrc Mike Frysinger
2009-07-27 20:52 ` Wolfgang Denk
@ 2009-09-09 12:14 ` Mike Frysinger
2009-09-09 13:33 ` Wolfgang Denk
` (4 more replies)
1 sibling, 5 replies; 41+ messages in thread
From: Mike Frysinger @ 2009-09-09 12:14 UTC (permalink / raw)
To: u-boot
The env code is protected by the ENV_IS_EMBEDDED define, so attempting to
compile the code when this isn't defined is pointless. Now that the env
headers have unified around CONFIG_ENV_IS_EMBEDDED, convert the build
system to only build the env objects when this is enabled. And now that
the env code is conditionally compiled, we can drop the source code checks.
For people who want to extract the environment manually, add a new option
that only enables the envcrc utility.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
v2
- change logic from "always builds" to "build only when needed"
common/Makefile | 5 +----
common/env_embedded.c | 7 -------
include/common.h | 5 +++++
tools/Makefile | 11 +++--------
tools/envcrc.c | 11 +----------
5 files changed, 10 insertions(+), 29 deletions(-)
diff --git a/common/Makefile b/common/Makefile
index 3781738..e3a1591 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -49,12 +49,9 @@ COBJS-y += cmd_nvedit.o
# environment
COBJS-y += env_common.o
+COBJS-$(CONFIG_ENV_IS_EMBEDDED) += env_embedded.o
COBJS-$(CONFIG_ENV_IS_IN_DATAFLASH) += env_dataflash.o
COBJS-$(CONFIG_ENV_IS_IN_EEPROM) += env_eeprom.o
-COBJS-$(CONFIG_ENV_IS_EMBEDDED) += env_embedded.o
-COBJS-$(CONFIG_ENV_IS_IN_EEPROM) += env_embedded.o
-COBJS-$(CONFIG_ENV_IS_IN_FLASH) += env_embedded.o
-COBJS-$(CONFIG_ENV_IS_IN_NVRAM) += env_embedded.o
COBJS-$(CONFIG_ENV_IS_IN_FLASH) += env_flash.o
COBJS-$(CONFIG_ENV_IS_IN_MG_DISK) += env_mgdisk.o
COBJS-$(CONFIG_ENV_IS_IN_NAND) += env_nand.o
diff --git a/common/env_embedded.c b/common/env_embedded.c
index ae6cac4..e27e1cd 100644
--- a/common/env_embedded.c
+++ b/common/env_embedded.c
@@ -41,11 +41,6 @@
#endif
/*
- * Generate embedded environment table
- * inside U-Boot image, if needed.
- */
-#if defined(ENV_IS_EMBEDDED)
-/*
* Only put the environment in it's own section when we are building
* U-Boot proper. The host based program "tools/envcrc" does not need
* a seperate section. Note that ENV_CRC is only defined when building
@@ -210,5 +205,3 @@ unsigned long env_size __PPCTEXT__ = sizeof(env_t);
* Add in absolutes.
*/
GEN_ABS(env_offset, CONFIG_ENV_OFFSET);
-
-#endif /* ENV_IS_EMBEDDED */
diff --git a/include/common.h b/include/common.h
index 35f12c0..edfc687 100644
--- a/include/common.h
+++ b/include/common.h
@@ -721,4 +721,9 @@ int cpu_release(int nr, int argc, char *argv[]);
#define ALIGN(x,a) __ALIGN_MASK((x),(typeof(x))(a)-1)
#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask))
+/* Pull in stuff for the build system */
+#ifdef DO_DEPS_ONLY
+# include <environment.h>
+#endif
+
#endif /* __COMMON_H_ */
diff --git a/tools/Makefile b/tools/Makefile
index b5a1e39..603a6c1 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -69,13 +69,7 @@ include $(TOPDIR)/config.mk
BIN_FILES-$(CONFIG_CMD_LOADS) += img2srec$(SFX)
BIN_FILES-y += mkimage$(SFX)
BIN_FILES-$(CONFIG_ENV_IS_EMBEDDED) += envcrc$(SFX)
-BIN_FILES-$(CONFIG_ENV_IS_IN_DATAFLASH) += envcrc$(SFX)
-BIN_FILES-$(CONFIG_ENV_IS_IN_EEPROM) += envcrc$(SFX)
-BIN_FILES-$(CONFIG_ENV_IS_IN_FLASH) += envcrc$(SFX)
-BIN_FILES-$(CONFIG_ENV_IS_IN_ONENAND) += envcrc$(SFX)
-BIN_FILES-$(CONFIG_ENV_IS_IN_NAND) += envcrc$(SFX)
-BIN_FILES-$(CONFIG_ENV_IS_IN_NVRAM) += envcrc$(SFX)
-BIN_FILES-$(CONFIG_ENV_IS_IN_SPI_FLASH) += envcrc$(SFX)
+BIN_FILES-$(CONFIG_ENV_IS_EMBEDDED_CUSTOM) += envcrc$(SFX)
BIN_FILES-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1$(SFX)
BIN_FILES-$(CONFIG_CMD_NET) += gen_eth_addr$(SFX)
BIN_FILES-$(CONFIG_LCD_LOGO) += bmp_logo$(SFX)
@@ -93,7 +87,8 @@ EXT_OBJ_FILES-y += common/image.o
# Source files located in the tools directory
OBJ_FILES-$(CONFIG_CMD_LOADS) += img2srec.o
OBJ_FILES-y += mkimage.o
-OBJ_FILES-$(CONFIG_ENV_IS_EMBEDDED) += envcrc.o
+BIN_FILES-$(CONFIG_ENV_IS_EMBEDDED) += envcrc.o
+BIN_FILES-$(CONFIG_ENV_IS_EMBEDDED_CUSTOM) += envcrc.o
OBJ_FILES-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1.o
OBJ_FILES-$(CONFIG_CMD_NET) += gen_eth_addr.o
OBJ_FILES-$(CONFIG_LCD_LOGO) += bmp_logo.o
diff --git a/tools/envcrc.c b/tools/envcrc.c
index 5b0f7cd..d02a7db 100644
--- a/tools/envcrc.c
+++ b/tools/envcrc.c
@@ -50,10 +50,6 @@
# if defined(CONFIG_ENV_ADDR_REDUND) && !defined(CONFIG_ENV_SIZE_REDUND)
# define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
# endif
-# if (CONFIG_ENV_ADDR >= CONFIG_SYS_MONITOR_BASE) && \
- ((CONFIG_ENV_ADDR + CONFIG_ENV_SIZE) <= (CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN))
-# define ENV_IS_EMBEDDED 1
-# endif
# if defined(CONFIG_ENV_ADDR_REDUND) || defined(CONFIG_ENV_OFFSET_REDUND)
# define CONFIG_SYS_REDUNDAND_ENVIRONMENT 1
# endif
@@ -70,14 +66,11 @@
extern uint32_t crc32 (uint32_t, const unsigned char *, unsigned int);
-#ifdef ENV_IS_EMBEDDED
extern unsigned int env_size;
extern unsigned char environment;
-#endif /* ENV_IS_EMBEDDED */
int main (int argc, char **argv)
{
-#ifdef ENV_IS_EMBEDDED
unsigned char pad = 0x00;
uint32_t crc;
unsigned char *envptr = &environment,
@@ -131,8 +124,6 @@ int main (int argc, char **argv)
} else {
printf ("0x%08X\n", crc);
}
-#else
- printf ("0\n");
-#endif
+
return EXIT_SUCCESS;
}
--
1.6.4.2
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH v2] env: only build env_embedded and envcrc when needed
2009-09-09 12:14 ` [U-Boot] [PATCH v2] env: only build env_embedded and envcrc when needed Mike Frysinger
@ 2009-09-09 13:33 ` Wolfgang Denk
2009-09-09 14:02 ` Mike Frysinger
2009-09-09 15:50 ` [U-Boot] [PATCH 1/2 v3] " Mike Frysinger
` (3 subsequent siblings)
4 siblings, 1 reply; 41+ messages in thread
From: Wolfgang Denk @ 2009-09-09 13:33 UTC (permalink / raw)
To: u-boot
Dear Mike Frysinger,
In message <1252498455-28276-1-git-send-email-vapier@gentoo.org> you wrote:
> The env code is protected by the ENV_IS_EMBEDDED define, so attempting to
> compile the code when this isn't defined is pointless. Now that the env
> headers have unified around CONFIG_ENV_IS_EMBEDDED, convert the build
> system to only build the env objects when this is enabled. And now that
> the env code is conditionally compiled, we can drop the source code checks.
>
> For people who want to extract the environment manually, add a new option
> that only enables the envcrc utility.
Add a new option...?
I guess this is CONFIG_ENV_IS_EMBEDDED_CUSTOM then?
Hm... but I see no users of this variable, nobody is setting it?
Also, I see no documentation for it?
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
Of course there's no reason for it, it's just our policy.
^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH v2] env: only build env_embedded and envcrc when needed
2009-09-09 13:33 ` Wolfgang Denk
@ 2009-09-09 14:02 ` Mike Frysinger
2009-09-09 14:26 ` Wolfgang Denk
0 siblings, 1 reply; 41+ messages in thread
From: Mike Frysinger @ 2009-09-09 14:02 UTC (permalink / raw)
To: u-boot
On Wednesday 09 September 2009 09:33:20 Wolfgang Denk wrote:
> Mike Frysinger wrote:
> > The env code is protected by the ENV_IS_EMBEDDED define, so attempting to
> > compile the code when this isn't defined is pointless. Now that the env
> > headers have unified around CONFIG_ENV_IS_EMBEDDED, convert the build
> > system to only build the env objects when this is enabled. And now that
> > the env code is conditionally compiled, we can drop the source code
> > checks.
> >
> > For people who want to extract the environment manually, add a new option
> > that only enables the envcrc utility.
>
> Add a new option...?
>
> I guess this is CONFIG_ENV_IS_EMBEDDED_CUSTOM then?
>
> Hm... but I see no users of this variable, nobody is setting it?
Blackfin has been using ENV_IS_EMBEDDED_CUSTOM. i have a patch to update it
to CONFIG_xxx, but was waiting for this to be accepted first.
> Also, I see no documentation for it?
guessing you want it added to the top level README ?
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090909/4617c0f5/attachment.pgp
^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH v2] env: only build env_embedded and envcrc when needed
2009-09-09 14:02 ` Mike Frysinger
@ 2009-09-09 14:26 ` Wolfgang Denk
2009-09-09 14:32 ` Mike Frysinger
0 siblings, 1 reply; 41+ messages in thread
From: Wolfgang Denk @ 2009-09-09 14:26 UTC (permalink / raw)
To: u-boot
Dear Mike Frysinger,
In message <200909091002.40958.vapier@gentoo.org> you wrote:
>
> > I guess this is CONFIG_ENV_IS_EMBEDDED_CUSTOM then?
> >
> > Hm... but I see no users of this variable, nobody is setting it?
>
> Blackfin has been using ENV_IS_EMBEDDED_CUSTOM. i have a patch to update it
> to CONFIG_xxx, but was waiting for this to be accepted first.
Hm.. normally we don't add code without users...
> > Also, I see no documentation for it?
>
> guessing you want it added to the top level README ?
Indeed. What's the name supposed to mean? "The envrionment is
embedded custom" sounds strange to me.
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
One essential to success is that you desire be an all-obsessing one,
your thoughts and aims be co-ordinated, and your energy be concentra-
ted and applied without letup.
^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH v2] env: only build env_embedded and envcrc when needed
2009-09-09 14:26 ` Wolfgang Denk
@ 2009-09-09 14:32 ` Mike Frysinger
2009-09-15 20:44 ` Wolfgang Denk
0 siblings, 1 reply; 41+ messages in thread
From: Mike Frysinger @ 2009-09-09 14:32 UTC (permalink / raw)
To: u-boot
On Wednesday 09 September 2009 10:26:20 Wolfgang Denk wrote:
> Mike Frysinger wrote:
> > > I guess this is CONFIG_ENV_IS_EMBEDDED_CUSTOM then?
> > >
> > > Hm... but I see no users of this variable, nobody is setting it?
> >
> > Blackfin has been using ENV_IS_EMBEDDED_CUSTOM. i have a patch to update
> > it to CONFIG_xxx, but was waiting for this to be accepted first.
>
> Hm.. normally we don't add code without users...
it's already in use, i just need to basically run sed to change it from
current name to the new one.
> > > Also, I see no documentation for it?
> >
> > guessing you want it added to the top level README ?
>
> Indeed. What's the name supposed to mean? "The envrionment is
> embedded custom" sounds strange to me.
i saw it as "custom embedding of the environment". the only thing it does is
enable the envcrc binary. i thought of using "CONFIG_ENVCRC", but it seemed a
little too short.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090909/edddbeda/attachment.pgp
^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 1/2 v3] env: only build env_embedded and envcrc when needed
2009-09-09 12:14 ` [U-Boot] [PATCH v2] env: only build env_embedded and envcrc when needed Mike Frysinger
2009-09-09 13:33 ` Wolfgang Denk
@ 2009-09-09 15:50 ` Mike Frysinger
2009-09-15 20:45 ` Wolfgang Denk
2009-09-09 15:50 ` [U-Boot] [PATCH 2/2] Blackfin: tweak embedded env config option Mike Frysinger
` (2 subsequent siblings)
4 siblings, 1 reply; 41+ messages in thread
From: Mike Frysinger @ 2009-09-09 15:50 UTC (permalink / raw)
To: u-boot
The env code is protected by the ENV_IS_EMBEDDED define, so attempting to
compile the code when this isn't defined is pointless. Now that the env
headers have unified around CONFIG_ENV_IS_EMBEDDED, convert the build
system to only build the env objects when this is enabled. And now that
the env code is conditionally compiled, we can drop the source code checks.
For people who want to extract the environment manually, add a new option
that only enables the envcrc utility (CONFIG_ENV_IS_EMBEDDED_CUSTOM).
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
v3
- add some documentation
README | 5 +++++
common/Makefile | 5 +----
common/env_embedded.c | 7 -------
include/common.h | 5 +++++
tools/Makefile | 11 +++--------
tools/envcrc.c | 11 +----------
6 files changed, 15 insertions(+), 29 deletions(-)
diff --git a/README b/README
index ff4ed8b..05cf6b0 100644
--- a/README
+++ b/README
@@ -2473,6 +2473,11 @@ to save the current settings.
environment. If redundant environment is used, it will be copied to
CONFIG_NAND_ENV_DST + CONFIG_ENV_SIZE.
+- CONFIG_ENV_IS_EMBEDDED_CUSTOM
+
+ Builds up envcrc with the target environment so that external utils
+ may easily extract it and embed it in final U-Boot images.
+
- CONFIG_SYS_SPI_INIT_OFFSET
Defines offset to the initial SPI buffer area in DPRAM. The
diff --git a/common/Makefile b/common/Makefile
index 3781738..e3a1591 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -49,12 +49,9 @@ COBJS-y += cmd_nvedit.o
# environment
COBJS-y += env_common.o
+COBJS-$(CONFIG_ENV_IS_EMBEDDED) += env_embedded.o
COBJS-$(CONFIG_ENV_IS_IN_DATAFLASH) += env_dataflash.o
COBJS-$(CONFIG_ENV_IS_IN_EEPROM) += env_eeprom.o
-COBJS-$(CONFIG_ENV_IS_EMBEDDED) += env_embedded.o
-COBJS-$(CONFIG_ENV_IS_IN_EEPROM) += env_embedded.o
-COBJS-$(CONFIG_ENV_IS_IN_FLASH) += env_embedded.o
-COBJS-$(CONFIG_ENV_IS_IN_NVRAM) += env_embedded.o
COBJS-$(CONFIG_ENV_IS_IN_FLASH) += env_flash.o
COBJS-$(CONFIG_ENV_IS_IN_MG_DISK) += env_mgdisk.o
COBJS-$(CONFIG_ENV_IS_IN_NAND) += env_nand.o
diff --git a/common/env_embedded.c b/common/env_embedded.c
index ae6cac4..e27e1cd 100644
--- a/common/env_embedded.c
+++ b/common/env_embedded.c
@@ -41,11 +41,6 @@
#endif
/*
- * Generate embedded environment table
- * inside U-Boot image, if needed.
- */
-#if defined(ENV_IS_EMBEDDED)
-/*
* Only put the environment in it's own section when we are building
* U-Boot proper. The host based program "tools/envcrc" does not need
* a seperate section. Note that ENV_CRC is only defined when building
@@ -210,5 +205,3 @@ unsigned long env_size __PPCTEXT__ = sizeof(env_t);
* Add in absolutes.
*/
GEN_ABS(env_offset, CONFIG_ENV_OFFSET);
-
-#endif /* ENV_IS_EMBEDDED */
diff --git a/include/common.h b/include/common.h
index 35f12c0..edfc687 100644
--- a/include/common.h
+++ b/include/common.h
@@ -721,4 +721,9 @@ int cpu_release(int nr, int argc, char *argv[]);
#define ALIGN(x,a) __ALIGN_MASK((x),(typeof(x))(a)-1)
#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask))
+/* Pull in stuff for the build system */
+#ifdef DO_DEPS_ONLY
+# include <environment.h>
+#endif
+
#endif /* __COMMON_H_ */
diff --git a/tools/Makefile b/tools/Makefile
index b5a1e39..603a6c1 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -69,13 +69,7 @@ include $(TOPDIR)/config.mk
BIN_FILES-$(CONFIG_CMD_LOADS) += img2srec$(SFX)
BIN_FILES-y += mkimage$(SFX)
BIN_FILES-$(CONFIG_ENV_IS_EMBEDDED) += envcrc$(SFX)
-BIN_FILES-$(CONFIG_ENV_IS_IN_DATAFLASH) += envcrc$(SFX)
-BIN_FILES-$(CONFIG_ENV_IS_IN_EEPROM) += envcrc$(SFX)
-BIN_FILES-$(CONFIG_ENV_IS_IN_FLASH) += envcrc$(SFX)
-BIN_FILES-$(CONFIG_ENV_IS_IN_ONENAND) += envcrc$(SFX)
-BIN_FILES-$(CONFIG_ENV_IS_IN_NAND) += envcrc$(SFX)
-BIN_FILES-$(CONFIG_ENV_IS_IN_NVRAM) += envcrc$(SFX)
-BIN_FILES-$(CONFIG_ENV_IS_IN_SPI_FLASH) += envcrc$(SFX)
+BIN_FILES-$(CONFIG_ENV_IS_EMBEDDED_CUSTOM) += envcrc$(SFX)
BIN_FILES-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1$(SFX)
BIN_FILES-$(CONFIG_CMD_NET) += gen_eth_addr$(SFX)
BIN_FILES-$(CONFIG_LCD_LOGO) += bmp_logo$(SFX)
@@ -93,7 +87,8 @@ EXT_OBJ_FILES-y += common/image.o
# Source files located in the tools directory
OBJ_FILES-$(CONFIG_CMD_LOADS) += img2srec.o
OBJ_FILES-y += mkimage.o
-OBJ_FILES-$(CONFIG_ENV_IS_EMBEDDED) += envcrc.o
+BIN_FILES-$(CONFIG_ENV_IS_EMBEDDED) += envcrc.o
+BIN_FILES-$(CONFIG_ENV_IS_EMBEDDED_CUSTOM) += envcrc.o
OBJ_FILES-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1.o
OBJ_FILES-$(CONFIG_CMD_NET) += gen_eth_addr.o
OBJ_FILES-$(CONFIG_LCD_LOGO) += bmp_logo.o
diff --git a/tools/envcrc.c b/tools/envcrc.c
index 5b0f7cd..d02a7db 100644
--- a/tools/envcrc.c
+++ b/tools/envcrc.c
@@ -50,10 +50,6 @@
# if defined(CONFIG_ENV_ADDR_REDUND) && !defined(CONFIG_ENV_SIZE_REDUND)
# define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
# endif
-# if (CONFIG_ENV_ADDR >= CONFIG_SYS_MONITOR_BASE) && \
- ((CONFIG_ENV_ADDR + CONFIG_ENV_SIZE) <= (CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN))
-# define ENV_IS_EMBEDDED 1
-# endif
# if defined(CONFIG_ENV_ADDR_REDUND) || defined(CONFIG_ENV_OFFSET_REDUND)
# define CONFIG_SYS_REDUNDAND_ENVIRONMENT 1
# endif
@@ -70,14 +66,11 @@
extern uint32_t crc32 (uint32_t, const unsigned char *, unsigned int);
-#ifdef ENV_IS_EMBEDDED
extern unsigned int env_size;
extern unsigned char environment;
-#endif /* ENV_IS_EMBEDDED */
int main (int argc, char **argv)
{
-#ifdef ENV_IS_EMBEDDED
unsigned char pad = 0x00;
uint32_t crc;
unsigned char *envptr = &environment,
@@ -131,8 +124,6 @@ int main (int argc, char **argv)
} else {
printf ("0x%08X\n", crc);
}
-#else
- printf ("0\n");
-#endif
+
return EXIT_SUCCESS;
}
--
1.6.4.2
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 2/2] Blackfin: tweak embedded env config option
2009-09-09 12:14 ` [U-Boot] [PATCH v2] env: only build env_embedded and envcrc when needed Mike Frysinger
2009-09-09 13:33 ` Wolfgang Denk
2009-09-09 15:50 ` [U-Boot] [PATCH 1/2 v3] " Mike Frysinger
@ 2009-09-09 15:50 ` Mike Frysinger
2009-09-11 9:39 ` [U-Boot] [PATCH 2/2 v2] " Mike Frysinger
2009-09-30 19:29 ` [U-Boot] [PATCH 1/2 v4] env: only build env_embedded and envcrc when needed Mike Frysinger
2009-09-30 19:29 ` [U-Boot] [PATCH 2/2 v3] Blackfin: tweak embedded LDR env config option Mike Frysinger
4 siblings, 1 reply; 41+ messages in thread
From: Mike Frysinger @ 2009-09-09 15:50 UTC (permalink / raw)
To: u-boot
Use the common config option for extracting the environment for embedding
into LDR files.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
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 | 5 ++---
18 files changed, 20 insertions(+), 21 deletions(-)
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_SIZE 0x2000
#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_SIZE 0x2000
#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_SIZE 0x2000
#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 0x10000
#define CONFIG_ENV_SIZE 0x10000
#define CONFIG_ENV_SECT_SIZE 0x10000
-#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 0x10000
#define CONFIG_ENV_SIZE 0x10000
#define CONFIG_ENV_SECT_SIZE 0x10000
-#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_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/bf548-ezkit.h b/include/configs/bf548-ezkit.h
index 5b9de16..16d7af2 100644
--- a/include/configs/bf548-ezkit.h
+++ b/include/configs/bf548-ezkit.h
@@ -107,7 +107,7 @@
#define CONFIG_ENV_OFFSET 0x10000
#define CONFIG_ENV_SIZE 0x2000
#define CONFIG_ENV_SECT_SIZE 0x10000
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_CUSTOM
#elif (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_NAND)
#define CONFIG_ENV_IS_IN_NAND
#define CONFIG_ENV_OFFSET 0x40000
@@ -118,7 +118,7 @@
#define CONFIG_ENV_OFFSET 0x2000
#define CONFIG_ENV_SIZE 0x2000
#define CONFIG_ENV_SECT_SIZE (128 * 1024)
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_CUSTOM
#endif
diff --git a/include/configs/bf561-ezkit.h b/include/configs/bf561-ezkit.h
index 4779a97..fe27a54 100644
--- a/include/configs/bf561-ezkit.h
+++ b/include/configs/bf561-ezkit.h
@@ -86,7 +86,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/cm-bf527.h b/include/configs/cm-bf527.h
index 1592719..c60e876 100644
--- a/include/configs/cm-bf527.h
+++ b/include/configs/cm-bf527.h
@@ -106,7 +106,7 @@
#define CONFIG_ENV_OFFSET 0x8000
#define CONFIG_ENV_SIZE 0x8000
#define CONFIG_ENV_SECT_SIZE 0x20000
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_CUSTOM
/*
diff --git a/include/configs/cm-bf537e.h b/include/configs/cm-bf537e.h
index 34d4299..62db60e 100644
--- a/include/configs/cm-bf537e.h
+++ b/include/configs/cm-bf537e.h
@@ -92,7 +92,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/cm-bf537u.h b/include/configs/cm-bf537u.h
index d1870a8..590511b 100644
--- a/include/configs/cm-bf537u.h
+++ b/include/configs/cm-bf537u.h
@@ -96,7 +96,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/cm-bf548.h b/include/configs/cm-bf548.h
index b5cfc21..b1a0cd8 100644
--- a/include/configs/cm-bf548.h
+++ b/include/configs/cm-bf548.h
@@ -96,7 +96,7 @@
#define CONFIG_ENV_ADDR 0x20008000
#define CONFIG_ENV_OFFSET 0x8000
#define CONFIG_ENV_SIZE 0x8000
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_CUSTOM
/*
diff --git a/include/configs/ibf-dsp561.h b/include/configs/ibf-dsp561.h
index 066859f..05cdbc2 100644
--- a/include/configs/ibf-dsp561.h
+++ b/include/configs/ibf-dsp561.h
@@ -75,7 +75,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/tcm-bf537.h b/include/configs/tcm-bf537.h
index 9794e1b..8e97db0 100644
--- a/include/configs/tcm-bf537.h
+++ b/include/configs/tcm-bf537.h
@@ -93,7 +93,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/lib_blackfin/config.mk b/lib_blackfin/config.mk
index ce2fe67..3f560c9 100644
--- a/lib_blackfin/config.mk
+++ b/lib_blackfin/config.mk
@@ -53,9 +53,8 @@ LDR_FLAGS += --bmode $(subst BFIN_BOOT_,,$(CONFIG_BFIN_BOOT_MODE))
LDR_FLAGS += --use-vmas
LDR_FLAGS += --initcode $(obj)cpu/$(CPU)/initcode.o
ifneq ($(CONFIG_BFIN_BOOT_MODE),BFIN_BOOT_UART)
-ifneq ($(ENV_IS_EMBEDDED_CUSTOM),ENV_IS_EMBEDDED_CUSTOM)
-LDR_FLAGS += --punchit $$(($(CONFIG_ENV_OFFSET))):$$(($(CONFIG_ENV_SIZE))):$(obj)env-ldr.o
-endif
+LDR_FLAGS-$(CONFIG_ENV_IS_EMBEDDED_CUSTOM) += \
+ --punchit $$(($(CONFIG_ENV_OFFSET))):$$(($(CONFIG_ENV_SIZE))):$(obj)env-ldr.o
endif
ifneq (,$(findstring s,$(MAKEFLAGS)))
LDR_FLAGS += --quiet
--
1.6.4.2
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 2/2 v2] Blackfin: tweak embedded env config option
2009-09-09 15:50 ` [U-Boot] [PATCH 2/2] Blackfin: tweak embedded env config option Mike Frysinger
@ 2009-09-11 9:39 ` Mike Frysinger
2009-09-15 20:49 ` Wolfgang Denk
0 siblings, 1 reply; 41+ messages in thread
From: Mike Frysinger @ 2009-09-11 9:39 UTC (permalink / raw)
To: u-boot
Use the common config option for extracting the environment for embedding
into LDR files.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
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_SIZE 0x2000
#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_SIZE 0x2000
#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_SIZE 0x2000
#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 0x10000
#define CONFIG_ENV_SIZE 0x10000
#define CONFIG_ENV_SECT_SIZE 0x10000
-#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 0x10000
#define CONFIG_ENV_SIZE 0x10000
#define CONFIG_ENV_SECT_SIZE 0x10000
-#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_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/bf548-ezkit.h b/include/configs/bf548-ezkit.h
index 5b9de16..16d7af2 100644
--- a/include/configs/bf548-ezkit.h
+++ b/include/configs/bf548-ezkit.h
@@ -107,7 +107,7 @@
#define CONFIG_ENV_OFFSET 0x10000
#define CONFIG_ENV_SIZE 0x2000
#define CONFIG_ENV_SECT_SIZE 0x10000
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_CUSTOM
#elif (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_NAND)
#define CONFIG_ENV_IS_IN_NAND
#define CONFIG_ENV_OFFSET 0x40000
@@ -118,7 +118,7 @@
#define CONFIG_ENV_OFFSET 0x2000
#define CONFIG_ENV_SIZE 0x2000
#define CONFIG_ENV_SECT_SIZE (128 * 1024)
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_CUSTOM
#endif
diff --git a/include/configs/bf561-ezkit.h b/include/configs/bf561-ezkit.h
index 4779a97..fe27a54 100644
--- a/include/configs/bf561-ezkit.h
+++ b/include/configs/bf561-ezkit.h
@@ -86,7 +86,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/cm-bf527.h b/include/configs/cm-bf527.h
index 1592719..c60e876 100644
--- a/include/configs/cm-bf527.h
+++ b/include/configs/cm-bf527.h
@@ -106,7 +106,7 @@
#define CONFIG_ENV_OFFSET 0x8000
#define CONFIG_ENV_SIZE 0x8000
#define CONFIG_ENV_SECT_SIZE 0x20000
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_CUSTOM
/*
diff --git a/include/configs/cm-bf537e.h b/include/configs/cm-bf537e.h
index 34d4299..62db60e 100644
--- a/include/configs/cm-bf537e.h
+++ b/include/configs/cm-bf537e.h
@@ -92,7 +92,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/cm-bf537u.h b/include/configs/cm-bf537u.h
index d1870a8..590511b 100644
--- a/include/configs/cm-bf537u.h
+++ b/include/configs/cm-bf537u.h
@@ -96,7 +96,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/cm-bf548.h b/include/configs/cm-bf548.h
index b5cfc21..b1a0cd8 100644
--- a/include/configs/cm-bf548.h
+++ b/include/configs/cm-bf548.h
@@ -96,7 +96,7 @@
#define CONFIG_ENV_ADDR 0x20008000
#define CONFIG_ENV_OFFSET 0x8000
#define CONFIG_ENV_SIZE 0x8000
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_CUSTOM
/*
diff --git a/include/configs/ibf-dsp561.h b/include/configs/ibf-dsp561.h
index 066859f..05cdbc2 100644
--- a/include/configs/ibf-dsp561.h
+++ b/include/configs/ibf-dsp561.h
@@ -75,7 +75,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/tcm-bf537.h b/include/configs/tcm-bf537.h
index 9794e1b..8e97db0 100644
--- a/include/configs/tcm-bf537.h
+++ b/include/configs/tcm-bf537.h
@@ -93,7 +93,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/lib_blackfin/config.mk b/lib_blackfin/config.mk
index ce2fe67..b455211 100644
--- a/lib_blackfin/config.mk
+++ b/lib_blackfin/config.mk
@@ -43,6 +43,11 @@ endif
ifneq ($(CONFIG_BFIN_BOOT_MODE),BFIN_BOOT_BYPASS)
ALL += $(obj)u-boot.ldr
endif
+ifeq ($(CONFIG_ENV_IS_EMBEDDED_CUSTOM),y)
+CREATE_LDR_ENV = $(obj)tools/envcrc --binary > $(obj)env-ldr.o
+else
+CREATE_LDR_ENV =
+endif
SYM_PREFIX = _
@@ -53,9 +58,8 @@ LDR_FLAGS += --bmode $(subst BFIN_BOOT_,,$(CONFIG_BFIN_BOOT_MODE))
LDR_FLAGS += --use-vmas
LDR_FLAGS += --initcode $(obj)cpu/$(CPU)/initcode.o
ifneq ($(CONFIG_BFIN_BOOT_MODE),BFIN_BOOT_UART)
-ifneq ($(ENV_IS_EMBEDDED_CUSTOM),ENV_IS_EMBEDDED_CUSTOM)
-LDR_FLAGS += --punchit $$(($(CONFIG_ENV_OFFSET))):$$(($(CONFIG_ENV_SIZE))):$(obj)env-ldr.o
-endif
+LDR_FLAGS-$(CONFIG_ENV_IS_EMBEDDED_CUSTOM) += \
+ --punchit $$(($(CONFIG_ENV_OFFSET))):$$(($(CONFIG_ENV_SIZE))):$(obj)env-ldr.o
endif
ifneq (,$(findstring s,$(MAKEFLAGS)))
LDR_FLAGS += --quiet
--
1.6.4.2
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH v2] env: only build env_embedded and envcrc when needed
2009-09-09 14:32 ` Mike Frysinger
@ 2009-09-15 20:44 ` Wolfgang Denk
2009-09-15 21:39 ` Mike Frysinger
0 siblings, 1 reply; 41+ messages in thread
From: Wolfgang Denk @ 2009-09-15 20:44 UTC (permalink / raw)
To: u-boot
Dear Mike Frysinger,
In message <200909091032.17175.vapier@gentoo.org> you wrote:
>
> > Hm.. normally we don't add code without users...
>
> it's already in use, i just need to basically run sed to change it from
> current name to the new one.
I don't see any users in mainline, though. Or am I missing something?
> > > > Also, I see no documentation for it?
> > >
> > > guessing you want it added to the top level README ?
> >
> > Indeed. What's the name supposed to mean? "The envrionment is
> > embedded custom" sounds strange to me.
>
> i saw it as "custom embedding of the environment". the only thing it does is
> enable the envcrc binary. i thought of using "CONFIG_ENVCRC", but it seemed a
> little too short.
CONFIG_ENABLE_ENVCRC ? CONFIG_BUILD_ENVCRC ?
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
To live is always desirable.
-- Eleen the Capellan, "Friday's Child", stardate 3498.9
^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 1/2 v3] env: only build env_embedded and envcrc when needed
2009-09-09 15:50 ` [U-Boot] [PATCH 1/2 v3] " Mike Frysinger
@ 2009-09-15 20:45 ` Wolfgang Denk
0 siblings, 0 replies; 41+ messages in thread
From: Wolfgang Denk @ 2009-09-15 20:45 UTC (permalink / raw)
To: u-boot
Dear Mike Frysinger,
In message <1252511443-1638-1-git-send-email-vapier@gentoo.org> you wrote:
> The env code is protected by the ENV_IS_EMBEDDED define, so attempting to
> compile the code when this isn't defined is pointless. Now that the env
> headers have unified around CONFIG_ENV_IS_EMBEDDED, convert the build
> system to only build the env objects when this is enabled. And now that
> the env code is conditionally compiled, we can drop the source code checks.
>
> For people who want to extract the environment manually, add a new option
> that only enables the envcrc utility (CONFIG_ENV_IS_EMBEDDED_CUSTOM).
I see no users, and I hesitate to add dead code.
And CONFIG_ENV_IS_EMBEDDED_CUSTOM is an ugly and misleading name.
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
All a hacker needs is a tight PUSHJ, a loose pair of UUOs, and a warm
place to shift.
^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 2/2 v2] Blackfin: tweak embedded env config option
2009-09-11 9:39 ` [U-Boot] [PATCH 2/2 v2] " Mike Frysinger
@ 2009-09-15 20:49 ` Wolfgang Denk
2009-09-15 21:36 ` Mike Frysinger
2009-10-01 7:12 ` Mike Frysinger
0 siblings, 2 replies; 41+ messages in thread
From: Wolfgang Denk @ 2009-09-15 20:49 UTC (permalink / raw)
To: u-boot
Dear Mike Frysinger,
In message <1252661962-16105-1-git-send-email-vapier@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: wd@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.
^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 2/2 v2] Blackfin: tweak embedded env config option
2009-09-15 20:49 ` Wolfgang Denk
@ 2009-09-15 21:36 ` Mike Frysinger
2009-09-22 20:41 ` Wolfgang Denk
2009-10-01 7:12 ` Mike Frysinger
1 sibling, 1 reply; 41+ messages in thread
From: Mike Frysinger @ 2009-09-15 21:36 UTC (permalink / raw)
To: u-boot
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090915/c4fb5036/attachment.pgp
^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH v2] env: only build env_embedded and envcrc when needed
2009-09-15 20:44 ` Wolfgang Denk
@ 2009-09-15 21:39 ` Mike Frysinger
2009-09-22 20:43 ` Wolfgang Denk
0 siblings, 1 reply; 41+ messages in thread
From: Mike Frysinger @ 2009-09-15 21:39 UTC (permalink / raw)
To: u-boot
On Tuesday 15 September 2009 16:44:23 Wolfgang Denk wrote:
> Mike Frysinger wrote:
> > > > > Also, I see no documentation for it?
> > > >
> > > > guessing you want it added to the top level README ?
> > >
> > > Indeed. What's the name supposed to mean? "The envrionment is
> > > embedded custom" sounds strange to me.
> >
> > i saw it as "custom embedding of the environment". the only thing it
> > does is enable the envcrc binary. i thought of using "CONFIG_ENVCRC",
> > but it seemed a little too short.
>
> CONFIG_ENABLE_ENVCRC ? CONFIG_BUILD_ENVCRC ?
the name doesnt really matter to me. if you're fine with CONFIG_BUILD_ENVCRC,
i'll use that in common code and keep the CONFIG_ENV_IS_EMBEDDED_CUSTOM in the
Blackfin specific code.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090915/7c6c305b/attachment.pgp
^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 2/2 v2] Blackfin: tweak embedded env config option
2009-09-15 21:36 ` Mike Frysinger
@ 2009-09-22 20:41 ` Wolfgang Denk
2009-09-23 15:41 ` Mike Frysinger
0 siblings, 1 reply; 41+ messages in thread
From: Wolfgang Denk @ 2009-09-22 20:41 UTC (permalink / raw)
To: u-boot
Dear Mike Frysinger,
In message <200909151736.52720.vapier@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: wd at denx.de
"A child is a person who can't understand why someone would give away
a perfectly good kitten." - Doug Larson
^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH v2] env: only build env_embedded and envcrc when needed
2009-09-15 21:39 ` Mike Frysinger
@ 2009-09-22 20:43 ` Wolfgang Denk
2009-09-23 15:40 ` Mike Frysinger
0 siblings, 1 reply; 41+ messages in thread
From: Wolfgang Denk @ 2009-09-22 20:43 UTC (permalink / raw)
To: u-boot
Dear Mike Frysinger,
In message <200909151739.11704.vapier@gentoo.org> you wrote:
>
> > > i saw it as "custom embedding of the environment". the only thing it
> > > does is enable the envcrc binary. i thought of using "CONFIG_ENVCRC",
> > > but it seemed a little too short.
> >
> > CONFIG_ENABLE_ENVCRC ? CONFIG_BUILD_ENVCRC ?
>
> the name doesnt really matter to me. if you're fine with CONFIG_BUILD_ENVCRC,
> i'll use that in common code and keep the CONFIG_ENV_IS_EMBEDDED_CUSTOM in the
> Blackfin specific code.
CONFIG_BUILD_ENVCRC is fine with me (and I'd rather see if you got rid
of this unwieldy CONFIG_ENV_IS_EMBEDDED_CUSTOM thingy).
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
Leave bigotry in your quarters; there's no room for it on the bridge.
-- Kirk, "Balance of Terror", stardate 1709.2
^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH v2] env: only build env_embedded and envcrc when needed
2009-09-22 20:43 ` Wolfgang Denk
@ 2009-09-23 15:40 ` Mike Frysinger
0 siblings, 0 replies; 41+ messages in thread
From: Mike Frysinger @ 2009-09-23 15:40 UTC (permalink / raw)
To: u-boot
On Tuesday 22 September 2009 16:43:14 Wolfgang Denk wrote:
> Mike Frysinger wrote:
> > > > i saw it as "custom embedding of the environment". the only thing it
> > > > does is enable the envcrc binary. i thought of using
> > > > "CONFIG_ENVCRC", but it seemed a little too short.
> > >
> > > CONFIG_ENABLE_ENVCRC ? CONFIG_BUILD_ENVCRC ?
> >
> > the name doesnt really matter to me. if you're fine with
> > CONFIG_BUILD_ENVCRC, i'll use that in common code and keep the
> > CONFIG_ENV_IS_EMBEDDED_CUSTOM in the Blackfin specific code.
>
> CONFIG_BUILD_ENVCRC is fine with me (and I'd rather see if you got rid
> of this unwieldy CONFIG_ENV_IS_EMBEDDED_CUSTOM thingy).
so i'll have envcrc controlled by CONFIG_BUILD_ENVCRC and i'll control
embedding the env in the LDR by CONFIG_EMBEDDED_ENV_IN_LDR.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090923/52a861ca/attachment.pgp
^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 2/2 v2] Blackfin: tweak embedded env config option
2009-09-22 20:41 ` Wolfgang Denk
@ 2009-09-23 15:41 ` Mike Frysinger
0 siblings, 0 replies; 41+ messages in thread
From: Mike Frysinger @ 2009-09-23 15:41 UTC (permalink / raw)
To: u-boot
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090923/e57c8ecd/attachment.pgp
^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 1/2 v4] env: only build env_embedded and envcrc when needed
2009-09-09 12:14 ` [U-Boot] [PATCH v2] env: only build env_embedded and envcrc when needed Mike Frysinger
` (2 preceding siblings ...)
2009-09-09 15:50 ` [U-Boot] [PATCH 2/2] Blackfin: tweak embedded env config option Mike Frysinger
@ 2009-09-30 19:29 ` Mike Frysinger
2009-10-18 20:53 ` Wolfgang Denk
2009-09-30 19:29 ` [U-Boot] [PATCH 2/2 v3] Blackfin: tweak embedded LDR env config option Mike Frysinger
4 siblings, 1 reply; 41+ messages in thread
From: Mike Frysinger @ 2009-09-30 19:29 UTC (permalink / raw)
To: u-boot
The env code is protected by the ENV_IS_EMBEDDED define, so attempting to
compile the code when this isn't defined is pointless. Now that the env
headers have unified around CONFIG_ENV_IS_EMBEDDED, convert the build
system to only build the env objects when this is enabled. And now that
the env code is conditionally compiled, we can drop the source code checks.
For people who want to extract the environment manually, add a new option
CONFIG_BUILD_ENVCRC that only enables the envcrc utility.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
v4
- rename config option to CONFIG_BUILD_ENVCRC
README | 5 +++++
common/Makefile | 3 ---
common/env_embedded.c | 7 -------
include/common.h | 5 +++++
tools/Makefile | 9 ++-------
tools/envcrc.c | 11 +----------
6 files changed, 13 insertions(+), 27 deletions(-)
diff --git a/README b/README
index dee0e67..744f6bf 100644
--- a/README
+++ b/README
@@ -2305,6 +2305,11 @@ The following definitions that deal with the placement and management
of environment data (variable area); in general, we support the
following configurations:
+- CONFIG_BUILD_ENVCRC:
+
+ Builds up envcrc with the target environment so that external utils
+ may easily extract it and embed it in final U-Boot images.
+
- CONFIG_ENV_IS_IN_FLASH:
Define this if the environment is in flash memory.
diff --git a/common/Makefile b/common/Makefile
index 3781738..a92a75f 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -52,9 +52,6 @@ COBJS-y += env_common.o
COBJS-$(CONFIG_ENV_IS_IN_DATAFLASH) += env_dataflash.o
COBJS-$(CONFIG_ENV_IS_IN_EEPROM) += env_eeprom.o
COBJS-$(CONFIG_ENV_IS_EMBEDDED) += env_embedded.o
-COBJS-$(CONFIG_ENV_IS_IN_EEPROM) += env_embedded.o
-COBJS-$(CONFIG_ENV_IS_IN_FLASH) += env_embedded.o
-COBJS-$(CONFIG_ENV_IS_IN_NVRAM) += env_embedded.o
COBJS-$(CONFIG_ENV_IS_IN_FLASH) += env_flash.o
COBJS-$(CONFIG_ENV_IS_IN_MG_DISK) += env_mgdisk.o
COBJS-$(CONFIG_ENV_IS_IN_NAND) += env_nand.o
diff --git a/common/env_embedded.c b/common/env_embedded.c
index ae6cac4..e27e1cd 100644
--- a/common/env_embedded.c
+++ b/common/env_embedded.c
@@ -41,11 +41,6 @@
#endif
/*
- * Generate embedded environment table
- * inside U-Boot image, if needed.
- */
-#if defined(ENV_IS_EMBEDDED)
-/*
* Only put the environment in it's own section when we are building
* U-Boot proper. The host based program "tools/envcrc" does not need
* a seperate section. Note that ENV_CRC is only defined when building
@@ -210,5 +205,3 @@ unsigned long env_size __PPCTEXT__ = sizeof(env_t);
* Add in absolutes.
*/
GEN_ABS(env_offset, CONFIG_ENV_OFFSET);
-
-#endif /* ENV_IS_EMBEDDED */
diff --git a/include/common.h b/include/common.h
index f7c93bf..7df9afa 100644
--- a/include/common.h
+++ b/include/common.h
@@ -719,4 +719,9 @@ int cpu_release(int nr, int argc, char *argv[]);
#define ALIGN(x,a) __ALIGN_MASK((x),(typeof(x))(a)-1)
#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask))
+/* Pull in stuff for the build system */
+#ifdef DO_DEPS_ONLY
+# include <environment.h>
+#endif
+
#endif /* __COMMON_H_ */
diff --git a/tools/Makefile b/tools/Makefile
index b04e3f3..2a9a9fd 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -69,13 +69,7 @@ include $(TOPDIR)/config.mk
BIN_FILES-$(CONFIG_LCD_LOGO) += bmp_logo$(SFX)
BIN_FILES-$(CONFIG_VIDEO_LOGO) += bmp_logo$(SFX)
BIN_FILES-$(CONFIG_ENV_IS_EMBEDDED) += envcrc$(SFX)
-BIN_FILES-$(CONFIG_ENV_IS_IN_DATAFLASH) += envcrc$(SFX)
-BIN_FILES-$(CONFIG_ENV_IS_IN_EEPROM) += envcrc$(SFX)
-BIN_FILES-$(CONFIG_ENV_IS_IN_FLASH) += envcrc$(SFX)
-BIN_FILES-$(CONFIG_ENV_IS_IN_ONENAND) += envcrc$(SFX)
-BIN_FILES-$(CONFIG_ENV_IS_IN_NAND) += envcrc$(SFX)
-BIN_FILES-$(CONFIG_ENV_IS_IN_NVRAM) += envcrc$(SFX)
-BIN_FILES-$(CONFIG_ENV_IS_IN_SPI_FLASH) += envcrc$(SFX)
+BIN_FILES-$(CONFIG_BUILD_ENVCRC) += envcrc$(SFX)
BIN_FILES-$(CONFIG_CMD_NET) += gen_eth_addr$(SFX)
BIN_FILES-$(CONFIG_CMD_LOADS) += img2srec$(SFX)
BIN_FILES-$(CONFIG_INCA_IP) += inca-swap-bytes$(SFX)
@@ -95,6 +89,7 @@ OBJ_FILES-$(CONFIG_LCD_LOGO) += bmp_logo.o
OBJ_FILES-$(CONFIG_VIDEO_LOGO) += bmp_logo.o
OBJ_FILES-y += default_image.o
OBJ_FILES-$(CONFIG_ENV_IS_EMBEDDED) += envcrc.o
+OBJ_FILES-$(CONFIG_BUILD_ENVCRC) += envcrc.o
OBJ_FILES-y += fit_image.o
OBJ_FILES-$(CONFIG_CMD_NET) += gen_eth_addr.o
OBJ_FILES-$(CONFIG_CMD_LOADS) += img2srec.o
diff --git a/tools/envcrc.c b/tools/envcrc.c
index 5b0f7cd..d02a7db 100644
--- a/tools/envcrc.c
+++ b/tools/envcrc.c
@@ -50,10 +50,6 @@
# if defined(CONFIG_ENV_ADDR_REDUND) && !defined(CONFIG_ENV_SIZE_REDUND)
# define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
# endif
-# if (CONFIG_ENV_ADDR >= CONFIG_SYS_MONITOR_BASE) && \
- ((CONFIG_ENV_ADDR + CONFIG_ENV_SIZE) <= (CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN))
-# define ENV_IS_EMBEDDED 1
-# endif
# if defined(CONFIG_ENV_ADDR_REDUND) || defined(CONFIG_ENV_OFFSET_REDUND)
# define CONFIG_SYS_REDUNDAND_ENVIRONMENT 1
# endif
@@ -70,14 +66,11 @@
extern uint32_t crc32 (uint32_t, const unsigned char *, unsigned int);
-#ifdef ENV_IS_EMBEDDED
extern unsigned int env_size;
extern unsigned char environment;
-#endif /* ENV_IS_EMBEDDED */
int main (int argc, char **argv)
{
-#ifdef ENV_IS_EMBEDDED
unsigned char pad = 0x00;
uint32_t crc;
unsigned char *envptr = &environment,
@@ -131,8 +124,6 @@ int main (int argc, char **argv)
} else {
printf ("0x%08X\n", crc);
}
-#else
- printf ("0\n");
-#endif
+
return EXIT_SUCCESS;
}
--
1.6.5.rc2
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 2/2 v3] Blackfin: tweak embedded LDR env config option
2009-09-09 12:14 ` [U-Boot] [PATCH v2] env: only build env_embedded and envcrc when needed Mike Frysinger
` (3 preceding siblings ...)
2009-09-30 19:29 ` [U-Boot] [PATCH 1/2 v4] env: only build env_embedded and envcrc when needed Mike Frysinger
@ 2009-09-30 19:29 ` Mike Frysinger
4 siblings, 0 replies; 41+ messages in thread
From: Mike Frysinger @ 2009-09-30 19:29 UTC (permalink / raw)
To: u-boot
Use the common config option for extracting the environment for embedding
into LDR files and clarify the LDR-specific option.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
v3
- rename option to CONFIG_ENV_IS_EMBEDDED_IN_LDR and use new
CONFIG_BUILD_ENVCRC option
Makefile | 2 +-
include/asm-blackfin/config.h | 5 +++++
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 +++++++---
20 files changed, 31 insertions(+), 22 deletions(-)
diff --git a/Makefile b/Makefile
index 9c5b2a5..4d2b0da 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/asm-blackfin/config.h b/include/asm-blackfin/config.h
index 25794dd..248b491 100644
--- a/include/asm-blackfin/config.h
+++ b/include/asm-blackfin/config.h
@@ -76,6 +76,11 @@
# define CONFIG_ENV_SPI_CS BFIN_BOOT_SPI_SSEL
#endif
+/* We need envcrc to embed the env into LDRs */
+#ifdef CONFIG_ENV_IS_EMBEDDED_IN_LDR
+# define CONFIG_BUILD_ENVCRC
+#endif
+
/* Default/common Blackfin memory layout */
#ifndef CONFIG_SYS_SDRAM_BASE
# define CONFIG_SYS_SDRAM_BASE 0
diff --git a/include/configs/bf518f-ezbrd.h b/include/configs/bf518f-ezbrd.h
index 3db8171..4928403 100644
--- a/include/configs/bf518f-ezbrd.h
+++ b/include/configs/bf518f-ezbrd.h
@@ -109,7 +109,7 @@
#define CONFIG_ENV_SIZE 0x2000
#define CONFIG_ENV_SECT_SIZE 0x2000
#endif
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_IN_LDR
/*
diff --git a/include/configs/bf526-ezbrd.h b/include/configs/bf526-ezbrd.h
index 97853af..711fa27 100644
--- a/include/configs/bf526-ezbrd.h
+++ b/include/configs/bf526-ezbrd.h
@@ -126,7 +126,7 @@
#define CONFIG_ENV_SIZE 0x2000
#define CONFIG_ENV_SECT_SIZE 0x2000
#endif
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_IN_LDR
/*
diff --git a/include/configs/bf527-ezkit.h b/include/configs/bf527-ezkit.h
index 0d02354..5f3cb83 100644
--- a/include/configs/bf527-ezkit.h
+++ b/include/configs/bf527-ezkit.h
@@ -125,7 +125,7 @@
#define CONFIG_ENV_SIZE 0x2000
#define CONFIG_ENV_SECT_SIZE 0x2000
#endif
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_IN_LDR
/*
diff --git a/include/configs/bf533-stamp.h b/include/configs/bf533-stamp.h
index 4be2a5c..b43db93 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_IN_LDR
#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..86aa1f6 100644
--- a/include/configs/bf537-minotaur.h
+++ b/include/configs/bf537-minotaur.h
@@ -115,7 +115,7 @@
#define CONFIG_ENV_OFFSET 0x10000
#define CONFIG_ENV_SIZE 0x10000
#define CONFIG_ENV_SECT_SIZE 0x10000
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_IN_LDR
/*
diff --git a/include/configs/bf537-pnav.h b/include/configs/bf537-pnav.h
index 0f908ef..6627a04 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_IN_LDR
#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..7e9dd36 100644
--- a/include/configs/bf537-srv1.h
+++ b/include/configs/bf537-srv1.h
@@ -115,7 +115,7 @@
#define CONFIG_ENV_OFFSET 0x10000
#define CONFIG_ENV_SIZE 0x10000
#define CONFIG_ENV_SECT_SIZE 0x10000
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_IN_LDR
/*
diff --git a/include/configs/bf537-stamp.h b/include/configs/bf537-stamp.h
index 74b9ecd..017fb45 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_IN_LDR
#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..67daa29 100644
--- a/include/configs/bf538f-ezkit.h
+++ b/include/configs/bf538f-ezkit.h
@@ -109,7 +109,7 @@
#if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_BYPASS)
#define ENV_IS_EMBEDDED
#else
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_IN_LDR
#endif
#ifdef ENV_IS_EMBEDDED
/* WARNING - the following is hand-optimized to fit within
diff --git a/include/configs/bf548-ezkit.h b/include/configs/bf548-ezkit.h
index 5b9de16..d0a9e49 100644
--- a/include/configs/bf548-ezkit.h
+++ b/include/configs/bf548-ezkit.h
@@ -107,7 +107,7 @@
#define CONFIG_ENV_OFFSET 0x10000
#define CONFIG_ENV_SIZE 0x2000
#define CONFIG_ENV_SECT_SIZE 0x10000
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_IN_LDR
#elif (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_NAND)
#define CONFIG_ENV_IS_IN_NAND
#define CONFIG_ENV_OFFSET 0x40000
@@ -118,7 +118,7 @@
#define CONFIG_ENV_OFFSET 0x2000
#define CONFIG_ENV_SIZE 0x2000
#define CONFIG_ENV_SECT_SIZE (128 * 1024)
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_IN_LDR
#endif
diff --git a/include/configs/bf561-ezkit.h b/include/configs/bf561-ezkit.h
index 4779a97..81f9cb1 100644
--- a/include/configs/bf561-ezkit.h
+++ b/include/configs/bf561-ezkit.h
@@ -86,7 +86,7 @@
#if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_BYPASS)
#define ENV_IS_EMBEDDED
#else
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_IN_LDR
#endif
#ifdef ENV_IS_EMBEDDED
/* WARNING - the following is hand-optimized to fit within
diff --git a/include/configs/cm-bf527.h b/include/configs/cm-bf527.h
index 1592719..3d41bd1 100644
--- a/include/configs/cm-bf527.h
+++ b/include/configs/cm-bf527.h
@@ -106,7 +106,7 @@
#define CONFIG_ENV_OFFSET 0x8000
#define CONFIG_ENV_SIZE 0x8000
#define CONFIG_ENV_SECT_SIZE 0x20000
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_IN_LDR
/*
diff --git a/include/configs/cm-bf537e.h b/include/configs/cm-bf537e.h
index 34d4299..b243e1a 100644
--- a/include/configs/cm-bf537e.h
+++ b/include/configs/cm-bf537e.h
@@ -92,7 +92,7 @@
#if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_BYPASS)
#define ENV_IS_EMBEDDED
#else
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_IN_LDR
#endif
#ifdef ENV_IS_EMBEDDED
/* WARNING - the following is hand-optimized to fit within
diff --git a/include/configs/cm-bf537u.h b/include/configs/cm-bf537u.h
index d1870a8..0ed5960 100644
--- a/include/configs/cm-bf537u.h
+++ b/include/configs/cm-bf537u.h
@@ -96,7 +96,7 @@
#if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_BYPASS)
#define ENV_IS_EMBEDDED
#else
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_IN_LDR
#endif
#ifdef ENV_IS_EMBEDDED
/* WARNING - the following is hand-optimized to fit within
diff --git a/include/configs/cm-bf548.h b/include/configs/cm-bf548.h
index b5cfc21..9630f7d 100644
--- a/include/configs/cm-bf548.h
+++ b/include/configs/cm-bf548.h
@@ -96,7 +96,7 @@
#define CONFIG_ENV_ADDR 0x20008000
#define CONFIG_ENV_OFFSET 0x8000
#define CONFIG_ENV_SIZE 0x8000
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_IN_LDR
/*
diff --git a/include/configs/ibf-dsp561.h b/include/configs/ibf-dsp561.h
index 066859f..7c9f71e 100644
--- a/include/configs/ibf-dsp561.h
+++ b/include/configs/ibf-dsp561.h
@@ -75,7 +75,7 @@
#if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_BYPASS)
#define ENV_IS_EMBEDDED
#else
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_IN_LDR
#endif
#ifdef ENV_IS_EMBEDDED
/* WARNING - the following is hand-optimized to fit within
diff --git a/include/configs/tcm-bf537.h b/include/configs/tcm-bf537.h
index 9794e1b..9615ced 100644
--- a/include/configs/tcm-bf537.h
+++ b/include/configs/tcm-bf537.h
@@ -93,7 +93,7 @@
#if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_BYPASS)
#define ENV_IS_EMBEDDED
#else
-#define ENV_IS_EMBEDDED_CUSTOM
+#define CONFIG_ENV_IS_EMBEDDED_IN_LDR
#endif
#ifdef ENV_IS_EMBEDDED
/* WARNING - the following is hand-optimized to fit within
diff --git a/lib_blackfin/config.mk b/lib_blackfin/config.mk
index ce2fe67..323d28f 100644
--- a/lib_blackfin/config.mk
+++ b/lib_blackfin/config.mk
@@ -43,6 +43,11 @@ 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 = _
@@ -53,9 +58,8 @@ LDR_FLAGS += --bmode $(subst BFIN_BOOT_,,$(CONFIG_BFIN_BOOT_MODE))
LDR_FLAGS += --use-vmas
LDR_FLAGS += --initcode $(obj)cpu/$(CPU)/initcode.o
ifneq ($(CONFIG_BFIN_BOOT_MODE),BFIN_BOOT_UART)
-ifneq ($(ENV_IS_EMBEDDED_CUSTOM),ENV_IS_EMBEDDED_CUSTOM)
-LDR_FLAGS += --punchit $$(($(CONFIG_ENV_OFFSET))):$$(($(CONFIG_ENV_SIZE))):$(obj)env-ldr.o
-endif
+LDR_FLAGS-$(CONFIG_ENV_IS_EMBEDDED_IN_LDR) += \
+ --punchit $$(($(CONFIG_ENV_OFFSET))):$$(($(CONFIG_ENV_SIZE))):$(obj)env-ldr.o
endif
ifneq (,$(findstring s,$(MAKEFLAGS)))
LDR_FLAGS += --quiet
--
1.6.5.rc2
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 2/2 v2] Blackfin: tweak embedded env config option
2009-09-15 20:49 ` Wolfgang Denk
2009-09-15 21:36 ` Mike Frysinger
@ 2009-10-01 7:12 ` Mike Frysinger
1 sibling, 0 replies; 41+ messages in thread
From: Mike Frysinger @ 2009-10-01 7:12 UTC (permalink / raw)
To: u-boot
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=)
^ permalink raw reply related [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 1/2 v4] env: only build env_embedded and envcrc when needed
2009-09-30 19:29 ` [U-Boot] [PATCH 1/2 v4] env: only build env_embedded and envcrc when needed Mike Frysinger
@ 2009-10-18 20:53 ` Wolfgang Denk
2009-10-18 21:01 ` Mike Frysinger
0 siblings, 1 reply; 41+ messages in thread
From: Wolfgang Denk @ 2009-10-18 20:53 UTC (permalink / raw)
To: u-boot
Dear Mike Frysinger,
In message <1254338999-16311-1-git-send-email-vapier@gentoo.org> you wrote:
> The env code is protected by the ENV_IS_EMBEDDED define, so attempting to
> compile the code when this isn't defined is pointless. Now that the env
> headers have unified around CONFIG_ENV_IS_EMBEDDED, convert the build
> system to only build the env objects when this is enabled. And now that
> the env code is conditionally compiled, we can drop the source code checks.
>
> For people who want to extract the environment manually, add a new option
> CONFIG_BUILD_ENVCRC that only enables the envcrc utility.
>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> ---
> v4
> - rename config option to CONFIG_BUILD_ENVCRC
>
> README | 5 +++++
> common/Makefile | 3 ---
> common/env_embedded.c | 7 -------
> include/common.h | 5 +++++
> tools/Makefile | 9 ++-------
> tools/envcrc.c | 11 +----------
> 6 files changed, 13 insertions(+), 27 deletions(-)
Applied, thanks.
[My understanding is that patch 2/2 will go through your BF repo now,
right?]
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
The software required `Windows 95 or better', so I installed Linux.
^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 1/2 v4] env: only build env_embedded and envcrc when needed
2009-10-18 20:53 ` Wolfgang Denk
@ 2009-10-18 21:01 ` Mike Frysinger
2009-10-18 21:19 ` Wolfgang Denk
2009-10-18 21:32 ` Wolfgang Denk
0 siblings, 2 replies; 41+ messages in thread
From: Mike Frysinger @ 2009-10-18 21:01 UTC (permalink / raw)
To: u-boot
On Sunday 18 October 2009 16:53:54 Wolfgang Denk wrote:
> Mike Frysinger wrote:
> > The env code is protected by the ENV_IS_EMBEDDED define, so attempting to
> > compile the code when this isn't defined is pointless. Now that the env
> > headers have unified around CONFIG_ENV_IS_EMBEDDED, convert the build
> > system to only build the env objects when this is enabled. And now that
> > the env code is conditionally compiled, we can drop the source code
> > checks.
> >
> > For people who want to extract the environment manually, add a new option
> > CONFIG_BUILD_ENVCRC that only enables the envcrc utility.
> >
> > Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> > ---
> > v4
> > - rename config option to CONFIG_BUILD_ENVCRC
> >
> > README | 5 +++++
> > common/Makefile | 3 ---
> > common/env_embedded.c | 7 -------
> > include/common.h | 5 +++++
> > tools/Makefile | 9 ++-------
> > tools/envcrc.c | 11 +----------
> > 6 files changed, 13 insertions(+), 27 deletions(-)
>
> Applied, thanks.
>
> [My understanding is that patch 2/2 will go through your BF repo now,
> right?]
i can do that since it's already in my vendor branch
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20091018/ee0e5118/attachment.pgp
^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 1/2 v4] env: only build env_embedded and envcrc when needed
2009-10-18 21:01 ` Mike Frysinger
@ 2009-10-18 21:19 ` Wolfgang Denk
2009-10-18 21:32 ` Wolfgang Denk
1 sibling, 0 replies; 41+ messages in thread
From: Wolfgang Denk @ 2009-10-18 21:19 UTC (permalink / raw)
To: u-boot
Dear Mike Frysinger,
In message <200910181701.33654.vapier@gentoo.org> you wrote:
>
> > [My understanding is that patch 2/2 will go through your BF repo now,
> > right?]
>
> i can do that since it's already in my vendor branch
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
Die meisten Menschen pflegen im Kindesalter vom Zeigen auf Gegenst?n-
de (Mausbewegung) und "ga" sagen (Mausklick) abzukommen, zugunsten
eines m?chtigeren und langwierig zu erlernenden Tools (Sprache).
-- Achim Linder in de.comp.os.linux.misc
^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 1/2 v4] env: only build env_embedded and envcrc when needed
2009-10-18 21:01 ` Mike Frysinger
2009-10-18 21:19 ` Wolfgang Denk
@ 2009-10-18 21:32 ` Wolfgang Denk
2009-10-18 21:51 ` Mike Frysinger
2009-10-19 0:55 ` Mike Frysinger
1 sibling, 2 replies; 41+ messages in thread
From: Wolfgang Denk @ 2009-10-18 21:32 UTC (permalink / raw)
To: u-boot
Dear Mike Frysinger,
In message <200910181701.33654.vapier@gentoo.org> you wrote:
>
> > Mike Frysinger wrote:
> > > The env code is protected by the ENV_IS_EMBEDDED define, so attempting to
> > > compile the code when this isn't defined is pointless. Now that the env
> > > headers have unified around CONFIG_ENV_IS_EMBEDDED, convert the build
> > > system to only build the env objects when this is enabled. And now that
> > > the env code is conditionally compiled, we can drop the source code
> > > checks.
> > >
> > > For people who want to extract the environment manually, add a new option
> > > CONFIG_BUILD_ENVCRC that only enables the envcrc utility.
> > >
> > > Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> > > ---
> > > v4
> > > - rename config option to CONFIG_BUILD_ENVCRC
> > >
> > > README | 5 +++++
> > > common/Makefile | 3 ---
> > > common/env_embedded.c | 7 -------
> > > include/common.h | 5 +++++
> > > tools/Makefile | 9 ++-------
> > > tools/envcrc.c | 11 +----------
> > > 6 files changed, 13 insertions(+), 27 deletions(-)
> >
> > Applied, thanks.
Arghhh...
This patch seems to break a *lot* of boards:
...
Configuring for mgsuvd board...
ppc_6xx-ld: cannot find common/env_embedded.o
make: *** [/work/wd/tmp-ppc/u-boot] Error 1
ppc_6xx-size: '/work/wd/tmp-ppc/u-boot': No such file
Configuring for MHPC board...
ppc_6xx-ld: cannot find common/env_embedded.o
make: *** [/work/wd/tmp-ppc/u-boot] Error 1
ppc_6xx-size: '/work/wd/tmp-ppc/u-boot': No such file
Configuring for MPC86xADS board...
ppc_6xx-ld: cannot find common/env_embedded.o
make: *** [/work/wd/tmp-ppc/u-boot] Error 1
ppc_6xx-size: '/work/wd/tmp-ppc/u-boot': No such file
Configuring for MPC885ADS board...
ppc_6xx-ld: cannot find common/env_embedded.o
make: *** [/work/wd/tmp-ppc/u-boot] Error 1
ppc_6xx-size: '/work/wd/tmp-ppc/u-boot': No such file
Configuring for NETPHONE board...
ppc_6xx-ld: cannot find common/env_embedded.o
make: *** [/work/wd/tmp-ppc/u-boot] Error 1
ppc_6xx-size: '/work/wd/tmp-ppc/u-boot': No such file
Configuring for NETTA board...
ppc_6xx-ld: cannot find common/env_embedded.o
make: *** [/work/wd/tmp-ppc/u-boot] Error 1
ppc_6xx-size: '/work/wd/tmp-ppc/u-boot': No such file
Configuring for NETTA2 board...
ppc_6xx-ld: cannot find common/env_embedded.o
make: *** [/work/wd/tmp-ppc/u-boot] Error 1
ppc_6xx-size: '/work/wd/tmp-ppc/u-boot': No such file
Configuring for NETTA board...
ppc_6xx-ld: cannot find common/env_embedded.o
make: *** [/work/wd/tmp-ppc/u-boot] Error 1
ppc_6xx-size: '/work/wd/tmp-ppc/u-boot': No such file
... Version 1
Configuring for NETVIA board...
ppc_6xx-ld: cannot find common/env_embedded.o
make: *** [/work/wd/tmp-ppc/u-boot] Error 1
ppc_6xx-size: '/work/wd/tmp-ppc/u-boot': No such file
... Version 2
Configuring for NETVIA board...
ppc_6xx-ld: cannot find common/env_embedded.o
make: *** [/work/wd/tmp-ppc/u-boot] Error 1
ppc_6xx-size: '/work/wd/tmp-ppc/u-boot': No such file
Configuring for NX823 board...
ppc_6xx-ld: cannot find common/env_embedded.o
make: *** [/work/wd/tmp-ppc/u-boot] Error 1
ppc_6xx-size: '/work/wd/tmp-ppc/u-boot': No such file
Configuring for pcu_e board...
ppc_6xx-ld: cannot find common/env_embedded.o
make: *** [/work/wd/tmp-ppc/u-boot] Error 1
ppc_6xx-size: '/work/wd/tmp-ppc/u-boot': No such file
Configuring for QS823 board...
ppc_6xx-ld: cannot find common/env_embedded.o
make: *** [/work/wd/tmp-ppc/u-boot] Error 1
ppc_6xx-size: '/work/wd/tmp-ppc/u-boot': No such file
Configuring for QS850 board...
ppc_6xx-ld: cannot find common/env_embedded.o
make: *** [/work/wd/tmp-ppc/u-boot] Error 1
ppc_6xx-size: '/work/wd/tmp-ppc/u-boot': No such file
Configuring for QS860T board...
ppc_6xx-ld: cannot find common/env_embedded.o
make: *** [/work/wd/tmp-ppc/u-boot] Error 1
ppc_6xx-size: '/work/wd/tmp-ppc/u-boot': No such file
Configuring for quantum board...
ppc_6xx-ld: cannot find common/env_embedded.o
make: *** [/work/wd/tmp-ppc/u-boot] Error 1
ppc_6xx-size: '/work/wd/tmp-ppc/u-boot': No such file
Configuring for R360MPI board...
ppc_6xx-ld: cannot find common/env_embedded.o
make: *** [/work/wd/tmp-ppc/u-boot] Error 1
ppc_6xx-size: '/work/wd/tmp-ppc/u-boot': No such file
...
etc. etc.
Please fix, or should I rather revert the commit?
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
The faster I go, the behinder I get. -- Lewis Carroll
^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 1/2 v4] env: only build env_embedded and envcrc when needed
2009-10-18 21:32 ` Wolfgang Denk
@ 2009-10-18 21:51 ` Mike Frysinger
2009-10-18 21:58 ` Wolfgang Denk
2009-10-19 0:55 ` Mike Frysinger
1 sibling, 1 reply; 41+ messages in thread
From: Mike Frysinger @ 2009-10-18 21:51 UTC (permalink / raw)
To: u-boot
On Sunday 18 October 2009 17:32:15 Wolfgang Denk wrote:
> Mike Frysinger wrote:
> > > Mike Frysinger wrote:
> > > > The env code is protected by the ENV_IS_EMBEDDED define, so
> > > > attempting to compile the code when this isn't defined is pointless.
> > > > Now that the env headers have unified around CONFIG_ENV_IS_EMBEDDED,
> > > > convert the build system to only build the env objects when this is
> > > > enabled. And now that the env code is conditionally compiled, we can
> > > > drop the source code checks.
> > > >
> > > > For people who want to extract the environment manually, add a new
> > > > option CONFIG_BUILD_ENVCRC that only enables the envcrc utility.
> > > >
> > > > Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> > > > ---
> > > > v4
> > > > - rename config option to CONFIG_BUILD_ENVCRC
> > > >
> > > > README | 5 +++++
> > > > common/Makefile | 3 ---
> > > > common/env_embedded.c | 7 -------
> > > > include/common.h | 5 +++++
> > > > tools/Makefile | 9 ++-------
> > > > tools/envcrc.c | 11 +----------
> > > > 6 files changed, 13 insertions(+), 27 deletions(-)
> > >
> > > Applied, thanks.
>
> Arghhh...
>
> This patch seems to break a *lot* of boards:
>
> ...
> Configuring for mgsuvd board...
> ppc_6xx-ld: cannot find common/env_embedded.o
> make: *** [/work/wd/tmp-ppc/u-boot] Error 1
>
> etc. etc.
>
> Please fix, or should I rather revert the commit?
i'd prefer to fix. my guess is these boards link in the .o all the time even
when they dont have an embedded environment (which isnt a big deal -- the file
would be 0 bytes in that case).
where can i get this "ppc_6xx" compiler ?
-mike
^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 1/2 v4] env: only build env_embedded and envcrc when needed
2009-10-18 21:51 ` Mike Frysinger
@ 2009-10-18 21:58 ` Wolfgang Denk
0 siblings, 0 replies; 41+ messages in thread
From: Wolfgang Denk @ 2009-10-18 21:58 UTC (permalink / raw)
To: u-boot
Dear Mike Frysinger,
In message <200910181751.13743.vapier@gentoo.org> you wrote:
>
> i'd prefer to fix. my guess is these boards link in the .o all the time even
> when they dont have an embedded environment (which isnt a big deal -- the file
> would be 0 bytes in that case).
>
> where can i get this "ppc_6xx" compiler ?
ELDK 4.2 for Power. I guess you can use any other tool chain for ppc as
well.
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
"Everything should be made as simple as possible, but not simpler."
- Albert Einstein
^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 1/2 v4] env: only build env_embedded and envcrc when needed
2009-10-18 21:32 ` Wolfgang Denk
2009-10-18 21:51 ` Mike Frysinger
@ 2009-10-19 0:55 ` Mike Frysinger
2009-10-19 9:31 ` Wolfgang Denk
` (3 more replies)
1 sibling, 4 replies; 41+ messages in thread
From: Mike Frysinger @ 2009-10-19 0:55 UTC (permalink / raw)
To: u-boot
On Sunday 18 October 2009 17:32:15 Wolfgang Denk wrote:
> Mike Frysinger wrote:
> > > Mike Frysinger wrote:
> > > > The env code is protected by the ENV_IS_EMBEDDED define, so
> > > > attempting to compile the code when this isn't defined is pointless.
> > > > Now that the env headers have unified around CONFIG_ENV_IS_EMBEDDED,
> > > > convert the build system to only build the env objects when this is
> > > > enabled. And now that the env code is conditionally compiled, we can
> > > > drop the source code checks.
> > > >
> > > > For people who want to extract the environment manually, add a new
> > > > option CONFIG_BUILD_ENVCRC that only enables the envcrc utility.
> > > >
> > > > Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> > > > ---
> > > > v4
> > > > - rename config option to CONFIG_BUILD_ENVCRC
> > > >
> > > > README | 5 +++++
> > > > common/Makefile | 3 ---
> > > > common/env_embedded.c | 7 -------
> > > > include/common.h | 5 +++++
> > > > tools/Makefile | 9 ++-------
> > > > tools/envcrc.c | 11 +----------
> > > > 6 files changed, 13 insertions(+), 27 deletions(-)
> > >
> > > Applied, thanks.
>
> Arghhh...
>
> This patch seems to break a *lot* of boards:
i'm attaching two patches here. since we're past the merge window but before
rc1, i dont know how invasive you want to get.
the first one restores env_embedded.o building for certain config options
(even though it'll only produce a 0 byte file). if you want to be cautious
for this release, then i guess we can merge just this patch.
the second one attempts to clean up env_embedded.o in all linker scripts where
the board would only end up with a 0 byte file. obviously i cant test any of
these since i dont have the hardware, but the logic seems straight forward.
if you want to stay cautious, this would go into the next branch for start of
next merge window.
or just merge the 2nd patch only and assume that people who dont test the rc1+
are dead boards anyways. i got some build errors even after these fixes, but
they seem unrelated to my env_embedded changes as they have to do with
sections filling up & overflowing with my gcc-4.1.1 compiler.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-env-restore-limited-env_embedded-building.patch
Type: text/x-patch
Size: 1897 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20091018/c09d17e6/attachment.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-env_embedded-remove-unused-code-from-linker-scripts.patch
Type: text/x-patch
Size: 34007 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20091018/c09d17e6/attachment-0001.bin
^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 1/2 v4] env: only build env_embedded and envcrc when needed
2009-10-19 0:55 ` Mike Frysinger
@ 2009-10-19 9:31 ` Wolfgang Denk
2009-10-19 19:36 ` Mike Frysinger
2009-10-25 20:14 ` Wolfgang Denk
` (2 subsequent siblings)
3 siblings, 1 reply; 41+ messages in thread
From: Wolfgang Denk @ 2009-10-19 9:31 UTC (permalink / raw)
To: u-boot
Dear Mike Frysinger,
In message <200910182055.01744.vapier@gentoo.org> you wrote:
>
> > This patch seems to break a *lot* of boards:
>
> i'm attaching two patches here. since we're past the merge window but before
> rc1, i dont know how invasive you want to get.
>
> the first one restores env_embedded.o building for certain config options
> (even though it'll only produce a 0 byte file). if you want to be cautious
> for this release, then i guess we can merge just this patch.
>
> the second one attempts to clean up env_embedded.o in all linker scripts where
> the board would only end up with a 0 byte file. obviously i cant test any of
> these since i dont have the hardware, but the logic seems straight forward.
> if you want to stay cautious, this would go into the next branch for start of
> next merge window.
>
> or just merge the 2nd patch only and assume that people who dont test the rc1+
> are dead boards anyways. i got some build errors even after these fixes, but
> they seem unrelated to my env_embedded changes as they have to do with
> sections filling up & overflowing with my gcc-4.1.1 compiler.
I would tend to apply your second patch - but looking at it I will
not do it, as it seems to break boards just harder, i. e. they may
build, but will fail to work.
For example:
...
> diff --git a/board/tqc/tqm8xx/u-boot.lds b/board/tqc/tqm8xx/u-boot.lds
> index 2df8d84..8207b2c 100644
> --- a/board/tqc/tqm8xx/u-boot.lds
> +++ b/board/tqc/tqm8xx/u-boot.lds
> @@ -21,6 +21,8 @@
> * MA 02111-1307 USA
> */
>
> +#include <config.h>
> +
> OUTPUT_ARCH(powerpc)
> /* Do we need any of these for elf?
> __DYNAMIC = 0; */
> @@ -64,8 +66,10 @@ SECTIONS
> lib_generic/zlib.o (.text)
> lib_ppc/cache.o (.text)
>
> +#ifdef CONFIG_ENV_IS_EMBEDDED
> . = DEFINED(env_offset) ? env_offset : .;
> common/env_embedded.o (.ppcenv)
> +#endif
All TQM8xx boards use a hand-optimized linker script that places the
envrionment (both the primary and the redundant copies) into the
small boot sectors of the bottom boot block type NOR flash used on
these boards (and the same is true for other boards as well; I know
this for sure at least for IVM*, km8xx, purple, spc1920, stxxtc,
trab).
However, none of these #defines CONFIG_ENV_IS_EMBEDDED in their board
config files.
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
Intel's new motto: United we stand. Divided we fall!
^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 1/2 v4] env: only build env_embedded and envcrc when needed
2009-10-19 9:31 ` Wolfgang Denk
@ 2009-10-19 19:36 ` Mike Frysinger
0 siblings, 0 replies; 41+ messages in thread
From: Mike Frysinger @ 2009-10-19 19:36 UTC (permalink / raw)
To: u-boot
On Monday 19 October 2009 05:31:36 Wolfgang Denk wrote:
> Mike Frysinger wrote:
> > diff --git a/board/tqc/tqm8xx/u-boot.lds b/board/tqc/tqm8xx/u-boot.lds
> > index 2df8d84..8207b2c 100644
> > --- a/board/tqc/tqm8xx/u-boot.lds
> > +++ b/board/tqc/tqm8xx/u-boot.lds
> > @@ -21,6 +21,8 @@
> > * MA 02111-1307 USA
> > */
> >
> > +#include <config.h>
> > +
> > OUTPUT_ARCH(powerpc)
> > /* Do we need any of these for elf?
> > __DYNAMIC = 0; */
> > @@ -64,8 +66,10 @@ SECTIONS
> > lib_generic/zlib.o (.text)
> > lib_ppc/cache.o (.text)
> >
> > +#ifdef CONFIG_ENV_IS_EMBEDDED
> > . = DEFINED(env_offset) ? env_offset : .;
> > common/env_embedded.o (.ppcenv)
> > +#endif
>
> All TQM8xx boards use a hand-optimized linker script that places the
> envrionment (both the primary and the redundant copies) into the
> small boot sectors of the bottom boot block type NOR flash used on
> these boards (and the same is true for other boards as well; I know
> this for sure at least for IVM*, km8xx, purple, spc1920, stxxtc,
> trab).
>
> However, none of these #defines CONFIG_ENV_IS_EMBEDDED in their board
> config files.
if none of them have defined CONFIG_ENV_IS_EMBEDDED, then this code never
would have expanded to anything. if you look at the actual env_embedded.c
code, it is completely wrapped in
#ifdef CONFIG_ENV_IS_EMBEDDED
...
#endif
thus env_offset would not be defined nor would env_embedded.o contain anything
thus nothing would be injected thus nothing should be changed thus my proposed
change should be fine
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20091019/be076157/attachment.pgp
^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 1/2 v4] env: only build env_embedded and envcrc when needed
2009-10-19 0:55 ` Mike Frysinger
2009-10-19 9:31 ` Wolfgang Denk
@ 2009-10-25 20:14 ` Wolfgang Denk
2009-10-25 21:55 ` Wolfgang Denk
2009-10-26 23:24 ` Wolfgang Denk
3 siblings, 0 replies; 41+ messages in thread
From: Wolfgang Denk @ 2009-10-25 20:14 UTC (permalink / raw)
To: u-boot
Dear Mike Frysinger,
In message <200910182055.01744.vapier@gentoo.org> you wrote:
>
> > This patch seems to break a *lot* of boards:
>
> i'm attaching two patches here. since we're past the merge window but before
> rc1, i dont know how invasive you want to get.
>
> the first one restores env_embedded.o building for certain config options
> (even though it'll only produce a 0 byte file). if you want to be cautious
> for this release, then i guess we can merge just this patch.
>
> the second one attempts to clean up env_embedded.o in all linker scripts where
> the board would only end up with a 0 byte file. obviously i cant test any of
> these since i dont have the hardware, but the logic seems straight forward.
> if you want to stay cautious, this would go into the next branch for start of
> next merge window.
>
> or just merge the 2nd patch only and assume that people who dont test the rc1+
> are dead boards anyways. i got some build errors even after these fixes, but
> they seem unrelated to my env_embedded changes as they have to do with
> sections filling up & overflowing with my gcc-4.1.1 compiler.
> -mike
Applied patch #2, after testing on lwmon.
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
Do not simplify the design of a program if a way can be found to make
it complex and wonderful.
^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 1/2 v4] env: only build env_embedded and envcrc when needed
2009-10-19 0:55 ` Mike Frysinger
2009-10-19 9:31 ` Wolfgang Denk
2009-10-25 20:14 ` Wolfgang Denk
@ 2009-10-25 21:55 ` Wolfgang Denk
2009-10-26 8:36 ` Mike Frysinger
2009-10-26 23:24 ` Wolfgang Denk
3 siblings, 1 reply; 41+ messages in thread
From: Wolfgang Denk @ 2009-10-25 21:55 UTC (permalink / raw)
To: u-boot
Dear Mike Frysinger,
In message <200910182055.01744.vapier@gentoo.org> you wrote:
>
> i'm attaching two patches here. since we're past the merge window but before
> rc1, i dont know how invasive you want to get.
>
> the first one restores env_embedded.o building for certain config options
> (even though it'll only produce a 0 byte file). if you want to be cautious
> for this release, then i guess we can merge just this patch.
>
> the second one attempts to clean up env_embedded.o in all linker scripts where
> the board would only end up with a 0 byte file. obviously i cant test any of
> these since i dont have the hardware, but the logic seems straight forward.
> if you want to stay cautious, this would go into the next branch for start of
> next merge window.
>
> or just merge the 2nd patch only and assume that people who dont test the rc1+
> are dead boards anyways. i got some build errors even after these fixes, but
> they seem unrelated to my env_embedded changes as they have to do with
> sections filling up & overflowing with my gcc-4.1.1 compiler.
Hm... even though I like patch #2 more than the other one (which is
why I applied #2), there is a strange phenomenon remaining:
With patch #2 applied, I get these errors for the acadia_nand,
bamboo_nand, canyonlands_nand, and kilauea_nand configurations:
-> ./MAKEALL kilauea_nand
Configuring for kilauea_nand board...
In file included from include/common.h:724:
/home/wd/git/u-boot/work/include/environment.h:117:1: warning: "CONFIG_ENV_IS_EMBEDDED" redefined
In file included from /home/wd/git/u-boot/work/include/config.h:4,
from include/common.h:37:
/home/wd/git/u-boot/work/include/configs/kilauea.h:127:1: warning: this is the location of the previous definition
But when I remove the CONFIG_ENV_IS_EMBEDDED definition from line 127
of include/configs/kilauea.h, then I get this:
./MAKEALL kilauea kilauea_nand
Configuring for kilauea board...
text data bss dec hex filename
287816 24656 46548 359020 57a6c /work/wd/tmp-ppc/u-boot
Configuring for kilauea_nand board...
ppc_6xx-ld: cannot find common/env_embedded.o
make: *** [/work/wd/tmp-ppc/u-boot] Error 1
There seems to be still a logic error ...
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
"A child is a person who can't understand why someone would give away
a perfectly good kitten." - Doug Larson
^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 1/2 v4] env: only build env_embedded and envcrc when needed
2009-10-25 21:55 ` Wolfgang Denk
@ 2009-10-26 8:36 ` Mike Frysinger
2009-10-26 12:13 ` Stefan Roese
2009-10-26 19:17 ` Wolfgang Denk
0 siblings, 2 replies; 41+ messages in thread
From: Mike Frysinger @ 2009-10-26 8:36 UTC (permalink / raw)
To: u-boot
On Sunday 25 October 2009 17:55:07 Wolfgang Denk wrote:
> Mike Frysinger wrote:
> > i'm attaching two patches here. since we're past the merge window but
> > before rc1, i dont know how invasive you want to get.
> >
> > the first one restores env_embedded.o building for certain config options
> > (even though it'll only produce a 0 byte file). if you want to be
> > cautious for this release, then i guess we can merge just this patch.
> >
> > the second one attempts to clean up env_embedded.o in all linker scripts
> > where the board would only end up with a 0 byte file. obviously i cant
> > test any of these since i dont have the hardware, but the logic seems
> > straight forward. if you want to stay cautious, this would go into the
> > next branch for start of next merge window.
> >
> > or just merge the 2nd patch only and assume that people who dont test the
> > rc1+ are dead boards anyways. i got some build errors even after these
> > fixes, but they seem unrelated to my env_embedded changes as they have to
> > do with sections filling up & overflowing with my gcc-4.1.1 compiler.
>
> Hm... even though I like patch #2 more than the other one (which is
> why I applied #2), there is a strange phenomenon remaining:
>
>
> With patch #2 applied, I get these errors for the acadia_nand,
> bamboo_nand, canyonlands_nand, and kilauea_nand configurations:
>
> -> ./MAKEALL kilauea_nand
> Configuring for kilauea_nand board...
> In file included from include/common.h:724:
> /home/wd/git/u-boot/work/include/environment.h:117:1: warning:
> "CONFIG_ENV_IS_EMBEDDED" redefined In file included from
> /home/wd/git/u-boot/work/include/config.h:4, from include/common.h:37:
> /home/wd/git/u-boot/work/include/configs/kilauea.h:127:1: warning: this is
> the location of the previous definition
>
> But when I remove the CONFIG_ENV_IS_EMBEDDED definition from line 127
> of include/configs/kilauea.h, then I get this:
>
> ./MAKEALL kilauea kilauea_nand
> Configuring for kilauea board...
> text data bss dec hex filename
> 287816 24656 46548 359020 57a6c /work/wd/tmp-ppc/u-boot
> Configuring for kilauea_nand board...
> ppc_6xx-ld: cannot find common/env_embedded.o
> make: *** [/work/wd/tmp-ppc/u-boot] Error 1
>
> There seems to be still a logic error ...
should be harmless, but obviously it's ugly. the attached patch should fix
things up. the related issue is the one i raised in the other env embedded
thread wrt the meaning of "ENV_IS_EMBEDDED" ...
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-env-avoid-redefining-CONFIG_ENV_IS_EMBEDDED.patch
Type: text/x-patch
Size: 1393 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20091026/a9354f04/attachment.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20091026/a9354f04/attachment.pgp
^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 1/2 v4] env: only build env_embedded and envcrc when needed
2009-10-26 8:36 ` Mike Frysinger
@ 2009-10-26 12:13 ` Stefan Roese
2009-10-26 12:26 ` Mike Frysinger
2009-10-26 19:17 ` Wolfgang Denk
1 sibling, 1 reply; 41+ messages in thread
From: Stefan Roese @ 2009-10-26 12:13 UTC (permalink / raw)
To: u-boot
On Monday 26 October 2009 09:36:11 Mike Frysinger wrote:
> > But when I remove the CONFIG_ENV_IS_EMBEDDED definition from line 127
> > of include/configs/kilauea.h, then I get this:
> >
> > ./MAKEALL kilauea kilauea_nand
> > Configuring for kilauea board...
> > text data bss dec hex filename
> > 287816 24656 46548 359020 57a6c /work/wd/tmp-ppc/u-boot
> > Configuring for kilauea_nand board...
> > ppc_6xx-ld: cannot find common/env_embedded.o
> > make: *** [/work/wd/tmp-ppc/u-boot] Error 1
> >
> > There seems to be still a logic error ...
>
> should be harmless, but obviously it's ugly. the attached patch should fix
> things up. the related issue is the one i raised in the other env embedded
> thread wrt the meaning of "ENV_IS_EMBEDDED" ...
Thanks. With this patch, most of the ppc4xx compile problems I have noticed
are gone now. But unfortunately not all. Those two 4xx platforms still don't
compile:
CRAYL1 EXBITGEN
$ ./MAKEALL CRAYL1
Configuring for CRAYL1 board...
ppc_4xx-ld: cannot find common/env_embedded.o
make: *** [u-boot] Error 1
ppc_4xx-size: './u-boot': No such file
A quick scan reveals that both ports have one thing in common. They both
include:
common/env_embedded.o(.text)
in their linker scripts.
Cheers,
Stefan
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de
^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 1/2 v4] env: only build env_embedded and envcrc when needed
2009-10-26 12:13 ` Stefan Roese
@ 2009-10-26 12:26 ` Mike Frysinger
2009-10-26 12:34 ` Stefan Roese
0 siblings, 1 reply; 41+ messages in thread
From: Mike Frysinger @ 2009-10-26 12:26 UTC (permalink / raw)
To: u-boot
On Monday 26 October 2009 08:13:57 Stefan Roese wrote:
> On Monday 26 October 2009 09:36:11 Mike Frysinger wrote:
> > > But when I remove the CONFIG_ENV_IS_EMBEDDED definition from line 127
> > > of include/configs/kilauea.h, then I get this:
> > >
> > > ./MAKEALL kilauea kilauea_nand
> > > Configuring for kilauea board...
> > > text data bss dec hex filename
> > > 287816 24656 46548 359020 57a6c /work/wd/tmp-ppc/u-boot
> > > Configuring for kilauea_nand board...
> > > ppc_6xx-ld: cannot find common/env_embedded.o
> > > make: *** [/work/wd/tmp-ppc/u-boot] Error 1
> > >
> > > There seems to be still a logic error ...
> >
> > should be harmless, but obviously it's ugly. the attached patch should
> > fix things up. the related issue is the one i raised in the other env
> > embedded thread wrt the meaning of "ENV_IS_EMBEDDED" ...
>
> Thanks. With this patch, most of the ppc4xx compile problems I have noticed
> are gone now. But unfortunately not all. Those two 4xx platforms still
> don't compile:
>
> CRAYL1 EXBITGEN
>
> $ ./MAKEALL CRAYL1
> Configuring for CRAYL1 board...
> ppc_4xx-ld: cannot find common/env_embedded.o
> make: *** [u-boot] Error 1
> ppc_4xx-size: './u-boot': No such file
>
> A quick scan reveals that both ports have one thing in common. They both
> include:
> common/env_embedded.o(.text)
> in their linker scripts.
you sure you applied the patch fully ? in the patch i posted:
board/cray/L1/u-boot.lds | 3 ---
board/cray/L1/u-boot.lds.debug | 2 --
board/exbitgen/u-boot.lds | 3 ---
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20091026/7c8d1a83/attachment.pgp
^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 1/2 v4] env: only build env_embedded and envcrc when needed
2009-10-26 12:26 ` Mike Frysinger
@ 2009-10-26 12:34 ` Stefan Roese
2009-10-26 20:45 ` Mike Frysinger
0 siblings, 1 reply; 41+ messages in thread
From: Stefan Roese @ 2009-10-26 12:34 UTC (permalink / raw)
To: u-boot
On Monday 26 October 2009 13:26:22 Mike Frysinger wrote:
> > Thanks. With this patch, most of the ppc4xx compile problems I have
> > noticed are gone now. But unfortunately not all. Those two 4xx platforms
> > still don't compile:
> >
> > CRAYL1 EXBITGEN
> >
> > $ ./MAKEALL CRAYL1
> > Configuring for CRAYL1 board...
> > ppc_4xx-ld: cannot find common/env_embedded.o
> > make: *** [u-boot] Error 1
> > ppc_4xx-size: './u-boot': No such file
> >
> > A quick scan reveals that both ports have one thing in common. They both
> > include:
> > common/env_embedded.o(.text)
> > in their linker scripts.
>
> you sure you applied the patch fully ? in the patch i posted:
> board/cray/L1/u-boot.lds | 3 ---
> board/cray/L1/u-boot.lds.debug | 2 --
> board/exbitgen/u-boot.lds | 3 ---
I just applied the patch from your latest mail in this thread to mainline
(0001-env-avoid-redefining-CONFIG_ENV_IS_EMBEDDED.patch, from October 26th). I
missed the patch you reference above. Could you please send me a link to it?
Thanks.
Cheers,
Stefan
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de
^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 1/2 v4] env: only build env_embedded and envcrc when needed
2009-10-26 8:36 ` Mike Frysinger
2009-10-26 12:13 ` Stefan Roese
@ 2009-10-26 19:17 ` Wolfgang Denk
2009-10-26 20:43 ` Mike Frysinger
1 sibling, 1 reply; 41+ messages in thread
From: Wolfgang Denk @ 2009-10-26 19:17 UTC (permalink / raw)
To: u-boot
Dear Mike Frysinger,
In message <200910260436.12814.vapier@gentoo.org> you wrote:
>
> should be harmless, but obviously it's ugly. the attached patch should fix
> things up. the related issue is the one i raised in the other env embedded
> thread wrt the meaning of "ENV_IS_EMBEDDED" ...
I see. Thanks.
Tests running.
Is it ok with you that I squash this patch into the previous one?
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
You young'uns. That was *long* before AltaVista, DejaNews, or even
(gasp) the *Web*! In fact, we typed that thread on steam-powered card
punchers, and shipped it around via Pony Express.
-- Randal Schwartz in <8cwww1cd0d.fsf@gadget.cscaper.com>
^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 1/2 v4] env: only build env_embedded and envcrc when needed
2009-10-26 19:17 ` Wolfgang Denk
@ 2009-10-26 20:43 ` Mike Frysinger
0 siblings, 0 replies; 41+ messages in thread
From: Mike Frysinger @ 2009-10-26 20:43 UTC (permalink / raw)
To: u-boot
On Monday 26 October 2009 15:17:45 Wolfgang Denk wrote:
> Mike Frysinger wrote:
> > should be harmless, but obviously it's ugly. the attached patch should
> > fix things up. the related issue is the one i raised in the other env
> > embedded thread wrt the meaning of "ENV_IS_EMBEDDED" ...
>
> I see. Thanks.
>
> Tests running.
>
> Is it ok with you that I squash this patch into the previous one?
doesnt matter to me
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20091026/03be0ff6/attachment.pgp
^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 1/2 v4] env: only build env_embedded and envcrc when needed
2009-10-26 12:34 ` Stefan Roese
@ 2009-10-26 20:45 ` Mike Frysinger
0 siblings, 0 replies; 41+ messages in thread
From: Mike Frysinger @ 2009-10-26 20:45 UTC (permalink / raw)
To: u-boot
On Monday 26 October 2009 08:34:35 Stefan Roese wrote:
> On Monday 26 October 2009 13:26:22 Mike Frysinger wrote:
> > > Thanks. With this patch, most of the ppc4xx compile problems I have
> > > noticed are gone now. But unfortunately not all. Those two 4xx
> > > platforms still don't compile:
> > >
> > > CRAYL1 EXBITGEN
> > >
> > > $ ./MAKEALL CRAYL1
> > > Configuring for CRAYL1 board...
> > > ppc_4xx-ld: cannot find common/env_embedded.o
> > > make: *** [u-boot] Error 1
> > > ppc_4xx-size: './u-boot': No such file
> > >
> > > A quick scan reveals that both ports have one thing in common. They
> > > both include:
> > > common/env_embedded.o(.text)
> > > in their linker scripts.
> >
> > you sure you applied the patch fully ? in the patch i posted:
> > board/cray/L1/u-boot.lds | 3 ---
> > board/cray/L1/u-boot.lds.debug | 2 --
> > board/exbitgen/u-boot.lds | 3 ---
>
> I just applied the patch from your latest mail in this thread to mainline
> (0001-env-avoid-redefining-CONFIG_ENV_IS_EMBEDDED.patch, from October
> 26th). I missed the patch you reference above. Could you please send me a
> link to it?
that patch was only to fix a redefine warning. the major linker script update
was up two e-mails from that patch in the thread.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20091026/5547bee3/attachment.pgp
^ permalink raw reply [flat|nested] 41+ messages in thread
* [U-Boot] [PATCH 1/2 v4] env: only build env_embedded and envcrc when needed
2009-10-19 0:55 ` Mike Frysinger
` (2 preceding siblings ...)
2009-10-25 21:55 ` Wolfgang Denk
@ 2009-10-26 23:24 ` Wolfgang Denk
3 siblings, 0 replies; 41+ messages in thread
From: Wolfgang Denk @ 2009-10-26 23:24 UTC (permalink / raw)
To: u-boot
Dear Mike Frysinger,
In message <200910182055.01744.vapier@gentoo.org> you wrote:
>
...
> From 1ffa4c71d249e877c8b4b84e412af7efc1e8f113 Mon Sep 17 00:00:00 2001
> From: Mike Frysinger <vapier@gentoo.org>
> Date: Sun, 18 Oct 2009 19:37:11 -0400
> Subject: [PATCH 2/2] env_embedded: remove unused code from linker scripts
>
> Punt references to common/env_embedded.o when the linker script does not
> utilize env_offset as this means the location of the environment is not
> kept in a fixed location -- it'll get appended wherever the previous
> .text objects happen to end. This will fluctuate greatly by the compiler
> and related optimizations.
>
> For boards that do leverage env_offset behind a DEFINED() check, only try
> to include env_embedded.o when the object would actually be non-zero.
> i.e. when CONFIG_ENV_IS_EMBEDDED is defined
I give up. Applying this patch was a wrong thing to do. It _does_
break boards.
I wrote this before:
------- Forwarded Message
Date: Mon, 19 Oct 2009 11:31:36 +0200
From: Wolfgang Denk <wd@denx.de>
To: Mike Frysinger <vapier@gentoo.org>
cc: u-boot at lists.denx.de
Subject: Re: [U-Boot] [PATCH 1/2 v4] env: only build env_embedded and envcrc wh
en needed
...
I would tend to apply your second patch - but looking at it I will
not do it, as it seems to break boards just harder, i. e. they may
build, but will fail to work.
For example:
...
> diff --git a/board/tqc/tqm8xx/u-boot.lds b/board/tqc/tqm8xx/u-boot.lds
> index 2df8d84..8207b2c 100644
> --- a/board/tqc/tqm8xx/u-boot.lds
> +++ b/board/tqc/tqm8xx/u-boot.lds
> @@ -21,6 +21,8 @@
> * MA 02111-1307 USA
> */
>
> +#include <config.h>
> +
> OUTPUT_ARCH(powerpc)
> /* Do we need any of these for elf?
> __DYNAMIC = 0; */
> @@ -64,8 +66,10 @@ SECTIONS
> lib_generic/zlib.o (.text)
> lib_ppc/cache.o (.text)
>
> +#ifdef CONFIG_ENV_IS_EMBEDDED
> . = DEFINED(env_offset) ? env_offset : .;
> common/env_embedded.o (.ppcenv)
> +#endif
All TQM8xx boards use a hand-optimized linker script that places the
envrionment (both the primary and the redundant copies) into the
small boot sectors of the bottom boot block type NOR flash used on
these boards (and the same is true for other boards as well; I know
this for sure at least for IVM*, km8xx, purple, spc1920, stxxtc,
trab).
However, none of these #defines CONFIG_ENV_IS_EMBEDDED in their board
config files.
...
------- End of Forwarded Message
And this is what happens:
Before applying the patch:
*fill* 0x40007a68 0x598 00
common/env_embedded.o(.ppcenv)
.ppcenv 0x40008000 0x8000 common/env_embedded.o
0x40008000 environment
0x4000c000 redundand_environment
*(.text)
i. e. the environment sectors are neatly aligned at the bootom boot
sectors at offset 0x8000 and 0xC000
After applying the patch:
.ppcenv 0x40033278 0x8000
.ppcenv 0x40033278 0x8000 common/libcommon.a(env_embedded.o)
0x40033278 environment
0x40037278 redundand_environment
i. e. the environment sectors are at random locations. U-Boot doesn't
even boot any more on two 8xx boards I tested.
Sorry, but I don't have time nor nerves any more at this point of the
release cycle to continue trying this patch or that, so I decided to
revert commit 6dab6add ("env: only build env_embedded and envcrc when
needed").
Now all boards build fine again.
Please clean this up so it works on all boards, and resubmit for next
release. 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
It is dangerous to be sincere unless you are also stupid.
- George Bernard Shaw
^ permalink raw reply [flat|nested] 41+ messages in thread
end of thread, other threads:[~2009-10-26 23:24 UTC | newest]
Thread overview: 41+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-27 8:31 [U-Boot] [PATCH/RFC] env: always build env_embedded and envcrc Mike Frysinger
2009-07-27 20:52 ` Wolfgang Denk
2009-09-09 12:14 ` [U-Boot] [PATCH v2] env: only build env_embedded and envcrc when needed Mike Frysinger
2009-09-09 13:33 ` Wolfgang Denk
2009-09-09 14:02 ` Mike Frysinger
2009-09-09 14:26 ` Wolfgang Denk
2009-09-09 14:32 ` Mike Frysinger
2009-09-15 20:44 ` Wolfgang Denk
2009-09-15 21:39 ` Mike Frysinger
2009-09-22 20:43 ` Wolfgang Denk
2009-09-23 15:40 ` Mike Frysinger
2009-09-09 15:50 ` [U-Boot] [PATCH 1/2 v3] " Mike Frysinger
2009-09-15 20:45 ` Wolfgang Denk
2009-09-09 15:50 ` [U-Boot] [PATCH 2/2] Blackfin: tweak embedded env config option Mike Frysinger
2009-09-11 9:39 ` [U-Boot] [PATCH 2/2 v2] " Mike Frysinger
2009-09-15 20:49 ` Wolfgang Denk
2009-09-15 21:36 ` Mike Frysinger
2009-09-22 20:41 ` Wolfgang Denk
2009-09-23 15:41 ` Mike Frysinger
2009-10-01 7:12 ` Mike Frysinger
2009-09-30 19:29 ` [U-Boot] [PATCH 1/2 v4] env: only build env_embedded and envcrc when needed Mike Frysinger
2009-10-18 20:53 ` Wolfgang Denk
2009-10-18 21:01 ` Mike Frysinger
2009-10-18 21:19 ` Wolfgang Denk
2009-10-18 21:32 ` Wolfgang Denk
2009-10-18 21:51 ` Mike Frysinger
2009-10-18 21:58 ` Wolfgang Denk
2009-10-19 0:55 ` Mike Frysinger
2009-10-19 9:31 ` Wolfgang Denk
2009-10-19 19:36 ` Mike Frysinger
2009-10-25 20:14 ` Wolfgang Denk
2009-10-25 21:55 ` Wolfgang Denk
2009-10-26 8:36 ` Mike Frysinger
2009-10-26 12:13 ` Stefan Roese
2009-10-26 12:26 ` Mike Frysinger
2009-10-26 12:34 ` Stefan Roese
2009-10-26 20:45 ` Mike Frysinger
2009-10-26 19:17 ` Wolfgang Denk
2009-10-26 20:43 ` Mike Frysinger
2009-10-26 23:24 ` Wolfgang Denk
2009-09-30 19:29 ` [U-Boot] [PATCH 2/2 v3] Blackfin: tweak embedded LDR env config option Mike Frysinger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox