gpoulios opened a new pull request, #16298: URL: https://github.com/apache/nuttx/pull/16298
Add kernel build (target `imx93-evk:knsh`) to i.MX93 EVK. ## Summary The new target is preconfigured for use with AHAB boot (see https://spsdk.readthedocs.io/en/latest/examples/ahab/imx93/imx93_ahab_uboot.html) as a replacement of U-Boot proper (BL33 at EL2), hence the load address is set to 0x80200000. It introduces NuttX kernel build to i.MX93 platform. ## Impact Should not affect existing users. Changes to existing config are minimal and wrapped by Kconfig settings that are disabled for existing users (`CONFIG_BUILD_KERNEL`, `CONFIG_IMX9_BIN_ROMFS` newly introduced). Adds also a section on i.MX93 documentation (step 5) with instructions on how to use this target. ## Testing Built on Linux host, target `imx93-evk:knsh` (as specified in Documentation/platforms/arm64/imx9/boards/imx93-evk/README.txt). Tested on i.MX93 EVK using i.MX U-boot SPL @ lf_v2024.04. <details> <summary>OS test results</summary> Note: the results below were obtained with the following changes compared to the provided defconfig: - `CONFIG_PRIORITY_INHERITANCE` was disabled because `ostest` uses `task_create` when priority inheritance is enabled. - `CONFIG_TESTING_OSTEST` was enabled to provide `ostest` - `CONFIG_TESTING_OSTEST_FPUTESTDISABLE` was disabled as it's not compatible with kernel builds. ``` NuttShell (NSH) knsh> 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: putenv(Variable1=BadValue3) ostest_main: setenv(Variable1, GoodValue1, TRUE) ostest_main: setenv(Variable2, BadValue1, FALSE) ostest_main: setenv(Variable2, GoodValue2, TRUE) ostest_main: setenv(Variable3, GoodValue3, FALSE) ostest_main: setenv(Variable3, BadValue2, FALSE) show_variable: Variable=Variable1 has value=GoodValue1 show_variable: Variable=Variable2 has value=GoodValue2 show_variable: Variable=Variable3 has value=GoodValue3 ostest_main: Started user_main at PID=7 user_main: Begin argument test user_main: Started with argc=5 user_main: argv[0]="user_main" 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 21000 21000 ordblks 2 2 mxordblk 1aff8 1aff8 uordblks 27e8 27e8 fordblks 1e818 1e818 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 21000 21000 ordblks 2 2 mxordblk 1aff8 1aff8 uordblks 27e8 27e8 fordblks 1e818 1e818 user_main: libc tests End of test memory usage: VARIABLE BEFORE AFTER ======== ======== ======== arena 21000 21000 ordblks 2 2 mxordblk 1aff8 1aff8 uordblks 27e8 27e8 fordblks 1e818 1e818 show_variable: Variable=Variable1 has value=GoodValue1 show_variable: Variable=Variable2 has value=GoodValue2 show_variable: Variable=Variable3 has value=GoodValue3 show_variable: Variable=Variable1 has no value show_variable: Variable=Variable2 has value=GoodValue2 show_variable: Variable=Variable3 has value=GoodValue3 End of test memory usage: VARIABLE BEFORE AFTER ======== ======== ======== arena 21000 21000 ordblks 2 3 mxordblk 1aff8 1aff8 uordblks 27e8 27c8 fordblks 1e818 1e838 show_variable: Variable=Variable1 has no value show_variable: Variable=Variable2 has no value show_variable: Variable=Variable3 has no value End of test memory usage: VARIABLE BEFORE AFTER ======== ======== ======== arena 21000 21000 ordblks 3 2 mxordblk 1aff8 1aff8 uordblks 27c8 26f0 fordblks 1e838 1e910 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 21000 21000 ordblks 2 2 mxordblk 1aff8 1aff8 uordblks 26f0 26f0 fordblks 1e910 1e910 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 21000 21000 ordblks 2 2 mxordblk 1aff8 1aff8 uordblks 26f0 26f0 fordblks 1e910 1e910 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 21000 21000 ordblks 2 3 mxordblk 1aff8 d178 uordblks 26f0 a578 fordblks 1e910 16a88 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 21000 21000 ordblks 3 3 mxordblk d178 d178 uordblks a578 a578 fordblks 16a88 16a88 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=0xffffffffffffffff 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=0xffffffffffffffff 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 21000 21000 ordblks 3 3 mxordblk d178 12ff8 uordblks a578 46f8 fordblks 16a88 1c908 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 21000 21000 ordblks 3 3 mxordblk 12ff8 12ff8 uordblks 46f8 46f8 fordblks 1c908 1c908 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 waiter_func: Thread 1 new semaphore value = -1 poster_func: Thread 3 new semaphore value = -1 waiter_func: Thread 1 done poster_func: Thread 3 semaphore value = -1 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 21000 39000 ordblks 3 5 mxordblk 12ff8 15178 uordblks 46f8 1a288 fordblks 1c908 1ed78 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: (35 sec, 830000000 nsec) AFTER: (37 sec, 840000000 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: (37 sec, 840000000 nsec) AFTER: (38 sec, 850000000 nsec) End of test memory usage: VARIABLE BEFORE AFTER ======== ======== ======== arena 39000 39000 ordblks 5 3 mxordblk 15178 25178 uordblks 1a288 a578 fordblks 1ed78 2ea88 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 39000 39000 ordblks 3 3 mxordblk 25178 1d178 uordblks a578 a578 fordblks 2ea88 2ea88 user_main: pthread_exit() test pthread_exit_test: Started pthread_exit_main at PID=30 pthread_exit_main 30: Starting pthread_exit_thread pthread_exit_main 30: Sleeping for 5 seconds pthread_exit_thread 31: Sleeping for 10 second pthread_exit_thread 31: Still running... pthread_exit_main 30: Calling pthread_exit() End of test memory usage: VARIABLE BEFORE AFTER ======== ======== ======== arena 39000 39000 ordblks 3 4 mxordblk 1d178 1d178 uordblks a578 c580 fordblks 2ea88 2ca80 user_main: pthread_rwlock test pthread_rwlock: Initializing rwlock pthread_exit_thread 31: Exiting End of test memory usage: VARIABLE BEFORE AFTER ======== ======== ======== arena 39000 41000 ordblks 4 5 mxordblk 1d178 15178 uordblks c580 1a288 fordblks 2ca80 26d78 user_main: pthread_rwlock_cancel test pthread_rwlock_cancel: Starting test End of test memory usage: VARIABLE BEFORE AFTER ======== ======== ======== arena 41000 41000 ordblks 5 2 mxordblk 15178 3aff8 uordblks 1a288 26f0 fordblks 26d78 3e910 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 41000 41000 ordblks 2 3 mxordblk 3aff8 2d178 uordblks 26f0 a578 fordblks 3e910 36a88 user_main: sigprocmask test sigprocmask_test: SUCCESS End of test memory usage: VARIABLE BEFORE AFTER ======== ======== ======== arena 41000 41000 ordblks 3 3 mxordblk 2d178 2d178 uordblks a578 a578 fordblks 36a88 36a88 user_main: signal handler test sighand_test: Initializing semaphore to 0 sighand_test: Unmasking SIGCHLD sighand_test: Registering SIGCHLD handler sighand_test: Starting waiter task sighand_test: Started waiter_main pid=46 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=46 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 41000 41000 ordblks 3 3 mxordblk 2d178 32ff8 uordblks a578 46f8 fordblks 36a88 3c908 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=47 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=52 signest_test: Simple case: Total signalled 1180 Odd=580 Even=600 Total handled 1180 Odd=580 Even=600 Total nested 0 Odd=0 Even=0 signest_test: With task locking Total signalled 2360 Odd=1160 Even=1200 Total handled 2360 Odd=1160 Even=1200 Total nested 0 Odd=0 Even=0 signest_test: With intefering thread Total signalled 3540 Odd=1740 Even=1800 Total handled 3540 Odd=1740 Even=1800 Total nested 0 Odd=0 Even=0 signest_test: done End of test memory usage: VARIABLE BEFORE AFTER ======== ======== ======== arena 41000 41000 ordblks 3 4 mxordblk 32ff8 2aff8 uordblks 46f8 6700 fordblks 3c908 3a900 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=0xc00094a4 oact.sa_flags=0 oact.sa_mask=aaaaaaaaaaa2a8aa 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 41000 41000 ordblks 4 4 mxordblk 2aff8 2aff8 uordblks 6700 6700 fordblks 3a900 3a900 user_main: round-robin scheduler test rr_test: Set thread priority to 1 rr_test: Set thread policy to SCHED_RR rr_test: Starting first get_primes_thread First get_primes_thread: 56 rr_test: Starting second get_primes_thread Second get_primes_thread: 57 rr_test: Waiting for threads to complete -- this should take awhile If RR scheduling is working, they should start and complete at about the same time get_primes_thread id=1 started, looking for primes < 10000, doing 10 run(s) get_primes_thread id=2 started, looking for primes < 10000, doing 10 run(s) get_primes_thread id=1 finished, found 1230 primes, last one was 9973 get_primes_thread id=2 finished, found 1230 primes, last one was 9973 rr_test: Done End of test memory usage: VARIABLE BEFORE AFTER ======== ======== ======== arena 41000 41000 ordblks 4 4 mxordblk 2aff8 25178 uordblks 6700 12400 fordblks 3a900 2ec00 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_func: Thread 3 done barrier_test: Thread 2 completed with result=0 barrier_test: Thread 3 completed with result=0 barrier_func: Thread 4 done barrier_func: Thread 5 done barrier_test: Thread 4 completed with result=0 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 41000 61000 ordblks 4 10 mxordblk 25178 15178 uordblks 12400 41b30 fordblks 2ec00 1f4d0 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 61000 61000 ordblks 10 4 mxordblk 15178 45178 uordblks 41b30 12400 fordblks 1f4d0 4ec00 Final memory usage: VARIABLE BEFORE AFTER ======== ======== ======== arena 21000 61000 ordblks 2 4 mxordblk 1aff8 45178 uordblks 27e8 12400 fordblks 1e818 4ec00 user_main: Exiting ostest_main: Exiting with status 0 ``` </details> -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org