RT600 ROM Boot流程

Boot mode

  • ROM code boot流程
    • 当ROM运行到bootloader_run()
    • get_boot_mode()根据fuse或者拨码来判定boot mode。
    • go_master_boot()进入master boot后
      • masterboot_init()
        获取boot device以及初始化对应的boot device。
        Fuse boot时,使能recovery boot fuse后SD、EMMC、OSPi支持recovery boot,boot from pin不支持recovery boot。
        SD、EMMC、OSPI、USB-DFU支持fail through boot
      • masterboot_run()
        SD、EMMC、OSPI boot
        根据image header中的信息进行boot
        Serial boot
        1. 如果是UARTI2CSPI则进入peripheral detect mode,支持get-propertyset-propertywrite-memory指令。write memory只支持写到RAM中。将write-memory后面输入的参数作为boot的信息,然后根据image header进行boot。不支持recovery boot 跟go_fail_through_mode,也就是boot失败的话不会进行recovery boot跟ISP boot
        2. 如果是USB-DFU,则从USB中读取数据进行boot。
      • recovery_boot_run()
        master boot失败后,如果开启了recovery boot fuse,从SPI noreeprom boot
      • go_fail_through_mode()
        recovery boot失败后,根据FUSE的值,使用对应的instance进入ISP mode

Master boot

从大的角度讲,master包含两种类型的boot:

  1. Normal boot(OSPISDEMMC)
    • OSPI Nor boot
      支持auto-probe。如果auto-probe打开,ROM自动配置Flash configure block。
      否则ROM会从0x400处获取Flash configure block
    • SDEMMC boot
    • 如果上述上述boot失败后,有条件地进入Recovery boot,即ROM从SPI NorEEPROM boot。
    • Recovery boot失败后进入ISP mode
  2. Serial boot
    • Serial boot支持的设备有,USB-DFU、UART、I2C、SPI
    • Boot device配置为USB-DFU,ROM直接从USB中读取数据进行boot。失败后进入ISP
    • Boot device配置为serial boot,支持UART、I2C、SPI。ROM进入到peripheral detect mode,一旦建立通讯,规则如下:
      • 支持的命令有:
        • Get-Property
        • Set-Property
        • Write-Memory
      • 只能写数据到RAM,ROM根据write-memory后面所跟参数进行boot

ISP mode

  • 进入这个模式后,可以使用blhost对fuse,boot device进行programming的操作。
  • 支持的interface有USB-HID、UART、I2C、SPI
  • 支持IAP - in application programming
    • ROM APIs to program OTP
    • ROM APIs to program Serial Nor Flash
    • ROM APIs to program encrypted image
原文地址:https://www.cnblogs.com/richard-xiong/p/9557252.html