aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiklas Cassel <niklas.cassel@linaro.org>2018-06-12 20:50:39 +0200
committerBjorn Andersson <bjorn.andersson@linaro.org>2018-06-12 12:08:01 -0700
commita50ec8047cb6b7e4f6051f2a0b2db0bb81b7725b (patch)
tree7b0406977bf3085a4cc7527e66d4d9454bb323a8
parent5fc4cdbba48da4b13ddf5a92cd3d6beb4e49db10 (diff)
qdl: fix qdl when building for 32-bit
The sahara protocol specification defines the image field for a read64 request as 8 bytes. Use the correct type to represent this. This will not change the behavior when building for 64-bit, where the compiler already aligned the offset field correctly, in order to satisfy natural alignment requirements. However, when building for 32-bit, this change results in a qdl that can flash a device successfully. Signed-off-by: Niklas Cassel <niklas.cassel@linaro.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
-rw-r--r--sahara.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sahara.c b/sahara.c
index 7e28443..8820a5b 100644
--- a/sahara.c
+++ b/sahara.c
@@ -78,7 +78,7 @@ struct sahara_pkt {
uint32_t status;
} done_resp;
struct {
- uint32_t image;
+ uint64_t image;
uint64_t offset;
uint64_t length;
} read64_req;
@@ -157,7 +157,7 @@ static void sahara_read64(int fd, struct sahara_pkt *pkt, const char *mbn)
assert(pkt->length == 0x20);
- printf("READ64 image: %d offset: 0x%" PRIx64 " length: 0x%" PRIx64 "\n",
+ printf("READ64 image: %" PRId64 " offset: 0x%" PRIx64 " length: 0x%" PRIx64 "\n",
pkt->read64_req.image, pkt->read64_req.offset, pkt->read64_req.length);
ret = sahara_read_common(fd, mbn, pkt->read64_req.offset, pkt->read64_req.length);