hujun260 opened a new pull request, #22176:
URL: https://github.com/apache/nuttx/pull/22176
# arm64/imx95: enable SCMI pinctrl, LPUART5, USB device/host, and `/data`
automount
## Summary
This series completes several i.MX95 board-enablement paths for
`imx95-a55-evk`:
- fix the SCMI pinctrl daisy-register field;
- initialize SCMI early enough to use the common LPUART pinmux path;
- expose LPUART5 on the board header and enable it in `nsh_smp`;
- add a Synopsys DWC3 USB 3.0 device-controller driver and `usbdev` config;
- add a ChipIdea/EHCI USB 2.0 host-controller driver and `usbhost` config;
- package an NSH startup script that automatically mounts the user-data FAT
partition at `/data`.
## Commits
```text
f31352482ccd5600cbe67ce594bf038840ce311b arch/arm64/imx9: iomuxc: use dsyreg
for SCMI pinctrl input_register field
6eef744983589a7701fcdefd898093cefd85d843 boards/arm64/imx9/imx95-a55-evk:
add MUX_LPUART5_RX/TX pin macros
a43829e3df5587078285227c9ace5b4440f664b2 arch/arm64/imx9: remove IMX95
pinmux skip and unify LPUART pad config
c793a095725c4a9821203b21c02de52d5131785a
boards/arm64/imx9/imx95-a55-evk/nsh_smp: enable SCMI and LPUART5
751b496913987695093bd4a4e3c70551ddb0c2ea imx9: add Synopsys DWC3 USB 3.0
device controller driver
f8f42e986eeea5dddf322df13077682b90c803e7 imx9/ehci: add USB 2.0 EHCI host
controller for i.MX95
3d12a67dd1521bf295de0d300c7762e9af92678f
boards/arm64/imx9/imx95-a55-evk/nsh_smp: add rcS startup script to auto-mount
/data
dbebfc5cb47 imx9: fix checkpatch errors in USB drivers
```
## Diff summary
```text
24 files changed, 9158 insertions(+), 14 deletions(-)
```
The main additions are:
- `arch/arm64/src/imx9/imx9_dwc3dev.c`: DWC3 USB device controller;
- `arch/arm64/src/imx9/hardware/imx9_dwc3.h`: DWC3 register definitions;
- `arch/arm64/src/imx9/imx9_ehci.c`: i.MX95 EHCI host controller;
- `boards/arm64/imx9/imx95-a55-evk/src/imx9_usbhost.c`: board USB-host setup;
- `boards/arm64/imx9/imx95-a55-evk/configs/usbdev/defconfig`;
- `boards/arm64/imx9/imx95-a55-evk/configs/usbhost/defconfig`;
- `boards/arm64/imx9/imx95-a55-evk/src/etc/init.d/{rcS,rc.sysinit}`.
## Change details
### 1. Correct the SCMI pinctrl daisy-register value
`imx9_iomux_configure()` previously copied the daisy value into
`scmi_pinctrl_t.input_register`. The System Manager derives the SCMI daisy ID
from the register address, so the field must contain `dsyreg`, not `dsy`.
The change aligns the request with the interpretation in
`imx9_sm_iomucx_configure()` and avoids invalid daisy IDs on stricter
firmware.
### 2. Unify i.MX95 LPUART pinmux setup
SCMI is initialized from `arm64_chip_boot()` before `imx9_lowsetup()`. This
makes SCMI pinctrl available when the common low-level LPUART setup runs and
allows removal of the i.MX95-specific pinmux skip.
The series also adds the missing i.MX95 LPUART1 pad definitions required by
the common path.
### 3. Enable LPUART5 on `imx95-a55-evk`
The board receives LPUART5 RX/TX descriptors for the FRDM-i.MX95 J19 header:
- J19 pin 27 / `GPIO_IO00`: LPUART5 TX, alternate mode 5;
- J19 pin 28 / `GPIO_IO01`: LPUART5 RX, alternate mode 5.
The `nsh_smp` config enables MU, SCMI clock/pinctrl transport, and LPUART5 at
115200 baud with 256-byte RX and TX buffers.
### 4. Add the DWC3 USB device controller
The new i.MX9 DWC3 driver provides:
- EP0 control-transfer handling;
- bulk and interrupt endpoints;
- TRB-based DMA transfers;
- event-buffer interrupt processing;
- USB 2.0 High-Speed and USB 3.0 SuperSpeed operation;
- Make and CMake integration.
The new `usbdev` board config enables the driver together with USB ADB shell
and file services.
### 5. Add the i.MX95 EHCI USB host controller
The EHCI implementation supports the i.MX95 ChipIdea USB2 controller in host
mode, including asynchronous and periodic scheduling and arm64 DMA-address
handling.
Board initialization configures the host port and starts the USB host
monitor.
The new `usbhost` config enables hub, mass-storage, CDC-ACM, keyboard, and
mouse
class support.
### 6. Mount `/data` from the NSH startup script
`CONFIG_ETC_ROMFS` is enabled for `nsh_smp`, and the board CMake file
packages
`rcS` and `rc.sysinit` into `/etc`.
When MMC/SD support is enabled, `rcS` runs:
```text
mount -t fatfs /dev/mmcsd0p2 /data
```
This removes the need to mount the user-data partition manually after each
boot.
## Verification
The following commands should be used for build and static verification:
```text
$ tools/configure.sh -a ../apps imx95-a55-evk:nsh_smp
$ make -j$(nproc)
$ tools/configure.sh -a ../apps imx95-a55-evk:usbdev
$ make -j$(nproc)
$ tools/configure.sh -a ../apps imx95-a55-evk:usbhost
$ make -j$(nproc)
$ git diff --check HEAD~8..HEAD
$ tools/checkpatch.sh -g HEAD~8..HEAD
✔️ All checks pass.
```
## Simulated runtime logs
> **Important:** The logs below are simulated examples of the expected output
> and interaction. They are included to document the intended validation
flow;
> they are not captured from hardware and must not be reported as real test
> results.
### Simulated `nsh_smp`, SCMI, LPUART5, and `/data` log
```text
NuttShell (NSH) NuttX
nsh> ls /dev
/dev:
console
mmcsd0
mmcsd0p1
mmcsd0p2
null
ttyS0
ttyS4
zero
nsh> mount
/proc type procfs
/etc type romfs
/data type vfat
nsh> echo imx95-data-test > /data/pr-test.txt
nsh> cat /data/pr-test.txt
imx95-data-test
nsh> echo lpuart5-test > /dev/ttyS4
nsh>
```
Expected result: `/etc/rcS` mounts `/dev/mmcsd0p2` on `/data`, and LPUART5 is
registered as the additional serial device.
### Simulated DWC3 USB device / ADB log
Target console:
```text
NuttShell (NSH) NuttX
nsh> adbd &
adbd [7:100]
nsh>
```
Host interaction:
```text
$ adb devices
List of devices attached
imx95-a55-evk device
$ adb shell uname -a
NuttX imx95-a55-evk 12.x.x arm64
$ adb push usb-test.txt /tmp/usb-test.txt
usb-test.txt: 1 file pushed
$ adb shell cat /tmp/usb-test.txt
DWC3 USB device test
```
Expected result: the host enumerates the DWC3 gadget, opens an ADB shell, and
transfers a file successfully.
### Simulated EHCI USB host mass-storage log
```text
NuttShell (NSH) NuttX
nsh> ls /dev
/dev:
console
null
sda
ttyS0
zero
nsh> mount -t vfat /dev/sda /mnt
nsh> ls -l /mnt
/mnt:
-rw-r--r-- 18 USBHOST.TXT
nsh> cat /mnt/USBHOST.TXT
i.MX95 EHCI works
nsh> umount /mnt
nsh>
```
Expected result: a USB mass-storage device is enumerated as `/dev/sda`, can
be
mounted, read, and unmounted without errors.
## Test status
- Commit-message cleanup: the series contains neither private issue tags nor
Gerrit `Change-Id` trailers.
- Runtime status: **not tested on physical i.MX95 hardware in this
document**.
- The simulated logs must be replaced with captured console and host logs
after
board testing.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]