mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Anton Bondarenko <anton.bondarenko.sama@gmail.com>
To: broonie@kernel.org, b38343@freescale.com, s.hauer@pengutronix.de
Cc: linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	vladimir_zapolskiy@mentor.com, jiada_wang@mentor.com
Subject: [PATCH v6 1/8] spi: imx: fix loopback mode setup after controller reset
Date: Tue,  8 Dec 2015 07:43:43 +0100	[thread overview]
Message-ID: <1449557030-27525-2-git-send-email-anton.bondarenko.sama@gmail.com> (raw)
In-Reply-To: <1449557030-27525-1-git-send-email-anton.bondarenko.sama@gmail.com>

If controller hold in reset it's not possible to write any
register except CTRL. So all other registers must be updated
only after controller bring out from reset.

Signed-off-by: Anton Bondarenko <anton.bondarenko.sama@gmail.com>
---
 drivers/spi/spi-imx.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c
index 410522f..3aa33c8 100644
--- a/drivers/spi/spi-imx.c
+++ b/drivers/spi/spi-imx.c
@@ -356,6 +356,9 @@ static int __maybe_unused mx51_ecspi_config(struct spi_imx_data *spi_imx,
 	else
 		cfg &= ~MX51_ECSPI_CONFIG_SSBPOL(config->cs);
 
+	/* CTRL register always go first to bring out controller from reset */
+	writel(ctrl, spi_imx->base + MX51_ECSPI_CTRL);
+
 	reg = readl(spi_imx->base + MX51_ECSPI_TESTREG);
 	if (config->mode & SPI_LOOP)
 		reg |= MX51_ECSPI_TESTREG_LBC;
@@ -363,7 +366,6 @@ static int __maybe_unused mx51_ecspi_config(struct spi_imx_data *spi_imx,
 		reg &= ~MX51_ECSPI_TESTREG_LBC;
 	writel(reg, spi_imx->base + MX51_ECSPI_TESTREG);
 
-	writel(ctrl, spi_imx->base + MX51_ECSPI_CTRL);
 	writel(cfg, spi_imx->base + MX51_ECSPI_CONFIG);
 
 	/*
-- 
2.6.3


  reply	other threads:[~2015-12-08  6:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-08  6:43 [PATCH v6 0/8] Improvements for SPI IMX driver for Freescale ECSPI controller, continuation Anton Bondarenko
2015-12-08  6:43 ` Anton Bondarenko [this message]
2015-12-08  6:43 ` [PATCH v6 2/8] spi: imx: enable loopback only for ECSPI controller family Anton Bondarenko
2015-12-08  6:43 ` [PATCH v6 3/8] spi: imx: return error from dma channel request Anton Bondarenko
2015-12-08  6:43 ` [PATCH v6 4/8] spi: imx: defer spi initialization, if DMA engine is Anton Bondarenko
2015-12-08  6:43 ` [PATCH v6 5/8] spi: imx: allow only WML aligned transfers to use DMA Anton Bondarenko
2015-12-15 18:27   ` Mark Brown
2015-12-08  6:43 ` [PATCH v6 6/8] spi: imx: remove dead RX DMA tail handling code Anton Bondarenko
2015-12-08  6:43 ` [PATCH v6 7/8] spi: imx: replace fixed timeout with calculated Anton Bondarenko
2015-12-08  6:43 ` [PATCH v6 8/8] spi: imx: add support for all SPI word width for DMA Anton Bondarenko
2015-12-15  9:41   ` Robin Gong

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=1449557030-27525-2-git-send-email-anton.bondarenko.sama@gmail.com \
    --to=anton.bondarenko.sama@gmail.com \
    --cc=b38343@freescale.com \
    --cc=broonie@kernel.org \
    --cc=jiada_wang@mentor.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=vladimir_zapolskiy@mentor.com \
    /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

all inboxes | Powered by JetHome®