summaryrefslogtreecommitdiff
path: root/src/flash
diff options
context:
space:
mode:
authorAlexandre Pereira da Silva <aletes.xgr@gmail.com>2011-04-12 12:56:28 -0300
committerØyvind Harboe <oyvind.harboe@zylin.com>2011-04-19 12:53:05 +0200
commit32ede8fa21fecb68d404b25251ec29ce5e8e6505 (patch)
treef0989e1bcfaa744c520d57b78a4a7da766e87d84 /src/flash
parente105915a4a1ca8f5c80d25b0a79728bc16f306b1 (diff)
downloadopenocd_libswd-32ede8fa21fecb68d404b25251ec29ce5e8e6505.tar.gz
openocd_libswd-32ede8fa21fecb68d404b25251ec29ce5e8e6505.tar.bz2
openocd_libswd-32ede8fa21fecb68d404b25251ec29ce5e8e6505.tar.xz
openocd_libswd-32ede8fa21fecb68d404b25251ec29ce5e8e6505.zip
Fix non cfi x16 nor flash connected to x8 bus. The ids in the table should be masked before comparison.
Diffstat (limited to 'src/flash')
-rw-r--r--src/flash/nor/non_cfi.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/flash/nor/non_cfi.c b/src/flash/nor/non_cfi.c
index b6739043..795f60da 100644
--- a/src/flash/nor/non_cfi.c
+++ b/src/flash/nor/non_cfi.c
@@ -454,13 +454,19 @@ static struct non_cfi non_cfi_flashes[] = {
void cfi_fixup_non_cfi(struct flash_bank *bank)
{
+ unsigned int mask;
struct cfi_flash_bank *cfi_info = bank->driver_priv;
struct non_cfi *non_cfi = non_cfi_flashes;
+ if(cfi_info->x16_as_x8)
+ mask = 0xFF;
+ else
+ mask = 0xFFFF;
+
for (non_cfi = non_cfi_flashes; non_cfi->mfr; non_cfi++)
{
if ((cfi_info->manufacturer == non_cfi->mfr)
- && (cfi_info->device_id == non_cfi->id))
+ && (cfi_info->device_id == (non_cfi->id & mask)))
{
break;
}