1
0
Fork 0
forked from len0rd/rockbox

Removed PP5020_ prefix from register defines and added/renamed some

defines.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8438 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Thom Johansen 2006-01-24 22:31:57 +00:00
parent 289ec0164b
commit 22e6c02f8e
5 changed files with 40 additions and 41 deletions

View file

@ -203,7 +203,7 @@ static int ipod_4g_button_read(void)
void ipod_4g_button_int(void)
{
PP5020_CPU_HI_INT_CLR = PP5020_I2C_MASK;
CPU_HI_INT_CLR = I2C_MASK;
udelay(250);
outl(0x0, 0x7000c140);
int_btn = ipod_4g_button_read();
@ -211,8 +211,8 @@ void ipod_4g_button_int(void)
outl(0x400a1f00, 0x7000c100);
GPIOB_OUTPUT_VAL |= 0x10;
PP5020_CPU_INT_EN = 0x40000000;
PP5020_CPU_HI_INT_EN = PP5020_I2C_MASK;
CPU_INT_EN = 0x40000000;
CPU_HI_INT_EN = I2C_MASK;
}
#endif
@ -397,8 +397,8 @@ void button_init(void)
GPIOA_INT_CLR = GPIOA_INT_STAT & 0x20;
/* enable interrupts */
GPIOA_INT_EN = 0x20;
PP5020_CPU_INT_EN = 0x40000000;
PP5020_CPU_HI_INT_EN = PP5020_I2C_MASK;
CPU_INT_EN = 0x40000000;
CPU_HI_INT_EN = I2C_MASK;
#endif /* CONFIG_KEYPAD */
queue_init(&button_queue);

View file

@ -31,7 +31,6 @@
/*** definitions ***/
#define IPOD_HW_REVISION (*((volatile unsigned long*)0x00002084))
#define IPOD_PP5020_RTC (*((volatile unsigned long*)0x60005010))
#define IPOD_LCD_BASE 0x70008a0c
#define IPOD_LCD_BUSY_MASK 0x80000000
@ -49,7 +48,7 @@ static int lcd_type = 1; /* 0 = "old" Color/Photo, 1 = "new" Color & Nano */
/* check if number of useconds has past */
static inline int timer_check(unsigned long clock_start, unsigned long usecs)
{
if ( (IPOD_PP5020_RTC - clock_start) >= usecs ) {
if ( (USEC_TIMER - clock_start) >= usecs ) {
return 1;
} else {
return 0;
@ -59,7 +58,7 @@ static inline int timer_check(unsigned long clock_start, unsigned long usecs)
static void lcd_wait_write(void)
{
if ((inl(IPOD_LCD_BASE) & IPOD_LCD_BUSY_MASK) != 0) {
int start = IPOD_PP5020_RTC;
int start = USEC_TIMER;
do {
if ((inl(IPOD_LCD_BASE) & IPOD_LCD_BUSY_MASK) == 0) break;

View file

@ -57,35 +57,35 @@
#define DEV_RS (*(volatile unsigned long *)(0x60006004))
#define DEV_EN (*(volatile unsigned long *)(0x6000600c))
#define PP5020_TIMER1 (*(volatile unsigned long *)(0x60005000))
#define PP5020_TIMER1_ACK (*(volatile unsigned long *)(0x60005004))
#define PP5020_TIMER2 (*(volatile unsigned long *)(0x60005008))
#define PP5020_TIMER2_ACK (*(volatile unsigned long *)(0x6000500c))
#define PP5020_TIMER_STATUS (*(volatile unsigned long *)(0x60005010))
#define TIMER1_CFG (*(volatile unsigned long *)(0x60005000))
#define TIMER1_VAL (*(volatile unsigned long *)(0x60005004))
#define TIMER2_CFG (*(volatile unsigned long *)(0x60005008))
#define TIMER2_VAL (*(volatile unsigned long *)(0x6000500c))
#define USEC_TIMER (*(volatile unsigned long *)(0x60005010))
#define PP5020_CPU_INT_STAT (*(volatile unsigned long*)(0x64004000))
#define PP5020_CPU_HI_INT_STAT (*(volatile unsigned long*)(0x64004100))
#define PP5020_CPU_INT_EN (*(volatile unsigned long*)(0x60004024))
#define PP5020_CPU_HI_INT_EN (*(volatile unsigned long*)(0x60004124))
#define PP5020_CPU_INT_CLR (*(volatile unsigned long*)(0x60004028))
#define PP5020_CPU_HI_INT_CLR (*(volatile unsigned long*)(0x60004128))
#define CPU_INT_STAT (*(volatile unsigned long*)(0x64004000))
#define CPU_HI_INT_STAT (*(volatile unsigned long*)(0x64004100))
#define CPU_INT_EN (*(volatile unsigned long*)(0x60004024))
#define CPU_HI_INT_EN (*(volatile unsigned long*)(0x60004124))
#define CPU_INT_CLR (*(volatile unsigned long*)(0x60004028))
#define CPU_HI_INT_CLR (*(volatile unsigned long*)(0x60004128))
#define PP5020_TIMER1_IRQ 0
#define PP5020_TIMER2_IRQ 1
#define PP5020_I2S_IRQ 10
#define PP5020_IDE_IRQ 23
#define PP5020_GPIO_IRQ (32+0)
#define PP5020_SER0_IRQ (32+4)
#define PP5020_SER1_IRQ (32+5)
#define PP5020_I2C_IRQ (32+8)
#define TIMER1_IRQ 0
#define TIMER2_IRQ 1
#define I2S_IRQ 10
#define IDE_IRQ 23
#define GPIO_IRQ (32+0)
#define SER0_IRQ (32+4)
#define SER1_IRQ (32+5)
#define I2C_IRQ (32+8)
#define PP5020_TIMER1_MASK (1 << PP5020_TIMER1_IRQ)
#define PP5020_I2S_MASK (1 << PP5020_I2S_IRQ)
#define PP5020_IDE_MASK (1 << PP5020_IDE_IRQ)
#define PP5020_GPIO_MASK (1 << (PP5020_GPIO_IRQ-32))
#define PP5020_SER0_MASK (1 << (PP5020_SER0_IRQ-32))
#define PP5020_SER1_MASK (1 << (PP5020_SER1_IRQ-32))
#define PP5020_I2C_MASK (1 << (PP5020_I2C_IRQ-32))
#define TIMER1_MASK (1 << TIMER1_IRQ)
#define I2S_MASK (1 << I2S_IRQ)
#define IDE_MASK (1 << IDE_IRQ)
#define GPIO_MASK (1 << (GPIO_IRQ-32))
#define SER0_MASK (1 << (SER0_IRQ-32))
#define SER1_MASK (1 << (SER1_IRQ-32))
#define I2C_MASK (1 << (I2C_IRQ-32))
#define USB2D_IDENT (*(volatile unsigned long*)(0xc5000000))
#define USB_STATUS (*(volatile unsigned long*)(0xc50001a4))

View file

@ -351,7 +351,7 @@ void TIMER1(void)
{
int i;
PP5020_TIMER1_ACK;
TIMER1_VAL; /* Read value to ack IRQ */
/* Run through the list of tick tasks */
for (i = 0;i < MAX_NUM_TICK_TASKS;i++)
{
@ -369,12 +369,12 @@ void TIMER1(void)
void tick_start(unsigned int interval_in_ms)
{
#ifndef BOOTLOADER
PP5020_TIMER1 = 0x0;
PP5020_TIMER1_ACK;
TIMER1_CFG = 0x0;
TIMER1_VAL;
/* enable timer */
PP5020_TIMER1 = 0xc0000000 | (interval_in_ms*1000);
TIMER1_CFG = 0xc0000000 | (interval_in_ms*1000);
/* unmask interrupt source */
PP5020_CPU_INT_EN = PP5020_TIMER1_MASK;
CPU_INT_EN = TIMER1_MASK;
#else
/* We don't enable interrupts in the bootloader */
(void)interval_in_ms;

View file

@ -1112,9 +1112,9 @@ extern void ipod_4g_button_int(void);
void irq(void)
{
if (PP5020_CPU_INT_STAT & PP5020_TIMER1_MASK)
if (CPU_INT_STAT & TIMER1_MASK)
TIMER1();
else if (PP5020_CPU_HI_INT_STAT & PP5020_I2C_MASK)
else if (CPU_HI_INT_STAT & I2C_MASK)
ipod_4g_button_int();
}
#endif