Various coldfire fixes: (1) iAudio Bootloader: Check the status of main & remote power button vs. the respective hold switch, and shut down when on hold. On X5/M5 this check is not strictly necessary for the main unit, but left there to keep things uniform. (2) M3: Stop reading the ADC properly before leaving the bootloader, on RoLo, and on reboot, to make it work reliably after those transitions. (3) Disable all interrupt sources on system init to avoid premature ISR calls after enabling interrupts in general. (4) iAudios: Proper implementation of ide_powered(), avoiding nasty HDD clicks in the bootloader when powering down, e.g. because of Hold. (5) Slight optimisations.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16689 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jens Arnold 2008-03-17 23:47:38 +00:00
parent 4071826c81
commit ed3ff1b0b5
8 changed files with 71 additions and 21 deletions

View file

@ -67,6 +67,7 @@ inline void __reset_cookie(void)
void start_firmware(void)
{
adc_close();
asm(" move.w #0x2700,%sr");
__reset_cookie();
asm(" move.l %0,%%d0" :: "i"(DRAM_START));
@ -126,16 +127,35 @@ void main(void)
int rc;
bool rc_on_button = false;
bool on_button = false;
bool rec_button = false;
bool hold_status = false;
/* We want to read the buttons as early as possible, before the user
releases the ON button */
#ifdef IAUDIO_M3
or_l(0x80000000, &GPIO_FUNCTION); /* remote Play button */
and_l(~0x80000000, &GPIO_ENABLE);
or_l(0x00000202, &GPIO1_FUNCTION); /* main Hold & Play */
if ((GPIO1_READ & 0x000000002) == 0)
on_button = true;
if ((GPIO_READ & 0x80000000) == 0)
rc_on_button = true;
#elif defined(IAUDIO_M5) || defined(IAUDIO_X5)
int data;
(void)rc_on_button;
(void)on_button;
(void)rec_button;
(void)hold_status;
(void)data;
or_l(0x0e000000, &GPIO_FUNCTION); /* main Hold & Power, remote Play */
and_l(~0x0e000000, &GPIO_ENABLE);
data = GPIO_READ;
if ((data & 0x04000000) == 0)
on_button = true;
if ((data & 0x02000000) == 0)
rc_on_button = true;
#endif
power_init();
system_init();
@ -153,6 +173,16 @@ void main(void)
font_init();
adc_init();
button_init();
if ((!on_button || button_hold())
&& (!rc_on_button || remote_button_hold())
&& !charger_inserted())
{
/* No need to check for USB connection here, as USB is handled
* in the cowon loader. */
printf("Hold switch on");
shutdown();
}
printf("Rockbox boot loader");
printf("Version %s", version);