From 9d07a05275b4d4935b78b29883e9401ba3f79cb8 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Fri, 24 Mar 2017 15:48:26 +0100 Subject: state: backend_circular: Set minumum writesize to 8 NOR flashes have a write size of 1. With this the metadata may end up on non-4-byte-aligned offsets. Force the minimum writesize to 8 so that the metadata is always at aligned offsets. Signed-off-by: Sascha Hauer --- src/barebox-state/backend_bucket_circular.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/barebox-state/backend_bucket_circular.c b/src/barebox-state/backend_bucket_circular.c index 58fffd1..5a525f6 100644 --- a/src/barebox-state/backend_bucket_circular.c +++ b/src/barebox-state/backend_bucket_circular.c @@ -475,6 +475,9 @@ int state_backend_bucket_circular_create(struct device_d *dev, const char *path, struct state_backend_storage_bucket_circular *circ; int ret; + if (writesize < 8) + writesize = 8; + circ = xzalloc(sizeof(*circ)); circ->eraseblock = eraseblock; circ->writesize = writesize; -- cgit v1.2.3