This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux: Keystone2 image tree blob support

Tool/software: Linux

Hi,

    I'd like to know if for c66ak2h is possible boot with a multifile containing monitor+kernel+ramdisk+fdt+fpga+etc...
I have created this its file:

/*
 * U-Boot uImage source file with multiple kernels, ramdisks and FDT blobs
 */

/dts-v1/;

/ {
    description = "Various kernels, ramdisks and FDT blobs";
    #address-cells = <1>;

    images {
/*
        uboot {
            description = "U-Boot";
            type = "standalone";
            arch = "arm";
            compression = "none";
            load = <0x0C000000>;
        };

        atf {
            description = "ARM Trusted Firmware";
            type = "firmware";
            arch = "arm";
            compression = "none";
            load = <0x18000>;
            entry = <0x18000>;
        };
*/

        firmware@1 {
            description = "Boot monitor";
            data = /incbin/("./board-support/boot-monitor-4.0+gitAUTOINC+e1f885ab6d/skern-k2hk");
            type = "firmware";
            arch = "arm";
            compression = "none";
            load = <0x0c5f0000>;
            entry = <0x0c5f0000>;
            hash@1 {
                algo = "md5";
            };
            hash@2 {
                algo = "sha1";
            };
        };

/*
        firmware@1 {
            description = "Boot monitor2";
            data = /incbin/("./board-support/boot-monitor-4.0+gitAUTOINC+e1f885ab6d/soc/k2hk/s-kernel.out");
            type = "firmware";
            arch = "arm";
            compression = "none";
            load = <0x0c5f0000>;
            entry = <0x0c5f0000>;
            hash@1 {
                algo = "md5";
            };
            hash@2 {
                algo = "sha1";
            };
        };

        firmware@2 {
            description = "Boot monitor3";
            data = /incbin/("./board-support/boot-monitor-4.0+gitAUTOINC+e1f885ab6d/soc/k2hk/nonsec.out");
            type = "firmware";
            arch = "arm";
            compression = "none";
            load = <0x0c5f0000>;
            entry = <0x0c5f0000>;
            hash@1 {
                algo = "md5";
            };
            hash@2 {
                algo = "sha1";
            };
        };
*/

        kernel@1 {
            description = "Board Kernel";
            data = /incbin/("./board-support/linux-rt-4.14.40+gitAUTOINC+d5443cbd3b-gd5443cbd3b/arch/arm/boot/zImage");
            type = "kernel";
            arch = "arm";
            os = "linux";
            compression = "none";
            load = <0x80000000>;
            entry = <0x80000000>;
            hash@1 {
                algo = "md5";
            };
            hash@2 {
                algo = "sha1";
            };
        };

/*
        kernel@2 {
            description = "Kernel 2.4.25";
            data = /incbin/("./2.4.25Image");
            type = "kernel";
            arch = "arm";
            os = "linux";
            compression = "gzip";
            load = <00000000>;
            entry = <00000000>;
            hash@1 {
                algo = "md5";
            };
        };

        ramdisk@1 {
            description = "Linux ramdisk";
            data = /incbin/("./ramdisk");
            type = "ramdisk";
            arch = "arm";
            os = "linux";
            compression = "gzip";
            load = <0x???00000>;
            entry = <0x???00000>;
            hash@1 {
                algo = "sha1";
            };
        };

        initrd {
            description = "Linux initrd";
            type = "ramdisk";
            compression = "none";
            load = <0x??00000>;
            arch = "arm";
        };
*/
        fdt@1 {
            description = "Board fdt";
            data = /incbin/("./board-support/linux-rt-4.14.40+gitAUTOINC+d5443cbd3b-gd5443cbd3b/arch/arm/boot/dts/keystone-k2hk-evm.dtb");
            type = "flat_dt";
            load = <0x87000000>;
            arch = "arm";
            compression = "none";
            hash@1 {
                algo = "crc32";
            };

/*
        fpga@1 {
            description = "FPGA";
            data = /incbin/("/tftpboot/download.bit");
            type = "fpga";
            arch = "arm";
            compression = "none";
            load = <0x90000000>;
            hash@1 {
                algo = "md5";
            };
*/
        };
    };

    configurations {
        default = "config@1";

        config@1{
            description ="Board conf1";
            /*loadables = "uboot", "atf", "kernel", "initrd";*/
            loadables = "firmware@1", "kernel@1", "fdt@1";
            kernel = "kernel@1";
            firmware = "firmware@1";
            /*ramdisk = "ramdisk@1";*/
            fdt = "fdt@1";
            /*fpga = "fpga@1";*/
        };
    };
};

