diff options
Diffstat (limited to 'arch/arm/boards/karo-tx25/lowlevel.c')
-rw-r--r-- | arch/arm/boards/karo-tx25/lowlevel.c | 61 |
1 files changed, 27 insertions, 34 deletions
diff --git a/arch/arm/boards/karo-tx25/lowlevel.c b/arch/arm/boards/karo-tx25/lowlevel.c index f79cd91640..d6658b535f 100644 --- a/arch/arm/boards/karo-tx25/lowlevel.c +++ b/arch/arm/boards/karo-tx25/lowlevel.c @@ -1,28 +1,13 @@ -/* - * - * (c) 2011 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de> - * - * 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 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. - * - */ +// SPDX-License-Identifier: GPL-2.0-or-later +// SPDX-FileCopyrightText: 2011 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix + #include <common.h> #include <init.h> -#include <mach/imx25-regs.h> -#include <mach/esdctl.h> +#include <mach/imx/imx25-regs.h> +#include <mach/imx/esdctl.h> #include <io.h> #include <linux/sizes.h> -#include <mach/imx-nand.h> +#include <mach/imx/imx-nand.h> #include <asm/barebox-arm.h> #include <asm/barebox-arm-head.h> #include <asm/system.h> @@ -74,7 +59,24 @@ static inline void __bare_init setup_sdram(uint32_t base, uint32_t esdctl, writel(esdctl, esdctlreg); } -static void __bare_init karo_tx25_common_init(void *fdt) +extern char __dtb_imx25_karo_tx25_start[]; + +static void __noreturn karo_tx25_start(void) +{ + void *fdt; + + fdt = __dtb_imx25_karo_tx25_start + get_runtime_offset(); + + imx25_barebox_entry(fdt); +} + +static void __noreturn karo_tx25_load_nand(void) +{ + imx25_nand_load_image(); + karo_tx25_start(); +} + +static void __bare_init karo_tx25_common_init(void) { uint32_t r; @@ -138,7 +140,7 @@ static void __bare_init karo_tx25_common_init(void *fdt) /* Skip SDRAM initialization if we run from RAM */ r = get_pc(); if (r > 0x80000000 && r < 0xa0000000) - goto out; + karo_tx25_start(); /* set to 3.3v SDRAM */ writel(0x800, MX25_IOMUXC_BASE_ADDR + 0x454); @@ -156,21 +158,12 @@ static void __bare_init karo_tx25_common_init(void *fdt) setup_sdram(0x80000000, ESDCTLVAL, ESDCFGVAL); setup_sdram(0x90000000, ESDCTLVAL, ESDCFGVAL); - imx25_barebox_boot_nand_external(fdt); - -out: - imx25_barebox_entry(fdt); + imx25_nand_relocate_to_sdram(karo_tx25_load_nand); } -extern char __dtb_imx25_karo_tx25_start[]; - ENTRY_FUNCTION(start_imx25_karo_tx25, r0, r1, r2) { - void *fdt; - arm_setup_stack(MX25_IRAM_BASE_ADDR + MX25_IRAM_SIZE); - fdt = __dtb_imx25_karo_tx25_start + get_runtime_offset(); - - karo_tx25_common_init(fdt); + karo_tx25_common_init(); } |