Commit ea3729e23b36233354fd9f9dfd2d1b21ff1f49a8

Authored by Philipp Tomsich
Committed by Simon Glass
1 parent 366aad4d97

rockchip: mkimage: Update comments for header size

The calculation of the variable header size in rkcommon_vrec_header
had been update twice in the earlier series (introducing boot0-style
images to deal with the alignment of the first instruction in 64bit
binaries). Unfortunately, I didn't update the comment twice (so it
remained out-of-date).

This change brings the comment back in-sync with what the code is
doing.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Acked-by: Simon Glass <sjg@chromium.org>

Showing 1 changed file with 13 additions and 9 deletions Side-by-side Diff

... ... @@ -177,7 +177,7 @@
177 177  
178 178 rkcommon_set_header0(buf, file_size, params);
179 179  
180   - /* Set up the SPL name and add the AArch64 'nop' padding, if needed */
  180 + /* Set up the SPL name */
181 181 memcpy(&hdr->magic, rkcommon_get_spl_hdr(params), RK_SPL_HDR_SIZE);
182 182  
183 183 if (rkcommon_need_rc4_spl(params))
184 184  
185 185  
186 186  
... ... @@ -212,17 +212,21 @@
212 212 *
213 213 * 0x0 header0 (see rkcommon.c)
214 214 * 0x800 spl_name ('RK30', ..., 'RK33')
  215 + * (start of the payload for AArch64 payloads: we expect the
  216 + * first 4 bytes to be available for overwriting with our
  217 + * spl_name)
215 218 * 0x804 first instruction to be executed
216   - * (image start for AArch32, 'nop' for AArch64))
217   - * 0x808 second instruction to be executed
218   - * (image start for AArch64)
  219 + * (start of the image/payload for 32bit payloads)
219 220 *
220   - * For AArch64 (ARMv8) payloads, we receive an input file that
221   - * needs to start on an 8-byte boundary (natural alignment), so
222   - * we need to put a NOP at 0x804.
  221 + * For AArch64 (ARMv8) payloads, natural alignment (8-bytes) is
  222 + * required for its sections (so the image we receive needs to
  223 + * have the first 4 bytes reserved for the spl_name). Reserving
  224 + * these 4 bytes is done using the BOOT0_HOOK infrastructure.
223 225 *
224   - * Depending on this, the header is either 0x804 or 0x808 bytes
225   - * in length.
  226 + * Depending on this, the header is either 0x800 (if this is a
  227 + * 'boot0'-style payload, which has reserved 4 bytes at the
  228 + * beginning for the 'spl_name' and expects us to overwrite
  229 + * its first 4 bytes) or 0x804 bytes in length.
226 230 */
227 231 if (rkcommon_spl_is_boot0(params))
228 232 tparams->header_size = RK_SPL_HDR_START;