Skip to contentSkip to conversation

RR v3 PATCH: SMDK6400 Fix some build bug

U-Boot Superseded seedshope 3 participants 15 messages Jan 13, 2011 – Jan 19, 2011

Subsystems (2)

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

seedshope

author
#0 lore raw

Change from V1:
patch 1:
patch 2: Delete some compile information from commit.
patch 3: Add LED modify information and Delete some compile information from commit. patch 4: Add new patch for SDRAM init.

Change frome v2:
patch2: Modify Makefile for arch/arm/cpu/arm1176/s3c64xx/cpu_init.s in build error. It will generat redefine information for "mem_ctrl_asm_init" before the Modify.
patch4: Modify the Sergei Shtylyov comments and change the SDRAM size variable for PHYS_SDRAM_SIZE_1.

I apply this patch and build ok.

author
#1 lore raw

PATCH v3 1/4 SMDK6400: Fix CONFIG_SYS_INIT_SP_ADDR undefined

Fix CONFIG_SYS_INIT_SP_ADDR undefined issue.

include/configs/smdk6400.h +5 -0
index 671f2c7..c9acf58 100644
@@ -44,6 +44,11 @@
 #define CONFIG_PERIPORT_BASE	0x70000000
 #define CONFIG_PERIPORT_SIZE	0x13
 
+#define CONFIG_SYS_IRAM_BASE    0x0c000000  /* Internal SRAM base address */
+#define CONFIG_SYS_IRAM_SIZE    0x2000      /* 8 KB of internal SRAM memory */
+#define CONFIG_SYS_IRAM_END     (CONFIG_SYS_IRAM_BASE + CONFIG_SYS_IRAM_SIZE)
+#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_IRAM_END - GENERATED_GBL_DATA_SIZE)
+
 #define CONFIG_SYS_SDRAM_BASE	0x50000000
 
 /* input clock of PLL: SMDK6400 has 12MHz input clock */
Signature · 1 line
1.7.1
author
#2 lore raw

PATCH v3 2/4 SMDK6400: Fix some label undefined in build error

In reply to seedshope

Modify Makefile for cpu_init.c and Start.s use some label,this defined u-boot.lds of arch/arm/cpu/arm1176. But SMDK6400 use the link script board/samsung/smdk6400/u-boot-nand.lds. So add some label form u-boot.lds to u-boot-nand.lds

arch/arm/cpu/arm1176/s3c64xx/Makefile +5 -2
index 0785b19..f4b9574 100644
@@ -30,12 +30,15 @@ LIB	= $(obj)lib$(SOC).o
 
 SOBJS	= reset.o
 
-COBJS-$(CONFIG_S3C6400)	+= cpu_init.o speed.o
+COBJS-$(CONFIG_S3C6400)	+= speed.o
 COBJS-y	+= timer.o
 
+CPUINIT	= cpu_init.o
+
 OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS-y))
+CPUINIT := $(addprefix $(obj),$(CPUINIT))
 
-all:	$(obj).depend $(START) $(LIB)
+all:	$(obj).depend $(START) $(LIB) $(CPUINIT)
 
 $(LIB):	$(OBJS)
 	$(call cmd_link_o_target, $(OBJS))
board/samsung/smdk6400/u-boot-nand.lds +25 -4
index 29a4f61..2b87fc6 100644
@@ -55,8 +55,29 @@ SECTIONS
 	. = ALIGN(4);
 	.mmudata : { *(.mmudata) }
 
-	. = ALIGN(4);
-	__bss_start = .;
-	.bss : { *(.bss) . = ALIGN(4); }
-	_end = .;
+        . = ALIGN(4);
+
+	.rel.dyn : {
+		__rel_dyn_start = .;
+		*(.rel*)
+		__rel_dyn_end = .;
+	}
+
+	.dynsym : {
+		__dynsym_start = .;
+		*(.dynsym)
+	}
+
+	.bss __rel_dyn_start (OVERLAY) : {
+		__bss_start = .;
+		*(.bss)
+		. = ALIGN(4);
+		_end = .;
+	}
+
+	/DISCARD/ : { *(.dynstr*) }
+	/DISCARD/ : { *(.dynamic*) }
+	/DISCARD/ : { *(.plt*) }
+	/DISCARD/ : { *(.interp*) }
+	/DISCARD/ : { *(.gnu*) }
 }
Signature · 1 line
1.7.1
#3 lore raw

PATCH v3 2/4 SMDK6400: Fix some label undefined in build error

Le 13/01/2011 14:36, seedshope a ?crit :

Quoted 19 lines

Modify Makefile for cpu_init.c and Start.s use some label,this defined u-boot.lds of arch/arm/cpu/arm1176. But SMDK6400 use the link script board/samsung/smdk6400/u-boot-nand.lds. So add some label form u-boot.lds to u-boot-nand.lds

arch/arm/cpu/arm1176/s3c64xx/Makefile +1 -1
index 0785b19..f4b9574 100644
@@ -30,12 +30,15 @@ LIB	= $(obj)lib$(SOC).o
 
  SOBJS	= reset.o
 
-COBJS-$(CONFIG_S3C6400)	+= cpu_init.o speed.o
+COBJS-$(CONFIG_S3C6400)	+= speed.o
  COBJS-y	+= timer.o
 

arch/arm/cpu/arm1176/s3c64xx/Makefile LIB = $(obj)lib$(SOC).o · line 44

Quoted 10 lines
arch/arm/cpu/arm1176/s3c64xx/Makefile +4 -1
+CPUINIT	= cpu_init.o
+
  OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS-y))
+CPUINIT := $(addprefix $(obj),$(CPUINIT))
 
-all:	$(obj).depend $(START) $(LIB)
+all:	$(obj).depend $(START) $(LIB) $(CPUINIT)
 
  $(LIB):	$(OBJS)
  	$(call cmd_link_o_target, $(OBJS))

Not sure I get what's the problem and how exactly this changes solves it. Can you detail this particular issue?

Amicalement,

Signature · 1 line
Albert.
author
#4 lore raw

PATCH v3 2/4 SMDK6400: Fix some label undefined in build error

Quoted 27 lines · Albert ARIBAUD

Le 13/01/2011 14:36, seedshope a ?crit :

Quoted 26 lines

Modify Makefile for cpu_init.c and Start.s use some label,this defined u-boot.lds of arch/arm/cpu/arm1176. But SMDK6400 use the link script board/samsung/smdk6400/u-boot-nand.lds. So add some label form u-boot.lds
to u-boot-nand.lds

arch/arm/cpu/arm1176/s3c64xx/Makefile +4 -1
index 0785b19..f4b9574 100644
@@ -30,12 +30,15 @@ LIB    = $(obj)lib$(SOC).o
 
  SOBJS    = reset.o
 
-COBJS-$(CONFIG_S3C6400)    += cpu_init.o speed.o
+COBJS-$(CONFIG_S3C6400)    += speed.o
  COBJS-y    += timer.o
 
+CPUINIT    = cpu_init.o
+
  OBJS    := $(addprefix $(obj),$(SOBJS) $(COBJS-y))
+CPUINIT := $(addprefix $(obj),$(CPUINIT))
 
Quoted 8 lines

arch/arm/cpu/arm1176/s3c64xx/Makefile LIB = $(obj)lib$(SOC).o · line 44

Quoted 5 lines
arch/arm/cpu/arm1176/s3c64xx/Makefile +1 -1
-all:    $(obj).depend $(START) $(LIB)
+all:    $(obj).depend $(START) $(LIB) $(CPUINIT)
 
  $(LIB):    $(OBJS)
      $(call cmd_link_o_target, $(OBJS))

Not sure I get what's the problem and how exactly this changes solves it. Can you detail this particular issue?

The issue is mem_ctrl_asm_init redefine in
arch/arm/cpu/arm1176/s3c64xx/cpu_init.s.

At first, the link script file include cpu_init.s in board/samsung/smd6400/u-boot-nand.s, If I separate the cpu_init.o from COBJS-$(CONFIG_S3C6400), I guess cmd_link_o_target will deal with cpu_init.o. So the link script will double link the cpu_init file.

I have two method to solve it.
first: see the patch
second: Modify the link script

But I feel, the first method is safe.

I asked a question. I will RR on next, The patch1 and patch3 have already ok, Do I only send patch2 and patch4?

Quoted 2 lines

Amicalement,

author
#5 lore raw

