stm32mp1: psci: add synchronization with ROM code
authorPatrick Delaunay <patrick.delaunay@st.com>
Thu, 18 Apr 2019 15:32:40 +0000 (17:32 +0200)
committerPatrice Chotard <patrice.chotard@st.com>
Thu, 23 May 2019 09:36:46 +0000 (11:36 +0200)
commitbb7288ef1c170302d51c666087b65df38e3aab2a
tree26bfff355c0ef929097d413dbfebc6595114ff67
parentee7d7723706efd935b669951cea102974c645065
stm32mp1: psci: add synchronization with ROM code

Use SGI0 interruption  and TAMP_BACKUP_MAGIC_NUMBER
to synchronize the core1 boot sequence requested by
core0 in psci_cpu_on():
- a initial interruption is needed in ROM code after
  RCC_MP_GRSTCSETR_MPUP1RST (psci_cpu_off)
- the ROM code set to 0 the 2 registers
  + TAMP_BACKUP_BRANCH_ADDRESS
  + TAMP_BACKUP_MAGIC_NUMBER
  when magic is not egual to
  BOOT_API_A7_CORE0_MAGIC_NUMBER

This patch solve issue for cpu1 restart in kernel.
echo 0 > /sys/devices/system/cpu/cpu1/online
echo 1 > /sys/devices/system/cpu/cpu1/online

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
arch/arm/mach-stm32mp/psci.c