iPod: Code cleanup - the bootloader now compiles with zero warnings

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7812 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Dave Chapman 2005-11-11 17:51:35 +00:00
parent c2a0406e10
commit d31a32c501
17 changed files with 111 additions and 58 deletions

View file

@ -256,10 +256,11 @@ void adc_init(void)
#elif CONFIG_CPU == PP5020
#warning Implement adc.c
/* TODO: Implement adc.c */
unsigned short adc_read(int channel)
{
(void)channel;
return 0;
}

View file

@ -1247,7 +1247,8 @@ void ata_enable(bool on)
#elif CONFIG_CPU == TCC730
#elif CONFIG_CPU == PP5020
#warning Implement ata_enable()
/* TODO: Implement ata_enable() */
(void)on;
#endif
}
@ -1400,7 +1401,7 @@ int ata_init(void)
bool coldstart = (GPIO_FUNCTION & 0x00080000) == 0;
#elif CONFIG_CPU == PP5020
bool coldstart = false;
#warning Implement coldstart variable
/* TODO: Implement coldstart variable */
#else
bool coldstart = (PACR2 & 0x4000) != 0;
#endif

View file

@ -563,7 +563,10 @@ static int button_read(void)
data = P7;
if (data & 0x01)
btn |= BUTTON_ON;
#elif CONFIG_KEYPAD == IPOD_4G_PAD || CONFIG_KEYPAD == IPOD_NANO_PAD
/* TODO: Implement for iPod */
(void)data;
#endif /* CONFIG_KEYPAD */

View file

