@@ -27,8 +27,6 @@
DECLARE_GLOBAL_DATA_PTR;
-extern void __malloc_start, __malloc_end, __stack_start;
-
/*
* Console Initialization
*/
@@ -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
@@ -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);