arm64: zynqmp: Fix split mode reset functionality
authorNeal Frager <neal.frager@amd.com>
Wed, 4 May 2022 07:12:26 +0000 (09:12 +0200)
committerMichal Simek <michal.simek@amd.com>
Wed, 18 May 2022 11:17:18 +0000 (13:17 +0200)
commit67bdaa016514f020b717a3ba350696ded44a10a3
treed953633ed4777448bf9c151a45dd23b34317a49c
parent2946c551f1d873f40187c042d0c9306e7fef27c5
arm64: zynqmp: Fix split mode reset functionality

This patch fixes two issues in the set_r5_reset function.

1. When in split mode, the lpd_amba_rst bit should only be set when
both r5 cpu cores are in reset. Otherwise, if one r5 core is still
running, setting the lpd_amba_rst bit will cause an error for the
running core. The set_r5_reset function has been modified to check
if the other r5 core is still running before setting the lpd_amba_rst
bit.

2. The cpu_disable function was always assuming that the r5 cores
are in split mode when resetting either core 4 or 5. This is
incorrect for lockstep functionality. This patch adds a function
check_r5_mode to handle the cpu_disable function correctly for
the r5 cores by checking the mode and handling the reset appropriately.

Signed-off-by: Neal Frager <neal.frager@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/d99cbd7f2394ac055ef27457298f554ff0747ba7.1651648344.git.michal.simek@amd.com
arch/arm/mach-zynqmp/mp.c