diff options
author | Nicolas Pitre <nicolas.pitre@linaro.org> | 2011-09-13 22:37:07 -0400 |
---|---|---|
committer | Nicolas Pitre <nico@fluxnic.net> | 2011-09-14 13:51:59 -0400 |
commit | b90b9a38251e9c89c34179eccde57411ceb5f1aa (patch) | |
tree | 88d324970a195a540e86628cd2edc02243a3d38a /arch/arm/boot/compressed/libfdt_env.h | |
parent | df4879fa2603fbf0804a80f9f146ef9023dd621f (diff) | |
download | op-kernel-dev-b90b9a38251e9c89c34179eccde57411ceb5f1aa.zip op-kernel-dev-b90b9a38251e9c89c34179eccde57411ceb5f1aa.tar.gz |
ARM: zImage: allow supplementing appended DTB with traditional ATAG data
Some old bootloaders can't be updated to a device tree capable one,
yet they provide ATAGs with memory configuration, the ramdisk address,
the kernel cmdline string, etc. To allow a device tree enabled
kernel to be used with such bootloaders, it is necessary to convert those
ATAGs into FDT properties and fold them into the DTB appended to zImage.
Currently the following ATAGs are converted:
ATAG_CMDLINE
ATAG_MEM
ATAG_INITRD2
If the corresponding information already exists in the appended DTB, it
is replaced, otherwise the required node is created to hold it.
The code looks for ATAGs at the location pointed by the value of r2 upon
entry into the zImage code. If no ATAGs are found there, an attempt at
finding ATAGs at the typical 0x100 offset from start of RAM is made.
Otherwise the DTB is left unchanged.
Thisstarted from an older patch from John Bonesio <bones@secretlab.ca>,
with contributions from David Brown <davidb@codeaurora.org>.
Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Tested-by: Shawn Guo <shawn.guo@linaro.org>
Tested-by: Dave Martin <dave.martin@linaro.org>
Tested-by: Thomas Abraham <thomas.abraham@linaro.org>
Diffstat (limited to 'arch/arm/boot/compressed/libfdt_env.h')
-rw-r--r-- | arch/arm/boot/compressed/libfdt_env.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/arm/boot/compressed/libfdt_env.h b/arch/arm/boot/compressed/libfdt_env.h new file mode 100644 index 0000000..1f4e718 --- /dev/null +++ b/arch/arm/boot/compressed/libfdt_env.h @@ -0,0 +1,15 @@ +#ifndef _ARM_LIBFDT_ENV_H +#define _ARM_LIBFDT_ENV_H + +#include <linux/types.h> +#include <linux/string.h> +#include <asm/byteorder.h> + +#define fdt16_to_cpu(x) be16_to_cpu(x) +#define cpu_to_fdt16(x) cpu_to_be16(x) +#define fdt32_to_cpu(x) be32_to_cpu(x) +#define cpu_to_fdt32(x) cpu_to_be32(x) +#define fdt64_to_cpu(x) be64_to_cpu(x) +#define cpu_to_fdt64(x) cpu_to_be64(x) + +#endif |