The output file is:

@@@@@@@@@@@@@@@@@@@@@@@ Multi @@@@@@@@@@@@@@@@@@@@@@@@
Warning (unit_address_vs_reg): Node /images/firmware@1 has a unit name, but no reg property
Warning (unit_address_vs_reg): Node /images/firmware@1/hash@1 has a unit name, but no reg property
Warning (unit_address_vs_reg): Node /images/firmware@1/hash@2 has a unit name, but no reg property
Warning (unit_address_vs_reg): Node /images/kernel@1 has a unit name, but no reg property
Warning (unit_address_vs_reg): Node /images/kernel@1/hash@1 has a unit name, but no reg property
Warning (unit_address_vs_reg): Node /images/kernel@1/hash@2 has a unit name, but no reg property
Warning (unit_address_vs_reg): Node /images/fdt@1 has a unit name, but no reg property
Warning (unit_address_vs_reg): Node /images/fdt@1/hash@1 has a unit name, but no reg property
Warning (unit_address_vs_reg): Node /configurations/config@1 has a unit name, but no reg property
FIT description: Various kernels, ramdisks and FDT blobs
Created:         Fri Feb 15 13:49:07 2019
 Image 0 (firmware@1)
  Description:  Boot monitor
  Created:      Fri Feb 15 13:49:07 2019
  Type:         Firmware
  Compression:  uncompressed
  Data Size:    32768 Bytes = 32.00 KiB = 0.03 MiB
  Architecture: ARM
  Load Address: 0x0c5f0000
  Hash algo:    md5
  Hash value:   00b5d2d6da793f96d5bc392d14382e05
  Hash algo:    sha1
  Hash value:   29bdfafd03f3075ead0cd69382e22e22bbc46e00
 Image 1 (kernel@1)
  Description:  Board Kernel
  Created:      Fri Feb 15 13:49:07 2019
  Type:         Kernel Image
  Compression:  uncompressed
  Data Size:    3850752 Bytes = 3760.50 KiB = 3.67 MiB
  Architecture: ARM
  OS:           Linux
  Load Address: 0x80000000
  Entry Point:  0x80000000
  Hash algo:    md5
  Hash value:   1ca6cff3788a8eb9561469d34c468ef2
  Hash algo:    sha1
  Hash value:   a75ccc5e86990e863e9d7388f87550e2c4af2b3d
 Image 2 (fdt@1)
  Description:  Board fdt
  Created:      Fri Feb 15 13:49:07 2019
  Type:         Flat Device Tree
  Compression:  uncompressed
  Data Size:    39118 Bytes = 38.20 KiB = 0.04 MiB
  Architecture: ARM
  Load Address: 0x87000000
  Hash algo:    crc32
  Hash value:   dea8228d
 Default Configuration: 'config@1'
 Configuration 0 (config@1)
  Description:  Board conf1
  Kernel:       kernel@1
  FDT:          fdt@1
  Loadables:    firmware@1
                kernel@1
                fdt@1

The image is created and downloaded on board, but I can't find any command to use to run before the firmware (boot monitor) and then Linux.

Is it possible have a u-boot script to load monitor (and others parts)? and the command to do in u-boot shell to start thet script?

The Uboot version is:

U-Boot 2018.01-gc02be9e (Feb 14 2019 - 17:43:37 +0100)


env default -f -a

setenv ipaddr 192.168.99.23
setenv serverip 192.168.99.24
setenv nfs_root 192.168.99.24

setenv boot net
setenv tftp_root /tftpboot
setenv nfs_root /export..../targetNFS

setenv fdtaddr 0x87000000
setenv addr_mon 0x0c5f0000
setenv loadaddr 0x88000000

setenv get_kern_net tftpboot \${loadaddr} \${tftp_root}/\${name_kern}
run get_kern_net

setenv name_kern Board_multi.itb
boot

I have tried the following boot commands:

bootm ${addr_mon}
bootm ${loadaddr} - ${fdtaddr}

And that the command is not supported (I suppose):

bootm {addr_mon}:firmware@1#config@1

=> run get_kern_net                    

netcp@2000000 Waiting for SGMII auto negotiation to complete. done
BOOTP broadcast 1
BOOTP broadcast 2
*** Unhandled DHCP Option in OFFER/ACK: 44
*** Unhandled DHCP Option in OFFER/ACK: 44
DHCP client bound to address 192.168.99.23 (355 ms)
Using netcp@2000000 device
TFTP from server 192.168.99.24; our IP address is 192.168.99.23
Filename '/tftpboot/Board_multi.itb'.
Load address: 0x88000000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         ########
         3 MiB/s