PATCH v3 2/4 SMDK6400: Fix some label undefined in build error

Quoted 28 lines · seedshope
Quoted 27 lines · Albert ARIBAUD

Le 13/01/2011 14:36, seedshope a ?crit :

Quoted 26 lines

Modify Makefile for cpu_init.c and Start.s use some label,this defined u-boot.lds of arch/arm/cpu/arm1176. But SMDK6400 use the link script board/samsung/smdk6400/u-boot-nand.lds. So add some label form u-boot.lds
to u-boot-nand.lds

arch/arm/cpu/arm1176/s3c64xx/Makefile +4 -1
index 0785b19..f4b9574 100644
@@ -30,12 +30,15 @@ LIB    = $(obj)lib$(SOC).o
 
  SOBJS    = reset.o
 
-COBJS-$(CONFIG_S3C6400)    += cpu_init.o speed.o
+COBJS-$(CONFIG_S3C6400)    += speed.o
  COBJS-y    += timer.o
 
+CPUINIT    = cpu_init.o
+
  OBJS    := $(addprefix $(obj),$(SOBJS) $(COBJS-y))
+CPUINIT := $(addprefix $(obj),$(CPUINIT))
 
Quoted 8 lines
Quoted 8 lines

arch/arm/cpu/arm1176/s3c64xx/Makefile LIB = $(obj)lib$(SOC).o · line 44

Quoted 5 lines
arch/arm/cpu/arm1176/s3c64xx/Makefile +1 -1
-all:    $(obj).depend $(START) $(LIB)
+all:    $(obj).depend $(START) $(LIB) $(CPUINIT)
 
  $(LIB):    $(OBJS)
      $(call cmd_link_o_target, $(OBJS))

Not sure I get what's the problem and how exactly this changes solves it. Can you detail this particular issue?

The part of u-boot-nand.lds as following:

         . = ALIGN(4);
         .text      :
         {
           arch/arm/cpu/arm1176/start.o  (.text)
           arch/arm/cpu/arm1176/s3c64xx/cpu_init.o       (.text)
           *(.text)
         }

I reference start.s to get the patch.;-)

Thanks,
seedshope

Quoted 19 lines

The issue is mem_ctrl_asm_init redefine in
arch/arm/cpu/arm1176/s3c64xx/cpu_init.s.

At first, the link script file include cpu_init.s in board/samsung/smd6400/u-boot-nand.s, If I separate the cpu_init.o from COBJS-$(CONFIG_S3C6400), I guess cmd_link_o_target will deal with cpu_init.o. So the link script will double link the cpu_init file.

I have two method to solve it.
first: see the patch
second: Modify the link script

But I feel, the first method is safe.

I asked a question. I will RR on next, The patch1 and patch3 have already ok, Do I only send patch2 and patch4?

Quoted 2 lines

Amicalement,

#6 lore raw

PATCH v3 2/4 SMDK6400: Fix some label undefined in build error

In reply to seedshope

Hi seedshope,

Le 14/01/2011 16:45, seedshope a ?crit :

Quoted 31 lines · Albert ARIBAUD
Quoted 30 lines

Le 13/01/2011 14:36, seedshope a ?crit :

Quoted 29 lines

Modify Makefile for cpu_init.c and Start.s use some label,this defined u-boot.lds of arch/arm/cpu/arm1176. But SMDK6400 use the link script board/samsung/smdk6400/u-boot-nand.lds. So add some label form u-boot.lds
to u-boot-nand.lds

arch/arm/cpu/arm1176/s3c64xx/Makefile +0 -0
index 0785b19..f4b9574 100644
@@ -30,12 +30,15 @@ LIB = $(obj)lib$(SOC).o
 

SOBJS = reset.o

arch/arm/cpu/arm1176/s3c64xx/Makefile +1 -1
-COBJS-$(CONFIG_S3C6400) += cpu_init.o speed.o
+COBJS-$(CONFIG_S3C6400) += speed.o

COBJS-y += timer.o

arch/arm/cpu/arm1176/s3c64xx/Makefile +2 -0
+CPUINIT = cpu_init.o
+

OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS-y))

arch/arm/cpu/arm1176/s3c64xx/Makefile +2 -1
+CPUINIT := $(addprefix $(obj),$(CPUINIT))
 
-all: $(obj).depend $(START) $(LIB)
+all: $(obj).depend $(START) $(LIB) $(CPUINIT)
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

$(LIB): $(OBJS)
$(call cmd_link_o_target, $(OBJS))

Not sure I get what's the problem and how exactly this changes solves it. Can you detail this particular issue?

The issue is mem_ctrl_asm_init redefine in
arch/arm/cpu/arm1176/s3c64xx/cpu_init.s.

From what follows it seems the problem is rather cpu_init.o being
linked in twice. Correct?

Quoted 4 lines

At first, the link script file include cpu_init.s in board/samsung/smd6400/u-boot-nand.s, If I separate the cpu_init.o from COBJS-$(CONFIG_S3C6400), I guess cmd_link_o_target will deal with cpu_init.o. So the link script will double link the cpu_init file.

Then you should fix the double linking by i) determining why the double linking happens and ii) properly linking once only.

Quoted 5 lines

I have two method to solve it.
first: see the patch
second: Modify the link script

But I feel, the first method is safe.

It may be safe, but IIUC it does not properly address the issue and its root cause.

Quoted 2 lines

I asked a question. I will RR on next, The patch1 and patch3 have already ok, Do I only send patch2 and patch4?

My personal practice is to re-send the whole patchset for each new version, because i) people can easily see the whole of the changes without having to go pick parts of previous versions and ii) it makes clear when a patch is removed or added to the set.

Quoted 1 line
Quoted 1 line

Amicalement,

Amicalement,

Signature · 1 line
Albert.
author
#7 lore raw

PATCH v3 2/4 SMDK6400: Fix some label undefined in build error

Quoted 39 lines · Albert ARIBAUD

Hi seedshope,

Le 14/01/2011 16:45, seedshope a ?crit :

Quoted 36 lines · Albert ARIBAUD
Quoted 35 lines

Le 13/01/2011 14:36, seedshope a ?crit :

Quoted 29 lines

Modify Makefile for cpu_init.c and Start.s use some label,this defined u-boot.lds of arch/arm/cpu/arm1176. But SMDK6400 use the link script board/samsung/smdk6400/u-boot-nand.lds. So add some label form u-boot.lds
to u-boot-nand.lds

arch/arm/cpu/arm1176/s3c64xx/Makefile +0 -0
index 0785b19..f4b9574 100644
@@ -30,12 +30,15 @@ LIB = $(obj)lib$(SOC).o
 

SOBJS = reset.o

arch/arm/cpu/arm1176/s3c64xx/Makefile +1 -1
-COBJS-$(CONFIG_S3C6400) += cpu_init.o speed.o
+COBJS-$(CONFIG_S3C6400) += speed.o

COBJS-y += timer.o

arch/arm/cpu/arm1176/s3c64xx/Makefile +2 -0
+CPUINIT = cpu_init.o
+

OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS-y))

arch/arm/cpu/arm1176/s3c64xx/Makefile +2 -1
+CPUINIT := $(addprefix $(obj),$(CPUINIT))
 
-all: $(obj).depend $(START) $(LIB)
+all: $(obj).depend $(START) $(LIB) $(CPUINIT)
Quoted 2 lines

$(LIB): $(OBJS)
$(call cmd_link_o_target, $(OBJS))

Not sure I get what's the problem and how exactly this changes solves it. Can you detail this particular issue?

Quoted 5 lines
Quoted 2 lines

The issue is mem_ctrl_asm_init redefine in
arch/arm/cpu/arm1176/s3c64xx/cpu_init.s.

From what follows it seems the problem is rather cpu_init.o being linked in twice. Correct?

maybe

Quoted 8 lines
Quoted 5 lines

At first, the link script file include cpu_init.s in board/samsung/smd6400/u-boot-nand.s, If I separate the cpu_init.o from COBJS-$(CONFIG_S3C6400), I guess cmd_link_o_target will deal with cpu_init.o. So the link script will double link the cpu_init file.

Then you should fix the double linking by i) determining why the double linking happens and ii) properly linking once only.

Hi Alvert ARIBAUD,

I see the code for smdk6400. I found this code is very old. Before It can not add cmd_link_o_target in Makefile(arch/arm/cpu/arm1176/s3c64xx/Makefile), The file will only to compile. So the link script is ok.

But, Now, It is not. As far as I know, The linker script can do to link the first specified file for user.
Since I do not full understand the cmd_link_o_target mechanism. So I only guess the command do
some link work.

Maybe I am correct.

Quoted 9 lines
Quoted 6 lines

I have two method to solve it.
first: see the patch
second: Modify the link script

But I feel, the first method is safe.

It may be safe, but IIUC it does not properly address the issue and its root cause.

yes

Quoted 8 lines
Quoted 3 lines

I asked a question. I will RR on next, The patch1 and patch3 have already ok, Do I only send patch2 and patch4?

My personal practice is to re-send the whole patchset for each new version, because i) people can easily see the whole of the changes without having to go pick parts of previous versions and ii) it makes clear when a patch is removed or added to the set.

ok

Thanks,
seedshope

Quoted 4 lines
Quoted 2 lines
Quoted 2 lines

Amicalement,

Amicalement,

#8 lore raw

PATCH v3 2/4 SMDK6400: Fix some label undefined in build error

Le 14/01/2011 17:56, seedshope a ?crit :

Quoted 61 lines · Albert ARIBAUD
Quoted 39 lines

Hi seedshope,

Le 14/01/2011 16:45, seedshope a ?crit :

Quoted 36 lines · Albert ARIBAUD
Quoted 35 lines

Le 13/01/2011 14:36, seedshope a ?crit :

Quoted 29 lines

Modify Makefile for cpu_init.c and Start.s use some label,this defined u-boot.lds of arch/arm/cpu/arm1176. But SMDK6400 use the link script board/samsung/smdk6400/u-boot-nand.lds. So add some label form u-boot.lds
to u-boot-nand.lds

arch/arm/cpu/arm1176/s3c64xx/Makefile +0 -0
index 0785b19..f4b9574 100644
@@ -30,12 +30,15 @@ LIB = $(obj)lib$(SOC).o
 

SOBJS = reset.o

arch/arm/cpu/arm1176/s3c64xx/Makefile +1 -1
-COBJS-$(CONFIG_S3C6400) += cpu_init.o speed.o
+COBJS-$(CONFIG_S3C6400) += speed.o

COBJS-y += timer.o

arch/arm/cpu/arm1176/s3c64xx/Makefile +2 -0
+CPUINIT = cpu_init.o
+

OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS-y))

arch/arm/cpu/arm1176/s3c64xx/Makefile +2 -1
+CPUINIT := $(addprefix $(obj),$(CPUINIT))
 
-all: $(obj).depend $(START) $(LIB)
+all: $(obj).depend $(START) $(LIB) $(CPUINIT)
Quoted 2 lines

$(LIB): $(OBJS)
$(call cmd_link_o_target, $(OBJS))

Not sure I get what's the problem and how exactly this changes solves it. Can you detail this particular issue?

Quoted 5 lines
Quoted 2 lines

The issue is mem_ctrl_asm_init redefine in
arch/arm/cpu/arm1176/s3c64xx/cpu_init.s.

From what follows it seems the problem is rather cpu_init.o being linked in twice. Correct?

maybe

Quoted 8 lines
Quoted 5 lines

At first, the link script file include cpu_init.s in board/samsung/smd6400/u-boot-nand.s, If I separate the cpu_init.o from COBJS-$(CONFIG_S3C6400), I guess cmd_link_o_target will deal with cpu_init.o. So the link script will double link the cpu_init file.

Then you should fix the double linking by i) determining why the double linking happens and ii) properly linking once only.

Hi Alvert ARIBAUD,

I see the code for smdk6400. I found this code is very old. Before It can not add cmd_link_o_target in Makefile(arch/arm/cpu/arm1176/s3c64xx/Makefile), The file will only to compile. So the link script is ok.

Quoted 7 lines

But, Now, It is not. As far as I know, The linker script can do to link the first specified file for user.
Since I do not full understand the cmd_link_o_target mechanism. So I only guess the command do
some link work.

Maybe I am correct.

I don't want to accept this change on the off chance that it might be correct; before your next patch submission, please try building your code without this specific patch and positively find why the build fails.

Amicalement,

Signature · 1 line
Albert.
author
#9 lore raw

PATCH v3 2/4 SMDK6400: Fix some label undefined in build error

Quoted 69 lines · Albert ARIBAUD

Le 14/01/2011 17:56, seedshope a ?crit :

Quoted 68 lines · Albert ARIBAUD
Quoted 40 lines

Hi seedshope,

Le 14/01/2011 16:45, seedshope a ?crit :

Quoted 37 lines · Albert ARIBAUD
Quoted 36 lines

Le 13/01/2011 14:36, seedshope a ?crit :

Quoted 30 lines

Modify Makefile for cpu_init.c and Start.s use some label,this defined
u-boot.lds of arch/arm/cpu/arm1176. But SMDK6400 use the link script board/samsung/smdk6400/u-boot-nand.lds. So add some label form u-boot.lds
to u-boot-nand.lds

arch/arm/cpu/arm1176/s3c64xx/Makefile +0 -0
index 0785b19..f4b9574 100644
@@ -30,12 +30,15 @@ LIB = $(obj)lib$(SOC).o
 

SOBJS = reset.o

arch/arm/cpu/arm1176/s3c64xx/Makefile +1 -1
-COBJS-$(CONFIG_S3C6400) += cpu_init.o speed.o
+COBJS-$(CONFIG_S3C6400) += speed.o

COBJS-y += timer.o

arch/arm/cpu/arm1176/s3c64xx/Makefile +2 -0
+CPUINIT = cpu_init.o
+

OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS-y))

arch/arm/cpu/arm1176/s3c64xx/Makefile +2 -1
+CPUINIT := $(addprefix $(obj),$(CPUINIT))
 
-all: $(obj).depend $(START) $(LIB)
+all: $(obj).depend $(START) $(LIB) $(CPUINIT)
Quoted 2 lines

$(LIB): $(OBJS)
$(call cmd_link_o_target, $(OBJS))

Not sure I get what's the problem and how exactly this changes solves it. Can you detail this particular issue?

Quoted 5 lines
Quoted 2 lines

The issue is mem_ctrl_asm_init redefine in
arch/arm/cpu/arm1176/s3c64xx/cpu_init.s.

From what follows it seems the problem is rather cpu_init.o being linked in twice. Correct?

maybe

Quoted 8 lines
Quoted 5 lines

At first, the link script file include cpu_init.s in board/samsung/smd6400/u-boot-nand.s, If I separate the cpu_init.o from COBJS-$(CONFIG_S3C6400), I guess cmd_link_o_target will deal with cpu_init.o. So the link script will double link the cpu_init file.

Then you should fix the double linking by i) determining why the double linking happens and ii) properly linking once only.

Hi Alvert ARIBAUD,

I see the code for smdk6400. I found this code is very old. Before It can not add cmd_link_o_target in Makefile(arch/arm/cpu/arm1176/s3c64xx/Makefile), The file will only to compile. So the link script is ok.

But, Now, It is not. As far as I know, The linker script can do to link the first specified file for user.
Since I do not full understand the cmd_link_o_target mechanism. So I only guess the command do
some link work.

Quoted 5 lines
Quoted 1 line

Maybe I am correct.

I don't want to accept this change on the off chance that it might be correct; before your next patch submission, please try building your code without this specific patch and positively find why the build fails.

ok,

Thanks
seedshope

Quoted 2 lines

Amicalement,

author
#10 lore raw

PATCH v3 2/4 SMDK6400: Fix some label undefined in build error

In reply to Albert ARIBAUD
Quoted 69 lines · Albert ARIBAUD

Le 14/01/2011 17:56, seedshope a ?crit :

Quoted 68 lines · Albert ARIBAUD
Quoted 40 lines

Hi seedshope,

Le 14/01/2011 16:45, seedshope a ?crit :

Quoted 37 lines · Albert ARIBAUD
Quoted 36 lines

Le 13/01/2011 14:36, seedshope a ?crit :

Quoted 30 lines

Modify Makefile for cpu_init.c and Start.s use some label,this defined
u-boot.lds of arch/arm/cpu/arm1176. But SMDK6400 use the link script board/samsung/smdk6400/u-boot-nand.lds. So add some label form u-boot.lds
to u-boot-nand.lds

