imx233 128MB ram and u-boot.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

imx233 128MB ram and u-boot.

Jump to solution
3,040 Views
pierreparent
Contributor III

Hi,

I have a custom board with an imx233 BGA and 2 chip of ram 64MB (one wired on each chip select).

Linux boots correctly on it.

The problem I have is whatever I do u-boot says I have only 64MB of RAM, but I should have 128MB. Do you know if there is any software adjustments to do so that it can work?

Thank you in advance,

Regards,

Pierre.

Labels (2)
0 Kudos
1 Solution
1,342 Views
fabio_estevam
NXP Employee
NXP Employee

Pierre,

mx23evk detects 128MB correctly. You may need to adapt this following commit into your board:

commit 920178d38133e76da8b0394b0d3f088e7afbaee7

Author: Otavio Salvador <otavio@ossystems.com.br>

Date:   Sat Feb 23 02:43:06 2013 +0000

    mx23evk: Adjust DRAM control register to use full 128MB of RAM

  

    Adjust HW_DRAM_CTL14 to enable the chip selects to allow usage of full

    128MB of RAM.

  

    Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>

diff --git a/board/freescale/mx23evk/spl_boot.c b/board/freescale/mx23evk/spl_bo

index 6007433..b6f4e7e 100644

--- a/board/freescale/mx23evk/spl_boot.c

+++ b/board/freescale/mx23evk/spl_boot.c

@@ -98,6 +98,16 @@ const iomux_cfg_t iomux_setup[] = {

                (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),

};

+#define HW_DRAM_CTL14  (0x38 >> 2)

+#define CS_MAP         0x3

+#define INTAREF                0x2

+#define HW_DRAM_CTL14_CONFIG   (INTAREF << 8 | CS_MAP)

+

+void mxs_adjust_memory_params(uint32_t *dram_vals)

+{

+       dram_vals[HW_DRAM_CTL14] = HW_DRAM_CTL14_CONFIG;

+}

+

void board_init_ll(void)

{

        mxs_common_spl_init(iomux_setup, ARRAY_SIZE(iomux_setup));

View solution in original post

0 Kudos
7 Replies
1,342 Views
pierreparent
Contributor III

By the way:

Did anyone test u-boot with the evaluation kit? Did u-boot detect that there was 2 rams and 128MB?


(There might very well be an electronic problem on our board, but it seems strange because everything else works fine)

I'm just reading the freescale doc it says:

The number of connected chip selects and their connection orientation is based on the programming in

the HW_DRAM_CTL14_CS_MAP bit field. Because the internal DRAM controller supports up to 4

memory chips, this field is structured to support either one, two, or four memory chips. However, because

only 2 memory chip selects are pinned out on the 169BGA package and only 1 memory chip select is

pinned out on the 128QFP package, not all CS_MAP configurations can be used.

Below are examples of valid system configurations for the CS_MAP bit field:

CS_MAP = b0001: One memory device is connected to EMI_CE0n (configuration supported in

128LQFP and 169BGA).

CS_MAP = b0010: One memory device is connected to EMI_CE1n (configuration supported in

169BGA only).

CS_MAP = b0011: Two memory devices are connected - one to EMI_CE0n and one to

EMI_CE1n. (configuration supported in 169BGA only).

So it seems that a register needs to be configured, doesn't it?

0 Kudos
1,343 Views
fabio_estevam
NXP Employee
NXP Employee

Pierre,

mx23evk detects 128MB correctly. You may need to adapt this following commit into your board:

commit 920178d38133e76da8b0394b0d3f088e7afbaee7

Author: Otavio Salvador <otavio@ossystems.com.br>

Date:   Sat Feb 23 02:43:06 2013 +0000

    mx23evk: Adjust DRAM control register to use full 128MB of RAM

  

    Adjust HW_DRAM_CTL14 to enable the chip selects to allow usage of full

    128MB of RAM.

  

    Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>

diff --git a/board/freescale/mx23evk/spl_boot.c b/board/freescale/mx23evk/spl_bo

index 6007433..b6f4e7e 100644

--- a/board/freescale/mx23evk/spl_boot.c

+++ b/board/freescale/mx23evk/spl_boot.c

@@ -98,6 +98,16 @@ const iomux_cfg_t iomux_setup[] = {

                (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),

};

+#define HW_DRAM_CTL14  (0x38 >> 2)

+#define CS_MAP         0x3

+#define INTAREF                0x2

+#define HW_DRAM_CTL14_CONFIG   (INTAREF << 8 | CS_MAP)

+

+void mxs_adjust_memory_params(uint32_t *dram_vals)

+{

+       dram_vals[HW_DRAM_CTL14] = HW_DRAM_CTL14_CONFIG;

+}

+

void board_init_ll(void)

{

        mxs_common_spl_init(iomux_setup, ARRAY_SIZE(iomux_setup));

0 Kudos
1,342 Views
pierreparent
Contributor III

Ok I see thanks!

I added this patch to my u-boot config it now says that I have ... 16MB of ram! What?

I'm going to try with a cleaner u-boot version because the one I use is a little dirty...

0 Kudos
1,342 Views
pierreparent
Contributor III

Even with a clean u-boot from git repository with imx23evk_config I get 16MiB of ram, very strange...

Might be an electronic problem, then I guess...

0 Kudos
1,342 Views
pierreparent
Contributor III

Ok it works! :smileyhappy: 128mio!

So at first I had a u-boot configuration problem as you pointed out.

I had also a small solder bridge which prevented the second ram to work. Now it's fine!

0 Kudos
1,342 Views
igorpadykov
NXP Employee
NXP Employee

Hi Pierre

in uboot2009.08 one can check parameters in include/configs/mx23_evk.h :

#define CONFIG_NR_DRAM_BANKS    
#define PHYS_SDRAM_1  

#define PHYS_SDRAM_1_SIZE

Best regards

igor

0 Kudos
1,342 Views
pierreparent
Contributor III

Thanks for the answer.

Here is what I have:

#define CONFIG_NR_DRAM_BANKS   1   /* 1 bank of DRAM */
#define PHYS_SDRAM_1   0x40000000    /* Base address */
#define PHYS_SDRAM_1_SIZE   0x08000000    /* Max 128 MB RAM */
#define CONFIG_SYS_SDRAM_BASE

Is it correct?

0 Kudos