* [PATCH 0/3] ARM: at91: enhance PM routines
@ 2025-08-27 14:54 nicolas.ferre
2025-08-27 14:54 ` [PATCH 1/3] ARM: at91: pm: fix .uhp_udp_mask specification for current SoCs nicolas.ferre
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: nicolas.ferre @ 2025-08-27 14:54 UTC (permalink / raw)
To: ARM Maintainers, Alexandre Belloni, Ryan Wanner,
Varshini Rajendran, Claudiu Beznea
Cc: linux-kernel, linux-arm-kernel, Nicolas Ferre
From: Nicolas Ferre <nicolas.ferre@microchip.com>
Low priority fixes to the PM code, in relation to recent addition of sam9x75 or
sama7d65 SoCs.
Nicolas Ferre (3):
ARM: at91: pm: fix .uhp_udp_mask specification for current SoCs
ARM: at91: pm: fix MCKx restore routine
ARM: at91: pm: save and restore ACR during PLL disable/enable
arch/arm/mach-at91/pm.c | 2 +-
arch/arm/mach-at91/pm_suspend.S | 12 +++++++++---
2 files changed, 10 insertions(+), 4 deletions(-)
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/3] ARM: at91: pm: fix .uhp_udp_mask specification for current SoCs
2025-08-27 14:54 [PATCH 0/3] ARM: at91: enhance PM routines nicolas.ferre
@ 2025-08-27 14:54 ` nicolas.ferre
2025-08-27 14:54 ` [PATCH 2/3] ARM: at91: pm: fix MCKx restore routine nicolas.ferre
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: nicolas.ferre @ 2025-08-27 14:54 UTC (permalink / raw)
To: ARM Maintainers, Alexandre Belloni, Ryan Wanner,
Varshini Rajendran, Claudiu Beznea
Cc: linux-kernel, linux-arm-kernel, Nicolas Ferre
From: Nicolas Ferre <nicolas.ferre@microchip.com>
All SoCs using this structure field .uhp_udp_mask in configuration
index 4 don't have the bit 7 specified: sam9x60 nor sam9x75.
Remove this bit from the mask definition to match register layout.
This mask is used in function at91_pm_verify_clocks().
Signed-off-by: Nicolas Ferre <nicolas.ferre@microchip.com>
---
arch/arm/mach-at91/pm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
index 3aa20038ad93..35058b99069c 100644
--- a/arch/arm/mach-at91/pm.c
+++ b/arch/arm/mach-at91/pm.c
@@ -1364,7 +1364,7 @@ static const struct pmc_info pmc_infos[] __initconst = {
.version = AT91_PMC_V1,
},
{
- .uhp_udp_mask = AT91SAM926x_PMC_UHP | AT91SAM926x_PMC_UDP,
+ .uhp_udp_mask = AT91SAM926x_PMC_UHP,
.mckr = 0x28,
.version = AT91_PMC_V2,
},
--
2.43.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/3] ARM: at91: pm: fix MCKx restore routine
2025-08-27 14:54 [PATCH 0/3] ARM: at91: enhance PM routines nicolas.ferre
2025-08-27 14:54 ` [PATCH 1/3] ARM: at91: pm: fix .uhp_udp_mask specification for current SoCs nicolas.ferre
@ 2025-08-27 14:54 ` nicolas.ferre
2025-08-27 14:54 ` [PATCH 3/3] ARM: at91: pm: save and restore ACR during PLL disable/enable nicolas.ferre
2025-09-01 16:03 ` [PATCH 0/3] ARM: at91: enhance PM routines Alexandre Belloni
3 siblings, 0 replies; 5+ messages in thread
From: nicolas.ferre @ 2025-08-27 14:54 UTC (permalink / raw)
To: ARM Maintainers, Alexandre Belloni, Ryan Wanner,
Varshini Rajendran, Claudiu Beznea
Cc: linux-kernel, linux-arm-kernel, Nicolas Ferre
From: Nicolas Ferre <nicolas.ferre@microchip.com>
The at91_mckx_ps_restore() assembly function is responsible for setting
back MCKx system bus clocks after exiting low power modes.
Fix a typo and use tmp3 variable instead of tmp2 to correctly set MCKx
to previously saved sate.
Tmp2 was used without the needed changes in CSS and DIV. Moreover the
required bit 7, telling that MCR register's content is to be changed
(CMD/write), was not set.
Fix function comment to match tmp variables actually used.
Signed-off-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Fixes: 28eb1d40fe57 ("ARM: at91: pm: add support for MCK1..4 save/restore for ulp modes")
---
arch/arm/mach-at91/pm_suspend.S | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-at91/pm_suspend.S b/arch/arm/mach-at91/pm_suspend.S
index e23b86834096..7e6c94f8edee 100644
--- a/arch/arm/mach-at91/pm_suspend.S
+++ b/arch/arm/mach-at91/pm_suspend.S
@@ -904,7 +904,7 @@ e_done:
/**
* at91_mckx_ps_restore: restore MCKx settings
*
- * Side effects: overwrites tmp1, tmp2
+ * Side effects: overwrites tmp1, tmp2 and tmp3
*/
.macro at91_mckx_ps_restore
#ifdef CONFIG_SOC_SAMA7
@@ -980,7 +980,7 @@ r_ps:
bic tmp3, tmp3, #AT91_PMC_MCR_V2_ID_MSK
orr tmp3, tmp3, tmp1
orr tmp3, tmp3, #AT91_PMC_MCR_V2_CMD
- str tmp2, [pmc, #AT91_PMC_MCR_V2]
+ str tmp3, [pmc, #AT91_PMC_MCR_V2]
wait_mckrdy tmp1
--
2.43.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/3] ARM: at91: pm: save and restore ACR during PLL disable/enable
2025-08-27 14:54 [PATCH 0/3] ARM: at91: enhance PM routines nicolas.ferre
2025-08-27 14:54 ` [PATCH 1/3] ARM: at91: pm: fix .uhp_udp_mask specification for current SoCs nicolas.ferre
2025-08-27 14:54 ` [PATCH 2/3] ARM: at91: pm: fix MCKx restore routine nicolas.ferre
@ 2025-08-27 14:54 ` nicolas.ferre
2025-09-01 16:03 ` [PATCH 0/3] ARM: at91: enhance PM routines Alexandre Belloni
3 siblings, 0 replies; 5+ messages in thread
From: nicolas.ferre @ 2025-08-27 14:54 UTC (permalink / raw)
To: ARM Maintainers, Alexandre Belloni, Ryan Wanner,
Varshini Rajendran, Claudiu Beznea
Cc: linux-kernel, linux-arm-kernel, Nicolas Ferre
From: Nicolas Ferre <nicolas.ferre@microchip.com>
Add a new word in assembly to store ACR value during the calls
to at91_plla_disable/at91_plla_enable macros and use it.
Signed-off-by: Nicolas Ferre <nicolas.ferre@microchip.com>
[cristian.birsan@microchip.com: remove ACR_DEFAULT_PLLA loading]
Signed-off-by: Cristian Birsan <cristian.birsan@microchip.com>
---
arch/arm/mach-at91/pm_suspend.S | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-at91/pm_suspend.S b/arch/arm/mach-at91/pm_suspend.S
index 7e6c94f8edee..aad53ec9e957 100644
--- a/arch/arm/mach-at91/pm_suspend.S
+++ b/arch/arm/mach-at91/pm_suspend.S
@@ -689,6 +689,10 @@ sr_dis_exit:
bic tmp2, tmp2, #AT91_PMC_PLL_UPDT_ID
str tmp2, [pmc, #AT91_PMC_PLL_UPDT]
+ /* save acr */
+ ldr tmp2, [pmc, #AT91_PMC_PLL_ACR]
+ str tmp2, .saved_acr
+
/* save div. */
mov tmp1, #0
ldr tmp2, [pmc, #AT91_PMC_PLL_CTRL0]
@@ -758,7 +762,7 @@ sr_dis_exit:
str tmp1, [pmc, #AT91_PMC_PLL_UPDT]
/* step 2. */
- ldr tmp1, =AT91_PMC_PLL_ACR_DEFAULT_PLLA
+ ldr tmp1, .saved_acr
str tmp1, [pmc, #AT91_PMC_PLL_ACR]
/* step 3. */
@@ -1207,6 +1211,8 @@ ENDPROC(at91_pm_suspend_in_sram)
#endif
.saved_mckr:
.word 0
+.saved_acr:
+ .word 0
.saved_pllar:
.word 0
.saved_sam9_lpr:
--
2.43.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 0/3] ARM: at91: enhance PM routines
2025-08-27 14:54 [PATCH 0/3] ARM: at91: enhance PM routines nicolas.ferre
` (2 preceding siblings ...)
2025-08-27 14:54 ` [PATCH 3/3] ARM: at91: pm: save and restore ACR during PLL disable/enable nicolas.ferre
@ 2025-09-01 16:03 ` Alexandre Belloni
3 siblings, 0 replies; 5+ messages in thread
From: Alexandre Belloni @ 2025-09-01 16:03 UTC (permalink / raw)
To: nicolas.ferre
Cc: ARM Maintainers, Ryan Wanner, Varshini Rajendran, Claudiu Beznea,
linux-kernel, linux-arm-kernel
On 27/08/2025 16:54:24+0200, Nicolas Ferre wrote:
> From: Nicolas Ferre <nicolas.ferre@microchip.com>
>
> Low priority fixes to the PM code, in relation to recent addition of sam9x75 or
> sama7d65 SoCs.
Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
>
> Nicolas Ferre (3):
> ARM: at91: pm: fix .uhp_udp_mask specification for current SoCs
> ARM: at91: pm: fix MCKx restore routine
> ARM: at91: pm: save and restore ACR during PLL disable/enable
>
> arch/arm/mach-at91/pm.c | 2 +-
> arch/arm/mach-at91/pm_suspend.S | 12 +++++++++---
> 2 files changed, 10 insertions(+), 4 deletions(-)
>
> --
> 2.43.0
>
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-09-01 16:03 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-27 14:54 [PATCH 0/3] ARM: at91: enhance PM routines nicolas.ferre
2025-08-27 14:54 ` [PATCH 1/3] ARM: at91: pm: fix .uhp_udp_mask specification for current SoCs nicolas.ferre
2025-08-27 14:54 ` [PATCH 2/3] ARM: at91: pm: fix MCKx restore routine nicolas.ferre
2025-08-27 14:54 ` [PATCH 3/3] ARM: at91: pm: save and restore ACR during PLL disable/enable nicolas.ferre
2025-09-01 16:03 ` [PATCH 0/3] ARM: at91: enhance PM routines Alexandre Belloni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).