arch/arm/cpu/arm1176/s3c64xx/Makefile +0 -0
index 0785b19..f4b9574 100644
@@ -30,12 +30,15 @@ LIB = $(obj)lib$(SOC).o
 

SOBJS = reset.o

arch/arm/cpu/arm1176/s3c64xx/Makefile +1 -1
-COBJS-$(CONFIG_S3C6400) += cpu_init.o speed.o
+COBJS-$(CONFIG_S3C6400) += speed.o

COBJS-y += timer.o

arch/arm/cpu/arm1176/s3c64xx/Makefile +2 -0
+CPUINIT = cpu_init.o
+

OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS-y))

arch/arm/cpu/arm1176/s3c64xx/Makefile +2 -1
+CPUINIT := $(addprefix $(obj),$(CPUINIT))
 
-all: $(obj).depend $(START) $(LIB)
+all: $(obj).depend $(START) $(LIB) $(CPUINIT)
Quoted 2 lines

$(LIB): $(OBJS)
$(call cmd_link_o_target, $(OBJS))

Not sure I get what's the problem and how exactly this changes solves it. Can you detail this particular issue?

Quoted 5 lines
Quoted 2 lines

The issue is mem_ctrl_asm_init redefine in
arch/arm/cpu/arm1176/s3c64xx/cpu_init.s.

From what follows it seems the problem is rather cpu_init.o being linked in twice. Correct?

maybe

Quoted 8 lines
Quoted 5 lines

At first, the link script file include cpu_init.s in board/samsung/smd6400/u-boot-nand.s, If I separate the cpu_init.o from COBJS-$(CONFIG_S3C6400), I guess cmd_link_o_target will deal with cpu_init.o. So the link script will double link the cpu_init file.

Then you should fix the double linking by i) determining why the double linking happens and ii) properly linking once only.

Hi Alvert ARIBAUD,

I see the code for smdk6400. I found this code is very old. Before It can not add cmd_link_o_target in Makefile(arch/arm/cpu/arm1176/s3c64xx/Makefile), The file will only to compile. So the link script is ok.

But, Now, It is not. As far as I know, The linker script can do to link the first specified file for user.
Since I do not full understand the cmd_link_o_target mechanism. So I only guess the command do
some link work.

Quoted 5 lines
Quoted 1 line

Maybe I am correct.

I don't want to accept this change on the off chance that it might be correct; before your next patch submission, please try building your code without this specific patch and positively find why the build fails.

Hi Amicalement

I trace the issue, I find cmd_link_o_target will link the cpu_init.o file. If I add the file to u-boot-nand.lds file, The file will be link twice.

Now, It is good method to delete the file in u-boot-nand.s. Why? Before I think Nand Booting for the 4kb, If you don't link the file to the first 4kB, the system
will be generate error. Because the mem initialization function will can't find.

But , Now , The nand booting will be generate in nand_spl, the generate u-boot img is limit for 4KB,
So this is ok.

Do you think about?

Thanks,
seedshope

Quoted 2 lines

Amicalement,

author
#11 lore raw

PATCH v3 3/4 SMDK6400: Fix build error for nand_spl support

In reply to seedshope

Add some relocation symbols to u-boot.lds and disable LED functions in start.s to support nand_spl.

arch/arm/cpu/arm1176/start.S +2 -0
index 237dcfe..ae3706a 100644
@@ -354,9 +354,11 @@ clbss_l:str	r2, [r0]		/* clear loop...		    */
 	cmp	r0, r1
 	bne	clbss_l
 
+#ifndef CONFIG_NAND_SPL
 	bl coloured_LED_init
 	bl red_LED_on
 #endif
