1 // SPDX-License-Identifier: GPL-2.0+
3 * (C) Copyright 2015 Google, Inc
4 * Written by Simon Glass <sjg@chromium.org>
6 * See README.rockchip for details of the rksd format
15 static void rksd_set_header(void *buf, struct stat *sbuf, int ifd,
16 struct image_tool_params *params)
22 * We need to calculate this using 'RK_SPL_HDR_START' and not using
23 * 'tparams->header_size', as the additional byte inserted when
24 * 'is_boot0' is true counts towards the payload (and not towards the
27 size = params->file_size - RK_SPL_HDR_START;
28 ret = rkcommon_set_header(buf, size, params);
30 /* TODO(sjg@chromium.org): This method should return an error */
31 printf("Warning: SPL image is too large (size %#x) and will "
36 static int rksd_check_image_type(uint8_t type)
38 if (type == IH_TYPE_RKSD)
44 static int rksd_vrec_header(struct image_tool_params *params,
45 struct image_type_params *tparams)
48 * Pad to a 2KB alignment, as required for init_size by the ROM
49 * (see https://lists.denx.de/pipermail/u-boot/2017-May/293268.html)
51 return rkcommon_vrec_header(params, tparams, RK_INIT_SIZE_ALIGN);
59 "Rockchip SD Boot Image support",
62 rkcommon_check_params,
63 rkcommon_verify_header,
64 rkcommon_print_header,
67 rksd_check_image_type,