Skip to contentSkip to conversation

M28: Cleanup memsize.o OOT build

PATCH Superseded Marek Vasut 2 participants 5 messages Dec 8, 2011 – Dec 9, 2011 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 M28: Cleanup memsize.o OOT build

Cc Wolfgang Denk <[email protected]>
Cc Detlev Zundel <[email protected]>
Cc Stefano Babic <[email protected]>
---
 arch/arm/cpu/arm926ejs/mx28/Makefile       |    7 +------
 arch/arm/cpu/arm926ejs/mx28/spl_boot.c     |   13 ++-----------
 arch/arm/cpu/arm926ejs/mx28/u-boot-spl.lds |   12 ++++++------
 include/configs/m28evk.h                   |    2 ++
 4 files changed, 11 insertions(+), 23 deletions(-)
arch/arm/cpu/arm926ejs/mx28/Makefile +1 -6
index 372de8a..a2e3f77 100644
@@ -28,7 +28,7 @@ LIB	= $(obj)lib$(SOC).o
 COBJS	= clock.o mx28.o iomux.o timer.o
 
 ifdef	CONFIG_SPL_BUILD
-COBJS	+= memsize.o spl_boot.o spl_mem_init.o spl_power_init.o
+COBJS	+= spl_boot.o spl_mem_init.o spl_power_init.o
 endif
 
 SRCS	:= $(START:.o=.S) $(COBJS:.o=.c)
@@ -40,11 +40,6 @@ all:	$(obj).depend $(LIB)
 $(LIB):	$(OBJS)
 	$(call cmd_link_o_target, $(OBJS))
 
-ifdef	CONFIG_SPL_BUILD
-memsize.c:
-	ln -sf $(TOPDIR)/common/memsize.c $@
-endif
-
 #########################################################################
 
 # defines $(obj).depend target
arch/arm/cpu/arm926ejs/mx28/spl_boot.c +2 -11
index 3cd4c24..dfb8309 100644
@@ -68,17 +68,8 @@ inline void board_init_r(gd_t *id, ulong dest_addr)
 		;
 }
 
-inline int printf(const char *fmt, ...)
-{
-	return 0;
-}
-
-inline void __coloured_LED_init(void) {}
-inline void __red_LED_on(void) {}
-void coloured_LED_init(void)
-	__attribute__((weak, alias("__coloured_LED_init")));
-void red_LED_on(void)
-	__attribute__((weak, alias("__red_LED_on")));
+void serial_putc(const char c) {}
+void serial_puts(const char *s) {}
 void hang(void) __attribute__ ((noreturn));
 void hang(void)
 {
arch/arm/cpu/arm926ejs/mx28/u-boot-spl.lds +6 -6
index 893320f..0fccd52 100644
@@ -67,16 +67,16 @@ SECTIONS
 		*(.dynsym)
 	}
 
-	_end = .;
-
-	.bss __rel_dyn_start (OVERLAY) : {
+	.bss : {
+		. = ALIGN(4);
 		__bss_start = .;
-		*(.bss)
-		 . = ALIGN(4);
+		*(.bss*)
+		. = ALIGN(4);
 		__bss_end__ = .;
 	}
 
-	/DISCARD/ : { *(.bss*) }
+	_end = .;
+
 	/DISCARD/ : { *(.dynstr*) }
 	/DISCARD/ : { *(.dynsym*) }
 	/DISCARD/ : { *(.dynamic*) }
include/configs/m28evk.h +2 -0
index cdf7636..39c841f 100644
@@ -50,6 +50,8 @@
 #define	CONFIG_SPL_NO_CPU_SUPPORT_CODE
 #define	CONFIG_SPL_START_S_PATH		"arch/arm/cpu/arm926ejs/mx28"
 #define	CONFIG_SPL_LDSCRIPT	"arch/arm/cpu/arm926ejs/mx28/u-boot-spl.lds"
+#define	CONFIG_SPL_LIBCOMMON_SUPPORT
+#define	CONFIG_SPL_LIBGENERIC_SUPPORT
 
 /*
  * U-Boot Commands
Signature · 1 line
1.7.7.1
#1 lore raw

PATCH v2 1/1 M28: Cleanup memsize.o OOT build

The current way memsize.c is built just made a symlink into the directory with SPL and then compiled it like any other file there. This was bad as that broke the out-of-tree build.

The new way introduced in this patch uses the standard spl/Makefile methods (CONFIG_SPL_LIBCOMMON_SUPPORT / CONFIG_SPL_LIBGENERIC_SUPPORT) to let files in common/ be built. Because common/Makefile says memsize.c is always built (SPL and non-SPL build), this fixes our issue with memsize.c out-of-tree build.

Cc Wolfgang Denk <[email protected]>
Cc Detlev Zundel <[email protected]>
Cc Stefano Babic <[email protected]>
---
 arch/arm/cpu/arm926ejs/mx28/Makefile       |    7 +------
 arch/arm/cpu/arm926ejs/mx28/spl_boot.c     |   13 ++-----------
 arch/arm/cpu/arm926ejs/mx28/u-boot-spl.lds |   12 ++++++------
 include/configs/m28evk.h                   |    2 ++
 4 files changed, 11 insertions(+), 23 deletions(-)

V2: I have to learn to write meaningful commit messages

arch/arm/cpu/arm926ejs/mx28/Makefile +1 -6
index 372de8a..a2e3f77 100644
@@ -28,7 +28,7 @@ LIB	= $(obj)lib$(SOC).o
 COBJS	= clock.o mx28.o iomux.o timer.o
 
 ifdef	CONFIG_SPL_BUILD
-COBJS	+= memsize.o spl_boot.o spl_mem_init.o spl_power_init.o
+COBJS	+= spl_boot.o spl_mem_init.o spl_power_init.o
 endif
 
 SRCS	:= $(START:.o=.S) $(COBJS:.o=.c)
@@ -40,11 +40,6 @@ all:	$(obj).depend $(LIB)
 $(LIB):	$(OBJS)
 	$(call cmd_link_o_target, $(OBJS))
 
-ifdef	CONFIG_SPL_BUILD
-memsize.c:
-	ln -sf $(TOPDIR)/common/memsize.c $@
-endif
-
 #########################################################################
 
 # defines $(obj).depend target
arch/arm/cpu/arm926ejs/mx28/spl_boot.c +2 -11
index 3cd4c24..dfb8309 100644
@@ -68,17 +68,8 @@ inline void board_init_r(gd_t *id, ulong dest_addr)
 		;
 }
 
-inline int printf(const char *fmt, ...)
-{
-	return 0;
-}
-
-inline void __coloured_LED_init(void) {}
-inline void __red_LED_on(void) {}
-void coloured_LED_init(void)
-	__attribute__((weak, alias("__coloured_LED_init")));
-void red_LED_on(void)
-	__attribute__((weak, alias("__red_LED_on")));
+void serial_putc(const char c) {}
+void serial_puts(const char *s) {}
 void hang(void) __attribute__ ((noreturn));
 void hang(void)
 {
arch/arm/cpu/arm926ejs/mx28/u-boot-spl.lds +6 -6
index 893320f..0fccd52 100644
@@ -67,16 +67,16 @@ SECTIONS
 		*(.dynsym)
 	}
 
-	_end = .;
-
-	.bss __rel_dyn_start (OVERLAY) : {
+	.bss : {
+		. = ALIGN(4);
 		__bss_start = .;
-		*(.bss)
-		 . = ALIGN(4);
+		*(.bss*)
+		. = ALIGN(4);
 		__bss_end__ = .;
 	}
 
-	/DISCARD/ : { *(.bss*) }
+	_end = .;
+
 	/DISCARD/ : { *(.dynstr*) }
 	/DISCARD/ : { *(.dynsym*) }
 	/DISCARD/ : { *(.dynamic*) }
include/configs/m28evk.h +2 -0
index cdf7636..39c841f 100644
@@ -50,6 +50,8 @@
 #define	CONFIG_SPL_NO_CPU_SUPPORT_CODE
 #define	CONFIG_SPL_START_S_PATH		"arch/arm/cpu/arm926ejs/mx28"
 #define	CONFIG_SPL_LDSCRIPT	"arch/arm/cpu/arm926ejs/mx28/u-boot-spl.lds"
+#define	CONFIG_SPL_LIBCOMMON_SUPPORT
+#define	CONFIG_SPL_LIBGENERIC_SUPPORT
 
 /*
  * U-Boot Commands
Signature · 1 line
1.7.7.1
#2 lore raw

PATCH 1/1 M28: Cleanup memsize.o OOT build

In reply to Marek Vasut
Quoted 5 lines · Marek Vasut
Cc Wolfgang Denk <[email protected]>
Cc Detlev Zundel <[email protected]>
Cc Stefano Babic <[email protected]>

---

Hi Marek,

Quoted 6 lines
 arch/arm/cpu/arm926ejs/mx28/Makefile       |    7 +------
 arch/arm/cpu/arm926ejs/mx28/spl_boot.c     |   13 ++-----------
 arch/arm/cpu/arm926ejs/mx28/u-boot-spl.lds |   12 ++++++------
 include/configs/m28evk.h                   |    2 ++
 4 files changed, 11 insertions(+), 23 deletions(-)

It seems to me that your patch does much more as what you describe in the commit message.

Quoted 11 lines
arch/arm/cpu/arm926ejs/mx28/spl_boot.c +0 -3
index 3cd4c24..dfb8309 100644
@@ -68,17 +68,8 @@ inline void board_init_r(gd_t *id, ulong dest_addr)
 		;
 }
 
-inline int printf(const char *fmt, ...)
-{
-	return 0;

arch/arm/cpu/arm926ejs/mx28/spl_boot.c inline void board_init_r(gd_t *id, ulong dest_addr) · line 72

Quoted 10 lines
arch/arm/cpu/arm926ejs/mx28/spl_boot.c +2 -8
-}
-
-inline void __coloured_LED_init(void) {}
-inline void __red_LED_on(void) {}
-void coloured_LED_init(void)
-	__attribute__((weak, alias("__coloured_LED_init")));
-void red_LED_on(void)
-	__attribute__((weak, alias("__red_LED_on")));
+void serial_putc(const char c) {}
+void serial_puts(const char *s) {}

Make a note in the commit message about these changes (not related to the subject)

Quoted 20 lines
arch/arm/cpu/arm926ejs/mx28/spl_boot.c +0 -0
 void hang(void) __attribute__ ((noreturn));
 void hang(void)
 {
arch/arm/cpu/arm926ejs/mx28/u-boot-spl.lds +3 -5
index 893320f..0fccd52 100644
@@ -67,16 +67,16 @@ SECTIONS
 		*(.dynsym)
 	}
 
-	_end = .;
-
-	.bss __rel_dyn_start (OVERLAY) : {
+	.bss : {
+		. = ALIGN(4);
 		__bss_start = .;
-		*(.bss)
-		 . = ALIGN(4);
+		*(.bss*)

arch/arm/cpu/arm926ejs/mx28/u-boot-spl.lds SECTIONS · line 82

Quoted 10 lines
arch/arm/cpu/arm926ejs/mx28/u-boot-spl.lds +3 -1
+		. = ALIGN(4);
 		__bss_end__ = .;
 	}
 
-	/DISCARD/ : { *(.bss*) }
+	_end = .;
+
 	/DISCARD/ : { *(.dynstr*) }
 	/DISCARD/ : { *(.dynsym*) }
 	/DISCARD/ : { *(.dynamic*) }

However, these change fix another issue. You want to cleanup u-boot-spl.lds, but then there are some other parts I cannot understand. For example, why is __u_boot_cmd_start = needed ?

If your goal is to cleanup the linker file, please submit a separate patch removing also the unused sections in SPL.

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================
#3 lore raw

PATCH 1/1 M28: Cleanup memsize.o OOT build

Quoted 9 lines · Marek Vasut
Quoted 5 lines
Cc Wolfgang Denk <[email protected]>
Cc Detlev Zundel <[email protected]>
Cc Stefano Babic <[email protected]>

---

Hi Marek,

Quoted 8 lines
Quoted 5 lines
 arch/arm/cpu/arm926ejs/mx28/Makefile       |    7 +------
 arch/arm/cpu/arm926ejs/mx28/spl_boot.c     |   13 ++-----------
 arch/arm/cpu/arm926ejs/mx28/u-boot-spl.lds |   12 ++++++------
 include/configs/m28evk.h                   |    2 ++
 4 files changed, 11 insertions(+), 23 deletions(-)

It seems to me that your patch does much more as what you describe in the commit message.

Please check V2

Quoted 11 lines
Quoted 11 lines
(quoted diff) +0 -0

b/arch/arm/cpu/arm926ejs/mx28/spl_boot.c index 3cd4c24..dfb8309 100644

arch/arm/cpu/arm926ejs/mx28/spl_boot.c +0 -0
@@ -68,17 +68,8 @@ inline void board_init_r(gd_t *id, ulong dest_addr)
 
 		;
 
 }
 
Quoted 16 lines

arch/arm/cpu/arm926ejs/mx28/spl_boot.c inline void board_init_r(gd_t *id, ulong dest_addr) · line 72

Quoted 13 lines
arch/arm/cpu/arm926ejs/mx28/spl_boot.c +2 -11
-inline int printf(const char *fmt, ...)
-{
-	return 0;
-}
-
-inline void __coloured_LED_init(void) {}
-inline void __red_LED_on(void) {}
-void coloured_LED_init(void)
-	__attribute__((weak, alias("__coloured_LED_init")));
-void red_LED_on(void)
-	__attribute__((weak, alias("__red_LED_on")));
+void serial_putc(const char c) {}
+void serial_puts(const char *s) {}

Make a note in the commit message about these changes (not related to the subject)

Actually I explained this in V2.

Quoted 37 lines
Quoted 37 lines
arch/arm/cpu/arm926ejs/mx28/spl_boot.c +0 -0
 void hang(void) __attribute__ ((noreturn));

void hang(void)
{

(quoted diff) +0 -0

b/arch/arm/cpu/arm926ejs/mx28/u-boot-spl.lds index 893320f..0fccd52 100644

arch/arm/cpu/arm926ejs/mx28/u-boot-spl.lds +6 -6
@@ -67,16 +67,16 @@ SECTIONS
 
 		*(.dynsym)
 
 	}
 
-	_end = .;
-
-	.bss __rel_dyn_start (OVERLAY) : {
+	.bss : {
+		. = ALIGN(4);
 
 		__bss_start = .;
 
-		*(.bss)
-		 . = ALIGN(4);
+		*(.bss*)
+		. = ALIGN(4);
 
 		__bss_end__ = .;
 
 	}
 
-	/DISCARD/ : { *(.bss*) }
+	_end = .;
+
Quoted 5 lines

arch/arm/cpu/arm926ejs/mx28/u-boot-spl.lds SECTIONS · line 82

Quoted 3 lines
arch/arm/cpu/arm926ejs/mx28/u-boot-spl.lds +0 -0
 	/DISCARD/ : { *(.dynstr*) }
 	/DISCARD/ : { *(.dynsym*) }
 	/DISCARD/ : { *(.dynamic*) }

However, these change fix another issue.

Not really actually.

Quoted 3 lines

You want to cleanup
u-boot-spl.lds, but then there are some other parts I cannot understand. For example, why is __u_boot_cmd_start = needed ?

Well, u-boot-spl.lds will need a separate cleanup patch eventually maybe.

Quoted 3 lines

If your goal is to cleanup the linker file, please submit a separate patch removing also the unused sections in SPL.

Not now, right now my goal is to fix the build issue. Linker file cleanup can wait after .12 release.

M

#4 lore raw

PATCH 1/1 M28: Cleanup memsize.o OOT build

Quoted 15 lines · Marek Vasut
Quoted 15 lines · Marek Vasut
Quoted 5 lines
Cc Wolfgang Denk <[email protected]>
Cc Detlev Zundel <[email protected]>
Cc Stefano Babic <[email protected]>

---

Hi Marek,

Quoted 5 lines
 arch/arm/cpu/arm926ejs/mx28/Makefile       |    7 +------
 arch/arm/cpu/arm926ejs/mx28/spl_boot.c     |   13 ++-----------
 arch/arm/cpu/arm926ejs/mx28/u-boot-spl.lds |   12 ++++++------
 include/configs/m28evk.h                   |    2 ++
 4 files changed, 11 insertions(+), 23 deletions(-)
Quoted 4 lines
Quoted 2 lines

It seems to me that your patch does much more as what you describe in the commit message.

Please check V2

Ah, ok, I see it.

Quoted 17 lines
Quoted 8 lines
Quoted 8 lines
arch/arm/cpu/arm926ejs/mx28/spl_boot.c +0 -8
-inline int printf(const char *fmt, ...)
-{
-	return 0;
-}
-
-inline void __coloured_LED_init(void) {}
-inline void __red_LED_on(void) {}
-void coloured_LED_init(void)
Quoted 8 lines

arch/arm/cpu/arm926ejs/mx28/spl_boot.c inline void board_init_r(gd_t *id, ulong dest_addr) · line 72

Quoted 5 lines
arch/arm/cpu/arm926ejs/mx28/spl_boot.c +2 -3
-	__attribute__((weak, alias("__coloured_LED_init")));
-void red_LED_on(void)
-	__attribute__((weak, alias("__red_LED_on")));
+void serial_putc(const char c) {}
+void serial_puts(const char *s) {}

Make a note in the commit message about these changes (not related to the subject)

Quoted 1 line

Actually I explained this in V2.

Ok, it is enough

Quoted 12 lines
Quoted 5 lines

arch/arm/cpu/arm926ejs/mx28/u-boot-spl.lds SECTIONS · line 82

Quoted 3 lines
arch/arm/cpu/arm926ejs/mx28/u-boot-spl.lds +0 -0
 	/DISCARD/ : { *(.dynstr*) }
 	/DISCARD/ : { *(.dynsym*) }
 	/DISCARD/ : { *(.dynamic*) }

However, these change fix another issue.

Not really actually.

Quoted 3 lines

You want to cleanup
u-boot-spl.lds, but then there are some other parts I cannot understand. For example, why is __u_boot_cmd_start = needed ?

Quoted 7 lines

Well, u-boot-spl.lds will need a separate cleanup patch eventually maybe.

Quoted 3 lines

If your goal is to cleanup the linker file, please submit a separate patch removing also the unused sections in SPL.

Not now, right now my goal is to fix the build issue. Linker file cleanup can wait after .12 release.

Ok, well - I will merge it into u-boot-imx.

Stefano

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================