cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Observer
Observer
14,607 Views
Registered: ‎07-22-2013

change RAM size

Jump to solution

hi,

 

working on zc702 has 1GB RAM.

 

i m moving to board with 512KB RAM .

 

where are changes need to be done ?

do i need to change in the linux parts ( like the u-boot, kernel,device tree )?

or in the PLAN Ahead (+ fsbl ) ? 

 

thanks

Ari

 

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Scholar
Scholar
20,945 Views
Registered: ‎05-28-2013
Yup, that's correct for the bootloader.

You'll also need to change the device tree in the kernel: arch/arm/boot/dts/zynq-zc702.dts. The second value after <reg> is the size, here set to 512M.

memory {
device_type = "memory";
reg = <0x00000000 0x20000000>;
};

Lastly, you'll need to check the settings in ISE/Vivado when generating the FSBL. Ultimately this is what configures the memory controller.

View solution in original post

0 Kudos
5 Replies
Highlighted
Adventurer
Adventurer
14,603 Views
Registered: ‎05-18-2011

Hello Ari,

I haven't had to do this myself yet, but I have noticed in u-boot that the config file for the Zed board (include/configs/zynq_zed.h) contains the following line:

 

#define PHYS_SDRAM_1_SIZE (512 * 1024 * 1024)

 

There is a similar line (but specifing 1GB of RAM) in zynq_zc70x.h.  I presume you would be generating your own u-boot by customizing one of these existing files.

 

I haven't tracked down the source of the memory size specification given to the Linux kernel yet, but I know that the kernel running on my microZed board is aware that it has 1Gbyte to play with, despite the fact that I boot it with a u-boot that says it has only 512Mbyte of RAM.  I presume that it picks that up from the device tree blob.  (At least, that's where it would pick it up in my view of an ideal world).

 

It would be fairly easy for you to experiment with this on your zc702 board -- boot it up, look at the contents of /proc/meminfo.  Edit the memory size and recompile your devicetree dts file to say it has only 512Mbyte of memory, reboot, and look at the new contents of /proc/meminfo.

 

I hope this helps.

 

--wpd

 

0 Kudos
Highlighted
Scholar
Scholar
20,946 Views
Registered: ‎05-28-2013
Yup, that's correct for the bootloader.

You'll also need to change the device tree in the kernel: arch/arm/boot/dts/zynq-zc702.dts. The second value after <reg> is the size, here set to 512M.

memory {
device_type = "memory";
reg = <0x00000000 0x20000000>;
};

Lastly, you'll need to check the settings in ISE/Vivado when generating the FSBL. Ultimately this is what configures the memory controller.

View solution in original post

0 Kudos
Highlighted
Observer
Observer
14,588 Views
Registered: ‎07-22-2013

changing zedboard to work with 256KB works fine.

 

zynq> cat proc/meminfo
MemTotal: 253872 kB

 

thanks.

Best Regards

 

Ari

 

 

0 Kudos
Highlighted
Mentor
Mentor
14,552 Views
Registered: ‎06-10-2008

Are you saying that if I don't tell the FSBL about all my RAM the rest won't be able to use it?

 

I would imagine that neither the FSBL nor U-boot really need to know about all memory as long as they don't need that much, and that only the devicetree needs the correct value for linux to use it all.

 

Maarten

0 Kudos
Highlighted
Scholar
Scholar
14,549 Views
Registered: ‎05-28-2013
The FSBL needs to have the correct memory settings (this includes the capacity, and a lot more detailed other stuff). Otherwise memory will not work, or will be unreliable.

Normally on a PC with removable memory (DIMM), these same parameters are stored in a small serial eeprom (SPD). The BIOS reads these and configures the memory controller accordingly. But the Zynq handles this in the FSBL.

U-boot only uses a small amount of RAM, mostly just to hold the kernel and ramdisk temporarily. So whether it is configured for 256MB or 512MB really doesn't matter too much, since it really only needs perhaps 16MB.
0 Kudos