]>
git.ipfire.org Git - people/ms/u-boot.git/blob - tools/rksd.c
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 int rksd_verify_header(unsigned char *buf
, int size
,
17 struct image_tool_params
*params
)
22 static void rksd_print_header(const void *buf
)
26 static void rksd_set_header(void *buf
, struct stat
*sbuf
, int ifd
,
27 struct image_tool_params
*params
)
32 size
= params
->file_size
- RK_SPL_HDR_START
;
33 ret
= rkcommon_set_header(buf
, size
, params
);
35 /* TODO(sjg@chromium.org): This method should return an error */
36 printf("Warning: SPL image is too large (size %#x) and will not boot\n",
41 static int rksd_extract_subimage(void *buf
, struct image_tool_params
*params
)
46 static int rksd_check_image_type(uint8_t type
)
48 if (type
== IH_TYPE_RKSD
)
54 /* We pad the file out to a fixed size - this method returns that size */
55 static int rksd_vrec_header(struct image_tool_params
*params
,
56 struct image_type_params
*tparams
)
60 rkcommon_vrec_header(params
, tparams
);
62 pad_size
= RK_SPL_HDR_START
+ rkcommon_get_spl_size(params
);
63 debug("pad_size %x\n", pad_size
);
65 return pad_size
- params
->file_size
- tparams
->header_size
;
73 "Rockchip SD Boot Image support",
76 rkcommon_check_params
,
80 rksd_extract_subimage
,
81 rksd_check_image_type
,