summaryrefslogtreecommitdiffstats
path: root/common/filetype.c
diff options
context:
space:
mode:
authorJan Weitzel <j.weitzel@phytec.de>2012-09-06 14:41:11 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2012-09-07 10:31:54 +0200
commit75831d168720aabd80da31c24677bf75c35bb1a9 (patch)
treef342f5371cc5e212acdb0e0ff0a0dba888de9071 /common/filetype.c
parent33ac4ef69e0a0425a249ff028b59f5004f24f926 (diff)
downloadbarebox-75831d168720aabd80da31c24677bf75c35bb1a9.tar.gz
xload: get barebox size from barebox_arm_head
Add functions to read the barebox_arm_head, check barebox magicword and read out the barebox image size. Create a inital partion of 1Mb to access the barebox image on nand. Signed-off-by: Jan Weitzel <j.weitzel@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/filetype.c')
-rw-r--r--common/filetype.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/filetype.c b/common/filetype.c
index e736d43..6306fdc 100644
--- a/common/filetype.c
+++ b/common/filetype.c
@@ -75,7 +75,7 @@ enum filetype file_detect_type(void *_buf)
if (strncmp(buf8, "#!/bin/sh", 9) == 0)
return filetype_sh;
- if (buf[8] == 0x65726162 && buf[9] == 0x00786f62)
+ if (is_barebox_arm_head(_buf))
return filetype_arm_barebox;
if (buf[9] == 0x016f2818 || buf[9] == 0x18286f01)
return filetype_arm_zimage;