Skip to contentSkip to conversation

env: add default env size for CONFIG_ENV_IS_NOWHERE

RFC PATCH New Bo Shen 3 participants 5 messages Aug 11, 2013 – Aug 12, 2013

lore
Share & tools
lore

Bo Shen

author
#0 lore raw

RFC PATCH 1/1 env: add default env size for CONFIG_ENV_IS_NOWHERE

when CONFIG_ENV_IS_NOWHERE is enabled, it is still need to define CONFIG_ENV_SIZE. So, add a default size (1024 Bytes) to avoid compile error if not define CONFIG_ENV_SIZE

---
The default value for CONFIG_ENV_SIZE (1024 Bytes) maybe not the better choice, consider runtime decided, however failed.

This patch is only compile testing with CONFIG_ENV_IS_NOWHERE enable
---

 include/environment.h |    6 ++++++
 1 file changed, 6 insertions(+)
include/environment.h +6 -0
index 46a3554..52a7769 100644
@@ -146,6 +146,12 @@ extern unsigned long nand_env_oob_offset;
 extern char *env_name_spec;
 #endif
 
+#ifdef CONFIG_ENV_IS_NOWHERE
+# ifndef CONFIG_ENV_SIZE
+# define CONFIG_ENV_SIZE 0x400
+# endif
+#endif
+
 #define ENV_SIZE (CONFIG_ENV_SIZE - ENV_HEADER_SIZE)
 
 typedef struct environment_s {
Signature · 1 line
1.7.10.4
#1 lore raw

RFC PATCH 1/1 env: add default env size for CONFIG_ENV_IS_NOWHERE

Dear Bo Shen,

Quoted 3 lines · In message <[email protected]> you wrote:

when CONFIG_ENV_IS_NOWHERE is enabled, it is still need to define CONFIG_ENV_SIZE. So, add a default size (1024 Bytes) to avoid compile error if not define CONFIG_ENV_SIZE

I don;t understand the rationale for this patch. In which way is the environment seize for the CONFIG_ENV_IS_NOWHERE case different from any other cases? For these, we do not define a default either, so why should we handle this case differently?

In any cse, the needed environment seize if a pretty board specific thing, and I think it makes sense to let the user define it.

Best regards,

Wolfgang Denk

Signature · 4 lines
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
Anyone who isn't confused here doesn't really know what's going on.
author
#2 lore raw

RFC PATCH 1/1 env: add default env size for CONFIG_ENV_IS_NOWHERE

Hi Wolfgang Denk,

Quoted 11 lines · Wolfgang Denk

Dear Bo Shen,

Quoted 3 lines · In message <[email protected]> you wrote:

when CONFIG_ENV_IS_NOWHERE is enabled, it is still need to define CONFIG_ENV_SIZE. So, add a default size (1024 Bytes) to avoid compile error if not define CONFIG_ENV_SIZE

I don;t understand the rationale for this patch. In which way is the environment seize for the CONFIG_ENV_IS_NOWHERE case different from any other cases? For these, we do not define a default either, so why should we handle this case differently?

In my opinion, there is a little different. The CONFIG_ENV_IS_NOWHERE case only store environment in volatile memory (e.g. DDR SDRAM) while not store in non-volatile device.

At first glance of CONFIG_ENV_IS_NOWHERE, I think no need to define the CONFIG_ENV_SIZE, actually, it needs to define the CONFIG_ENV_SIZE. So, I think add a default value will be better (Maybe another choice to add a description in README file to specify how to use CONFIG_ENV_IS_NOWHERE).

Quoted 2 lines

In any cse, the needed environment seize if a pretty board specific thing, and I think it makes sense to let the user define it.

Yes, the environment size is a pretty board specific thing. So, in this patch, there is an option for user to define it.

Quoted 4 lines

Best regards,

Wolfgang Denk

Best Regards,
Bo Shen

#3 lore raw

RFC PATCH 1/1 env: add default env size for CONFIG_ENV_IS_NOWHERE

Dear Bo Shen,

Quoted 5 lines · In message <[email protected]> you wrote:

At first glance of CONFIG_ENV_IS_NOWHERE, I think no need to define the CONFIG_ENV_SIZE, actually, it needs to define the CONFIG_ENV_SIZE. So, I think add a default value will be better (Maybe another choice to add a description in README file to specify how to use CONFIG_ENV_IS_NOWHERE).

I cannot see in which way the required environment size in this case is different from all other cases. To me, a default size makes little sense - it is just a chance to miss setting a suitable value, so it bites you later (at run time) instead of earlyin development.

Quoted 5 lines
Quoted 2 lines

In any cse, the needed environment seize if a pretty board specific thing, and I think it makes sense to let the user define it.

Yes, the environment size is a pretty board specific thing. So, in this patch, there is an option for user to define it.

I think the user should always set this to a useful (for him) value. For example, you think 1 KiB is a useful size, I would think it is too small. Ask two other people, and you will hear three other different numbers.

Best regards,

Wolfgang Denk

Signature · 5 lines
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
Motto of the Electrical Engineer: Working computer hardware is a  lot
like an erect penis: it stays up as long as you don't fuck with it.
#4 lore raw

RFC PATCH 1/1 env: add default env size for CONFIG_ENV_IS_NOWHERE

In reply to Bo Shen
Quoted 3 lines · Bo Shen

when CONFIG_ENV_IS_NOWHERE is enabled, it is still need to define CONFIG_ENV_SIZE. So, add a default size (1024 Bytes) to avoid compile error if not define CONFIG_ENV_SIZE

The problem is that ENV_SIZE is also a limiting factor on how big the run-time copy of the environment may be, not just how much space we use when writing to a backing store, so NAK.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130812/96760e70/attachment.pgp>