[U-Boot-Users] memory probe

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

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

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

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

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

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

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

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

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
participants (4)
-
Jon Loeliger
-
Matej Kupljen
-
Sumit Chauhan
-
Wolfgang Denk