Skip to contentSkip to conversation

clk: at91: sam9x60-pll: adapt PMC_PLL_ACR default value

PATCH Applied [email protected] 3 participants 3 messages Nov 11, 2019 – Jan 6, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clk: at91: sam9x60-pll: adapt PMC_PLL_ACR default value

From: Eugen Hristev <[email protected]>

Product datasheet recommends different values for UPLL and PLLA analog control register.
Adapt accordingly.

---

datasheet link http://ww1.microchip.com/downloads/en/DeviceDoc/SAM9X60-Data-Sheet-DS60001579A.pdf
chapter 57.7.10 optimal setting of the PLLA and PLLUTMI

 drivers/clk/at91/clk-sam9x60-pll.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/clk/at91/clk-sam9x60-pll.c +6 -2
index 34b8178..dfb354a 100644
@@ -25,7 +25,8 @@
 #define		PMC_PLL_CTRL1_MUL_MSK		GENMASK(30, 24)
 
 #define PMC_PLL_ACR	0x18
-#define		PMC_PLL_ACR_DEFAULT		0x1b040010UL
+#define		PMC_PLL_ACR_DEFAULT_UPLL	0x12020010UL
+#define		PMC_PLL_ACR_DEFAULT_PLLA	0x00020010UL
 #define		PMC_PLL_ACR_UTMIVR		BIT(12)
 #define		PMC_PLL_ACR_UTMIBG		BIT(13)
 #define		PMC_PLL_ACR_LOOP_FILTER_MSK	GENMASK(31, 24)
@@ -88,7 +89,10 @@ static int sam9x60_pll_prepare(struct clk_hw *hw)
 	}
 
 	/* Recommended value for PMC_PLL_ACR */
-	val = PMC_PLL_ACR_DEFAULT;
+	if (pll->characteristics->upll)
+		val = PMC_PLL_ACR_DEFAULT_UPLL;
+	else
+		val = PMC_PLL_ACR_DEFAULT_PLLA;
 	regmap_write(regmap, PMC_PLL_ACR, val);
 
 	regmap_write(regmap, PMC_PLL_CTRL1,
Signature · 1 line
2.7.4
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · On 11/11/2019 at 14:28, Eugen Hristev - M18282 wrote:

From: Eugen Hristev <[email protected]>

Product datasheet recommends different values for UPLL and PLLA analog control register.
Adapt accordingly.

Best regards,
Nicolas

Quoted 35 lines

---

datasheet link http://ww1.microchip.com/downloads/en/DeviceDoc/SAM9X60-Data-Sheet-DS60001579A.pdf
chapter 57.7.10 optimal setting of the PLLA and PLLUTMI

  drivers/clk/at91/clk-sam9x60-pll.c | 8 ++++++--
  1 file changed, 6 insertions(+), 2 deletions(-)
drivers/clk/at91/clk-sam9x60-pll.c +6 -2
index 34b8178..dfb354a 100644
@@ -25,7 +25,8 @@
  #define		PMC_PLL_CTRL1_MUL_MSK		GENMASK(30, 24)
 
  #define PMC_PLL_ACR	0x18
-#define		PMC_PLL_ACR_DEFAULT		0x1b040010UL
+#define		PMC_PLL_ACR_DEFAULT_UPLL	0x12020010UL
+#define		PMC_PLL_ACR_DEFAULT_PLLA	0x00020010UL
  #define		PMC_PLL_ACR_UTMIVR		BIT(12)
  #define		PMC_PLL_ACR_UTMIBG		BIT(13)
  #define		PMC_PLL_ACR_LOOP_FILTER_MSK	GENMASK(31, 24)
@@ -88,7 +89,10 @@ static int sam9x60_pll_prepare(struct clk_hw *hw)
  	}
 
  	/* Recommended value for PMC_PLL_ACR */
-	val = PMC_PLL_ACR_DEFAULT;
+	if (pll->characteristics->upll)
+		val = PMC_PLL_ACR_DEFAULT_UPLL;
+	else
+		val = PMC_PLL_ACR_DEFAULT_PLLA;
  	regmap_write(regmap, PMC_PLL_ACR, val);
 
  	regmap_write(regmap, PMC_PLL_CTRL1,
Signature · 6 lines
Nicolas Ferre

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel