summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-11-26 11:23:30 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2013-12-10 14:35:33 +0100
commit509f62209907d6cc4c8d4b4e95aff91c7684f5db (patch)
tree1e38bfaf62d450e9025c4502e460214baeb14729 /arch
parentace667e6bba1de3c24a02c9197c6872a6d2ea94e (diff)
downloadbarebox-509f62209907d6cc4c8d4b4e95aff91c7684f5db.tar.gz
barebox-509f62209907d6cc4c8d4b4e95aff91c7684f5db.tar.xz
ARM: Make multi images startup process simpler
The multi image startup process used to have three binaries involved: - The lowlevel board code to initialize SDRAM - the uncompressor - the regular (compressed) barebox binary Drop the uncompressor and put the uncompress code into the lowlevel board code binary. This makes the startup process easier. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/cpu/Makefile2
-rw-r--r--arch/arm/cpu/start-images.c49
-rw-r--r--arch/arm/cpu/uncompress.c9
3 files changed, 6 insertions, 54 deletions
diff --git a/arch/arm/cpu/Makefile b/arch/arm/cpu/Makefile
index aba201bb9d..c29d03021f 100644
--- a/arch/arm/cpu/Makefile
+++ b/arch/arm/cpu/Makefile
@@ -23,7 +23,7 @@ obj-$(CONFIG_CACHE_L2X0) += cache-l2x0.o
pbl-y += setupc.o
pbl-$(CONFIG_PBL_SINGLE_IMAGE) += start-pbl.o
-pbl-$(CONFIG_PBL_MULTI_IMAGES) += start-images.o uncompress.o
+pbl-$(CONFIG_PBL_MULTI_IMAGES) += uncompress.o
obj-y += common.o cache.o
pbl-y += common.o cache.o
diff --git a/arch/arm/cpu/start-images.c b/arch/arm/cpu/start-images.c
deleted file mode 100644
index d48d245294..0000000000
--- a/arch/arm/cpu/start-images.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * start-pbl.c
- *
- * Copyright (c) 2010-2012 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
- * Copyright (c) 2012 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2
- * as published by the Free Software Foundation.
- *
- * 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, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include <common.h>
-#include <init.h>
-#include <sizes.h>
-#include <pbl.h>
-#include <asm/barebox-arm.h>
-#include <asm/barebox-arm-head.h>
-#include <asm-generic/memory_layout.h>
-#include <asm/sections.h>
-#include <asm/pgtable.h>
-#include <debug_ll.h>
-
-void __naked __noreturn barebox_arm_entry(uint32_t membase, uint32_t memsize,
- uint32_t boarddata)
-{
- unsigned long barebox_base;
- void __noreturn (*barebox)(uint32_t, uint32_t, uint32_t);
-
- barebox_base = ld_var(__image_end) - get_runtime_offset() + 4;
-
- if (IS_ENABLED(CONFIG_THUMB2_BAREBOX))
- barebox = (void *)(barebox_base + 1);
- else
- barebox = (void *)barebox_base;
-
- barebox(membase, memsize, boarddata);
-}
diff --git a/arch/arm/cpu/uncompress.c b/arch/arm/cpu/uncompress.c
index b0819c7369..6d3302a31c 100644
--- a/arch/arm/cpu/uncompress.c
+++ b/arch/arm/cpu/uncompress.c
@@ -43,7 +43,7 @@ static int __attribute__((__used__))
__attribute__((__section__(".image_end")))
__image_end_dummy = 0xdeadbeef;
-static void noinline uncompress(uint32_t membase,
+static void __noreturn noinline uncompress_start_payload(uint32_t membase,
uint32_t memsize, uint32_t boarddata)
{
uint32_t offset;
@@ -99,12 +99,13 @@ static void noinline uncompress(uint32_t membase,
}
/*
- * Generic second stage pbl uncompressor entry
+ * For the multi images startup process board code jumps here. We will uncompress
+ * the attached barebox image and start it.
*/
-ENTRY_FUNCTION(start_uncompress)(uint32_t membase, uint32_t memsize,
+void __naked __noreturn barebox_arm_entry(uint32_t membase, uint32_t memsize,
uint32_t boarddata)
{
arm_setup_stack(membase + memsize - 16);
- uncompress(membase, memsize, boarddata);
+ uncompress_start_payload(membase, memsize, boarddata);
}