Skip to content

Commit

Permalink
intel_adsp: mem_window: reinitialize after idle exit
Browse files Browse the repository at this point in the history
Exiting idle state requires to reinitialize all memory window
instances to flush the cached memory.
Added function that calls initialization of devices during runtime.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
  • Loading branch information
Andrey Borisovich committed Mar 24, 2023
1 parent fc367d4 commit 8dcac84
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions soc/xtensa/intel_adsp/common/include/mem_window.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ struct mem_win_config {
bool read_only;
};

void mem_window_idle_exit(void);

#endif

#endif
8 changes: 8 additions & 0 deletions soc/xtensa/intel_adsp/common/mem_window.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ __imr int mem_win_init(const struct device *dev)
return 0;
}

void mem_window_idle_exit(void)
{
mem_win_init(DEVICE_DT_GET(MEM_WINDOW_NODE(0)));
mem_win_init(DEVICE_DT_GET(MEM_WINDOW_NODE(1)));
mem_win_init(DEVICE_DT_GET(MEM_WINDOW_NODE(2)));
mem_win_init(DEVICE_DT_GET(MEM_WINDOW_NODE(3)));
}

#define MEM_WINDOW_DEFINE(n) \
static const struct mem_win_config mem_win_config_##n = { \
.base_addr = DT_REG_ADDR(MEM_WINDOW_NODE(n)), \
Expand Down

0 comments on commit 8dcac84

Please sign in to comment.