Simon Glass | c9c7403 | 2015-08-30 16:55:24 -0600 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2015 Google, Inc |
| 3 | * Written by Simon Glass <sjg@chromium.org> |
| 4 | * |
| 5 | * SPDX-License-Identifier: GPL-2.0+ |
| 6 | */ |
| 7 | |
| 8 | #ifndef _RKCOMMON_H |
| 9 | #define _RKCOMMON_H |
| 10 | |
| 11 | enum { |
| 12 | RK_BLK_SIZE = 512, |
Jeffy Chen | 0e7c90a | 2015-11-17 14:20:30 +0800 | [diff] [blame^] | 13 | RK_INIT_OFFSET = 4, |
| 14 | RK_MAX_BOOT_SIZE = 512 << 10, |
Simon Glass | c9c7403 | 2015-08-30 16:55:24 -0600 | [diff] [blame] | 15 | }; |
| 16 | |
| 17 | /** |
| 18 | * rkcommon_set_header() - set up the header for a Rockchip boot image |
| 19 | * |
| 20 | * This sets up a 2KB header which can be interpreted by the Rockchip boot ROM. |
| 21 | * |
| 22 | * @buf: Pointer to header place (must be at least 2KB in size) |
| 23 | * @file_size: Size of the file we want the boot ROM to load, in bytes |
| 24 | * @return 0 if OK, -ENOSPC if too large |
| 25 | */ |
| 26 | int rkcommon_set_header(void *buf, uint file_size); |
| 27 | |
| 28 | #endif |