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.

[参考译文] AM623:FIT 映像引导

Guru**** 2562120 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1570780/am623-fit-image-boot

器件型号:AM623


工具/软件:

我正在尝试从合适的映像引导、但内核似乎没有执行。 normal` booti `使用相同的内核和 dtb 工作、所以我知道我的内核和 dtb 很好。   

以下是我的 FIT 来源:

/dts-v1/;

/ {
  description = "script, kernel, initramfs and DTB for Phytec-AM62";
  #address-cells = <1>;

  images {
    default = "script-1";

    kernel-1 {
      description = "Linux kernel";
      data = /incbin/("Image");
      type = "kernel";
      arch = "arm64";
      os = "linux";
      compression = "none";
      load = <0x82000000>;
      entry = <0x82000000>;
      hash-1 {
        algo = "crc32";
      };
      hash-2 {
        algo = "sha1";
      };
    };

    ramdisk-1 {
      description = "Ramdisk";
      data = /incbin/("initramfs.xz");
      type = "ramdisk";
      arch = "arm64";
      os = "linux";
      load = <0x86000000>;
      //entry = <0x86000000>;
      hash-1 {
        algo = "crc32";
      };
      hash-2 {
        algo = "sha1";
      };
    };

    fdt-1 {
      description = "Device tree";
      data = /incbin/("oftree");
      type = "flat_dt";
      arch = "arm";
      compression = "none";
      load = <0x88000000>;
      hash-1 {
        algo = "crc32";
      };
      hash-2 {
        algo = "sha1";
      };
    };

    script-1 {
      description = "Boot script";
      data = /incbin/("boot.cmd");
      type = "script";
      load = <0x80000000>;
    };
  };

  configurations {
    default = "linux-1";
    bootscript-1 {
      description = "Boot script";
      script = "script-1";
    };

    linux-1 {
      description = "Kernel, ramdisk and DTB";
      kernel = "kernel-1";
      ramdisk = "ramdisk-1";
      fdt = "fdt-1";
      //compatible = "phytec,am625-phyboard-lyra-rdkphytec,am62-phycore-somti,am625";
    };
  };
};

// rebuild with mkimage -f "./kernel.its" "./fitImage"

下面是 u-boot 输出:

U-Boot SPL 2024.04 (Sep 26 2025 - 15:57:50 +0000)
SYSFW ABI: 4.0 (firmware rev 0x000a '10.1.8--v10.01.08 (Fiery Fox)')
SPL initial stack usage: 13408 bytes
Trying to boot from MMC2
Authentication passed
Authentication passed
Authentication passed
Authentication passed
Authentication passed
Starting ATF on ARM64 core...

NOTICE:  BL31: v2.12.6(release):lts-v2.12.6
NOTICE:  BL31: Built : 02:07:59, Sep 25 2025
I/TC:
I/TC: OP-TEE version: 4.7.0 (gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)) #1 Thu Sep 25 02:38:41 UTC 2025 aarch64
I/TC: WARNING: This OP-TEE configuration might be insecure!
I/TC: WARNING: Please check optee.readthedocs.io/.../porting_guidelines.html
I/TC: Primary CPU initializing
I/TC: GIC redistributor base address not provided
I/TC: Assuming default GIC group status and modifier
I/TC: SYSFW ABI: 4.0 (firmware rev 0x000a '10.1.8--v10.01.08 (Fiery Fox)')
I/TC: HUK Initialized
I/TC: Primary CPU switching to normal world boot

U-Boot SPL 2024.04 (Sep 26 2025 - 15:58:23 +0000)
SYSFW ABI: 4.0 (firmware rev 0x000a '10.1.8--v10.01.08 (Fiery Fox)')
SPL initial stack usage: 1856 bytes
Trying to boot from MMC2
Authentication passed
Authentication passed


U-Boot 2024.04 (Sep 26 2025 - 15:58:23 +0000)

