public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCHv1] ARM: Add Altera SOCFPGA Cyclone5
Date: Wed, 29 Aug 2012 14:07:33 +0200	[thread overview]
Message-ID: <20120829120732.GA32065@elf.ucw.cz> (raw)
In-Reply-To: <503B9590.7000403@ti.com>

Hi!

> > Some observations:
> > 
> > Not sure what to do with CONFIG_SPL_STACK: altera was just using
> > symbol from linker script. Is there way to keep it like that? I'd hate
> > to invent magic constant.
> 
> Well, lets think about this.  Previously, everyone has been saying "use
> this spot in SRAM" or "use this spot in DRAM (which has been setup
> previously)".  But I think you should be able to do
> #define CONFIG_SPL_STACK __linker_symbol and be done with it.

Yes, that seems to do the trick... if it is acceptable.

									Pavel

commit 2cc99bcf39dc90ec4f43b949b8db75d5b019c92f
Author: Pavel <pavel@ucw.cz>
Date:   Wed Aug 29 14:04:47 2012 +0200

    Use CONFIG_SPL_START as suggested by Tom Rini.
    
    Signed-off-by: Pavel Machek <pavel@denx.de>

diff --git a/arch/arm/cpu/armv7/socfpga/spl.c b/arch/arm/cpu/armv7/socfpga/spl.c
index ca5f4cf..88f809d 100644
--- a/arch/arm/cpu/armv7/socfpga/spl.c
+++ b/arch/arm/cpu/armv7/socfpga/spl.c
@@ -27,8 +27,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-extern void __malloc_start, __malloc_end, __stack_start;
-
 /*
  * Console Initialization
  */
diff --git a/arch/arm/include/asm/arch-socfpga/spl.h b/arch/arm/include/asm/arch-socfpga/spl.h
index 68ceec6..43efa67 100644
--- a/arch/arm/include/asm/arch-socfpga/spl.h
+++ b/arch/arm/include/asm/arch-socfpga/spl.h
@@ -1 +1,28 @@
+/*
+ *  Copyright (C) 2012 Pavel Machek <pavel@denx.de>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _SOCFPGA_SPL_H_
+#define _SOCFPGA_SPL_H_
+
+/* Symbols from linker script */
+extern void __malloc_start, __malloc_end, __stack_start;
+
+#define CONFIG_SPL_STACK (&__stack_start)
+
 #define BOOT_DEVICE_RAM 1
+
+#endif
diff --git a/arch/arm/lib/spl.c b/arch/arm/lib/spl.c
index 8c8806e..2d1f47a 100644
--- a/arch/arm/lib/spl.c
+++ b/arch/arm/lib/spl.c
@@ -41,9 +41,8 @@ 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"(&__stack_start));
+	asm volatile("mov sp, %0\n" : : "r"(CONFIG_SPL_STACK));
 
 	/* Clear the BSS. */
 	memset(__bss_start, 0, __bss_end__ - __bss_start);

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

  reply	other threads:[~2012-08-29 12:07 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
2012-08-25 11:56         ` Pavel Machek
2012-08-27 15:43           ` Tom Rini
2012-08-29 12:07             ` Pavel Machek [this message]
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=20120829120732.GA32065@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