summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDongwoo Lee <dwoo08.lee@samsung.com>2020-03-18 12:35:59 +0900
committerDongwoo Lee <dwoo08.lee@samsung.com>2020-03-18 14:52:49 +0900
commit29950f08d56bd278a198463489be60d6bbdba49c (patch)
treeabc316065c2cd3751d1bd9f9ded63d34d619d114
parent737d065c7fa0dc71223f6eb83dcb938b640dbea4 (diff)
downloadinitrd-flash-29950f08d56bd278a198463489be60d6bbdba49c.tar.gz
initrd-flash-29950f08d56bd278a198463489be60d6bbdba49c.tar.bz2
initrd-flash-29950f08d56bd278a198463489be60d6bbdba49c.zip
thor: Bump protocol version to 5.0
To support the images exceeds 4GB, thor protocol 5.0 is applied. This requires thor client support: Ref: https://git.tizen.org/cgit/tools/lthor/commit/?id=30fa9f0cbfc4b089bb7e733b9cb75a60e1d10369 u-boot thor downloader already supports protocol 5.0: Ref: https://gitlab.denx.de/u-boot/u-boot/-/commit/1fe9ae76b113103bcc40aa15949f9dd8aa0a06a2 Change-Id: I149361ca2f40b5775249f3672e3e19b2f6394b68 Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
-rw-r--r--src/thor-proto.h2
-rw-r--r--src/thor.c6
2 files changed, 5 insertions, 3 deletions
diff --git a/src/thor-proto.h b/src/thor-proto.h
index f384b46..c26aefd 100644
--- a/src/thor-proto.h
+++ b/src/thor-proto.h
@@ -84,7 +84,7 @@ struct data_res_pkt {
int32_t cnt; /* Int. Datas. */
} __attribute__((__packed__));
-#define VER_PROTOCOL_MAJOR 4
+#define VER_PROTOCOL_MAJOR 5
#define VER_PROTOCOL_MINOR 0
#define RQT_PKT_SIZE sizeof(struct rqt_pkt)
diff --git a/src/thor.c b/src/thor.c
index d6dfa09..e19d33f 100644
--- a/src/thor.c
+++ b/src/thor.c
@@ -216,7 +216,8 @@ static int thor_process_rqt_download(struct tfm_context *ctx, struct rqt_pkt *rq
switch (rqt->sub_id) {
case RQT_DL_INIT:
- ctx->thor_file_size = (unsigned long)rqt->int_data[0];
+ ctx->thor_file_size = (uint64_t)rqt->int_data[0]
+ + ((uint64_t)rqt->int_data[1] << 32);
break;
case RQT_DL_FILE_INFO:
file_type = rqt->int_data[0];
@@ -226,7 +227,8 @@ static int thor_process_rqt_download(struct tfm_context *ctx, struct rqt_pkt *rq
break;
}
- ctx->thor_file_size = (unsigned long)rqt->int_data[1];
+ ctx->thor_file_size = (uint64_t)rqt->int_data[1]
+ + ((uint64_t)rqt->int_data[2] << 32);
memcpy(f_name, rqt->str_data[0], FILE_NAME_MAXLEN);
rsp.int_data[0] = DATA_PKT_SIZE;