Device Tree append support in QorIQ-SDK-V1.9-20151210-yocto?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Device Tree append support in QorIQ-SDK-V1.9-20151210-yocto?

2,591 Views
nobelsharanyanj
Contributor III

Hi,

I am using P1010RDB board as well as custom board. Instead of having separate device tree blob I planned to append the device tree blob along with the kernel image.

does the current kernel support (CONFIG_XXX_APPENDED_DTB)?

if not does freescale support this feature in future?

 

regards

Nobel

Labels (1)
0 Kudos
4 Replies

762 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello nobel sharanyan jeganathan,

The option CONFIG_XXX_APPENDED_DTB is not provided in SDK 1.9 Linux Kernel, you could edit the Makefile to generate uImage with dtb appended.

You could edit (obj)/uImage.% definition in arch/powerpc/boot/Makefile as the following.

(obj)/uImage.%: vmlinux  $(obj)/dts/%.dtb  $(wrapperbits)

        $(call if_changed,wrap,uboot,,$(obj)/dts/$*.dtb)

Then use the following command to generate uImage.

make uImage.p1010rdb-pb ARCH=powerpc CROSS_COMPILE="powerpc-fsl-linux-gnuspe-" CC="powerpc-fsl-linux-gnuspe-gcc --sysroot=/home/b25805/test/QorIQ-SDK-V1.9-20151210-yocto/build_p1010rdb/tmp/sysroots/p1010rdb" LOADADDR=20008000

Thanks,

Yiping

762 Views
nobelsharanyanj
Contributor III

Hi Yiping,

Thanks, when you append device tree to zImage/uImage, how does the kernel knows where to look for device tree? because for u-boot it look like a single image and there is no information to uboot. There should be a cpu registers which hold such detail about where to look for device tree blob when kernel boot. correct me if I am wrong.

I am doing it in other way, from uImage create zImage by removing 65 bytes header. Create Multi image with the combination of zImage, ramdisk.cpio.gz and device tree blob by mkimage. there is an another efficient way by using  "flattened image tree".(right now I am not looking into it).

even though my goal is to append device tree, with the help of multi image I have appended ramdisk, dtb with zImage.

Regards

Nobel

0 Kudos

762 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello Nobel,

You could use the method for ARM64 Layerspace platform, please refer to the following example.

The following is the content of kernel-rdb.its, use the command "mkimage -f kernel-rdb.its kernel.itb" to generate kernel.itb which includes Kernel image, dts and ramdisk filesystem.

/dts-v1/;

/ {

        description = "RDB Image file for the LS2085A Linux Kernel";

        #address-cells = <1>;

        images {

                kernel@1 {

                        description = "ARM64 Linux kernel";

                        data = /incbin/("Image.gz");

                        type = "kernel";

                        arch = "arm64";

                        os = "linux";

                        compression = "gzip";

                        load = <0x80080000>;

                        entry = <0x80080000>;

                };

                fdt@1 {

                        description = "Flattened Device Tree blob";

                        data = /incbin/("Image-fsl-ls2085a-rdb.dtb");

                        type = "flat_dt";

                        arch = "arm64";

                        compression = "none";

                        load = <0x90000000>;

                };

                ramdisk@1 {

                        description = "LS2 Ramdisk";

                        data = /incbin/("fsl-image-core-ls2085ardb.ext2.gz");

                        type = "ramdisk";

                        arch = "arm64";

                        os = "linux";

                        compression = "none";

                };

        };

      configurations {

                default = "config@1";

                config@1 {

                        description = "Boot Linux kernel";

                        kernel = "kernel@1";

                        fdt = "fdt@1";

                        ramdisk = "ramdisk@1";

                };

        };

};

You need to modify kernel-rdb.its according to your target, run "bitbake u-boot-mkimage-native" to generate mkimage command, export the PATH "build_<platform>_release/tmp/sysroots/x86_64-linux/usr/bin/"  for "mkimage" and "dtc" command.


Have a great day,
Yiping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

762 Views
nobelsharanyanj
Contributor III

Hi Yiping,

let you know once I validated above *.its file.

for your information, I am using P1010(powerpc) not arm hope that should not be problem in using the files.

Regards

Nobel

0 Kudos