summaryrefslogtreecommitdiffstats
path: root/spi.c
diff options
context:
space:
mode:
Diffstat (limited to 'spi.c')
-rw-r--r--spi.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/spi.c b/spi.c
index 894f73f..0a4a618 100644
--- a/spi.c
+++ b/spi.c
@@ -110,7 +110,10 @@ int spi_chip_read(struct flashctx *flash, uint8_t *buf, unsigned int start,
* means 0xffffff, the highest unsigned 24bit number.
*/
addrbase = spi_get_valid_read_addr(flash);
- if (addrbase + flash->chip->total_size * 1024 > (1 << 24)) {
+ /* Show flash chip size warning if flash chip doesn't support
+ 4-Bytes Addressing mode and last address excedes 24 bits */
+ if (!(flash->chip->feature_bits & FEATURE_4BA_SUPPORT) &&
+ addrbase + flash->chip->total_size * 1024 > (1 << 24)) {
msg_perr("Flash chip size exceeds the allowed access window. ");
msg_perr("Read will probably fail.\n");
/* Try to get the best alignment subject to constraints. */
OpenPOWER on IntegriCloud