Skip to content

Add support for UDC for Apollo510 family #89023

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

zeonchew
Copy link
Contributor

@zeonchew zeonchew commented Apr 24, 2025

This PR adds support for UDC for Ambiq Apollo510 family. The boards tested are:

  • apollo510_evb

Followings are the USB samples tested:

  • cdc_acm
  • console-next
  • mass
  • hid-keyboard (with CONFIG_PM_DEVICE=n)
  • hid-mouse (with CONFIG_PM_DEVICE=n)
  • webusb-next

However, this PR is opened as draft until the following dependencies is met:

p/s: only commit bf0f76a and fa4c752 belongs to this PR. the other commits belong to another PR as it is needed for UDC code changes to compile. It will not be here when the official PR is up.

swift-tk and others added 12 commits April 23, 2025 16:42
The buf_in_nocache function is to be used by various device drivers
to check if buffer is in noncacheable region.
The cacheable DMA buffer shall be put into section .ambiq_dma_buff
due to certain restrictions of the SoC.

Signed-off-by: Swift Tian <[email protected]>
Standarlized transfer priority and add a medium level.

Signed-off-by: Swift Tian <[email protected]>
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 <[email protected]>
Add the binding properties available to apollo5.

Signed-off-by: Swift Tian <[email protected]>
MSPI controller nodes and corresponding XIP regions are added.

Signed-off-by: Swift Tian <[email protected]>
Add mspi to board devicetree including pinctrl and mspi devices.

Signed-off-by: Swift Tian <[email protected]>
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 <[email protected]>
The APS Z8 driver supports these variants : APS25616n, APS25616BA,
and APS51216BA.

Signed-off-by: Swift Tian <[email protected]>
This device driver supports ISSI is25w/lx032/64 series flash.
Only extended SPI mode(1s-1s-1s, 1s-8s-8s, 1s-1s-8s) is implemented.

Signed-off-by: Swift Tian <[email protected]>
The utility may be used during development stage to get
ambiq platform specific timing parameters for mspi devices.

Signed-off-by: Swift Tian <[email protected]>
Add USB node to apollo510 qualifier, and apollo510_evb board to enable
USB support on the MCU and its EVB.

Signed-off-by: Chew Zeh Yang <[email protected]>
Added handling specific to apollo510 and new feature supported by the
soc.

Signed-off-by: Chew Zeh Yang <[email protected]>
Copy link

The following west manifest projects have changed revision in this Pull Request:

Name Old Revision New Revision Diff
hal_ambiq zephyrproject-rtos/hal_ambiq@e916e84 zephyrproject-rtos/hal_ambiq@9df2220 zephyrproject-rtos/[email protected]

All manifest checks OK

Note: This message is automatically posted and updated by the Manifest GitHub Action.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for UDC for the Ambiq Apollo510 family and updates several USB, MSPI, and flash drivers along with DTS bindings to support new hardware features and improved functionality.

  • Updated DTS bindings for Ambiq MSPI devices and controllers
  • Modified USB device controller driver for cache handling and enhanced clock configuration
  • Updated flash and MSPI drivers to use new priority definitions and timing configuration macros

Reviewed Changes

Copilot reviewed 46 out of 57 changed files in this pull request and generated no comments.

Show a summary per file
File Description
dts/bindings/mspi/ambiq,mspi-device.yaml Updated default array length for timing-config property
dts/bindings/mspi/ambiq,mspi-controller.yaml Added new properties for MSPI controller configuration
drivers/usb/udc/udc_ambiq.c Enhanced cache management, type definitions, and clock handling
drivers/mspi/mspi_ambiq.h Removed unused structure field and added timing scan types
drivers/memc/memc_mspi_aps_z8.h Added support definitions for new memory controller features
drivers/memc/memc_mspi_aps6404l.c Updated timing configuration macros using COND_CODE_1
drivers/flash/flash_mspi_emul_device.c Updated transfer priority definitions
drivers/flash/flash_mspi_atxp032.c Switched to memcpy for JEDEC ID handling and adjusted timing macros
boards/ambiq/apollo510_evb/apollo510_evb.yaml Added mspi and usbd support to board configuration
Files not reviewed (11)
  • boards/ambiq/apollo510_evb/Kconfig.defconfig: Language not supported
  • boards/ambiq/apollo510_evb/apollo510_evb-pinctrl.dtsi: Language not supported
  • boards/ambiq/apollo510_evb/apollo510_evb.dts: Language not supported
  • drivers/flash/CMakeLists.txt: Language not supported
  • drivers/flash/Kconfig.mspi: Language not supported
  • drivers/memc/CMakeLists.txt: Language not supported
  • drivers/memc/Kconfig.mspi: Language not supported
  • drivers/mspi/CMakeLists.txt: Language not supported
  • drivers/mspi/Kconfig.ambiq: Language not supported
  • drivers/usb/udc/Kconfig.ambiq: Language not supported
  • dts/arm/ambiq/ambiq_apollo510.dtsi: Language not supported
Comments suppressed due to low confidence (3)

drivers/usb/udc/udc_ambiq.c:1027

  • The callback parameter type for 'xfer_len' was updated to use XFER_LEN_CB_TYPE; please verify that this type change is consistently used across all related USB transfer functions to avoid potential type mismatches.
uint8_t ep_addr, XFER_LEN_CB_TYPE xfer_len, am_hal_usb_xfer_code_e code, void *param)

dts/bindings/mspi/ambiq,mspi-device.yaml:51

  • The default timing configuration array length changed from 8 to 7 values; please verify that this change is consistent with the updated structure in mspi_ambiq_timing_cfg and does not break expected configurations.
default: [0, 0, 0, 0, 0, 0, 0]

drivers/mspi/mspi_ambiq.h:60

  • The field 'ui32RXDQSDelayEXT' has been removed from the mspi_ambiq_timing_cfg structure; please ensure that all related code and DTS bindings have been updated accordingly to reflect this change.
struct mspi_ambiq_timing_cfg {

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.

2 participants