[PATCH v1 7/8] ARM: at91: Add initialize function to sdramc

Sam Ravnborg sam at ravnborg.org
Mon May 16 08:13:06 PDT 2022


Hi Ahmad,

On Mon, May 16, 2022 at 12:47:52PM +0200, Ahmad Fatoum wrote:
> Hello Sam,
> 
> On 15.05.22 21:38, Sam Ravnborg wrote:
> > +int at91sam9_sdramc_initialize(const struct at91sam9_sdramc_config *config,
> > +			       unsigned int sdram_address)
> > +{
> > +	unsigned int i;
> > +
> > +	/* Step#1 SDRAM feature must be in the configuration register */
> > +	sdramc_wr(config, AT91_SDRAMC_CR, config->cr);
> > +
> > +	/* Step#2 For mobile SDRAM, temperature-compensated self refresh(TCSR),... */
> > +
> > +	/* Step#3 The SDRAM memory type must be set in the Memory Device Register */
> > +	sdramc_wr(config, AT91_SDRAMC_MDR, config->mdr);
> > +
> > +	/* Step#4 The minimum pause of 200 us is provided to precede any single toggle */
> > +	for (i = 0; i < 1000; i++) ;
> 
> This and similar instances below must be replaced by proper delays.
> You can use early_udelay for this as you already initialize the PIT.
> 
> Did you test SDRAM worked with this setup? I assumed this to be at least
> one of the reasons current at91bootstrap fails to work with current compilers
> for the 9263. (Newer SoCs use a different DRAM controller and thus a different
> driver that doesn't use compile-time removable delay loops).

Thanks, I already looked at these with a question mark in my head but
then forgot about them - will fix.

And no - this is not yet tested, just ported from at91bootstrap.

	Sam



More information about the barebox mailing list