freebsd-nq/sys/arm
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
..
allwinner mmc: switch mmc_helper to device_ api 2021-09-20 17:18:02 +02:00
altera/socfpga arm: clean up empty lines in .c and .h files 2020-09-01 21:17:24 +00:00
annapurna/alpine Remove versatile support 2021-04-12 06:16:31 +00:00
arm sched: separate out schedinit_ap() 2021-11-03 15:54:59 -05:00
broadcom/bcm2835 bcm2835_sdhci: don't use DMA for kernel dumps 2021-09-21 10:08:39 -03:00
conf qcom: add initial SCM legacy API 2021-11-04 09:02:33 -07:00
freescale Remove "All Rights Reserved" from FreeBSD Foundation sys/ copyrights 2021-08-08 10:42:24 -04:00
include arm: Remove unused items 2021-11-03 13:54:36 -06:00
linux linux(4): Regen for clone syscall. 2021-08-12 11:47:31 +03:00
mv arm/mv: Don't rely on firmware MSI mapping in ICU 2021-07-20 23:24:42 +02:00
nvidia arm: fix a typo in nvidia/drm2/tegra_bo.c 2021-10-25 18:42:10 +00:00
qemu
qualcomm ipq401x: add MP core start-up path for the CPU regulator/clock gate used 2021-11-04 09:02:36 -07:00
rockchip Add support for RK3288 SoC. 2020-12-04 16:24:44 +00:00
ti ti(4): Fix a typo in an error message 2021-10-02 10:51:29 +02:00
xilinx arm: clean up empty lines in .c and .h files 2020-09-01 21:17:24 +00:00