aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/power/reset/at91-sama5d2_shdwc.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-09-16power: reset: at91-poweroff: do not procede if at91_shdwc is allocatedClaudiu Beznea1-0/+3
There should be only one instance of struct shdwc in the system. This is referenced through at91_shdwc. Return in probe if at91_shdwc is already allocated. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2018-09-16power: reset: at91-poweroff: rename at91_shdwc_base member of struct shdwcClaudiu Beznea1-10/+10
Rename at91_shdwc_base member of struct shdwc to shdwc_base. There is already an "at91" string in at91_shdwc object. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2018-09-16power: reset: at91-poweroff: make sclk part of struct shdwcClaudiu Beznea1-7/+7
Make sclk part of struct shdwc to have all the data specific to SHDWC grouped together in one structure. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2018-09-16power: reset: at91-poweroff: make mpddrc_base part of struct shdwcClaudiu Beznea1-9/+10
Make mpddrc_base part of struct shdwc since there is also only one instance of struct shdwc *at91_shdwc in system and to have all data specific to SHDWC grouped together. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2018-09-16power: reset: at91-poweroff: use only one poweroff functionClaudiu Beznea1-21/+8
Use only one poweroff function for sama5d2 and adapt it to work for both scenarios (having LPDDR or not). Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2018-09-16power: reset: at91-poweroff: switch to slow clock before shutdownClaudiu Beznea1-8/+58
The SAMA5D2 NRST input signal is resynchronized with the SLCK clock and it can take up to 2 SLCK cycles (about 90us) for the internal reset to be effective. During this delay, the VDDCORE current consumption may still be high (application-dependent) with the VDDCORE regulator already OFF. Under such conditions, VDDCORE may operate below its operating range leading to potential register corruption. To prevent such situation, it is recommended to decrease significantly the power consumption of the device once the voltage regulator is turned-off. This can be achieved by operating the device at a much lower low frequency. To solve this switch the master clock to slock clock just before writing shutdown command to shutdown controller. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Suggested-by: Patrice Vilchez <patrice.vilchez@microchip.com> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2018-01-08power: reset: account for const type of of_device_id.dataJulia Lawall1-2/+2
This driver creates a const structure that it stores in the data field of an of_device_id array. Add const to the declaration of the location that receives a value from the data field to ensure that the compiler will continue to check that the value is not modified and remove the const-dropping cast on the access to the data field. Done using Coccinelle. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2017-07-24power: reset: Convert to using %pOF instead of full_nameRob Herring1-2/+2
Now that we have a custom printf format specifier, convert users of full_name to use %pOF instead. This is preparation to remove storing of the full path string for each node. Signed-off-by: Rob Herring <robh@kernel.org> Cc: Nicolas Ferre <nicolas.ferre@microchip.com> Cc: Sebastian Reichel <sre@kernel.org> Cc: linux-pm@vger.kernel.org Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2017-06-08power: reset: at91-sama5d2_shdwc: fix clobber listAlexandre Belloni1-1/+1
Assembly in at91_lpddr_poweroff has r0 in the clobber list but uses r6. Reported-by: Ben Hutchings <ben.hutchings@codethink.co.uk> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2017-01-16power: reset: at91-poweroff: timely shutdown LPDDR memoriesAlexandre Belloni1-1/+48
LPDDR memories can only handle up to 400 uncontrolled power off. Ensure the proper power off sequence is used before shutting down the platform. Cc: <stable@vger.kernel.org> # 4.4+ Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-04-10power: reset: at91-shdwc: add new shutdown controller driverNicolas Ferre1-0/+282
Sama5d2 SoC has a completely new shutdown controller with new features and register layout. It thus makes sense to add a new driver for this new peripheral. This driver is Device Tree only and handles events from the wake-up pin and the RTC. As the register layout may change in the future, so some values are encoded in a configuration structure. Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>