Skip to contentSkip to conversation

Revert "i.MX28: Enable additional DRAM address bits"

PATCH Superseded Marek Vasut 3 participants 16 messages May 2, 2012 – May 4, 2012 Arm (32-bit)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 Revert "i.MX28: Enable additional DRAM address bits"

This reverts commit 69d26d09de1cb93e0a09ca71d9f0d41a66f0756a.

Apparently, this commit got mainline only because of OOT port and causes breakage on board that is mainline. Revert.

Cc Wolfgang Denk <[email protected]>
Cc Detlev Zundel <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
---
 arch/arm/cpu/arm926ejs/mx28/spl_mem_init.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/cpu/arm926ejs/mx28/spl_mem_init.c +1 -1
index 4f62142..0d13537 100644
@@ -39,7 +39,7 @@ uint32_t dram_vals[] = {
 	0x00000000, 0x00000100, 0x00000000, 0x00000000,
 	0x00000000, 0x00000000, 0x00000000, 0x00000000,
 	0x00000000, 0x00000000, 0x00010101, 0x01010101,
-	0x000f0f01, 0x0f02010a, 0x00000000, 0x00010101,
+	0x000f0f01, 0x0f02020a, 0x00000000, 0x00010101,
 	0x00000100, 0x00000100, 0x00000000, 0x00000002,
 	0x01010000, 0x05060302, 0x06005003, 0x0a0000c8,
 	0x02009c40, 0x0000030c, 0x0036a609, 0x031a0612,
Signature · 1 line
1.7.10
#1 lore raw

PATCH 2/3 M28: Scan only first 512 MB of DRAM to avoid memory wraparound

Cc Wolfgang Denk <[email protected]>
Cc Detlev Zundel <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
---
 include/configs/m28evk.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/configs/m28evk.h +1 -1
index 4016570..7e1661e 100644
@@ -88,7 +88,7 @@
  */
 #define	CONFIG_NR_DRAM_BANKS		1		/* 1 bank of DRAM */
 #define	PHYS_SDRAM_1			0x40000000	/* Base address */
-#define	PHYS_SDRAM_1_SIZE		0x40000000	/* Max 1 GB RAM */
+#define	PHYS_SDRAM_1_SIZE		0x20000000	/* Max 512 MB RAM */
 #define	CONFIG_STACKSIZE		0x00010000	/* 128 KB stack */
 #define	CONFIG_SYS_MALLOC_LEN		0x00400000	/* 4 MB for malloc */
 #define	CONFIG_SYS_GBL_DATA_SIZE	128		/* Initial data */
Signature · 1 line
1.7.10
#2 lore raw

PATCH 3/3 i.MX28: Increase the delay after DRAM init

In reply to Marek Vasut

This solves issues when larger amount of DRAM is used.

Cc Wolfgang Denk <[email protected]>
Cc Detlev Zundel <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
---
 arch/arm/cpu/arm926ejs/mx28/spl_mem_init.c |    2 ++
 1 file changed, 2 insertions(+)
arch/arm/cpu/arm926ejs/mx28/spl_mem_init.c +2 -0
index 0d13537..0b592f7 100644
@@ -237,4 +237,6 @@ void mx28_mem_init(void)
 	early_delay(10000);
 
 	mx28_mem_setup_cpu_and_hbus();
+
+	early_delay(10000);
 }
Signature · 1 line
1.7.10
#3 lore raw

PATCH 3/3 i.MX28: Increase the delay after DRAM init

Quoted 1 line · Marek Vasut

This solves issues when larger amount of DRAM is used.

Shouldn't we check if we are using a "large amount of DRAM"?

If we don't check then even boards with small amount of RAM would have this additional delay.

#4 lore raw

PATCH 3/3 i.MX28: Increase the delay after DRAM init

Dear Fabio Estevam,

Quoted 7 lines · Marek Vasut
Quoted 1 line

This solves issues when larger amount of DRAM is used.

Shouldn't we check if we are using a "large amount of DRAM"?

If we don't check then even boards with small amount of RAM would have this additional delay.

I'm afraid this worked on boards with a small amound of RAM by sheer accident (or good will of the DRAM), time to play safe and fix this.

Best regards,
Marek Vasut

#5 lore raw

PATCH 3/3 i.MX28: Increase the delay after DRAM init

Hi Marek,

Quoted 5 lines

Dear Fabio Estevam,

Quoted 3 lines · Marek Vasut
Quoted 1 line

This solves issues when larger amount of DRAM is used.

Quoted 8 lines
Quoted 4 lines

Shouldn't we check if we are using a "large amount of DRAM"?

If we don't check then even boards with small amount of RAM would have this additional delay.

I'm afraid this worked on boards with a small amound of RAM by sheer accident
(or good will of the DRAM), time to play safe and fix this.

Can you please comment on why we are waiting and why we are waiting exactly this long? Can we maybe poll the needed time somehow?

Thanks
Detlev

Signature · 6 lines
Less talking -- more hacking
                                        -- Olin Shivers
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de
#6 lore raw

PATCH 3/3 i.MX28: Increase the delay after DRAM init

Dear Detlev Zundel,

Quoted 12 lines

Hi Marek,

Quoted 10 lines

Dear Fabio Estevam,

Quoted 7 lines · Marek Vasut
Quoted 1 line

This solves issues when larger amount of DRAM is used.

Shouldn't we check if we are using a "large amount of DRAM"?

If we don't check then even boards with small amount of RAM would have this additional delay.

Quoted 6 lines
Quoted 3 lines

I'm afraid this worked on boards with a small amound of RAM by sheer accident
(or good will of the DRAM), time to play safe and fix this.

Can you please comment on why we are waiting and why we are waiting exactly this long? Can we maybe poll the needed time somehow?

We need to wait for the CPU clock to stabilize. I think there is a bit for that that we can poll, indeed. It's in my queue to revise the memory init code eventually actually, because I think I can make it even faster and fix some rough edges that are still there.

Quoted 3 lines

Thanks
Detlev

Best regards,
Marek Vasut

#7 lore raw

PATCH 3/3 i.MX28: Increase the delay after DRAM init

Hi Marek,

[...]

Quoted 4 lines
Quoted 2 lines

Can you please comment on why we are waiting and why we are waiting exactly this long? Can we maybe poll the needed time somehow?

We need to wait for the CPU clock to stabilize.

This would be a worthwhile comment in the code.

Quoted 1 line

I think there is a bit for that that we can poll, indeed.

And _that_ is even better ;)

Quoted 3 lines

It's in my queue to revise the memory init code eventually actually, because I think I can make it even faster and fix some rough edges that are still there.

Thanks!
Detlev

Signature · 6 lines
Man is a fool, and woman, for tolerating him, is a damned fool
                       -- Mark Twain
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de
#8 lore raw

PATCH 3/3 i.MX28: Increase the delay after DRAM init

Dear Detlev Zundel,

Quoted 10 lines

Hi Marek,

[...]

Quoted 4 lines
Quoted 2 lines

Can you please comment on why we are waiting and why we are waiting exactly this long? Can we maybe poll the needed time somehow?

We need to wait for the CPU clock to stabilize.

This would be a worthwhile comment in the code.

Indeed, will do

Quoted 4 lines
Quoted 2 lines

I think there is a bit for that that we can poll, indeed.

And _that_ is even better ;)

I'm not doing this in this patch, I want a stable implementation here and I can break it later ;-)

Quoted 7 lines
Quoted 4 lines

It's in my queue to revise the memory init code eventually actually, because I think I can make it even faster and fix some rough edges that are still there.

Thanks!
Detlev

Best regards,
Marek Vasut

#9 lore raw

PATCH 3/3 i.MX28: Increase the delay after DRAM init

In reply to Detlev Zundel

Dear Detlev Zundel,

Quoted 7 lines

