os/drivers/cpu, apps/system: Add CPU driver interface and test app#7033
Open
mukku-suneel wants to merge 3 commits intoSamsung:masterfrom
Open
os/drivers/cpu, apps/system: Add CPU driver interface and test app#7033mukku-suneel wants to merge 3 commits intoSamsung:masterfrom
mukku-suneel wants to merge 3 commits intoSamsung:masterfrom
Conversation
Contributor
Author
|
This PR depends on PR #7028 |
3a55ddb to
220a207
Compare
Contributor
-need to remove it |
38deec1 to
771c4b9
Compare
Contributor
|
LGTM |
anjana348
reviewed
Nov 12, 2025
66f8606 to
3785ca7
Compare
3785ca7 to
5b80ffc
Compare
Contributor
|
Hello @mukku-suneel |
5b80ffc to
c68e8a8
Compare
Contributor
Author
Hello @seokhun-eom24 |
ewoodev
reviewed
Feb 2, 2026
os/drivers/cpu/cpu_driver.c
Outdated
| } | ||
| return OK; | ||
| case IOC_CPU_GET_STATE: { | ||
| int state = up_get_cpu_state(cpu); |
Contributor
There was a problem hiding this comment.
The cpu state api was merged.
please replace it
os/drivers/cpu/cpu_driver.c
Outdated
| case IOC_CPU_GET_STATE: { | ||
| int state = up_get_cpu_state(cpu); | ||
| if (state < 0) { | ||
| lldbg("ERROR: Invalid CPU state %d for CPU%d\n", state, cpu); |
Contributor
There was a problem hiding this comment.
Do not use lldbg on this case
lldbg makes log mixing.
please use only non-schedule or irq.
c68e8a8 to
d01ca81
Compare
Add character driver for Secondary CPUs management operations through /dev/cpuX device nodes. Provides ioctl interface for CPU enable/disable and state query operations. This driver enables userspace applications and test utilities to control CPU states and perform cpu on/off operations through standard interface.
…esting Add cputest application with shell commands for testing CPU driver functionality. Provides commands to enable/disable secondary CPUs and check CPU status through device interface. Shell commands added: - cpuctrl on <cpu_id>: Power on specified CPU - cpuctrl off <cpu_id>: Power off specified CPU - cpuctrl status: Show status of all Secondary CPUs - cpuctrl help : Show the help message Test Results: TASH>> TASH>> TASH>>cpuctrl status TASH>>cpu state for cpu1: 0 (running) TASH>> TASH>> TASH>> TASH>>smp TASH>> Main[0]: Running on CPU0 Main[0]: Initializing barrier Running SMP test with AMP configuration Thread[1]: Started Thread[1]: Running on CPU0 Main[0]: Thread 1 created Thread[2]: Started Thread[2]: Running on CPU1 Main[0]: Thread 2 created Thread[3]: Started Thread[3]: Running on CPU0 Main[0]: Thread 3 created Thread[4]: Started Thread[4]: Running on CPU1 Main[0]: Thread 4 created Thread[5]: Started Thread[5]: Running on CPU0 Main[0]: Thread 5 created Thread[6]: Started Thread[6]: Running on CPU1 Main[0]: Thread 6 created Thread[7]: Started Thread[7]: Running on CPU0 Main[0]: Thread 7 created Thread[8]: Started Thread[8]: Running on CPU1 Main[0]: Thread 8 created Thread[2]: Calling pthread_barrier_wait() Thread[1]: Calling pthread_barrier_wait() Thread[4]: Calling pthread_barrier_wait() Thread[3]: Calling pthread_barrier_wait() Thread[5]: Calling pthread_barrier_wait() Thread[6]: Calling pthread_barrier_wait() Thread[7]: Calling pthread_barrier_wait() Thread[8]: Calling pthread_barrier_wait() Thread[8]: Back with ret=PTHREAD_BARRIER_SERIAL_THREAD (I AM SPECIAL) Thread[1]: Back with ret=0 (I am not special) Thread[3]: Back with ret=0 (I am not special) Thread[5]: Back with ret=0 (I am not special) Thread[7]: Back with ret=0 (I am not special) Thread[2]: Back with ret=0 (I am not special) Thread[4]: Back with ret=0 (I am not special) Thread[6]: Back with ret=0 (I am not special) Thread[8]: Done Thread[2]: Done Thread[4]: Done Thread[6]: Done Thread[1]: Done Thread[3]: Done Thread[5]: Done Main[0]: Thread 1 completed with result=0 Thread[7]: Done Main[0]: Thread 2 completed with result=0 Main[0]: Thread 3 completed with result=0 Main[0]: Thread 4 completed with result=0 Main[0]: Thread 5 completed with result=0 Main[0]: Thread 6 completed with result=0 Main[0]: Thread 7 completed with result=0 Main[0]: Thread 8 completed with result=0 TASH>> TASH>> TASH>> TASH>> TASH>>cpuctrl off 1 TASH>>powering down cpu1! cpu1 successfully disabled state: 1 (offline) TASH>> TASH>> TASH>> TASH>>cpuctrl status TASH>>cpu state for cpu1: 1 (offline) TASH>> TASH>> TASH>> TASH>> TASH>>smp TASH>> Main[0]: Running on CPU0 Main[0]: Initializing barrier Running SMP test with AMP configuration Thread[1]: Started Thread[1]: Running on CPU0 Main[0]: Thread 1 created Thread[2]: Started Thread[2]: Running on CPU0 Main[0]: Thread 2 created Thread[3]: Started Thread[3]: Running on CPU0 Main[0]: Thread 3 created Thread[4]: Started Thread[4]: Running on CPU0 Main[0]: Thread 4 created Thread[5]: Started Thread[5]: Running on CPU0 Main[0]: Thread 5 created Thread[6]: Started Thread[6]: Running on CPU0 Main[0]: Thread 6 created Thread[7]: Started Thread[7]: Running on CPU0 Main[0]: Thread 7 created Thread[8]: Started Thread[8]: Running on CPU0 Main[0]: Thread 8 created Thread[1]: Calling pthread_barrier_wait() Thread[3]: Calling pthread_barrier_wait() Thread[5]: Calling pthread_barrier_wait() Thread[7]: Calling pthread_barrier_wait() Thread[2]: Calling pthread_barrier_wait() Thread[4]: Calling pthread_barrier_wait() Thread[6]: Calling pthread_barrier_wait() Thread[8]: Calling pthread_barrier_wait() Thread[8]: Back with ret=PTHREAD_BARRIER_SERIAL_THREAD (I AM SPECIAL) Thread[1]: Back with ret=0 (I am not special) Thread[3]: Back with ret=0 (I am not special) Thread[5]: Back with ret=0 (I am not special) Thread[7]: Back with ret=0 (I am not special) Thread[2]: Back with ret=0 (I am not special) Thread[4]: Back with ret=0 (I am not special) Thread[6]: Back with ret=0 (I am not special) Thread[1]: Done Thread[3]: Done Thread[7]: Done Thread[5]: Done Main[0]: Thread 1 completed with result=0 Thread[6]: Done Thread[8]: Done Thread[2]: Done Thread[4]: Done Main[0]: Thread 2 completed with result=0 Main[0]: Thread 3 completed with result=0 Main[0]: Thread 4 completed with result=0 Main[0]: Thread 5 completed with result=0 Main[0]: Thread 6 completed with result=0 Main[0]: Thread 7 completed with result=0 Main[0]: Thread 8 completed with result=0 TASH>> TASH>> TASH>> TASH>>cpuctrl on 1 TASH>>powering up cpu1! cpu1 successfully enabled state: 0 (running) TASH>> TASH>> TASH>>cpuctrl status TASH>>cpu state for cpu1: 0 (running) TASH>> TASH>> TASH>> TASH>>smp TASH>> Main[0]: Running on CPU0 Main[0]: Initializing barrier Running SMP test with AMP configuration Thread[1]: Started Thread[1]: Running on CPU0 Main[0]: Thread 1 created Thread[2]: Started Thread[2]: Running on CPU1 Main[0]: Thread 2 created Thread[3]: Started Thread[3]: Running on CPU0 Main[0]: Thread 3 created Thread[4]: Started Thread[4]: Running on CPU1 Main[0]: Thread 4 created Thread[5]: Started Thread[5]: Running on CPU0 Main[0]: Thread 5 created Thread[6]: Started Thread[6]: Running on CPU1 Main[0]: Thread 6 created Thread[7]: Started Thread[7]: Running on CPU0 Main[0]: Thread 7 created Thread[8]: Started Thread[8]: Running on CPU1 Main[0]: Thread 8 created Thread[2]: Calling pthread_barrier_wait() Thread[1]: Calling pthread_barrier_wait() Thread[4]: Calling pthread_barrier_wait() Thread[3]: Calling pthread_barrier_wait() Thread[5]: Calling pthread_barrier_wait() Thread[6]: Calling pthread_barrier_wait() Thread[7]: Calling pthread_barrier_wait() Thread[8]: Calling pthread_barrier_wait() Thread[8]: Back with ret=PTHREAD_BARRIER_SERIAL_THREAD (I AM SPECIAL) Thread[1]: Back with ret=0 (I am not special) Thread[3]: Back with ret=0 (I am not special) Thread[5]: Back with ret=0 (I am not special) Thread[7]: Back with ret=0 (I am not special) Thread[2]: Back with ret=0 (I am not special) Thread[4]: Back with ret=0 (I am not special) Thread[6]: Back with ret=0 (I am not special) Thread[8]: Done Thread[2]: Done Thread[4]: Done Thread[6]: Done Thread[1]: Done Thread[3]: Done Thread[5]: Done Main[0]: Thread 1 completed with result=0 Thread[7]: Done Main[0]: Thread 2 completed with result=0 Main[0]: Thread 3 completed with result=0 Main[0]: Thread 4 completed with result=0 Main[0]: Thread 5 completed with result=0 Main[0]: Thread 6 completed with result=0 Main[0]: Thread 7 completed with result=0 Main[0]: Thread 8 completed with result=0 TASH>> TASH>> TASH>> TASH>>
…ration for rtl8730e Add CONFIG_CPU_DRIVER=y and CONFIG_SYSTEM_CPUCONTROL=y to rtl8730e board configurations to enable CPU driver support and CPU control app for CPU management operations.
d01ca81 to
990f28f
Compare
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.
Add Secondary CPUs management interface with character driver interface,
test application and board configuration support.
CPU Driver:
Test Application:
Configuration:
Shell commands added: