IMX 53 change RAM size. U-boot or/and Linux .

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

IMX 53 change RAM size. U-boot or/and Linux .

跳至解决方案
11,892 次查看
janiscoders
Contributor III

Hi, we have a custom board based on imx53 QSB, but we have 4*128 MB of RAM (512MB) unlike QSB which has 4*256 MB (1GB).

Everything was working fine until one day we noticed that on large data copying or when RAM is used a lot, then our board (Linux) just hangs and everything stops without any feedback.

I didn't change anything in RAM configuration, because everything was fine. If I make a load on RAM and watch the free memory using free command, then I see that everything hangs around 256MB of memory usage.

I've tried passing the mem=512M value from u-boot, but still the hanging issue. If I pass around 240M, then everything is fine.

So the questions are - could this be a RAM issue? Maybe this is the CS (Chip Select) register issue, because it thinks it has 512Mb. Does everything is reinitialized in Linux from zero? OR memory is initialized in u-boot and fixing there will fix Linux too? Because u-boot is working fine and I don't want to spend time messing there and have no results in Linux.

Could you point me to files in source code where those values can be modified?

Thank you. 

标签 (2)
标记 (2)
0 项奖励
回复
1 解答
3,903 次查看
fabio_estevam
NXP Employee
NXP Employee

The memory initialization is done in the bootloader and the kernel just uses whatever the bootloder has configured.

In U-boot, you can look at the memory initializations at (using mx53 qsb as example here):

uboot-imx.git - Freescale i.MX u-boot Tree

And the RAM size is also passed in the board config file:

http://git.freescale.com/git/cgit.cgi/imx/uboot-imx.git/tree/include/configs/mx53_loco.h?h=imx_v2009...

Search for PHYS_SDRAM_1.

Regards,

Fabio Estevam

在原帖中查看解决方案

0 项奖励
回复
4 回复数
3,904 次查看
fabio_estevam
NXP Employee
NXP Employee

The memory initialization is done in the bootloader and the kernel just uses whatever the bootloder has configured.

In U-boot, you can look at the memory initializations at (using mx53 qsb as example here):

uboot-imx.git - Freescale i.MX u-boot Tree

And the RAM size is also passed in the board config file:

http://git.freescale.com/git/cgit.cgi/imx/uboot-imx.git/tree/include/configs/mx53_loco.h?h=imx_v2009...

Search for PHYS_SDRAM_1.

Regards,

Fabio Estevam

0 项奖励
回复
3,903 次查看
kubiznak_petr
Contributor V

Hi Fabio,

I'm currently meeting the same problem on Vybrid. Our custom board uses 256 MB DDR3 (128 MB x 16), compared to Tower which uses 128 MB ddr. So I changed the value of PHYS_SDRAM_1_SIZE from (128 * 1024 * 1024) to (256 * 1024 * 1024) in both vybrid.h and vybrid_iram.h in include/configs/. Nothing changed though, still printing "DRAM:  128 MiB" in the U-Boot start sequence.

In board/freescale/vybrid/vybrid.c I noticed that function dram_init() sets a variable gd->ram_size to the value computed in ddr_ctrl_init(). Using md command, I displayed values of the registers used to compute the value (registers DDR_CR001, DDR_CR073, DDR_CR078) and calculated it manually, getting value 0x00200000, which does not make sense.

Don't you please see where the problem could be? Should I somewhere set the 16 bit word length instead of changing PHYS_SDRAM_1_SIZE?

Thank you, Petr

0 项奖励
回复
3,903 次查看
fabio_estevam
NXP Employee
NXP Employee

Hi Petr,

I am not familiar with the Vybrid DDR controller.

I would suggest you to start a new thread so that someone knowledgeable on this line could assist.

Regards,

Fabio Estevam

0 项奖励
回复
3,903 次查看
janiscoders
Contributor III

Thank you really much. It seems like that fixed the problem. Simply changed to

#define PHYS_SDRAM_1   CSD0_BASE_ADDR

#define PHYS_SDRAM_1_SIZE    (256 * 1024 * 1024)

#define PHYS_SDRAM_2   CSD1_BASE_ADDR

#define PHYS_SDRAM_2_SIZE    (256 * 1024 * 1024)


in mx53_loco.h without modifying flash_header.S !

And lesson learned - memory initialization is performed only in u-boot.


0 项奖励
回复