Hi Marek,

[...]

Quoted 3 lines
Quoted 2 lines

Can you please comment on why we are waiting and why we are waiting exactly this long? Can we maybe poll the needed time somehow?

Quoted 7 lines
Quoted 1 line

We need to wait for the CPU clock to stabilize.

This would be a worthwhile comment in the code.

Quoted 1 line

I think there is a bit for that that we can poll, indeed.

And _that_ is even better ;)

And I was wrong, there isn't ... I made a dip into the manual and there's nothing :/ So this patch will have to do

Quoted 7 lines
Quoted 4 lines

It's in my queue to revise the memory init code eventually actually, because I think I can make it even faster and fix some rough edges that are still there.

Thanks!
Detlev

Best regards,
Marek Vasut

#10 lore raw

PATCH 3/3 i.MX28: Increase the delay after DRAM init

Hi Marek,

Quoted 11 lines

Dear Detlev Zundel,

Quoted 9 lines

Hi Marek,

[...]

Quoted 4 lines
Quoted 2 lines

Can you please comment on why we are waiting and why we are waiting exactly this long? Can we maybe poll the needed time somehow?

We need to wait for the CPU clock to stabilize.

Quoted 8 lines
Quoted 5 lines

This would be a worthwhile comment in the code.

Quoted 1 line

I think there is a bit for that that we can poll, indeed.

And _that_ is even better ;)

And I was wrong, there isn't ... I made a dip into the manual and there's nothing :/ So this patch will have to do

Ah, too bad. Then at least comment on how you derived the delay and what parameters where used for this calculation.

Thanks
Detlev

Signature · 9 lines
... and I will continue to use a  low-level language to indicate how
machines actually compute.  Readers  who only want to see algorithms
that are already packaged in a plug-in way, using a trendy language,
should buy other people's books.
                                         -- Donald Knuth, Fascicle 1
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de
#11 lore raw

PATCH 1/3 Revert "i.MX28: Enable additional DRAM address bits"

In reply to Marek Vasut

Hi Marek,

Quoted 4 lines

This reverts commit 69d26d09de1cb93e0a09ca71d9f0d41a66f0756a.

Apparently, this commit got mainline only because of OOT port and causes breakage on board that is mainline. Revert.

To be honest, I don't understand what this patch or what the original patch did, nor through what OOT port this hit mainline and what breakage it causes on other boards.

So also I can read the sentence, I cannot make heads and tails of it. Can you please write commit messages that people like me can make some sense from? I.e. answering the following questions would help me

- What does the original commit do? (its too late to change the original commit)
- Why was the change made in the first place and for what OOT port?
- What breakage is caused on what boards?
- Why can we revert the change without any problems?

Thanks
Detlev

Signature · 6 lines
#!/usr/bin/perl -l
print ((1 x shift) !~ /^(11+?)\1+$/ ? "prime" : "not prime");
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de
#12 lore raw

PATCH 1/3 Revert "i.MX28: Enable additional DRAM address bits"

Dear Detlev Zundel,

Quoted 10 lines

Hi Marek,

Quoted 4 lines

This reverts commit 69d26d09de1cb93e0a09ca71d9f0d41a66f0756a.

Apparently, this commit got mainline only because of OOT port and causes breakage on board that is mainline. Revert.

To be honest, I don't understand what this patch or what the original patch did, nor through what OOT port this hit mainline and what breakage it causes on other boards.

It enabled some additional address bits on X board, allowing it to use full 512MB of RAM. But because we don't have any other such configured board and X board isn't mainline, I reverted this patch. It caused trouble on new 256MB configuration of M28.

Once there'll be some module that needs different memory configuration (like X board) mainline, we'll add this here, but until then, I'd like to stick with common memory init.

Quoted 7 lines

So also I can read the sentence, I cannot make heads and tails of it. Can you please write commit messages that people like me can make some sense from? I.e. answering the following questions would help me

- What does the original commit do? (its too late to change the original commit)