done
Bytes transferred = 3924714 (3be2ea hex)
=> bootm 0x80000000:kernel@1#config@1
Wrong Image Format for bootm command
ERROR: can't get kernel image!
=>

=> bootm 0x88000000:kernel@1
## Loading kernel from FIT Image at 88000000 ...
   Trying 'kernel@1' kernel subimage
     Description:  DRSP Kernel
     Created:      2019-02-15  12:49:07 UTC
     Type:         Kernel Image
     Compression:  uncompressed
     Data Start:   0x880081f0
     Data Size:    3850752 Bytes = 3.7 MiB
     Architecture: ARM
     OS:           Linux
     Load Address: 0x80000000
     Entry Point:  0x80000000
     Hash algo:    md5
     Hash value:   1ca6cff3788a8eb9561469d34c468ef2
     Hash algo:    sha1
     Hash value:   a75ccc5e86990e863e9d7388f87550e2c4af2b3d
   Verifying Hash Integrity ... md5+ sha1+ OK
   Loading Kernel Image ... OK

Starting kernel ...

Nothing else.

Best regards,

Dario

  • Hi,

    Could you share which Processor SDK Linux is this?

    Best Regards,
    Yordan
  • Hi,

    I'm sorry I have forgotten this info:

    ti-processor-sdk-linux-rt-k2hk-evm-05.00.00.15

    Is enought? I think so.


    I have forgotten this command:

    setenv name_kern /tftpboot/Board_multi.itb

    I have also tried the following commands but fails anyway :

    => bootm 0x0c5f0000:firmware@1
    Wrong Image Format for bootm command
    ERROR: can't get kernel image!
    => bootm 0x0c5f0000:firmware@1#kernel@1
    Wrong Image Format for bootm command
    ERROR: can't get kernel image!
    => bootm 0x0c5f0000:firmware@1#config@1
    Wrong Image Format for bootm command
    ERROR: can't get kernel image!
    => bootm 0x0c5f0000#config@1
    Wrong Image Format for bootm command
    ERROR: can't get kernel image!
    => bootm 0x0c5f0000#config@1

    Regards,
    Dario

  • Hi,

    I think to have found the correct sequence:

    setenv default -f -a

    setenv ipaddr 192.168.99.23
    setenv serverip 192.168.99.24
    setenv nfs_root 192.168.99.24
    setenv hostname EVM

    setenv boot net
    setenv tftp_root /tftpboot
    setenv nfs_root /export/..../targetNFS

    setenv autostart no
    setenv fdtaddr 0x87000000
    setenv addr_mon 0x0c5f0000
    setenv loadaddr 0x88000000

    #monitor compileld with DEBUG=1

    setenv image_name Image_multi.itb

    setenv get_mon_net tftpboot \${loadaddr} \${tftp_root}/\${image_name}; imxtract \${loadaddr} firmware@1 \${addr_mon}
    setenv get_fdt_net imxtract \${loadaddr} fdt@1 \${fdtaddr}
    setenv get_kern_net imxtract \${loadaddr} kernel@1 0x80000000
    setenv run_mon_net go \${addr_mon}
    setenv run_kern_net bootm \${loadaddr} - \${fdtaddr}

    run init_${boot}
    run get_mon_net
    run run_mon_net
    run get_fdt_net
    run get_kern_net
    run run_kern_net


    The its ffile is:


    /*
    * U-Boot uImage source file with multiple kernels, ramdisks and FDT blobs
    */

    /dts-v1/;

    / {
    description = "Various kernels, ramdisks and FDT blobs";
    #address-cells = <1>;

    images {
    /*
    uboot {
    description = "U-Boot";
    type = "standalone";
    arch = "arm";
    compression = "none";
    load = <0x0C000000>;
    };
    */

    firmware@1 {
    description = "Boot monitor";
    data = /incbin/("./board-support/boot-monitor-4.0+gitAUTOINC+e1f885ab6d/skern-k2hk");
    type = "firmware";
    arch = "arm";
    compression = "none";
    load = <0x0c5f0000>;
    entry = <0x0c5f0000>;
    hash@1 {
    algo = "md5";
    };
    hash@2 {
    algo = "sha1";
    };
    };

    kernel@1 {
    description = "Board Kernel";
    data = /incbin/("./board-support/linux-rt-4.14.40+gitAUTOINC+d5443cbd3b-gd5443cbd3b/arch/arm/boot/zImage");
    type = "kernel";
    arch = "arm";
    os = "linux";
    compression = "none";
    load = <0x80000000>;
    entry = <0x80000000>;
    hash@1 {
    algo = "md5";
    };
    hash@2 {
    algo = "sha1";
    };
    };

    /*
    ramdisk@1 {
    description = "Board ramdisk";
    data = /incbin/("./ramdisk");
    type = "ramdisk";
    arch = "arm";
    os = "linux";
    compression = "gzip";
    load = <0x??000000>;
    entry = <0x??000000>;
    hash@1 {
    algo = "sha1";
    };
    };

    initrd {
    description = "Linux initrd";
    type = "ramdisk";
    compression = "none";
    load = <0x???0000>;
    arch = "arm";
    };
    */

    fdt@1 {
    description = "Board fdt";
    data = /incbin/("./board-support/linux-rt-4.14.40+gitAUTOINC+d5443cbd3b-gd5443cbd3b/arch/arm/boot/dts/keystone-k2hk-evm.dtb");
    type = "flat_dt";
    load = <0x87000000>;
    arch = "arm";
    compression = "none";
    hash@1 {
    algo = "crc32";
    };

    /*
    fpga@1 {
    description = "FPGA";
    data = /incbin/("/tftpboot/download.bit");
    type = "fpga";
    arch = "arm";
    compression = "none";
    load = <0x30000000>;
    hash@1 {
    algo = "md5";
    };
    */
    };
    };

    configurations {
    default = "config@1";

    config@2{
    description = "Board conf2";
    loadables = "firmware@1";
    };

    config@1{
    description = "Board conf1";
    kernel = "kernel@1";
    fdt = "fdt@1";
    };
    };
    };

    For now starts but slowly, too slowly...

    Created: 2019-02-15 15:46:14 UTC
    Type: Kernel Image
    Compression: uncompressed
    Data Start: 0x880081f0
    Data Size: 3850752 Bytes = 3.7 MiB
    Architecture: ARM
    OS: Linux
    Load Address: 0x80000000
    Entry Point: 0x80000000
    Hash algo: md5
    Hash value: 1ca6cff3788a8eb9561469d34c468ef2
    Hash algo: sha1
    Hash value: a75ccc5e86990e863e9d7388f87550e2c4af2b3d
    Verifying Hash Integrity ... md5+ sha1+ OK
    ## Flattened Device Tree blob at 87000000
    Booting using the fdt blob at 0x87000000
    Loading Kernel Image ... OK
    Loading Device Tree to 8fff3000, end 8ffff8cd ... OK

    Starting kernel ...

    DEBUG: >>>> skern_poweron_cpu(1) >>>>

    DEBUG: Message2 from Secure Mode: Core freq - -34707204Hz

    DEBUG: >>>> skern_poweron_cpu(2) >>>>

    DEBUG: Message2 from Secure Mode: Core freq - -34707204Hz

    DEBUG: >>>> skern_poweron_cpu(3) >>>>

    DEBUG: Message2 from Secure Mode: Core freq - -34707204Hz

    [ 0.000000] Booting Linux on physical CPU 0x0
    [ 0.000000] Linux version 4.14.40-rt29-gd5443cbd3b (xxxxxx) (gcc version 7.2.1 20171011 (Linaro GCC 7.2-2017.11)) #1 SMP PREEMPT RT Thu Feb 14 12:33:14 CET 2019
    [ 0.000000] CPU: ARMv7 Processor [412fc0f4] revision 4 (ARMv7), cr=30c5387d
    [ 0.000000] CPU: div instructions available: patching division code
    .....

    Have you any idea for this problem?

    DEBUG: Message2 from Secure Mode: Core freq - -34707204Hz

    negative number, yesterday with more files I have seen this line:

    DEBUG: Message2 from Secure Mode: Core freq - 200000000Hz


    Regards,
    Dario

  • Hi again,

        I have solved the speed problem, in its file:

    data = /incbin/("./board-support/boot-monitor-4.0+gitAUTOINC+e1f885ab6d/skern-k2hk.bin");

    And in uboot shell now is possible to call the uboot mon_install command and set the correct speed:

    setenv run_mon_net mon_install \${addr_mon}

    In minicom shell:

    Starting kernel ...
    DEBUG: >>>> skern_poweron_cpu(1) >>>>
    DEBUG: Message2 from Secure Mode: Core freq - 200000000Hz

    Regards,
    Dario