From f7d783cc292186266622cfebb552fcf695aefd46 Mon Sep 17 00:00:00 2001 From: Nicolas Pitre Date: Tue, 13 Sep 2011 22:37:07 -0400 Subject: 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 , with contributions from David Brown . Signed-off-by: Nicolas Pitre Tested-by: Shawn Guo Tested-by: Dave Martin Tested-by: Thomas Abraham Signed-off-by: Chinmay Kamat Change-Id: Ifb96adf6976da0f518c9c2cdad6be85f94c8ad1c Original: b90b9a38251e9c89c34179eccde57411ceb5f1aa Reviewed-on: http://git-master/r/107423 Reviewed-by: Simone Willett Tested-by: Simone Willett --- arch/arm/Kconfig | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'arch/arm/Kconfig') diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index fc9d147ae30e..bc3e8dc005bb 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1960,6 +1960,18 @@ config ARM_APPENDED_DTB location into r2 of a bootloader provided DTB is always preferable to this option. +config ARM_ATAG_DTB_COMPAT + bool "Supplement the appended DTB with traditional ATAG information" + depends on ARM_APPENDED_DTB + help + Some old bootloaders can't be updated to a DTB capable one, yet + they provide ATAGs with memory configuration, the ramdisk address, + the kernel cmdline string, etc. Such information is dynamically + provided by the bootloader and can't always be stored in a static + DTB. To allow a device tree enabled kernel to be used with such + bootloaders, this option allows zImage to extract the information + from the ATAG list and store it at run time into the appended DTB. + config CMDLINE string "Default kernel command string" default "" -- cgit v1.2.3