All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joel Stanley <joel@jms.id.au>
To: Jeremy Kerr <jk@ozlabs.org>, Andrew Jeffery <andrew@aj.id.au>
Cc: openbmc@lists.ozlabs.org
Subject: [PATCH linux dev-5.3 4/7] fsi: aspeed: Only select OPB0 once
Date: Fri, 25 Oct 2019 12:03:48 +1100	[thread overview]
Message-ID: <20191025010351.30298-5-joel@jms.id.au> (raw)
In-Reply-To: <20191025010351.30298-1-joel@jms.id.au>

The driver can leve OPB0 selected to save a AHB write per OPB operation.

Signed-off-by: Joel Stanley <joel@jms.id.au>
---
 drivers/fsi/fsi-master-aspeed.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/fsi/fsi-master-aspeed.c b/drivers/fsi/fsi-master-aspeed.c
index d2c01956663f..58b090e2cf46 100644
--- a/drivers/fsi/fsi-master-aspeed.c
+++ b/drivers/fsi/fsi-master-aspeed.c
@@ -197,7 +197,6 @@ static u32 opb_write(void __iomem *base, uint32_t addr, uint32_t val,
 	if (xfer_size < 0)
 		return xfer_size;
 
-	writel(0x1, base + OPB0_SELECT);
 	writel(CMD_WRITE, base + OPB0_RW);
 	writel(xfer_size, base + OPB0_XFER_SIZE);
 	writel(addr, base + OPB0_FSI_ADDR);
@@ -233,7 +232,6 @@ static int opb_read(void __iomem *base, uint32_t addr, size_t size, u32 *out)
 	if (xfer_size < 0)
 		return xfer_size;
 
-	writel(0x1, base + OPB0_SELECT);
 	writel(CMD_READ, base + OPB0_RW);
 	writel(xfer_size, base + OPB0_XFER_SIZE);
 	writel(addr, base + OPB0_FSI_ADDR);
@@ -596,6 +594,13 @@ static int fsi_master_aspeed_probe(struct platform_device *pdev)
 	writel(0x0011bb1b, aspeed->base + OPB0_W_ENDIAN);
 	writel(0xffaa5500, aspeed->base + 0x50);
 
+	/*
+	 * Select OPB0 for all operations.
+	 * Will need to be reworked when enabling DMA or anything that uses
+	 * OPB1.
+	 */
+	writel(0x1, aspeed->base + OPB0_SELECT);
+
 	rc = opb_read(aspeed->base, ctrl_base + FSI_MVER, 4, &raw);
 	if (rc) {
 		dev_err(&pdev->dev, "failed to read hub version\n");
-- 
2.23.0

  parent reply	other threads:[~2019-10-25  1:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-25  1:03 [PATCH linux dev-5.3 0/7] AST2600 FSI speed improvements Joel Stanley
2019-10-25  1:03 ` [PATCH linux dev-5.3 1/7] fsi: aspeed: busy loop in the write case Joel Stanley
2019-10-25  1:52   ` Andrew Jeffery
2019-10-25  1:03 ` [PATCH linux dev-5.3 2/7] fsi: master: Change default divisor to 14 Joel Stanley
2019-10-25  1:56   ` Andrew Jeffery
2019-10-25  1:03 ` [PATCH linux dev-5.3 3/7] fsi: aspeed: Enable relative addressing Joel Stanley
2019-10-25  1:57   ` Andrew Jeffery
2019-10-25  1:03 ` Joel Stanley [this message]
2019-10-25  1:59   ` [PATCH linux dev-5.3 4/7] fsi: aspeed: Only select OPB0 once Andrew Jeffery
2019-10-25  1:03 ` [PATCH linux dev-5.3 5/7] fsi: aspeed: Avoid copying read data twice Joel Stanley
2019-10-25  2:09   ` Andrew Jeffery
2019-10-25  1:03 ` [PATCH linux dev-5.3 6/7] fsi: aspeed: Pass fsi_master_aspeed insead of base Joel Stanley
2019-10-25  1:03 ` [PATCH linux dev-5.3 7/7] fsi: aspeed: Special case repeated full word reads Joel Stanley
2019-10-29  3:16   ` Jeremy Kerr
2019-10-29  3:53     ` Joel Stanley

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=20191025010351.30298-5-joel@jms.id.au \
    --to=joel@jms.id.au \
    --cc=andrew@aj.id.au \
    --cc=jk@ozlabs.org \
    --cc=openbmc@lists.ozlabs.org \
    /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.