From 242cbd5cd73542c79020a4ce9a8e83ee0391bc72 Mon Sep 17 00:00:00 2001 From: Daniel Ankers Date: Wed, 22 Nov 2006 00:41:30 +0000 Subject: Change if CONFIG_CPU==PP50XX to ifdef CPU_PP where appropriate git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11569 a1c6a512-1295-4272-9138-f99709370657 --- apps/debug_menu.c | 4 ++-- apps/playback.c | 2 +- apps/plugins/plugin.lds | 8 ++------ firmware/app.lds | 2 +- firmware/export/config.h | 3 +-- firmware/export/kernel.h | 2 +- firmware/export/timer.h | 2 +- firmware/kernel.c | 2 +- firmware/rolo.c | 8 +++++--- firmware/timer.c | 13 ++++++------- 10 files changed, 21 insertions(+), 25 deletions(-) diff --git a/apps/debug_menu.c b/apps/debug_menu.c index ecdbe26370..d127aefbfb 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c @@ -385,8 +385,8 @@ bool dbg_flash_id(unsigned* p_manufacturer, unsigned* p_device, unsigned addr1, unsigned addr2) { -#if (CONFIG_CPU == PP5002) || (CONFIG_CPU == PP5020) - /* TODO: Implement for iPod */ +#ifdef CPU_PP + /* TODO: Implement for PortalPlayer */ (void)p_manufacturer; (void)p_device; (void)addr1; diff --git a/apps/playback.c b/apps/playback.c index 9bf6942e7f..9d03cd266c 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -167,7 +167,7 @@ enum { #endif /* As defined in plugin.lds */ -#if CONFIG_CPU == PP5020 || CONFIG_CPU == PP5002 +#if defined(CPU_PP) #define CODEC_IRAM_ORIGIN 0x4000c000 #define CODEC_IRAM_SIZE 0xc000 #elif defined(IAUDIO_X5) diff --git a/apps/plugins/plugin.lds b/apps/plugins/plugin.lds index f72059c107..ef0dece36f 100644 --- a/apps/plugins/plugin.lds +++ b/apps/plugins/plugin.lds @@ -20,10 +20,6 @@ OUTPUT_FORMAT(elf32-sh) #define ARCH_IRIVER #endif -#if (CONFIG_CPU==PP5002) || (CONFIG_CPU==PP5020) -#define ARCH_IPOD -#endif - #ifdef ARCH_IRIVER #define DRAMORIG 0x31000000 #define IRAMORIG 0x1000c000 @@ -32,7 +28,7 @@ OUTPUT_FORMAT(elf32-sh) #define DRAMORIG 0x31000000 #define IRAMORIG 0x10010000 #define IRAMSIZE 0x10000 -#elif defined(ARCH_IPOD) +#elif defined(CPU_PP) #define DRAMORIG 0x00000000 #define IRAMORIG 0x4000c000 #define IRAMSIZE 0xc000 @@ -77,7 +73,7 @@ SECTIONS .text : { *(.text*) -#if (CONFIG_CPU==PP5020) || (CONFIG_CPU==PNX0101) || (CONFIG_CPU==PP5002) +#if defined(CPU_PP) || (CONFIG_CPU==PNX0101) *(.glue_7) *(.glue_7t) #endif diff --git a/firmware/app.lds b/firmware/app.lds index a081536dfb..965d7950af 100644 --- a/firmware/app.lds +++ b/firmware/app.lds @@ -36,7 +36,7 @@ INPUT(target/sh/crt0.o) #define DRAMORIG 0x31000000 + STUBOFFSET #define IRAMORIG 0x10000000 #define IRAMSIZE 0x10000 -#elif (CONFIG_CPU==PP5002) || (CONFIG_CPU==PP5020) +#elif defined(CPU_PP) #define DRAMORIG 0x00000000 + STUBOFFSET #define IRAMORIG 0x40000000 #define IRAMSIZE 0xc000 diff --git a/firmware/export/config.h b/firmware/export/config.h index 74c7e924ff..95e3399690 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h @@ -275,8 +275,7 @@ #if !defined(SIMULATOR) && /* Not for simulators */ \ (((CONFIG_CPU == SH7034) && !defined(PLUGIN)) || /* SH1 archos: core only */ \ defined(CPU_COLDFIRE) || /* Coldfire: core, plugins, codecs */ \ - (CONFIG_CPU == PP5020) || /* iPod and H10: core, plugins, codecs */ \ - (CONFIG_CPU == PP5002) || /* iPod: core, plugins, codecs */ \ + defined(CPU_PP) || /* PortalPlayer: core, plugins, codecs */ \ (CONFIG_CPU == PNX0101)) #define ICODE_ATTR __attribute__ ((section(".icode"))) #define ICONST_ATTR __attribute__ ((section(".irodata"))) diff --git a/firmware/export/kernel.h b/firmware/export/kernel.h index 32c052a34d..2474c6dcac 100644 --- a/firmware/export/kernel.h +++ b/firmware/export/kernel.h @@ -70,7 +70,7 @@ struct mutex }; /* global tick variable */ -#if ((CONFIG_CPU == PP5002) || (CONFIG_CPU == PP5020)) && defined(BOOTLOADER) +#if defined(CPU_PP) && defined(BOOTLOADER) /* We don't enable interrupts in the iPod bootloader, so we need to fake the current_tick variable */ #define current_tick (signed)(USEC_TIMER/10000) diff --git a/firmware/export/timer.h b/firmware/export/timer.h index 2fb7c6495f..f32a8a1790 100644 --- a/firmware/export/timer.h +++ b/firmware/export/timer.h @@ -26,7 +26,7 @@ #ifndef SIMULATOR -#if CONFIG_CPU == PP5020 || CONFIG_CPU == PP5002 +#if defined(CPU_PP) /* Portalplayer chips use a microsecond timer. */ #define TIMER_FREQ 1000000 #elif defined(CPU_COLDFIRE) diff --git a/firmware/kernel.c b/firmware/kernel.c index 79f26f58f2..5a58935601 100644 --- a/firmware/kernel.c +++ b/firmware/kernel.c @@ -25,7 +25,7 @@ #include "system.h" #include "panic.h" -#if ((CONFIG_CPU != PP5020) && (CONFIG_CPU != PP5002)) || !defined(BOOTLOADER) +#if !defined(CPU_PP) || !defined(BOOTLOADER) long current_tick = 0; #endif diff --git a/firmware/rolo.c b/firmware/rolo.c index 846cebff6f..057c4820eb 100644 --- a/firmware/rolo.c +++ b/firmware/rolo.c @@ -32,8 +32,10 @@ #if !defined(IRIVER_IFP7XX_SERIES) && \ (CONFIG_CPU != PP5002) && !defined(IRIVER_H10) && \ - !defined(IRIVER_H10_5GB) && (CONFIG_CPU != S3C2440) + !defined(IRIVER_H10_5GB) && (CONFIG_CPU != S3C2440) && \ + !defined(SANSA_E200) /* FIX: this doesn't work on iFP, 3rd Gen ipods, or H10 yet */ +/* TODO: Test on the Sansa */ #define IRQ0_EDGE_TRIGGER 0x80 @@ -111,7 +113,7 @@ int rolo_load(const char* filename) { int fd; long length; -#if defined(CPU_COLDFIRE) || (CONFIG_CPU == PP5002) || (CONFIG_CPU == PP5020) +#if defined(CPU_COLDFIRE) || defined(CPU_PP) int i; unsigned long checksum,file_checksum; #else @@ -141,7 +143,7 @@ int rolo_load(const char* filename) length = filesize(fd) - FIRMWARE_OFFSET_FILE_DATA; -#if defined(CPU_COLDFIRE) || (CONFIG_CPU == PP5002) || (CONFIG_CPU == PP5020) +#if defined(CPU_COLDFIRE) || defined(CPU_PP) /* Read and save checksum */ lseek(fd, FIRMWARE_OFFSET_FILE_CRC, SEEK_SET); if (read(fd, &file_checksum, 4) != 4) { diff --git a/firmware/timer.c b/firmware/timer.c index 80d3fec561..849e4ba598 100644 --- a/firmware/timer.c +++ b/firmware/timer.c @@ -49,7 +49,7 @@ void TIMER1(void) pfn_timer(); TER1 = 0xff; /* clear all events */ } -#elif CONFIG_CPU == PP5020 || CONFIG_CPU == PP5002 +#elif defined(CPU_PP) void TIMER2(void) { TIMER2_VAL; /* ACK interrupt */ @@ -150,7 +150,7 @@ static bool timer_set(long cycles, bool start) if (start || (TCN1 >= TRR1)) TCN1 = 0; /* reset the timer */ TER1 = 0xff; /* clear all events */ -#elif CONFIG_CPU == PP5020 || CONFIG_CPU == PP5002 +#elif defined(CPU_PP) if (cycles > 0x20000000 || cycles < 2) return false; @@ -200,9 +200,8 @@ bool timer_register(int reg_prio, void (*unregister_callback)(void), if (reg_prio <= timer_prio || cycles == 0) return false; -#if (CONFIG_CPU==PP5002) || (CONFIG_CPU==PP5020) || (CONFIG_CPU==PNX0101) \ - || (CONFIG_CPU==S3C2440) - /* TODO: Implement for iPod and iFP (if possible) */ +#if defined(CPU_PP) || (CONFIG_CPU==PNX0101) || (CONFIG_CPU==S3C2440) + /* TODO: Implement for PortalPlayer and iFP (if possible) */ (void)int_prio; #endif @@ -227,7 +226,7 @@ bool timer_register(int reg_prio, void (*unregister_callback)(void), ICR2 = 0x90; /* interrupt on level 4.0 */ and_l(~(1<<10), &IMR); TMR1 |= 1; /* start timer */ -#elif CONFIG_CPU == PP5020 || CONFIG_CPU == PP5002 +#elif defined(CPU_PP) /* unmask interrupt source */ CPU_INT_EN = TIMER2_MASK; #endif @@ -247,7 +246,7 @@ void timer_unregister(void) #elif defined CPU_COLDFIRE TMR1 = 0; /* disable timer 1 */ or_l((1<<10), &IMR); /* disable interrupt */ -#elif CONFIG_CPU == PP5020 || CONFIG_CPU == PP5002 +#elif defined(CPU_PP) TIMER2_CFG = 0; /* stop timer 2 */ CPU_INT_CLR = TIMER2_MASK; #endif -- cgit v1.2.3