All of lore.kernel.org
 help / color / mirror / Atom feed
From: Detlev Zundel <dzu@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/3] mpc52xx: Add SPI driver.
Date: Mon, 08 Jun 2009 17:58:21 +0200	[thread overview]
Message-ID: <m2fxea67ky.fsf@ohwell.denx.de> (raw)
In-Reply-To: <1243416179-64368-1-git-send-email-gjb@semihalf.com> (Grzegorz Bernacki's message of "Wed, 27 May 2009 11:22:57 +0200")

Hi Grzegorz,

> Signed-off-by: Grzegorz Bernacki <gjb@semihalf.com>
> ---
>  drivers/spi/Makefile      |    1 +
>  drivers/spi/mpc52xx_spi.c |  108 +++++++++++++++++++++++++++++++++++++++++++++
>  include/mpc5xxx.h         |   18 +++++++
>  3 files changed, 127 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/spi/mpc52xx_spi.c
>
> diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile
> index 1350f3e..1272c17 100644
> --- a/drivers/spi/Makefile
> +++ b/drivers/spi/Makefile
> @@ -28,6 +28,7 @@ LIB	:= $(obj)libspi.a
>  COBJS-$(CONFIG_ATMEL_DATAFLASH_SPI) += atmel_dataflash_spi.o
>  COBJS-$(CONFIG_ATMEL_SPI) += atmel_spi.o
>  COBJS-$(CONFIG_BFIN_SPI) += bfin_spi.o
> +COBJS-$(CONFIG_MPC52XX_SPI) += mpc52xx_spi.o
>  COBJS-$(CONFIG_MPC8XXX_SPI) += mpc8xxx_spi.o
>  COBJS-$(CONFIG_MXC_SPI) += mxc_spi.o
>  COBJS-$(CONFIG_SOFT_SPI) += soft_spi.o
> diff --git a/drivers/spi/mpc52xx_spi.c b/drivers/spi/mpc52xx_spi.c
> new file mode 100644
> index 0000000..6dae7ad
> --- /dev/null
> +++ b/drivers/spi/mpc52xx_spi.c
> @@ -0,0 +1,108 @@
> +/*
> + * (C) Copyright 2009
> + * Frank Bodammer <frank.bodammer@gcd-solutions.de>
> + * (C) Copyright 2009 Semihalf, Grzegorz Bernacki
> + *
> + * See file CREDITS for list of people who contributed to this
> + * project.
> + *
> + * 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 <common.h>
> +#include <malloc.h>
> +#include <spi.h>
> +#include <mpc5xxx.h>
> +
> +void spi_init(void)
> +{
> +	struct mpc5xxx_spi *spi = (struct mpc5xxx_spi *)MPC5XXX_SPI;
> +	/*
> +	 * Its important to use the correct order when initializing the
> +	 * registers
> +	 */
> +	spi->ddr = 0x0F;	/* set all SPI pins as output */

Here and below you want to use accessor macros - please check the whole
patch.

Cheers
  Detlev

-- 
The latest code  looks a bit similar to the old  [linux] big-reader-locks  hack
(which got dropped for good many eons ago and with which i deny any involvement
with, such as having authored it. [oh, did i say that out loud? crap.]), imple-
mented cleanly and properly.     -- Ingo Molnar <20090428124033.GA1655@elte.hu>
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de

      parent reply	other threads:[~2009-06-08 15:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-27  9:22 [U-Boot] [PATCH 1/3] mpc52xx: Add SPI driver Grzegorz Bernacki
2009-05-27  9:22 ` [U-Boot] [PATCH 2/3] digsy MTC: Add SPI support Grzegorz Bernacki
2009-06-08 15:57   ` Detlev Zundel
2009-05-27  9:22 ` [U-Boot] [PATCH 3/3] digsy MTC: Add 'mtc' command Grzegorz Bernacki
2009-06-08 16:06   ` Detlev Zundel
2009-06-08 15:58 ` Detlev Zundel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2fxea67ky.fsf@ohwell.denx.de \
    --to=dzu@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.