PM: TI: AM335x: PM STANDBY fixes
Subsystems (8)
cover PM: TI: AM335x: PM STANDBY fixes
This patch series fixes the Power management issues on TI's am335x soc.
on AM335x, the wakeup doesn't work in the case of STANDBY.
1. Since CM3 PM FW [1](ti-v4.1.y) doesn't enable l4ls clockdomain upon wakeup, it fails to wakeup the MPU.
To fix this, don't turn off the l4ls clk domain in the STANDBY transition in MPU.
2. Also Per AM335x TRM [2](section 8.1.4.3 Power mode), in case of STANDBY, PER domain should be ON. So fix PER power domain handling for standby. l4ls is a part of the PER domain.
Since we are not turning off the l4ls clockdomain on STANDBY in MPU, PER power domain would remain ON. But still, explicitly handle this to be in sync with the STANDBY requirement.
3. On am335x evm[1], UART0 - (UART1-HW) has a wakeup capability. Set the wakeup-source property in DT for AM335x.
4. Enable PM configs for AM335x.
[1] https://git.ti.com/cgit/processor-firmware/ti-amx3-cm3-pm-firmware/
[2] https://www.ti.com/lit/ug/spruh73q/spruh73q.pdf
[3] https://www.ti.com/tool/TMDXEVM3358
Test log:
https://gist.github.com/sukrutb/bdbfd1220fe8578a9decf87d0bac6796
Sukrut Bellary (4):
ARM: OMAP2+: Fix l4ls clk domain handling in STANDBY
pmdomain: ti: Fix STANDBY handling of PER power domain
ARM: dts: am335x: Set wakeup-source for UART0
ARM: multi_v7_defconfig: Enable am335x PM configs
arch/arm/boot/dts/ti/omap/am335x-evm.dts | 2 +- arch/arm/configs/multi_v7_defconfig | 5 +++++ arch/arm/mach-omap2/clockdomain.h | 1 + arch/arm/mach-omap2/clockdomains33xx_data.c | 2 +- arch/arm/mach-omap2/cm33xx.c | 14 +++++++++++++- drivers/pmdomain/ti/omap_prm.c | 8 ++++++-- 6 files changed, 27 insertions(+), 5 deletions(-)
Signature · 1 line
2.34.1
PATCH 1/4 ARM: OMAP2+: Fix l4ls clk domain handling in STANDBY
Don't put the l4ls clk domain to sleep in case of standby. Since CM3 PM FW[1](ti-v4.1.y) doesn't wake-up/enable the l4ls clk domain upon wake-up, CM3 PM FW fails to wake-up the MPU.
[1] https://git.ti.com/cgit/processor-firmware/ti-amx3-cm3-pm-firmware/
--- arch/arm/mach-omap2/clockdomain.h | 1 + arch/arm/mach-omap2/clockdomains33xx_data.c | 2 +- arch/arm/mach-omap2/cm33xx.c | 14 +++++++++++++- 3 files changed, 15 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/clockdomain.h +1 -0
@@ -48,6 +48,7 @@#define CLKDM_NO_AUTODEPS (1 << 4)#define CLKDM_ACTIVE_WITH_MPU (1 << 5)#define CLKDM_MISSING_IDLE_REPORTING (1 << 6) +#define CLKDM_STANDBY_FORCE_WAKEUP BIT(7)#define CLKDM_CAN_HWSUP (CLKDM_CAN_ENABLE_AUTO | CLKDM_CAN_DISABLE_AUTO)#define CLKDM_CAN_SWSUP (CLKDM_CAN_FORCE_SLEEP | CLKDM_CAN_FORCE_WAKEUP)
arch/arm/mach-omap2/clockdomains33xx_data.c +1 -1
@@ -19,7 +19,7 @@ static struct clockdomain l4ls_am33xx_clkdm = { .pwrdm = { .name = "per_pwrdm" }, .cm_inst = AM33XX_CM_PER_MOD, .clkdm_offs = AM33XX_CM_PER_L4LS_CLKSTCTRL_OFFSET, - .flags = CLKDM_CAN_SWSUP, + .flags = CLKDM_CAN_SWSUP | CLKDM_STANDBY_FORCE_WAKEUP, };static struct clockdomain l3s_am33xx_clkdm = {
arch/arm/mach-omap2/cm33xx.c +13 -1
@@ -20,6 +20,9 @@#include "cm-regbits-34xx.h" #include "cm-regbits-33xx.h" #include "prm33xx.h" +#if IS_ENABLED (CONFIG_SUSPEND ) +#include <linux/suspend.h> +#endif /* * CLKCTRL_IDLEST_*: possible values for the CM_*_CLKCTRL.IDLEST bitfield:
@@ -328,8 +331,17 @@ static int am33xx_clkdm_clk_disable(struct clockdomain *clkdm) {bool hwsup = false; +#if IS_ENABLED (CONFIG_SUSPEND ) +/* +* In case of standby, Don't put the l4ls clk domain to sleep. +* Since CM3 PM FW doesn't wake-up/enable the l4ls clk domain +* upon wake-up, CM3 PM FW fails to wake-up th MPU. +*/ +if (pm_suspend_target_state ==PM_SUSPEND_STANDBY && + (clkdm->flags &CLKDM_STANDBY_FORCE_WAKEUP )) +return 0 ; +#endif hwsup =am33xx_cm_is_clkdm_in_hwsup (clkdm->cm_inst, clkdm->clkdm_offs); -if (!hwsup && (clkdm->flags &CLKDM_CAN_FORCE_SLEEP ))am33xx_clkdm_sleep (clkdm);
Signature · 1 line
2.34.1
PATCH 2/4 pmdomain: ti: Fix STANDBY handling of PER power domain
In reply to Sukrut BellaryPer AM335x TRM[1](section 8.1.4.3 Power mode), in case of STANDBY, PER domain should be ON. So, fix the PER power domain handling on standby.
[1] https://www.ti.com/lit/ug/spruh73q/spruh73q.pdf
--- drivers/pmdomain/ti/omap_prm.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/pmdomain/ti/omap_prm.c +6 -2
@@ -18,7 +18,9 @@#include <linux/pm_domain.h> #include <linux/reset-controller.h> #include <linux/delay.h> - +#if IS_ENABLED (CONFIG_SUSPEND ) +#include <linux/suspend.h> +#endif #include <linux/platform_data/ti-prm.h> enum omap_prm_domain_mode {
@@ -88,6 +90,7 @@ struct omap_reset_data {#define OMAP_PRM_HAS_RSTST BIT(1)#define OMAP_PRM_HAS_NO_CLKDM BIT(2)#define OMAP_PRM_RET_WHEN_IDLE BIT(3) +#define OMAP_PRM_ON_WHEN_STANDBY BIT(4)#define OMAP_PRM_HAS_RESETS (OMAP_PRM_HAS_RSTCTRL | OMAP_PRM_HAS_RSTST)
@@ -404,7 +407,8 @@ static const struct omap_prm_data am3_prm_data[] = { .name = "per", .base = 0x44e00c00, .pwrstctrl = 0xc, .pwrstst = 0x8, .dmap = &omap_prm_noinact, .rstctrl = 0x0, .rstmap = am3_per_rst_map, - .flags = OMAP_PRM_HAS_RSTCTRL, .clkdm_name = "pruss_ocp" + .flags = OMAP_PRM_HAS_RSTCTRL | OMAP_PRM_ON_WHEN_STANDBY, + .clkdm_name = "pruss_ocp", }, { .name = "wkup", .base = 0x44e00d00,
Signature · 1 line
2.34.1
Re: [PATCH 2/4] pmdomain: ti: Fix STANDBY handling of PER power domain
Quoted 6 lines · Sukrut Bellary
Per AM335x TRM[1](section 8.1.4.3 Power mode), in case of STANDBY, PER domain should be ON. So, fix the PER power domain handling on standby.
[1] https://www.ti.com/lit/ug/spruh73q/spruh73q.pdf
Signed-off-by Sukrut Bellary <[email protected]>
Ulf, this series has been tested now. Go ahead and take this patch.
Thanks,
Kevin
Quoted 39 lines
--- drivers/pmdomain/ti/omap_prm.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)drivers/pmdomain/ti/omap_prm.c +6
-2@@ -18,7 +18,9 @@#include <linux/pm_domain.h> #include <linux/reset-controller.h> #include <linux/delay.h> - +#if IS_ENABLED (CONFIG_SUSPEND ) +#include <linux/suspend.h> +#endif #include <linux/platform_data/ti-prm.h> enum omap_prm_domain_mode {@@ -88,6 +90,7 @@ struct omap_reset_data {#define OMAP_PRM_HAS_RSTST BIT(1)#define OMAP_PRM_HAS_NO_CLKDM BIT(2)#define OMAP_PRM_RET_WHEN_IDLE BIT(3) +#define OMAP_PRM_ON_WHEN_STANDBY BIT(4)#define OMAP_PRM_HAS_RESETS (OMAP_PRM_HAS_RSTCTRL | OMAP_PRM_HAS_RSTST)@@ -404,7 +407,8 @@ static const struct omap_prm_data am3_prm_data[] = { .name = "per", .base = 0x44e00c00, .pwrstctrl = 0xc, .pwrstst = 0x8, .dmap = &omap_prm_noinact, .rstctrl = 0x0, .rstmap = am3_per_rst_map, - .flags = OMAP_PRM_HAS_RSTCTRL, .clkdm_name = "pruss_ocp" + .flags = OMAP_PRM_HAS_RSTCTRL | OMAP_PRM_ON_WHEN_STANDBY, + .clkdm_name = "pruss_ocp", }, { .name = "wkup", .base = 0x44e00d00,Signature · 1 line
2.34.1
Re: [PATCH 2/4] pmdomain: ti: Fix STANDBY handling of PER power domain
In reply to Sukrut BellaryQuoted 7 lines · Sukrut Bellary
Per AM335x TRM[1](section 8.1.4.3 Power mode), in case of STANDBY, PER domain should be ON. So, fix the PER power domain handling on standby.
[1] https://www.ti.com/lit/ug/spruh73q/spruh73q.pdf
Signed-off-by Sukrut Bellary <[email protected]>
Applied for next, thanks!
Kind regards
Uffe
Quoted 40 lines
--- drivers/pmdomain/ti/omap_prm.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)drivers/pmdomain/ti/omap_prm.c +6
-3@@ -18,7 +18,9 @@#include <linux/pm_domain.h> #include <linux/reset-controller.h> #include <linux/delay.h> - +#if IS_ENABLED (CONFIG_SUSPEND ) +#include <linux/suspend.h> +#endif #include <linux/platform_data/ti-prm.h> enum omap_prm_domain_mode {@@ -88,6 +90,7 @@ struct omap_reset_data {#define OMAP_PRM_HAS_RSTST BIT(1)#define OMAP_PRM_HAS_NO_CLKDM BIT(2)#define OMAP_PRM_RET_WHEN_IDLE BIT(3) +#define OMAP_PRM_ON_WHEN_STANDBY BIT(4)#define OMAP_PRM_HAS_RESETS (OMAP_PRM_HAS_RSTCTRL | OMAP_PRM_HAS_RSTST)@@ -404,7 +407,8 @@ static const struct omap_prm_data am3_prm_data[] = { .name = "per", .base = 0x44e00c00, .pwrstctrl = 0xc, .pwrstst = 0x8, .dmap = &omap_prm_noinact, .rstctrl = 0x0, .rstmap = am3_per_rst_map, - .flags = OMAP_PRM_HAS_RSTCTRL, .clkdm_name = "pruss_ocp" + .flags = OMAP_PRM_HAS_RSTCTRL | OMAP_PRM_ON_WHEN_STANDBY, + .clkdm_name = "pruss_ocp", }, { .name = "wkup", .base = 0x44e00d00, --2.34.1
PATCH 3/4 ARM: dts: am335x: Set wakeup-source for UART0
In reply to Sukrut BellaryOn am335x evm[1], UART0(UART1-HW) has a wakeup capability. Set wakeup-source, which will be used in the omap serial driver to enable the device wakeup capability.
[1] https://www.ti.com/tool/TMDXEVM3358
[2] AM335x TRM - https://www.ti.com/lit/ug/spruh73q/spruh73q.pdf
--- arch/arm/boot/dts/ti/omap/am335x-evm.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/ti/omap/am335x-evm.dts +1 -1
@@ -388,7 +388,7 @@ AM33XX_PADCONF(AM335X_PIN_UART0_RTSN, PIN_INPUT_PULLDOWN, MUX_MODE2) /* uart0_rt &uart0 { pinctrl-names = "default"; pinctrl-0 = <&uart0_pins>; - + wakeup-source; status = "okay"; };
Signature · 1 line
2.34.1
PATCH 4/4 ARM: multi_v7_defconfig: Enable am335x PM configs
In reply to Sukrut BellaryEnable Power management related defconfigs for TI AM335x[1].
[1] AM335x TRM - https://www.ti.com/lit/ug/spruh73q/spruh73q.pdf
--- arch/arm/configs/multi_v7_defconfig | 5 +++++ 1 file changed, 5 insertions(+)
arch/arm/configs/multi_v7_defconfig +5 -0
@@ -985,6 +985,7 @@ CONFIG_EDAC=y CONFIG_EDAC_LAYERSCAPE=y CONFIG_EDAC_HIGHBANK_MC=y CONFIG_EDAC_HIGHBANK_L2=y +CONFIG_RTC_DRV_OMAP=y CONFIG_RTC_CLASS=y CONFIG_RTC_DRV_AC100=y CONFIG_RTC_DRV_AS3722=y
@@ -1095,6 +1096,7 @@ CONFIG_TEGRA_IOMMU_SMMU=y CONFIG_EXYNOS_IOMMU=y CONFIG_QCOM_IOMMU=y CONFIG_REMOTEPROC=y +CONFIG_WKUP_M3_RPROC=m CONFIG_OMAP_REMOTEPROC=m CONFIG_OMAP_REMOTEPROC_WATCHDOG=y CONFIG_KEYSTONE_REMOTEPROC=m
@@ -1146,6 +1148,8 @@ CONFIG_ARCH_TEGRA_3x_SOC=y CONFIG_ARCH_TEGRA_114_SOC=y CONFIG_ARCH_TEGRA_124_SOC=y CONFIG_SOC_TI=y +CONFIG_AMX3_PM=m +CONFIG_WKUP_M3_IPC=m CONFIG_KEYSTONE_NAVIGATOR_QMSS=y CONFIG_KEYSTONE_NAVIGATOR_DMA=y CONFIG_RASPBERRYPI_POWER=y
@@ -1162,6 +1166,7 @@ CONFIG_EXTCON_MAX77693=m CONFIG_EXTCON_MAX8997=m CONFIG_EXTCON_USB_GPIO=y CONFIG_TI_AEMIF=y +CONFIG_TI_EMIF_SRAM=m CONFIG_STM32_FMC2_EBI=y CONFIG_EXYNOS5422_DMC=m CONFIG_IIO=y
Signature · 1 line
2.34.1
Re: [PATCH 4/4] ARM: multi_v7_defconfig: Enable am335x PM configs
Quoted 5 lines · Sukrut Bellary
Enable Power management related defconfigs for TI AM335x[1].
[1] AM335x TRM - https://www.ti.com/lit/ug/spruh73q/spruh73q.pdf
Signed-off-by Sukrut Bellary <[email protected]>
Arnd, can you take this via the SoC tree please?
Kevin
Quoted 43 lines
--- arch/arm/configs/multi_v7_defconfig | 5 +++++ 1 file changed, 5 insertions(+)arch/arm/configs/multi_v7_defconfig +5
-0@@ -985,6 +985,7 @@ CONFIG_EDAC=y CONFIG_EDAC_LAYERSCAPE=y CONFIG_EDAC_HIGHBANK_MC=y CONFIG_EDAC_HIGHBANK_L2=y +CONFIG_RTC_DRV_OMAP=y CONFIG_RTC_CLASS=y CONFIG_RTC_DRV_AC100=y CONFIG_RTC_DRV_AS3722=y@@ -1095,6 +1096,7 @@ CONFIG_TEGRA_IOMMU_SMMU=y CONFIG_EXYNOS_IOMMU=y CONFIG_QCOM_IOMMU=y CONFIG_REMOTEPROC=y +CONFIG_WKUP_M3_RPROC=m CONFIG_OMAP_REMOTEPROC=m CONFIG_OMAP_REMOTEPROC_WATCHDOG=y CONFIG_KEYSTONE_REMOTEPROC=m@@ -1146,6 +1148,8 @@ CONFIG_ARCH_TEGRA_3x_SOC=y CONFIG_ARCH_TEGRA_114_SOC=y CONFIG_ARCH_TEGRA_124_SOC=y CONFIG_SOC_TI=y +CONFIG_AMX3_PM=m +CONFIG_WKUP_M3_IPC=m CONFIG_KEYSTONE_NAVIGATOR_QMSS=y CONFIG_KEYSTONE_NAVIGATOR_DMA=y CONFIG_RASPBERRYPI_POWER=y@@ -1162,6 +1166,7 @@ CONFIG_EXTCON_MAX77693=m CONFIG_EXTCON_MAX8997=m CONFIG_EXTCON_USB_GPIO=y CONFIG_TI_AEMIF=y +CONFIG_TI_EMIF_SRAM=m CONFIG_STM32_FMC2_EBI=y CONFIG_EXYNOS5422_DMC=m CONFIG_IIO=ySignature · 1 line
2.34.1
Kevin Hilman
maintainerRe: [PATCH 4/4] ARM: multi_v7_defconfig: Enable am335x PM configs
Hi Arnd,
Quoted 11 lines · Kevin Hilman
Quoted 5 lines · Sukrut Bellary
Enable Power management related defconfigs for TI AM335x[1].
[1] AM335x TRM - https://www.ti.com/lit/ug/spruh73q/spruh73q.pdf
Signed-off-by Sukrut Bellary <[email protected]>Reviewed-by Kevin Hilman <[email protected]>Arnd, can you take this via the SoC tree please?
Looks like this slipped through the cracks for v6.16. Could you apply
this for v6.17 please?
Thanks,
Kevin
Quoted 43 lines
Quoted 43 lines
--- arch/arm/configs/multi_v7_defconfig | 5 +++++ 1 file changed, 5 insertions(+)arch/arm/configs/multi_v7_defconfig +5
-0@@ -985,6 +985,7 @@ CONFIG_EDAC=y CONFIG_EDAC_LAYERSCAPE=y CONFIG_EDAC_HIGHBANK_MC=y CONFIG_EDAC_HIGHBANK_L2=y +CONFIG_RTC_DRV_OMAP=y CONFIG_RTC_CLASS=y CONFIG_RTC_DRV_AC100=y CONFIG_RTC_DRV_AS3722=y@@ -1095,6 +1096,7 @@ CONFIG_TEGRA_IOMMU_SMMU=y CONFIG_EXYNOS_IOMMU=y CONFIG_QCOM_IOMMU=y CONFIG_REMOTEPROC=y +CONFIG_WKUP_M3_RPROC=m CONFIG_OMAP_REMOTEPROC=m CONFIG_OMAP_REMOTEPROC_WATCHDOG=y CONFIG_KEYSTONE_REMOTEPROC=m@@ -1146,6 +1148,8 @@ CONFIG_ARCH_TEGRA_3x_SOC=y CONFIG_ARCH_TEGRA_114_SOC=y CONFIG_ARCH_TEGRA_124_SOC=y CONFIG_SOC_TI=y +CONFIG_AMX3_PM=m +CONFIG_WKUP_M3_IPC=m CONFIG_KEYSTONE_NAVIGATOR_QMSS=y CONFIG_KEYSTONE_NAVIGATOR_DMA=y CONFIG_RASPBERRYPI_POWER=y@@ -1162,6 +1166,7 @@ CONFIG_EXTCON_MAX77693=m CONFIG_EXTCON_MAX8997=m CONFIG_EXTCON_USB_GPIO=y CONFIG_TI_AEMIF=y +CONFIG_TI_EMIF_SRAM=m CONFIG_STM32_FMC2_EBI=y CONFIG_EXYNOS5422_DMC=m CONFIG_IIO=ySignature · 1 line
2.34.1
Kevin Hilman
maintainerQuoted 3 lines · Sukrut Bellary
This patch series fixes the Power management issues on TI's am335x soc.
on AM335x, the wakeup doesn't work in the case of STANDBY.
This series is specifically targetted at the AM335x EVM (which I don't have to test), so I'd appreciate getting any test reports for this before I queue it up.
For AM335x, I currently only have the ICEv2 and Beaglebone Black, neithor of which support suspend resume with RTC wake AFAICT. If they do, please enlighten me. :)
I was able to do a basic boot test on the 2 boards I have with this series applied on top of v6.15-rc1 and basic boot still works, but I was not able to test the PM path that's being changed here, so any tests on AM3 platforms that actually use this path are appreciated.
Kevin
Quoted 15 lines · Kevin Hilman
Quoted 3 lines · Sukrut Bellary
This patch series fixes the Power management issues on TI's am335x soc.
on AM335x, the wakeup doesn't work in the case of STANDBY.
This series is specifically targetted at the AM335x EVM (which I don't have to test), so I'd appreciate getting any test reports for this before I queue it up.
For AM335x, I currently only have the ICEv2 and Beaglebone Black, neithor of which support suspend resume with RTC wake AFAICT. If they do, please enlighten me. :)
Quoted 6 lines
I was able to do a basic boot test on the 2 boards I have with this series applied on top of v6.15-rc1 and basic boot still works, but I was not able to test the PM path that's being changed here, so any tests on AM3 platforms that actually use this path are appreciated.
Kevin
Is the pmdomain patch(3) ready to be applied here? Please let me know if you want me to pick it up.
Kind regards
Uffe
Kevin Hilman
maintainerQuoted 21 lines · Ulf Hansson
Quoted 20 lines · Kevin Hilman
Quoted 3 lines · Sukrut Bellary
This patch series fixes the Power management issues on TI's am335x soc.
on AM335x, the wakeup doesn't work in the case of STANDBY.
This series is specifically targetted at the AM335x EVM (which I don't have to test), so I'd appreciate getting any test reports for this before I queue it up.
For AM335x, I currently only have the ICEv2 and Beaglebone Black, neithor of which support suspend resume with RTC wake AFAICT. If they do, please enlighten me. :)
I was able to do a basic boot test on the 2 boards I have with this series applied on top of v6.15-rc1 and basic boot still works, but I was not able to test the PM path that's being changed here, so any tests on AM3 platforms that actually use this path are appreciated.
Quoted 4 lines
Quoted 1 line
Kevin
Is the pmdomain patch(3) ready to be applied here? Please let me know if you want me to pick it up.
Not yet, I have some concerns so I'd like to see more testing on the actual hardware, which I don't have (yet, but it's on the way).
Kevin
Hello Sukrut, Keven, Ulf,
Quoted 20 lines · Sukrut Bellary
This patch series fixes the Power management issues on TI's am335x soc.
on AM335x, the wakeup doesn't work in the case of STANDBY.
1. Since CM3 PM FW [1](ti-v4.1.y) doesn't enable l4ls clockdomain upon wakeup, it fails to wakeup the MPU.
To fix this, don't turn off the l4ls clk domain in the STANDBY transition in MPU.2. Also Per AM335x TRM [2](section 8.1.4.3 Power mode), in case of STANDBY, PER domain should be ON. So fix PER power domain handling for standby. l4ls is a part of the PER domain.
Since we are not turning off the l4ls clockdomain on STANDBY in MPU, PER power domain would remain ON. But still, explicitly handle this to be in sync with the STANDBY requirement.
3. On am335x evm[1], UART0 - (UART1-HW) has a wakeup capability. Set the wakeup-source property in DT for AM335x.
Quoted 9 lines
4. Enable PM configs for AM335x.
[1] https://git.ti.com/cgit/processor-firmware/ti-amx3-cm3-pm-firmware/
[2] https://www.ti.com/lit/ug/spruh73q/spruh73q.pdf
[3] https://www.ti.com/tool/TMDXEVM3358Test log:
https://gist.github.com/sukrutb/bdbfd1220fe8578a9decf87d0bac6796
Thanks for the patches, Sukrut.
I was able to test this series on am335x EVM, baseline being rc5 next
branch: https://gist.github.com/jmenti/cda1675b5fc5844b6f065376e98026f5
regards,
~ Judith