summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-rockchip/bootm.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-rockchip/bootm.c')
-rw-r--r--arch/arm/mach-rockchip/bootm.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/arm/mach-rockchip/bootm.c b/arch/arm/mach-rockchip/bootm.c
index 5d6181ebd7..6f4aa27808 100644
--- a/arch/arm/mach-rockchip/bootm.c
+++ b/arch/arm/mach-rockchip/bootm.c
@@ -1,9 +1,12 @@
+// SPDX-License-Identifier: GPL-2.0-only
+
#define pr_fmt(fmt) "rockchip-bootm-barebox: " fmt
#include <bootm.h>
#include <common.h>
#include <init.h>
#include <memory.h>
+#include <mach/rockchip/rockchip.h>
struct newidb_entry {
uint32_t sector;
@@ -85,7 +88,8 @@ static int do_bootm_rkns_barebox_image(struct image_data *data)
file_type_to_string(filetype));
if (filetype == filetype_arm_barebox) {
- barebox = buf + entry_start;
+ memmove(buf, buf + entry_start, image_size - entry_start);
+ barebox = buf;
goto found;
}
}
@@ -111,6 +115,9 @@ static struct image_handler image_handler_rkns_barebox_image = {
static int rockchip_register_barebox_image_handler(void)
{
+ if (rockchip_soc() < 0)
+ return 0;
+
return register_image_handler(&image_handler_rkns_barebox_image);
}
late_initcall(rockchip_register_barebox_image_handler);