From: Ilko Iliev <iliev@ronetix.at>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] at91: board specific lowlevel_init.S
Date: Tue, 28 Oct 2008 12:45:49 +0100 [thread overview]
Message-ID: <4906FB6D.4000204@ronetix.at> (raw)
In-Reply-To: <20081028062444.GB6417@game.jcrosoft.org>
Dear Jean-Christophe,
Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 22:20 Mon 27 Oct , Wolfgang Denk wrote:
>
>> Dear Jean-Christophe PLAGNIOL-VILLARD,
>>
>> In message <20081027164336.GA1778@game.jcrosoft.org> you wrote:
>>
>>>> I've found that weak functions are only overwritten if the overwriting
>>>> function is in a file (not archive) that has strongly-linked symbols.
>>>> Admittedly, I've only done this with C code but expect that the assembly
>>>> equivalent works the same way. The idea of using weak functions seems
>>>> great, but suffers from some pretty cumbersome weaknesses :)
>>>>
>>> I've found a solution but it's need to update the all u-boot linking method.
>>>
>>> Move from AR to LD.
>>>
>> Well, that is exactly what Ben just described.
>>
>>
>>> Which need some work to fit on all boards.
>>>
>> Well, actually only the file lowlevel_init.o needs to be treated that
>> way, so the needed hcanges look not too complicated to me.
>>
> I'll send a patch to move cpu/at91 to it only and an example to use it with
> board dir
>
Please take a look at the following patch:
diff --git a/Makefile b/Makefile
index d6abb4d..b1c07ae 100644
--- a/Makefile
+++ b/Makefile
@@ -199,6 +199,11 @@ endif
ifeq ($(CPU),mpc85xx)
OBJS += cpu/$(CPU)/resetvec.o
endif
+ifeq ($(SOC),at91)
+OBJS += cpu/$(CPU)/$(SOC)/lowlevel_init.o $(shell \
+ if [ -f board/$(VENDOR)/$(BOARD)/$(BOARD)_lowlevel_init.S ];
then echo \
+ "board/$(VENDOR)/$(BOARD)/$(BOARD)_lowlevel_init.o"; fi)
+endif
OBJS := $(addprefix $(obj),$(OBJS))
@@ -337,7 +342,8 @@ $(obj)u-boot: depend $(SUBDIRS)
$(OBJS) $(LIBBOARD) $(LIBS) $(LDSCRIPT)
-Map u-boot.map -o u-boot
$(OBJS): depend $(obj)include/autoconf.mk
- $(MAKE) -C cpu/$(CPU) $(if $(REMOTE_BUILD),$@,$(notdir $@))
+ $(MAKE) -C cpu/$(CPU)
+# $(MAKE) -C cpu/$(CPU) $(if $(REMOTE_BUILD),$@,$(notdir $@))
$(LIBS): depend $(obj)include/autoconf.mk
$(MAKE) -C $(dir $(subst $(obj),,$@))
diff --git a/cpu/arm926ejs/at91/Makefile b/cpu/arm926ejs/at91/Makefile
index 2d2a888..d0dcf9b 100644
--- a/cpu/arm926ejs/at91/Makefile
+++ b/cpu/arm926ejs/at91/Makefile
@@ -28,12 +28,13 @@ LIB = $(obj)lib$(SOC).a
COBJS-y += timer.o
COBJS-$(CONFIG_HAS_DATAFLASH) +=spi.o
COBJS-y += usb.o
-SOBJS = lowlevel_init.o
+LOWLEVEL_INIT = lowlevel_init.o
-SRCS := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
+SRCS := $(LOWLEVEL_INIT:.o=.S) $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS-y))
+LOWLEVEL_INIT := $(addprefix $(obj),$(LOWLEVEL_INIT))
-all: $(obj).depend $(LIB)
+all: $(obj).depend $(LIB) $(LOWLEVEL_INIT)
$(LIB): $(OBJS)
$(AR) $(ARFLAGS) $@ $(OBJS)
diff --git a/cpu/arm926ejs/at91/lowlevel_init.S
b/cpu/arm926ejs/at91/lowlevel_init.S
index ec6ad5d..4fea4a6 100644
--- a/cpu/arm926ejs/at91/lowlevel_init.S
+++ b/cpu/arm926ejs/at91/lowlevel_init.S
@@ -30,6 +30,8 @@
#ifndef CONFIG_SKIP_LOWLEVEL_INIT
.globl lowlevel_init
+.weak lowlevel_init
+.set lowlevel_init,function
lowlevel_init:
/*
I think that this part is not good, but I don't know how to make it better:
- $(MAKE) -C cpu/$(CPU) $(if $(REMOTE_BUILD),$@,$(notdir $@))
+ $(MAKE) -C cpu/$(CPU)
+# $(MAKE) -C cpu/$(CPU) $(if $(REMOTE_BUILD),$@,$(notdir $@))
--
Mit freundlichen Gr??en/With best regards,
Ilko Iliev
Ronetix Development Tools GmbH
CPU Modules, JTAG/BDM Emulators and Flash Programmers
Waidhausenstrasse 13/5, 1140 Vienna, Austria
E-Mail: iliev at ronetix.at; Web: www.ronetix.at
next prev parent reply other threads:[~2008-10-28 11:45 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-21 13:41 [U-Boot] [PATCH] at91: board specific lowlevel_init.S Ilko Iliev
2008-10-21 13:58 ` Wolfgang Denk
2008-10-21 16:00 ` Ilko Iliev
2008-10-21 16:43 ` Jean-Christophe PLAGNIOL-VILLARD
2008-10-21 19:08 ` Wolfgang Denk
2008-10-22 11:12 ` Ilko Iliev
2008-10-22 12:41 ` Jean-Christophe PLAGNIOL-VILLARD
2008-10-22 13:07 ` Ilko Iliev
2008-10-22 13:22 ` Jean-Christophe PLAGNIOL-VILLARD
2008-10-22 14:01 ` Ilko Iliev
2008-10-22 15:06 ` Jean-Christophe PLAGNIOL-VILLARD
2008-10-22 15:49 ` Ilko Iliev
2008-10-27 15:52 ` Ilko Iliev
2008-10-27 16:27 ` Ben Warren
2008-10-27 16:43 ` Jean-Christophe PLAGNIOL-VILLARD
2008-10-27 17:44 ` Ilko Iliev
2008-10-27 21:27 ` Wolfgang Denk
2008-10-27 21:20 ` Wolfgang Denk
2008-10-28 6:24 ` Jean-Christophe PLAGNIOL-VILLARD
2008-10-28 11:45 ` Ilko Iliev [this message]
2008-10-30 20:47 ` Jean-Christophe PLAGNIOL-VILLARD
2008-11-05 17:29 ` Ilko Iliev
2008-11-05 17:37 ` Jean-Christophe PLAGNIOL-VILLARD
2008-11-05 21:33 ` Wolfgang Denk
2008-11-06 15:03 ` Ilko Iliev
2008-11-06 15:07 ` Ilko Iliev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4906FB6D.4000204@ronetix.at \
--to=iliev@ronetix.at \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox