# HG changeset patch # User asl # Date 1093078097 0 # Node ID c8515e56054864de94512079f1c2795b49dd445f # Parent faaea4243d52b0afd68927361955f271c9494925 2004-08-21 Andrew Lunn * include/flash_strata_v2.inl (flash_unlock_block): * cdl/flash_strata_v2.cdl: CDL to control the maximum number of blocks the driver supports. Some of the newer strata device has more than the default maximum of 128. Problem pointed out by Kevin Zhang. diff --git a/packages/devs/flash/intel/stratav2/current/ChangeLog b/packages/devs/flash/intel/stratav2/current/ChangeLog --- a/packages/devs/flash/intel/stratav2/current/ChangeLog +++ b/packages/devs/flash/intel/stratav2/current/ChangeLog @@ -1,3 +1,10 @@ +2004-08-21 Andrew Lunn + + * include/flash_strata_v2.inl (flash_unlock_block): + * cdl/flash_strata_v2.cdl: CDL to control the maximum number of + blocks the driver supports. Some of the newer strata device has more + than the default maximum of 128. Problem pointed out by Kevin Zhang. + 2004-08-13 Andrew Lunn * cdl/flash_strata_v2.cdl: Indicate we implement diff --git a/packages/devs/flash/intel/stratav2/current/cdl/flash_strata_v2.cdl b/packages/devs/flash/intel/stratav2/current/cdl/flash_strata_v2.cdl --- a/packages/devs/flash/intel/stratav2/current/cdl/flash_strata_v2.cdl +++ b/packages/devs/flash/intel/stratav2/current/cdl/flash_strata_v2.cdl @@ -65,13 +65,26 @@ cdl_package CYGPKG_DEVS_FLASH_STRATA_V2 description "FLASH memory device support for Intel StrataFlash using the V2 driver API" - cdl_option CYGOPT_DEVS_FLASH_STRATA_V2_LOCKING { + cdl_component CYGOPT_DEVS_FLASH_STRATA_V2_LOCKING { display "Flash device implements locking" default_value 1 implements CYGHWR_IO_FLASH_BLOCK_LOCKING description " This option controls whether the driver will include code to allow locking and unlocking of blocks." + + cdl_option CYGNUM_DEVS_FLASH_STRATA_V2_MAX_BLOCKS { + display "Maximum number of blocks the driver supports" + flavor data + default_value 128 + description " + The strata devices do not support unlocking an + individual block. Instead it is necassary to unlock + all the blocks in one operation and then lock all those + blocks that should be blocked. To do this we need an array + containing the current status of the blocks. This controls the + size of that array." + } } cdl_option CYGOPT_DEV_FLASH_STATE_V2_DUMP_UNKNOWN { diff --git a/packages/devs/flash/intel/stratav2/current/include/flash_strata_v2.inl b/packages/devs/flash/intel/stratav2/current/include/flash_strata_v2.inl --- a/packages/devs/flash/intel/stratav2/current/include/flash_strata_v2.inl +++ b/packages/devs/flash/intel/stratav2/current/include/flash_strata_v2.inl @@ -434,7 +434,6 @@ strata_program_buf (struct cyg_flash_dev // then reset the regions which are known to be locked. // -#define MAX_FLASH_BLOCKS 128 #define FLASH_LOCK_MASK 0x1 // which bit of the read query has the lock bit static int @@ -447,7 +446,7 @@ strata_unlock_block(struct cyg_flash_dev #ifndef CYGOPT_FLASH_IS_SYNCHRONOUS int i; volatile flash_t *bp, *bpv, *block; - unsigned char is_locked[MAX_FLASH_BLOCKS]; + unsigned char is_locked[CYGNUM_DEVS_FLASH_STRATA_V2_MAX_BLOCKS]; #endif // Get base address and map addresses to virtual addresses