[U-Boot] [PATCH 1/3 v2] 83xx: Default to using DMA to initialize SDRAM

Jerry Van Baren gerald.vanbaren at ge.com
Thu Jul 9 19:00:23 CEST 2009


Ira W. Snyder wrote:
> On Wed, Jul 08, 2009 at 05:58:50PM -0700, Ira W. Snyder wrote:
>> On Wed, Jul 08, 2009 at 07:32:26PM -0500, Peter Tyser wrote:
>>> On Thu, 2009-07-09 at 08:24 +0800, Liu Dave-R63238 wrote:

[snip]

>> Both the DMA and CPU methods are definitely on the same order of
>> magnitude. The time taken by the CFI flash driver is MUCH longer than
>> the SDRAM initialization. I wonder, should the icache be enabled for
>> that as well?
>>
>> I'll do some more testing when I get back to the office tomorrow.
>>
> 
> Ok, I've added back the get_tbms() code, and created a routine to
> initialize ECC with the CPU. I've inlined my patch below, just for
> reference.
> 
> DMA 945ms
> CPU 581ms
> 
> As an interesting comparison, I also benchmarked the method of using the
> DDR controller to initialize ECC.
> 
> DDRC 129ms
> 
> So there you have it. Dave Liu is correct, the CPU method is faster,
> though definitely on the same order of magnitude with the
> icache_enable()/icache_disable() patch.

Thanks for the measurements and the update.

> I may stick with the DDRC method on my board, the difference is just
> amazing. The flash init still takes up most of the boot process,
> however.
> 
> Peter, feel free to fold the patch below into your own work.
> Ira

[snip]

FWIIW, and it doesn't materially change your results, but it would have 
been better to duplicate the get_tbms() call and put it directly around 
the *_meminit() calls rather than having the print statements inside the 
timed part.  Since U-Boot printing is a blocking call (generally), you 
are adding the UART Tx time to your measurement.

#if 0
	debug("\nInitializing ECC (using DMA)!\n");
	s = get_tbms();
  	dma_meminit(CONFIG_MEM_INIT_VALUE, dram_size);
#else
	debug("\nInitializing ECC (using CPU)!\n");
	s = get_tbms();
	cpu_meminit(CONFIG_MEM_INIT_VALUE, dram_size);
#endif
	e = get_tbms();


> +	s = get_tbms();
> +#if 0
> +	debug("\nInitializing ECC (using DMA)!\n");
>  	dma_meminit(CONFIG_MEM_INIT_VALUE, dram_size);
> +#else
> +	debug("\nInitializing ECC (using CPU)!\n");
> +	cpu_meminit(CONFIG_MEM_INIT_VALUE, dram_size);
> +#endif
> +	e = get_tbms();
>  
>  	debug("\nREADY!\n");
> +	debug("ddr init duration: %ld ms\n", e - s);
>  
>  	/* Clear All ECC Errors */
>  	if ((ddr->err_detect & ECC_ERROR_DETECT_MME) == ECC_ERROR_DETECT_MME)

Thanks,
gvb


More information about the U-Boot mailing list