9
0
Fork 0

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>
This commit is contained in:
Sascha Hauer 2013-11-26 11:23:30 +01:00
parent ace667e6bb
commit 509f622099
4 changed files with 9 additions and 63 deletions

View File

@ -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

View File

@ -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);
}

View File

@ -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);
}

View File

@ -69,10 +69,10 @@ $(obj)/%.pblb: $(obj)/%.pbl FORCE
quiet_cmd_pblx ?= PBLX $@
cmd_pblx ?= cat $(obj)/$(patsubst %.pblx,%.pblb,$(2)) > $@; \
$(call size_append, $(obj)/barebox.x) >> $@; \
cat $(obj)/barebox.x >> $@
$(call size_append, $(obj)/barebox.z) >> $@; \
cat $(obj)/barebox.z >> $@
$(obj)/%.pblx: $(obj)/%.pblb $(obj)/barebox.x FORCE
$(obj)/%.pblx: $(obj)/%.pblb $(obj)/barebox.z FORCE
$(call if_changed,pblx,$(@F))
$(obj)/%.s: $(obj)/% FORCE
@ -93,12 +93,6 @@ quiet_cmd_selfextract = COMP $@
$(call size_append, $<) >> $@; \
cat $< >> $@
pblx-y += start_uncompress
# barebox.x - self extracting barebox binary
# ----------------------------------------------------------------
$(obj)/barebox.x: $(obj)/barebox.z $(obj)/start_uncompress.pblb FORCE
$(call if_changed,selfextract)
# %.img - create a copy from another file
# ----------------------------------------------------------------
.SECONDEXPANSION: