[PATCH] Arm:add dtbimage.<dt> and dtbuimage.<dt> rules

Source: Internet
Author: User
Tags diff zinstall

Reproduced:

http://permalink.gmane.org/gmane.linux.kbuild.devel/8755

This rules is useful for appended device tree conforming to the CONFIG_ARM_APPENDED_DTB kernel option. The rule dtbimage.<dt> is actually just a:
Cat Zimage <DT>.DTB > Dtbimage.<dt>the dtbuimage.<dt> makes an uimage out of the dtbimage.<dt> File. Kernelversion:v3.6-rc5

signed-off-by:richard Genoud <richard.genoud <at> gmail.com>---arch/arm/makefile | 30 ++++++++++++++++--------------Arch/arm/Boot/makefile | 11 +++++++++++Scripts/makefile.lib | 6 ++++++ 3FilesChanged, insertions (+), deletions (-)diff--git a/arch/arm/makefile b/arch/arm/Makefileindex 30eae87.. c5f2673 100644---a/arch/arm/Makefile+ + b/arch/arm/Makefile<at> <at> -278,7 +278,7 <at> <at>Archprepare:#Convert bzimage to Zimage bzimage:zimage-zimage Image xipimage bootpimage uimage:vmlinux+zimage Image xipimage bootpimage uimage dtbimage.% dtbuimage.%: Vmlinux$ (Q) $ (make) $ (build) =$ (Boot) machine=$ (machine) $ (Boot)/$ <at>Zinstall Uinstall Install:vmlinux<at> <at> -300,17 +300,19 <at> <at> i zi:; $ (Q) $ (make) $ (build) =$ (Boot) machine=$ (machine) $ <at>define archhelp-Echo' * zimage-compressed kernel image (arch/$ (arch)/Boot/zimage)'-Echo' Image-uncompressed kernel Image (arch/$ (Arch)/Boot/image)'-Echo' * XIPIMAGE-XIP kernel image,ifConfigured (arch/$ (arch)/Boot/xipimage)'-Echo' uimage-u-Bootwrapped zimage '-Echo' bootpimage-combined zimage and initial RAM disk '-Echo' (Supply INITRD image via make variable initrd=<Path>)'-Echo' Dtbs-buildDevice TreeBLOBs forenabled boards '-Echo' Install-install uncompressed kernel '-Echo' Zinstall-install compressed kernel '-Echo' Uinstall-install uBootwrapped compressed kernel '-Echo' Install using (Your) ~/bin/$ (Installkernel)or '-Echo' (distribution)/sbin/$ (Installkernel)or '-Echo' Install to $$ (Install_path) andRunLilo '+Echo' * zimage-compressed kernel image (arch/$ (arch)/Boot/zimage)'+Echo' Image-uncompressed kernel Image (arch/$ (Arch)/Boot/image)'+Echo' * XIPIMAGE-XIP kernel image,ifConfigured (arch/$ (arch)/Boot/xipimage)'+Echo' uimage-u-Bootwrapped Zimage '+Echo' bootpimage-combined zimage and initial RAM disk '+Echo' (Supply INITRD image via make variable initrd=<Path>)'+Echo' Dtbs-buildDevice TreeBLOBs forenabled boards '+Echo' Dtbimage.<dt>-zimage with an appendedDevice Treeblob '+Echo' Dtbuimage.<dt>-uimage with an embeddedDevice Treeblob '+Echo' install-install uncompressed kernel '+Echo' Zinstall-install compressed kernel '+Echo' Uinstall-install uBootwrapped compressed kernel '+Echo' Install using (Your) ~/bin/$ (Installkernel)or '+Echo' (distribution)/sbin/$ (Installkernel)or '+Echo' Install to $$ (Install_path) andRunLilo ' Endefdiff--git a/arch/arm/Boot/makefile b/arch/arm/Boot/Makefileindex c877087.. 35c01a8 100644---a/arch/arm/Boot/Makefile+ + b/arch/arm/Boot/Makefile<at> <at> -98,6 +98,17 <at> <at> $ (obj)/bootpimage: $ (obj)/bootp/BOOTP Force$(PagerIf_changed,objcopy) <at>Echo' Kernel: $ <at>is ready '+# dtbimage.%-A dtbimage is a zimage with an appendedDevice Treeblob+$ (obj)/dtbimage.%: $ (obj)/zimage $ (obj)/%.DTB Force+    $(PagerIF_CHANGED,CAT) + <at>Echo' Kernel: $ <at>is ready '++# dtbuimage.%-A dtbuimage is a uimage with an embeddedDevice Treeblob+$ (obj)/dtbuimage.%: $ (obj)/dtbimage.% Force+ <at> $ (CHECK_FOR_MULTIPLE_LOADADDR) + $ (PagerIf_changed,uimage) + <at>Echo' Image $ <at>is ready '+Phony+=initrd Force initrd:<at> Test "$ (initrd_phys)"! = "" | | \diff--git a/scripts/makefile.lib B/scripts/makefile.Libindex 0be6f11.. 8550466 100644---a/scripts/makefile.Lib+ + + B/scripts/makefile.Lib<at> <at> -235,6 +235,12 <at> <at> cmd_ld = $ (LD) $ (ldflags) $ (ldflags-y) $ (ldflags_$ (<at > F)) \quiet_cmd_objcopy= Objcopy $ <at>cmd_objcopy= $ (objcopy) $ (objcopyflags) $ (objcopyflags_$ (<at> F)) $< $ <at> +#Cat+# ---------------------------------------------------------------------------++quiet_cmd_cat = Cat $ <at> +cmd_cat = (cat $ (filter-out force,$^) > $ <at>) | | (Rm-f $ <at>; false) + #Gzip# -----------------------------------------------------------------------------

Reproduced:

Https://www.osadl.org/Single-View.111+M5297463051f.0.html

How can I boot a recent kernel?

Yes, some vendors still ship bootloaders without device tree support, since their vendor kernel does no know what a Devic E tree is and, thus, the bootloader neither does. But, fortunately, kernel developers is aware of it and implemented the

Config_arm_appended_dtb

Feature. What's this?

Append The device tree to the kernel

Since the bootloader loads the kernel into memory without asking any questions, we can fool the bootloader by making the K Ernel a little larger and append the device tree at its end. During the first steps of kernel initialization, the device tree is searched for at the end of the regular kernel code and Used as if it had been loaded separately.

How does I prepare the kernel for this procedure?

In any case, config_arm_appended_dtb=y must is configured. If zimage is used to boot, simply execute

Cd/usr/src/kernels/your-linux-tree
CD Arch/your-arch/boot
Cat Zimage DTS/YOUR-DEVICE-TREE.DTB >ZIMAGE-WITH-DTB

After have compiled the kernel as usual. If the uimage format is needed, you still has to execute the above commands. In addition, create a uimage file based on the combined zimage kernel as follows

CP Zimage ZIMAGE-WITHOUT-DTB
CP ZIMAGE-WITH-DTB Zimage
CD-
Make loadaddr= $YOUR _loadaddr arch=your-arch uimage
CD-
CP ZIMAGE-WITHOUT-DTB Zimage

And let the bootloader load the uimage file, now contains both the kernel and device tree.

Check for the correct model string

If everything worked correctly, you should see a line

Machine:your Generic Board (flattened Device Tree), Model:your model string

That corresponds to the related setting in your device tree. This was one of the first output lines after the kernel started execution.

[PATCH] Arm:add dtbimage.<dt> and dtbuimage.<dt> rules

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.