diff options
author | Jens Arnold <amiconn@rockbox.org> | 2011-06-19 17:23:18 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2011-06-19 17:23:18 +0000 |
commit | 91ce4b2a60c4cbe8e3568f79c3a73572461ff40d (patch) | |
tree | 863cf4142841fee4dd53e2849d060d2c559cca55 /bootloader | |
parent | e9e0cf59085cb3b3d77c8a2962fd8b80ac4d0c9d (diff) | |
download | rockbox-91ce4b2a60c4cbe8e3568f79c3a73572461ff40d.tar.gz rockbox-91ce4b2a60c4cbe8e3568f79c3a73572461ff40d.zip |
Optional dual-boot support in iAudio X5 and M5 bootloader, based on FS#5289.
In order to enable it, #define HAVE_DUALBOOT when building the bootloader.
Do not use the automatically created x5_fw.bin or m5_fw.bin, but use mkboot
to create a new firmware file from an OF x5_fw.bin resp. m5_fw.bin and
bootloader.bin.
The dual-boot bootloader boots the OF when pressing Play (main or remote) for
more than 3 seconds. Hold it a bit longer because the OF also checks buttons.
Short press boots rockbox.
As a bonus, the Play button read (for hold check) is done a bit earlier for
single-boot mode as well.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30018 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'bootloader')
-rw-r--r-- | bootloader/bootloader.make | 3 | ||||
-rw-r--r-- | bootloader/iaudio_coldfire.c | 16 |
2 files changed, 10 insertions, 9 deletions
diff --git a/bootloader/bootloader.make b/bootloader/bootloader.make index 0118235bb7..78b8b438c4 100644 --- a/bootloader/bootloader.make +++ b/bootloader/bootloader.make | |||
@@ -10,6 +10,7 @@ | |||
10 | INCLUDES += -I$(APPSDIR) | 10 | INCLUDES += -I$(APPSDIR) |
11 | SRC += $(call preprocess, $(APPSDIR)/SOURCES) | 11 | SRC += $(call preprocess, $(APPSDIR)/SOURCES) |
12 | 12 | ||
13 | CONFIGFILE := $(FIRMDIR)/export/config/$(MODELNAME).h | ||
13 | BOOTLDS := $(FIRMDIR)/target/$(CPU)/$(MANUFACTURER)/boot.lds | 14 | BOOTLDS := $(FIRMDIR)/target/$(CPU)/$(MANUFACTURER)/boot.lds |
14 | BOOTLINK := $(BUILDDIR)/boot.link | 15 | BOOTLINK := $(BUILDDIR)/boot.link |
15 | 16 | ||
@@ -17,7 +18,7 @@ CLEANOBJS += $(BUILDDIR)/bootloader.* | |||
17 | 18 | ||
18 | .SECONDEXPANSION: | 19 | .SECONDEXPANSION: |
19 | 20 | ||
20 | $(BOOTLINK): $(BOOTLDS) | 21 | $(BOOTLINK): $(BOOTLDS) $(CONFIGFILE) |
21 | $(call PRINTS,PP $(@F)) | 22 | $(call PRINTS,PP $(@F)) |
22 | $(call preprocess2file,$<,$@,-DLOADADDRESS=$(LOADADDRESS)) | 23 | $(call preprocess2file,$<,$@,-DLOADADDRESS=$(LOADADDRESS)) |
23 | 24 | ||
diff --git a/bootloader/iaudio_coldfire.c b/bootloader/iaudio_coldfire.c index 5639a0e59b..9c829c4a34 100644 --- a/bootloader/iaudio_coldfire.c +++ b/bootloader/iaudio_coldfire.c | |||
@@ -123,6 +123,10 @@ void check_battery(void) | |||
123 | } | 123 | } |
124 | } | 124 | } |
125 | 125 | ||
126 | #if defined(IAUDIO_M5) || defined(IAUDIO_X5) | ||
127 | int initial_gpio_read; | ||
128 | #endif | ||
129 | |||
126 | void main(void) | 130 | void main(void) |
127 | { | 131 | { |
128 | int i; | 132 | int i; |
@@ -144,17 +148,13 @@ void main(void) | |||
144 | if ((GPIO_READ & 0x80000000) == 0) | 148 | if ((GPIO_READ & 0x80000000) == 0) |
145 | rc_on_button = true; | 149 | rc_on_button = true; |
146 | #elif defined(IAUDIO_M5) || defined(IAUDIO_X5) | 150 | #elif defined(IAUDIO_M5) || defined(IAUDIO_X5) |
147 | int data; | ||
148 | |||
149 | or_l(0x0e000000, &GPIO_FUNCTION); /* main Hold & Power, remote Play */ | 151 | or_l(0x0e000000, &GPIO_FUNCTION); /* main Hold & Power, remote Play */ |
150 | and_l(~0x0e000000, &GPIO_ENABLE); | 152 | and_l(~0x0e000000, &GPIO_ENABLE); |
151 | 153 | ||
152 | data = GPIO_READ; | 154 | if ((initial_gpio_read & 0x04000000) == 0) |
153 | |||
154 | if ((data & 0x04000000) == 0) | ||
155 | on_button = true; | 155 | on_button = true; |
156 | 156 | ||
157 | if ((data & 0x02000000) == 0) | 157 | if ((initial_gpio_read & 0x02000000) == 0) |
158 | rc_on_button = true; | 158 | rc_on_button = true; |
159 | #endif | 159 | #endif |
160 | 160 | ||