Skip to content

Commit

Permalink
Merge pull request zephyrproject-rtos#8 from FrameworkComputer/azalea…
Browse files Browse the repository at this point in the history
….ibf_delay

azalea: add small delay for ibf data loss
  • Loading branch information
kiram9 authored Jul 17, 2023
2 parents 577dcc0 + 94a21a3 commit d83900f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Kconfig.zephyr
Original file line number Diff line number Diff line change
Expand Up @@ -890,3 +890,10 @@ config THIRD_PARTY_CUSTOMIZED_DESIGN
help
because framework use windows platform, will need change third
party function to assort windows.

config THIRD_PARTY_CUSTOMIZED_IBF_DELAY
bool "add delay for framework at subs ibf handle"
default n
help
at framework have 8042 data loss issue, need to add a small delay
to make sure we wouldn't loss data in the ibf handle.
9 changes: 9 additions & 0 deletions drivers/espi/host_subs_npcx.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,14 @@ static void host_kbc_ibf_isr(const void *arg)
struct espi_evt_data_kbc *kbc_evt =
(struct espi_evt_data_kbc *)&evt.evt_data;

#if defined(CONFIG_THIRD_PARTY_CUSTOMIZED_IBF_DELAY)
k_busy_wait(4);
#endif
/* KBC Input Buffer Full event */
kbc_evt->evt = HOST_KBC_EVT_IBF;
#if defined(CONFIG_THIRD_PARTY_CUSTOMIZED_IBF_DELAY)
k_busy_wait(4);
#endif
#if defined(CONFIG_THIRD_PARTY_CUSTOMIZED_DESIGN)
/* The data in KBC Input Buffer */
kbc_evt->data = inst_kbc->SHIKMDI;
Expand All @@ -265,6 +271,9 @@ static void host_kbc_ibf_isr(const void *arg)
*/
kbc_evt->type = IS_BIT_SET(inst_kbc->HIKMST, NPCX_HIKMST_A2);

#if defined(CONFIG_THIRD_PARTY_CUSTOMIZED_IBF_DELAY)
k_busy_wait(40);
#endif
LOG_DBG("%s: kbc data 0x%02x", __func__, evt.evt_data);
espi_send_callbacks(host_sub_data.callbacks, host_sub_data.host_bus_dev,
evt);
Expand Down

0 comments on commit d83900f

Please sign in to comment.