summaryrefslogtreecommitdiffstats
path: root/tools/rkcommon.h
blob: 57fd726004c89f324b420793f3549903a300ff01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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
OpenPOWER on IntegriCloud