From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavel Machek Date: Wed, 29 Aug 2012 14:07:33 +0200 Subject: [U-Boot] [PATCHv1] ARM: Add Altera SOCFPGA Cyclone5 In-Reply-To: <503B9590.7000403@ti.com> References: <1345157139-19585-1-git-send-email-dinguyen@altera.com> <201208230026.53389.marex@denx.de> <20120823011353.GB3476@bill-the-cat> <20120823104342.GA28214@elf.ucw.cz> <5037D383.2080105@ti.com> <20120825115601.GA19418@elf.ucw.cz> <503B9590.7000403@ti.com> Message-ID: <20120829120732.GA32065@elf.ucw.cz> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 Date: Wed Aug 29 14:04:47 2012 +0200 Use CONFIG_SPL_START as suggested by Tom Rini. Signed-off-by: Pavel Machek 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 + * + * 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 . + */ + +#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