diff options
Diffstat (limited to 'firmware/target/mips/ingenic_x1000/installer-x1000.h')
-rw-r--r-- | firmware/target/mips/ingenic_x1000/installer-x1000.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/firmware/target/mips/ingenic_x1000/installer-x1000.h b/firmware/target/mips/ingenic_x1000/installer-x1000.h new file mode 100644 index 0000000000..b71839a907 --- /dev/null +++ b/firmware/target/mips/ingenic_x1000/installer-x1000.h | |||
@@ -0,0 +1,55 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2021 Aidan MacDonald | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | #ifndef __INSTALLER_X1000_H__ | ||
23 | #define __INSTALLER_X1000_H__ | ||
24 | |||
25 | /* This API is for the bootloader recovery menu and Rockbox utility to handle | ||
26 | * bootloader installation, backup, and restore. | ||
27 | * | ||
28 | * Currently the installer can only handle NAND flash, although the X1000 can | ||
29 | * boot from NOR flash or SD/MMC. Support for other storage media can be added | ||
30 | * when there is a target that needs it. | ||
31 | * | ||
32 | * Bootloader updates are tarballs, and they can "monkey patch" the flash in | ||
33 | * a customizable way (but fixed at compile time). | ||
34 | * | ||
35 | * Backup and restore simply takes the range of eraseblocks touched by the | ||
36 | * monkey patch and copies them to or from a regular file. | ||
37 | */ | ||
38 | |||
39 | enum { | ||
40 | IERR_SUCCESS = 0, | ||
41 | IERR_OUT_OF_MEMORY, | ||
42 | IERR_FILE_NOT_FOUND, | ||
43 | IERR_FILE_IO, | ||
44 | IERR_BAD_FORMAT, | ||
45 | IERR_NAND_OPEN, | ||
46 | IERR_NAND_READ, | ||
47 | IERR_NAND_WRITE, | ||
48 | }; | ||
49 | |||
50 | extern int install_bootloader(const char* filename); | ||
51 | extern int backup_bootloader(const char* filename); | ||
52 | extern int restore_bootloader(const char* filename); | ||
53 | extern const char* installer_strerror(int rc); | ||
54 | |||
55 | #endif /* __INSTALLER_X1000_H__ */ | ||