# HG changeset patch # User bartv # Date 1240308806 0 # Node ID 6338fd43e9be3001f22fc6303ee8947b7003a713 # Parent 05a4930e2f1a1a70030626480854ad5b0218bb0b Fix 16as8 macros diff --git a/packages/devs/flash/amd/am29xxxxxv2/current/ChangeLog b/packages/devs/flash/amd/am29xxxxxv2/current/ChangeLog --- a/packages/devs/flash/amd/am29xxxxxv2/current/ChangeLog +++ b/packages/devs/flash/amd/am29xxxxxv2/current/ChangeLog @@ -1,3 +1,8 @@ +2009-04-20 Rene Schipp von Branitz Nielsen + + * src/am29xxxxx.c: Added set of parentheses around macro + parameters used in multiplications. Fixes 16as8 bug. + 2008-12-19 Jonathan Larmour * cdl/flash_am29xxxxx_v2.cdl: Doh, fix doc link properly. diff --git a/packages/devs/flash/amd/am29xxxxxv2/current/src/am29xxxxx.c b/packages/devs/flash/amd/am29xxxxxv2/current/src/am29xxxxx.c --- a/packages/devs/flash/amd/am29xxxxxv2/current/src/am29xxxxx.c +++ b/packages/devs/flash/amd/am29xxxxxv2/current/src/am29xxxxx.c @@ -139,10 +139,10 @@ #define AM29_OFFSET_CFI_Q AM29_OFFSET_CFI_DATA(0x0010) #define AM29_OFFSET_CFI_SIZE AM29_OFFSET_CFI_DATA(0x0027) #define AM29_OFFSET_CFI_BLOCK_REGIONS AM29_OFFSET_CFI_DATA(0x002C) -#define AM29_OFFSET_CFI_BLOCK_COUNT_LSB(_i_) AM29_OFFSET_CFI_DATA(0x002D + (4 * _i_)) -#define AM29_OFFSET_CFI_BLOCK_COUNT_MSB(_i_) AM29_OFFSET_CFI_DATA(0x002E + (4 * _i_)) -#define AM29_OFFSET_CFI_BLOCK_SIZE_LSB(_i_) AM29_OFFSET_CFI_DATA(0x002F + (4 * _i_)) -#define AM29_OFFSET_CFI_BLOCK_SIZE_MSB(_i_) AM29_OFFSET_CFI_DATA(0x0030 + (4 * _i_)) +#define AM29_OFFSET_CFI_BLOCK_COUNT_LSB(_i_) AM29_OFFSET_CFI_DATA(0x002D + (4 * (_i_))) +#define AM29_OFFSET_CFI_BLOCK_COUNT_MSB(_i_) AM29_OFFSET_CFI_DATA(0x002E + (4 * (_i_))) +#define AM29_OFFSET_CFI_BLOCK_SIZE_LSB(_i_) AM29_OFFSET_CFI_DATA(0x002F + (4 * (_i_))) +#define AM29_OFFSET_CFI_BLOCK_SIZE_MSB(_i_) AM29_OFFSET_CFI_DATA(0x0030 + (4 * (_i_))) #define AM29_STATUS_DQ7 AM29_SWAP(AM29_PARALLEL(0x0080)) #define AM29_STATUS_DQ6 AM29_SWAP(AM29_PARALLEL(0x0040)) @@ -509,6 +509,6 @@ am29_get_block_info(struct cyg_flash_dev #define AM29_OFFSET_DEVID3 0x001E #define AM29_OFFSET_AT49_LOCK_STATUS 04 #define AM29_OFFSET_CFI 0x00AA -#define AM29_OFFSET_CFI_DATA(_idx_) (2 * _idx_) +#define AM29_OFFSET_CFI_DATA(_idx_) (2 * (_idx_)) #include "am29xxxxx_aux.c"