summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2006-11-08 18:33:06 +0000
committerMichael Sevakis <jethead71@rockbox.org>2006-11-08 18:33:06 +0000
commitd7e55278f38b843e77541439209fcf6c0e6f3662 (patch)
treea3ef52a14e64756330f7c8bf86791daba77c900a
parenta32b33bf83b70979d131933ed1bed1b4efeb74ec (diff)
downloadrockbox-d7e55278f38b843e77541439209fcf6c0e6f3662.tar.gz
rockbox-d7e55278f38b843e77541439209fcf6c0e6f3662.zip
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
-rw-r--r--firmware/export/config-h100.h3
-rw-r--r--firmware/export/config-h120.h3
-rw-r--r--firmware/system.c19
-rw-r--r--firmware/target/coldfire/system-target.h4
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 @@
100/* Define this if you want to use coldfire's i2c interface */ 100/* Define this if you want to use coldfire's i2c interface */
101#define CONFIG_I2C I2C_COLDFIRE 101#define CONFIG_I2C I2C_COLDFIRE
102 102
103/* Define this if you can run rockbox from flash memory */
104#define HAVE_FLASHED_ROCKBOX
105
103/* Define if we have a hardware defect that causes ticking on the audio line */ 106/* Define if we have a hardware defect that causes ticking on the audio line */
104#define HAVE_REMOTE_LCD_TICKING 107#define HAVE_REMOTE_LCD_TICKING
105 108
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 @@
102#define BATTERY_TYPES_COUNT 1 /* only one type */ 102#define BATTERY_TYPES_COUNT 1 /* only one type */
103#define BATTERY_SCALE_FACTOR 16665 /* FIX: this value is picked at random */ 103#define BATTERY_SCALE_FACTOR 16665 /* FIX: this value is picked at random */
104 104
105/* Define this if you can run rockbox from flash memory */
106#define HAVE_FLASHED_ROCKBOX
107
105/* Define if we have a hardware defect that causes ticking on the audio line */ 108/* Define if we have a hardware defect that causes ticking on the audio line */
106#define HAVE_REMOTE_LCD_TICKING 109#define HAVE_REMOTE_LCD_TICKING
107 110
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) {
126} 126}
127 127
128#endif 128#endif
129#if defined(IRIVER_H100_SERIES) && !defined(SIMULATOR) 129
130bool detect_flashed_rockbox(void) 130bool detect_flashed_rockbox(void)
131{ 131{
132#ifdef HAVE_FLASHED_ROCKBOX
132 struct flash_header hdr; 133 struct flash_header hdr;
133 uint8_t *src = (uint8_t *)FLASH_ENTRYPOINT; 134 uint8_t *src = (uint8_t *)FLASH_ENTRYPOINT;
134 135
135# ifndef BOOTLOADER 136#ifndef BOOTLOADER
136 int oldmode; 137 int oldmode = system_memory_guard(MEMGUARD_NONE);
137 oldmode = system_memory_guard(MEMGUARD_NONE); 138#endif
138# endif
139 139
140 memcpy(&hdr, src, sizeof(struct flash_header)); 140 memcpy(&hdr, src, sizeof(struct flash_header));
141 141
142# ifndef BOOTLOADER 142#ifndef BOOTLOADER
143 system_memory_guard(oldmode); 143 system_memory_guard(oldmode);
144# endif 144#endif
145 145
146 if (hdr.magic != FLASH_MAGIC) 146 if (hdr.magic != FLASH_MAGIC)
147 return false; 147 return false;
148 148
149 return true; 149 return true;
150}
151#else 150#else
152bool detect_flashed_rockbox(void)
153{
154 return false; 151 return false;
152#endif /* HAVE_FLASHED_ROCKBOX */
155} 153}
156#endif
157 154
158#if CONFIG_CPU == TCC730 155#if CONFIG_CPU == TCC730
159 156
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)
147#endif 147#endif
148void coldfire_set_pllcr_audio_bits(long bits); 148void coldfire_set_pllcr_audio_bits(long bits);
149 149
150#ifdef HRIVER_H100_SERIES
151bool detect_flashed_rockbox(void);
152#endif
153
154/* 11.2896 MHz */ 150/* 11.2896 MHz */
155#define CPUFREQ_DEFAULT_MULT 1 151#define CPUFREQ_DEFAULT_MULT 1
156#define CPUFREQ_DEFAULT (CPUFREQ_DEFAULT_MULT * CPU_FREQ) 152#define CPUFREQ_DEFAULT (CPUFREQ_DEFAULT_MULT * CPU_FREQ)