* [U-Boot] [PATCH 1/2] nios2: call board_init_f_mem
@ 2015-09-09 8:03 Thomas Chou
2015-09-09 8:03 ` [U-Boot] [PATCH 2/2] nios2: enable malloc() pool before relocation Thomas Chou
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Thomas Chou @ 2015-09-09 8:03 UTC (permalink / raw)
To: u-boot
We will need CONFIG_SYS_MALLOC_F_LEN to use serial uclass.
So we shall undefine CONFIG_SYS_GENERIC_GLOBAL_DATA, and
call board_init_f_mem() to allocates early malloc() memory
with size of CONFIG_SYS_MALLOC_F_LEN in board_f.c.
Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
---
arch/nios2/cpu/start.S | 10 ++++++++++
arch/nios2/include/asm/config.h | 2 --
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/arch/nios2/cpu/start.S b/arch/nios2/cpu/start.S
index 5c7074e..6c7c777 100644
--- a/arch/nios2/cpu/start.S
+++ b/arch/nios2/cpu/start.S
@@ -120,6 +120,16 @@ _reloc:
stw r0, 4(sp)
mov fp, sp
+ /* Allocate and zero GD, update SP */
+ mov r4, sp
+ movhi r2, %hi(board_init_f_mem at h)
+ ori r2, r2, %lo(board_init_f_mem at h)
+ callr r2
+
+ /* Update stack- and frame-pointers */
+ mov sp, r2
+ mov fp, sp
+
/*
* Call board_init_f -- never returns
*/
diff --git a/arch/nios2/include/asm/config.h b/arch/nios2/include/asm/config.h
index 9c13848..cd29734 100644
--- a/arch/nios2/include/asm/config.h
+++ b/arch/nios2/include/asm/config.h
@@ -7,6 +7,4 @@
#ifndef _ASM_CONFIG_H_
#define _ASM_CONFIG_H_
-#define CONFIG_SYS_GENERIC_GLOBAL_DATA
-
#endif
--
2.1.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH 2/2] nios2: enable malloc() pool before relocation
2015-09-09 8:03 [U-Boot] [PATCH 1/2] nios2: call board_init_f_mem Thomas Chou
@ 2015-09-09 8:03 ` Thomas Chou
2015-09-09 12:04 ` Marek Vasut
2015-09-15 8:57 ` Thomas Chou
2015-09-09 12:04 ` [U-Boot] [PATCH 1/2] nios2: call board_init_f_mem Marek Vasut
2015-09-15 8:56 ` Thomas Chou
2 siblings, 2 replies; 6+ messages in thread
From: Thomas Chou @ 2015-09-09 8:03 UTC (permalink / raw)
To: u-boot
Enable malloc() pool before relocation, because this is needed
to use serial uclass.
Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
---
configs/nios2-generic_defconfig | 1 -
1 file changed, 1 deletion(-)
diff --git a/configs/nios2-generic_defconfig b/configs/nios2-generic_defconfig
index 2acf45d..9c1bec5 100644
--- a/configs/nios2-generic_defconfig
+++ b/configs/nios2-generic_defconfig
@@ -1,5 +1,4 @@
CONFIG_NIOS2=y
-# CONFIG_SYS_MALLOC_F is not set
CONFIG_TARGET_NIOS2_GENERIC=y
CONFIG_DEFAULT_DEVICE_TREE="3c120_devboard"
CONFIG_HUSH_PARSER=y
--
2.1.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH 1/2] nios2: call board_init_f_mem
2015-09-09 8:03 [U-Boot] [PATCH 1/2] nios2: call board_init_f_mem Thomas Chou
2015-09-09 8:03 ` [U-Boot] [PATCH 2/2] nios2: enable malloc() pool before relocation Thomas Chou
@ 2015-09-09 12:04 ` Marek Vasut
2015-09-15 8:56 ` Thomas Chou
2 siblings, 0 replies; 6+ messages in thread
From: Marek Vasut @ 2015-09-09 12:04 UTC (permalink / raw)
To: u-boot
On Wednesday, September 09, 2015 at 10:03:24 AM, Thomas Chou wrote:
> We will need CONFIG_SYS_MALLOC_F_LEN to use serial uclass.
> So we shall undefine CONFIG_SYS_GENERIC_GLOBAL_DATA, and
> call board_init_f_mem() to allocates early malloc() memory
> with size of CONFIG_SYS_MALLOC_F_LEN in board_f.c.
>
> Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Marek Vasut <marex@denx.de>
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH 2/2] nios2: enable malloc() pool before relocation
2015-09-09 8:03 ` [U-Boot] [PATCH 2/2] nios2: enable malloc() pool before relocation Thomas Chou
@ 2015-09-09 12:04 ` Marek Vasut
2015-09-15 8:57 ` Thomas Chou
1 sibling, 0 replies; 6+ messages in thread
From: Marek Vasut @ 2015-09-09 12:04 UTC (permalink / raw)
To: u-boot
On Wednesday, September 09, 2015 at 10:03:25 AM, Thomas Chou wrote:
> Enable malloc() pool before relocation, because this is needed
> to use serial uclass.
>
> Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Marek Vasut <marex@denx.de>
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH 1/2] nios2: call board_init_f_mem
2015-09-09 8:03 [U-Boot] [PATCH 1/2] nios2: call board_init_f_mem Thomas Chou
2015-09-09 8:03 ` [U-Boot] [PATCH 2/2] nios2: enable malloc() pool before relocation Thomas Chou
2015-09-09 12:04 ` [U-Boot] [PATCH 1/2] nios2: call board_init_f_mem Marek Vasut
@ 2015-09-15 8:56 ` Thomas Chou
2 siblings, 0 replies; 6+ messages in thread
From: Thomas Chou @ 2015-09-15 8:56 UTC (permalink / raw)
To: u-boot
On 09/09/2015 04:03 PM, Thomas Chou wrote:
> We will need CONFIG_SYS_MALLOC_F_LEN to use serial uclass.
> So we shall undefine CONFIG_SYS_GENERIC_GLOBAL_DATA, and
> call board_init_f_mem() to allocates early malloc() memory
> with size of CONFIG_SYS_MALLOC_F_LEN in board_f.c.
>
> Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
> ---
> arch/nios2/cpu/start.S | 10 ++++++++++
> arch/nios2/include/asm/config.h | 2 --
> 2 files changed, 10 insertions(+), 2 deletions(-)
Applied to u-boot-nios.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH 2/2] nios2: enable malloc() pool before relocation
2015-09-09 8:03 ` [U-Boot] [PATCH 2/2] nios2: enable malloc() pool before relocation Thomas Chou
2015-09-09 12:04 ` Marek Vasut
@ 2015-09-15 8:57 ` Thomas Chou
1 sibling, 0 replies; 6+ messages in thread
From: Thomas Chou @ 2015-09-15 8:57 UTC (permalink / raw)
To: u-boot
On 09/09/2015 04:03 PM, Thomas Chou wrote:
> Enable malloc() pool before relocation, because this is needed
> to use serial uclass.
>
> Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
> ---
> configs/nios2-generic_defconfig | 1 -
> 1 file changed, 1 deletion(-)
>
Applied to u-boot-nios.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-09-15 8:57 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-09 8:03 [U-Boot] [PATCH 1/2] nios2: call board_init_f_mem Thomas Chou
2015-09-09 8:03 ` [U-Boot] [PATCH 2/2] nios2: enable malloc() pool before relocation Thomas Chou
2015-09-09 12:04 ` Marek Vasut
2015-09-15 8:57 ` Thomas Chou
2015-09-09 12:04 ` [U-Boot] [PATCH 1/2] nios2: call board_init_f_mem Marek Vasut
2015-09-15 8:56 ` Thomas Chou
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox