public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Vikas Manocha <vikas.manocha@st.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v7 1/6] spi: cadence_qspi: move trigger base configuration in init
Date: Wed, 23 Sep 2015 17:19:31 -0700	[thread overview]
Message-ID: <1443053976-9112-2-git-send-email-vikas.manocha@st.com> (raw)
In-Reply-To: <1443053976-9112-1-git-send-email-vikas.manocha@st.com>

No need to configure indirect trigger address for every read/write.

Signed-off-by: Vikas Manocha <vikas.manocha@st.com>
---

Changes in v7: None
Changes in v6: None
Changes in v5: fixed type cast compilation warnings.
Changes in v4: removed extra type casts.
Changes in v3: added commit message & removed extra bracket.
Changes in v2: Rebased to master

 drivers/spi/cadence_qspi_apb.c |    9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/spi/cadence_qspi_apb.c b/drivers/spi/cadence_qspi_apb.c
index d053407..d377ad1 100644
--- a/drivers/spi/cadence_qspi_apb.c
+++ b/drivers/spi/cadence_qspi_apb.c
@@ -534,6 +534,8 @@ void cadence_qspi_apb_controller_init(struct cadence_spi_platdata *plat)
 
 	/* Indirect mode configurations */
 	writel((plat->sram_size/2), plat->regbase + CQSPI_REG_SRAMPARTITION);
+	writel((u32)plat->ahbbase & CQSPI_INDIRECTTRIGGER_ADDR_MASK,
+	       plat->regbase + CQSPI_REG_INDIRECTTRIGGER);
 
 	/* Disable all interrupts */
 	writel(0, plat->regbase + CQSPI_REG_IRQMASK);
@@ -693,10 +695,6 @@ int cadence_qspi_apb_indirect_read_setup(struct cadence_spi_platdata *plat,
 		/* for normal read (only ramtron as of now) */
 		addr_bytes = cmdlen - 1;
 
-	/* Setup the indirect trigger address */
-	writel(((u32)plat->ahbbase & CQSPI_INDIRECTTRIGGER_ADDR_MASK),
-	       plat->regbase + CQSPI_REG_INDIRECTTRIGGER);
-
 	/* Configure the opcode */
 	rd_reg = cmdbuf[0] << CQSPI_REG_RD_INSTR_OPCODE_LSB;
 
@@ -790,9 +788,6 @@ int cadence_qspi_apb_indirect_write_setup(struct cadence_spi_platdata *plat,
 		       cmdlen, (unsigned int)cmdbuf);
 		return -EINVAL;
 	}
-	/* Setup the indirect trigger address */
-	writel(((u32)plat->ahbbase & CQSPI_INDIRECTTRIGGER_ADDR_MASK),
-	       plat->regbase + CQSPI_REG_INDIRECTTRIGGER);
 
 	/* Configure the opcode */
 	reg = cmdbuf[0] << CQSPI_REG_WR_INSTR_OPCODE_LSB;
-- 
1.7.9.5

  reply	other threads:[~2015-09-24  0:19 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-24  0:19 [U-Boot] [PATCH v7 0/6] spi: cadence_qspi: optimize & fix indirect rd-writes Vikas Manocha
2015-09-24  0:19 ` Vikas Manocha [this message]
2015-09-24  7:22   ` [U-Boot] [PATCH v7 1/6] spi: cadence_qspi: move trigger base configuration in init Wolfgang Denk
2015-09-24 18:12     ` Vikas MANOCHA
2015-09-24 18:56       ` Wolfgang Denk
2015-09-24 19:39         ` Jagan Teki
2015-09-24 22:32           ` Wolfgang Denk
2015-09-25 23:25             ` Vikas MANOCHA
2015-09-24  0:19 ` [U-Boot] [PATCH v7 2/6] spi: cadence_qspi: fix indirect read/write start address Vikas Manocha
2015-09-24  7:18   ` Wolfgang Denk
2015-09-24  0:19 ` [U-Boot] [PATCH v7 3/6] spi: cadence_qspi: fix base trigger address & transfer " Vikas Manocha
2015-09-24  7:24   ` Wolfgang Denk
2015-09-24  7:49   ` Wolfgang Denk
2015-09-24  0:19 ` [U-Boot] [PATCH v7 4/6] spi: cadence_qspi: rename ahbbase to flashbase for clarity Vikas Manocha
2015-09-24  0:19 ` [U-Boot] [PATCH v7 5/6] spi: cadence_qspi: remove unused macro Vikas Manocha
2015-09-24  0:19 ` [U-Boot] [PATCH v7 6/6] spi: cadence_qspi: get fifo width from device tree Vikas Manocha
2015-09-24  7:34   ` Wolfgang Denk

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=1443053976-9112-2-git-send-email-vikas.manocha@st.com \
    --to=vikas.manocha@st.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