From: Pavel Machek <pavel@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCHv1] ARM: Add Altera SOCFPGA Cyclone5
Date: Sat, 25 Aug 2012 12:42:07 +0200 [thread overview]
Message-ID: <20120825104207.GA12281@elf.ucw.cz> (raw)
In-Reply-To: <5037D383.2080105@ti.com>
On Fri 2012-08-24 12:18:27, Tom Rini wrote:
> On 08/23/2012 03:43 AM, Pavel Machek wrote:
>
> [snip]
> >> It's the omap-common/spl.c code with the bits for IH_OS_LINUX taken out
> >> :) Can you please re-do your series on top of the SPL series I just
> >> posted that provides a common SPL framework? Thanks!
> >
> > I'll take a look. OTOH, ammount of code duplication here is quite low,
> > and redoing it on top of SPL series will mean delaying merge, right?
>
> My hope is that since I got the SPL patches posted in time we can get
> them in for v2012.10 so no, this will only help your chances :)
Got it. I pulled Stefan's version -- he seems to have your changes as
a git tree. I merged altera code into that, and with these quick hacks
on top of that, it boots. Good sign :-).
diff --git a/arch/arm/cpu/armv7/socfpga/spl.c b/arch/arm/cpu/armv7/socfpga/spl.c
index 7bd1e2f..74ac8e6 100644
--- a/arch/arm/cpu/armv7/socfpga/spl.c
+++ b/arch/arm/cpu/armv7/socfpga/spl.c
@@ -33,7 +33,7 @@ static struct spl_image_info spl_image;
extern void __malloc_start, __malloc_end, __stack_start;
/* Define global data structure pointer to it */
-static gd_t gdata __attribute__ ((section(".data")));
+gd_t gdata __attribute__ ((section(".data")));
/*
* Error action
@@ -134,27 +134,6 @@ static void spl_console_init(void)
}
/*
- * Board initialization prior bss clearance
- * Do note below concerns when inserting your function here.
- * Please refer to README for more details.
-
- * Initialized global data (data segment) is read-only. Do not attempt
- to write it.
-
- * Do not use any uninitialized global data (or implicitely initialized
- as zero data - BSS segment) at all - this is undefined, initiali-
- zation is performed later (when relocating to RAM).
-
- * Stack space is very limited. Avoid big data buffers or things like
- that.
- */
-void board_init_f(ulong dummy)
-{
- /* Will clear bss then jump back to function board_init_r */
- relocate_code((ulong) &__stack_start, &gdata, CONFIG_SPL_TEXT_BASE);
-}
-
-/*
* Board initialization after bss clearance
*/
void board_init_r(gd_t *id, ulong dummy)
diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index c892f82..9db93d8 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -45,7 +45,7 @@ COBJS-y += reset.o
SOBJS-$(CONFIG_USE_ARCH_MEMSET) += memset.o
SOBJS-$(CONFIG_USE_ARCH_MEMCPY) += memcpy.o
else
-COBJS-$(CONFIG_SPL_FRAMEWORK) += spl.o
+COBJS-y += spl.o
endif
COBJS-y += cache.o
diff --git a/arch/arm/lib/spl.c b/arch/arm/lib/spl.c
index 2d1f47a..8c8806e 100644
--- a/arch/arm/lib/spl.c
+++ b/arch/arm/lib/spl.c
@@ -41,8 +41,9 @@ extern char __bss_start[], __bss_end__[];
*/
void __weak board_init_f(ulong dummy)
{
+ extern void __stack_start;
/* Set the stack pointer. */
- asm volatile("mov sp, %0\n" : : "r"(CONFIG_SPL_STACK));
+ asm volatile("mov sp, %0\n" : : "r"(&__stack_start));
/* Clear the BSS. */
memset(__bss_start, 0, __bss_end__ - __bss_start);
diff --git a/include/configs/socfpga_cyclone5.h b/include/configs/socfpga_cyclone5.h
index 29aa9da..ac52e57 100644
--- a/include/configs/socfpga_cyclone5.h
+++ b/include/configs/socfpga_cyclone5.h
@@ -109,6 +109,7 @@
#define CONFIG_DOS_PARTITION 1
#ifdef CONFIG_SPL_BUILD
+#define CONFIG_SPL_FRAMEWORK
#undef CONFIG_PARTITIONS
#endif
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
next prev parent reply other threads:[~2012-08-25 10:42 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-16 22:45 [U-Boot] [PATCHv1] ARM: Add Altera SOCFPGA Cyclone5 dinguyen at altera.com
2012-08-22 22:10 ` Pavel Machek
2012-08-22 22:26 ` Marek Vasut
2012-08-23 1:13 ` Tom Rini
2012-08-23 10:43 ` Pavel Machek
2012-08-23 11:18 ` Stefan Roese
2012-08-29 12:30 ` Pavel Machek
2012-08-29 12:32 ` Stefan Roese
2012-08-24 19:18 ` Tom Rini
2012-08-25 9:03 ` Pavel Machek
2012-08-25 10:42 ` Pavel Machek [this message]
2012-08-25 11:56 ` Pavel Machek
2012-08-27 15:43 ` Tom Rini
2012-08-29 12:07 ` Pavel Machek
2012-08-25 12:05 ` Pavel Machek
2012-08-27 15:57 ` Tom Rini
2012-08-29 12:27 ` Pavel Machek
2012-08-29 13:41 ` Pavel Machek
2012-08-29 18:26 ` Tom Rini
2012-08-29 23:21 ` Pavel Machek
2012-08-30 0:00 ` Tom Rini
2012-08-30 17:18 ` Pavel Machek
2012-08-30 17:34 ` Tom Rini
2012-08-30 17:46 ` Tom Rini
2012-08-30 18:05 ` Pavel Machek
2012-08-30 18:30 ` Tom Rini
2012-08-30 20:42 ` Pavel Machek
2012-08-30 22:25 ` Tom Rini
2012-08-31 21:26 ` Dinh Nguyen
2012-08-31 21:37 ` Tom Rini
2012-08-31 7:02 ` Stefan Roese
2012-08-29 23:34 ` Pavel Machek
2012-08-29 23:56 ` Marek Vasut
2012-08-30 16:59 ` Pavel Machek
2012-08-30 18:02 ` Marek Vasut
2012-08-30 18:12 ` Pavel Machek
2012-08-30 18:16 ` Marek Vasut
2012-09-03 2:59 ` Chin Liang See
2012-08-30 0:03 ` Tom Rini
2012-08-30 17:20 ` Pavel Machek
2012-08-23 10:56 ` Pavel Machek
2012-08-23 10:50 ` Pavel Machek
2012-08-24 22:59 ` Tom Rini
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=20120825104207.GA12281@elf.ucw.cz \
--to=pavel@denx.de \
--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