diff options
author | Amaury Pouly <amaury.pouly@gmail.com> | 2016-09-26 21:22:21 +0100 |
---|---|---|
committer | Gerrit Rockbox <gerrit@rockbox.org> | 2016-12-12 12:03:08 +0100 |
commit | a983859291e29e2cfe26df8e00814b546d865b5c (patch) | |
tree | 7ba94ae05153124a52bc546d46aecb91715578b3 /firmware/target/arm/imx233/dualboot-imx233.h | |
parent | 5c50efc9cec9b0b2f0af216c4e9bf82dc3046d04 (diff) | |
download | rockbox-a983859291e29e2cfe26df8e00814b546d865b5c.tar.gz rockbox-a983859291e29e2cfe26df8e00814b546d865b5c.zip |
imx233: add capability to boot OF or updater instead of Rockbox
This commit adds the necessary code in the dualboot stub (bootloader) to
let rockbox control the boot process. In particular, rockbox can now choose
if the next boot will be normal (boot rockbox or OF on magic key), to OF
or to updater.
The intents (to be added in follow-up commits) are:
1) Let the user more easily reboot to the OF. On some targets it is not trivial,
especially in USB mode.
2) Automatically reboot to updater when the user drop firmware.sb at the root
of the drive (currently, the user needs to do that in OF USB mode)
3) Document this OF magic
Change-Id: I86df651dec048c318c6a22de74abb8c6b41aa9ad
Diffstat (limited to 'firmware/target/arm/imx233/dualboot-imx233.h')
-rw-r--r-- | firmware/target/arm/imx233/dualboot-imx233.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/firmware/target/arm/imx233/dualboot-imx233.h b/firmware/target/arm/imx233/dualboot-imx233.h new file mode 100644 index 0000000000..59b6b2f93c --- /dev/null +++ b/firmware/target/arm/imx233/dualboot-imx233.h | |||
@@ -0,0 +1,53 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright © 2011 by Amaury Pouly | ||
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 | #ifndef DUALBOOT_IMX233_H | ||
22 | #define DUALBOOT_IMX233_H | ||
23 | |||
24 | #include "config.h" | ||
25 | |||
26 | /* IMPORTANT NOTE This file is used by both Rockbox (firmware and bootloader) | ||
27 | * and the dualboot stub. The stub #include this file directly with | ||
28 | * COMPILE_DUALBOOT_STUB defined, so make sure this file is independent and does | ||
29 | * not requires anything from the firmware */ | ||
30 | #ifndef COMPILE_DUALBOOT_STUB | ||
31 | #include "stdint.h" | ||
32 | #endif | ||
33 | |||
34 | #ifdef HAVE_DUALBOOT_STUB | ||
35 | /* See dualboot-imx233.c for documentation */ | ||
36 | |||
37 | enum imx233_dualboot_field_t | ||
38 | { | ||
39 | DUALBOOT_CAP_BOOT, /* boot capability: 1 => BOOT field supports OF and UPDATER */ | ||
40 | DUALBOOT_BOOT, /* boot mode: IMX23_BOOT_x */ | ||
41 | }; | ||
42 | |||
43 | #define IMX233_BOOT_NORMAL 0 /* boot Rockbox (or OF if magic button) */ | ||
44 | #define IMX233_BOOT_OF 1 /* boot OF */ | ||
45 | #define IMX233_BOOT_UPDATER 2 /* boot updater */ | ||
46 | |||
47 | /* get field value (or 0 if not present) */ | ||
48 | unsigned imx233_dualboot_get_field(enum imx233_dualboot_field_t field); | ||
49 | /* write field value */ | ||
50 | void imx233_dualboot_set_field(enum imx233_dualboot_field_t field, unsigned val); | ||
51 | #endif /* HAVE_DUALBOOT_STUB */ | ||
52 | |||
53 | #endif /* DUALBOOT_IMX233_H */ | ||