From a1191902cab72b9f7127365fac39a1e1d5c9abda Mon Sep 17 00:00:00 2001 From: wdenk Date: Sun, 9 Jan 2005 17:12:27 +0000 Subject: * Patch by Jon Loeliger, 02 Sep 2004: Reset monitor size back to 256 so environment can be written to flash on MPC85xx ADS and CDS releases. * Patch by Paolo Broggini, 02 Sep 2004: Make BSS clearing on ARM systems more robust * Patch by Yue Hu and Joe, 01 Sep 2004: - add PCI support for ixp425; - add EEPRO100 suppor tfor ixdp425 board. * Fix problem with protected sector detection in driver/cfi_flash.c --- drivers/cfi_flash.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'drivers/cfi_flash.c') diff --git a/drivers/cfi_flash.c b/drivers/cfi_flash.c index 4ced810385..101eb74913 100644 --- a/drivers/cfi_flash.c +++ b/drivers/cfi_flash.c @@ -1066,10 +1066,22 @@ static ulong flash_get_size (ulong base, int banknum) for (j = 0; j < erase_region_count; j++) { info->start[sect_cnt] = sector; sector += (erase_region_size * size_ratio); - info->protect[sect_cnt] = - flash_isset (info, sect_cnt, - FLASH_OFFSET_PROTECT, - FLASH_STATUS_PROTECT); + + /* + * Only read protection status from supported devices (intel...) + */ + switch (info->vendor) { + case CFI_CMDSET_INTEL_EXTENDED: + case CFI_CMDSET_INTEL_STANDARD: + info->protect[sect_cnt] = + flash_isset (info, sect_cnt, + FLASH_OFFSET_PROTECT, + FLASH_STATUS_PROTECT); + break; + default: + info->protect[sect_cnt] = 0; /* default: not protected */ + } + sect_cnt++; } } -- cgit