Commit d90480d3 authored by Kevin Gillespie's avatar Kevin Gillespie Committed by Kevin

Fixing alignment issue with flash algorithm.

Change-Id: Ie3be47c4db541403b1d9215da3dd2d41bae1c462
parent 8817de52
...@@ -509,11 +509,12 @@ static int max32xxx_write(struct flash_bank *bank, const uint8_t *buffer, ...@@ -509,11 +509,12 @@ static int max32xxx_write(struct flash_bank *bank, const uint8_t *buffer,
return retval; return retval;
} }
if (remaining >= 4) { if (remaining >= 16) {
/* try using a block write */ /* try using a block write */
/* 128-bit align the words_remaining */ /* 128-bit align the words_remaining */
words_remaining = remaining / 4; words_remaining = remaining / 16;
words_remaining *= 4;
/* Algorithm will pad with 0xFF */ /* Algorithm will pad with 0xFF */
// words_remaining -= words_remaining % 4; // words_remaining -= words_remaining % 4;
...@@ -643,6 +644,7 @@ static int max32xxx_write(struct flash_bank *bank, const uint8_t *buffer, ...@@ -643,6 +644,7 @@ static int max32xxx_write(struct flash_bank *bank, const uint8_t *buffer,
return ERROR_FAIL; return ERROR_FAIL;
} }
target_read_u32(target, info->flc_base + FLC_CN, &flash_cn);
flash_cn &= ~(FLC_CN_32BIT); flash_cn &= ~(FLC_CN_32BIT);
target_write_u32(target, info->flc_base + FLC_CN, flash_cn); target_write_u32(target, info->flc_base + FLC_CN, flash_cn);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment