Skip to content

Conversation

@mukku-suneel
Copy link
Contributor

@mukku-suneel mukku-suneel commented Nov 6, 2025

Add Secondary CPUs management interface with character driver interface,
test application and board configuration support.

CPU Driver:

  • Add character driver for CPU management through /dev/cpuX device nodes
  • Provide ioctl interface for CPU enable/disable and state operations

Test Application:

  • 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.
  • Register commands during system initialization

Configuration:

  • Enable CPU driver in rtl8730e board configurations
  • Add Kconfig options for CPU driver and test application

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 Cases:

Default:
TASH>smp
-- smp will run and all threads exit properly

TASH>cpuctrl off 1
-- CPU1 Power off

TASH>cpuctrl on 1
-- CPU1 turned back on

TASH>smp
-- smp will run and all threads exit properly

@mukku-suneel
Copy link
Contributor Author

mukku-suneel commented Nov 6, 2025

This PR depends on PR #7028

@mukku-suneel mukku-suneel marked this pull request as ready for review November 11, 2025 09:24
@mukku-suneel mukku-suneel force-pushed the cpu_on_off_driver branch 4 times, most recently from 3a55ddb to 220a207 Compare November 11, 2025 11:44
@amandeep-samsung
Copy link
Contributor

  • Integrate with existing cpu_arch_ops_s architecture operations

-need to remove it


switch (cmd) {
case IOC_CPU_ENABLE:
#if HOTPLUG_MANAGER_IMPLENTED
Copy link
Contributor

Choose a reason for hiding this comment

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

HOTPLUG_MANAGER_IMPLENTED is not defined currently.
once kernel team adds cpu on/off manager, then we will integrate with their exported APIs

@mukku-suneel mukku-suneel force-pushed the cpu_on_off_driver branch 2 times, most recently from 38deec1 to 771c4b9 Compare November 11, 2025 13:53
const char *cpu_states[] = {
"running", //0
"stop", //1
};
Copy link
Contributor

Choose a reason for hiding this comment

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

we will map these cpu states with newly defined scheduler cpu states after kernel team submits patch.

@mukku-suneel mukku-suneel changed the title os/drivers/cpu, apps/system: Add CPU driver interface and test application for CPU management os/drivers/cpu, apps/system: Add CPU driver interface and test app Nov 11, 2025
@amandeep-samsung
Copy link
Contributor

LGTM

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 Cases:

Default:
TASH>smp
- smp will run and all threads exit properly

TASH>cpuctrl off 1
- CPU1 Power off

TASH>cpuctrl on 1
- CPU1 turned back on

TASH>smp
- smp will run and all threads exit properly
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants