public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marek.vasut@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/4] SPI: Add SPI driver support for Marvell Armada100
Date: Mon, 19 Sep 2011 12:55:47 +0200	[thread overview]
Message-ID: <201109191255.47759.marek.vasut@gmail.com> (raw)
In-Reply-To: <1316429230-5957-1-git-send-email-ajay.bhargav@einfochips.com>

On Monday, September 19, 2011 12:47:07 PM Ajay Bhargav wrote:
> This patch provides support for SPI emulated over SSP for Marvell
> Armada100 SOC.
> 
> Signed-off-by: Ajay Bhargav <ajay.bhargav@einfochips.com>
> ---
>  arch/arm/include/asm/arch-armada100/spi.h |  111 ++++++++++++++++
>  drivers/spi/Makefile                      |    1 +
>  drivers/spi/armada100_spi.c               |  205
> +++++++++++++++++++++++++++++ 3 files changed, 317 insertions(+), 0
> deletions(-)
>  create mode 100644 arch/arm/include/asm/arch-armada100/spi.h
>  create mode 100644 drivers/spi/armada100_spi.c
> 

[...]

> +
> +#define SSCR1_TXTRESH(x)	((x - 1) << 6)	/* level [1..16] */
> +#define SSCR1_RXTRESH(x)	((x - 1) << 10)	/* level [1..16] */

((x) - 1), missing parenthesis, please fix globally.

> +#define SSCR1_TINTE		(1 << 19)	/* Receiver Time-out
> +						   Interrupt enable */
> +
> +#define SSCR0_DSS		0x0f		/* Data Size Select (mask) */
> +#define SSCR0_DATASIZE(x)	(x - 1)		/* Data Size Select [4..16] */
> +#define SSCR0_FRF		0x30		/* FRame Format (mask) */
> +#define SSCR0_MOTO		(0x0 << 4)	/* Motorola's Serial
> +						   Peripheral Interface */
> +#define SSCR0_TI		(0x1 << 4)	/* TI's Synchronous
> +						   Serial Protocol (SSP) */
> +#define SSCR0_NATIONAL		(0x2 << 4)	/* National Microwire */
> +#define SSCR0_ECS		(1 << 6)	/* External clock select */
> +#define SSCR0_SSE		(1 << 7)	/* Synchronous Serial Port
> +						   Enable */
> +
> +#define SSSR_TNF	(1 << 2)	/* Transmit FIFO Not Full */
> +#define SSSR_RNE	(1 << 3)	/* Receive FIFO Not Empty */
> +#define SSSR_BSY	(1 << 4)	/* SSP Busy */
> +#define SSSR_TFS	(1 << 5)	/* Transmit FIFO Service Request */
> +#define SSSR_RFS	(1 << 6)	/* Receive FIFO Service Request */
> +#define SSSR_ROR	(1 << 7)	/* Receive FIFO Overrun */
> +#define SSSR_TINT	(1 << 19)	/* Receiver Time-out Interrupt */

[...]

> +
> +static void null_writer(struct armd_spi_slave *pss)
> +{
> +	while (!(readl(&pss->spi_reg->sssr) & SSSR_TNF))
> +		;

Please avoid endless loops, please fix globally.


Cheers

  reply	other threads:[~2011-09-19 10:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-19 10:47 [U-Boot] [PATCH 1/4] SPI: Add SPI driver support for Marvell Armada100 Ajay Bhargav
2011-09-19 10:55 ` Marek Vasut [this message]
2011-09-19 10:46   ` Ajay Bhargav
2011-09-19 11:08     ` Marek Vasut
2011-09-19 14:22 ` Mike Frysinger

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=201109191255.47759.marek.vasut@gmail.com \
    --to=marek.vasut@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox