diff mbox

[U-Boot] Revert "warp: Use imx_ddr_size() for calculating the DDR size"

Message ID 1471021952-20482-1-git-send-email-breno.lima@nxp.com
State Rejected
Delegated to: Stefano Babic
Headers show

Commit Message

Breno Matheus Lima Aug. 12, 2016, 5:12 p.m. UTC
Commit a13d3757f7df25d0 "warp: Use imx_ddr_size() for calculating the DDR size"
causes breakage on warp board.

U-boot gets stuck in the DRAM line. It's necessary to revert this patch until
a better solution is found, otherwise it's not possible to use the board.

This reverts commit a13d3757f7df25d0f017e85551b899d598ad1bdb.

Signed-off-by: Breno Lima <breno.lima@nxp.com>
---
 board/warp/warp.c      | 2 +-
 include/configs/warp.h | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

Comments

Fabio Estevam Aug. 12, 2016, 7:38 p.m. UTC | #1
Hi Otavio,

On Fri, Aug 12, 2016 at 3:27 PM, Otavio Salvador
<otavio.salvador@ossystems.com.br> wrote:

> Why is this happening? I am fine in reverting this but we need to fix
> the detection. Is it due memory callibration problems?

The problem here is that warp uses the DDR initialization from mx6sl-evk.

From configs/mx6slevk_defconfig:
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx6slevk/imximage.cfg,MX6SL"

The usage of imx_ddr_size() revealed that the DDR size is not being
programmed correctly for the warp board.

The proper way to fix this is to create a board/warp/imximage.cfg file
with the DDR configuration done specifically for this board.

Then imx_ddr_size() should work without issues for warp.

Until this is done, better go with the revert patch for now:

Tested-by: Fabio Estevam <fabio.estevam@nxp.com>
Fabio Estevam Aug. 12, 2016, 7:40 p.m. UTC | #2
On Fri, Aug 12, 2016 at 4:38 PM, Fabio Estevam <festevam@gmail.com> wrote:
> Hi Otavio,
>
> On Fri, Aug 12, 2016 at 3:27 PM, Otavio Salvador
> <otavio.salvador@ossystems.com.br> wrote:
>
>> Why is this happening? I am fine in reverting this but we need to fix
>> the detection. Is it due memory callibration problems?
>
> The problem here is that warp uses the DDR initialization from mx6sl-evk.
>
> From configs/mx6slevk_defconfig:

Here I meant configs/warp_defconfig instead.
Stefano Babic Aug. 12, 2016, 9:07 p.m. UTC | #3
Hi Fabio,

On 12/08/2016 21:38, Fabio Estevam wrote:
> Hi Otavio,
> 
> On Fri, Aug 12, 2016 at 3:27 PM, Otavio Salvador
> <otavio.salvador@ossystems.com.br> wrote:
> 
>> Why is this happening? I am fine in reverting this but we need to fix
>> the detection. Is it due memory callibration problems?
> 
> The problem here is that warp uses the DDR initialization from mx6sl-evk.
> 
> From configs/mx6slevk_defconfig:
> CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx6slevk/imximage.cfg,MX6SL"
> 
> The usage of imx_ddr_size() revealed that the DDR size is not being
> programmed correctly for the warp board.
> 

That means that reverting just hides the problem.

> The proper way to fix this is to create a board/warp/imximage.cfg file
> with the DDR configuration done specifically for this board.
> 
> Then imx_ddr_size() should work without issues for warp.
> 
> Until this is done, better go with the revert patch for now:
> 
> Tested-by: Fabio Estevam <fabio.estevam@nxp.com>

Let's say: if there won't be any fix before the release, it is ok to
revert this.

Regards,
Stefano
Otavio Salvador Aug. 12, 2016, 9:17 p.m. UTC | #4
On Fri, Aug 12, 2016 at 6:07 PM, Stefano Babic <sbabic@denx.de> wrote:
> Hi Fabio,
>
> On 12/08/2016 21:38, Fabio Estevam wrote:
>> Hi Otavio,
>>
>> On Fri, Aug 12, 2016 at 3:27 PM, Otavio Salvador
>> <otavio.salvador@ossystems.com.br> wrote:
>>
>>> Why is this happening? I am fine in reverting this but we need to fix
>>> the detection. Is it due memory callibration problems?
>>
>> The problem here is that warp uses the DDR initialization from mx6sl-evk.
>>
>> From configs/mx6slevk_defconfig:
>> CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx6slevk/imximage.cfg,MX6SL"
>>
>> The usage of imx_ddr_size() revealed that the DDR size is not being
>> programmed correctly for the warp board.
>>
>
> That means that reverting just hides the problem.
>
>> The proper way to fix this is to create a board/warp/imximage.cfg file
>> with the DDR configuration done specifically for this board.
>>
>> Then imx_ddr_size() should work without issues for warp.
>>
>> Until this is done, better go with the revert patch for now:
>>
>> Tested-by: Fabio Estevam <fabio.estevam@nxp.com>
>
> Let's say: if there won't be any fix before the release, it is ok to
> revert this.

Agreed. We ought to fix the calibration so we don't need to hide the issue.
Fabio Estevam Aug. 13, 2016, 12:49 a.m. UTC | #5
Hi Stefano,

On Fri, Aug 12, 2016 at 6:07 PM, Stefano Babic <sbabic@denx.de> wrote:

> Let's say: if there won't be any fix before the release, it is ok to
> revert this.

Fair enough. I have prepared a patch that adds a imximage file for
warp and fix the MDCTL register.

Breno will test it on Monday.

Regards,

Fabio Estevam
Fabio Estevam Aug. 15, 2016, 1:26 p.m. UTC | #6
Hi Stefano,

On Fri, Aug 12, 2016 at 9:49 PM, Fabio Estevam <festevam@gmail.com> wrote:
> Hi Stefano,
>
> On Fri, Aug 12, 2016 at 6:07 PM, Stefano Babic <sbabic@denx.de> wrote:
>
>> Let's say: if there won't be any fix before the release, it is ok to
>> revert this.
>
> Fair enough. I have prepared a patch that adds a imximage file for
> warp and fix the MDCTL register.
>
> Breno will test it on Monday.

Breno confirmed my patch fixes the warp board boot. I have just
submitted to the list.

Regards,

Fabio Estevam
diff mbox

Patch

diff --git a/board/warp/warp.c b/board/warp/warp.c
index 0bc0a6a..49dfdb6 100644
--- a/board/warp/warp.c
+++ b/board/warp/warp.c
@@ -46,7 +46,7 @@  DECLARE_GLOBAL_DATA_PTR;
 
 int dram_init(void)
 {
-	gd->ram_size = imx_ddr_size();
+	gd->ram_size = get_ram_size((void *)PHYS_SDRAM, PHYS_SDRAM_SIZE);
 
 	return 0;
 }
diff --git a/include/configs/warp.h b/include/configs/warp.h
index 12c7c38..4a8e270 100644
--- a/include/configs/warp.h
+++ b/include/configs/warp.h
@@ -43,6 +43,7 @@ 
 /* Physical Memory Map */
 #define CONFIG_NR_DRAM_BANKS		1
 #define PHYS_SDRAM			MMDC0_ARB_BASE_ADDR
+#define PHYS_SDRAM_SIZE			SZ_512M
 
 #define CONFIG_SYS_SDRAM_BASE		PHYS_SDRAM
 #define CONFIG_SYS_INIT_RAM_ADDR	IRAM_BASE_ADDR