imx95-a55: add GPIO and eMMC (USDHC) support with partition table parsing, verify use i.mx95-FRDM EVK#18501
Draft
jasonbu wants to merge 7 commits intoapache:masterfrom
Draft
imx95-a55: add GPIO and eMMC (USDHC) support with partition table parsing, verify use i.mx95-FRDM EVK#18501jasonbu wants to merge 7 commits intoapache:masterfrom
jasonbu wants to merge 7 commits intoapache:masterfrom
Conversation
arm64_modifyreg8.c, arm64_modifyreg16.c, arm64_modifyreg32.c were present in Make.defs but missing from CMakeLists.txt, causing link errors when building with cmake. Signed-off-by: buxiasen <buxiasen@xiaomi.com>
…upport The MMC CMD6 bus width switch was gated on priv->buswidth which is derived from the SD SCR register. For MMC cards this field is never set (unless SDIO_CAPS_4BIT_ONLY), so the CMD6 was skipped while the host PROCTL DTW was still changed - causing a bus width mismatch and data transfer timeouts. Fix by checking priv->caps instead of priv->buswidth for MMC cards. Also select EXT_CSD_BUS_WIDTH_8 when host reports SDIO_CAPS_8BIT. Signed-off-by: buxiasen <buxiasen@xiaomi.com>
Rename IMX9_IRQ_uSDHC{1,2,3} to IMX9_IRQ_USDHC{1,2,3} in both arm
and arm64 imx95_irq.h to follow the all-caps naming convention used
by imx93_irq.h and the rest of the NuttX codebase. Remove the now
unnecessary USDHC IRQ alias block from arm64 imx95_irq.h.
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
Add imx95 GPIO register definitions (same IP block as imx93), fill g_gpio_base[] array for imx95, include imx95_gpio.h from the common header, and compile imx9_gpio.c/imx9_gpiobase.c for imx95 in cmake. Signed-off-by: buxiasen <buxiasen@xiaomi.com>
Port USDHC1 (eMMC) driver to the i.MX95 FRDM EVK board: - Create imx95_pinmux.h with SD1/USDHC1 pin definitions - Add USDHC1 pin macros to board.h - Create board-level imx9_usdhc.c glue code - Update imx9_bringup.c with DMA allocator and USDHC init - Add SCMI clock guards in imx9_usdhc.c (imx95 clock roots are owned by System Manager, direct CCM writes are no-ops) - Fix CCM_CR_USDHC2 copy-paste bug to CCM_CR_USDHC1 Signed-off-by: buxiasen <buxiasen@xiaomi.com>
imx9_dmapreflight() rejected unaligned buffers unconditionally, but dmarecvsetup() has a bounce path via priv->rxbuffer for small transfers. Add a buflen > sizeof(priv->rxbuffer) check so that small reads (e.g. ext_csd 512-byte stack buffer) can use the bounce buffer instead of failing with -EFAULT. Signed-off-by: buxiasen <buxiasen@xiaomi.com>
Parse the partition table on /dev/mmcsd0 during board bringup and register each partition as /dev/mmcsd0pN. MBR partitions have no name field so a custom handler is needed instead of the default register_partition which skips unnamed entries. Verify by i.mx95 FRDM 'mount -t vfat /dev/mmcsd0p0 /data' Signed-off-by: buxiasen <buxiasen@xiaomi.com>
Contributor
|
Hi @fdcavalcanti @tmedicci @eren-terzioglu We are receiving this error on all PRs. Can you check it? Boards https://github.com/apache/nuttx/actions/runs/22758561387/job/66009383296#logs |
Contributor
There's a fix coming very soon. |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add GPIO and eMMC (USDHC) support for the i.MX95 A55 EVK board, enabling 8-bit eMMC access with MBR/GPT partition table parsing.
Changes
1.
imx9: add GPIO support for imx95g_gpio_base[]array for imx95imx95_gpio.hfrom the common headerimx9_gpio.c/imx9_gpiobase.cfor imx95 in cmake2.
imx95-a55-evk: add USDHC eMMC driver supportimx95_pinmux.h/imx95_ccm.h/imx95_pll.hhardware definitions for imx95board.himx9_usdhc.cglue codeimx9_bringup.cwith DMA allocator and USDHC initCONFIG_IMX9_CLK_OVER_SCMIcompile-time guards inimx9_usdhc.cto isolate the IMX95 SCMI clock path from the existing IMX93 direct-CCM path — no functional change for IMX933.
imx9: usdhc fix dmapreflight rejecting small unaligned buffersimx9_dmapreflight()rejected unaligned buffers unconditionally, butdmarecvsetup()has a bounce path viapriv->rxbufferfor small transfersbuflen > sizeof(priv->rxbuffer)check so that small reads (e.g. ext_csd 512-byte stack buffer) can use the bounce buffer instead of failing with-EFAULT4.
imx95-a55-evk: add MBR/GPT partition table parsing on eMMC/dev/mmcsd0during board bringup and register each partition as/dev/mmcsd0pNImpact
#ifndef CONFIG_IMX9_CLK_OVER_SCMIguards — zero functional change for existing IMX93 boardsdmapreflightfix is a generic improvement that benefits all imx9 USDHC usersTesting
Verified on i.MX95 FRDM EVK:
mount -t vfat /dev/mmcsd0p0 /dataworksneed enable feature by menuconfig.
defconfig diff did not bring in these patch chain
ostest passed in i.MX95 FRDM EVK
[2026-03-06 17:57:11] user_main: Exiting [2026-03-06 17:57:11] ostest_main: Exiting with status 0 [2026-03-06 17:57:11] nsh>