freebsd-dev/sys
Adrian Chadd d3514c2942 ipq401x: add MP core start-up path for the CPU regulator/clock gate used
This code implements the "kpssv2" flavour of CPU regulator/clock gating
in Linux.  It's used by at least the ipq4018/4019 to power on and off
CPU cores.

This is based on the Linux implementation - the register definitions
and values are from Linux and I've reverse engineered the sequencing
requirements.

The MP bring-up is:

* set cold boot address via an SCM call - this is the address used
  by the bootloader/TZ firmware to jump to when the CPUs boot

* power down the LDO feeding the CPU core and wait for it to settle

* program in the right set of LDO and power tree configuration for
  the CPU regulator to power up the core.  Unfortunately these are
  magic numbers that I've not found documented anywhere.

* (I think) power up the shared L2 cache connect if it isn't.

* Clamp the power into the core down; put the core into reset

* Unclamp the power rail; release reset; and then set the core to boot.

The MP core will then boot the bootloader/TZ firmware and then
will wait until an incoming interrupt kicks it to start @ mpentry.

Tested:

* IPQ4019, 4 CPUs

Release APs
CPU(3) applied BP hardening: not necessary
CPU(1) applied BP hardening: not necessary
CPU(2) applied BP hardening: not necessary

Reviewed by: andrew, manu, imp
Differential Revision: https://reviews.freebsd.org/D32723
2021-11-04 09:02:36 -07:00
..
amd64 amd64: Deduplicate routines for expanding KASAN/KMSAN shadow maps 2021-11-03 12:36:02 -04:00
arm ipq401x: add MP core start-up path for the CPU regulator/clock gate used 2021-11-04 09:02:36 -07:00
arm64 sched: separate out schedinit_ap() 2021-11-03 15:54:59 -05:00
bsm Add fspacectl(2), vn_deallocate(9) and VOP_DEALLOCATE(9). 2021-08-05 23:20:42 +08:00
cam scsi_cd: Improve TOC access validation 2021-11-03 15:09:17 -04:00
cddl Allow ddb and dtrace use the DMAP region on arm64 2021-10-01 11:27:33 +01:00
compat linprocfs: Fix formatting of Uid and Gid lines 2021-11-03 08:40:55 +00:00
conf kasan: Disable validation of function parameters passed by value 2021-11-03 12:36:02 -04:00
contrib Merge commit 'ce929fe84f9c453263af379f3b255ff8eca01d48' 2021-10-29 19:18:03 +02:00
crypto crypto: Support Chacha20-Poly1305 with a nonce size of 8 bytes. 2021-10-06 14:08:49 -07:00
ddb Create sys/reg.h for the common code previously in machine/reg.h 2021-08-30 12:50:53 +01:00
dev qcom_rnd: add initial qualcomm prng driver. 2021-11-04 09:02:27 -07:00
dts ipq4018: add a device tree file for the ASUS rt-ac58u router 2021-10-18 19:18:46 +00:00
fs procfs_doprocfile(): simplify 2021-11-04 06:13:47 +02:00
gdb
geom gjournal(8): Fix a typo in a source code comment 2021-11-03 17:14:00 +01:00
gnu
i386 sysbeep: Adjust interface to take a duration as a sbt 2021-11-03 16:03:51 -06:00
isa
kern Allow kern.ipc.maxsockets to be set to current value without error 2021-11-04 12:56:09 +00:00
kgssapi
libkern libkern: remove bcopy 2021-08-24 11:24:07 +00:00
mips sched: separate out schedinit_ap() 2021-11-03 15:54:59 -05:00
modules linux: mv sys/i386/linux/linux_ptrace{,_machdep}.c 2021-11-03 08:50:17 +00:00
net epair: remove "All rights reserved" 2021-11-02 16:50:26 +00:00
net80211 net80211: add a driver-private pointer to struct ieee80211_node 2021-10-31 19:08:28 +00:00
netgraph ng_pptpgre(4): Fix a typo in a source code comment 2021-11-03 17:15:59 +01:00
netinet SIFTR: Fix compilation with -DSIFTR_IPV6 2021-11-04 00:32:17 +00:00
netinet6 blackhole(4): disable for locally originated TCP/UDP packets 2021-11-03 13:02:44 -07:00
netipsec ipsec: add a lock encompassing SPI allocation 2021-11-03 19:51:40 +00:00
netpfil pf: remove the flags argument from pf_unlink_state 2021-11-01 20:59:14 +01:00
netsmb
nfs
nfsclient
nfsserver
nlm
ofed socket: De-duplicate SBLOCKWAIT() definitions 2021-09-14 09:01:32 -04:00
opencrypto crypto: Cleanup mtx_init() calls. 2021-11-02 12:18:05 -07:00
powerpc sched: separate out schedinit_ap() 2021-11-03 15:54:59 -05:00
riscv sched: separate out schedinit_ap() 2021-11-03 15:54:59 -05:00
rpc rpc: Convert an SOLISTENING check to an assertion 2021-09-17 14:19:05 -04:00
security Add fspacectl(2), vn_deallocate(9) and VOP_DEALLOCATE(9). 2021-08-05 23:20:42 +08:00
sys qcom_rnd: add initial qualcomm prng driver. 2021-11-04 09:02:27 -07:00
teken
tests routing: add IPv6 fib validation procedure. 2021-08-16 23:04:01 +00:00
tools ipq4018: add TCSR definitions from Linux. 2021-10-18 19:18:01 +00:00
ufs ufs: remove write-only variables 2021-10-21 21:40:46 +03:00
vm Fix a common typo in syctl descriptions 2021-11-03 20:49:24 +01:00
x86 sched: separate out schedinit_ap() 2021-11-03 15:54:59 -05:00
xdr
xen xen: introduce xen_pv_disks_disabled() 2021-07-28 17:27:04 +02:00
Makefile