Skip to content

drivers: mspi: ambiq: boards: samples: add Apollo3 Blue MSPI support#110514

Open
RichardSWheatley wants to merge 4 commits into
zephyrproject-rtos:mainfrom
AmbiqMicro:apollo3-mspi-updates
Open

drivers: mspi: ambiq: boards: samples: add Apollo3 Blue MSPI support#110514
RichardSWheatley wants to merge 4 commits into
zephyrproject-rtos:mainfrom
AmbiqMicro:apollo3-mspi-updates

Conversation

@RichardSWheatley
Copy link
Copy Markdown
Contributor

@RichardSWheatley RichardSWheatley commented Jun 3, 2026

Extend the Ambiq MSPI AP3 driver to support Apollo3 Blue (in addition
to the existing Apollo3 Plus Blue support), add the necessary board
pinctrl configuration for the Apollo3 EVB, fix the MSPI0 DTS node on
the Apollo3 Blue SoC, and introduce a new sample to verify MSPI TX
signal integrity.

Changes:

dts/arm/ambiq/ambiq_apollo3_blue.dtsi:

  • Rename mspi0 node from spi@40020000 to mspi@40020000
  • Update compatible from ambiq,mspi to ambiq,mspi-controller
  • Add default clock-frequency of 48 MHz

drivers/mspi/Kconfig.ambiq:

  • Gate MSPI_TIMING imply on SOC_APOLLO3P_BLUE
  • Add MSPI_AMBIQ_BUFF_RAM_LOCATION default (0x40000) for Apollo3 Blue

drivers/mspi/mspi_ambiq_ap3.c:

  • Guard Apollo3P Blue-only HAL fields (write latency, DMA boundary,
    instruction/address size runtime control) behind
    CONFIG_SOC_APOLLO3P_BLUE
  • mspi_ambiq_timing_config() returns -ENOTSUP on Apollo3 Blue
  • Return -ENOTSUP for non-zero mem_boundary/time_to_break on
    Apollo3 Blue

boards/ambiq/apollo3_evb/apollo3_evb-pinctrl.dtsi:

  • Add MSPI0_8 (P24) pin group to mspi0_default with iom-mspi binding
  • Add missing ambiq,iom-mspi property to NCE19 group
  • Add mspi0_sleep state covering all six MSPI0 pins as GPIO

samples/boards/ambiq/apollo3_mspi_tx_scope:

  • New sample exercising the MSPI TX path on Apollo3 EVB and
    Apollo3 Plus EVB, intended for use with a logic analyser or
    oscilloscope to verify signal integrity
  • Board conf for apollo3_evb disables serial/console to fit within
    Apollo3 Blue's 320 KB SRAM budget

Tested by building for apollo3_evb/apollo3_blue and
apollo3p_evb/apollo3p_blue and running the TX scope sample on
hardware.

#105729

Rename the mspi0 node from spi@40020000 to mspi@40020000 to
match the actual bus type. Update the compatible string from
ambiq,mspi to ambiq,mspi-controller to align with the binding
name used by the driver. Add clock-frequency = <48000000> as
the default operating frequency.

Signed-off-by: Richard Wheatley <richard.wheatley@ambiq.com>
Guard Apollo3P Blue-only HAL fields (write latency, DMA boundary,
timing control, instruction/address size runtime control) behind
CONFIG_SOC_APOLLO3P_BLUE ifdefs so the driver also compiles and
runs correctly on Apollo3 Blue.

Add a dedicated MSPI_AMBIQ_BUFF_RAM_LOCATION default for Apollo3
Blue (0x40000) to account for its smaller SRAM layout. Gate the
MSPI_TIMING imply on SOC_APOLLO3P_BLUE since the timing API is
not available on Apollo3 Blue.

mspi_ambiq_timing_config() returns -ENOTSUP on Apollo3 Blue.
mem_boundary and time_to_break return -ENOTSUP if non-zero
values are requested on that SoC.

Signed-off-by: Richard Wheatley <richard.wheatley@ambiq.com>
Add mspi0_default group2 for the MSPI0_8 pin (P24) with
iom-mspi and iom-num bindings, and update the NCE19 group3
with the missing ambiq,iom-mspi property.

Add mspi0_sleep state covering all six MSPI0 pins (P22, P26,
P4, P23, P24, P19) as GPIO so they are tristated when the
bus is idle.

Signed-off-by: Richard Wheatley <richard.wheatley@ambiq.com>
Add a new sample that exercises the MSPI TX path on the
Apollo3 EVB and Apollo3 Plus EVB boards. The sample is
intended to be used with a logic analyser or oscilloscope
to verify MSPI signal integrity.

Board-specific overlays configure the MSPI0 peripheral and
pinctrl. The apollo3_evb.conf disables serial/console to fit
within Apollo3 Blue's 320 KB SRAM budget.

Signed-off-by: Richard Wheatley <richard.wheatley@ambiq.com>
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

@JarmouniA JarmouniA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the new sample board/soc specific!?

ret = -EHOSTDOWN;
goto e_return;
}
#endif
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#endif
#endif /* CONFIG_SOC_APOLLO3P_BLUE */

ret = -EHOSTDOWN;
goto e_return;
}
#endif
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#endif
#endif /* CONFIG_SOC_APOLLO3P_BLUE */

@RichardSWheatley
Copy link
Copy Markdown
Contributor Author

Why is the new sample board/soc specific!?

The other boards/socs have an on-board MSPI or a shield. This one does not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Is Ambiq Apollo3 Blue mspi driver missing?

4 participants