From aade077e431b584980a0418c0e464f6ef31c5c20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Heiko=20St=C3=BCbner?= Date: Sat, 18 Feb 2017 19:46:26 +0100 Subject: [PATCH] rockchip: Move bootrom-related declarations to a header So far spl-boards have declared the back_to_brom() function as simple extern in the files themself. That doesn't scale well if every boards defines this on its own. Therefore move the declarations to a bootrom header. Signed-off-by: Heiko Stuebner Tested-by: Kever Yang --- arch/arm/include/asm/arch-rockchip/bootrom.h | 22 ++++++++++++++++++++ arch/arm/mach-rockchip/rk3036-board-spl.c | 3 +-- arch/arm/mach-rockchip/rk3288-board-spl.c | 3 ++- 3 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 arch/arm/include/asm/arch-rockchip/bootrom.h diff --git a/arch/arm/include/asm/arch-rockchip/bootrom.h b/arch/arm/include/asm/arch-rockchip/bootrom.h new file mode 100644 index 0000000000..79fb1a07ac --- /dev/null +++ b/arch/arm/include/asm/arch-rockchip/bootrom.h @@ -0,0 +1,22 @@ +/* + * (C) Copyright 2017 Heiko Stuebner + * + * SPDX-License-Identifier: GPL-2.0 + */ + +#ifndef _ASM_ARCH_BOOTROM_H +#define _ASM_ARCH_BOOTROM_H + +/* + * Saved Stack pointer address. + * Access might be needed in some special cases. + */ +extern u32 SAVE_SP_ADDR; + +/* + * Hand control back to the bootrom to load another + * boot stage. + */ +extern void back_to_bootrom(void); + +#endif diff --git a/arch/arm/mach-rockchip/rk3036-board-spl.c b/arch/arm/mach-rockchip/rk3036-board-spl.c index 801548109b..0522d65467 100644 --- a/arch/arm/mach-rockchip/rk3036-board-spl.c +++ b/arch/arm/mach-rockchip/rk3036-board-spl.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -20,8 +21,6 @@ static struct rk3036_grf * const grf = (void *)GRF_BASE; #define DEBUG_UART_BASE 0x20068000 -extern void back_to_bootrom(void); - void board_init_f(ulong dummy) { #ifdef EARLY_DEBUG diff --git a/arch/arm/mach-rockchip/rk3288-board-spl.c b/arch/arm/mach-rockchip/rk3288-board-spl.c index 3713c13d69..74f3379194 100644 --- a/arch/arm/mach-rockchip/rk3288-board-spl.c +++ b/arch/arm/mach-rockchip/rk3288-board-spl.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -155,7 +156,7 @@ static int configure_emmc(struct udevice *pinctrl) return 0; } #endif -extern void back_to_bootrom(void); + void board_init_f(ulong dummy) { struct udevice *pinctrl;