diff mbox

[U-Boot,1/2] AT91: fix TOP9000 built issues

Message ID 1291887964-2537-1-git-send-email-u-boot@emk-elektronik.de
State Superseded
Delegated to: Reinhard Meyer
Headers show

Commit Message

Reinhard Meyer Dec. 9, 2010, 9:46 a.m. UTC
Since I originally made and checked the TOP9000 support patch some changes
to mainline broke the built. This small patch fixes this.

Signed-off-by: Reinhard Meyer <u-boot@emk-elektronik.de>
---
 board/emk/top9000/Makefile  |    6 +++---
 board/emk/top9000/top9000.c |    2 +-
 include/configs/top9000.h   |    8 ++++++--
 3 files changed, 10 insertions(+), 6 deletions(-)

Comments

Reinhard Meyer Dec. 9, 2010, 11:16 a.m. UTC | #1
I wrote:

>  /*
>   * Warning: changing CONFIG_SYS_TEXT_BASE requires
> - * adapting the initial boot program
> + * adapting the initial boot program.
> + * Guard it since the definition finds its way to the command-line and
> + * causes warnings when this file is included
>   */
> -#define CONFIG_SYS_TEXT_BASE		0x21f00000	/* 31 MB into RAM */
> +#ifndef CONFIG_SYS_TEXT_BASE
> +# define CONFIG_SYS_TEXT_BASE		0x21f00000	/* 31 MB into RAM */
> +#endif

Because I had this warning when building u-boot:

*** make u-boot.bin
In file included from /home/reinhard/embedded/top9000/build/u-boot/include/config.h:5,
                 from include/common.h:37:
/home/reinhard/embedded/u-boot-atmel/include/configs/top9000.h:45:1: warning: "CONFIG_SYS_TEXT_BASE" redefined
<command-line>: warning: this is the location of the previous definition

Since I found guarding the define a bit ugly, I removed it again, trying to investigate
where exactly the definition in the command line came from.

Surprisingly, further builds did not ever again show that warning. I can only assume some
stuff in the out-of-tree build was dormant and got removed when I did a "make clean".

A new patch without the guarding will follow soon.

Best Regards,
Reinhard
diff mbox

Patch

diff --git a/board/emk/top9000/Makefile b/board/emk/top9000/Makefile
index 9b28048..3ac6f14 100644
--- a/board/emk/top9000/Makefile
+++ b/board/emk/top9000/Makefile
@@ -26,9 +26,9 @@ 
 
 include $(TOPDIR)/config.mk
 
-LIB	= $(obj)lib$(BOARD).a
+LIB	= $(obj)lib$(BOARD).o
 
-COBJS-y	+= top9000.o
+COBJS-y	+= $(BOARD).o
 COBJS-$(CONFIG_ATMEL_SPI)	+= spi.o
 
 SRCS	:= $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
@@ -36,7 +36,7 @@  OBJS	:= $(addprefix $(obj),$(COBJS-y))
 SOBJS	:= $(addprefix $(obj),$(SOBJS))
 
 $(LIB):	$(obj).depend $(OBJS) $(SOBJS)
-	$(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
+	$(call cmd_link_o_target, $(OBJS) $(SOBJS))
 
 clean:
 	rm -f $(SOBJS) $(OBJS)
diff --git a/board/emk/top9000/top9000.c b/board/emk/top9000/top9000.c
index b0fe2d6..73dd706 100644
--- a/board/emk/top9000/top9000.c
+++ b/board/emk/top9000/top9000.c
@@ -120,7 +120,7 @@  int board_mmc_getcd(u8 *cd, struct mmc *mmc)
 
 int board_early_init_f(void)
 {
-	at91_shdwn_t *shdwn = (at91_shdwn_t *)AT91_SHDWN_BASE;
+	struct at91_shdwn *shdwn = (struct at91_shdwn *)AT91_SHDWN_BASE;
 
 	/*
 	 * make sure the board can be powered on by
diff --git a/include/configs/top9000.h b/include/configs/top9000.h
index ff3933b..814fb6c 100644
--- a/include/configs/top9000.h
+++ b/include/configs/top9000.h
@@ -40,9 +40,13 @@ 
 
 /*
  * Warning: changing CONFIG_SYS_TEXT_BASE requires
- * adapting the initial boot program
+ * adapting the initial boot program.
+ * Guard it since the definition finds its way to the command-line and
+ * causes warnings when this file is included
  */
-#define CONFIG_SYS_TEXT_BASE		0x21f00000	/* 31 MB into RAM */
+#ifndef CONFIG_SYS_TEXT_BASE
+# define CONFIG_SYS_TEXT_BASE		0x21f00000	/* 31 MB into RAM */
+#endif
 
 /* Command line configuration */
 #include <config_cmd_default.h>