public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] memory probe
@ 2005-05-10  2:09 Sumit Chauhan
  2005-05-11 18:31 ` Matej Kupljen
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Sumit Chauhan @ 2005-05-10  2:09 UTC (permalink / raw)
  To: u-boot

Hi,

We are  planning to use uboot on our system and wanted to know if
u-boot can probe the memory installed on the system automatically and
pass the correct mem size to linux kernel  ?

Way I could understand it was that the mem size and offset had to be
compile time #define'ed ..

what if we want same image to work on 2 different memory configuration
hardware ?

how does the memory probe work on PC etc ? bootloaders use BIOS Calls ?
how can I do this on my ixdp425 plattform ?

Cheers,
Sumit

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot-Users] memory probe
  2005-05-10  2:09 [U-Boot-Users] memory probe Sumit Chauhan
@ 2005-05-11 18:31 ` Matej Kupljen
  2005-05-11 20:56   ` Wolfgang Denk
  2005-05-11 18:38 ` Jon Loeliger
  2005-05-11 18:44 ` Wolfgang Denk
  2 siblings, 1 reply; 9+ messages in thread
From: Matej Kupljen @ 2005-05-11 18:31 UTC (permalink / raw)
  To: u-boot

Hi

> what if we want same image to work on 2 different memory configuration
> hardware ?

We had such board. One with 32MB and other with 64MB of SDRAM.
We used DIP switches, which were read early in a U-Boot, in
memsetup.S. On the position of this DIP switch we then decided
which path in the mesetup.S to take.
Then, in out dram_init function for our board, we again read the
DIP switch and decide what to report as DRAM size.

BR,
Matej

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot-Users] memory probe
  2005-05-10  2:09 [U-Boot-Users] memory probe Sumit Chauhan
  2005-05-11 18:31 ` Matej Kupljen
@ 2005-05-11 18:38 ` Jon Loeliger
  2005-05-11 18:44 ` Wolfgang Denk
  2 siblings, 0 replies; 9+ messages in thread
From: Jon Loeliger @ 2005-05-11 18:38 UTC (permalink / raw)
  To: u-boot

On Mon, 2005-05-09 at 21:09, Sumit Chauhan wrote:
> Hi,
> 
> We are  planning to use uboot on our system and wanted to know if
> u-boot can probe the memory installed on the system automatically and
> pass the correct mem size to linux kernel  ?

Did you read any of the code for your board?
BTW, what is your board?

Chances are that it will determine the correct size
of your memory dynamically.

> Way I could understand it was that the mem size and offset had to be
> compile time #define'ed ..

Maybe.  Maybe not.

> what if we want same image to work on 2 different memory configuration
> hardware ?

It might work.  What does the code say?

> how does the memory probe work on PC etc ?

No idea.

> bootloaders use BIOS Calls ?
> how can I do this on my ixdp425 plattform ?

Um, there might be some confusion going on here...
What are you wanting to use U-Boot for?

jdl

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot-Users] memory probe
  2005-05-10  2:09 [U-Boot-Users] memory probe Sumit Chauhan
  2005-05-11 18:31 ` Matej Kupljen
  2005-05-11 18:38 ` Jon Loeliger
@ 2005-05-11 18:44 ` Wolfgang Denk
  2 siblings, 0 replies; 9+ messages in thread
From: Wolfgang Denk @ 2005-05-11 18:44 UTC (permalink / raw)
  To: u-boot

In message <aa56107905050919099b9b06b@mail.gmail.com> you wrote:
> 
> We are  planning to use uboot on our system and wanted to know if
> u-boot can probe the memory installed on the system automatically and
> pass the correct mem size to linux kernel  ?

Yes, it can. Actually this is the default behaviour.

Ummm... why didn't you have a look at the mailing list arcive instead
of posting?

> Way I could understand it was that the mem size and offset had to be
> compile time #define'ed ..

Wrong.

> what if we want same image to work on 2 different memory configuration
> hardware ?

Just do it. It is up to you how you implement support for your board.

> how does the memory probe work on PC etc ? bootloaders use BIOS Calls ?

BIOS? That's a different world. Wrong list.

> how can I do this on my ixdp425 plattform ?

Have a look at common/memsize.c and how it's used on other boards.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I mean, I . . . think to understand you, I just don't know  what  you
are saying ...                        - Terry Pratchett, _Soul Music_

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot-Users] memory probe
  2005-05-11 18:31 ` Matej Kupljen
@ 2005-05-11 20:56   ` Wolfgang Denk
  2005-05-12  8:15     ` Matej Kupljen
  0 siblings, 1 reply; 9+ messages in thread
From: Wolfgang Denk @ 2005-05-11 20:56 UTC (permalink / raw)
  To: u-boot

In message <1115836301.25819.7.camel@orionlinux.starfleet.com> you wrote:
> 
> We had such board. One with 32MB and other with 64MB of SDRAM.
> We used DIP switches, which were read early in a U-Boot, in
> memsetup.S. On the position of this DIP switch we then decided
> which path in the mesetup.S to take.
> Then, in out dram_init function for our board, we again read the
> DIP switch and decide what to report as DRAM size.

No need to do this.  If  implemented  correctly,  U-Boot  will  auto-
matically  find  out  how  big  your  RAM.  This is what the RAM size
detection code in common/memsize.c was made for. Just use it.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Nobody trips over mountains. It is the small pebble that  causes  you
to  stumble.  Pass all the pebbles in your path and you will find you
have crossed the mountain.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot-Users] memory probe
  2005-05-11 20:56   ` Wolfgang Denk
@ 2005-05-12  8:15     ` Matej Kupljen
  2005-05-12  8:42       ` Wolfgang Denk
  0 siblings, 1 reply; 9+ messages in thread
From: Matej Kupljen @ 2005-05-12  8:15 UTC (permalink / raw)
  To: u-boot

Hi

> > Then, in out dram_init function for our board, we again read the
> > DIP switch and decide what to report as DRAM size.
> 
> No need to do this.  If  implemented  correctly,  U-Boot  will  auto-
> matically  find  out  how  big  your  RAM.  This is what the RAM size
> detection code in common/memsize.c was made for. Just use it.

Yes, but you still need to read the DIP switch in the memsetup.S
to properly initialise SDRAM. You can use this code only to report
the memory size to U-Boot and the Linux.

BR,
Matej

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot-Users] memory probe
  2005-05-12  8:15     ` Matej Kupljen
@ 2005-05-12  8:42       ` Wolfgang Denk
  2005-05-12  9:06         ` Matej Kupljen
  0 siblings, 1 reply; 9+ messages in thread
From: Wolfgang Denk @ 2005-05-12  8:42 UTC (permalink / raw)
  To: u-boot

In message <1115885736.9698.2.camel@orionlinux.starfleet.com> you wrote:
> 
> > No need to do this.  If  implemented  correctly,  U-Boot  will  auto-
> > matically  find  out  how  big  your  RAM.  This is what the RAM size
> > detection code in common/memsize.c was made for. Just use it.
> 
> Yes, but you still need to read the DIP switch in the memsetup.S

No, this is NOT necessary.

> to properly initialise SDRAM. You can use this code only to report
> the memory size to U-Boot and the Linux.

No, this code is used to ADJUST the memory controller to  the  actual
sizes found on the board - you start with a preliminary configuration
of  the  memory  controller which assumes that all possible banks are
fitted with the maximum amountof memory; then you run  get_ram_size()
on  all  of these banks, disable those where a size of 0 is reported,
and adjust controller settings according to the  sizes  reported  for
the others.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Panic, n.: The second time you can't do it the first time.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot-Users] memory probe
  2005-05-12  8:42       ` Wolfgang Denk
@ 2005-05-12  9:06         ` Matej Kupljen
  2005-05-12  9:43           ` Wolfgang Denk
  0 siblings, 1 reply; 9+ messages in thread
From: Matej Kupljen @ 2005-05-12  9:06 UTC (permalink / raw)
  To: u-boot

Hi

> > to properly initialise SDRAM. You can use this code only to report
> > the memory size to U-Boot and the Linux.
> 
> No, this code is used to ADJUST the memory controller to  the  actual
> sizes found on the board - you start with a preliminary configuration
> of  the  memory  controller which assumes that all possible banks are
> fitted with the maximum amountof memory; then you run  get_ram_size()
> on  all  of these banks, disable those where a size of 0 is reported,
> and adjust controller settings according to the  sizes  reported  for
> the others.

I see.
But how can you determine the number of Column/Row address bits and the
number of internal SDRAM banks?
Those are the values for the registers MDCNFG for PXA255, for example.

BR,
Matej

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot-Users] memory probe
  2005-05-12  9:06         ` Matej Kupljen
@ 2005-05-12  9:43           ` Wolfgang Denk
  0 siblings, 0 replies; 9+ messages in thread
From: Wolfgang Denk @ 2005-05-12  9:43 UTC (permalink / raw)
  To: u-boot

In message <1115888767.9698.6.camel@orionlinux.starfleet.com> you wrote:
> 
> But how can you determine the number of Column/Row address bits and the
> number of internal SDRAM banks?

Just try it out :-)

See for example function initdram() in "board/tqm8xx/tqm8xx.c" - here
we assume to have a maximum of 2 banks of  SRAM,  and  try  out  both
banks both with 8, 9 and 10 columns each.

Of course we assume that you know which chips and how many banks  are
theoretically possible on your board.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Where there's no emotion, there's no motive for violence.
	-- Spock, "Dagger of the Mind", stardate 2715.1

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2005-05-12  9:43 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-10  2:09 [U-Boot-Users] memory probe Sumit Chauhan
2005-05-11 18:31 ` Matej Kupljen
2005-05-11 20:56   ` Wolfgang Denk
2005-05-12  8:15     ` Matej Kupljen
2005-05-12  8:42       ` Wolfgang Denk
2005-05-12  9:06         ` Matej Kupljen
2005-05-12  9:43           ` Wolfgang Denk
2005-05-11 18:38 ` Jon Loeliger
2005-05-11 18:44 ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox