how to shutdown CPU from userspace

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

how to shutdown CPU from userspace

1,379 次查看
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

标签 (1)
0 项奖励
7 回复数

1,215 次查看
b36401
NXP Employee
NXP Employee

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

0 项奖励

1,215 次查看
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 项奖励

1,215 次查看
b36401
NXP Employee
NXP Employee

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

0 项奖励

1,215 次查看
greeranjunk
Contributor III

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

0 项奖励

1,215 次查看
b36401
NXP Employee
NXP Employee

You can use something like this:

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

0 项奖励

1,215 次查看
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 项奖励

1,215 次查看
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 项奖励