Browse Source

Fix non cfi x16 nor flash connected to x8 bus. The ids in the table should be masked before comparison.

tags/v0.5.0-rc1
Alexandre Pereira da Silva 13 years ago
committed by Øyvind Harboe
parent
commit
32ede8fa21
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      src/flash/nor/non_cfi.c

+ 7
- 1
src/flash/nor/non_cfi.c View File

@@ -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;
}


Loading…
Cancel
Save