summaryrefslogtreecommitdiffstats
path: root/lib/fdtdec.c
diff options
context:
space:
mode:
authorHeiko Schocher <hs@denx.de>2014-03-03 12:19:30 +0100
committerTom Rini <trini@ti.com>2014-03-21 16:40:38 -0400
commit29a23f9d6c533f8371be3ae0268c4c75866291b2 (patch)
treecb7e69f6a7903ac5f63c03f99aa4f34b9fd151d7 /lib/fdtdec.c
parent6bf4ca076f8c7a3c1c5abd1cbb059516f7af15df (diff)
downloadblackbird-obmc-uboot-29a23f9d6c533f8371be3ae0268c4c75866291b2.tar.gz
blackbird-obmc-uboot-29a23f9d6c533f8371be3ae0268c4c75866291b2.zip
tools, fit_check_sign: verify a signed fit image
add host tool "fit_check_sign" which verifies, if a fit image is signed correct. Signed-off-by: Heiko Schocher <hs@denx.de> Cc: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'lib/fdtdec.c')
-rw-r--r--lib/fdtdec.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index f65ab4f58f..8da2d74041 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -3,6 +3,7 @@
* SPDX-License-Identifier: GPL-2.0+
*/
+#ifndef USE_HOSTCC
#include <common.h>
#include <serial.h>
#include <libfdt.h>
@@ -643,3 +644,22 @@ int fdtdec_read_fmap_entry(const void *blob, int node, const char *name,
return 0;
}
+#else
+#include "libfdt.h"
+#include "fdt_support.h"
+
+int fdtdec_get_int(const void *blob, int node, const char *prop_name,
+ int default_val)
+{
+ const int *cell;
+ int len;
+
+ cell = fdt_getprop_w((void *)blob, node, prop_name, &len);
+ if (cell && len >= sizeof(int)) {
+ int val = fdt32_to_cpu(cell[0]);
+
+ return val;
+ }
+ return default_val;
+}
+#endif
OpenPOWER on IntegriCloud