Skip to contentSkip to conversation

i.MX28: Fix VDDIO and VDDA setup

PATCH New Marek Vasut 5 participants 13 messages Jan 31, 2012 – Feb 7, 2012 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i.MX28: Fix VDDIO and VDDA setup

The DC power STS shouldn't be checked if booting off 5V supply.

Cc Wolfgang Denk <[email protected]>
Cc Detlev Zundel <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Robert Deli?n <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Matthias Fuchs <[email protected]>
---
 arch/arm/cpu/arm926ejs/mx28/spl_power_init.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

Note: Guys, please give this a testrun. I think it might fix the issue Robert was observing. I dug into the imx-bootlets and the bootrom X-Files and found this paranormal piece of code. Adding it fixes the boot issue on my crappy board.

M

arch/arm/cpu/arm926ejs/mx28/spl_power_init.c +12 -4
index ee0f237..c6c25d9 100644
@@ -802,7 +802,9 @@ void mx28_power_set_vddio(uint32_t new_target, uint32_t new_brownout)
 			clrsetbits_le32(&power_regs->hw_power_vddioctrl,
 				POWER_VDDIOCTRL_TRG_MASK, diff);
 
-			if (powered_by_linreg)
+			if (powered_by_linreg ||
+				(readl(&power_regs->hw_power_sts) &
+					POWER_STS_VDD5V_GT_VDDIO))
 				early_delay(1500);
 			else {
 				while (!(readl(&power_regs->hw_power_sts) &
@@ -837,7 +839,9 @@ void mx28_power_set_vddio(uint32_t new_target, uint32_t new_brownout)
 			clrsetbits_le32(&power_regs->hw_power_vddioctrl,
 				POWER_VDDIOCTRL_TRG_MASK, diff);
 
-			if (powered_by_linreg)
+			if (powered_by_linreg ||
+				(readl(&power_regs->hw_power_sts) &
+					POWER_STS_VDD5V_GT_VDDIO))
 				early_delay(1500);
 			else {
 				while (!(readl(&power_regs->hw_power_sts) &
@@ -895,7 +899,9 @@ void mx28_power_set_vddd(uint32_t new_target, uint32_t new_brownout)
 			clrsetbits_le32(&power_regs->hw_power_vdddctrl,
 				POWER_VDDDCTRL_TRG_MASK, diff);
 
-			if (powered_by_linreg)
+			if (powered_by_linreg ||
+				(readl(&power_regs->hw_power_sts) &
+					POWER_STS_VDD5V_GT_VDDIO))
 				early_delay(1500);
 			else {
 				while (!(readl(&power_regs->hw_power_sts) &
@@ -930,7 +936,9 @@ void mx28_power_set_vddd(uint32_t new_target, uint32_t new_brownout)
 			clrsetbits_le32(&power_regs->hw_power_vdddctrl,
 					POWER_VDDDCTRL_TRG_MASK, diff);
 
-			if (powered_by_linreg)
+			if (powered_by_linreg ||
+				(readl(&power_regs->hw_power_sts) &
+					POWER_STS_VDD5V_GT_VDDIO))
 				early_delay(1500);
 			else {
 				while (!(readl(&power_regs->hw_power_sts) &
Signature · 1 line
1.7.8.3
#1 lore raw

PATCH 1/1 i.MX28: Fix VDDIO and VDDA setup

I tested both patch on my mx28evk. At least I cannot notice any missbehavior :-) Downloading the patched u-boot via USB recovery download still does not work.

Marek, did you find any further mentionable difference between bootlets code and current u-boot implementation?

Matthias

Quoted 68 lines · Marek Vasut

The DC power STS shouldn't be checked if booting off 5V supply.

Cc Wolfgang Denk <[email protected]>
Cc Detlev Zundel <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Robert Deli?n <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Matthias Fuchs <[email protected]>
---
 arch/arm/cpu/arm926ejs/mx28/spl_power_init.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

Note: Guys, please give this a testrun. I think it might fix the issue Robert was observing. I dug into the imx-bootlets and the bootrom X-Files and found this paranormal piece of code. Adding it fixes the boot issue on my crappy board.

M

arch/arm/cpu/arm926ejs/mx28/spl_power_init.c +12 -4
index ee0f237..c6c25d9 100644
@@ -802,7 +802,9 @@ void mx28_power_set_vddio(uint32_t new_target, uint32_t new_brownout)
 			clrsetbits_le32(&power_regs->hw_power_vddioctrl,
 				POWER_VDDIOCTRL_TRG_MASK, diff);
 
-			if (powered_by_linreg)
+			if (powered_by_linreg ||
+				(readl(&power_regs->hw_power_sts) &
+					POWER_STS_VDD5V_GT_VDDIO))
 				early_delay(1500);
 			else {
 				while (!(readl(&power_regs->hw_power_sts) &
@@ -837,7 +839,9 @@ void mx28_power_set_vddio(uint32_t new_target, uint32_t new_brownout)
 			clrsetbits_le32(&power_regs->hw_power_vddioctrl,
 				POWER_VDDIOCTRL_TRG_MASK, diff);
 
-			if (powered_by_linreg)
+			if (powered_by_linreg ||
+				(readl(&power_regs->hw_power_sts) &
+					POWER_STS_VDD5V_GT_VDDIO))
 				early_delay(1500);
 			else {
 				while (!(readl(&power_regs->hw_power_sts) &
@@ -895,7 +899,9 @@ void mx28_power_set_vddd(uint32_t new_target, uint32_t new_brownout)
 			clrsetbits_le32(&power_regs->hw_power_vdddctrl,
 				POWER_VDDDCTRL_TRG_MASK, diff);
 
-			if (powered_by_linreg)
+			if (powered_by_linreg ||
+				(readl(&power_regs->hw_power_sts) &
+					POWER_STS_VDD5V_GT_VDDIO))
 				early_delay(1500);
 			else {
 				while (!(readl(&power_regs->hw_power_sts) &
@@ -930,7 +936,9 @@ void mx28_power_set_vddd(uint32_t new_target, uint32_t new_brownout)
 			clrsetbits_le32(&power_regs->hw_power_vdddctrl,
 					POWER_VDDDCTRL_TRG_MASK, diff);
 
-			if (powered_by_linreg)
+			if (powered_by_linreg ||
+				(readl(&power_regs->hw_power_sts) &
+					POWER_STS_VDD5V_GT_VDDIO))
 				early_delay(1500);
 			else {
 				while (!(readl(&power_regs->hw_power_sts) &
Signature · 17 lines
------------------------------------------------------------------------
Dipl.-Ing. Matthias Fuchs
Head of System Design

esd electronic system design gmbh
Vahrenwalder Str. 207 - 30165 Hannover - GERMANY
Phone: +49-511-37298-0 - Fax: +49-511-37298-68
Please visit our homepage http://www.esd.eu
Quality Products - Made in Germany

Besuchen Sie uns auf der embedded world 2012
in Halle 4, Stand 129
vom 28. Februar - 01. M?rz 2012 in N?rnberg!
------------------------------------------------------------------------
Gesch?ftsf?hrer: Klaus Detering
Amtsgericht Hannover HRB 51373 - VAT-ID DE 115672832
-------------------------------------------------------------------------
#2 lore raw

PATCH 1/1 i.MX28: Fix VDDIO and VDDA setup

Quoted 3 lines

I tested both patch on my mx28evk. At least I cannot notice any missbehavior :-) Downloading the patched u-boot via USB recovery download still does not work.

Good, any improvements though?

Quoted 3 lines

Marek, did you find any further mentionable difference between bootlets code and current u-boot implementation?

Not yet.

Quoted 2 lines

Matthias

M

Quoted 99 lines · Marek Vasut
Quoted 97 lines

The DC power STS shouldn't be checked if booting off 5V supply.

Cc Wolfgang Denk <[email protected]>
Cc Detlev Zundel <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Robert Deli?n <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Matthias Fuchs <[email protected]>

---

 arch/arm/cpu/arm926ejs/mx28/spl_power_init.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

Note: Guys, please give this a testrun. I think it might fix the issue Robert was observing. I dug into the imx-bootlets and the bootrom X-Files and found this paranormal piece of code. Adding it fixes the boot issue on my crappy board.

M

(quoted diff) +0 -0

b/arch/arm/cpu/arm926ejs/mx28/spl_power_init.c index ee0f237..c6c25d9 100644

arch/arm/cpu/arm926ejs/mx28/spl_power_init.c +3 -1
@@ -802,7 +802,9 @@ void mx28_power_set_vddio(uint32_t new_target,
 uint32_t new_brownout)
 
 			clrsetbits_le32(&power_regs->hw_power_vddioctrl,
 
 				POWER_VDDIOCTRL_TRG_MASK, diff);
 
-			if (powered_by_linreg)
+			if (powered_by_linreg ||
+				(readl(&power_regs->hw_power_sts) &
+					POWER_STS_VDD5V_GT_VDDIO))
arch/arm/cpu/arm926ejs/mx28/spl_power_init.c +3 -1
 				early_delay(1500);
 
 			else {
 
 				while (!(readl(&power_regs->hw_power_sts) &
@@ -837,7 +839,9 @@ void mx28_power_set_vddio(uint32_t new_target,
 uint32_t new_brownout)
 
 			clrsetbits_le32(&power_regs->hw_power_vddioctrl,
 
 				POWER_VDDIOCTRL_TRG_MASK, diff);
 
-			if (powered_by_linreg)
+			if (powered_by_linreg ||
+				(readl(&power_regs->hw_power_sts) &
+					POWER_STS_VDD5V_GT_VDDIO))
arch/arm/cpu/arm926ejs/mx28/spl_power_init.c +3 -1
 				early_delay(1500);
 
 			else {
 
 				while (!(readl(&power_regs->hw_power_sts) &
@@ -895,7 +899,9 @@ void mx28_power_set_vddd(uint32_t new_target,
 uint32_t new_brownout)
 
 			clrsetbits_le32(&power_regs->hw_power_vdddctrl,
 
 				POWER_VDDDCTRL_TRG_MASK, diff);
 
-			if (powered_by_linreg)
+			if (powered_by_linreg ||
+				(readl(&power_regs->hw_power_sts) &
+					POWER_STS_VDD5V_GT_VDDIO))
arch/arm/cpu/arm926ejs/mx28/spl_power_init.c +3 -1
 				early_delay(1500);
 
 			else {
 
 				while (!(readl(&power_regs->hw_power_sts) &
@@ -930,7 +936,9 @@ void mx28_power_set_vddd(uint32_t new_target,
 uint32_t new_brownout)
 
 			clrsetbits_le32(&power_regs->hw_power_vdddctrl,
 
 					POWER_VDDDCTRL_TRG_MASK, diff);
 
-			if (powered_by_linreg)
+			if (powered_by_linreg ||
+				(readl(&power_regs->hw_power_sts) &
+					POWER_STS_VDD5V_GT_VDDIO))
arch/arm/cpu/arm926ejs/mx28/spl_power_init.c +0 -0
 				early_delay(1500);
 
 			else {
 
 				while (!(readl(&power_regs->hw_power_sts) &
#3 lore raw

PATCH 1/1 i.MX28: Fix VDDIO and VDDA setup

Quoted 5 lines · Marek Vasut
Quoted 3 lines

I tested both patch on my mx28evk. At least I cannot notice any missbehavior :-) Downloading the patched u-boot via USB recovery download still does not work.

Good, any improvements though?

No. It works as before. Whatever that means :-)
I will respond to my prior USB posting with some news about that.

Matthias

#4 lore raw

PATCH 1/1 i.MX28: Fix VDDIO and VDDA setup

In reply to Marek Vasut
Quoted 5 lines · Marek Vasut

Note: Guys, please give this a testrun. I think it might fix the issue Robert
was observing. I dug into the imx-bootlets and the bootrom X-Files and found this paranormal piece of code. Adding it fixes the boot issue on my crappy board.

Tried your patch and my mx28evk still hangs after a "reboot" command. It reads the scratch registers as 0, report the total RAM size as 0 and then U-boot hangs.

Regards,

Fabio Estevam

#5 lore raw

PATCH 1/1 i.MX28: Fix VDDIO and VDDA setup

Quoted 10 lines · Marek Vasut
Quoted 5 lines

Note: Guys, please give this a testrun. I think it might fix the issue Robert
was observing. I dug into the imx-bootlets and the bootrom X-Files and found this paranormal piece of code. Adding it fixes the boot issue on my crappy board.

Tried your patch and my mx28evk still hangs after a "reboot" command. It reads the scratch registers as 0, report the total RAM size as 0 and then U-boot hangs.

Right, because RAM size is 0. I see, so DRAM init fails somewhere. I think though it doesn't hang in the POWER init code anymore. Can you trace mem_init() in the SPL? Simply define CONFIG_SPL_SERIAL_SUPPORT for example and run serial_init() before, then run serial_puts() every now and then when fit.

M

Quoted 4 lines

Regards,

Fabio Estevam

#6 lore raw

PATCH 1/1 i.MX28: Fix VDDIO and VDDA setup

Quoted 1 line

Right, because RAM size is 0. I see, so DRAM init fails somewhere.

That's exactly where and why it hangs, in my case.

Quoted 2 lines

I think
though it doesn't hang in the POWER init code anymore.

In my case, I don't think it hung in power_init before your patch. I'm pretty sure it hung at the same place.

Quoted 3 lines

Can you trace mem_init()
in the SPL? Simply define CONFIG_SPL_SERIAL_SUPPORT for example and run serial_init() before, then run serial_puts() every now and then when fit.

I'm trying too. I'm also trying to figure out the call stack of mx28_dram_init(), but no luck so far.

#7 lore raw

PATCH 1/1 i.MX28: Fix VDDIO and VDDA setup

Quoted 10 lines
Quoted 1 line

Right, because RAM size is 0. I see, so DRAM init fails somewhere.

That's exactly where and why it hangs, in my case.

Quoted 2 lines

I think
though it doesn't hang in the POWER init code anymore.

In my case, I don't think it hung in power_init before your patch. I'm pretty sure it hung at the same place.

Quoted 6 lines
Quoted 3 lines

Can you trace mem_init()
in the SPL? Simply define CONFIG_SPL_SERIAL_SUPPORT for example and run serial_init() before, then run serial_puts() every now and then when fit.

I'm trying too. I'm also trying to figure out the call stack of mx28_dram_init(), but no luck so far.

Try s/0x2a/~(26)/ in spl_mem_init.c ... to lower the freq to 166MHz and see what it does.

M

#8 lore raw

PATCH 1/1 i.MX28: Fix VDDIO and VDDA setup

In reply to Robert Deliën
Quoted 10 lines
Quoted 1 line

Right, because RAM size is 0. I see, so DRAM init fails somewhere.

That's exactly where and why it hangs, in my case.

Quoted 2 lines

I think
though it doesn't hang in the POWER init code anymore.

In my case, I don't think it hung in power_init before your patch. I'm pretty sure it hung at the same place.

Quoted 6 lines
Quoted 3 lines

Can you trace mem_init()
in the SPL? Simply define CONFIG_SPL_SERIAL_SUPPORT for example and run serial_init() before, then run serial_puts() every now and then when fit.

I'm trying too. I'm also trying to figure out the call stack of mx28_dram_init(), but no luck so far.

Ok, what happens if you replace mx28_dram_init() with:

while (!readl(0x8001c280))

	mx28_mem_init();

?

#9 lore raw

PATCH 1/1 i.MX28: Fix VDDIO and VDDA setup

Quoted 4 lines

Ok, what happens if you replace mx28_dram_init() with:

while (!readl(0x8001c280))

	mx28_mem_init();

I'm sorry for my late response; I was attending an FPGA workshop today. I will test this first thing in the morning, when I'm at the office.

#10 lore raw

PATCH 1/1 i.MX28: Fix VDDIO and VDDA setup

In reply to Marek Vasut

Hi Marek,

Quoted 4 lines

Ok, what happens if you replace mx28_dram_init() with:

while (!readl(0x8001c280))

       mx28_mem_init();

It's not entirely clear what you'd like me to try: mx28_dram_init is called in U-Boot, while mx28_mem_init is SPL code.
I have tried to link SPL objects along, but I'm getting a number of duplicate symbols now. Before I start fixing that, I'd first like to know if that's really what you want me to try.

#11 lore raw

PATCH 1/1 i.MX28: Fix VDDIO and VDDA setup

In reply to Fabio Estevam

Hi,

Same here. I've applied the patch and tried it on my mx28evk and 'reboot' from the Kernel prompt results into DRAM: 0 Bytes and a hanging U-Boot.

I didn't try single-stepping with the debugger yet; I'm still messing around with the PLL bypass bit and PLL configuration.

Cheers,

Robert.

________________________________________
From: Fabio Estevam [festevam at gmail.com]
Sent: 31 January 2012 13:26
To: Marek Vasut
Cc: u-boot at lists.denx.de; Wolfgang Denk; Detlev Zundel; Stefano Babic; Robert Deli?n; Matthias Fuchs
Subject: Re: [PATCH] i.MX28: Fix VDDIO and VDDA setup

Quoted 5 lines · Marek Vasut

Note: Guys, please give this a testrun. I think it might fix the issue Robert
was observing. I dug into the imx-bootlets and the bootrom X-Files and found this paranormal piece of code. Adding it fixes the boot issue on my crappy board.

Tried your patch and my mx28evk still hangs after a "reboot" command. It reads the scratch registers as 0, report the total RAM size as 0 and then U-boot hangs.

Regards,

Fabio Estevam

#12 lore raw

PATCH 1/1 i.MX28: Fix VDDIO and VDDA setup

In reply to Marek Vasut
Quoted 10 lines · Marek Vasut

The DC power STS shouldn't be checked if booting off 5V supply.

Cc Wolfgang Denk <[email protected]>
Cc Detlev Zundel <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Robert Deli?n <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Matthias Fuchs <[email protected]>

---

Applied to u-boot-imx, thanks.

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-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================