-
Notifications
You must be signed in to change notification settings - Fork 619
os/drivers/cpu, apps/system: Add CPU driver interface and test app #7033
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
base: master
Are you sure you want to change the base?
Conversation
|
This PR depends on PR #7028 |
3a55ddb to
220a207
Compare
-need to remove it |
38deec1 to
771c4b9
Compare
|
LGTM |
66f8606 to
3785ca7
Compare
| return -get_errno(); | ||
| } | ||
|
|
||
| printf("state: %d (%s)\n", state, cpu_states[state]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In current master branch, cpu_state_t has 3 states.
Do we have plan to reduce it to two states? If not we need to update cpu_states to 3 states array.
typedef enum {
CPU_RUNNING = 0, /* CPU is in task scheduer or boot from reset */
CPU_HOTPLUG = 1, /* CPU is offline */
CPU_WAKE_FROM_SLEEP = 2, /* CPU just wake from sleep but not in task scheduler */
} cpu_state_t;When hotplug manager is implemented, we have to check here too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay
3785ca7 to
5b80ffc
Compare
|
Hello @mukku-suneel |
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.
5b80ffc to
c68e8a8
Compare
Hello @seokhun-eom24 |
Add Secondary CPUs management interface with character driver interface,
test application and board configuration support.
CPU Driver:
Test Application:
Configuration:
Shell commands added: