summaryrefslogtreecommitdiffstats
path: root/src/target/firmware/flash
diff options
context:
space:
mode:
authorIngo Albrecht2010-07-19 08:56:25 +0200
committerIngo Albrecht2010-07-20 14:41:21 +0200
commit3f891b75c683b43ac65a7f36d58b2de40fae1942 (patch)
treeea984132f4e40c57b94e15ac180c1e79d2413185 /src/target/firmware/flash
parentfirmware: some documentation about memory maps and linkage (diff)
downloadosmocom-3f891b75c683b43ac65a7f36d58b2de40fae1942.tar.gz
osmocom-3f891b75c683b43ac65a7f36d58b2de40fae1942.tar.xz
osmocom-3f891b75c683b43ac65a7f36d58b2de40fae1942.zip
firmware: better flash protection
Diffstat (limited to 'src/target/firmware/flash')
-rw-r--r--src/target/firmware/flash/cfi_flash.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/target/firmware/flash/cfi_flash.c b/src/target/firmware/flash/cfi_flash.c
index 452b395..5ca81b6 100644
--- a/src/target/firmware/flash/cfi_flash.c
+++ b/src/target/firmware/flash/cfi_flash.c
@@ -142,7 +142,11 @@ static inline uint16_t flash_read16(const void *base_addr, uint32_t offset)
__ramtext
static char flash_protected(uint32_t block_offset) {
#ifdef CONFIG_FLASH_WRITE
+# ifdef CONFIG_FLASH_WRITE_LOADER
return 0;
+# else
+ return block_offset <= 0xFFFF;
+# endif
#else
return 1;
#endif