2 * Copyright (C) 2016 Freescale Semiconductor, Inc.
4 * SPDX-License-Identifier: GPL-2.0+
9 #define ROM_API_TABLE_BASE_ADDR_LEGACY 0x180
10 #define ROM_VERSION_OFFSET 0x80
11 #define ROM_API_HWCNFG_SETUP_OFFSET 0x08
22 * Check if we are in USB serial download mode and immediately return to ROM
23 * Need to check USB CTRL clock firstly, then check the USBx_nASYNCLISTADDR
41 * The following is to fill in those arguments for this ROM function
42 * pu_irom_hwcnfg_setup(void **start, size_t *bytes, const void *boot_data)
43 * This function is used to copy data from the storage media into DDR.
44 * start - Initial (possibly partial) image load address on entry.
45 * Final image load address on exit.
46 * bytes - Initial (possibly partial) image size on entry.
47 * Final image size on exit.
48 * boot_data - Initial @ref ivt Boot Data load address.
55 * check the _pu_irom_api_table for the address
57 before_calling_rom___pu_irom_hwcnfg_setup:
58 ldr r3, =ROM_VERSION_OFFSET
60 ldr r3, =ROM_API_TABLE_BASE_ADDR_LEGACY
61 ldr r4, [r3, #ROM_API_HWCNFG_SETUP_OFFSET]
63 after_calling_rom___pu_irom_hwcnfg_setup:
66 /* To return to ROM from plugin, we need to fill in these argument.
67 * Here is what need to do:
68 * Need to construct the paramters for this function before return to ROM:
69 * plugin_download(void **start, size_t *bytes, UINT32 *ivt_offset)
77 ldr r5, second_ivt_offset
82 /* return back to ROM code */
85 /* make the following data right in the end of the output*/
88 #define FLASH_OFFSET 0x400
91 * second_ivt_offset is the offset from the "second_ivt_header" to
92 * "image_copy_start", which involves FLASH_OFFSET, plus the first
93 * ivt_header, the plugin code size itself recorded by "ivt2_header"
96 second_ivt_offset: .long (ivt2_header + 0x2C + FLASH_OFFSET)
99 * The following is the second IVT header plus the second boot data
101 ivt2_header: .long 0x0
102 app2_code_jump_v: .long 0x0
105 boot_data2_ptr: .long 0x0
107 app_code_csf2: .long 0x0
109 boot_data2: .long 0x0
110 image_len2: .long 0x0