@ -28,10 +28,12 @@
/* Local functions definitions */
#if 0
static int i2c_write_byte(int device, unsigned char data);
static int i2c_gen_start(int device);
static void i2c_gen_stop(int device);
static volatile unsigned char *i2c_get_addr(int device);
#endif
#define IPOD_I2C_BASE 0x7000c000
#define IPOD_I2C_CTRL (IPOD_I2C_BASE+0x00)
@ -53,8 +55,8 @@ static volatile unsigned char *i2c_get_addr(int device);
static int
ipod_i2c_wait_not_busy(void)
{
unsigned long timeout;
#if 0
unsigned long timeout;
timeout = jiffies + POLL_TIMEOUT;
while (time_before(jiffies, timeout)) {
if (!(inb(IPOD_I2C_STATUS) & IPOD_I2C_BUSY)) {
@ -65,6 +67,7 @@ ipod_i2c_wait_not_busy(void)
return -ETIMEDOUT;
#endif
return 0;
}
@ -81,8 +84,7 @@ void i2c_init(void)
outl(0x0, 0x600060a4);
outl(0x80 | (0 << 8), 0x600060a4);
i2c_readbyte(0x8, 0);
//i2c_readbyte(0x8, 0);
}
void i2c_close(void)
@ -130,8 +132,9 @@ int i2c_write(int device, unsigned char *buf, int count)
return count;
}
#if 0
/* Write a byte to the interface, returns 0 on success, -1 otherwise. */
int i2c_write_byte(int device, unsigned char data)
static int i2c_write_byte(int device, unsigned char data)
{
if (ipod_i2c_wait_not_busy() < 0) {
return -2;
@ -179,6 +182,7 @@ void i2c_gen_stop(int device)
regs[O_MBCR] &= ~MSTA; /* Clear MSTA to generate STOP */
}
#endif
volatile unsigned char *i2c_get_addr(int device)
{

View file

@ -155,23 +155,26 @@ int lcd_getstringsize(const unsigned char *str, int *w, int *h)
static void setpixel(int x, int y)
{
unsigned short *data = &lcd_framebuffer[y][x*2];
unsigned short *data = (unsigned short*)&lcd_framebuffer[y][x*2];
*data = fg_pattern;
}
static void clearpixel(int x, int y)
{
unsigned short *data = &lcd_framebuffer[y][x*2];
unsigned short *data = (unsigned short*)&lcd_framebuffer[y][x*2];
*data = bg_pattern;
}
static void flippixel(int x, int y)
{
/* What should this do on a color display? */
(void)x;
(void)y;
}
static void nopixel(int x, int y)
{
/* What should this do on a color display? */
(void)x;
(void)y;
}
@ -182,17 +185,18 @@ lcd_pixelfunc_type* const lcd_pixelfuncs[8] = {
};
/* 'mask' and 'bits' contain 2 bits per pixel */
static void flipblock(unsigned short *address, unsigned mask, unsigned bits)
static void flipblock(unsigned char *address, unsigned mask, unsigned bits)
ICODE_ATTR;
static void flipblock(unsigned short *address, unsigned mask, unsigned bits)
static void flipblock(unsigned char *address, unsigned mask, unsigned bits)
{
*address ^= bits & mask;
}
static void bgblock(unsigned short *address, unsigned mask, unsigned bits)
static void bgblock(unsigned char *address, unsigned mask, unsigned bits)
ICODE_ATTR;
static void bgblock(unsigned short *address, unsigned mask, unsigned bits)
static void bgblock(unsigned char *address, unsigned mask, unsigned bits)
{
(void)bits;
if (mask > 0) {
*address = bg_pattern;
} else {
@ -200,10 +204,11 @@ static void bgblock(unsigned short *address, unsigned mask, unsigned bits)
}
}
static void fgblock(unsigned short *address, unsigned mask, unsigned bits)
static void fgblock(unsigned char *address, unsigned mask, unsigned bits)
ICODE_ATTR;
static void fgblock(unsigned short *address, unsigned mask, unsigned bits)
static void fgblock(unsigned char *address, unsigned mask, unsigned bits)
{
(void)bits;
if (mask > 0) {
*address = fg_pattern;
} else {
@ -211,40 +216,40 @@ static void fgblock(unsigned short *address, unsigned mask, unsigned bits)
}
}
static void solidblock(unsigned short *address, unsigned mask, unsigned bits)
static void solidblock(unsigned char *address, unsigned mask, unsigned bits)
ICODE_ATTR;
static void solidblock(unsigned short *address, unsigned mask, unsigned bits)
static void solidblock(unsigned char *address, unsigned mask, unsigned bits)
{
*address = (*address & ~mask) | (bits & mask & fg_pattern)
| (~bits & mask & bg_pattern);
}
static void flipinvblock(unsigned short *address, unsigned mask, unsigned bits)
static void flipinvblock(unsigned char *address, unsigned mask, unsigned bits)
ICODE_ATTR;
static void flipinvblock(unsigned short *address, unsigned mask, unsigned bits)
static void flipinvblock(unsigned char *address, unsigned mask, unsigned bits)
{
*address ^= ~bits & mask;
}
static void bginvblock(unsigned short *address, unsigned mask, unsigned bits)
static void bginvblock(unsigned char *address, unsigned mask, unsigned bits)
ICODE_ATTR;
static void bginvblock(unsigned short *address, unsigned mask, unsigned bits)
static void bginvblock(unsigned char *address, unsigned mask, unsigned bits)
{
mask &= bits;
*address = (*address & ~mask) | (bg_pattern & mask);
}
static void fginvblock(unsigned short *address, unsigned mask, unsigned bits)
static void fginvblock(unsigned char *address, unsigned mask, unsigned bits)
ICODE_ATTR;
static void fginvblock(unsigned short *address, unsigned mask, unsigned bits)
static void fginvblock(unsigned char *address, unsigned mask, unsigned bits)
{
mask &= ~bits;
*address = (*address & ~mask) | (fg_pattern & mask);
}
static void solidinvblock(unsigned short *address, unsigned mask, unsigned bits)
static void solidinvblock(unsigned char *address, unsigned mask, unsigned bits)
ICODE_ATTR;
static void solidinvblock(unsigned short *address, unsigned mask, unsigned bits)
static void solidinvblock(unsigned char *address, unsigned mask, unsigned bits)
{
*address = (*address & ~mask) | (~bits & mask & fg_pattern)
| (bits & mask & bg_pattern);
@ -536,9 +541,9 @@ void lcd_mono_bitmap_part(const unsigned char *src, int src_x, int src_y,
int out_x;
int out_y;
unsigned char pixel;
int src_width=src_x+width+stride;
unsigned short* addr;
(void)stride;
/* nothing to draw? */
if ((width <= 0) || (height <= 0) || (x >= LCD_WIDTH) || (y >= LCD_HEIGHT)
|| (x + width <= 0) || (y + height <= 0))
@ -705,7 +710,7 @@ void lcd_bitmap_part(const unsigned char *src, int src_x, int src_y,
/* Draw a full native bitmap */
void lcd_bitmap(const unsigned char *src, int x, int y, int width, int height)
{
unsigned short* s=src;
unsigned short* s=(unsigned short*)src;
unsigned short* d=(unsigned short*)&lcd_framebuffer[y][x*2];
int k=LCD_WIDTH-width;
int i,j;
@ -782,16 +787,18 @@ void lcd_puts_style(int x, int y, const unsigned char *str, int style)
xpos = xmargin + x*w / strlen(str);
ypos = ymargin + y*h;
lcd_putsxy(xpos, ypos, str);
#if 0
drawmode = (DRMODE_SOLID|DRMODE_INVERSEVID);
(void)style;
#if 0
/* TODO: Implement lcd_fillrect */
lcd_fillrect(xpos + w, ypos, LCD_WIDTH - (xpos + w), h);
if (style & STYLE_INVERT)
{
drawmode = DRMODE_COMPLEMENT;
lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, h);
}
drawmode = lastmode;
#endif
drawmode = lastmode;
}
/* put a string at a given char position */

View file

@ -71,7 +71,7 @@ static int timer_get_current(void)
}
/* check if number of useconds has past */
static int timer_check(int clock_start, int usecs)
static int timer_check(unsigned long clock_start, unsigned long usecs)
{
unsigned long clock;
clock = inl(IPOD_PP5020_RTC);
@ -127,18 +127,21 @@ int lcd_default_contrast(void)
void lcd_set_contrast(int val)
{
#warning: Implement lcd_set_contrast()
/* TODO: Implement lcd_set_contrast() */
(void)val;
}
void lcd_set_invert_display(bool yesno)
{
#warning: Implement lcd_set_invert_display()
/* TODO: Implement lcd_set_invert_display() */
(void)yesno;
}
/* turn the display upside down (call lcd_update() afterwards) */
void lcd_set_flip(bool yesno)
{
#warning: Implement lcd_set_flip()
/* TODO: Implement lcd_set_flip() */
(void)yesno;
}
/* Rolls up the lcd display by the specified amount of lines.
@ -150,8 +153,8 @@ void lcd_set_flip(bool yesno)
* The value must be 0 <= pixels < LCD_HEIGHT. */
void lcd_roll(int lines)
{
/* TODO: Implement lcd_roll() */
lines &= LCD_HEIGHT-1;
#warning: To do: Implement lcd_roll()
}
/* LCD init */
@ -204,7 +207,13 @@ void lcd_init_device(void)
void lcd_blit(const unsigned char* data, int x, int by, int width,
int bheight, int stride)
{
#warning Implement lcd_blit()
/* TODO: Implement lcd_blit() */
(void)data;
(void)x;
(void)by;
(void)width;
(void)bheight;
(void)stride;
}
/* Update a fraction of the display. */

View file

@ -74,7 +74,7 @@ void power_init(void)
spdif_power_enable(false);
#endif
#elif CONFIG_CPU == PP5020
#warning Implement power_init()
/* TODO: Implement power_init() */
#else
#ifdef HAVE_POWEROFF_ON_PB5
PBCR2 &= ~0x0c00; /* GPIO for PB5 */
@ -166,7 +166,7 @@ void ide_power_enable(bool on)
else
or_l(0x80000000, &GPIO_OUT);
#elif CONFIG_CPU == PP5020
#warning Implement ide_power_enable()
/* TODO: Implement ide_power_enable() */
#elif defined(GMINI_ARCH)
if(on)
P1 |= 0x08;
@ -218,7 +218,7 @@ bool ide_powered(void)
#if CONFIG_CPU == MCF5249
return (GPIO_OUT & 0x80000000)?false:true;
#elif CONFIG_CPU == PP5020
#warning Implement ide_powered()
/* TODO: Implement ide_powered() */
return true;
#elif defined(GMINI_ARCH)
return (P1 & 0x08?true:false);
@ -252,7 +252,7 @@ void power_off(void)
#if CONFIG_CPU == MCF5249
and_l(~0x00080000, &GPIO1_OUT);
#elif CONFIG_CPU == PP5020
#warning Implement power_off()
/* TODO: Implement power_off() */
#elif defined(GMINI_ARCH)
P1 &= ~1;
P1CON &= ~1;

View file

@ -146,7 +146,7 @@ bool remote_button_hold(void);
#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_NANO_PAD)
#warning Correct the IPOD definitions
/* TODO: Correct the IPOD definitions */
#define BUTTON_ON 0x0001
#define BUTTON_OFF 0x0002

View file

@ -26,13 +26,12 @@
#ifndef _I2C_ARM_H
#define _I2C_ARM_H
#warning Implement: i2c-pp5020.h
/* TODO: Implement: i2c-pp5020.h */
void i2c_init(void);
int i2c_write(int device, unsigned char *buf, int count);
void i2c_close(void);
#define MAX_LOOP 0x100 /* TODO: select a better value */
/* PLLCR control */

View file

@ -294,7 +294,7 @@ static inline void invalidate_icache(void)
#elif CONFIG_CPU == PP5020
#warning Implement set_irq_level and check CPU frequencies
/* TODO: Implement set_irq_level and check CPU frequencies */
#define CPUFREQ_DEFAULT CPU_FREQ
#define CPUFREQ_NORMAL 37500000

View file

@ -68,8 +68,7 @@ void sleep(int ticks)
void yield(void)
{
#if CONFIG_CPU == PP5020
/* Threading not yet implemented */
#warning Enable yield()
/* TODO: Threading not yet implemented */
return;
#endif
switch_thread();
@ -325,7 +324,8 @@ void tick_start(unsigned int interval_in_ms)
#elif CONFIG_CPU == PP5020
void tick_start(unsigned int interval_in_ms) {
#warning Implement tick_start
/* TODO: Implement tick_start */
(void)interval_in_ms;
}
#endif

View file

@ -73,6 +73,9 @@ void rolo_restart(const unsigned char* source, unsigned char* dest,
: : "a"(dest)
);
#endif
#if CONFIG_CPU == PP5020
/* TODO: Implement for iPod */
#endif
}
#endif
@ -89,7 +92,7 @@ int rolo_load(const char* filename)
{
int fd;
long length;
#if CONFIG_CPU == MCF5249
#if CONFIG_CPU == MCF5249 || CONFIG_CPU == PP5020
int i;
unsigned long checksum,file_checksum;
#else
@ -113,7 +116,7 @@ int rolo_load(const char* filename)
length = filesize(fd) - FIRMWARE_OFFSET_FILE_DATA;
#if CONFIG_CPU == MCF5249
#if CONFIG_CPU == MCF5249 || CONFIG_CPU == PP5020
/* Read and save checksum */
lseek(fd, FIRMWARE_OFFSET_FILE_CRC, SEEK_SET);
if (read(fd, &file_checksum, 4) != 4) {

View file

@ -399,6 +399,9 @@ void sound_set_volume(int value)
#elif (CONFIG_CODEC == MAS3507D) || defined HAVE_UDA1380
current_volume = VOLUME_MIN + (value * VOLUME_RANGE / 100);
set_prescaled_volume(); /* tenth of dB */
#elif (CONFIG_CPU == PP5020)
/* TODO: Implement sound_set_volume() */
(void)value;
#endif
}
@ -412,6 +415,9 @@ void sound_set_balance(int value)
#elif CONFIG_CODEC == MAS3507D || defined HAVE_UDA1380
current_balance = value * VOLUME_RANGE / 100; /* tenth of dB */
set_prescaled_volume();
#elif (CONFIG_CPU == PP5020)
/* TODO: Implement sound_set_balance() */
(void)value;
#endif
}
@ -430,6 +436,9 @@ void sound_set_bass(int value)
uda1380_set_bass(value >> 1);
current_bass = value * 10;
set_prescaled_volume();
#elif (CONFIG_CPU == PP5020)
/* TODO: Implement sound_set_bass() */
(void)value;
#endif
}
@ -448,6 +457,9 @@ void sound_set_treble(int value)
uda1380_set_treble(value >> 1);
current_treble = value * 10;
set_prescaled_volume();
#elif (CONFIG_CPU == PP5020)
/* TODO: Implement sound_set_treble() */
(void)value;
#endif
}

View file

@ -1106,7 +1106,7 @@ int system_memory_guard(int newmode)
}
#elif CONFIG_CPU==PP5020
#warning TODO: Implement system.c
/* TODO: Implement system.c */
void system_init(void) {

View file

@ -42,7 +42,7 @@ struct regs
void *start; /* Thread start address, or NULL when started */
};
#elif CONFIG_CPU == PP5020
#warning TODO: define struct regs
/* TODO: define struct regs */
struct regs
{
void *sp; /* Stack pointer (a15) */
@ -80,15 +80,16 @@ static inline void load_context(const void* addr) __attribute__ ((always_inline)
#if CONFIG_CPU == PP5020
#warning TODO: Implement store_context and load_context
/* TODO: Implement store_context and load_context */
static inline void store_context(void* addr)
{
(void)addr;
}
static inline void load_context(const void* addr)
{
(void)addr;
}

View file

@ -55,7 +55,13 @@ static bool timer_set(long cycles, bool start)
{
int phi = 0; /* bits for the prescaler */
int prescale = 1;
#if CONFIG_CPU==PP5020
/* TODO: Implement for iPod */
(void)start;
(void)phi;
#endif
#ifdef CPU_COLDFIRE
cycles >>= 1; /* the coldfire timer works on busclk == cpuclk/2 */
#endif
@ -156,6 +162,11 @@ bool timer_register(int reg_prio, void (*unregister_callback)(void),
if (reg_prio <= timer_prio || cycles == 0)
return false;
#if CONFIG_CPU==PP5020
/* TODO: Implement for iPod */
(void)int_prio;
#endif
#if CONFIG_CPU == SH7034
if (int_prio < 1 || int_prio > 15)
return false;

View file

@ -146,9 +146,8 @@ static void usb_enable(bool on)
}
#elif defined(USB_IPODSTYLE)
#warning Implement USB_IPODSTYLE
/* TODO: Implement USB_IPODSTYLE */
(void) on;
#else
#ifdef HAVE_LCD_BITMAP
if(read_hw_mask() & USB_ACTIVE_HIGH)
@ -364,7 +363,10 @@ bool usb_detect(void)
/* TODO: add proper code code for H300 USB style */
current_status = false;
#endif
#ifdef USB_IPODSTYLE
/* TODO: Implement USB_IPODSTYLE */
current_status = false;
#endif
return current_status;
}