Skip to content

Introduce i.MX93 (M33) and IMX93-QSB board support#18460

Open
mzanders wants to merge 10 commits intoapache:masterfrom
mzanders:introduce_imx93-m33
Open

Introduce i.MX93 (M33) and IMX93-QSB board support#18460
mzanders wants to merge 10 commits intoapache:masterfrom
mzanders:introduce_imx93-m33

Conversation

@mzanders
Copy link
Contributor

@mzanders mzanders commented Feb 26, 2026

Summary

This PR adds support for the i.MX93 M33 processor, using IMX93-QSB as a test platform.

A lot of reuse was achieved from support for imx93 A55 core (in arm64) and imx95 M7 core (in arm).

Impact

As this is a big PR, the commits are organized in a way to ease the review process.

The first 6 commits reorganize the parts common with iMX95 and prepares these files for addition of iMX93 code. They touch:

  • clockconfig
  • iomuxc
  • irq
  • rptun/rsctable
  • mu driver
  • Kconfig

On their own, these commits are small and easy to review/analyze. I took special care to reduce the impact on the build of iMX95 as I don't have hardware to test that on. See test results below for proof.

The actual introduction of iMX93 is in done in two commits:

  • arch: additions managed through compile switches, not touching imx95 anymore
  • board support: completely isolated in its own board directory

The two final commits handle the codeowners file and add a documentation page.

Use of AI/LLM

As this is my first experience with NuttX, I used Claude Sonnet to help me understand how everything works extensively and get me on the way.

Items that started with a proposal from the LLM but were manually reviewed and modified later:

  • xcache driver
  • ccm clock configuration
  • documentation

Next to running all commits through checkpatch.sh, I fed them into Claude Sonnet as well which gave me valuable feedback on typo's, alignments etc.

At no point in the development was any AI allowed to directly edit my code.

Testing

Test case 1: no impact on imx95-evk builds - analysis

$ make distclean
$ git checkout master
$ tools/configure.sh imx95-evk:nsh
$ echo CONFIG_ASSERTIONS_FILENAME=n >> .config    # avoid noise due to line number changes
$ make

Memory region         Used Size  Region Size  %age Used
    m_interrupts:         936 B         2 KB     45.70%
           flash:      214512 B       254 KB     82.47%
            sram:       11776 B       256 KB      4.49%
           ocram:           0 B       352 KB      0.00%

$ arm-none-eabi-objdump -d nuttx > before.asm
$ make distclean
$ git checkout introduce_imx93-m33
$ tools/configure.sh imx95-evk:nsh
$ echo CONFIG_ASSERTIONS_FILENAME=n >> .config    # avoid noise due to line number changes
$ make

Memory region         Used Size  Region Size  %age Used
    m_interrupts:         936 B         2 KB     45.70%
           flash:      214512 B       254 KB     82.47%
            sram:       11776 B       256 KB      4.49%
           ocram:           0 B       352 KB      0.00%

$ arm-none-eabi-objdump -d nuttx > after.asm
$ diff before.asm after.asm

Diff results:

Function renames imx95>imx9:

756c756
<      e6c:	f000 fb94 	bl	1598 <imx95_mu_trigger_interrupts>
---
>      e6c:	f000 fb94 	bl	1598 <imx9_mu_trigger_interrupts>
1405c1405
<     1416:	f000 f87b 	bl	1510 <imx95_mu_init>
---
>     1416:	f000 f87b 	bl	1510 <imx9_mu_init>
1455c1455
<     1482:	f000 f86b 	bl	155c <imx95_mu_receive_msg_non_blocking>
---
>     1482:	f000 f86b 	bl	155c <imx9_mu_receive_msg_non_blocking>
1523c1523
< 00001510 <imx95_mu_init>:
---
> 00001510 <imx9_mu_init>:
1530,1531c1530,1531
<     151c:	d115      	bne.n	154a <imx95_mu_init+0x3a>
<     151e:	4b0d      	ldr	r3, [pc, #52]	@ (1554 <imx95_mu_init+0x44>)
---
>     151c:	d115      	bne.n	154a <imx9_mu_init+0x3a>
>     151e:	4b0d      	ldr	r3, [pc, #52]	@ (1554 <imx9_mu_init+0x44>)
1536c1536
<     1528:	490b      	ldr	r1, [pc, #44]	@ (1558 <imx95_mu_init+0x48>)
---
>     1528:	490b      	ldr	r1, [pc, #44]	@ (1558 <imx9_mu_init+0x48>)
1550c1550
<     1548:	e000      	b.n	154c <imx95_mu_init+0x3c>
---
>     1548:	e000      	b.n	154c <imx9_mu_init+0x3c>
1559c1559
< 0000155c <imx95_mu_receive_msg_non_blocking>:
---
> 0000155c <imx9_mu_receive_msg_non_blocking>:
1572c1572
<     1574:	d004      	beq.n	1580 <imx95_mu_receive_msg_non_blocking+0x24>
---
>     1574:	d004      	beq.n	1580 <imx9_mu_receive_msg_non_blocking+0x24>
1589c1589
< 00001598 <imx95_mu_trigger_interrupts>:
---
> 00001598 <imx9_mu_trigger_interrupts>:
1606c1606
<     15bc:	d10a      	bne.n	15d4 <imx95_mu_trigger_interrupts+0x3c>
---
>     15bc:	d10a      	bne.n	15d4 <imx9_mu_trigger_interrupts+0x3c>

Changed interrupt range test from <219 to <224 in imx9_irqinfo()

4091c4091
<     2bc6:	2bda      	cmp	r3, #218	@ 0xda
---
>     2bc6:	2bdf      	cmp	r3, #223	@ 0xdf

Test case 2: interrupt debug output verification

$ make distclean
$ tools/configure.sh imx93-qsb:nsh
$ echo CONFIG_DEBUG_IRQ=y >> .config
$ echo CONFIG_DEBUG_IRQ_ERROR=y >> .config
$ echo CONFIG_DEBUG_IRQ_WARN=y >> .config
$ echo CONFIG_DEBUG_IRQ_INFO=y >> .config
$ make

Deploy & run on target (see documentation for procedure).

NuttShell (NSH) NuttX-12.12.0
nsh> dmesg
imx9_dumpnvic: NVIC (initial, irq=284):
imx9_dumpnvic:   INTCTRL:    00400000 VECTAB:  0ffe0000
imx9_dumpnvic:   IRQ ENABLE: 00000000 00000000 00000000 00000000
imx9_dumpnvic:               00000000 00000000 00000000 00000000
imx9_dumpnvic:               00000000
imx9_dumpnvic:   SYSH_PRIO:  80808080 40000000 80800080
imx9_dumpnvic:   IRQ PRIO:   80808080 80808080 80808080 80808080
imx9_dumpnvic:               80808080 80808080 80808080 80808080
imx9_dumpnvic:               80808080 80808080 80808080 80808080
imx9_dumpnvic:               80808080 80808080 80808080 80808080
imx9_dumpnvic:               80808080 80808080 80808080 80808080
imx9_dumpnvic:               80808080 80808080 80808080 80808080
imx9_dumpnvic:               80808080 80808080 80808080 80808080
imx9_dumpnvic:               80808080 80808080 80808080 80808080
imx9_dumpnvic:               80808080 80808080 80808080 80808080
imx9_dumpnvic:               80808080 80808080 80808080 80808080
imx9_dumpnvic:               80808080 80808080 80808080 80808080
imx9_dumpnvic:               80808080 80808080 80808080 80808080
imx9_dumpnvic:               80808080 80808080 80808080 80808080
imx9_dumpnvic:               80808080 80808080 80808080 80808080
imx9_dumpnvic:               00000000 00000000 00000000 00000000
imx9_dumpnvic:               00000000 00000000 00000000 00000000
imx9_dumpnvic:               00000000 00000000 00000000
nsh> 

Test case 3: basic RPMSG functionality

$ make distclean
$ tools/configure.sh imx93-qsb:rpmsg
$ make

Deploy & run on target (see documentation for procedure).

On Linux side, after launching, run dmesg:

$ dmesg -c
[ 2192.340185] remoteproc remoteproc0: powering up imx-rproc
[ 2192.348364] remoteproc remoteproc0: Booting fw image rproc-imx-rproc-fw, size 2624556
[ 2192.863457] rproc-virtio rproc-virtio.1.auto: assigned reserved memory node vdevbuffer@a4020000
[ 2192.872797] virtio_rpmsg_bus virtio0: rpmsg host is online
[ 2192.878818] rproc-virtio rproc-virtio.1.auto: registered virtio0 (type 7)
[ 2192.885766] remoteproc remoteproc0: remote processor imx-rproc is now up
[ 2193.089101] virtio_rpmsg_bus virtio0: creating channel rpmsg-tty addr 0x400
$ minicom -D /dev/ttyRPMSG0

Welcome to minicom 2.9

OPTIONS: I18n 
Compiled on Sep 22 2023, 21:10:41.
Port /dev/ttyRPMSG0, 13:11:25

Press CTRL-A Z for help on special keys


NuttShell (NSH) NuttX-12.12.0
nsh> 
nsh> 

Test case 4: documentation output

Locally generated HTML file looks fine.

documentation_output

Test case 5: run OSTEST

$ make distclean
$ tools/configure.sh imx93-qsb:nsh-ddr
$ # enable OSTEST, configuration doesn't fit in ITCM
$ echo CONFIG_SCHED_WAITPID=y >> .config
$ echo CONFIG_TESTING_OSTEST=y >> .config
$ echo CONFIG_TESTING_OSTEST_LOOPS=1 >> .config
$ echo CONFIG_TESTING_OSTEST_STACKSIZE=8192 >> .config
$ echo CONFIG_TESTING_OSTEST_NBARRIER_THREADS=8 >> .config
$ echo CONFIG_TESTING_OSTEST_RR_RANGE=30000 >> .config
$ echo CONFIG_TESTING_OSTEST_RR_RUNS=10 >> .config
$ echo CONFIG_TESTING_OSTEST_SPINLOCK_THREADS=2 >> .config
$ echo CONFIG_TEST_LOOP_SCALE=100 >> .config
$ make

Deploy & run on target (see documentation for procedure).

NuttShell (NSH) NuttX-12.12.0
nsh> ostest
stdio_test: write fd=1
stdio_test: Standard I/O Check: printf
stdio_test: write fd=2
stdio_test: Standard I/O Check: fprintf to stderr
ostest_main: Started user_main at PID=3
ostest_main: Exiting with status 0
nsh> 
user_main: Begin argument test
user_main: Started with argc=5
user_main: argv[0]="ostest"
user_main: argv[1]="Arg1"
user_main: argv[2]="Arg2"
user_main: argv[3]="Arg3"
user_main: argv[4]="Arg4"

End of test memory usage:
VARIABLE  BEFORE   AFTER
======== ======== ========
arena      fd7200   fd7200
ordblks         2        2
mxordblk   fd30a0   fd30a0
uordblks     3608     3608
fordblks   fd3bf8   fd3bf8

user_main: getopt() test
getopt():  Simple test
getopt():  Invalid argument
getopt():  Missing optional argument
getopt_long():  Simple test
getopt_long():  No short options
getopt_long():  Argument for --option=argument
getopt_long():  Invalid long option
getopt_long():  Mixed long and short options
getopt_long():  Invalid short option
getopt_long():  Missing optional arguments
getopt_long_only():  Mixed long and short options
getopt_long_only():  Single hyphen long options

End of test memory usage:
VARIABLE  BEFORE   AFTER
======== ======== ========
arena      fd7200   fd7200
ordblks         2        2
mxordblk   fd30a0   fd30a0
uordblks     3608     3608
fordblks   fd3bf8   fd3bf8

user_main: libc tests

End of test memory usage:
VARIABLE  BEFORE   AFTER
======== ======== ========
arena      fd7200   fd7200
ordblks         2        2
mxordblk   fd30a0   fd30a0
uordblks     3608     3608
fordblks   fd3bf8   fd3bf8

user_main: setvbuf test
setvbuf_test: Test NO buffering
setvbuf_test: Using NO buffering
setvbuf_test: Test default FULL buffering
setvbuf_test: Using default FULL buffering
setvbuf_test: Test FULL buffering, buffer size 64
setvbuf_test: Using FULL buffering, buffer size 64
setvbuf_test: Test FULL buffering, pre-allocated buffer
setvbuf_test: Using FULL buffering, pre-allocated buffer
setvbuf_test: Test LINE buffering, buffer size 64
setvbuf_test: Using LINE buffering, buffer size 64
setvbuf_test: Test FULL buffering, pre-allocated buffer
setvbuf_test: Using FULL buffering, pre-allocated buffer

End of test memory usage:
VARIABLE  BEFORE   AFTER
======== ======== ========
arena      fd7200   fd7200
ordblks         2        2
mxordblk   fd30a0   fd30a0
uordblks     3608     3608
fordblks   fd3bf8   fd3bf8

user_main: /dev/null test
dev_null: Read 0 bytes from /dev/null
dev_null: Wrote 1024 bytes to /dev/null

End of test memory usage:
VARIABLE  BEFORE   AFTER
======== ======== ========
arena      fd7200   fd7200
ordblks         2        2
mxordblk   fd30a0   fd30a0
uordblks     3608     3608
fordblks   fd3bf8   fd3bf8

user_main: FPU test
Starting task FPU#1
fpu_test: Started task FPU#1 at PID=4
FPU#1: pass 1
Starting task FPU#2
fpu_test: Started task FPU#2 at PID=5
FPU#2: pass 1
FPU#1: pass 2
FPU#2: pass 2
FPU#1: pass 3
FPU#2: pass 3
FPU#1: pass 4
FPU#2: pass 4
FPU#1: pass 5
FPU#2: pass 5
FPU#1: pass 6
FPU#2: pass 6
FPU#1: pass 7
FPU#2: pass 7
FPU#1: pass 8
FPU#2: pass 8
FPU#1: pass 9
FPU#2: pass 9
FPU#1: pass 10
FPU#2: pass 10
FPU#1: pass 11
FPU#2: pass 11
FPU#1: pass 12
FPU#2: pass 12
FPU#1: pass 13
FPU#2: pass 13
FPU#1: pass 14
FPU#2: pass 14
FPU#1: pass 15
FPU#2: pass 15
FPU#1: pass 16
FPU#2: pass 16
FPU#1: Succeeded
FPU#2: Succeeded
fpu_test: Returning

End of test memory usage:
VARIABLE  BEFORE   AFTER
======== ======== ========
arena      fd7200   fd7200
ordblks         2        2
mxordblk   fd30a0   fd30a0
uordblks     3608     3608
fordblks   fd3bf8   fd3bf8

user_main: task_restart test

Test task_restart()
restart_main: Started restart_main at PID=6
restart_main: Started with argc=4
restart_main: argv[0]="ostest"
restart_main: argv[1]="This is argument 1"
restart_main: argv[2]="Argument 2 here"
restart_main: argv[3]="Lastly, the 3rd argument"
restart_main: I am still here
restart_main: I am still here
restart_main: Started restart_main at PID=6
restart_main: Started with argc=4
restart_main: argv[0]="ostest"
restart_main: argv[1]="This is argument 1"
restart_main: argv[2]="Argument 2 here"
restart_main: argv[3]="Lastly, the 3rd argument"
restart_main: Started with argc=4
restart_main: argv[0]="ostest"
restart_main: argv[1]="This is argument 1"
restart_main: argv[2]="Argument 2 here"
restart_main: argv[3]="Lastly, the 3rd argument"
restart_main: Exiting

End of test memory usage:
VARIABLE  BEFORE   AFTER
======== ======== ========
arena      fd7200   fd7200
ordblks         2        2
mxordblk   fd30a0   fd30a0
uordblks     3608     3608
fordblks   fd3bf8   fd3bf8

user_main: waitpid test

Test waitpid()
waitpid_start_child: Started waitpid_main at PID=7
waitpid_main: PID 7 Started
waitpid_start_child: Started waitpid_main at PID=8
waitpid_main: PID 8 Started
waitpid_start_child: Started waitpid_main at PID=9
waitpid_main: PID 9 Started
waitpid_test: Waiting for PID=7 with waitpid()
waitpid_main: PID 7 exitting with result=14
waitpid_test: PID 7 waitpid succeeded with stat_loc=0e00
waitpid_last: Waiting for PID=9 with waitpid()
waitpid_main: PID 8 exitting with result=14
waitpid_main: PID 9 exitting with result=14
waitpid_last: PASS: PID 9 waitpid succeeded with stat_loc=0e00

End of test memory usage:
VARIABLE  BEFORE   AFTER
======== ======== ========
arena      fd7200   fd7200
ordblks         2        2
mxordblk   fd30a0   fd30a0
uordblks     3608     3608
fordblks   fd3bf8   fd3bf8

user_main: mutex test
Initializing mutex
Starting thread 1
Starting thread 2
                Thread1 Thread2
        Loops   32      32
        Errors  0       0

Testing moved mutex
Starting moved mutex thread 1
Starting moved mutex thread 2
                Thread1 Thread2
        Moved Loops     32      32
        Moved Errors    0       0

End of test memory usage:
VARIABLE  BEFORE   AFTER
======== ======== ========
arena      fd7200   fd7200
ordblks         2        2
mxordblk   fd30a0   fd30a0
uordblks     3608     3608
fordblks   fd3bf8   fd3bf8

user_main: timed mutex test
mutex_test: Initializing mutex
mutex_test: Starting thread
pthread:  Started
pthread:  Waiting for lock or timeout
mutex_test: Unlocking
pthread:  Got the lock
pthread:  Waiting for lock or timeout
pthread:  Got the timeout.  Terminating
mutex_test: PASSED

End of test memory usage:
VARIABLE  BEFORE   AFTER
======== ======== ========
arena      fd7200   fd7200
ordblks         2        2
mxordblk   fd30a0   fd30a0
uordblks     3608     3608
fordblks   fd3bf8   fd3bf8

user_main: cancel test
cancel_test: Test 1a: Normal Cancellation
cancel_test: Starting thread
start_thread: Initializing mutex
start_thread: Initializing cond
start_thread: Starting thread
start_thread: Yielding
sem_waiter: Taking mutex
sem_waiter: Starting wait for condition
cancel_test: Canceling thread
cancel_test: Joining
cancel_test: waiter exited with result=0xffffffff
cancel_test: PASS thread terminated with PTHREAD_CANCELED
cancel_test: Test 2: Asynchronous Cancellation
... Skipped
cancel_test: Test 3: Cancellation of detached thread
cancel_test: Re-starting thread
restart_thread: Destroying cond
restart_thread: Destroying mutex
restart_thread: Re-starting thread
start_thread: Initializing mutex
start_thread: Initializing cond
start_thread: Starting thread
start_thread: Yielding
sem_waiter: Taking mutex
sem_waiter: Starting wait for condition
cancel_test: Canceling thread
cancel_test: Joining
cancel_test: PASS pthread_join failed with status=ESRCH
cancel_test: Test 5: Non-cancelable threads
cancel_test: Re-starting thread (non-cancelable)
restart_thread: Destroying cond
restart_thread: Destroying mutex
restart_thread: Re-starting thread
start_thread: Initializing mutex
start_thread: Initializing cond
start_thread: Starting thread
start_thread: Yielding
sem_waiter: Taking mutex
sem_waiter: Starting wait for condition
sem_waiter: Setting non-cancelable
cancel_test: Canceling thread
cancel_test: Joining
sem_waiter: Releasing mutex
sem_waiter: Setting cancelable
cancel_test: waiter exited with result=0xffffffff
cancel_test: PASS thread terminated with PTHREAD_CANCELED
cancel_test: Test 6: Cancel message queue wait
cancel_test: Starting thread (cancelable)
Skipped
cancel_test: Test 7: Cancel signal wait
cancel_test: Starting thread (cancelable)
Skipped

End of test memory usage:
VARIABLE  BEFORE   AFTER
======== ======== ========
arena      fd7200   fd7200
ordblks         2        2
mxordblk   fd30a0   fd30a0
uordblks     3608     3608
fordblks   fd3bf8   fd3bf8

user_main: robust test
robust_test: Initializing mutex
robust_test: Starting thread
robust_waiter: Taking mutex
robust_waiter: Exiting with mutex
robust_test: Take the lock again
robust_test: Make the mutex consistent again.
robust_test: Take the lock again
robust_test: Joining
robust_test: waiter exited with result=0
robust_test: Test complete with nerrors=0

End of test memory usage:
VARIABLE  BEFORE   AFTER
======== ======== ========
arena      fd7200   fd7200
ordblks         2        2
mxordblk   fd30a0   fd30a0
uordblks     3608     3608
fordblks   fd3bf8   fd3bf8

user_main: semaphore test
sem_test: Initializing semaphore to 0
sem_test: Starting waiter thread 1
sem_test: Set thread 1 priority to 191
waiter_func: Thread 1 Started
sem_test: Starting waiter thread 2
waiter_func: Thread 1 initial semaphore value = 0
sem_test: Set thread 2 priority to 128
waiter_func: Thread 1 waiting on semaphore
waiter_func: Thread 2 Started
waiter_func: Thread 2 initial semaphore value = -1
waiter_func: Thread 2 waiting on semaphore
sem_test: Starting poster thread 3
sem_test: Set thread 3 priority to 64
poster_func: Thread 3 started
poster_func: Thread 3 semaphore value = -2
poster_func: Thread 3 posting semaphore
waiter_func: Thread 1 awakened
poster_func: Thread 3 new semaphore value = -1
waiter_func: Thread 1 new semaphore value = -1
poster_func: Thread 3 semaphore value = -1
waiter_func: Thread 1 done
poster_func: Thread 3 posting semaphore
waiter_func: Thread 2 awakened
poster_func: Thread 3 new semaphore value = 0
waiter_func: Thread 2 new semaphore value = 0
poster_func: Thread 3 done
waiter_func: Thread 2 done

End of test memory usage:
VARIABLE  BEFORE   AFTER
======== ======== ========
arena      fd7200   fd7200
ordblks         2        2
mxordblk   fd30a0   fd30a0
uordblks     3608     3608
fordblks   fd3bf8   fd3bf8

user_main: timed semaphore test
semtimed_test: Initializing semaphore to 0
semtimed_test: Waiting for two second timeout
semtimed_test: PASS: first test returned timeout
BEFORE: (1514764848 sec, 710000000 nsec)
AFTER:  (1514764850 sec, 710000000 nsec)
semtimed_test: Starting poster thread
semtimed_test: Set thread 1 priority to 191
semtimed_test: Starting poster thread 3
semtimed_test: Set thread 3 priority to 64
semtimed_test: Waiting for two second timeout
poster_func: Waiting for 1 second
poster_func: Posting
semtimed_test: PASS: sem_timedwait succeeded
BEFORE: (1514764850 sec, 740000000 nsec)
AFTER:  (1514764851 sec, 800000000 nsec)

End of test memory usage:
VARIABLE  BEFORE   AFTER
======== ======== ========
arena      fd7200   fd7200
ordblks         2        2
mxordblk   fd30a0   fd30a0
uordblks     3608     3608
fordblks   fd3bf8   fd3bf8

user_main: condition variable test
cond_test: Initializing mutex
cond_test: Initializing cond
cond_test: Starting waiter
cond_test: Set thread 1 priority to 128
waiter_thread: Started
cond_test: Starting signaler
cond_test: Set thread 2 priority to 64
thread_signaler: Started
thread_signaler: Terminating
cond_test: signaler terminated, now cancel the waiter
cond_test:      Waiter  Signaler
cond_test: Loops        32      32
cond_test: Errors       0       0
cond_test:
cond_test: 0 times, waiter did not have to wait for data
cond_test: 0 times, data was already available when the signaler run
cond_test: 0 times, the waiter was in an unexpected state when the signaler ran

End of test memory usage:
VARIABLE  BEFORE   AFTER
======== ======== ========
arena      fd7200   fd7200
ordblks         2        2
mxordblk   fd30a0   fd30a0
uordblks     3608     3608
fordblks   fd3bf8   fd3bf8

user_main: pthread_exit() test
pthread_exit_test: Started pthread_exit_main at PID=28
pthread_exit_main 28: Starting pthread_exit_thread
pthread_exit_main 28: Sleeping for 5 seconds
pthread_exit_thread 29: Sleeping for 10 second
pthread_exit_thread 29: Still running...
pthread_exit_main 28: Calling pthread_exit()

End of test memory usage:
VARIABLE  BEFORE   AFTER
======== ======== ========
arena      fd7200   fd7200
ordblks         2        3
mxordblk   fd30a0   fd30a0
uordblks     3608     3ec0
fordblks   fd3bf8   fd3340

user_main: pthread_rwlock test
pthread_rwlock: Initializing rwlock
pthread_exit_thread 29: Exiting

End of test memory usage:
VARIABLE  BEFORE   AFTER
======== ======== ========
arena      fd7200   fd7200
ordblks         3        2
mxordblk   fd30a0   fd30a0
uordblks     3ec0     3618
fordblks   fd3340   fd3be8

user_main: pthread_rwlock_cancel test
pthread_rwlock_cancel: Starting test

End of test memory usage:
VARIABLE  BEFORE   AFTER
======== ======== ========
arena      fd7200   fd7200
ordblks         2        2
mxordblk   fd30a0   fd30a0
uordblks     3618     3618
fordblks   fd3be8   fd3be8

user_main: timed wait test
thread_waiter: Initializing mutex
timedwait_test: Initializing cond
timedwait_test: Starting waiter
timedwait_test: Set thread 2 priority to 177
thread_waiter: Taking mutex
timedwait_test: Joining
thread_waiter: Starting 5 second wait for condition
thread_waiter: pthread_cond_timedwait timed out
thread_waiter: Releasing mutex
thread_waiter: Exit with status 0x12345678
timedwait_test: waiter exited with result=0x12345678

End of test memory usage:
VARIABLE  BEFORE   AFTER
======== ======== ========
arena      fd7200   fd7200
ordblks         2        2
mxordblk   fd30a0   fd30a0
uordblks     3618     3618
fordblks   fd3be8   fd3be8

user_main: timed message queue test
timedmqueue_test: Starting sender
timedmqueue_test: Waiting for sender to complete
sender_thread: Starting
sender_thread: mq_timedsend succeeded on msg 0
sender_thread: mq_timedsend succeeded on msg 1
sender_thread: mq_timedsend succeeded on msg 2
sender_thread: mq_timedsend succeeded on msg 3
sender_thread: mq_timedsend succeeded on msg 4
sender_thread: mq_timedsend succeeded on msg 5
sender_thread: mq_timedsend succeeded on msg 6
sender_thread: mq_timedsend succeeded on msg 7
sender_thread: mq_timedsend succeeded on msg 8
sender_thread: mq_timedsend 9 timed out as expected
sender_thread: returning nerrors=0
timedmqueue_test: Starting receiver
timedmqueue_test: Waiting for receiver to complete
receiver_thread: Starting
receiver_thread: mq_timedreceive succeed on msg 0
receiver_thread: mq_timedreceive succeed on msg 1
receiver_thread: mq_timedreceive succeed on msg 2
receiver_thread: mq_timedreceive succeed on msg 3
receiver_thread: mq_timedreceive succeed on msg 4
receiver_thread: mq_timedreceive succeed on msg 5
receiver_thread: mq_timedreceive succeed on msg 6
receiver_thread: mq_timedreceive succeed on msg 7
receiver_thread: mq_timedreceive succeed on msg 8
receiver_thread: Receive 9 timed out as expected
receiver_thread: returning nerrors=0
timedmqueue_test: Test complete

End of test memory usage:
VARIABLE  BEFORE   AFTER
======== ======== ========
arena      fd7200   fd7200
ordblks         2        3
mxordblk   fd30a0   fd30a0
uordblks     3618     3680
fordblks   fd3be8   fd3b80

user_main: sigprocmask test
sigprocmask_test: SUCCESS

End of test memory usage:
VARIABLE  BEFORE   AFTER
======== ======== ========
arena      fd7200   fd7200
ordblks         3        3
mxordblk   fd30a0   fd30a0
uordblks     3680     3680
fordblks   fd3b80   fd3b80

user_main: message queue test
mqueue_test: Starting receiver
mqueue_test: Set receiver priority to 128
receiver_thread: Starting
mqueue_test: Starting sender
mqueue_test: Set sender thread priority to 64
mqueue_test: Waiting for sender to complete
sender_thread: Starting
receiver_thread: mq_receive succeeded on msg 0
sender_thread: mq_send succeeded on msg 0
receiver_thread: mq_receive succeeded on msg 1
sender_thread: mq_send succeeded on msg 1
receiver_thread: mq_receive succeeded on msg 2
sender_thread: mq_send succeeded on msg 2
receiver_thread: mq_receive succeeded on msg 3
sender_thread: mq_send succeeded on msg 3
receiver_thread: mq_receive succeeded on msg 4
sender_thread: mq_send succeeded on msg 4
receiver_thread: mq_receive succeeded on msg 5
sender_thread: mq_send succeeded on msg 5
receiver_thread: mq_receive succeeded on msg 6
sender_thread: mq_send succeeded on msg 6
receiver_thread: mq_receive succeeded on msg 7
sender_thread: mq_send succeeded on msg 7
receiver_thread: mq_receive succeeded on msg 8
sender_thread: mq_send succeeded on msg 8
receiver_thread: mq_receive succeeded on msg 9
sender_thread: mq_send succeeded on msg 9
sender_thread: returning nerrors=0
mqueue_test: Killing receiver
receiver_thread: mq_receive interrupted!
receiver_thread: returning nerrors=0
mqueue_test: Canceling receiver
mqueue_test: receiver has already terminated

End of test memory usage:
VARIABLE  BEFORE   AFTER
======== ======== ========
arena      fd7200   fd7200
ordblks         3        3
mxordblk   fd30a0   fd30a0
uordblks     3680     3680
fordblks   fd3b80   fd3b80

user_main: signal handler test
sighand_test: Initializing semaphore to 0
sighand_test: Starting waiter task
sighand_test: Started waiter_main pid=44
waiter_main: Waiter started
waiter_main: Unmasking signal 32
waiter_main: Registering signal handler
waiter_main: oact.sigaction=0 oact.sa_flags=0 oact.sa_mask=0000000000000000
waiter_main: Waiting on semaphore
sighand_test: Signaling pid=44 with signo=32 sigvalue=42
waiter_main: sem_wait() successfully interrupted by signal
waiter_main: done
sighand_test: done

End of test memory usage:
VARIABLE  BEFORE   AFTER
======== ======== ========
arena      fd7200   fd7200
ordblks         3        3
mxordblk   fd30a0   fd30a0
uordblks     3680     3698
fordblks   fd3b80   fd3b68

user_main: nested signal handler test
signest_test: Starting signal waiter task at priority 101
waiter_main: Waiter started
signest_test: Started waiter_main pid=45
waiter_main: Setting signal mask
signest_test: Starting interfering task at priority 102
waiter_main: Registering signal handler
interfere_main: Waiting on semaphore
waiter_main: Waiting on semaphore
signest_test: Started interfere_main pid=46
signest_test: Simple case:
  Total signalled 1240  Odd=620 Even=620
  Total handled   1240  Odd=620 Even=620
  Total nested    0    Odd=0   Even=0  
signest_test: With task locking
  Total signalled 2480  Odd=1240 Even=1240
  Total handled   2480  Odd=1240 Even=1240
  Total nested    0    Odd=0   Even=0  
signest_test: With intefering thread
  Total signalled 3720  Odd=1860 Even=1860
  Total handled   3720  Odd=1860 Even=1860
  Total nested    0    Odd=0   Even=0  
signest_test: done

End of test memory usage:
VARIABLE  BEFORE   AFTER
======== ======== ========
arena      fd7200   fd7200
ordblks         3        6
mxordblk   fd30a0   fd30a0
uordblks     3698     36f8
fordblks   fd3b68   fd3b08

user_main: POSIX timer test
timer_test: Initializing semaphore to 0
timer_test: Unmasking signal 32
timer_test: Registering signal handler
timer_test: oact.sigaction=0 oact.sa_flags=0 oact.sa_mask=0000000000000000
timer_test: Creating timer
timer_test: Starting timer
timer_test: Waiting on semaphore
timer_expiration: Received signal 32
timer_expiration: sival_int=42
timer_expiration: si_code=2 (SI_TIMER)
timer_expiration: ucontext=0
timer_test: sem_wait() successfully interrupted by signal
timer_test: g_nsigreceived=1
timer_test: Waiting on semaphore
timer_expiration: Received signal 32
timer_expiration: sival_int=42
timer_expiration: si_code=2 (SI_TIMER)
timer_expiration: ucontext=0
timer_test: sem_wait() successfully interrupted by signal
timer_test: g_nsigreceived=2
timer_test: Waiting on semaphore
timer_expiration: Received signal 32
timer_expiration: sival_int=42
timer_expiration: si_code=2 (SI_TIMER)
timer_expiration: ucontext=0
timer_test: sem_wait() successfully interrupted by signal
timer_test: g_nsigreceived=3
timer_test: Waiting on semaphore
timer_expiration: Received signal 32
timer_expiration: sival_int=42
timer_expiration: si_code=2 (SI_TIMER)
timer_expiration: ucontext=0
timer_test: sem_wait() successfully interrupted by signal
timer_test: g_nsigreceived=4
timer_test: Waiting on semaphore
timer_expiration: Received signal 32
timer_expiration: sival_int=42
timer_expiration: si_code=2 (SI_TIMER)
timer_expiration: ucontext=0
timer_test: sem_wait() successfully interrupted by signal
timer_test: g_nsigreceived=5
timer_test: Deleting timer
timer_test: done

End of test memory usage:
VARIABLE  BEFORE   AFTER
======== ======== ========
arena      fd7200   fd7200
ordblks         6        6
mxordblk   fd30a0   fd30a0
uordblks     36f8     36f8
fordblks   fd3b08   fd3b08

user_main: spinlock test
Start Lock test:
Thread num: 1, Loop times: 10000000

Test type: spinlock
spinlock: Test Results:
spinlock: Final counter: 10000000
spinlock: Average throughput : 610128 op/s
spinlock: Total execution time: 16390000000 ns
 
Test type: rspinlock
rspinlock: Test Results:
rspinlock: Final counter: 10000000
rspinlock: Average throughput : 610128 op/s
rspinlock: Total execution time: 16390000000 ns
 
Test type: seqcount
seqcount: Test Results:
seqcount: Final counter: 10000000
seqcount: Average throughput : 335232 op/s
seqcount: Total execution time: 29830000000 ns
 

End of test memory usage:
VARIABLE  BEFORE   AFTER
======== ======== ========
arena      fd7200   fd7200
ordblks         6        6
mxordblk   fd30a0   fd30a0
uordblks     36f8     36f8
fordblks   fd3b08   fd3b08

user_main: wdog test
wdog_test start...
wdtest_once 0 ns
wdtest_once 0 ns
wdtest_once 0 ns
wdtest_once 0 ns
wdtest_once 1 ns
wdtest_once 1 ns
wdtest_once 1 ns
wdtest_once 1 ns
wdtest_once 10 ns
wdtest_once 10 ns
wdtest_once 10 ns
wdtest_once 10 ns
wdtest_once 100 ns
wdtest_once 100 ns
wdtest_once 100 ns
wdtest_once 100 ns
wdtest_once 1000 ns
wdtest_once 1000 ns
wdtest_once 1000 ns
wdtest_once 1000 ns
wdtest_once 10000 ns
wdtest_once 10000 ns
wdtest_once 10000 ns
wdtest_once 10000 ns
wdtest_once 100000 ns
wdtest_once 100000 ns
wdtest_once 100000 ns
wdtest_once 100000 ns
wdtest_once 1000000 ns
wdtest_once 1000000 ns
wdtest_once 1000000 ns
wdtest_once 1000000 ns
wd_start with maximum delay, cancel OK, rest 1073741821
wd_start with maximum delay, cancel OK, rest 1073741821
wd_start with maximum delay, cancel OK, rest 1073741821
wd_start with maximum delay, cancel OK, rest 1073741821
wdtest_recursive 1000000ns
wdtest_recursive 1000000ns
wdtest_recursive 1000000ns
wdtest_recursive 1000000ns
recursive wdog triggered 6 times, elapsed tick 12
wdtest_recursive 10000000ns
recursive wdog triggered 6 times, elapsed tick 12
recursive wdog triggered 6 times, elapsed tick 12
wdtest_recursive 10000000ns
recursive wdog triggered 6 times, elapsed tick 12
wdtest_recursive 10000000ns
recursive wdog triggered 6 times, elapsed tick 12
wdtest_recursive 10000000ns
recursive wdog triggered 6 times, elapsed tick 12
recursive wdog triggered 6 times, elapsed tick 12
recursive wdog triggered 6 times, elapsed tick 12
wdog_test end...

End of test memory usage:
VARIABLE  BEFORE   AFTER
======== ======== ========
arena      fd7200   fd7200
ordblks         6        6
mxordblk   fd30a0   fd30a0
uordblks     36f8     36f8
fordblks   fd3b08   fd3b08

user_main: barrier test
barrier_test: Initializing barrier
barrier_test: Thread 0 created
barrier_func: Thread 0 started
barrier_test: Thread 1 created
barrier_func: Thread 1 started
barrier_test: Thread 2 created
barrier_func: Thread 2 started
barrier_test: Thread 3 created
barrier_func: Thread 3 started
barrier_test: Thread 4 created
barrier_func: Thread 4 started
barrier_test: Thread 5 created
barrier_func: Thread 5 started
barrier_test: Thread 6 created
barrier_func: Thread 6 started
barrier_test: Thread 7 created
barrier_func: Thread 7 started
barrier_func: Thread 0 calling pthread_barrier_wait()
barrier_func: Thread 1 calling pthread_barrier_wait()
barrier_func: Thread 2 calling pthread_barrier_wait()
barrier_func: Thread 3 calling pthread_barrier_wait()
barrier_func: Thread 4 calling pthread_barrier_wait()
barrier_func: Thread 5 calling pthread_barrier_wait()
barrier_func: Thread 6 calling pthread_barrier_wait()
barrier_func: Thread 7 calling pthread_barrier_wait()
barrier_func: Thread 7, back with status=PTHREAD_BARRIER_SERIAL_THREAD (I AM SPECIAL)
barrier_func: Thread 0, back with status=0 (I am not special)
barrier_func: Thread 1, back with status=0 (I am not special)
barrier_func: Thread 2, back with status=0 (I am not special)
barrier_func: Thread 3, back with status=0 (I am not special)
barrier_func: Thread 4, back with status=0 (I am not special)
barrier_func: Thread 5, back with status=0 (I am not special)
barrier_func: Thread 6, back with status=0 (I am not special)
barrier_func: Thread 7 done
barrier_func: Thread 0 done
barrier_func: Thread 1 done
barrier_test: Thread 0 completed with result=0
barrier_test: Thread 1 completed with result=0
barrier_func: Thread 2 done
barrier_test: Thread 2 completed with result=0
barrier_func: Thread 3 done
barrier_test: Thread 3 completed with result=0
barrier_func: Thread 4 done
barrier_test: Thread 4 completed with result=0
barrier_func: Thread 5 done
barrier_test: Thread 5 completed with result=0
barrier_func: Thread 6 done
barrier_test: Thread 6 completed with result=0
barrier_test: Thread 7 completed with result=0

End of test memory usage:
VARIABLE  BEFORE   AFTER
======== ======== ========
arena      fd7200   fd7200
ordblks         6        6
mxordblk   fd30a0   fd30a0
uordblks     36f8     36f8
fordblks   fd3b08   fd3b08

user_main: scheduler lock test
sched_lock: Starting lowpri_thread at 97
sched_lock: Set lowpri_thread priority to 97
sched_lock: Starting highpri_thread at 98
sched_lock: Set highpri_thread priority to 98
sched_lock: Waiting...
sched_lock: PASSED No pre-emption occurred while scheduler was locked.
sched_lock: Starting lowpri_thread at 97
sched_lock: Set lowpri_thread priority to 97
sched_lock: Starting highpri_thread at 98
sched_lock: Set highpri_thread priority to 98
sched_lock: Waiting...
sched_lock: PASSED No pre-emption occurred while scheduler was locked.
sched_lock: Finished

End of test memory usage:
VARIABLE  BEFORE   AFTER
======== ======== ========
arena      fd7200   fd7200
ordblks         6        6
mxordblk   fd30a0   fd30a0
uordblks     36f8     36f8
fordblks   fd3b08   fd3b08

user_main: vfork() test
vfork_test: Child 72 ran successfully

Final memory usage:
VARIABLE  BEFORE   AFTER
======== ======== ========
arena      fd7200   fd7200
ordblks         2        6
mxordblk   fd30a0   fd30a0
uordblks     3608     36f8
fordblks   fd3bf8   fd3b08
user_main: Exiting


- Guard imx9_gpc.h inclusion with CONFIG_IMX9_WFI_AWAKES_AT_SYSTICK
  to avoid a GPC dependency on chips that lack GPC
- Add depends on ARCH_CHIP_IMX95_M7 to IMX9_WFI_AWAKES_AT_SYSTICK
  since GPC wake configuration is i.MX95-specific
- Move XTAL_FREQ and ROOT_CLOCK_OFFSET defines to imx95_clock.h
- Make imx9_sm_setrootclock() and imx9_sm_getipfreq() static;
  they are not referenced outside this translation unit

Signed-off-by: Maarten Zanders <maarten@zanders.be>
The GPIO mux range check in imx9_iomux_gpio() used a hardcoded
IOMUXC_MUX_CTL_GPIO_IO37_OFFSET as the upper bound, which is
i.MX95-specific. Move the define to imx95_iomuxc.h as an alias of
the last GPIO_IO entry, and use the named constant in the comparison.

No functional change; i.MX95 builds are unaffected.

Signed-off-by: Maarten Zanders <maarten@zanders.be>
Use NVIC_IRQ_ENABLE(n) and NVIC_IRQ_PRIORITY(n) macros in
imx9_dumpnvic() to iterate over all NVIC registers programmatically
based on CONFIG_ARCH_NINTS (IMX9_IRQ_NEXTINT), rather than
enumerating named per-range register defines. Output is grouped
4-per-line for priority and 4-per-line for enable registers,
matching the original layout.
This avoids accessing registers which don't exist when extending
the interrupt count.

Also replace named NVIC_IRQxx_yy_ENABLE constants in imx9_irqinfo()
with NVIC_IRQ_ENABLE(n), avoiding naming conflicts between chips
with different IRQ counts.

Fix the upper boundary in the >192 IRQ branch from 219 to 224 to
align with the 32-interrupt register granularity.

Change %08x to %08lx to silence warnings from the compiler for
the debug dump.

No functional change for existing i.MX95-M7 builds.

Signed-off-by: Maarten Zanders <maarten@zanders.be>
…ers.

Extract chip-specific constants from imx9_rptun.c and imx9_rsctable.c
into new dispatch headers:

- hardware/imx9_rsctable.h: VDEV0_VRING_BASE and RESOURCE_TABLE_BASE,
  selected per ARCH_CHIP define
- hardware/imx9_rptun.h: MU_INSTANCE, selected per ARCH_CHIP define

Rename the misnamed VRING_SHMEM constant in imx9_rptun.c to
RESOURCE_TABLE_BASE, which correctly reflects that this address points
to the resource table, not the vring shared memory region.

No functional change for i.MX95-M7 builds.

Signed-off-by: Maarten Zanders <maarten@zanders.be>
Rename imx95_mu_* functions and CONFIG_IMX9_MU{5,7,8} Kconfig symbols
to imx9_mu_* and CONFIG_IMX95_MU{5,7,8} respectively, decoupling the
MU driver API from the iMX95-specific naming in preparation for
iMX93-M33 support.

Add ARCH_CHIP_IMX95_M7 dependency to the MU instance Kconfig entries
so they are only visible for the appropriate target.

Switch imx9_mu.c to include the generic imx9_memorymap.h instead of
the imx95-specific header.

Fix incorrect help text for MU8 (was copy-pasted from MU5).

Signed-off-by: Maarten Zanders <maarten@zanders.be>
…ection.

The menu and choice had the same purpose; keep only the choice.

Signed-off-by: Maarten Zanders <maarten@zanders.be>
Add hardware register headers and driver support for the NXP i.MX93
Cortex-M33 core. All new and modified code is guarded by
ARCH_CHIP_IMX93_M33 preprocessor defines; existing i.MX95-M7 builds
are unaffected.

New drivers:
- imx9_xcache.c - off core cache init and maintenance
- imx9_ccm.c - generic CCM abstraction layer

Signed-off-by: Maarten Zanders <maarten@zanders.be>
@github-actions github-actions bot added Area: CI Arch: arm Issues related to ARM (32-bit) architecture Size: XL The size of the change in this PR is very large. Consider breaking down the PR into smaller pieces. Board: arm labels Feb 26, 2026
acassis
acassis previously approved these changes Feb 26, 2026
@linguini1
Copy link
Contributor

Thank you @mzanders for a great PR! The testing section is very thorough, the addition of the docs is awesome and a good explanation :) You're a pro already! Looks like just some small CI checks are failing.

I'm CC'ing @AndreHeinemans-NXP who I believe has access to IMX95 hardware. Andre, would you be willing/able to test this patch on an IMX95 device to make sure that ostest works after these modifications?

Add board support for the NXP i.MX93 QSB targeting the Cortex-M33
core. Three configurations are provided:

- nsh:     run from ITCM (128 kB), LPUART2 console
- nsh-ddr: run from DDR, LPUART2 console
- rpmsg:   run from ITCM, RPMsg/OpenAMP transport, NSH on
           /dev/tty-nsh via RPMSG_UART_RAW

Linker scripts:
- itcm.ld: vectors + text in ITCM, data in DTCM
- ddr.ld:  vectors + text + data in DDR (0x89000000, 16 MB)

Tool to enable local debug interface through USB.

Signed-off-by: Maarten Zanders <maarten@zanders.be>
Add myself to new and common/modified files.

Signed-off-by: Maarten Zanders <maarten@zanders.be>
@mzanders
Copy link
Contributor Author

@linguini1
Thank you @mzanders for a great PR! The testing section is very thorough, the addition of the docs is awesome and a good explanation :) You're a pro already! Looks like just some small CI checks are failing.

Yes, whilst writing the documentation I remembered to include the small python script but forget to run checkpatch against it. I hope CI passes now!

I'm CC'ing @AndreHeinemans-NXP who I believe has access to IMX95 hardware. Andre, would you be willing/able to test this patch on an IMX95 device to make sure that ostest works after these modifications?

That would be awesome! Please get in touch directly @AndreHeinemans-NXP if anything seems off.

Add a writeup of currently supported features with a picture
and block diagram.

Signed-off-by: Maarten Zanders <maarten@zanders.be>
@mzanders mzanders force-pushed the introduce_imx93-m33 branch from 465b135 to d16c8a3 Compare February 26, 2026 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: arm Issues related to ARM (32-bit) architecture Area: CI Board: arm 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