Patchwork [U-Boot,v2,03/10] mx23evk: Adjust DRAM control register to use full 128MB of RAM

login
register
mail settings
Submitter Otavio Salvador
Date Feb. 11, 2013, 1:35 p.m.
Message ID <1360589756-26355-4-git-send-email-otavio@ossystems.com.br>
Download mbox | patch
Permalink /patch/219601/
State Changes Requested
Delegated to: Stefano Babic
Headers show

Comments

Otavio Salvador - Feb. 11, 2013, 1:35 p.m.
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>
---
Changes in v2: None

 board/freescale/mx23evk/spl_boot.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
Marek Vasut - Feb. 13, 2013, 9:13 p.m.
Dear Otavio Salvador,

> Adjust HW_DRAM_CTL14 to enable the chip selects to allow usage of full
> 128MB of RAM.

Why can this not be enabled globally?

> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---
> Changes in v2: None
> 
>  board/freescale/mx23evk/spl_boot.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/board/freescale/mx23evk/spl_boot.c
> b/board/freescale/mx23evk/spl_boot.c 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));

Best regards,
Marek Vasut
Otavio Salvador - Feb. 13, 2013, 9:21 p.m.
On Wed, Feb 13, 2013 at 7:13 PM, Marek Vasut <marex@denx.de> wrote:
> Dear Otavio Salvador,
>
>> Adjust HW_DRAM_CTL14 to enable the chip selects to allow usage of full
>> 128MB of RAM.
>
> Why can this not be enabled globally?

Because it breaks mx23_olinuxino; it is a good reason for me.

>> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
>> ---
>> Changes in v2: None
>>
>>  board/freescale/mx23evk/spl_boot.c | 10 ++++++++++
>>  1 file changed, 10 insertions(+)
>>
>> diff --git a/board/freescale/mx23evk/spl_boot.c
>> b/board/freescale/mx23evk/spl_boot.c 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));
>
> Best regards,
> Marek Vasut
Marek Vasut - Feb. 13, 2013, 9:33 p.m.
Dear Otavio Salvador,

> On Wed, Feb 13, 2013 at 7:13 PM, Marek Vasut <marex@denx.de> wrote:
> > Dear Otavio Salvador,
> > 
> >> Adjust HW_DRAM_CTL14 to enable the chip selects to allow usage of full
> >> 128MB of RAM.
> > 
> > Why can this not be enabled globally?
> 
> Because it breaks mx23_olinuxino; it is a good reason for me.

Can you elaborate please?

Best regards,
Marek Vasut
Otavio Salvador - Feb. 13, 2013, 9:38 p.m.
On Wed, Feb 13, 2013 at 7:33 PM, Marek Vasut <marex@denx.de> wrote:
> Dear Otavio Salvador,
>
>> On Wed, Feb 13, 2013 at 7:13 PM, Marek Vasut <marex@denx.de> wrote:
>> > Dear Otavio Salvador,
>> >
>> >> Adjust HW_DRAM_CTL14 to enable the chip selects to allow usage of full
>> >> 128MB of RAM.
>> >
>> > Why can this not be enabled globally?
>>
>> Because it breaks mx23_olinuxino; it is a good reason for me.
>
> Can you elaborate please?

From cover letter:

   The DRAM control register change has been kept specific to mx23evk as
    it breaks mx23_olinuxino (as it than reads only 16MB)

--
Otavio Salvador                             O.S. Systems
E-mail: otavio@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br
Marek Vasut - Feb. 14, 2013, 4:43 p.m.
Dear Otavio Salvador,

> On Wed, Feb 13, 2013 at 7:33 PM, Marek Vasut <marex@denx.de> wrote:
> > Dear Otavio Salvador,
> > 
> >> On Wed, Feb 13, 2013 at 7:13 PM, Marek Vasut <marex@denx.de> wrote:
> >> > Dear Otavio Salvador,
> >> > 
> >> >> Adjust HW_DRAM_CTL14 to enable the chip selects to allow usage of
> >> >> full 128MB of RAM.
> >> > 
> >> > Why can this not be enabled globally?
> >> 
> >> Because it breaks mx23_olinuxino; it is a good reason for me.
> > 
> > Can you elaborate please?
> 
> From cover letter:
> 
>    The DRAM control register change has been kept specific to mx23evk as
>     it breaks mx23_olinuxino (as it than reads only 16MB)

That's unfortunate.

Best regards,
Marek Vasut

Patch

diff --git a/board/freescale/mx23evk/spl_boot.c b/board/freescale/mx23evk/spl_boot.c
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));