From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Fri, 9 Sep 2011 13:50:16 +0200 Subject: [U-Boot] [PATCH 18/31] iMX28: Add SPI driver In-Reply-To: <4E69D385.1050203@denx.de> References: <1315514579-19215-1-git-send-email-marek.vasut@gmail.com> <1315514579-19215-19-git-send-email-marek.vasut@gmail.com> <4E69D385.1050203@denx.de> Message-ID: <201109091350.16806.marek.vasut@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Friday, September 09, 2011 10:51:17 AM Stefano Babic wrote: > On 09/08/2011 10:42 PM, Marek Vasut wrote: > > Signed-off-by: Marek Vasut > > Cc: Stefano Babic > > Cc: Wolfgang Denk > > Cc: Detlev Zundel > > --- > > > > drivers/spi/Makefile | 1 + > > drivers/spi/mxs_spi.c | 174 > > +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 175 > > insertions(+), 0 deletions(-) > > create mode 100644 drivers/spi/mxs_spi.c > > > > diff --git a/drivers/spi/mxs_spi.c b/drivers/spi/mxs_spi.c > > new file mode 100644 > > index 0000000..b9c2f06 > > --- /dev/null > > +++ b/drivers/spi/mxs_spi.c > > Ok - now I am sure and I agree with your choice. Please then use mxs > consequently in all files. > > > @@ -0,0 +1,174 @@ > > +/* > > + * Freescale i.MX28 SPI driver > > + * > > + * Copyright (C) 2011 Marek Vasut > > + * on behalf of DENX Software Engineering GmbH > > + * > > + * This program is free software; you can redistribute it and/or > > + * modify it under the terms of the GNU General Public License as > > + * published by the Free Software Foundation; either version 2 of > > + * the License, or (at your option) any later version. > > + * > > + * This program is distributed in the hope that it will be useful, > > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > > + * GNU General Public License for more details. > > + * > > + * You should have received a copy of the GNU General Public License > > + * along with this program; if not, write to the Free Software > > + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, > > + * MA 02111-1307 USA > > + */ > > + > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > General comment: drop this stuff and include only imx-regs.h > > > + > > +#define MXS_SPI_MAX_TIMEOUT 1000000 > > + > > +static inline struct mx28_ssp_regs *to_mxs_regs(struct spi_slave *slave) > > +{ > > + return (struct mx28_ssp_regs *)(MXS_SSP0_BASE + (slave->bus * 0x2000)); > > +} > > + > > +void spi_init(void) > > +{ > > +} > > + > > +struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs, > > + unsigned int max_hz, unsigned int mode) > > +{ > > Only the CS supplied in the SOC are supported, it is not possible to use > a GPIO. Please add a comment to explain that. I don't think I understand here. > > Best regards, > Stefano Babic