public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] nios2: trim CONFIG_SYS_MALLOC_LEN
@ 2015-11-04  5:30 Thomas Chou
  2015-11-04  5:30 ` [U-Boot] [PATCH 2/2] nios2: trim CONFIG_SYS_MEMTEST_END Thomas Chou
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Thomas Chou @ 2015-11-04  5:30 UTC (permalink / raw)
  To: u-boot

Trim CONFIG_SYS_MALLOC_LEN size, because CONFIG_ENV_SIZE
is included to total memory allocation in common.h,

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
---
 include/configs/nios2-generic.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/configs/nios2-generic.h b/include/configs/nios2-generic.h
index 6e426d6..9a01b22 100644
--- a/include/configs/nios2-generic.h
+++ b/include/configs/nios2-generic.h
@@ -82,7 +82,7 @@
 #define CONFIG_SYS_MONITOR_BASE	(CONFIG_SYS_SDRAM_BASE + \
 					 CONFIG_SYS_SDRAM_SIZE - \
 					 CONFIG_SYS_MONITOR_LEN)
-#define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + 0x20000)
+#define CONFIG_SYS_MALLOC_LEN		0x20000
 
 /*
  * MISC
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH 2/2] nios2: trim CONFIG_SYS_MEMTEST_END
  2015-11-04  5:30 [U-Boot] [PATCH 1/2] nios2: trim CONFIG_SYS_MALLOC_LEN Thomas Chou
@ 2015-11-04  5:30 ` Thomas Chou
  2015-11-04 14:27   ` Chin Liang See
  2015-11-06  1:30   ` Thomas Chou
  2015-11-04 14:22 ` [U-Boot] [PATCH 1/2] nios2: trim CONFIG_SYS_MALLOC_LEN Chin Liang See
  2015-11-06  1:30 ` Thomas Chou
  2 siblings, 2 replies; 8+ messages in thread
From: Thomas Chou @ 2015-11-04  5:30 UTC (permalink / raw)
  To: u-boot

Trim CONFIG_SYS_MEMTEST_END location.

CONFIG_SYS_MONITOR_LEN
  Reserving 256k for U-Boot at: d7fc0000
CONFIG_ENV_SIZE
CONFIG_SYS_MALLOC_LEN
  Reserving 256k for malloc() at: d7f80000
0x10000 for the rest
  Reserving 68 Bytes for Board Info at: d7f7ffbc
  Reserving 208 Bytes for Global Data at: d7f7feec
  Reserving 12000 Bytes for FDT at: d7f7d00c
  Stack

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
---
 include/configs/nios2-generic.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/configs/nios2-generic.h b/include/configs/nios2-generic.h
index 9a01b22..4569de8 100644
--- a/include/configs/nios2-generic.h
+++ b/include/configs/nios2-generic.h
@@ -96,7 +96,10 @@
 					 16)	/* Print buf size */
 #define CONFIG_SYS_LOAD_ADDR		CONFIG_SYS_SDRAM_BASE
 #define CONFIG_SYS_MEMTEST_START	CONFIG_SYS_SDRAM_BASE
-#define CONFIG_SYS_MEMTEST_END		(CONFIG_SYS_INIT_SP - 0x20000)
+#define CONFIG_SYS_MEMTEST_END		(CONFIG_SYS_MONITOR_BASE - \
+					 CONFIG_ENV_SIZE - \
+					 CONFIG_SYS_MALLOC_LEN -	\
+					 0x10000)
 #define CONFIG_CMDLINE_EDITING
 #define CONFIG_CMD_GPIO
 
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH 1/2] nios2: trim CONFIG_SYS_MALLOC_LEN
  2015-11-04  5:30 [U-Boot] [PATCH 1/2] nios2: trim CONFIG_SYS_MALLOC_LEN Thomas Chou
  2015-11-04  5:30 ` [U-Boot] [PATCH 2/2] nios2: trim CONFIG_SYS_MEMTEST_END Thomas Chou
@ 2015-11-04 14:22 ` Chin Liang See
  2015-11-06  1:30 ` Thomas Chou
  2 siblings, 0 replies; 8+ messages in thread
From: Chin Liang See @ 2015-11-04 14:22 UTC (permalink / raw)
  To: u-boot

On Wed, 2015-11-04 at 13:30 +0800, thomas at wytron.com.tw wrote:
> Trim CONFIG_SYS_MALLOC_LEN size, because CONFIG_ENV_SIZE
> is included to total memory allocation in common.h,
> 
> Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
> ---

Reviewed-by: Chin Liang See <clsee@altera.com>

Thanks
Chin Liang

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH 2/2] nios2: trim CONFIG_SYS_MEMTEST_END
  2015-11-04  5:30 ` [U-Boot] [PATCH 2/2] nios2: trim CONFIG_SYS_MEMTEST_END Thomas Chou
@ 2015-11-04 14:27   ` Chin Liang See
  2015-11-05  5:47     ` Thomas Chou
  2015-11-06  1:30   ` Thomas Chou
  1 sibling, 1 reply; 8+ messages in thread
From: Chin Liang See @ 2015-11-04 14:27 UTC (permalink / raw)
  To: u-boot

On Wed, 2015-11-04 at 13:30 +0800, thomas at wytron.com.tw wrote:
> Trim CONFIG_SYS_MEMTEST_END location.
> 
> CONFIG_SYS_MONITOR_LEN
>   Reserving 256k for U-Boot at: d7fc0000
> CONFIG_ENV_SIZE
> CONFIG_SYS_MALLOC_LEN
>   Reserving 256k for malloc() at: d7f80000
> 0x10000 for the rest
>   Reserving 68 Bytes for Board Info at: d7f7ffbc
>   Reserving 208 Bytes for Global Data at: d7f7feec
>   Reserving 12000 Bytes for FDT at: d7f7d00c
>   Stack
> 
> Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
> ---
>  include/configs/nios2-generic.h | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/include/configs/nios2-generic.h b/include/configs/nios2-generic.h
> index 9a01b22..4569de8 100644
> --- a/include/configs/nios2-generic.h
> +++ b/include/configs/nios2-generic.h
> @@ -96,7 +96,10 @@
>  					 16)	/* Print buf size */
>  #define CONFIG_SYS_LOAD_ADDR		CONFIG_SYS_SDRAM_BASE
>  #define CONFIG_SYS_MEMTEST_START	CONFIG_SYS_SDRAM_BASE
> -#define CONFIG_SYS_MEMTEST_END		(CONFIG_SYS_INIT_SP - 0x20000)
> +#define CONFIG_SYS_MEMTEST_END		(CONFIG_SYS_MONITOR_BASE - \
> +					 CONFIG_ENV_SIZE - \
> +					 CONFIG_SYS_MALLOC_LEN -	\

Since CONFIG_ENV_IS_IN_FLASH, I believe we can take out the
CONFIG_ENV_SIZE here.

Thanks
Chin Liang

> +					 0x10000)
>  #define CONFIG_CMDLINE_EDITING
>  #define CONFIG_CMD_GPIO
>  

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH 2/2] nios2: trim CONFIG_SYS_MEMTEST_END
  2015-11-04 14:27   ` Chin Liang See
@ 2015-11-05  5:47     ` Thomas Chou
  2015-11-09  6:37       ` Chin Liang See
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas Chou @ 2015-11-05  5:47 UTC (permalink / raw)
  To: u-boot

Hi Chin Liang,

On 2015?11?04? 22:27, Chin Liang See wrote:
>> +#define CONFIG_SYS_MEMTEST_END		(CONFIG_SYS_MONITOR_BASE - \
>> +					 CONFIG_ENV_SIZE - \
>> +					 CONFIG_SYS_MALLOC_LEN -	\
>
> Since CONFIG_ENV_IS_IN_FLASH, I believe we can take out the
> CONFIG_ENV_SIZE here.
>

This comes from a very old macro in common.h,

