diff options
Diffstat (limited to 'arch/arm/cpu/uncompress.c')
-rw-r--r-- | arch/arm/cpu/uncompress.c | 41 |
1 files changed, 13 insertions, 28 deletions
diff --git a/arch/arm/cpu/uncompress.c b/arch/arm/cpu/uncompress.c index 88d073ebdd..a481c4634d 100644 --- a/arch/arm/cpu/uncompress.c +++ b/arch/arm/cpu/uncompress.c @@ -1,22 +1,9 @@ -/* - * uncompress.c - uncompressor code for self extracing pbl image - * - * Copyright (c) 2010-2013 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. - * - */ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: 2010-2013 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix +// SPDX-FileCopyrightText: 2012 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> + +/* uncompress.c - uncompressor code for self extracing pbl image */ + #define pr_fmt(fmt) "uncompress.c: " fmt #include <common.h> @@ -65,8 +52,9 @@ void __noreturn barebox_pbl_start(unsigned long membase, unsigned long memsize, void *pg_start, *pg_end; unsigned long pc = get_pc(); - pg_start = input_data + global_variable_offset(); - pg_end = input_data_end + global_variable_offset(); + /* piggy data is not relocated, so determine the bounds now */ + pg_start = runtime_address(input_data); + pg_end = runtime_address(input_data_end); if (IS_ENABLED(CONFIG_PBL_RELOCATABLE)) { /* @@ -93,14 +81,11 @@ void __noreturn barebox_pbl_start(unsigned long membase, unsigned long memsize, pr_debug("memory at 0x%08lx, size 0x%08lx\n", membase, memsize); - if (IS_ENABLED(CONFIG_MMU_EARLY)) { - unsigned long ttb = arm_mem_ttb(membase, endmem); - pr_debug("enabling MMU, ttb @ 0x%08lx\n", ttb); - mmu_early_enable(membase, memsize, ttb); - } + if (IS_ENABLED(CONFIG_MMU)) + mmu_early_enable(membase, memsize); - free_mem_ptr = arm_mem_early_malloc(membase, endmem); - free_mem_end_ptr = arm_mem_early_malloc_end(membase, endmem); + free_mem_ptr = arm_mem_early_malloc(endmem); + free_mem_end_ptr = arm_mem_early_malloc_end(endmem); pr_debug("uncompressing barebox binary at 0x%p (size 0x%08x) to 0x%08lx (uncompressed size: 0x%08x)\n", pg_start, pg_len, barebox_base, uncompressed_len); |