soc/tegra: pmc: Add reboot notifier
authorJon Hunter <jonathanh@nvidia.com>
Tue, 30 Nov 2021 11:44:06 +0000 (11:44 +0000)
committerThierry Reding <treding@nvidia.com>
Thu, 16 Dec 2021 13:03:38 +0000 (14:03 +0100)
commit765d95f8ac54af611c804bb956b79391cfc1d27b
treef9f0e1d385956680d6f2e4fad1dfe5ad8ee5d850
parent66209e6fbd564f1bb3c69248423e4b761904a943
soc/tegra: pmc: Add reboot notifier

The Tegra PMC driver implements a restart handler that supports Tegra
specific reboot commands such as placing the device into 'recovery' mode
in order to reprogram the platform. This is accomplished by setting the
appropriate bit in the PMC scratch0 register prior to rebooting the
platform.

For Tegra platforms that support PSCI or EFI, the default Tegra restart
handler is not called and the PSCI or EFI restart handler is called
instead. Hence, for Tegra platforms that support PSCI or EFI, the Tegra
specific reboot commands do not currently work. Fix this by moving the
code that programs the PMC scratch0 register into a separate reboot
notifier that will always be called on reboot.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
Tested-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/soc/tegra/pmc.c