diff options
author | anans <anans@google.com> | 2022-04-18 12:21:43 +0530 |
---|---|---|
committer | Anand Saminathan <anans@google.com> | 2022-04-26 06:13:06 +0200 |
commit | a475518337e15935469543b1cce353e5b337ef52 (patch) | |
tree | 6cc922df1a6e7103e518d64f4c2fe0d9d903626c /drivers | |
parent | b3f03b20135fc5fcd5e6ec7e5ca49f1e59b5602e (diff) | |
download | trusted-firmware-a-a475518337e15935469543b1cce353e5b337ef52.tar.gz |
fix(ufs): read and write attribute based on spec
according to the spec, the response to read attr comes in the
ts.attr.value field and not in the data segment.
Signed-off-by: anans <anans@google.com>
Change-Id: Iaf21883bb7e364fd7c7e4bccb33359367a0cf99d
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ufs/ufs.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/ufs/ufs.c b/drivers/ufs/ufs.c index 720b732351..c71ff5a76a 100644 --- a/drivers/ufs/ufs.c +++ b/drivers/ufs/ufs.c @@ -441,7 +441,7 @@ static int ufs_prepare_query(utp_utrd_t *utrd, uint8_t op, uint8_t idn, break; case QUERY_WRITE_ATTR: query_upiu->query_func = QUERY_FUNC_STD_WRITE; - memcpy((void *)&query_upiu->ts.attr.value, (void *)buf, length); + query_upiu->ts.attr.value = htobe32(*((uint32_t *)buf)); break; default: assert(0); @@ -624,12 +624,14 @@ static void ufs_query(uint8_t op, uint8_t idn, uint8_t index, uint8_t sel, case QUERY_READ_FLAG: *(uint32_t *)buf = (uint32_t)resp->ts.flag.value; break; - case QUERY_READ_ATTR: case QUERY_READ_DESC: memcpy((void *)buf, (void *)(utrd.resp_upiu + sizeof(query_resp_upiu_t)), size); break; + case QUERY_READ_ATTR: + *(uint32_t *)buf = htobe32(resp->ts.attr.value); + break; default: /* Do nothing in default case */ break; |