Fix the Gigabeat F/X bootloader and add some code from Barry Wardell that was accidentally removed a while ago. Some of these changes are also more work towards getting the bootloader working from flash; it works but the player will not shutdown fully. About 16 mA are still drawn after calling the rom_shutdown routine. If anyone has some insight why I would be very interested.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18492 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Karl Kurbjun 2008-09-11 01:34:52 +00:00
parent 3656382f7d
commit b8a7a373f2
3 changed files with 244 additions and 88 deletions

View file

@ -244,6 +244,24 @@ static void LCD_SPI_init(void)
/* LCD init */
void lcd_init_device(void)
{
#ifdef BOOTLOADER
int i;
/* When the Rockbox bootloader starts, we are changing framebuffer address,
but we don't want what's shown on the LCD to change until we do an
lcd_update(), so copy the data from the old framebuffer to the new one */
unsigned short *buf = (unsigned short*)FRAME;
memcpy(FRAME, (short *)((LCDSADDR1)<<1), 320*240*2);
/* The Rockbox bootloader is transitioning from RGB555I to RGB565 mode
so convert the frambuffer data accordingly */
for(i=0; i< 320*240; i++){
*buf = ((*buf>>1) & 0x1F) | (*buf & 0xffc0);
buf++;
}
#endif
/* Set pins up */
GPHUP &= 0x600;

View file

@ -144,51 +144,49 @@ void s3c_regclr(volatile int *reg, unsigned int mask)
void system_init(void)
{
/* Disable interrupts and set all to IRQ mode */
INTMSK = -1;
INTMOD = 0;
SRCPND = -1;
INTPND = -1;
INTSUBMSK = -1;
SUBSRCPND = -1;
INTMSK = 0xFFFFFFFF;
INTMOD = 0;
SRCPND = 0xFFFFFFFF;
INTPND = 0xFFFFFFFF;
INTSUBMSK = 0xFFFFFFFF;
SUBSRCPND = 0xFFFFFFFF;
GPBCON |= 0x85;
GPBDAT |= 0x07;
GPBUP |= 0x20F;
/* Take care of flash related pins */
GPCCON |= 0x1000;
GPCDAT &= ~0x40;
GPCUP |= 0x51;
GPDCON |= 0x05;
GPDUP |= 0x03;
GPDDAT &= ~0x03;
GPFCON |= 0x00000AAA;
GPFUP |= 0xFF;
GPGCON |= 0x01001000;
GPGUP |= 0x70;
GPHCON |= 0x4005;
GPHDAT |= 0x03;
/* TODO: do something with PRIORITY */
/* Turn off currently-not or never-needed devices */
CLKCON &= ~(
/* Turn off AC97 and Camera */
(1<<19) | (1<<20)
/* Turn off SPI */
| (1 << 18)
/* Turn off IIS */
| (1 << 17)
/* Turn off I2C */
| (1 << 16)
/* Turn off all of the UARTS */
| ( (1<<10) | (1<<11) |(1<<12) )
/* Turn off MMC/SD/SDIO Controller (SDI) */
| (1 << 9)
/* Turn off USB device */
| (1 << 7)
/* Turn off USB host */
| (1 << 6)
/* Turn off NAND flash controller */
| (1 << 4)
);
/* Turn off the USB PLL */
CLKSLOW |= (1 << 7);
/* Turn off currently-not or never-needed devices.
* Be careful here, it is possible to freeze the device by disabling
* clocks at the wrong time.
*
* Turn off AC97, Camera, SPI, IIS, I2C, UARTS, MMC/SD/SDIO Controller
* USB device, USB host, NAND flash controller.
*
* IDLE, Sleep, LCDC, PWM timer, GPIO, RTC, and ADC are untouched (on)
*/
CLKCON &= ~0xFF1ED0;
CLKSLOW |= 0x80;
}
int system_memory_guard(int newmode)