]> git.baikalelectronics.ru Git - uboot.git/commit
mtd: cfi: respect reg address length
authorNuno Sá <nuno.sa@analog.com>
Thu, 11 May 2023 11:19:50 +0000 (13:19 +0200)
committerStefan Roese <sr@denx.de>
Mon, 15 May 2023 08:00:30 +0000 (10:00 +0200)
commit4d59ca2791f6f07e2e08779fa261731de5f6f651
treef3df04cc0570326f3dd9bc9314a0e8c9bdf97165
parent683915c6fcf69e09e652af859d9c0b7938b9b252
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>
drivers/mtd/cfi_flash.c
include/flash.h