Skip to content

Commit 54f760e

Browse files
swift-tkChromeos LUCI
authored andcommitted
emul: mspi: Add the mspi controller emulator
Add bus emulator support for MSPI and the MSPI controller emulator. The mspi_emul.c not only serves as an emulator but also provides an example implementation of the MSPI API. It does not actually do anything other than validating parameters and forwarding transceive request back to the device driver emulators. (cherry picked from commit f5554ca) Original-Signed-off-by: Swift Tian <[email protected]> GitOrigin-RevId: f5554ca Change-Id: I2bab84f8e8251d626e03925d56e970a34d71e5de Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/5635393 Commit-Queue: Ting Shen <[email protected]> Tested-by: Ting Shen <[email protected]> Reviewed-by: Ting Shen <[email protected]> Tested-by: Dawid Niedźwiecki <[email protected]> Reviewed-by: Dawid Niedźwiecki <[email protected]>
1 parent 9900681 commit 54f760e

File tree

7 files changed

+1074
-8
lines changed

7 files changed

+1074
-8
lines changed

drivers/mspi/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ zephyr_syscall_header(${ZEPHYR_BASE}/include/zephyr/drivers/mspi.h)
44

55
zephyr_library()
66
zephyr_library_sources_ifdef(CONFIG_MSPI_AMBIQ_AP3 mspi_ambiq_ap3.c)
7+
zephyr_library_sources_ifdef(CONFIG_MSPI_EMUL mspi_emul.c)

drivers/mspi/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,6 @@ module-str = mspi
6060
source "subsys/logging/Kconfig.template.log_config"
6161

6262
source "drivers/mspi/Kconfig.ambiq"
63+
source "drivers/mspi/Kconfig.mspi_emul"
6364

6465
endif # MSPI

drivers/mspi/Kconfig.mspi_emul

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright (c) 2024, Ambiq Micro Inc. <www.ambiq.com>
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config MSPI_EMUL
5+
bool "MSPI emulator"
6+
default y
7+
depends on DT_HAS_ZEPHYR_MSPI_EMUL_CONTROLLER_ENABLED
8+
depends on EMUL
9+
select MSPI_XIP
10+
select MSPI_SCRAMBLE
11+
select MSPI_TIMING
12+
select GPIO
13+
help
14+
Enable the MSPI emulator driver. This is a fake driver in that it
15+
does not talk to real hardware. Instead it talks to emulation
16+
drivers that pretend to be devices on the emulated MSPI bus. It is
17+
used for testing drivers for MSPI devices.

0 commit comments

Comments
 (0)