SoC:   AM62X SR1.0 HS-FS
Model: PHYTEC phyBOARD-Lyra AM625
DRAM:  2 GiB
Core:  85 devices, 33 uclasses, devicetree: separate
MMC:   mmc@fa10000: 0, mmc@fa00000: 1
Loading Environment from MMC... *** Warning - bad CRC, using default environment

In:    serial@2800000
Out:   serial@2800000
Err:   serial@2800000
Net:   eth0: ethernet@8000000port@1
Hit any key to stop autoboot:  0
=> echo $rdaddr

=> run fitboot
23728523 bytes read in 1079 ms (21 MiB/s)
## Loading kernel from FIT Image at 90000000 ...
   Using 'linux-1' configuration
   Verifying Hash Integrity ... OK
   Trying 'kernel-1' kernel subimage
     Description:  Linux kernel
     Created:      2025-09-26  16:53:30 UTC
     Type:         Kernel Image
     Compression:  uncompressed
     Data Start:   0x90000108
     Data Size:    18323968 Bytes = 17.5 MiB
     Architecture: AArch64
     OS:           Linux
     Load Address: 0x82000000
     Entry Point:  0x82000000
     Hash algo:    crc32
     Hash value:   c9e3f3aa
     Hash algo:    sha1
     Hash value:   72d194eeaf0ef57934f1c2718a9abe757e617c59
   Verifying Hash Integrity ... crc32+ sha1+ OK
## Loading ramdisk from FIT Image at 90000000 ...
   Using 'linux-1' configuration
   Verifying Hash Integrity ... OK
   Trying 'ramdisk-1' ramdisk subimage
     Description:  Ramdisk
     Created:      2025-09-26  16:53:30 UTC
     Type:         RAMDisk Image
     Compression:  uncompressed
     Data Start:   0x91179c24
     Data Size:    5353608 Bytes = 5.1 MiB
     Architecture: AArch64
     OS:           Linux
     Load Address: 0x86000000
     Entry Point:  0x86000000
     Hash algo:    crc32
     Hash value:   b2edf475
     Hash algo:    sha1
     Hash value:   26d7bc13800bd8c2ee34056bbbffb78cb1773b9c
   Verifying Hash Integrity ... crc32+ sha1+ OK
   Loading ramdisk from 0x91179c24 to 0x86000000
## Loading fdt from FIT Image at 90000000 ...
   Using 'linux-1' configuration
   Verifying Hash Integrity ... OK
   Trying 'fdt-1' fdt subimage
     Description:  Device tree
     Created:      2025-09-26  16:53:30 UTC
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x91694db4
     Data Size:    44425 Bytes = 43.4 KiB
     Architecture: ARM
     Load Address: 0x88000000
     Hash algo:    crc32
     Hash value:   0897d9d9
     Hash algo:    sha1
     Hash value:   b0291f6c79f9eb8fe94ffa11a4f3d868d271fed8
   Verifying Hash Integrity ... crc32+ sha1+ OK
   Loading fdt from 0x91694db4 to 0x88000000
   Booting using the fdt blob at 0x88000000
Working FDT set to 88000000
   Loading Kernel Image to 82000000
   Loading Ramdisk to fc9b2000, end fcecd088 ... OK
   Loading Device Tree to 00000000fc9a4000, end 00000000fc9b1d88 ... OK
Working FDT set to fc9a4000

Starting kernel ...

编辑:我意识到问题可能与我的引导参数有关;这里是我的引导参数。  当使用`booti`或`bootm`进行引导时、它们可正常工作

=> setenv bootargs "console=${console} earlycon=${earlycon} root=LABEL=rootfs ro rootwait panic=${panic} loglevel=${loglevel} ${fsck_args} ${recovery_args} ${optargs}"
=> echo $bootargs
console=ttyS2,115200n8 earlycon=ns16550a,mmio32,0x02800000 root=LABEL=rootfs ro rootwait panic=60 loglevel=4 fsck.mode=auto fsck.repair=yes

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Thomas:

    让我检查一下并更新您

    此致、

    Dilna K

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Thomas:

    请仔细阅读以下常见问题解答

    链接: —  https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1176944/faq-linux-how-to-boot-sitara-am3x-am4x-am6x-devices-from-initramfs-cpio-archive-ram-disk

    此致、

    Dilna K

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我确实想让 initramfs 工作,但是这个问题只是关于一个合适的图像。  如果我在没有 initramfs 的情况下定义我的 FIT 映像、我仍然会得到相同的行为:

        linux-1 {
          description = "Kernel and DTB, no ramdisk";
          kernel = "kernel-1";
          // ramdisk = "ramdisk-1";
          fdt = "fdt-1";
          //compatible = "phytec,am625-phyboard-lyra-rdkphytec,am62-phycore-somti,am625";
        };

    当我尝试在没有 initramfs 的情况下从 FIT 运行时的 u-boot 输出:

    In:    serial@2800000
    Out:   serial@2800000
    Err:   serial@2800000
    Net:   eth0: ethernet@8000000port@1
    Hit any key to stop autoboot:  0 
    => 
    => echo $fitboot
    load mmc ${mmcdev}:${mmcpart} ${addr_fit} fitImage; bootm ${addr_fit};
    => run fitboot
    23728491 bytes read in 1069 ms (21.2 MiB/s)
    ## Loading kernel from FIT Image at 90000000 ...
       Using 'linux-1' configuration
       Verifying Hash Integrity ... OK
       Trying 'kernel-1' kernel subimage
         Description:  Linux kernel
         Created:      2025-09-26  17:43:50 UTC
         Type:         Kernel Image
         Compression:  uncompressed
         Data Start:   0x90000108
         Data Size:    18323968 Bytes = 17.5 MiB
         Architecture: AArch64
         OS:           Linux
         Load Address: 0x82000000
         Entry Point:  0x82000000
         Hash algo:    crc32
         Hash value:   c9e3f3aa
         Hash algo:    sha1
         Hash value:   72d194eeaf0ef57934f1c2718a9abe757e617c59
       Verifying Hash Integrity ... crc32+ sha1+ OK
    ## Loading fdt from FIT Image at 90000000 ...
       Using 'linux-1' configuration
       Verifying Hash Integrity ... OK
       Trying 'fdt-1' fdt subimage
         Description:  Device tree
         Created:      2025-09-26  17:43:50 UTC
         Type:         Flat Device Tree
         Compression:  uncompressed
         Data Start:   0x91694db4
         Data Size:    44425 Bytes = 43.4 KiB
         Architecture: ARM
         Load Address: 0x88000000
         Hash algo:    crc32
         Hash value:   0897d9d9
         Hash algo:    sha1
         Hash value:   b0291f6c79f9eb8fe94ffa11a4f3d868d271fed8
       Verifying Hash Integrity ... crc32+ sha1+ OK
       Loading fdt from 0x91694db4 to 0x88000000
       Booting using the fdt blob at 0x88000000
    Working FDT set to 88000000
       Loading Kernel Image to 82000000
       Loading Device Tree to 00000000fcec0000, end 00000000fcecdd88 ... OK
    Working FDT set to fcec0000
    
    Starting kernel ...

    内核似乎没有启动。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Thomas:

    我有一些假设。

    1. I n 在 FIT 图像中更正加载/输入地址

    FIT 映像内的内核和 DTB 必须有在 FIT 的源文件中定义的正确加载和入口点地址 (.its)。

     如果地址错误、U-Boot 可能会将内核复制到错误的存储器位置、或跳转到错误的入口点。

    2.丢失或覆盖的 dtb/bootargs  

    来自 FIT 映像的 DTB 被损坏、或被加载到通过内核解压缩/重定位覆盖的存储器区域中。

    内部讨论正在进行中。 我会尽快回到您身边。

    此致、

    Dilna K

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Thomas:

    我认为这个关于 FIT 映像启动的问题更具体地针对安全启动。 我  也邀请到了我们的专家 hguan@ti.com 参加本次讨论。

    他今天不在办公室。 我想他能帮你解决这个问题。

    此致、

    Dilna K

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Thomas:
    希望 Linux SDK 参考链接在为内核时基故障映像签名时会很有用
    https://software-dl.ti.com/processor-sdk-linux/esd/AM62X/11_01_05_03/exports/docs/linux/Foundational_Components_Migration_Guide.html
    https://software-dl.ti.com/processor-sdk-linux/esd/AM62X/11_01_05_03/exports/docs/linux/Foundational_Components_Kernel_Users_Guide device.html#creating-the-kernel-fitimage-for-high-security-device-gp-sevices
    此致、
    - Hong

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    非常感谢。 我尝试使用上面文档中指定的内核和 dtb 地址、但我没有得到任何行为变化。

    U-Boot 2024.04 (Sep 26 2025 - 15:58:23 +0000)
    
    SoC:   AM62X SR1.0 HS-FS
    Model: PHYTEC phyBOARD-Lyra AM625
    DRAM:  2 GiB
    Core:  85 devices, 33 uclasses, devicetree: separate
    MMC:   mmc@fa10000: 0, mmc@fa00000: 1
    Loading Environment from MMC... *** Warning - bad CRC, using default environment
    
    In:    serial@2800000
    Out:   serial@2800000
    Err:   serial@2800000
    Net:   eth0: ethernet@8000000port@1
    Hit any key to stop autoboot:  0
    =>
    => run mmcargs
    => echo $bootargs
    console=ttyS2,115200n8 earlycon=ns16550a,mmio32,0x02800000 root=/dev/mmcblk1p2 rootwait rw
    => run fitboot
    23728515 bytes read in 1061 ms (21.3 MiB/s)
    ## Loading kernel from FIT Image at 90000000 ...
       Using 'linux-1' configuration
       Verifying Hash Integrity ... OK
       Trying 'kernel-1' kernel subimage
         Description:  Linux kernel
         Created:      2025-10-01  15:13:26 UTC
         Type:         Kernel Image
         Compression:  uncompressed
         Data Start:   0x90000108
         Data Size:    18323968 Bytes = 17.5 MiB
         Architecture: AArch64
         OS:           Linux
         Load Address: 0x81000000
         Entry Point:  0x81000000
         Hash algo:    crc32
         Hash value:   c9e3f3aa
         Hash algo:    sha1
         Hash value:   72d194eeaf0ef57934f1c2718a9abe757e617c59
       Verifying Hash Integrity ... crc32+ sha1+ OK
    ## Loading fdt from FIT Image at 90000000 ...
       Using 'linux-1' configuration
       Verifying Hash Integrity ... OK
       Trying 'fdt-1' fdt subimage
         Description:  Device tree
         Created:      2025-10-01  15:13:26 UTC
         Type:         Flat Device Tree
         Compression:  uncompressed
         Data Start:   0x91694db4
         Data Size:    44425 Bytes = 43.4 KiB
         Architecture: ARM
         Load Address: 0x83000000
         Hash algo:    crc32
         Hash value:   0897d9d9
         Hash algo:    sha1
         Hash value:   b0291f6c79f9eb8fe94ffa11a4f3d868d271fed8
       Verifying Hash Integrity ... crc32+ sha1+ OK
       Loading fdt from 0x91694db4 to 0x83000000
       Booting using the fdt blob at 0x83000000
    Working FDT set to 83000000
       Loading Kernel Image to 81000000
       Loading Device Tree to 00000000fcec0000, end 00000000fcecdd88 ... OK
    Working FDT set to fcec0000
    
    Starting kernel ...

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    这似乎是我的 FDT 定义缺失   arch=“arm64";“;-我假设 DTB 格式是独立于架构的,但显然它不喜欢它默认为`arm32` arch,如果我没有指定。