aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-at91/pm.c
AgeCommit message (Collapse)AuthorFilesLines
2020-08-17ARM: at91: pm: remove unnecessary at91sam9x60_idleAlexandre Belloni1-6/+1
cpu_do_idle() is already the default action for arm_pm_idle, there is no need to open code it. Signed-off-by: Alexandre Belloni <[email protected]> Reviewed-by: Claudiu Beznea <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-08-17ARM: at91: pm: of_node_put() after its usageClaudiu Beznea1-0/+1
Put node after it has been used. Fixes: 13f16017d3e3f ("ARM: at91: pm: Tie the USB clock mask to the pmc") Signed-off-by: Claudiu Beznea <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-08-17ARM: at91: pm: add per soc validation of pm modesClaudiu Beznea1-1/+79
Not all SoCs supports all the PM mode. User may end up settings, e.g. backup mode, on a non SAMA5D2 device, but the mode to not be valid. If backup mode is used on a devices not supporting it there will be no way of resuming other than rebooting. Signed-off-by: Claudiu Beznea <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-08-17ARM: at91: pm: add support for ULP0 fast wakeupClaudiu Beznea1-4/+5
ULP0 fast improves suspend/resume time with few milliseconds the drawback being the power consumption. The mean values measured for suspend/resume time are as follows (measured on SAMA5D2 Xplained board), ULP0 compared with fast ULP0: - ulp0 fast: suspend time: 169 ms, resume time: 216 ms - ulp0 : suspend time: 197 ms, resume time: 258 ms Current consumption while suspended (measured on SAMA5D2 Xplained board): - ulp0 fast: 730uA - ulp0 : 270uA Signed-off-by: Claudiu Beznea <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-07-18ARM: at91: pm: add missing put_device() call in at91_pm_sram_init()yu kuai1-3/+8
if of_find_device_by_node() succeed, at91_pm_sram_init() doesn't have a corresponding put_device(). Thus add a jump target to fix the exception handling for this function implementation. Fixes: d2e467905596 ("ARM: at91: pm: use the mmio-sram pool to access SRAM") Signed-off-by: yu kuai <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-02-18ARM: at91: pm: add pmc_version member to at91_pm_dataClaudiu Beznea1-0/+7
This will be used to differentiate b/w different PLLs settings to be applied in the final/first steps of the suspend/resume process by doing PLL specific configurations. Signed-off-by: Claudiu Beznea <[email protected]> Acked-by: Stephen Boyd <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-02-18ARM: at91: pm: use proper master clock register offsetClaudiu Beznea1-5/+23
SAM9X60's PMC has different master clock register offset than the other SoCs' PMC. Due to this, specify master clock register offset based on PMC compatible and pass it to pm_suspend.S since it is also needed in there. When PM part for SAM9X60 was published the SAM9X60's PMC (commit f6deae46039c ("clk: at91: add sam9x60 pmc driver")) wasn't integrated. Fixes: 01c7031cfa73 ("ARM: at91: pm: initial PM support for SAM9X60") Signed-off-by: Claudiu Beznea <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-10ARM: at91: pm: use of_device_id array to find the proper shdwc nodeClaudiu Beznea1-1/+7
Use of_device_id array to find the proper shdwc compatibile node. SAM9X60's shdwc changes were not integrated when commit eaedc0d379da ("ARM: at91: pm: add ULP1 support for SAM9X60") was integrated. Fixes: eaedc0d379da ("ARM: at91: pm: add ULP1 support for SAM9X60") Signed-off-by: Claudiu Beznea <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2020-01-10ARM: at91: pm: use SAM9X60 PMC's compatibleClaudiu Beznea1-0/+1
SAM9X60 PMC's has a different PMC. It was not integrated at the moment commit 01c7031cfa73 ("ARM: at91: pm: initial PM support for SAM9X60") was published. Fixes: 01c7031cfa73 ("ARM: at91: pm: initial PM support for SAM9X60") Signed-off-by: Claudiu Beznea <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2019-12-10ARM: at91: pm: move SAM9X60's PM under its own SoC config flagClaudiu Beznea1-1/+1
Move SAM9X60's PM part under SoC config flag. This allows the building of SAM9X60 platform withouth depending on CONFIG_SOC_AT91SAM9 flag, allowing us to select only necessary config flags for SAM9X60. Signed-off-by: Claudiu Beznea <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2019-06-25Merge tag 'at91-5.3-soc' of ↵Olof Johansson1-0/+1
git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into arm/soc AT91 SoC for 5.3 - fix a pm.c warning with W=1 * tag 'at91-5.3-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux: arm: add missing include platform-data/atmel.h Signed-off-by: Olof Johansson <[email protected]>
2019-06-20arm: add missing include platform-data/atmel.hPhilippe Mazenauer1-0/+1
Include corresponding headerfile <linux/platform-data/atmel.h> for function at91_suspend_entering_slow_clock(). ../arch/arm/mach-at91/pm.c:279:5: warning: no previous prototype for ‘at91_suspend_entering_slow_clock’ [-Wmissing-prototypes] int at91_suspend_entering_slow_clock(void) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Philippe Mazenauer <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2019-05-30treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152Thomas Gleixner1-5/+1
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 3029 file(s). Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Allison Randal <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-05-16Merge tag 'at91-5.2-soc' of ↵Olof Johansson1-60/+133
git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into arm/late AT91 SoC for 5.2 - PM changes for SAM9X60 * tag 'at91-5.2-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux: ARM: at91: pm: do not disable/enable PLLA for ULP modes ARM: at91: pm: disable RC oscillator in ULP0 ARM: at91: pm: add ULP1 support for SAM9X60 ARM: at91: pm: add support for per SoC wakeup source configuration ARM: at91: pm: keep at91_pm_backup_init() only for SAMA5D2 SoCs ARM: at91: pm: initial PM support for SAM9X60 dt-bindings: arm: atmel: add binding for SAM9X60 SoC ARM: at91: pm: introduce at91_soc_pm structure Signed-off-by: Olof Johansson <[email protected]>
2019-04-04arm/mach-at91/pm : fix possible object reference leakPeng Hao1-2/+4
of_find_device_by_node() takes a reference to the struct device when it finds a match via get_device. When returning error we should call put_device. Reviewed-by: Mukesh Ojha <[email protected]> Signed-off-by: Peng Hao <[email protected]> Signed-off-by: Ludovic Desroches <[email protected]>
2019-03-28ARM: at91: pm: add ULP1 support for SAM9X60Claudiu Beznea1-0/+24
Add ULP1 support for SAM9X60. In pm_suspend.S enable RC oscillator in PMC if it is not enabled. At resume the state before suspend is restored. Signed-off-by: Claudiu Beznea <[email protected]> Acked-by: Stephen Boyd <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]> Signed-off-by: Ludovic Desroches <[email protected]>
2019-03-28ARM: at91: pm: add support for per SoC wakeup source configurationClaudiu Beznea1-8/+34
Add support for per SoC wakeup source configuration. In this way we could have per SoC wakeup sources, shutdown controller and power management controller configurations for ULP1 power management mode. Signed-off-by: Claudiu Beznea <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]> Signed-off-by: Ludovic Desroches <[email protected]>
2019-03-28ARM: at91: pm: keep at91_pm_backup_init() only for SAMA5D2 SoCsClaudiu Beznea1-0/+3
In at91_pm_backup_init() return if it is not about SAMA5D2 SoCs. Signed-off-by: Claudiu Beznea <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]> Signed-off-by: Ludovic Desroches <[email protected]>
2019-03-28ARM: at91: pm: initial PM support for SAM9X60Claudiu Beznea1-0/+14
Add initial PM support for SAM9X60. This include idle, WFI and ULP0. Signed-off-by: Claudiu Beznea <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]> Signed-off-by: Ludovic Desroches <[email protected]>
2019-03-28ARM: at91: pm: introduce at91_soc_pm structureClaudiu Beznea1-56/+62
To have per SoC PM information add a new structure which embed a member of type struct at91_pm_data. This will allow easy addition of new information without contaminate struct at91_pm_data that is passed to the last phase suspend function (at91_suspend_sram_fn). Signed-off-by: Claudiu Beznea <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]> Signed-off-by: Ludovic Desroches <[email protected]>
2018-09-25ARM: at91: pm: call put_device instead of of_node_put in at91_pm_config_wszhong jiang1-3/+3
of_find_device_by_node takes a reference to the struct device when it finds a match via get_device. but it fails to put_device in at91_pm_config_ws, for_each_matching_node_and_match will get and put the node properly, there is no need to call the of_put_node. Therefore, just call put_device instead of of_node_put in at91_pm_config_ws. Fixes: d7484f5c6b3b ("ARM: at91: pm: configure wakeup sources for ULP1 mode") Suggested-by: Claudiu Beznea <[email protected]> Signed-off-by: zhong jiang <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2018-08-27ARM: at91: pm: remove pm_bu initialization in at91_pm_backup_init()Claudiu Beznea1-3/+0
There is no need to initialize pm_bu since it is used only if backup mode is selected. In case backup mode initialization fails (which means pm_bu is invalid) the ULP0 mode will be selected. Signed-off-by: Claudiu Beznea <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2018-08-23Merge tag 'armsoc-dt' of ↵Linus Torvalds1-0/+5
git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc Pull ARM device-tree updates from Olof Johansson: "Business as usual -- the bulk of our changes are to devicetree files with new hardware support, new SoCs and platforms, and new board types. New SoCs/platforms: - Raspberry Pi Compute Module (CM1) and IO board - i.MX6SSL from NXP - Renesas RZ/N1D SoC (R9A06G032), Dual Cortex-A7 with Ethernet, CAN and PLC interfaces - TI AM654 SoC, Quad Cortex-A53, safety subsystem with Cortex-R5 controllers, communication and PRU subsystem and lots of other interfaces (PCIe, USB3, etc). New boards and systems: - Several Atmel at91-based boards from Laird - Marvell Armada388-based Helios4 board from SolidRun - Samsung Aires-based phones (s5pv210) - Allwinner A64-based Pinebook laptop In addition to the above, there's the usual amount of new devices described on existing platforms, fixes and tweaks and new minor variants of boards/platforms" * tag 'armsoc-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (478 commits) arm64: dts: sdm845: Add tsens nodes arm64: dts: msm8996: thermal: Initialise via DT and add second controller arm64: dts: sprd: Add one suspend timer arm64: dts: sprd: Add SC27XX ADC device arm64: dts: sprd: Add SC27XX eFuse device arm64: dts: sprd: Add SC27XX vibrator device arm64: dts: sprd: Add SC27XX breathing light controller device arm64: dts: meson-axg: add spdif-dit codec arm64: dts: meson-axg: add lineout codec arm64: dts: meson-axg: add linein codec arm64: dts: meson-axg: add tdm interfaces arm64: dts: meson-axg: add tdmout formatters arm64: dts: meson-axg: add tdmin formatters arm64: dts: meson-axg: add spdifout arm64: dts: rockchip: add led support for Firefly-RK3399 arm64: dts: rockchip: remove deprecated Type-C PHY properties on rk3399 arm64: dts: rockchip: add power button support for Firefly-RK3399 ARM: dts: aspeed: Add coprocessor interrupt controller arm64: dts: meson-axg: add audio arb reset controller arm64: dts: meson-axg: add usb power regulator ...
2018-07-17ARM: at91: pm: configure wakeup sources for ULP1 modeClaudiu Beznea1-22/+146
Since for ULP1 PM mode of SAMA5D2 the wakeup sources are limited and well known add a method to check if these wakeup sources are defined by user (either via DT or filesystem). In case there are no wakeup sources defined for ULP1 the PM suspend will fail, otherwise these will be configured in fast startup registers of PMC. Since wakeup sources of ULP1 need also to be configured in SHDWC registers the code was a bit changed to map the SHDWC also in case ULP1 is requested by user (this was done in the initialization phase). In case the ULP1 initialization fails the ULP0 mode is used (this mode was also used in case backup mode initialization failed). Signed-off-by: Claudiu Beznea <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2018-07-17ARM: at91: pm: Add ULP1 mode supportWenyou Yang1-0/+1
In the ULP1 mode, in order to achieve the lowest power consumption with the system in retention mode and be able to resume on the wake up events, all the clocks are shut off, inclusive the embedded 12MHz RC oscillator, and the number of wake up sources is limited as well. When the wake up event is asserted, the embedded 12MHz RC oscillator restarts automatically. The ULP1 (Ultra Low-power mode 1) is introduced by SAMA5D2. The previous size of pm_suspend.o was 2148 bytes. With the addition of ULP1 mode the new size of pm_suspend.o raised at 2456 bytes. Signed-off-by: Wenyou Yang <[email protected]> Signed-off-by: Ludovic Desroches <[email protected]> [[email protected]: aligned with 4.18-rc1] Signed-off-by: Claudiu Beznea <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2018-07-17ARM: at91: pm: Use ULP0 naming instead of slow clockClaudiu Beznea1-9/+9
Switch to use ULP0 naming instead of slow clock naming for power modes, to be as closed as possible to datasheet. This commit does the necessary renaming and macro addition to be as close as possible to the namings from [1]. [1] https://lore.kernel.org/lkml/[email protected] Signed-off-by: Claudiu Beznea <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2018-06-20ARM: at91: fix USB clock detection handlingAlexandre Belloni1-0/+5
Add more compatibles to be able to correct the USB clock detection. at91sam9261 and at91sam9263 have the same PMC_SCSR layout as at91sam9260. at91sam9rl doesn't have any USB clock. Acked-by: Nicolas Ferre <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2017-09-18ARM: at91: Replace uses of virt_to_phys with __pa_symbolAlexandre Belloni1-2/+2
The PM code wrongly uses virt_to_phys() instead of __pa_symbol() and was not updated by commit 64fc2a947a98 ("ARM: 8641/1: treewide: Replace uses of virt_to_phys with __pa_symbol") because it was not yet in tree. Signed-off-by: Alexandre Belloni <[email protected]> Signed-off-by: Nicolas Ferre <[email protected]>
2017-08-23ARM: at91: don't select CONFIG_ARM_CPU_SUSPEND for old platformsArnd Bergmann1-0/+12
My previous patch fixed a link error for all at91 platforms when CONFIG_ARM_CPU_SUSPEND was not set, however this caused another problem on a configuration that enabled CONFIG_ARCH_AT91 but none of the individual SoCs, and that also enabled CPU_ARM720 as the only CPU: warning: (ARCH_AT91 && SOC_IMX23 && SOC_IMX28 && ARCH_PXA && MACH_MVEBU_V7 && SOC_IMX6 && ARCH_OMAP3 && ARCH_OMAP4 && SOC_OMAP5 && SOC_AM33XX && SOC_DRA7XX && ARCH_EXYNOS3 && ARCH_EXYNOS4 && EXYNOS5420_MCPM && EXYNOS_CPU_SUSPEND && ARCH_VEXPRESS_TC2_PM && ARM_BIG_LITTLE_CPUIDLE && ARM_HIGHBANK_CPUIDLE && QCOM_PM) selects ARM_CPU_SUSPEND which has unmet direct dependencies (ARCH_SUSPEND_POSSIBLE) arch/arm/kernel/sleep.o: In function `cpu_resume': (.text+0xf0): undefined reference to `cpu_arm720_suspend_size' arch/arm/kernel/suspend.o: In function `__cpu_suspend_save': suspend.c:(.text+0x134): undefined reference to `cpu_arm720_do_suspend' This improves the hack some more by only selecting ARM_CPU_SUSPEND for the part that requires it, and changing pm.c to drop the contents of unused init functions so we no longer refer to cpu_resume on at91 platforms that don't need it. Fixes: cc7a938f5f30 ("ARM: at91: select CONFIG_ARM_CPU_SUSPEND") Acked-by: Alexandre Belloni <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]>
2017-06-18Merge tag 'at91-ab-4.13-soc' of ↵Olof Johansson1-28/+178
git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux into next/soc SoC for 4.13: - New suspend/resume mode for sama5d2 - Initial support for armv7m based SoCs * tag 'at91-ab-4.13-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: ARM: at91: remove atmel_nand_data ARM: at91: fix at91_suspend_entering_slow_clock link error ARM: at91: debug: add samv7x support ARM: at91: add armv7m SoC detection ARM: at91: handle CONFIG_PM for armv7m configurations ARM: at91: Add armv7m support ARM: at91: Document armv7m compatibles ARM: at91: Documentation: add armv7m families ARM: at91: pm: fallback to slowclock when backup mode fails ARM: at91: pm: allow selecting standby and suspend modes ARM: at91: pm: Add sama5d2 backup mode Signed-off-by: Olof Johansson <[email protected]>
2017-05-19ARM: remove duplicate 'const' annotations'Arnd Bergmann1-1/+1
gcc-7 warns about some declarations that are more 'const' than necessary: arch/arm/mach-at91/pm.c:338:34: error: duplicate 'const' declaration specifier [-Werror=duplicate-decl-specifier] static const struct of_device_id const ramc_ids[] __initconst = { arch/arm/mach-bcm/bcm_kona_smc.c:36:34: error: duplicate 'const' declaration specifier [-Werror=duplicate-decl-specifier] static const struct of_device_id const bcm_kona_smc_ids[] __initconst = { arch/arm/mach-spear/time.c:207:34: error: duplicate 'const' declaration specifier [-Werror=duplicate-decl-specifier] static const struct of_device_id const timer_of_match[] __initconst = { arch/arm/mach-omap2/prm_common.c:714:34: error: duplicate 'const' declaration specifier [-Werror=duplicate-decl-specifier] static const struct of_device_id const omap_prcm_dt_match_table[] __initconst = { arch/arm/mach-omap2/vc.c:562:35: error: duplicate 'const' declaration specifier [-Werror=duplicate-decl-specifier] static const struct i2c_init_data const omap4_i2c_timing_data[] __initconst = { The ones in arch/arm were apparently all introduced accidentally by one commit that correctly marked a lot of variables as __initconst. Fixes: 19c233b79d1a ("ARM: appropriate __init annotation for const data") Acked-by: Alexandre Belloni <[email protected]> Acked-by: Tony Lindgren <[email protected]> Acked-by: Nicolas Pitre <[email protected]> Acked-by: Florian Fainelli <[email protected]> Acked-by: Viresh Kumar <[email protected]> Acked-by: Krzysztof Hałasa <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]>
2017-05-15ARM: at91: pm: fallback to slowclock when backup mode failsAlexandre Belloni1-0/+5
If the backup sram allocation fails, ensure we can suspend by falling back to the usual slow clock mode. Signed-off-by: Alexandre Belloni <[email protected]> Acked-by: Wenyou Yang <[email protected]>
2017-05-15ARM: at91: pm: allow selecting standby and suspend modesAlexandre Belloni1-34/+76
While we can only select between "standby" and "mem" states for power management, the atmel platforms can actually support more modes. For both standby and mem, allow selecting which mode will be used using the atmel.pm_modes kernel parameter. By default, keep the current modes. Signed-off-by: Alexandre Belloni <[email protected]> Acked-by: Wenyou Yang <[email protected]>
2017-05-15ARM: at91: pm: Add sama5d2 backup modeAlexandre Belloni1-3/+106
The sama5d2 has a mode were it is possible to cut power to the SoC while keeping the RAM in self refresh. Resuming from that mode needs support in the firmware/bootloader. Signed-off-by: Alexandre Belloni <[email protected]> Acked-by: Wenyou Yang <[email protected]>
2017-03-31ARM: at91: pm: Remove at91_pm_set_standbyAlexandre Belloni1-8/+2
Merge at91_pm_set_standby() in at91_dt_ramc as this is the only callsite. That moves it to the init section. Acked-by: Wenyou Yang <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2017-03-31ARM: at91: pm: Merge all at91sam9*_pm_initAlexandre Belloni1-13/+1
The PM initialization is now identical for all at91sam9. Merge the functions. Acked-by: Wenyou Yang <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2017-03-31ARM: at91: pm: Tie the USB clock mask to the pmcAlexandre Belloni1-14/+23
The USB clocks mask (uhp_udp_mask) depends on the pmc. Tie it to the pmc id instead of the SoC. Acked-by: Wenyou Yang <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2017-03-31ARM: at91: pm: Tie the memory controller type to the ramc idAlexandre Belloni1-10/+20
Instead of relying on the SoC type to select the memory controller type, use the device tree ids as they are parsed anyway. Acked-by: Wenyou Yang <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2017-03-31ARM: at91: pm: Workaround DDRSDRC self-refresh bug with LPDDR1 memories.Alexandre Belloni1-1/+19
As already explained for pm_suspend.S, the DDRSDR controller fails to put LPDDR1 memories in self-refresh. Force the controller to think it has DDR2 memories during the self-refresh period, as the DDR2 self-refresh spec is equivalent to LPDDR1, and is correctly implemented in the controller. Acked-by: Wenyou Yang <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2017-03-31ARM: at91: pm: Simplify at91rm9200_standbyAlexandre Belloni1-8/+3
Since 2008, AT91_MC_SDRAMC_LPR is set to 0 at kernel initialization. There is no use saving, changing and restoring it. Acked-by: Wenyou Yang <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2017-03-31ARM: at91: pm: Use struct at91_pm_data in pm_suspend.SAlexandre Belloni1-45/+33
The number of register we can safely pass to at91_pm_suspend_in_sram is limited. Instead, pass the address to the at91_pm_data structure. The offsets are automatically generated to avoid hardcoding them. Acked-by: Wenyou Yang <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2017-03-31ARM: at91: pm: Move global variables into at91_pm_dataAlexandre Belloni1-23/+21
Instead of having separate global variables to hold IP addresses, move them to struct at91_pm_data. Acked-by: Wenyou Yang <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2017-03-31ARM: at91: pm: Move at91_ramc_read/write to pm.cAlexandre Belloni1-0/+6
Those macros are only used in pm.c, move them there so we can remove the test on __ASSEMBLY__. Acked-by: Wenyou Yang <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2017-03-31ARM: at91: pm: Cleanup headersAlexandre Belloni1-16/+5
Remove unnecessary header inclusions and reorder the remaining ones. Acked-by: Wenyou Yang <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2017-03-14ARM: at91: pm: cpu_idle: switch DDR to power-down modeNicolas Ferre1-1/+17
On some DDR controllers, compatible with the sama5d3 one, the sequence to enter/exit/re-enter the self-refresh mode adds more constrains than what is currently written in the at91_idle driver. An actual access to the DDR chip is needed between exit and re-enter of this mode which is somehow difficult to implement. This sequence can completely hang the SoC. It is particularly experienced on parts which embed a L2 cache if the code run between IDLE calls fits in it... Moreover, as the intention is to enter and exit pretty rapidly from IDLE, the power-down mode is a good candidate. So now we use power-down instead of self-refresh. As we can simplify the code for sama5d3 compatible DDR controllers, we instantiate a new sama5d3_ddr_standby() function. Signed-off-by: Nicolas Ferre <[email protected]> Cc: <[email protected]> # v4.1+ Fixes: 017b5522d5e3 ("ARM: at91: Add new binding for sama5d3-ddramc") Signed-off-by: Alexandre Belloni <[email protected]>
2017-01-11ARM: at91: pm: remove useless extern definitionAlexandre Belloni1-1/+1
at91_ramc_base is local to pm.c, remove its definition in pm.h Signed-off-by: Alexandre Belloni <[email protected]>
2016-06-21ARM: at91: fix warnings in pm.cBen Dooks1-2/+3
Fix a pair of missing statics on un-exported functions and include <linux/platform_data/atmel.h> to provide the declaration of at91_suspend_entering_slow_clock() to fix the following sparse warnings: arch/arm/mach-at91/pm.c:127:5: warning: symbol 'at91_suspend_entering_slow_clock' was not declared. Should it be static? arch/arm/mach-at91/pm.c:358:6: warning: symbol 'at91rm9200_idle' was not declared. Should it be static? arch/arm/mach-at91/pm.c:367:6: warning: symbol 'at91sam9_idle' was not declared. Should it be static? Signed-off-by: Ben Dooks <[email protected]> Acked-by: Nicolas Ferre <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2016-02-17ARM: at91: pm: move idle functions to pm.cAlexandre Belloni1-5/+32
Avoid using code from clk/at91 for PM. This also has the bonus effect of setting arm_pm_idle for sama5 platforms. Signed-off-by: Alexandre Belloni <[email protected]> Acked-by: Boris Brezillon <[email protected]>
2016-02-17ARM: at91: pm: find and remap the pmcAlexandre Belloni1-6/+27
To avoid relying on at91_pmc_read(), find the pmc node and remap it locally. Signed-off-by: Alexandre Belloni <[email protected]> Acked-by: Boris Brezillon <[email protected]>
2016-02-17ARM: at91: pm: simply call at91_pm_initAlexandre Belloni1-3/+3
at91_pm_init() doesn't return a value, as is the case for its callers, simply call it instead of returning its non-existent return value. Signed-off-by: Alexandre Belloni <[email protected]> Acked-by: Boris Brezillon <[email protected]>