Skip to content

Commit 53e17c4

Browse files
scottwcpgkartben
authored andcommitted
drivers: spi: microchip: Add SPI driver for MEC5 HAL quad SPI
SPI driver for Microchip MEC5 HAL based QSPI controller. QSPI hardware supports full duplex, dual, and quad operation. MEC5 QSPI controller also includes three local DMA channels per direction to off load firmware. The driver API supports full or half-duplex. Due to QSPI hardware not supporting one wire half-duplex, this driver supports full-duplex only. QSPI hardware design requires it to control chip select and current hardware supports up to two chip selects. Zephyr's SPI DT macros store the child SPI device's reg properity as the "slave" member of the SPI configuration structure. The driver uses the "slave" value as the chip select. Additional timing settings specific to SPI flash devices are in a new SPI device YAM file: "microchip,mec5-qspi-device.yaml" which includes the standard "spi-device.yaml". If the new YAML is not used, the QSPI controller will use default timing values for chip select and I/O line taps. Signed-off-by: Scott Worley <scott.worley@microchip.com>
1 parent 035e651 commit 53e17c4

File tree

7 files changed

+618
-1
lines changed

7 files changed

+618
-1
lines changed

drivers/spi/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ zephyr_library_sources_ifdef(CONFIG_SPI_MCUX_DSPI spi_mcux_dspi.c)
3737
zephyr_library_sources_ifdef(CONFIG_SPI_MCUX_ECSPI spi_mcux_ecspi.c)
3838
zephyr_library_sources_ifdef(CONFIG_SPI_MCUX_FLEXCOMM spi_mcux_flexcomm.c)
3939
zephyr_library_sources_ifdef(CONFIG_SPI_MCUX_FLEXIO spi_mcux_flexio.c)
40+
zephyr_library_sources_ifdef(CONFIG_SPI_MEC5_QSPI spi_mchp_mec5_qspi.c)
4041
zephyr_library_sources_ifdef(CONFIG_SPI_NPCX_SPIP spi_npcx_spip.c)
4142
zephyr_library_sources_ifdef(CONFIG_SPI_NRFX_SPI spi_nrfx_spi.c spi_nrfx_common.c)
4243
zephyr_library_sources_ifdef(CONFIG_SPI_NRFX_SPIM spi_nrfx_spim.c spi_nrfx_common.c)

drivers/spi/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ source "drivers/spi/Kconfig.mcux_dspi"
115115
source "drivers/spi/Kconfig.mcux_ecspi"
116116
source "drivers/spi/Kconfig.mcux_flexcomm"
117117
source "drivers/spi/Kconfig.mcux_flexio"
118+
source "drivers/spi/Kconfig.mec5"
118119
source "drivers/spi/Kconfig.npcx"
119120
source "drivers/spi/Kconfig.nrfx"
120121
source "drivers/spi/Kconfig.numaker"

drivers/spi/Kconfig.mec5

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Microchip MEC5 QSPI
2+
3+
# Copyright (c) 2025 Microchip Technology Inc.
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
config SPI_MEC5_QSPI
7+
bool "Microchip MEC5 QSPI driver"
8+
default y
9+
depends on DT_HAS_MICROCHIP_MEC5_QSPI_ENABLED
10+
select PINCTRL
11+
help
12+
Enable support for Microchip MEC5 QSPI driver.

0 commit comments

Comments
 (0)