how to shutdown CPU from userspace

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how to shutdown CPU from userspace

1,283 Views
greeranjunk
Contributor III

i would like to lower the power consumption and shutdown or put to sleep a number of CPUs on the imx8m mini. From the manual there is the General Power Control (GPC) and it show a number of examples. In the example it uses    "reg32_write(GPC_IPS_BASE_ADDR + 0x40, 0xFFFFFFFF);" command to manipulate core1. The compiler does not know the GPC_IPS_BASE_ADDR and when i grep the code i find this code in the uboot-utils

"struct pgc_reg *pgc_core1 = (struct pgc_reg *)(GPC_BASE_ADDR + 0x840)"

the only reference to GPC_IPS_BASE_ADDR is in uboot-utils imx7.

my question is what is the correct way to shutdown or put to sleep cpus from the user-space.

thanks

Labels (1)
0 Kudos
7 Replies

1,119 Views
b36401
NXP Employee
NXP Employee

It is better to shutdown the CPU using Linux command, not accessing the registers directly.

0 Kudos

1,119 Views
greeranjunk
Contributor III

could you tell me how to shutdown the CPU using the Linux command. the command /sys/devices/system/cpu/cpu3/online obfuscates the cpu on the linux but does not shut it down so the power consumption is not altered which is the reason that i would like to shut them down

thanks

0 Kudos

1,119 Views
b36401
NXP Employee
NXP Employee

I mean something like "/sbin/shutdown 0".

0 Kudos

1,119 Views
greeranjunk
Contributor III

shutdown doesnt have an option to shutdown or suspend a specific CPU.

0 Kudos

1,119 Views
b36401
NXP Employee
NXP Employee

You can use something like this:

# echo 0 > /sys/devices/system/cpu/cpu1/online

0 Kudos

1,119 Views
greeranjunk
Contributor III

hi . sorry for not replying but was moved from the project. the "online" option obfuscated the cpu from the linux but the cpu still gets power and is on and my purpose is to lower the power consumption.

i was not able to send commands to the pmic for that

thanks

Ran

0 Kudos

1,119 Views
greeranjunk
Contributor III

after inspecting the code and documentation it seems that the manual  GPC_IPS_BASE_ADDR address is the same as the GPC_BASE_ADDR. now my problem is how to compile the test. the sdk does not include the asm files so my question is if the only way is to build it with the yocto and not the sdk?

thanks

0 Kudos