summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/env/fw_env.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index 381739d28d..8734663cd4 100644
--- a/tools/env/fw_env.c
+++ b/tools/env/fw_env.c
@@ -1647,6 +1647,9 @@ static int check_device_config(int dev)
goto err;
}
DEVTYPE(dev) = mtdinfo.type;
+ if (DEVESIZE(dev) == 0 && ENVSECTORS(dev) == 0 &&
+ mtdinfo.type == MTD_NORFLASH)
+ DEVESIZE(dev) = mtdinfo.erasesize;
if (DEVESIZE(dev) == 0)
/* Assume the erase size is the same as the env-size */
DEVESIZE(dev) = ENVSIZE(dev);