AnsweredAssumed Answered

i.MX6 ROM API Documentation

Question asked by Adeneo Engineering Team on Jan 31, 2013
Latest reply on Feb 13, 2013 by Adeneo Engineering Team
Branched to a new discussion

Hi Freescale Support Team,

       The ROM API Vector Table is at address 0x000000C0. There are couple of calls to these ROM APIs from WEC7 Eboot ivt_init.s code.


  1. Where can I find the documentation for the APIs that are exported by the i.MX6 ROM Code? RM does not have it.
  2. Will the set of APIs remain the same for the foreseeable Silicon Revisions?
  3. Why does eboot have to handle “USB Recovery Mode” (as highlighted in the Code Snippet below)? There is no documentation to explain the same.


Code Snippet (\platform\iMX6Q_SABRE_Lite\SRC\BOOTLOADER\EBOOT\ivt_init.s):

;    The following is to fill in those arguments for this ROM function
;    pu_irom_hwcnfg_setup(void **start, size_t *bytes, const void *boot_data)
;    This function is used to copy data from the storage media into DDR.
;    start - Initial (possibly partial) image load address on entry. 
;            Final image load address on exit.
;    bytes - Initial (possibly partial) image size on entry. 
;            Final image size on exit.
;    boot_data - Initial @ref ivt Boot Data load address.
    ; Restore the necessary address.
    mov r0, r4
    mov r1, r5
    mov r2, r6

    ldr r4, =0x000020ed     ;function entry in MX6Q

    ;We should distinguish USB recovery mode(SDP mode) and internal boot mode.
    ;If ROM runs in SDP mode, then it needn't load boot code from storage media.
    ;If ROM runs in SDP mode, then r0 must be 0x00
    ;If ROM runs in internal boot mode, then r0 should be larger than IRAM base address.   
    cmp r7, #0x00900000
    blxhi r4              ; Address is subject to change in future ROM versions
    cmp r7, #0x00900000
    blhi QUIT_PLUGIN

    ;Workaround run plug-ins in SDP mode without USB re-enumeration.
    ;how it works:
    ;ROM running in usb download mode.
    ;Host manufacturing application sends SDP command to download plug-in image.
    ;Host manufacturing application sends SDP command to jump to plug-in image and run it.
    ;Plug-in starts execution and after its regular tasks plug-in will then call into ROM
    ;call into pl_parse_and_handle()
    ldr r4, =0X00001D85     ;function entry in MX6Q
    blx     r4
; To return to ROM from plugin, we need to fill in these argument.
; Here is what need to do:
; Need to construct the paramters for this function before return to ROM:
; plugin_download(void **start, size_t *bytes, UINT32 *ivt_offset)
    ; Restore registers
    ldmfd sp!, {r0-r7, lr}

    ldr r3, DDR_DEST_ADDR
    str r3, [r0]
    ldr r3, =BOOT_DATA_IMG_LEN
    str r3, [r1]
    ldr r3, =(IVT_OFFSET+(IVT2_ADDR-IVT_ADDR))
    str r3, [r2]
    mov r0, #1

    bx lr          ; return back to ROM code


Thanks in advance,