This is the mail archive of the
ecos-patches@sourceware.org
mailing list for the eCos project.
fix v2 strata flash driver
- From: Bart Veer <bartv at ecoscentric dot com>
- To: ecos-patches at sourceware dot org
- Date: Tue, 21 Apr 2009 16:39:54 +0100
- Subject: fix v2 strata flash driver
This fixes the 16AS8 handling in the strata driver in the same way as
the V2 AMD driver.
Bart
2009-04-21 Bart Veer <bartv@ecoscentric.com>
* src/strata.c: Added set of parentheses around macro parameters
used in multiplications. Fixes 16as8 bug.
Index: src/strata.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/intel/stratav2/current/src/strata.c,v
retrieving revision 1.2
diff -u -p -r1.2 strata.c
--- src/strata.c 29 Jan 2009 17:48:27 -0000 1.2
+++ src/strata.c 21 Apr 2009 15:38:01 -0000
@@ -146,10 +146,10 @@
#define STRATA_OFFSET_CFI_WRITE_BUFFER_LSB STRATA_OFFSET_CFI_DATA(0x002A)
#define STRATA_OFFSET_CFI_WRITE_BUFFER_MSB STRATA_OFFSET_CFI_DATA(0x002B)
#define STRATA_OFFSET_CFI_BLOCK_REGIONS STRATA_OFFSET_CFI_DATA(0x002C)
-#define STRATA_OFFSET_CFI_BLOCK_COUNT_LSB(_i_) STRATA_OFFSET_CFI_DATA(0x002D + (4 * _i_))
-#define STRATA_OFFSET_CFI_BLOCK_COUNT_MSB(_i_) STRATA_OFFSET_CFI_DATA(0x002E + (4 * _i_))
-#define STRATA_OFFSET_CFI_BLOCK_SIZE_LSB(_i_) STRATA_OFFSET_CFI_DATA(0x002F + (4 * _i_))
-#define STRATA_OFFSET_CFI_BLOCK_SIZE_MSB(_i_) STRATA_OFFSET_CFI_DATA(0x0030 + (4 * _i_))
+#define STRATA_OFFSET_CFI_BLOCK_COUNT_LSB(_i_) STRATA_OFFSET_CFI_DATA(0x002D + (4 * (_i_)))
+#define STRATA_OFFSET_CFI_BLOCK_COUNT_MSB(_i_) STRATA_OFFSET_CFI_DATA(0x002E + (4 * (_i_)))
+#define STRATA_OFFSET_CFI_BLOCK_SIZE_LSB(_i_) STRATA_OFFSET_CFI_DATA(0x002F + (4 * (_i_)))
+#define STRATA_OFFSET_CFI_BLOCK_SIZE_MSB(_i_) STRATA_OFFSET_CFI_DATA(0x0030 + (4 * (_i_)))
#define STRATA_STATUS_SR7 STRATA_SWAP(STRATA_PARALLEL(0x0080))
#define STRATA_STATUS_SR6 STRATA_SWAP(STRATA_PARALLEL(0x0040))
@@ -471,6 +471,6 @@ strata_get_block_info(struct cyg_flash_d
#define STRATA_OFFSET_MANUFACTURER_ID 00
#define STRATA_OFFSET_DEVICE_ID 02
#define STRATA_OFFSET_LOCK_STATUS 04
-#define STRATA_OFFSET_CFI_DATA(_idx_) (2 * _idx_)
+#define STRATA_OFFSET_CFI_DATA(_idx_) (2 * (_idx_))
#include "strata_aux.c"