summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2017-03-24 15:48:26 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2017-03-31 13:57:56 +0200
commit9d07a05275b4d4935b78b29883e9401ba3f79cb8 (patch)
treed8821ac21ad267fa7403c2c1081c43b54dfafc14
parent9fc5f2a1301a7ad163ad590771a52a58fb0e1c69 (diff)
downloaddt-utils-9d07a05275b4d4935b78b29883e9401ba3f79cb8.tar.gz
dt-utils-9d07a05275b4d4935b78b29883e9401ba3f79cb8.tar.xz
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 <s.hauer@pengutronix.de>
-rw-r--r--src/barebox-state/backend_bucket_circular.c3
1 files changed, 3 insertions, 0 deletions
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;