[U-Boot] [PATCH] Use common function to set GPIOs for MX3 and MX5

David Jander david.jander at protonic.nl
Mon Aug 23 13:30:02 CEST 2010


Hi Stefano,

On Monday 23 August 2010 12:37:16 pm Stefano Babic wrote:
>[...]
> > In spi_cfg(), I saw this line:
> >
> > if (!(mode & SPI_CPOL))
> > 	sclkpol = 1;
> >
> > AFAIK, this should be:
> >
> > if (mode & SPI_CPOL)
> > 	sclkpol = 1;
> >
> > At least for the MX51. Can you confirm that this is different on the
> > MX31?
> 
> Agree. According to the MX51 Manual, the register must be set with:
> 	0 Active high polarity (0 = Idle).
> 	1 Active low polarity (1 = Idle).

I just checked in the reference manual of the i.MX31, and there the meaning of 
this bit has the same polarity as on the i.MX51, so you'll need to fix this 
also at the end of the spi_setup_slave() function, in the #else path of the 
#ifdef CONFIG_MX51 directive.

if (!(mode & SPI_CPOL))
	ctrl_reg |= MXC_CSPICTRL_POL;

should be:

if (mode & SPI_CPOL)
	ctrl_reg |= MXC_CSPICTRL_POL;

Would be nice if someone with a MX31 board could verify this.

> So we need to change both CONFIG_FSL_PMIC_MODE in config and in
> mxc_spi.c. Do you send a patch or do you prefer I will do this job ? I
> will add your signed-off-by if you agree.

I agree, and I guess you can better include it in your patch-set, otherwise 
I'd have to wait for your patches and then provide my own patch on top of 
that.... too complicated :-)

I am also adding support for S25FL032P chips to the spansion driver. Will post 
a patch later.

Right now I have correct detection of the chip, but the environment is not 
saved and read back correctly. Still investigating... maybe some chip 
configuration prolem in the spansion driver?

Best regards,

-- 
David Jander
Protonic Holland.


More information about the U-Boot mailing list