aboutsummaryrefslogtreecommitdiff
path: root/include/flash.h
diff options
context:
space:
mode:
authorNuno Sá2023-05-11 13:19:50 +0200
committerStefan Roese2023-05-15 10:00:30 +0200
commit43bacbe6ab85030a4dc424700f83108333e99536 (patch)
treef3df04cc0570326f3dd9bc9314a0e8c9bdf97165 /include/flash.h
parent177e506952a8ee34011590c4bd578d191fafb1ca (diff)
mtd: cfi: respect reg address length
flash_get_size() will get the flash size from the device itself and go through all erase regions to read protection status. However, the device mappable region (eg: devicetree reg property) might be lower than the device full size which means that the above cycle will result in a data bus exception. This change fixes it by reading the 'addr_size' during probe() and also use that as one possible upper limit. Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Diffstat (limited to 'include/flash.h')
-rw-r--r--include/flash.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/flash.h b/include/flash.h
index 95992fa689b..3710a2731b7 100644
--- a/include/flash.h
+++ b/include/flash.h
@@ -46,6 +46,7 @@ typedef struct {
#ifdef CONFIG_CFI_FLASH /* DM-specific parts */
struct udevice *dev;
phys_addr_t base;
+ phys_size_t addr_size;
#endif
} flash_info_t;