From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
To: cip-dev@lists.cip-project.org,
Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>,
Pavel Machek <pavel@denx.de>
Cc: Biju Das <biju.das.jz@bp.renesas.com>
Subject: [PATCH 5.10.y-cip 04/11] memory: renesas-rpc-if: refactor MOIIO and IOFV macros
Date: Fri, 12 Aug 2022 11:13:10 +0100 [thread overview]
Message-ID: <20220812101317.12380-5-prabhakar.mahadev-lad.rj@bp.renesas.com> (raw)
In-Reply-To: <20220812101317.12380-1-prabhakar.mahadev-lad.rj@bp.renesas.com>
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
commit 3542de6a5b159fac0e7ca84d77a57ea99125d6b1 upstream.
Don't use _HIZ macros but also provide a val. This is more consistent
with the other macros and, thus, easier to read. Also shorter.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20211119110442.4946-1-wsa+renesas@sang-engineering.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
drivers/memory/renesas-rpc-if.c | 20 ++++++++------------
1 file changed, 8 insertions(+), 12 deletions(-)
diff --git a/drivers/memory/renesas-rpc-if.c b/drivers/memory/renesas-rpc-if.c
index b98eed3f3ab2..7163d93a6498 100644
--- a/drivers/memory/renesas-rpc-if.c
+++ b/drivers/memory/renesas-rpc-if.c
@@ -24,14 +24,13 @@
#define RPCIF_CMNCR_MOIIO2(val) (((val) & 0x3) << 20)
#define RPCIF_CMNCR_MOIIO1(val) (((val) & 0x3) << 18)
#define RPCIF_CMNCR_MOIIO0(val) (((val) & 0x3) << 16)
-#define RPCIF_CMNCR_MOIIO_HIZ (RPCIF_CMNCR_MOIIO0(3) | \
- RPCIF_CMNCR_MOIIO1(3) | \
- RPCIF_CMNCR_MOIIO2(3) | RPCIF_CMNCR_MOIIO3(3))
+#define RPCIF_CMNCR_MOIIO(val) (RPCIF_CMNCR_MOIIO0(val) | RPCIF_CMNCR_MOIIO1(val) | \
+ RPCIF_CMNCR_MOIIO2(val) | RPCIF_CMNCR_MOIIO3(val))
#define RPCIF_CMNCR_IO3FV(val) (((val) & 0x3) << 14) /* documented for RZ/G2L */
#define RPCIF_CMNCR_IO2FV(val) (((val) & 0x3) << 12) /* documented for RZ/G2L */
#define RPCIF_CMNCR_IO0FV(val) (((val) & 0x3) << 8)
-#define RPCIF_CMNCR_IOFV_HIZ (RPCIF_CMNCR_IO0FV(3) | RPCIF_CMNCR_IO2FV(3) | \
- RPCIF_CMNCR_IO3FV(3))
+#define RPCIF_CMNCR_IOFV(val) (RPCIF_CMNCR_IO0FV(val) | RPCIF_CMNCR_IO2FV(val) | \
+ RPCIF_CMNCR_IO3FV(val))
#define RPCIF_CMNCR_BSZ(val) (((val) & 0x3) << 0)
#define RPCIF_SSLDR 0x0004 /* R/W */
@@ -335,17 +334,14 @@ int rpcif_hw_init(struct rpcif *rpc, bool hyperflash)
if (rpc->type == RPCIF_RCAR_GEN3)
regmap_update_bits(rpc->regmap, RPCIF_CMNCR,
- RPCIF_CMNCR_MOIIO_HIZ | RPCIF_CMNCR_BSZ(3),
- RPCIF_CMNCR_MOIIO_HIZ |
+ RPCIF_CMNCR_MOIIO(3) | RPCIF_CMNCR_BSZ(3),
+ RPCIF_CMNCR_MOIIO(3) |
RPCIF_CMNCR_BSZ(hyperflash ? 1 : 0));
else
regmap_update_bits(rpc->regmap, RPCIF_CMNCR,
- RPCIF_CMNCR_MOIIO_HIZ | RPCIF_CMNCR_IOFV_HIZ |
+ RPCIF_CMNCR_MOIIO(3) | RPCIF_CMNCR_IOFV(3) |
RPCIF_CMNCR_BSZ(3),
- RPCIF_CMNCR_MOIIO3(1) | RPCIF_CMNCR_MOIIO2(1) |
- RPCIF_CMNCR_MOIIO1(1) | RPCIF_CMNCR_MOIIO0(1) |
- RPCIF_CMNCR_IO3FV(2) | RPCIF_CMNCR_IO2FV(2) |
- RPCIF_CMNCR_IO0FV(2) |
+ RPCIF_CMNCR_MOIIO(1) | RPCIF_CMNCR_IOFV(2) |
RPCIF_CMNCR_BSZ(hyperflash ? 1 : 0));
/* Set RCF after BSZ update */
--
2.17.1
next prev parent reply other threads:[~2022-08-12 10:13 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-12 10:13 [PATCH 5.10.y-cip 00/11] Renesas RPCI-IF and RSPI driver fixes and improvements Lad Prabhakar
2022-08-12 10:13 ` [PATCH 5.10.y-cip 01/11] memory: renesas-rpc-if: Silence clang warning Lad Prabhakar
2022-08-12 10:13 ` [PATCH 5.10.y-cip 02/11] memory: renesas-rpc-if: simplify register update Lad Prabhakar
2022-08-12 10:13 ` [PATCH 5.10.y-cip 03/11] memory: renesas-rpc-if: avoid use of undocumented bits Lad Prabhakar
2022-08-12 10:13 ` Lad Prabhakar [this message]
2022-08-12 10:13 ` [PATCH 5.10.y-cip 05/11] memory: renesas-rpc-if: Simplify single/double data register access Lad Prabhakar
2022-08-12 10:13 ` [PATCH 5.10.y-cip 06/11] memory: renesas-rpc-if: simplify platform_get_resource_byname() Lad Prabhakar
2022-08-12 10:13 ` [PATCH 5.10.y-cip 07/11] spi: rpc-if: Fix RPM imbalance in probe error path Lad Prabhakar
2022-08-12 10:13 ` [PATCH 5.10.y-cip 08/11] spi: spi-rspi: : use proper DMAENGINE API for termination Lad Prabhakar
2022-08-12 10:13 ` [PATCH 5.10.y-cip 09/11] spi: rspi: drop unneeded MODULE_ALIAS Lad Prabhakar
2022-08-12 10:13 ` [PATCH 5.10.y-cip 10/11] spi: spi-rspi: Drop redeclaring ret variable in qspi_transfer_in() Lad Prabhakar
2022-08-12 10:13 ` [PATCH 5.10.y-cip 11/11] spi: spi-rspi: Fix PIO fallback on RZ platforms Lad Prabhakar
2022-08-13 14:17 ` [PATCH 5.10.y-cip 00/11] Renesas RPCI-IF and RSPI driver fixes and improvements Pavel Machek
2022-08-16 21:48 ` Pavel Machek
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=20220812101317.12380-5-prabhakar.mahadev-lad.rj@bp.renesas.com \
--to=prabhakar.mahadev-lad.rj@bp.renesas.com \
--cc=biju.das.jz@bp.renesas.com \
--cc=cip-dev@lists.cip-project.org \
--cc=nobuhiro1.iwamatsu@toshiba.co.jp \
--cc=pavel@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.