#if defined(CONFIG_ENV_IS_EMBEDDED)
#define TOTAL_MALLOC_LEN	CONFIG_SYS_MALLOC_LEN
#elif ( ((CONFIG_ENV_ADDR+CONFIG_ENV_SIZE) < CONFIG_SYS_MONITOR_BASE) || \
	(CONFIG_ENV_ADDR >= (CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN)) 
) || \
       defined(CONFIG_ENV_IS_IN_NVRAM)
#define	TOTAL_MALLOC_LEN	(CONFIG_SYS_MALLOC_LEN + CONFIG_ENV_SIZE)
#else
#define	TOTAL_MALLOC_LEN	CONFIG_SYS_MALLOC_LEN
#endif

The TOTAL_MALLOC_LEN is (CONFIG_SYS_MALLOC_LEN + CONFIG_ENV_SIZE) for 
nios2. I think the macro might need fix though.

Best regards,
Thomas

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH 1/2] nios2: trim CONFIG_SYS_MALLOC_LEN
  2015-11-04  5:30 [U-Boot] [PATCH 1/2] nios2: trim CONFIG_SYS_MALLOC_LEN Thomas Chou
  2015-11-04  5:30 ` [U-Boot] [PATCH 2/2] nios2: trim CONFIG_SYS_MEMTEST_END Thomas Chou
  2015-11-04 14:22 ` [U-Boot] [PATCH 1/2] nios2: trim CONFIG_SYS_MALLOC_LEN Chin Liang See
@ 2015-11-06  1:30 ` Thomas Chou
  2 siblings, 0 replies; 8+ messages in thread
From: Thomas Chou @ 2015-11-06  1:30 UTC (permalink / raw)
  To: u-boot



On 2015?11?04? 13:30, Thomas Chou wrote:
> Trim CONFIG_SYS_MALLOC_LEN size, because CONFIG_ENV_SIZE
> is included to total memory allocation in common.h,
>
> Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
> ---
>   include/configs/nios2-generic.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>

Applied to u-boot-nios.

> diff --git a/include/configs/nios2-generic.h b/include/configs/nios2-generic.h
> index 6e426d6..9a01b22 100644
> --- a/include/configs/nios2-generic.h
> +++ b/include/configs/nios2-generic.h
> @@ -82,7 +82,7 @@
>   #define CONFIG_SYS_MONITOR_BASE	(CONFIG_SYS_SDRAM_BASE + \
>   					 CONFIG_SYS_SDRAM_SIZE - \
>   					 CONFIG_SYS_MONITOR_LEN)
> -#define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + 0x20000)
> +#define CONFIG_SYS_MALLOC_LEN		0x20000
>
>   /*
>    * MISC
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH 2/2] nios2: trim CONFIG_SYS_MEMTEST_END
  2015-11-04  5:30 ` [U-Boot] [PATCH 2/2] nios2: trim CONFIG_SYS_MEMTEST_END Thomas Chou
  2015-11-04 14:27   ` Chin Liang See
@ 2015-11-06  1:30   ` Thomas Chou
  1 sibling, 0 replies; 8+ messages in thread
From: Thomas Chou @ 2015-11-06  1:30 UTC (permalink / raw)
  To: u-boot



On 2015?11?04? 13:30, Thomas Chou wrote:
> Trim CONFIG_SYS_MEMTEST_END location.
>
> CONFIG_SYS_MONITOR_LEN
>    Reserving 256k for U-Boot at: d7fc0000
> CONFIG_ENV_SIZE
> CONFIG_SYS_MALLOC_LEN
>    Reserving 256k for malloc() at: d7f80000
> 0x10000 for the rest
>    Reserving 68 Bytes for Board Info at: d7f7ffbc
>    Reserving 208 Bytes for Global Data at: d7f7feec
>    Reserving 12000 Bytes for FDT at: d7f7d00c
>    Stack
>
> Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
> ---
>   include/configs/nios2-generic.h | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
>

Applied to u-boot-nios.

> diff --git a/include/configs/nios2-generic.h b/include/configs/nios2-generic.h
> index 9a01b22..4569de8 100644
> --- a/include/configs/nios2-generic.h
> +++ b/include/configs/nios2-generic.h
> @@ -96,7 +96,10 @@
>   					 16)	/* Print buf size */
>   #define CONFIG_SYS_LOAD_ADDR		CONFIG_SYS_SDRAM_BASE
>   #define CONFIG_SYS_MEMTEST_START	CONFIG_SYS_SDRAM_BASE
> -#define CONFIG_SYS_MEMTEST_END		(CONFIG_SYS_INIT_SP - 0x20000)
> +#define CONFIG_SYS_MEMTEST_END		(CONFIG_SYS_MONITOR_BASE - \
> +					 CONFIG_ENV_SIZE - \
> +					 CONFIG_SYS_MALLOC_LEN -	\
> +					 0x10000)
>   #define CONFIG_CMDLINE_EDITING
>   #define CONFIG_CMD_GPIO
>
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH 2/2] nios2: trim CONFIG_SYS_MEMTEST_END
  2015-11-05  5:47     ` Thomas Chou
@ 2015-11-09  6:37       ` Chin Liang See
  0 siblings, 0 replies; 8+ messages in thread
From: Chin Liang See @ 2015-11-09  6:37 UTC (permalink / raw)
  To: u-boot

Hi Thomas,

On Thu, 2015-11-05 at 13:47 +0800, thomas at wytron.com.tw wrote:
> Hi Chin Liang,
> 
> On 2015?11?04? 22:27, Chin Liang See wrote:
> >> +#define CONFIG_SYS_MEMTEST_END		(CONFIG_SYS_MONITOR_BASE - \
> >> +					 CONFIG_ENV_SIZE - \
> >> +					 CONFIG_SYS_MALLOC_LEN -	\
> >
> > Since CONFIG_ENV_IS_IN_FLASH, I believe we can take out the
> > CONFIG_ENV_SIZE here.
> >
> 
> This comes from a very old macro in common.h,
> 
> #if defined(CONFIG_ENV_IS_EMBEDDED)
> #define TOTAL_MALLOC_LEN	CONFIG_SYS_MALLOC_LEN
> #elif ( ((CONFIG_ENV_ADDR+CONFIG_ENV_SIZE) < CONFIG_SYS_MONITOR_BASE) || \
> 	(CONFIG_ENV_ADDR >= (CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN)) 
> ) || \
>        defined(CONFIG_ENV_IS_IN_NVRAM)
> #define	TOTAL_MALLOC_LEN	(CONFIG_SYS_MALLOC_LEN + CONFIG_ENV_SIZE)
> #else
> #define	TOTAL_MALLOC_LEN	CONFIG_SYS_MALLOC_LEN
> #endif
> 
> The TOTAL_MALLOC_LEN is (CONFIG_SYS_MALLOC_LEN + CONFIG_ENV_SIZE) for 
> nios2. I think the macro might need fix though.

Yah. In that case, it should be ok CONFIG_ENV_SIZE is much small. The
memtest should sufficiently exercise the each memory lines. Thanks again
for the patch.


Reviewed-by: Chin Liang See <clsee@altera.com>

Thanks
Chin Liang


> 
> Best regards,
> Thomas

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-11-09  6:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-04  5:30 [U-Boot] [PATCH 1/2] nios2: trim CONFIG_SYS_MALLOC_LEN Thomas Chou
2015-11-04  5:30 ` [U-Boot] [PATCH 2/2] nios2: trim CONFIG_SYS_MEMTEST_END Thomas Chou
2015-11-04 14:27   ` Chin Liang See
2015-11-05  5:47     ` Thomas Chou
2015-11-09  6:37       ` Chin Liang See
2015-11-06  1:30   ` Thomas Chou
2015-11-04 14:22 ` [U-Boot] [PATCH 1/2] nios2: trim CONFIG_SYS_MALLOC_LEN Chin Liang See
2015-11-06  1:30 ` Thomas Chou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox