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.

[参考译文] AM625:从 eMMC 4GB 引导分区进行 SBL Linux 引导

Guru**** 2337880 points
Other Parts Discussed in Thread: AM625, SYSCONFIG
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1513599/am625-sbl-linux-boot-from-emmc-4gb-boot-partition

器件型号:AM625
主题: SysConfig 中讨论的其他器件

工具/软件:

在使用 SBL 的情况下、AM625是否可以从具有4MB 引导分区的 eMMC 引导 Linux?

参考 MCU+ SDK 的示例 tools/boot/sbl_prebuilt/am62x-sk/default_sbl_eMMC_linux_hs.cfg、似乎需要大约13MB 的闪存。

但我考虑为我的定制电路板使用4MB 引导分区的几乎 eMMC、因此我想知道是否可以将 SBL 引导与这些 eMMC 一起使用。

 

此致、

Koji

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

    Hwllo,

    Unknown 说:
    但几乎 eMMCs 我正在考虑为我的定制板有4MB 引导分区、所以我想知道是否可以将 SBL 引导与这些 eMMCs 一起使用。

    它看起来是可能的。 您可以为 Linux Appimage 和 A53 U-Boot 保留最后2MB 的闪存。 前2MB 将用于 SBL stage1、SBL stage2、DM、MCU 和 HSM 映像。 您必须相应地修改不同图像的偏移量。

    布局非常接近、因此您必须注意图像大小不超过保留的空间。

    此致、

    Prashant

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

    您好 、Prashant、

    我计划将偏移量修改为以下内容。

    有可能吗?

    0x0000  +------------------+
            |    SBL stage1    |
    0x0400  +------------------+
            |    SBL stage2    |
    0x0600  +------------------+
            |     MCU image    |
    0x0680  +------------------+
            |     HSM image    |
    0x0700  +------------------+
            |     DM image     |
    0x0900  +------------------+
            |     Not Use      |
    0x0a00  +------------------+
            |    A53 U-Boot    |
    0x1600  +------------------+
            |  linux Appimage  |
    0x2000  +------------------+

    这些偏移是根据构建映像的实际大小确定的。

     

    如何确认修改每个偏移的方法?

     

    此致、

    Koji

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

    您好:

    我建议采用以下布局:

    原始偏移量 基本映像 最大尺寸
    0x0 (默认偏移) SBL stage1 512KB
    0x80000 (默认偏移量) SBL 阶段2 256KB
    0xC0000 代替 256KB
    0x100000 DM 512KB
    0x180000 Linux 应用映像 1MB
    0x280000 (默认偏移量) A53 U-Boot (u-boot.img) 1.2MB
    0x3C0000 HSM 映像 256KB

    这种布局只需进行极少的更改、同时允许灵活选择不同的图像尺寸。 可以在 SBL stage1和 SBL stage2的 SysConfig 文件中更改偏移量。

    例如、上述布局需要进行以下更改:

    diff --git a/examples/drivers/boot/sbl_emmc_linux_multistage/sbl_emmc_linux_stage1/am62x-sk/r5fss0-0_nortos/example.syscfg b/examples/drivers/boot/sbl_emmc_linux_multistage/sbl_emmc_linux_stage1/am62x-sk/r5fss0-0_nortos/example.syscfg
    index 374dd797..88692d66 100644
    --- a/examples/drivers/boot/sbl_emmc_linux_multistage/sbl_emmc_linux_stage1/am62x-sk/r5fss0-0_nortos/example.syscfg
    +++ b/examples/drivers/boot/sbl_emmc_linux_multistage/sbl_emmc_linux_stage1/am62x-sk/r5fss0-0_nortos/example.syscfg
    @@ -38,7 +38,7 @@ const mpu_armv711 = mpu_armv7.addInstance();
      */
     bootloader1.bootMedia          = "EMMC";
     bootloader1.$name              = "CONFIG_BOOTLOADER_EMMC_MCU";
    -bootloader1.EMMCAppImageOffset = "0x100000";
    +bootloader1.EMMCAppImageOffset = "0xC0000";
     
     bootloader2.bootMedia          = "EMMC";
     bootloader2.$name              = "CONFIG_BOOTLOADER_EMMC_SBL";
    diff --git a/examples/drivers/boot/sbl_emmc_linux_multistage/sbl_emmc_linux_stage2/am62x-sk/r5fss0-0_nortos/example.syscfg b/examples/drivers/boot/sbl_emmc_linux_multistage/sbl_emmc_linux_stage2/am62x-sk/r5fss0-0_nortos/example.syscfg
    index 2864d5f9..cf4772f7 100644
    --- a/examples/drivers/boot/sbl_emmc_linux_multistage/sbl_emmc_linux_stage2/am62x-sk/r5fss0-0_nortos/example.syscfg
    +++ b/examples/drivers/boot/sbl_emmc_linux_multistage/sbl_emmc_linux_stage2/am62x-sk/r5fss0-0_nortos/example.syscfg
    @@ -23,16 +23,16 @@ const debug_log   = scripting.addModule("/kernel/dpl/debug_log");
      */
     bootloader1.bootMedia          = "EMMC";
     bootloader1.$name              = "CONFIG_BOOTLOADER_EMMC_HSM";
    -bootloader1.EMMCAppImageOffset = "0x800000";
    +bootloader1.EMMCAppImageOffset = "0x3C0000";
     
     bootloader2.bootMedia          = "EMMC";
     bootloader2.$name              = "CONFIG_BOOTLOADER_EMMC_DM";
    -bootloader2.EMMCAppImageOffset = "0xA00000";
    +bootloader2.EMMCAppImageOffset = "0x100000";
     
     bootloader3.$name              = "CONFIG_BOOTLOADER_EMMC_LINUX";
     bootloader3.appImageOffset     = "0xC00000";
     bootloader3.bootMedia          = "EMMC";
    -bootloader3.EMMCAppImageOffset = "0xC00000";
    +bootloader3.EMMCAppImageOffset = "0x180000";
     
     mmcsd1.$name            = "CONFIG_MMCSD0";
     bootloader1.MMCSDDriver = mmcsd1;
    

    此致、

    Prashant

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

    谢谢  Prashant、

    我根据您的建议修改了布局、并尝试从 eMMC 引导。

    内核可以启动但在途中停止。

    SYSFW Firmware Version 11.0.7--v11.00.07 (Fancy Rat)
    SYSFW Firmware revision 0xb
    SYSFW ABI revision 4.0
    
    [BOOTLOADER_PROFILE] Boot Media       : eMMC
    [BOOTLOADER_PROFILE] Boot Media Clock : 200.000 MHz
    [BOOTLOADER_PROFILE] Boot Image Size  : 185 KB
    [BOOTLOADER_PROFILE] Cores present    :
    m4f0-0
    r5f0-0
    [BOOTLOADER PROFILE] System_init                      :       5524us
    [BOOTLOADER PROFILE] Board_init                       :          0us
    [BOOTLOADER PROFILE] Drivers_open                     :      34415us
    [BOOTLOADER PROFILE] Board_driversOpen                :          0us
    [BOOTLOADER PROFILE] Sciclient Get Version            :      10206us
    [BOOTLOADER PROFILE] App_loadImages                   :       6261us
    [BOOTLOADER PROFILE] App_loadSelfcoreImage            :       7260us
    [BOOTLOADER_PROFILE] SBL Total Time Taken             :      63670us
    
    Image loading done, switching to application ...
    Starting MCU-m4f and 2nd stage bootloader
    
    SYSFW Firmware Version 11.0.7--v11.00.07 (Fancy Rat)
    SYSFW Firmware revision 0xb
    SYSFW ABI revision 4.0
    
    [BOOTLOADER_PROFILE] Boot Media       : eMMC
    [BOOTLOADER_PROFILE] Boot Media Clock : 200.000 MHz
    [BOOTLOADER_PROFILE] Boot Image Size  : 1179 KB
    [BOOTLOADER_PROFILE] Cores present    :
    hsm-m4f0-0
    r5f0-0
    a530-0
    [BOOTLOADER PROFILE] System_init                      :       2762us
    [BOOTLOADER PROFILE] Board_init                       :          0us
    [BOOTLOADER PROFILE] Drivers_open                     :      24140us
    [BOOTLOADER PROFILE] Board_driversOpen                :          0us
    [BOOTLOADER PROFILE] Sciclient Get Version            :      10250us
    [BOOTLOADER PROFILE] App_loadImages                   :       5038us
    [BOOTLOADER PROFILE] App_loadSelfcoreImage            :       8242us
    [BOOTLOADER PROFILE] App_loadLinuxImages              :      23825us
    [BOOTLOADER_PROFILE] SBL Total Time Taken             :      74261us
    
    Image loading done, switching to application ...
    Starting linux and RTOS/Baremetal applications
    
    U-Boot SPL 2023.04-ti-gf9b966c67473 (Mar 19 2024 - 20:31:40 +0000)
    SYSFW ABI: 4.0 (firmware rev 0x000b '11.0.7--v11.00.07 (Fancy Rat)')
    SPL initial stack usage: 1856 bytes
    Trying to boot from MMC1
    Authentication passed
    Authentication passed
    
    
    U-Boot 2023.04-ti-gf9b966c67473 (Mar 19 2024 - 20:31:40 +0000)
    
    SoC:   AM62X SR1.0 HS-SE
    Model: Texas Instruments AM625 SK
    DRAM:  no bloblist found!1 GiB
    tps65219_bind: pmic@30 - no child found
    Core:  89 devices, 33 uclasses, devicetree: separate
    NAND:  512 MiB
    MMC:   mmc@fa10000: 0, mmc@fa00000: 1
    Loading Environment from nowhere... OK
    In:    serial
    Out:   serial
    Err:   serial
    Net:   eth0: ethernet@8000000port@1
    Hit any key to stop autoboot:  0
    =>
    =>
    =>
    => setenv mmcdev 0
    => setenv bootpart 0:2
    => boot
    switch to partitions #0, OK
    mmc0(part 0) is current device
    SD/MMC found on device 0
    Failed to load 'boot.scr'
    Failed to load 'uEnv.txt'
    ## Error: "main_cpsw0_qsgmii_phyinit" not defined
    6693206 bytes read in 52 ms (122.8 MiB/s)
    name_fit_config=conf-ti_k3-am625-custom.dtb
    ## Loading kernel from FIT Image at 90000000 ...
       Using 'conf-ti_k3-am625-custom.dtb' configuration
       Verifying Hash Integrity ... sha512,rsa4096:custMpk+ OK
       Trying 'kernel-1' kernel subimage
         Description:  Linux kernel
         Type:         Kernel Image
         Compression:  gzip compressed
         Data Start:   0x900000fc
         Data Size:    6623399 Bytes = 6.3 MiB
         Architecture: AArch64
         OS:           Linux
         Load Address: 0x81000000
         Entry Point:  0x81000000
         Hash algo:    sha512
         Hash value:   c47f6b281b7be2b5fbdd5d3630ad15a7cc2cef311adc47847ce74ec775292b6127d1aa48253e80c83af8d11ae6f4bf25b3fb31855905897918456d25a9ff7c23
       Verifying Hash Integrity ... sha512+ OK
    ## Loading fdt from FIT Image at 90000000 ...
       Using 'conf-ti_k3-am625-custom.dtb' configuration
       Verifying Hash Integrity ... sha512,rsa4096:custMpk+ OK
       Trying 'fdt-ti_k3-am625-custom.dtb' fdt subimage
         Description:  Flattened Device Tree blob
         Type:         Flat Device Tree
         Compression:  uncompressed
         Data Start:   0x906512e0
         Data Size:    62951 Bytes = 61.5 KiB
         Architecture: AArch64
         Load Address: 0x83000000
         Hash algo:    sha512
         Hash value:   49f115ff4a2fbc91bb57e7944b2ae1ba7684900afbabc4cd7533758dbe749e8f1a530e28c05b4cf3790e4901f0ebf7dceac76c03869ee56393ac77e371856f0d
       Verifying Hash Integrity ... sha512+ OK
       Loading fdt from 0x906512e0 to 0x83000000
       Booting using the fdt blob at 0x83000000
    Working FDT set to 83000000
       Uncompressing Kernel Image
       Loading Device Tree to 000000008ffed000, end 000000008ffff5e6 ... OK
    Working FDT set to 8ffed000
    
    Starting kernel ...
    
    [    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
    [    0.000000] Linux version 6.1.80-rt26-ti-rt-g3c08dbfd7bfd (oe-user@oe-host) (aarch64-oe-linux-gcc (GCC) 11.4.0, GNU ld (GNU Binutils) 2.38.20220708) #1 SMP PREEMPT_RT Wed Mar 20 14:44:35 UTC 2024
    [    0.000000] Machine model: Custom AM6251 Custom Board
    [    0.000000] earlycon: ns16550a0 at MMIO32 0x0000000002800000 (options '')

    使用 fitImage 与使用 SD 引导相同、并可从 SD 引导。
    我还应该做什么?
     
    此致、
    Koji
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好:

    使用 fitImage 与用于 SD 引导相同、它可以从 SD 引导。

    您能否分享 SD 卡中的成功引导日志?

    谢谢!

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

    在日志中、我看到 PSDK 版本为9.2。

    我根据您的建议修改了布局、并尝试从 eMMC 引导。

    此处使用的组合是 MCU+ SDK v11.0和 PSDK v9.2。 此问题可能是由于此版本不匹配造成的。 您是否曾尝试使用两个 SDK 的相同版本进行引导?

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

    您好、Prashant、

    当通过 PSDK v9.2从 SD (具有 SPL 中断)引导时、可以引导 eMMC 中的 fitImage。

    我们的开发环境现在无法更改、但您的猜测似乎是正确的。

    我将在能够使用相同版本时再次确认。

     

    此致、

    Koji