1
0
Fork 0
forked from len0rd/rockbox

Cleaned up the bootloader code a little

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7113 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Linus Nielsen Feltzing 2005-07-12 05:25:42 +00:00
parent 3382abaf58
commit d2ca7fc5de

View file

@ -34,6 +34,7 @@
#include "panic.h" #include "panic.h"
#include "power.h" #include "power.h"
#include "file.h" #include "file.h"
#include "uda1380.h"
#define DRAM_START 0x31000000 #define DRAM_START 0x31000000
@ -45,13 +46,6 @@
int line = 0; int line = 0;
char *modelname[] =
{
"H120/140",
"H110/115",
"H300"
};
int usb_screen(void) int usb_screen(void)
{ {
return 0; return 0;
@ -59,22 +53,22 @@ int usb_screen(void)
static void usb_enable(bool on) static void usb_enable(bool on)
{ {
GPIO_OUT &= ~0x01000000; /* GPIO24 is the Cypress chip power */ and_l(~0x01000000, &GPIO_OUT); /* GPIO24 is the Cypress chip power */
GPIO_ENABLE |= 0x01000000; or_l(0x01000000, &GPIO_ENABLE);
GPIO_FUNCTION |= 0x01000000; or_l(0x01000000, &GPIO_FUNCTION);
GPIO1_FUNCTION |= 0x00000080; /* GPIO39 is the USB detect input */ or_l(0x00000080, &GPIO1_FUNCTION); /* GPIO39 is the USB detect input */
if(on) if(on)
{ {
/* Power on the Cypress chip */ /* Power on the Cypress chip */
GPIO_OUT |= 0x01000000; or_l(0x01000000, &GPIO_OUT);
sleep(2); sleep(2);
} }
else else
{ {
/* Power off the Cypress chip */ /* Power off the Cypress chip */
GPIO_OUT &= ~0x01000000; and_l(~0x01000000, &GPIO_OUT);
} }
} }
@ -188,8 +182,8 @@ void main(void)
/* Read the buttons early */ /* Read the buttons early */
/* Set GPIO33, GPIO37, GPIO38 and GPIO52 as general purpose inputs */ /* Set GPIO33, GPIO37, GPIO38 and GPIO52 as general purpose inputs */
GPIO1_FUNCTION |= 0x00100062; or_l(0x00100062, &GPIO1_FUNCTION);
GPIO1_ENABLE &= ~0x00100062; and_l(~0x00100062, &GPIO1_ENABLE);
data = GPIO1_READ; data = GPIO1_READ;
if ((data & 0x20) == 0) if ((data & 0x20) == 0)
@ -210,13 +204,8 @@ void main(void)
/* Set up waitstates for the peripherals */ /* Set up waitstates for the peripherals */
set_cpu_frequency(0); /* PLL off */ set_cpu_frequency(0); /* PLL off */
#endif #endif
/* UDA1380 RESET */ uda1380_reset();
GPIO_OUT |= (1<<29);
GPIO_ENABLE |= (1<<29);
GPIO_FUNCTION |= (1<<29);
sleep(HZ/100);
GPIO_OUT &= ~(1<<29);
backlight_init(); backlight_init();
set_irq_level(0); set_irq_level(0);