Skip to content

Commit 080787f

Browse files
TomChang19dleach02
authored andcommitted
drivers: espi: npcx: update the parsing function for espi taf
This commit updates the FLASHRXBUF parsing functionality of eSPI TAF. It ensures that data can be read correctly from FLASHRXBUF[0]. And, the eSPI TAF request can be parsed correctly. Signed-off-by: Tom Chang <[email protected]>
1 parent 15774e1 commit 080787f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/espi/espi_npcx.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,11 +383,13 @@ static uint32_t espi_taf_parse(const struct device *dev)
383383
{
384384
struct espi_reg *const inst = HAL_INSTANCE(dev);
385385
struct npcx_taf_head taf_head;
386-
uint32_t taf_addr;
386+
uint32_t taf_addr, head_data;
387387
uint8_t i, roundsize;
388388

389389
/* Get type, length and tag from RX buffer */
390-
memcpy(&taf_head, (void *)&inst->FLASHRXBUF[0], sizeof(taf_head));
390+
head_data = inst->FLASHRXBUF[0];
391+
taf_head = *(struct npcx_taf_head *)&head_data;
392+
391393
taf_pckt.type = taf_head.type;
392394
taf_pckt.len = (((uint16_t)taf_head.tag_hlen & 0xF) << 8) | taf_head.llen;
393395
taf_pckt.tag = taf_head.tag_hlen >> 4;

0 commit comments

Comments
 (0)