[U-Boot] Can not boot Linux with new FIT image on ARMv8

Simon Glass sjg at chromium.org
Wed Jul 30 16:05:08 CEST 2014


Hi,

On 29 July 2014 10:04, Duxiaoqiang <duxiaoqiang at huawei.com> wrote:
> Hi All:
>
> I am trying to make use of verified Uboot on ARMv8 FVP platform.
> I setup environment followed the below procedure, but failed after entered Linux kernel.
> There was nothing prompt information except "Starting kernel".
> Operation procedure as bellow:
>
> 1)  Add CONFIG_OF_CONTROL/CONFIG_RSA/CONFIG_FIT_SIGNATURE/CONFIG_FIT/CONFIG_OF_SEPARATE to vexpress_aemv8a.h
>
> 2)       Generate RSA keys use openssl tool
>
> 3)  Create a kernel.its file that used to build the FIT image
>
> / {
>
> description = "Chrome OS kernel image with one or more FDT blobs";
>
> #address-cells = <1>;
>
>
>
> images {
>
>            kernel at 1 {
>
>          description = "kernel image";
>
>                     data = /incbin/("Image.gz");
>
>                     type = "kernel_noload";
>
>                     arch = "arm64";
>
>                     os = "linux";
>
>                     compression = "gzip";
>
>                     load = <0x89000000>;
>
>                     entry = <0x89000000>;
>
>                     kernel-version = <1>;
>
>                     signature at 1 {
>
>                              algo = "sha1,rsa2048";
>
>                              key-name-hint = "dev";
>
>                     };
>
>            };
>
>            fdt at 1 {
>
>                     description = "fdb blob";
>
>                     data = /incbin/("atf_psci.dtb");
>
>                     type = "flat_dt";
>
>                     arch = "arm64";
>
>                     compression = "none";
>
>                     fdt-version = <1>;
>
>                     signature at 1 {
>
>                              algo = "sha1,rsa2048";
>
>                              key-name-hint = "dev";
>
>                     };
>
>            };
>
>      ramsidk at 1 {

ramdisk

>
>          description="ramdisk";
>
>          data = /incbin/("filesystem.cpio.gz");
>
>          type = "ramdisk";
>
>                     arch = "arm64";
>
>                     os = "linux";
>
>                     compression = "gzip";
>
>                     load = <0xaa000000>;
>
>                     entry = <0xaa000000>;
>
>                     signature at 1 {
>
>                              algo = "sha1,rsa2048";
>
>                              key-name-hint = "dev";
>
>                     };
>
>      };
>
> };
>
> configurations {
>
>            default = "conf at 1";
>
>            conf at 1 {
>
>                     kernel = "kernel at 1";
>
>                     fdt = "fdt at 1";
>
>          ramdisk = "ramdisk at 1";
>
>            };
>
> };
>
> };
>
>
>
> 4)  Get the Image.gz and atf_psci.dtb and ramdisk file(These images and device tree blob files are verified before with old uImage format, and they are ok)
>
> 5)  Build Uboot enanbled FDT:
>
> # make vexpress_aemv8a_config
>
> # make CROSS_COMPILE=<> DEVICE_TREE=atf_psci all
>
> Before compile, CONFIG_OF_SEPARATE has been added to vexpress_aemv8a.h; Also atf_psci.dts file was added to arch/arm/dts directory.
>
> After build , u-boot-dtb.bin file was generated.
> 6)  Build and signed FIT image as:
>
>    # cp atf_psco.dtb atf_psci_public.dtb
>
> # mkimage -D "-I dts -O dtb -p 2000" -F -f kernel.its -k "key" -K atf_psci_public.dtb -r image.fit
> 7)  Build FDT uboot with public key
> # make CROSS_COMPILE=<> EXT_DTB=/WORK/atf_psci_public.dtb
> And public key attached u-boot-dtb.bin file was generated.
> 8)  Load FIT image image.fit to address 0xc3000004 on Foundation
>
> The images are verified successful, however system hangs after enter Linux.
> I debugged Linux kernel with console output, and found that before function start_kernel be called it is normal.
> (After __turn_mmu_on function on kernel, the MMU was enabled, and my console output is invalid for not been mapped. So my debug was stopped before start_kernel. But I believe there is no obstacle between __turn_mmu_on function and start_kernel function).
> And also, I checked the input parameter fdt_blob for kernel, the address seems normal.
>
> This problem has confused me several days, I will appreciated if you can give me susggestions.

You could try 'setenv verify n' to turn off verification. That will
make sure that the problem is actually related to verified boot. Does
the image boot OK without verified boot?

It says:

>    Loading Device Tree to 000000009fe00000, end 000000009fe04a91 ... fdt_rsv_mem_addr = 00000000c32b2540

Is that a valid address? What addresses are the kernel, FDT and
ramdisk loaded to when you use the legacy image?

Everything looks OK to me on the U-Boot side.

> Logs are bellow.
> =====================Logs are bellow===================
> Trying 127.0.0.1...
> Connected to localhost.
> Escape character is '^]'.
> Booting trusted firmware boot loader stage 1
> Built : 10:44:52, Jul 29 2014
> Booting trusted firmware boot loader stage 2
> BL2 Built : 10:44:54, Jul 29 2014
> Booting trusted firmware boot loader stage 3
> BL31 Built : 10:44:56, Jul 29 2014
> BL33 image pc = 0x88000000
>
> U-Boot 2014.07-rc4 (Jul 29 2014 - 10:43:19) vexpress_aemv8a
>
> U-Boot code: 88000000 -> 88039BF0  BSS: -> 8806FB00
> monitor len: 0006FB00
> ramsize: 78000000
> Top of RAM usable for U-Boot at: 100000000
> Reserving 446k for U-Boot at: fff90000
> Reserving 136k for malloc() at: fff6e000
> Reserving 56 Bytes for Board Info at: fff6dfc8
> Reserving 264 Bytes for Global Data at: fff6dec0
> Reserving 11936 Bytes for FDT at: fff6b020
> New Stack Pointer is: fff6b020
> RAM Configuration:
> Bank #0: 88000000 1.9 GiB
> relocation Offset is: 77f90000
> monitor flash len: 00039BF0
> Now running in RAM - U-Boot at: fff90000
> fdtdec_get_config_int: load-environment
> Using default environment
>
> Destroy Hash Table: 00000000fffc3b00 table = 0000000000000000
> Create Hash Table: N=91
> INSERT: table 00000000fffc3b00, filled 1/97 rv 00000000fff6e220 ==> name="bootargs" value="console=ttyAMA0 root=/dev/ram0"
> INSERT: table 00000000fffc3b00, filled 2/97 rv 00000000fff6e6f8 ==> name="bootcmd" value="bootm $kernel_addr $initrd_addr:$initrd_size $fdt_addr"
> INSERT: table 00000000fffc3b00, filled 3/97 rv 00000000fff6e338 ==> name="baudrate" value="115200"
> INSERT: table 00000000fffc3b00, filled 4/97 rv 00000000fff6ea90 ==> name="kernel_addr" value="0x200000"
> INSERT: table 00000000fffc3b00, filled 5/97 rv 00000000fff6e6d0 ==> name="initrd_addr" value="0xa00000"
> INSERT: table 00000000fffc3b00, filled 6/97 rv 00000000fff6e1d0 ==> name="initrd_size" value="0x2000000"
> INSERT: table 00000000fffc3b00, filled 7/97 rv 00000000fff6e1f8 ==> name="fdt_addr" value="0x100000"
> INSERT: table 00000000fffc3b00, filled 8/97 rv 00000000fff6ec70 ==> name="fdt_high" value="0xa0000000"
> INSERT: free(data = 00000000fff6e010)
> INSERT: done
> In:    serial
> Out:   serial
> Err:   serial
> Initial value for argc=3
> Final value for argc=3
> Initial value for argc=3
> Final value for argc=3
> Initial value for argc=3
> Final value for argc=3
> Net:   Initial value for argc=3
> Final value for argc=3
> SMC91111-0
> Warning: failed to set MAC address
>
> Warning: Your board does not use generic board. Please read
> doc/README.generic-board and take action. Boards not
> upgraded by the late 2014 may break or be removed.
> fdtdec_get_config_int: bootdelay
> ### main_loop entered: bootdelay=-1
>
> fdtdec_get_config_int: kernel-offset
> fdtdec_get_config_int: rootdisk-offset
> fdtdec_get_config_string: bootcmd
> fdtdec_get_config_int: bootsecure
> ### main_loop: bootcmd="bootm $kernel_addr $initrd_addr:$initrd_size $fdt_addr"
> VExpress64# printenv bootargs
> bootargs=console=ttyAMA0 root=/dev/ram0
> VExpress64# bootm 0xc3000004
> ## Current stack ends at 0xfff6ac80 *  kernel: cmdline image address = 0xc3000004
> ## Loading kernel from FIT Image at c3000004 ...
> No configuration specified, trying default...
> Found default configuration: 'conf at 1'
>    Using 'conf at 1' configuration
>    Verifying Hash Integrity ... fit_config_check_sig: fdt=00000000fff6b020, conf='signature at 1', sig='key-dev'
> sha1,rsa2048:devHash nodes (6):
>    '/'
>    '/configurations/conf at 1'
>    '/images/fdt at 1'
>    '/images/fdt at 1/hash at 1'
>    '/images/kernel at 1'
>    '/images/kernel at 1/hash at 1'
> Hash regions:
>     Offset       Size
>         38         a0
>     2b241c         ec
>     2b3fa8         94
>   1859a7a8         18
>   1859a7d4         60
>   1859aa48         14
>   1859aa5c         e0
> fdtdec_get_int: rsa,num-bits: 0x800 (2048)
> fdtdec_get_int: rsa,n0-inverse: 0x259912c1 (630788801)
> key length 64
> Checksum algorithm: sha1+ OK
>    Trying 'kernel at 1' kernel subimage
>      Description:  linux kernel image
>      Type:         Kernel Image
>      Compression:  gzip compressed
>      Data Start:   0xc30000e8
>      Data Size:    2827062 Bytes = 2.7 MiB
>      Architecture: AArch64
>      OS:           Linux
>      Load Address: 0x89000000
>      Entry Point:  0x89000000
>      Hash node:    'hash at 1'
>      Hash algo:    sha1
>      Hash value:   402de3d5fd74c0de7dc997097a3b45474a659cde
>      Hash len:     20
>    Verifying Hash Integrity ... sha1+ OK
>       kernel data at 0xc30000e8, len = 0x002b2336 (2827062)
> *  ramdisk: using config 'conf at 1' from image at 0xc3000004
> ## Loading ramdisk from FIT Image at c3000004 ...
>    Using 'conf at 1' configuration
>    Trying 'ramdisk at 1' ramdisk subimage
>      Description:  RAMDISK Image
>      Type:         RAMDisk Image
>      Compression:  gzip compressed
>      Data Start:   0xc32b4078
>      Data Size:    405694073 Bytes = 386.9 MiB
>      Architecture: AArch64
>      OS:           Linux
>      Load Address: 0xaa000000
>      Entry Point:  0xaa000000
>      Hash node:    'hash at 1'
>      Hash algo:    sha1
>      Hash value:   cfc58f934035c7bf52109283be7cdbdb8d6c1640
>      Hash len:     20
>    Verifying Hash Integrity ... sha1+ OK
>    ramdisk start = 0xc32b4078, ramdisk end = 0xdb59a6f1
> *  fdt: using config 'conf at 1' from image at 0xc3000004
> ## Checking for 'FDT'/'FDT Image' at c3000004
> ## Loading fdt from FIT Image at c3000004 ...
>    Using 'conf at 1' configuration
>    Trying 'fdt at 1' fdt subimage
>      Description:  FDT blob
>      Type:         Flat Device Tree
>      Compression:  uncompressed
>      Data Start:   0xc32b2518
>      Data Size:    6802 Bytes = 6.6 KiB
>                Architecture: AArch64
>      Hash node:    'hash at 1'
>      Hash algo:    sha1
>      Hash value:   10550f02e9ebd95db9dc257625dc42b7bb2295c9
>      Hash len:     20
>    Verifying Hash Integrity ... sha1+ OK
> Can't get 'load' property from FIT 0xc3000004, node: offset 2827436, name fdt at 1 (FDT_ERR_NOTFOUND)
>    Booting using the fdt blob at 0xc32b2518
>    of_flat_tree at 0xc32b2518 size 0x00001a92
> Initial value for argc=3
> Final value for argc=3
>    Uncompressing Kernel Image ... OK
>    kernel loaded at 0x89000000, end = 0x895a0338
> using----------------: FDT
> fdt address is 00000000c32b2518
> boot_fdt_add_mem_rsv
> fdt_blob = 00000000c32b2518
> fdt_check_header
> fdt_num_mem_rsv
> fdt_rsv_mem_addr = 00000000c32b2540
> total = 1
> fdt_get_mem_rsv index_0
> addr = 00000000c32b2540
>    reserving fdt memory region: addr=80000000 size=10000
> boot_get_cmdline
> boot_ramdisk_high
> ## initrd_high = 0xffffffffffffffff, copy_to_ram = 1
>    Loading Ramdisk from c32b4078 to e7c83000, end fff69679 ... OK
>    ramdisk load start = 0xe7c83000, ramdisk load end = 0xfff69679
> boot_relocate_fdt
>    Loading Device Tree to 000000009fe00000, end 000000009fe04a91 ... fdt_rsv_mem_addr = 00000000c32b2540
> OK
> Initial value for argc=3
> Final value for argc=3
> image_setup_libfdt
> No ethernet MAC Address defined
> ## Transferring control to Linux (at address 89000000)...
> ## Fdt: 9fe00000
>
> Starting kernel ...
>
> "345678P9 at AB    <-----(PS: These information are added by me in Linux kernel)
>
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>

Regards,
Simon


More information about the U-Boot mailing list