Commit Graph

19 Commits

Author SHA1 Message Date
Pisit Sawangvonganan
b8a8173c1f drivers: kconfig: fix typo
Utilize a code spell-checking tool to scan for and correct spelling errors
in `Kconfig` files within the `drivers` directory.
Additionally, incorporates a fix recommended by the reviewer.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2025-07-01 10:58:54 -10:00
Andrzej Głąbek
e78729609d drivers: mspi_dw: Add support for RX dummy cycles in single line mode
Support for 8 dummy cycles in a single line RX transaction is required
for the standard JEDEC Read SFDP command. The SSI controller does not
support dummy cycles in Standard SPI mode, but the driver can simulate
those by just sending a dummy data byte.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2025-06-23 13:42:07 +02:00
Andrzej Głąbek
28dafe36e3 drivers: mspi_dw: Add error reporting on RX FIFO overflow
Immediately finish an RX transfer when the RX FIFO overflow is
encountered and return the -EIO error code, which better indicates
the problem than -ETIMEDOUT that was returned previously in such
case.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2025-06-23 13:42:07 +02:00
Andrzej Głąbek
e4dc74452c drivers: mspi_dw: Improve transfer handling
- use separate code paths for TX and RX in ISR
- make sending of dummy bytes in the single line mode (Standard
  SPI) more consistent so it can be easily extended
- use value 0 instead of 0xAA for dummy bytes as there is normally
  no point in making noise one the MOSI line when only receiving
  data (it can only be useful in debugging transfers)
- move all writing of data in the TX FIFO to ISR to avoid broken
  transfers in the single line mode (where the clock stretching
  is not available) when the driver is preempted right before it
  enables interrupts
- use the TX FIFO start level also for transfers without data,
  so that it's not possible that the TX FIFO gets emptied between
  the writes of command and address fields in the single line mode
- add a few comments to explain better how transfers are handled

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2025-06-23 13:42:07 +02:00
Andrzej Głąbek
6ddb616a23 drivers: mspi_dw: Add waiting for clock in nRF EXMIF specific resume
After the START task is triggered, the clock that drives the SSI core
needs some time to become ready. Before that, writes to SSI registers
may be unsuccessful. Add a loop that performs test writes to one of
the registers after the EXMIF peripheral is resumed to ensure that it
is fully operable.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2025-06-23 13:42:07 +02:00
Andrzej Głąbek
8b67b36f41 drivers: mspi_dw: Apply a few minor corrections
- replace %d with %u in two error log message format strings
- add checks for maximum supported address length
- correct *_WAIT_CYCLES_MAX macros used in XIP handling routines
  (although their values are valid, they belong to different SSI
  registers)
- remove one unnecessary use of SPI_CTRLR0_WAIT_CYCLES_MASK
- remove doubled definitions of the XIP_CTRL register bit fields

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2025-06-23 13:42:07 +02:00
Swift Tian
69c14e37ac drivers: mspi: add ambiq mspi timing scan utility
The utility may be used during development stage to get
ambiq platform specific timing parameters for mspi devices.

Signed-off-by: Swift Tian <swift.tian@ambiq.com>
2025-06-18 07:36:26 +02:00
Hao Luo
e05abfdcf4 drivers: mspi: ambiq: optimize ambiq mspi device pm
This commit optimizes the device pm for ambiq mspi driver
by adding pinctrl sleep/resume.

Signed-off-by: Hao Luo <hluo@ambiq.com>
2025-06-17 07:22:44 +02:00
Swift Tian
726eb0a25d drivers: mspi: add apollo5x MSPI controller
Add the MSPI controller support for apollo5x.
Add the MSPI controller to mspi API test.
Updated west.yml for hal updates.

Signed-off-by: Swift Tian <swift.tian@ambiq.com>
2025-05-07 10:33:38 +02:00
Swift Tian
5c7e7eab7f drivers: mspi: shroud controller specifics and fix potential issue
1. Moved ambiq specific macro to mspi_ambiq header.
2. Always fill rx&tx dummy settings regardless of transfer direction.
3. Add the CONFIG_MSPI_* macro for optional features.
4. Fixed the ID read process and add k_sleep during busy_wait in
   atxp032 driver.

Signed-off-by: Swift Tian <swift.tian@ambiq.com>
2025-05-07 10:33:38 +02:00
Hao Luo
6f4b92d64d soc: ambiq: Optimize the inclusion relationship of header files
Optimized the inclusion relationship of header files

Signed-off-by: Hao Luo <hluo@ambiq.com>
2025-04-17 09:06:18 +02:00
Hao Luo
a460479ff7 drivers: ambiq: Correct peripheral instance calculation
This commit corrected ambiq peripheral instance calculations

Signed-off-by: Hao Luo <hluo@ambiq.com>
2025-03-25 05:59:42 +01:00
Andrzej Głąbek
b31eeb6c6e drivers: mspi: Add driver for DesignWare SSI based controllers
Add a generic driver for MSPI controllers based on the DesignWare
SSI core. With small vendor-specific adaptations covering integration
details, it should be possible to use the driver for various devices.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2025-03-07 19:42:46 +01:00
Pieter De Gendt
e2cde472a7 drivers: mspi: Place API into iterable section
Add wrapper DEVICE_API macro to all mspi_driver_api instances.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-12-02 22:09:03 +00:00
Swift Tian
744338f6ea drivers: mspi: fix incorrect DT macro used in controller emulator
DT_INST* should be used in MSPI_CONFIG or device tree value capture
will fail sliently and fall back to defaults.

Signed-off-by: Swift Tian <swift.tian@ambiq.com>
2024-10-22 22:46:47 -04:00
Richard Wheatley
188fc58c72 drivers: update AMBIQ drivers to use proper base address
REG_X_BASEADDR will be removed from all hal files.
This forces the use of the peripheral base address
Define MSPI_PORT macro for chip drivers

Signed-off-by: Richard Wheatley <richard.wheatley@ambiq.com>
2024-08-11 19:18:09 -05:00
Swift Tian
43e23cf9f2 drivers: mspi: Add Ambiq apollo3p mspi controller
The Ambiq MSPI controller is implemented using the MSPI bus API.
The hardware supports up to 48MHz octal SDR with XIP, scrambling and
hardware command queue features.

Signed-off-by: Swift Tian <swift.tian@ambiq.com>
2024-06-14 21:07:00 -04:00
Swift Tian
f5554ca762 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.

Signed-off-by: Swift Tian <swift.tian@ambiq.com>
2024-06-14 21:07:00 -04:00
Swift Tian
8a2bf58826 drivers: mspi: Add the new MSPI API
The MSPI(multi-bit SPI) is provided as a generic API to accommodate
advanced SPI peripherals and devices that typically require command,
address and data phases, and multiple signal lines during these phases.
While the API supports advanced features such as XIP eXecute In Place
and scrambling, it is also compatible with generic SPI.

Signed-off-by: Swift Tian <swift.tian@ambiq.com>
2024-06-14 21:07:00 -04:00