From d7e55278f38b843e77541439209fcf6c0e6f3662 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Wed, 8 Nov 2006 18:33:06 +0000 Subject: Use HAVE_FLASHED_ROCKBOX when target is flashable. Currenly only used by the H100 series. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11470 a1c6a512-1295-4272-9138-f99709370657 --- firmware/export/config-h100.h | 3 +++ firmware/export/config-h120.h | 3 +++ firmware/system.c | 19 ++++++++----------- firmware/target/coldfire/system-target.h | 4 ---- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/firmware/export/config-h100.h b/firmware/export/config-h100.h index 285ab88930..91b2cb7658 100644 --- a/firmware/export/config-h100.h +++ b/firmware/export/config-h100.h @@ -100,6 +100,9 @@ /* Define this if you want to use coldfire's i2c interface */ #define CONFIG_I2C I2C_COLDFIRE +/* Define this if you can run rockbox from flash memory */ +#define HAVE_FLASHED_ROCKBOX + /* Define if we have a hardware defect that causes ticking on the audio line */ #define HAVE_REMOTE_LCD_TICKING diff --git a/firmware/export/config-h120.h b/firmware/export/config-h120.h index b22ff0eb22..ad73f379b9 100644 --- a/firmware/export/config-h120.h +++ b/firmware/export/config-h120.h @@ -102,6 +102,9 @@ #define BATTERY_TYPES_COUNT 1 /* only one type */ #define BATTERY_SCALE_FACTOR 16665 /* FIX: this value is picked at random */ +/* Define this if you can run rockbox from flash memory */ +#define HAVE_FLASHED_ROCKBOX + /* Define if we have a hardware defect that causes ticking on the audio line */ #define HAVE_REMOTE_LCD_TICKING diff --git a/firmware/system.c b/firmware/system.c index 96d5f96602..207a14727f 100644 --- a/firmware/system.c +++ b/firmware/system.c @@ -126,34 +126,31 @@ void system_init(void) { } #endif -#if defined(IRIVER_H100_SERIES) && !defined(SIMULATOR) + bool detect_flashed_rockbox(void) { +#ifdef HAVE_FLASHED_ROCKBOX struct flash_header hdr; uint8_t *src = (uint8_t *)FLASH_ENTRYPOINT; -# ifndef BOOTLOADER - int oldmode; - oldmode = system_memory_guard(MEMGUARD_NONE); -# endif +#ifndef BOOTLOADER + int oldmode = system_memory_guard(MEMGUARD_NONE); +#endif memcpy(&hdr, src, sizeof(struct flash_header)); -# ifndef BOOTLOADER +#ifndef BOOTLOADER system_memory_guard(oldmode); -# endif +#endif if (hdr.magic != FLASH_MAGIC) return false; return true; -} #else -bool detect_flashed_rockbox(void) -{ return false; +#endif /* HAVE_FLASHED_ROCKBOX */ } -#endif #if CONFIG_CPU == TCC730 diff --git a/firmware/target/coldfire/system-target.h b/firmware/target/coldfire/system-target.h index d885e7551d..24e3fb8705 100644 --- a/firmware/target/coldfire/system-target.h +++ b/firmware/target/coldfire/system-target.h @@ -147,10 +147,6 @@ static inline void invalidate_icache(void) #endif void coldfire_set_pllcr_audio_bits(long bits); -#ifdef HRIVER_H100_SERIES -bool detect_flashed_rockbox(void); -#endif - /* 11.2896 MHz */ #define CPUFREQ_DEFAULT_MULT 1 #define CPUFREQ_DEFAULT (CPUFREQ_DEFAULT_MULT * CPU_FREQ) -- cgit v1.2.3