+#endif
 
 /*
  * We are done. Do not return, instead branch to second part of board
nand_spl/board/samsung/smdk6400/u-boot.lds +16 -1
index 3ac6aa1..30b1573 100644
@@ -55,7 +55,22 @@ SECTIONS
 	__u_boot_cmd_end = .;
 
 	. = ALIGN(4);
+
+	.rel.dyn : {
+	__rel_dyn_start = .;
+	*(.rel*)
+	__rel_dyn_end = .;
+	}
+
+	.dynsym : {
+	__dynsym_start = .;
+	*(.dynsym)
+	}
+
+	.bss __rel_dyn_start (OVERLAY) : {
 	__bss_start = .;
-	.bss : { *(.bss) . = ALIGN(4); }
+	*(.bss)
+	. = ALIGN(4);
 	_end = .;
+	}
 }
Signature · 1 line
1.7.1
author
#12 lore raw

PATCH v3 4/4 SMDK6400: Fix SMDK6400 SDRAM init

In reply to seedshope

Since SDRAM init function have already change, So the SDRAM initial function must be change.

board/samsung/smdk6400/smdk6400.c +9 -1
index 35aa40b..043d553 100644
@@ -78,10 +78,18 @@ int board_init(void)
 	return 0;
 }
 
-int dram_init(void)
+void dram_init_banksize(void)
 {
+	DECLARE_GLOBAL_DATA_PTR;
+
 	gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
 	gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
+}
+
+int dram_init(void)
+{
+	gd->ram_size = get_ram_size((long *)CONFIG_SYS_SDRAM_BASE, \
+			PHYS_SDRAM_1_SIZE);
 
 	return 0;
 }
Signature · 1 line
1.7.1
#13 lore raw

PATCH v3 4/4 SMDK6400: Fix SMDK6400 SDRAM init

Dear seedshope,

Quoted 10 lines · seedshope

Since SDRAM init function have already change, So the SDRAM initial function must be change.

board/samsung/smdk6400/smdk6400.c +0 -0
index 35aa40b..043d553 100644

board/samsung/smdk6400/smdk6400.c int board_init(void) · line 83

Quoted 7 lines
board/samsung/smdk6400/smdk6400.c +2 -1
@@ -78,10 +78,18 @@ int board_init(void)
 ? ? ? ?return 0;
 ?}
 
-int dram_init(void)
+void dram_init_banksize(void)
 ?{
+ ? ? ? DECLARE_GLOBAL_DATA_PTR;

Please move it to out of function.

board/samsung/smdk6400/smdk6400.c int board_init(void)

Quoted 8 lines
board/samsung/smdk6400/smdk6400.c +6 -0
+
 ? ? ? ?gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
 ? ? ? ?gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
+}
+
+int dram_init(void)
+{
+ ? ? ? gd->ram_size = get_ram_size((long *)CONFIG_SYS_SDRAM_BASE, \

Please remove "\".

Quoted 8 lines
board/samsung/smdk6400/smdk6400.c +1 -1
+ ? ? ? ? ? ? ? ? ? ? ? PHYS_SDRAM_1_SIZE);
 
 ? ? ? ?return 0;
 ?}
--

1.7.1

Thanks
Minkyu Kang

Signature · 2 lines
from. prom.
www.promsoft.net
author
#14 lore raw

PATCH v3 4/4 SMDK6400: Fix SMDK6400 SDRAM init

Quoted 16 lines · Minkyu Kang

Dear seedshope,

Quoted 13 lines · seedshope

Since SDRAM init function have already change, So the SDRAM initial function must be change.

board/samsung/smdk6400/smdk6400.c +0 -0
index 35aa40b..043d553 100644
@@ -78,10 +78,18 @@ int board_init(void)
        return 0;
  }
 
Quoted 5 lines

board/samsung/smdk6400/smdk6400.c int board_init(void) · line 83

Quoted 4 lines
board/samsung/smdk6400/smdk6400.c +2 -1
-int dram_init(void)
+void dram_init_banksize(void)
  {
+       DECLARE_GLOBAL_DATA_PTR;

Please move it to out of function.

I am sorry, DECLARE_GLOBAL_DATA_PTR have already defind in the head of the file,
I will drop this declare.

Quoted 10 lines

board/samsung/smdk6400/smdk6400.c int board_init(void) · line 91

Quoted 8 lines
board/samsung/smdk6400/smdk6400.c +6 -0
+
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
+}
+
+int dram_init(void)
+{
+       gd->ram_size = get_ram_size((long *)CONFIG_SYS_SDRAM_BASE, \

Please remove "\".

ok

Thanks,
seedshope

Quoted 10 lines
Quoted 8 lines
board/samsung/smdk6400/smdk6400.c +1 -1
+                       PHYS_SDRAM_1_SIZE);
 
        return 0;
  }
--

1.7.1

Thanks
Minkyu Kang