2 * (C) Copyright 2015 Google, Inc
3 * Written by Simon Glass <sjg@chromium.org>
5 * SPDX-License-Identifier: GPL-2.0+
7 * See README.rockchip for details of the rksd format
10 #include "imagetool.h"
16 static void rksd_set_header(void *buf, struct stat *sbuf, int ifd,
17 struct image_tool_params *params)
23 * We need to calculate this using 'RK_SPL_HDR_START' and not using
24 * 'tparams->header_size', as the additional byte inserted when
25 * 'is_boot0' is true counts towards the payload (and not towards the
28 size = params->file_size - RK_SPL_HDR_START;
29 ret = rkcommon_set_header(buf, size, params);
31 /* TODO(sjg@chromium.org): This method should return an error */
32 printf("Warning: SPL image is too large (size %#x) and will "
37 static int rksd_check_image_type(uint8_t type)
39 if (type == IH_TYPE_RKSD)
45 static int rksd_vrec_header(struct image_tool_params *params,
46 struct image_type_params *tparams)
49 * Pad to the RK_BLK_SIZE (512 bytes) to be consistent with init_size
50 * being encoded in RK_BLK_SIZE units in header0 (see rkcommon.c).
52 return rkcommon_vrec_header(params, tparams, RK_BLK_SIZE);
60 "Rockchip SD Boot Image support",
63 rkcommon_check_params,
64 rkcommon_verify_header,
65 rkcommon_print_header,
68 rksd_check_image_type,