summaryrefslogtreecommitdiff
path: root/firmware/export/rkw-loader.h
diff options
context:
space:
mode:
authorMarcin Bukat <marcin.bukat@gmail.com>2012-03-04 00:06:20 +0100
committerMarcin Bukat <marcin.bukat@gmail.com>2012-03-04 00:36:02 +0100
commitecbda694b2ada5bacaf108509ed4080b1e00ac4b (patch)
tree7568dea4b5354f6822a21c758d939c2ccb640980 /firmware/export/rkw-loader.h
parent0263fe37e4a0f7db5e647c171afafda9783fc97b (diff)
downloadrockbox-ecbda694b2ada5bacaf108509ed4080b1e00ac4b.tar.gz
rockbox-ecbda694b2ada5bacaf108509ed4080b1e00ac4b.zip
rename rkw.h header file
Change-Id: I2cb6ea7da9c20ed0ef87f4b8ea90d2e4a4a3bca2
Diffstat (limited to 'firmware/export/rkw-loader.h')
-rw-r--r--firmware/export/rkw-loader.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/firmware/export/rkw-loader.h b/firmware/export/rkw-loader.h
new file mode 100644
index 0000000000..2101bd03b7
--- /dev/null
+++ b/firmware/export/rkw-loader.h
@@ -0,0 +1,46 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 *
9 * Copyright (C) 2012 Marcin Bukat
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 1
14 * of the License, or (at your option) any later version.
15 *
16 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
17 * KIND, either express or implied.
18 *
19 ****************************************************************************/
20
21#include <stdint.h>
22
23#define RKLD_MAGIC 0x4c44524b
24#define RKW_HEADER_CRC 0x40000000
25#define RKW_IMAGE_CRC 0x20000000
26
27struct rkw_header_t {
28 uint32_t magic_number; /* Magic number. 0x4C44524B */
29 uint32_t header_size; /* Size of the header */
30 uint32_t image_base; /* Base address of the firmware image */
31 uint32_t load_address; /* Load address */
32 uint32_t load_limit; /* End of the firmware image */
33 uint32_t bss_start; /* This is the start of .bss section of the firmware I suppose */
34 uint32_t reserved0; /* reserved - I've seen only zeros in this field so far */
35 uint32_t reserved1; /* reserved - I've seen only zeros in this field so far */
36 uint32_t entry_point; /* Entry point address */
37 uint32_t load_options; /* 0x80000000 - setup flag (I don't know what it means
38 * but is present in every RKW I saw),
39 * 0x40000000 - check header crc,
40 * 0x20000000 - check firmware crc
41 */
42 uint32_t crc; /* crc32 of the header (excluding crc32 field itself) */
43};
44
45const char *rkw_strerror(int8_t errno);
46int load_rkw(unsigned char* buf, const char* filename, int buffer_size);