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