* [U-Boot] [RFC PATCH] env: add default env size for CONFIG_ENV_IS_NOWHERE
@ 2013-08-11 14:15 Bo Shen
2013-08-11 14:50 ` Wolfgang Denk
2013-08-12 13:39 ` Tom Rini
0 siblings, 2 replies; 5+ messages in thread
From: Bo Shen @ 2013-08-11 14:15 UTC (permalink / raw)
To: u-boot
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
Signed-off-by: Bo Shen <voice.shen@gmail.com>
---
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(+)
diff --git a/include/environment.h b/include/environment.h
index 46a3554..52a7769 100644
--- a/include/environment.h
+++ b/include/environment.h
@@ -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 {
--
1.7.10.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [U-Boot] [RFC PATCH] env: add default env size for CONFIG_ENV_IS_NOWHERE
2013-08-11 14:15 [U-Boot] [RFC PATCH] env: add default env size for CONFIG_ENV_IS_NOWHERE Bo Shen
@ 2013-08-11 14:50 ` Wolfgang Denk
2013-08-12 13:07 ` Bo Shen
2013-08-12 13:39 ` Tom Rini
1 sibling, 1 reply; 5+ messages in thread
From: Wolfgang Denk @ 2013-08-11 14:50 UTC (permalink / raw)
To: u-boot
Dear Bo Shen,
In message <1376230503-25331-1-git-send-email-voice.shen@gmail.com> 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
--
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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [RFC PATCH] env: add default env size for CONFIG_ENV_IS_NOWHERE
2013-08-11 14:50 ` Wolfgang Denk
@ 2013-08-12 13:07 ` Bo Shen
2013-08-12 13:29 ` Wolfgang Denk
0 siblings, 1 reply; 5+ messages in thread
From: Bo Shen @ 2013-08-12 13:07 UTC (permalink / raw)
To: u-boot
Hi Wolfgang Denk,
On 8/11/2013 10:50 PM, Wolfgang Denk wrote:
> Dear Bo Shen,
>
> In message <1376230503-25331-1-git-send-email-voice.shen@gmail.com> 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).
> 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.
> Best regards,
>
> Wolfgang Denk
>
Best Regards,
Bo Shen
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [RFC PATCH] env: add default env size for CONFIG_ENV_IS_NOWHERE
2013-08-12 13:07 ` Bo Shen
@ 2013-08-12 13:29 ` Wolfgang Denk
0 siblings, 0 replies; 5+ messages in thread
From: Wolfgang Denk @ 2013-08-12 13:29 UTC (permalink / raw)
To: u-boot
Dear Bo Shen,
In message <5208DE04.1000405@gmail.com> 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.
> > 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
--
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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [RFC PATCH] env: add default env size for CONFIG_ENV_IS_NOWHERE
2013-08-11 14:15 [U-Boot] [RFC PATCH] env: add default env size for CONFIG_ENV_IS_NOWHERE Bo Shen
2013-08-11 14:50 ` Wolfgang Denk
@ 2013-08-12 13:39 ` Tom Rini
1 sibling, 0 replies; 5+ messages in thread
From: Tom Rini @ 2013-08-12 13:39 UTC (permalink / raw)
To: u-boot
On Sun, Aug 11, 2013 at 02:15:03PM +0000, Bo Shen 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
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.
--
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>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-08-12 13:39 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-11 14:15 [U-Boot] [RFC PATCH] env: add default env size for CONFIG_ENV_IS_NOWHERE Bo Shen
2013-08-11 14:50 ` Wolfgang Denk
2013-08-12 13:07 ` Bo Shen
2013-08-12 13:29 ` Wolfgang Denk
2013-08-12 13:39 ` Tom Rini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.