summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mvebu
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2018-05-31 23:28:17 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2018-06-04 08:54:47 +0200
commitbf8b6d46db9274c364947a22163b16e05f74211c (patch)
tree38a18947ce78b1ad824d0e972ca8aa621ec3157a /arch/arm/mach-mvebu
parentb086bf35dc8b1fc02bca67979e1a3420d21768c6 (diff)
downloadbarebox-bf8b6d46db9274c364947a22163b16e05f74211c.tar.gz
barebox-bf8b6d46db9274c364947a22163b16e05f74211c.tar.xz
kwbimage_v0: add support to detect and boot a mvebu v0 image
The differences between v0 and v1 of the mvebu kwbimage are small enough that the function to boot such an image can be shared between both variants. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mvebu')
-rw-r--r--arch/arm/mach-mvebu/kwbootimage.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/arch/arm/mach-mvebu/kwbootimage.c b/arch/arm/mach-mvebu/kwbootimage.c
index 8d364ceb7b..e379d732fe 100644
--- a/arch/arm/mach-mvebu/kwbootimage.c
+++ b/arch/arm/mach-mvebu/kwbootimage.c
@@ -10,7 +10,7 @@
#include <asm/unaligned.h>
#include <mach/common.h>
-static int do_bootm_kwbimage_v1(struct image_data *data)
+static int do_bootm_kwbimage_v0_v1(struct image_data *data)
{
int fd, ret;
loff_t offset;
@@ -69,14 +69,21 @@ out_free:
return ret;
}
+static struct image_handler image_handler_kwbimage_v0_handler = {
+ .name = "MVEBU kwbimage v0",
+ .bootm = do_bootm_kwbimage_v0_v1,
+ .filetype = filetype_kwbimage_v0,
+};
+
static struct image_handler image_handler_kwbimage_v1_handler = {
.name = "MVEBU kwbimage v1",
- .bootm = do_bootm_kwbimage_v1,
+ .bootm = do_bootm_kwbimage_v0_v1,
.filetype = filetype_kwbimage_v1,
};
static int mvebu_register_kwbimage_image_handler(void)
{
+ register_image_handler(&image_handler_kwbimage_v0_handler);
register_image_handler(&image_handler_kwbimage_v1_handler);
return 0;