Skip to content

Commit

Permalink
drivers: espi: npcx: update the parsing function for espi taf
Browse files Browse the repository at this point in the history
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 <CHChang19@nuvoton.com>
  • Loading branch information
TomChang19 authored and dleach02 committed Oct 1, 2024
1 parent 15774e1 commit 080787f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/espi/espi_npcx.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,11 +383,13 @@ static uint32_t espi_taf_parse(const struct device *dev)
{
struct espi_reg *const inst = HAL_INSTANCE(dev);
struct npcx_taf_head taf_head;
uint32_t taf_addr;
uint32_t taf_addr, head_data;
uint8_t i, roundsize;

/* Get type, length and tag from RX buffer */
memcpy(&taf_head, (void *)&inst->FLASHRXBUF[0], sizeof(taf_head));
head_data = inst->FLASHRXBUF[0];
taf_head = *(struct npcx_taf_head *)&head_data;

taf_pckt.type = taf_head.type;
taf_pckt.len = (((uint16_t)taf_head.tag_hlen & 0xF) << 8) | taf_head.llen;
taf_pckt.tag = taf_head.tag_hlen >> 4;
Expand Down

0 comments on commit 080787f

Please sign in to comment.