Skip to contentSkip to conversation

nios2: remove CONFIG_SYS_MALLOC_BASE macro

PATCH New Thomas Chou 3 participants 10 messages Nov 3, 2015 – Nov 6, 2015 NIOS2 architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 nios2: remove CONFIG_SYS_MALLOC_BASE macro

Remove CONFIG_SYS_MALLOC_BASE macro, as it is not used by the generic board.

---
 include/configs/nios2-generic.h | 2 --
 1 file changed, 2 deletions(-)
include/configs/nios2-generic.h +0 -2
index 84faa4c..74c715d 100644
@@ -84,8 +84,6 @@
 					 CONFIG_SYS_SDRAM_SIZE - \
 					 CONFIG_SYS_MONITOR_LEN)
 #define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + 0x20000)
-#define CONFIG_SYS_MALLOC_BASE		(CONFIG_SYS_MONITOR_BASE - \
-					 CONFIG_SYS_MALLOC_LEN)
 #define CONFIG_SYS_INIT_SP		CONFIG_SYS_MALLOC_BASE
 
 /*
Signature · 1 line
2.5.0
#1 lore raw

PATCH 1/3 nios2: remove CONFIG_SYS_MALLOC_BASE macro

Quoted 8 lines · Thomas Chou

Remove CONFIG_SYS_MALLOC_BASE macro, as it is not used by the generic board.

---
  include/configs/nios2-generic.h | 2 --
  1 file changed, 2 deletions(-)

Applied to u-boot-nios.

Quoted 14 lines
include/configs/nios2-generic.h +0 -2
index 84faa4c..74c715d 100644
@@ -84,8 +84,6 @@
  					 CONFIG_SYS_SDRAM_SIZE - \
  					 CONFIG_SYS_MONITOR_LEN)
  #define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + 0x20000)
-#define CONFIG_SYS_MALLOC_BASE		(CONFIG_SYS_MONITOR_BASE - \
-					 CONFIG_SYS_MALLOC_LEN)
  #define CONFIG_SYS_INIT_SP		CONFIG_SYS_MALLOC_BASE
 
  /*
#2 lore raw

PATCH 2/3 nios2: remove CONFIG_SYS_INIT_SP macro

In reply to Thomas Chou

Remove CONFIG_SYS_INIT_SP macro, as the initial stack is set to below the u-boot code.

---
 arch/nios2/cpu/start.S          | 3 +--
 include/configs/nios2-generic.h | 1 -
 2 files changed, 1 insertion(+), 3 deletions(-)
arch/nios2/cpu/start.S +1 -2
index 8758e7e..bb86bbf 100644
@@ -81,6 +81,7 @@ _cur:	movhi	r5, %hi(_cur - _start)
 	mov	r8, r4
 	movhi	r5, %hi(_start)
 	ori	r5, r5, %lo(_start)	/* r5 <- linked _start */
+	mov	sp, r5		/* initial stack below u-boot code */
 	beq	r4, r5, 3f
 
 	movhi	r6, %hi(CONFIG_SYS_MONITOR_LEN)
@@ -100,8 +101,6 @@ _cur:	movhi	r5, %hi(_cur - _start)
 _reloc:
 
 	/* STACK INIT -- zero top two words for call back chain. */
-	movhi	sp, %hi(CONFIG_SYS_INIT_SP)
-	ori	sp, sp, %lo(CONFIG_SYS_INIT_SP)
 	addi	sp, sp, -8
 	stw	r0, 0(sp)
 	stw	r0, 4(sp)
include/configs/nios2-generic.h +0 -1
index 74c715d..3a559f1 100644
@@ -84,7 +84,6 @@
 					 CONFIG_SYS_SDRAM_SIZE - \
 					 CONFIG_SYS_MONITOR_LEN)
 #define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + 0x20000)
-#define CONFIG_SYS_INIT_SP		CONFIG_SYS_MALLOC_BASE
 
 /*
  * MISC
Signature · 1 line
2.5.0
#5 lore raw

PATCH 2/3 nios2: remove CONFIG_SYS_INIT_SP macro

In reply to Thomas Chou
Quoted 9 lines · Thomas Chou

Remove CONFIG_SYS_INIT_SP macro, as the initial stack is set to below the u-boot code.

---
  arch/nios2/cpu/start.S          | 3 +--
  include/configs/nios2-generic.h | 1 -
  2 files changed, 1 insertion(+), 3 deletions(-)

Applied u-boot-nios.

Quoted 34 lines
arch/nios2/cpu/start.S +1 -2
index 8758e7e..bb86bbf 100644
@@ -81,6 +81,7 @@ _cur:	movhi	r5, %hi(_cur - _start)
  	mov	r8, r4
  	movhi	r5, %hi(_start)
  	ori	r5, r5, %lo(_start)	/* r5 <- linked _start */
+	mov	sp, r5		/* initial stack below u-boot code */
  	beq	r4, r5, 3f
 
  	movhi	r6, %hi(CONFIG_SYS_MONITOR_LEN)
@@ -100,8 +101,6 @@ _cur:	movhi	r5, %hi(_cur - _start)
  _reloc:
 
  	/* STACK INIT -- zero top two words for call back chain. */
-	movhi	sp, %hi(CONFIG_SYS_INIT_SP)
-	ori	sp, sp, %lo(CONFIG_SYS_INIT_SP)
  	addi	sp, sp, -8
  	stw	r0, 0(sp)
  	stw	r0, 4(sp)
include/configs/nios2-generic.h +0 -1
index 74c715d..3a559f1 100644
@@ -84,7 +84,6 @@
  					 CONFIG_SYS_SDRAM_SIZE - \
  					 CONFIG_SYS_MONITOR_LEN)
  #define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + 0x20000)
-#define CONFIG_SYS_INIT_SP		CONFIG_SYS_MALLOC_BASE
 
  /*
   * MISC
#7 lore raw

PATCH 3/3 nios2: fix cached mode in clearing the BSS

In reply to Thomas Chou

As the generic board runs in cached mode, it should not use "stwio" which bypass the cache.

---
 arch/nios2/cpu/start.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/nios2/cpu/start.S +1 -1
index bb86bbf..54787c5 100644
@@ -158,7 +158,7 @@ relocate_code:
 	ori	r6, r6, %lo(__bss_end)
 	beq	r5, r6, 5f
 
-4:	stwio	r0, 0(r5)
+4:	stw	r0, 0(r5)
 	addi	r5, r5, 4
 	bne	r5, r6, 4b
 5:
Signature · 1 line
2.5.0
#9 lore raw

PATCH 3/3 nios2: fix cached mode in clearing the BSS

In reply to Thomas Chou
Quoted 8 lines · Thomas Chou

As the generic board runs in cached mode, it should not use "stwio" which bypass the cache.

---
  arch/nios2/cpu/start.S | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

Applied to u-boot-nios.

Quoted 14 lines
arch/nios2/cpu/start.S +1 -1
index bb86bbf..54787c5 100644
@@ -158,7 +158,7 @@ relocate_code:
  	ori	r6, r6, %lo(__bss_end)
  	beq	r5, r6, 5f
 
-4:	stwio	r0, 0(r5)
+4:	stw	r0, 0(r5)
  	addi	r5, r5, 4
  	bne	r5, r6, 4b
  5: