From c13e400a31fceb64bd985ac48ef9c52b7502318b Mon Sep 17 00:00:00 2001 From: Nathan Whitehorn Date: Thu, 25 Jan 2018 05:13:40 +0000 Subject: Add limited read-only support for older (V2 and V3) device tree to libfdt. This can be useful in particular in the kernel when booting on systems with FDT-emitting firmware that is out of date. Releases of kexec-tools on ppc64 prior to the end of 2014 are notable examples of such. Signed-off-by: Nathan Whitehorn [dwg: Some whitespace cleanups] Signed-off-by: David Gibson --- cpukit/include/libfdt.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'cpukit/include/libfdt.h') diff --git a/cpukit/include/libfdt.h b/cpukit/include/libfdt.h index baa882cfa1..c8c00fa865 100644 --- a/cpukit/include/libfdt.h +++ b/cpukit/include/libfdt.h @@ -54,7 +54,7 @@ #include #include -#define FDT_FIRST_SUPPORTED_VERSION 0x10 +#define FDT_FIRST_SUPPORTED_VERSION 0x02 #define FDT_LAST_SUPPORTED_VERSION 0x11 /* Error codes: informative error codes */ @@ -527,6 +527,9 @@ int fdt_next_property_offset(const void *fdt, int offset); * offset. If lenp is non-NULL, the length of the property value is * also returned, in the integer pointed to by lenp. * + * Note that this code only works on device tree versions >= 16. fdt_getprop() + * works on all versions. + * * returns: * pointer to the structure representing the property * if lenp is non-NULL, *lenp contains the length of the property -- cgit v1.2.3