Skip to content

arch/arm64/imx9: add support for imx95 #16743

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 1 commit into
base: master
Choose a base branch
from

Conversation

lipengfei28
Copy link
Contributor

Note: Please adhere to Contributing Guidelines.

Summary

imx95 board run linux and nuttx at the same time

  1. nuttx use lpuart1 as console, linux use usb otg as adb debug console
  2. this method need linux driver boot nuttx
  3. the kernel patch
  4. the adb setup
    1. download and build:
      https://gitee.com/qaq-cmd/adbd/tree/master
    2. put the adbd_debug to /root
    3. set up usb otg: put ths adbd.sh to /root, chmod +x adbd.sh
    4. ln -s /bin/bash /system/bin/sh
    5. auto start adbd:
      cp adbd.service /etc/systemd/system
      systemctl start adbd
      systemctl enable adbd
  5. kernel patch and nuttx.ko
    1. put the nuttx directory to /home/lipengfei28/android/imx_9/sources/meta-imx/meta-imx-bsp/recipes-kernel
    2. patch to kernel
    3. bitbake -C compile linux-imx && bitbake nuttx
    4. adb shell; mkdir /root/boot; mount /dev/mmcblk0p1 boot
    5. adb push *dtb /root/boot
    6. adb push Image /root/boot
    7. reboot
  6. build nuttx for imx95
    ./tools/configure.sh imx95-a55-evk:nsh && make
    adb push nuttx.bin /root
  7. boot nuttx:
    echo 0 > /sys/devices/system/cpu/cpu0/online
    insmod nuttx.ko
  8. Enter nshell
    [ 1.975564] platform 4acf0000.dsi: Fixed dependency cycle(s) with /soc/bus@44000000/i2c@44350000/hdmi@3d
    [ 1.984898] platform hdmi-connector: Fixed dependency cycle(s) with /soc/bus@44000000/i2c@44350000/hdmi@3d
    [ 1.994507] i2c 1-003d: Fixed dependency cycle(s) with /soc/dsi@4acf0000
    [ 2.001114] i2c 1-003d: Fixed dependency cycle(s) with /hdmi-connector
    [ 2.008196] adp5585 1-0034: error -EIO: Failed to read device ID
    [ 2.014043] adp5585 1-0034: probe with driver adp5585 failed with error -5
    [ 2.020874] i2c i2c-1: LPI2C adapter registered
    [ 2.026425] imx8mq-usb-phy 4c1f0040.phy: supply vbus not found, using dummy regulator
    [ 2.038785] platform 4ad50000.isi: Fixed dependency cycle(s) with /soc/syscon@4ac10000/formatter@20
    [ 2.047684] platform 4ad30000.csi: Fixed dependency cycle(s) with /soc/syscon@4ac10000/formatter@20
    [ 2.056765] platform 4ac10000.syscon:formatter@20: Fixed dependency cycle(s) with /soc/isi@4ad50000
    [ 2.065674] platform 4ac10000.syscon:formatter@20: Fixed dependency cycle(s) with /soc/csi@4ad30000
    [ 2.077393] platform 4acf0000.dsi: Fixed dependency cycle(s) with /soc/syscon@4b010000/bridge@8
    [ 2.085936] platform 4b010000.syscon:bridge@8: Fixed dependency cycle(s) with /soc/dsi@4acf0000
    [ 2.094563] platform 4b010000.syscon:bridge@8: Fixed dependency cycle(s) with /soc/bridge@4b0d0000/channel@0
    [ 2.110173] 42590000.serial: ttyLP0 at MMIO 0x42590010 (irq = 110, base_baud = 1500000) is a FSL_LPUART
    [ 2.119462] printk: legacy console [ttyLP0] enabled
    [ 2.129043] printk: legacy bootconsole [lpuart32] disabled
  • Ready to Boot Primary CPU
  • Boot from EL2
  • Boot from EL1
  • Boot to C runtime for OS Initialize

NuttShell (NSH) NuttX-12.9.0
nsh>
nsh>
nsh>
nsh> ls
/:
dev/
proc/
nsh>

Update this section with information on why change is necessary,
what it exactly does and how, if new feature shows up, provide
references (dependencies, similar problems and solutions), etc.

Impact

Update this section, where applicable, on how change affects users,
build process, hardware, documentation, security, compatibility, etc.

Testing

Update this section with details on how did you verify the change,
what Host was used for build (OS, CPU, compiler, ..), what Target was
used for verification (arch, board:config, ..), etc. Providing build
and runtime logs from before and after change is highly appreciated.

@github-actions github-actions bot added Arch: arm64 Issues related to ARM64 (64-bit) architecture Board: arm64 Size: XL The size of the change in this PR is very large. Consider breaking down the PR into smaller pieces. labels Jul 18, 2025
@xiaoxiang781216 xiaoxiang781216 marked this pull request as draft July 18, 2025 09:56
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
@@ -0,0 +1,263 @@
/****************************************************************************
* boards/arm64/imx9/imx93-evk/include/board.h
Copy link
Contributor

Choose a reason for hiding this comment

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

change imx93-evk -> imx95-a55-evk

Copy link
Contributor

@jerpelea jerpelea left a comment

Choose a reason for hiding this comment

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

please split the commit into
arch/arm64/imx9: add imx95 support
boards/arm64/imx9: add imx95 support
documentation/arm64/imx9: add imx95 support

and add commit messages for all commits

@jerpelea jerpelea changed the title add imx95 board arch/arm64/imx9: add support for imx95 Jul 18, 2025

ifeq ($(CONFIG_ARCH_CHIP_IMX93),y)
CHIP_CSRCS += imx9_lpuart.c imx9_lowputc.c
ifeq ($(CONFIG_IMX95_BOOTL_FROM_LINUX),n)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we avoid using this CONFIG_IMX95_BOOTL_FROM_LINUX macro.
It makes the code unreadable and it's quite a niche try to foucs on
CONFIG_ARCH_CHIP_IMX93
CONFIG_ARCH_CHIP_IMX95

And then in some cases use the CONFIG_IMX95_BOOTL_FROM_LINUX

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arch: arm64 Issues related to ARM64 (64-bit) architecture Board: arm64 Size: XL The size of the change in this PR is very large. Consider breaking down the PR into smaller pieces.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants