diff options
author | Simon Glass <sjg@chromium.org> | 2015-08-30 16:55:24 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2015-09-02 21:28:23 -0600 |
commit | a131c1f44231e3546b1cca8480400c98d1dd7ac8 (patch) | |
tree | 47a83ea33e52c0cb131f025e4ccd045e022ab049 /tools/rkcommon.h | |
parent | 1b99e5bbb619f91c675306226a262a14c9d9a3a3 (diff) |
rockchip: Add the rkimage format to mkimage
Rockchip SoCs require certain formats for code that they execute, The
simplest format is a 4-byte header at the start of a binary file. Add
support for this so that we can create images that the boot ROM understands.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/rkcommon.h')
-rw-r--r-- | tools/rkcommon.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tools/rkcommon.h b/tools/rkcommon.h new file mode 100644 index 0000000000..57fd726004 --- /dev/null +++ b/tools/rkcommon.h @@ -0,0 +1,28 @@ +/* + * (C) Copyright 2015 Google, Inc + * Written by Simon Glass <sjg@chromium.org> + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#ifndef _RKCOMMON_H +#define _RKCOMMON_H + +enum { + RK_BLK_SIZE = 512, + RK_CODE1_OFFSET = 4, + RK_MAX_CODE1_SIZE = 32 << 10, +}; + +/** + * rkcommon_set_header() - set up the header for a Rockchip boot image + * + * This sets up a 2KB header which can be interpreted by the Rockchip boot ROM. + * + * @buf: Pointer to header place (must be at least 2KB in size) + * @file_size: Size of the file we want the boot ROM to load, in bytes + * @return 0 if OK, -ENOSPC if too large + */ +int rkcommon_set_header(void *buf, uint file_size); + +#endif |