Enabled additional address bits, to address full 512 MB of DRAM on the X board.

Quoted 1 line

- Why was the change made in the first place and for what OOT port?

Change of a DRAM configuration register that enabled additional address bit, at address 512MB of DRAM. Though this caused memory hole on our M28 module with 256MB of DRAM, which _is_ mainline. X board is OOT and never will be mainlined I guess.

Quoted 1 line

- What breakage is caused on what boards?

See above.

Quoted 1 line

- Why can we revert the change without any problems?

Because we don't have any mainline port that used this feature.

Quoted 3 lines

Thanks
Detlev

Best regards,
Marek Vasut

#13 lore raw

PATCH 1/3 Revert "i.MX28: Enable additional DRAM address bits"

Hi Marek,

[...]

Quoted 6 lines
Quoted 1 line

- Why was the change made in the first place and for what OOT port?

Change of a DRAM configuration register that enabled additional address bit, at address 512MB of DRAM. Though this caused memory hole on our M28 module with 256MB of DRAM, which _is_ mainline. X board is OOT and never will be mainlined I guess.

I still do not understand this fully. What exactly is this "memory hole" and why is it fatal? As far as I can remember, there are always some holes in the adress map, so why is this special?

Apart from that, I think most of these answers should go into the commit message to understand what is happening.

Thanks in advance
Detlev

Signature · 7 lines
Every generation laughs at the old fashions, but follows religiously
the new.
                                        -- Henry David Thoreau
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de
#14 lore raw

PATCH 1/3 Revert "i.MX28: Enable additional DRAM address bits"

Dear Detlev Zundel,

Quoted 6 lines

Hi Marek,

[...]

Quoted 2 lines
Quoted 1 line

- Why was the change made in the first place and for what OOT port?

Quoted 8 lines
Quoted 4 lines

Change of a DRAM configuration register that enabled additional address bit, at address 512MB of DRAM. Though this caused memory hole on our M28 module with 256MB of DRAM, which _is_ mainline. X board is OOT and never will be mainlined I guess.

I still do not understand this fully. What exactly is this "memory hole" and why is it fatal? As far as I can remember, there are always some holes in the adress map, so why is this special?

No, this one created this layout on our 256 MB module:

[chunk of memory][<- same thing][chunk of memory][<- same thing]

so get_ram_size() didn't work with it and it actually overwrote part of the U- Boot etc.

Quoted 3 lines

Apart from that, I think most of these answers should go into the commit message to understand what is happening.

Agreed

Quoted 2 lines

Thanks in advance
Detlev

Best regards,
Marek Vasut

#15 lore raw

PATCH 1/3 Revert "i.MX28: Enable additional DRAM address bits"

Hi Marek,

Quoted 17 lines

Dear Detlev Zundel,

Quoted 6 lines

Hi Marek,

[...]

Quoted 2 lines
Quoted 1 line

- Why was the change made in the first place and for what OOT port?

Quoted 8 lines
Quoted 4 lines

Change of a DRAM configuration register that enabled additional address bit, at address 512MB of DRAM. Though this caused memory hole on our M28 module with 256MB of DRAM, which _is_ mainline. X board is OOT and never will be mainlined I guess.

I still do not understand this fully. What exactly is this "memory hole" and why is it fatal? As far as I can remember, there are always some holes in the adress map, so why is this special?

Quoted 7 lines

No, this one created this layout on our 256 MB module:

[chunk of memory][<- same thing][chunk of memory][<- same thing]

so get_ram_size() didn't work with it and it actually overwrote part of the U-
Boot etc.

Ah, so it created what I would call a "memory mirroring" or "memory aliasing", right? Now I understand the problem, thanks.

Cheers
Detlev

Signature · 8 lines
This is  not the first  time my views  on some topic have  inspired in
someone the  desire to psychoanalyze me. Previous  experience leads me
to ask  about your couch. Is  it comfortable? Are its  springs in good
shape?                                     -- Jonh McCarthy
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de