[U-Boot] [sunxi/sun7i] ARMv7 SVC mode: PSCI not loaded and only 1st CPU core gets activated
U.Mutlu
for-gmane at mutluit.com
Fri Apr 5 22:27:26 UTC 2019
Hi,
when building u-boot for ARMv7 with these settings
for SVC mode (ie. "Secure Mode"), instead of HYPervisor mode:
ARM architecture --->
...
[*] Enable support for booting in non-secure mode
[*] Boot in secure mode by default
[ ] Enable support for hardware virtualization
[*] Enable PSCI support
(2) Maximum supported CPUs for PSCI
[ ] Use LPAE page table format
...
then only the first CPU core gets activated.
How to bring the other core(s) online?
I tried this from https://www.kernel.org/doc/html/v5.0/core-api/cpu_hotplug.html :
# echo 1 > /sys/devices/system/cpu/cpu1/online
bash: /sys/devices/system/cpu/cpu1/online: Permission denied
(actually there is no "online" entry under cpu1, but also not under cpu0.
Attached is the tree under /sys/devices/system/cpu/ )
#
# Automatically generated file; DO NOT EDIT.
# U-Boot 2019.04-rc4 Configuration
...
CONFIG_SYS_ARCH="arm"
CONFIG_SYS_CPU="armv7"
CONFIG_SYS_SOC="sunxi"
CONFIG_SYS_BOARD="sunxi"
CONFIG_SYS_CONFIG_NAME="sun7i"
...
CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-lamobo-r1"
...
# uname -a
Linux r1-3 5.0.5 #1 SMP Sat Mar 30 05:34:40 CET 2019 armv7l GNU/Linux
kernel conf has CONFIG_HOTPLUG_CPU=y
# dmesg | grep -i "smp\|psci\|started in"
[ 0.000000] Linux version 5.0.5 (u-ps at c22-local) (gcc version 9.0.1
20190326 (experimental) [trunk revision 269955] (GCC)) #1 SMP Sat Mar 30
05:34:40 CET 2019
[ 0.004154] smp: Bringing up secondary CPUs ...
[ 0.004753] smp: Brought up 1 node, 1 CPU
[ 0.004766] SMP: Total of 1 processors activated (48.00 BogoMIPS).
[ 0.004772] CPU: All CPU(s) started in SVC mode.
(ie. this means that PSCI is not loaded b/c otherwise there would be some
"psci" lines in the log)
# lscpu
Architecture: armv7l
Byte Order: Little Endian
CPU(s): 2
On-line CPU(s) list: 0
Off-line CPU(s) list: 1
Thread(s) per core: 1
Core(s) per socket: 1
Socket(s): 1
Model name: ARMv7 Processor rev 4 (v7l)
CPU max MHz: 960.0000
CPU min MHz: 144.0000
See also:
---------
http://linux-sunxi.org/PSCI
https://www.kernel.org/doc/Documentation/devicetree/bindings/arm/psci.txt
According to this page
https://falstaff.agner.ch/2016/07/03/u-bootlinux-and-hyp-mode-on-armv7/
it seems in older u-boot versions it did activate all CPUs in SVC mode:
"
Brought up 2 CPUs
SMP: Total of 2 processors activated (96.00 BogoMIPS).
CPU: All CPU(s) started in SVC mode.
"
-------------- next part --------------
/sys/devices/system/cpu/
├── cpu0
│ ├── cpu_capacity
│ ├── cpufreq -> ../cpufreq/policy0
│ ├── hotplug
│ │ ├── fail
│ │ ├── state
│ │ └── target
│ ├── of_node -> ../../../../firmware/devicetree/base/cpus/cpu at 0
│ ├── power
│ │ ├── autosuspend_delay_ms
│ │ ├── control
│ │ ├── pm_qos_resume_latency_us
│ │ ├── runtime_active_time
│ │ ├── runtime_status
│ │ └── runtime_suspended_time
│ ├── subsystem -> ../../../../bus/cpu
│ ├── topology
│ │ ├── core_id
│ │ ├── core_siblings
│ │ ├── core_siblings_list
│ │ ├── physical_package_id
│ │ ├── thread_siblings
│ │ └── thread_siblings_list
│ └── uevent
├── cpu1
│ ├── cpu_capacity
│ ├── cpufreq -> ../cpufreq/policy0
│ ├── hotplug
│ │ ├── fail
│ │ ├── state
│ │ └── target
│ ├── of_node -> ../../../../firmware/devicetree/base/cpus/cpu at 1
│ ├── power
│ │ ├── autosuspend_delay_ms
│ │ ├── control
│ │ ├── pm_qos_resume_latency_us
│ │ ├── runtime_active_time
│ │ ├── runtime_status
│ │ └── runtime_suspended_time
│ ├── subsystem -> ../../../../bus/cpu
│ └── uevent
├── cpufreq
│ ├── policy0
│ │ ├── affected_cpus
│ │ ├── cpuinfo_cur_freq
│ │ ├── cpuinfo_max_freq
│ │ ├── cpuinfo_min_freq
│ │ ├── cpuinfo_transition_latency
│ │ ├── related_cpus
│ │ ├── scaling_available_frequencies
│ │ ├── scaling_available_governors
│ │ ├── scaling_cur_freq
│ │ ├── scaling_driver
│ │ ├── scaling_governor
│ │ ├── scaling_max_freq
│ │ ├── scaling_min_freq
│ │ ├── scaling_setspeed
│ │ └── stats
│ │ ├── reset
│ │ ├── time_in_state
│ │ ├── total_trans
│ │ └── trans_table
│ └── schedutil
│ └── rate_limit_us
├── cpuidle
│ ├── current_driver
│ └── current_governor_ro
├── hotplug
│ └── states
├── isolated
├── kernel_max
├── modalias
├── offline
├── online
├── possible
├── power
│ ├── autosuspend_delay_ms
│ ├── control
│ ├── runtime_active_time
│ ├── runtime_status
│ └── runtime_suspended_time
├── present
└── uevent
20 directories, 63 files
More information about the U-Boot
mailing list