Skip to contentSkip to conversation

i.MX6: Add ANATOP regulator init

PATCH New Dirk Behme 3 participants 6 messages Apr 13, 2012 – Apr 23, 2012 Arm (32-bit)

lore
Share & tools
lore

Dirk Behme

author
#0 lore raw

PATCH 1/1 i.MX6: Add ANATOP regulator init

Init the core regulator voltage to 1.2V. This is required for the correct functioning of the GPU and when the ARM LDO is set to 1.225V. This is a workaround to fix some memory clock jitter.

Note: This should be but can't be done in the DCD. The bootloader
prevents access to the ANATOP registers.

CC Jason Chen <[email protected]>
CC Jason Liu <[email protected]>
CC Ranjani Vaidyanathan <[email protected]>
CC Stefano Babic <[email protected]>
CC Fabio Estevam <[email protected]>
---
 arch/arm/cpu/armv7/mx6/soc.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
arch/arm/cpu/armv7/mx6/soc.c +16 -0
index 543b2cc..957ea34 100644
@@ -77,10 +77,26 @@ void init_aips(void)
 	writel(0x00000000, &aips2->opacr4);
 }
 
+static void init_anatop_reg(void)
+{
+	struct anatop_regs *anatop = (struct anatop_regs *)ANATOP_BASE_ADDR;
+	int reg = readl(&anatop->reg_core);
+
+	/*
+	 * Increase the VDDSOC to 1.2V
+	 * Mask out the REG_CORE[22:18] bits (REG2_TRIG)
+	 * and set them to 1.2V (0.7V + 0x14 * 0.025V)
+	 */
+	reg = (reg & ~(0x1F << 18)) | (0x14 << 18);
+	writel(reg, &anatop->reg_core);
+}
+
 int arch_cpu_init(void)
 {
 	init_aips();
 
+	init_anatop_reg();
+
 	return 0;
 }
 #endif
Signature · 1 line
1.7.0.4
author
#1 lore raw

PATCH 1/1 i.MX6: Add ANATOP regulator init

Quoted 38 lines · Dirk Behme

Init the core regulator voltage to 1.2V. This is required for the correct functioning of the GPU and when the ARM LDO is set to 1.225V. This is a workaround to fix some memory clock jitter.

Note: This should be but can't be done in the DCD. The bootloader
prevents access to the ANATOP registers.

CC Jason Chen <[email protected]>
CC Jason Liu <[email protected]>
CC Ranjani Vaidyanathan <[email protected]>
CC Stefano Babic <[email protected]>
CC Fabio Estevam <[email protected]>
---
 arch/arm/cpu/armv7/mx6/soc.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
arch/arm/cpu/armv7/mx6/soc.c +13 -0
index 543b2cc..957ea34 100644
@@ -77,10 +77,26 @@ void init_aips(void)
 	writel(0x00000000, &aips2->opacr4);
 }
 
+static void init_anatop_reg(void)
+{
+	struct anatop_regs *anatop = (struct anatop_regs *)ANATOP_BASE_ADDR;
+	int reg = readl(&anatop->reg_core);
+
+	/*
+	 * Increase the VDDSOC to 1.2V
+	 * Mask out the REG_CORE[22:18] bits (REG2_TRIG)
+	 * and set them to 1.2V (0.7V + 0x14 * 0.025V)
+	 */
+	reg = (reg & ~(0x1F << 18)) | (0x14 << 18);
+	writel(reg, &anatop->reg_core);
+}

arch/arm/cpu/armv7/mx6/soc.c void init_aips(void) · line 102

Quoted 10 lines
arch/arm/cpu/armv7/mx6/soc.c +3 -0
+
 int arch_cpu_init(void)
 {
 	init_aips();
 
+	init_anatop_reg();
+
 	return 0;
 }
 #endif

Any comments on this?

Many thanks

Dirk

#2 lore raw

PATCH 1/1 i.MX6: Add ANATOP regulator init

In reply to Dirk Behme

2012/4/13 Dirk Behme <[email protected]>:

Quoted 47 lines

Init the core regulator voltage to 1.2V. This is required for the correct functioning of the GPU and when the ARM LDO is set to 1.225V. This is a workaround to fix some memory clock jitter.

Note: This should be but can't be done in the DCD. The bootloader ? ? ?prevents access to the ANATOP registers.

CC Jason Chen <[email protected]>
CC Jason Liu <[email protected]>
CC Ranjani Vaidyanathan <[email protected]>
CC Stefano Babic <[email protected]>
CC Fabio Estevam <[email protected]>

---
?arch/arm/cpu/armv7/mx6/soc.c | ? 16 ++++++++++++++++ ?1 files changed, 16 insertions(+), 0 deletions(-)

arch/arm/cpu/armv7/mx6/soc.c +16 -0
index 543b2cc..957ea34 100644
@@ -77,10 +77,26 @@ void init_aips(void)
 ? ? ? ?writel(0x00000000, &aips2->opacr4);
 ?}
 
+static void init_anatop_reg(void)
+{
+ ? ? ? struct anatop_regs *anatop = (struct anatop_regs *)ANATOP_BASE_ADDR;
+ ? ? ? int reg = readl(&anatop->reg_core);
+
+ ? ? ? /*
+ ? ? ? ?* Increase the VDDSOC to 1.2V
+ ? ? ? ?* Mask out the REG_CORE[22:18] bits (REG2_TRIG)
+ ? ? ? ?* and set them to 1.2V (0.7V + 0x14 * 0.025V)
+ ? ? ? ?*/
+ ? ? ? reg = (reg & ~(0x1F << 18)) | (0x14 << 18);
+ ? ? ? writel(reg, &anatop->reg_core);
+}
+
 ?int arch_cpu_init(void)
 ?{
 ? ? ? ?init_aips();
 
+ ? ? ? init_anatop_reg();
+
 ? ? ? ?return 0;
 ?}
Quoted 1 line

?#endif

Quoted 7 lines

--
1.7.0.4

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

#3 lore raw

PATCH 1/1 i.MX6: Add ANATOP regulator init

In reply to Dirk Behme
Quoted 7 lines · Dirk Behme

Init the core regulator voltage to 1.2V. This is required for the correct functioning of the GPU and when the ARM LDO is set to 1.225V. This is a workaround to fix some memory clock jitter.

Note: This should be but can't be done in the DCD. The bootloader
prevents access to the ANATOP registers.

Quoted 7 lines
CC Jason Chen <[email protected]>
CC Jason Liu <[email protected]>
CC Ranjani Vaidyanathan <[email protected]>
CC Stefano Babic <[email protected]>
CC Fabio Estevam <[email protected]>

---

Hi Dirk,

arch/arm/cpu/armv7/mx6/soc.c void init_aips(void) · line 90

Quoted 11 lines
arch/arm/cpu/armv7/mx6/soc.c +11 -0
+static void init_anatop_reg(void)
+{
+	struct anatop_regs *anatop = (struct anatop_regs *)ANATOP_BASE_ADDR;
+	int reg = readl(&anatop->reg_core);
+
+	/*
+	 * Increase the VDDSOC to 1.2V
+	 * Mask out the REG_CORE[22:18] bits (REG2_TRIG)
+	 * and set them to 1.2V (0.7V + 0x14 * 0.025V)
+	 */
+	reg = (reg & ~(0x1F << 18)) | (0x14 << 18);

Everything clear, but what do you mind to add an accessor to set this voltage ? It is straightforward, and more boards could use it.

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected]
=====================================================================
author
#4 lore raw

PATCH 1/1 i.MX6: Add ANATOP regulator init

Hi Stefano,

Quoted 18 lines · Stefano Babic
Quoted 7 lines · Dirk Behme

Init the core regulator voltage to 1.2V. This is required for the correct functioning of the GPU and when the ARM LDO is set to 1.225V. This is a workaround to fix some memory clock jitter.

Note: This should be but can't be done in the DCD. The bootloader
prevents access to the ANATOP registers.

Quoted 7 lines
CC Jason Chen <[email protected]>
CC Jason Liu <[email protected]>
CC Ranjani Vaidyanathan <[email protected]>
CC Stefano Babic <[email protected]>
CC Fabio Estevam <[email protected]>

---

Hi Dirk,

Quoted 14 lines

arch/arm/cpu/armv7/mx6/soc.c void init_aips(void) · line 90

Quoted 11 lines
arch/arm/cpu/armv7/mx6/soc.c +11 -0
+static void init_anatop_reg(void)
+{
+	struct anatop_regs *anatop = (struct anatop_regs *)ANATOP_BASE_ADDR;
+	int reg = readl(&anatop->reg_core);
+
+	/*
+	 * Increase the VDDSOC to 1.2V
+	 * Mask out the REG_CORE[22:18] bits (REG2_TRIG)
+	 * and set them to 1.2V (0.7V + 0x14 * 0.025V)
+	 */
+	reg = (reg & ~(0x1F << 18)) | (0x14 << 18);

Everything clear, but what do you mind to add an accessor to set this voltage ? It is straightforward, and more boards could use it.

Sorry, but what do you mean with "add an accessor"? Could you give an example?

Best regards

Dirk

#5 lore raw

PATCH 1/1 i.MX6: Add ANATOP regulator init

In reply to Stefano Babic
Quoted 15 lines · Stefano Babic

arch/arm/cpu/armv7/mx6/soc.c void init_aips(void) · line 90

Quoted 12 lines
arch/arm/cpu/armv7/mx6/soc.c +11 -0
+static void init_anatop_reg(void)
+{
+	struct anatop_regs *anatop = (struct anatop_regs *)ANATOP_BASE_ADDR;
+	int reg = readl(&anatop->reg_core);
+
+	/*
+	 * Increase the VDDSOC to 1.2V
+	 * Mask out the REG_CORE[22:18] bits (REG2_TRIG)
+	 * and set them to 1.2V (0.7V + 0x14 * 0.025V)
+	 */
+	reg = (reg & ~(0x1F << 18)) | (0x14 << 18);

Everything clear, but what do you mind to add an accessor to set this voltage ? It is straightforward, and more boards could use it.

Well, sometimes I am quite obscure, maybe I need more coffeine before writing my answers ;-)

What I mean is to change the function name to something like set_vddsoc(mV), and exporting it dropping the static clause.

Stefano

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================