Thread (1 message) 1 message, 1 author, 2025-10-22

Re: [PATCH v3 05/15] mtd: rawnand: sunxi: rework pattern found registers

From: Miquel Raynal <miquel.raynal@bootlin.com>
Date: 2025-10-22 09:02:42
Also in: linux-devicetree, linux-sunxi, lkml

Hi Richard,

On 20/10/2025 at 12:13:01 +02, Richard Genoud [off-list ref] wrote:
quoted hunk
On H6/H616, the register ECC_PAT_FOUND is at its own address, and not
part of ECC status register.
So, introduce the pattern found register offset in sunxi_nfc_caps, along
with its mask.

Also, introduce a non compile-time field_get() because FIELD_GET() and
u32_get_bits() don't work with non compile-time constant.
https://lore.kernel.org/lkml/cover.1739540679.git.geert+renesas@glider.be/ (local)

No functional change.

Signed-off-by: Richard Genoud <richard.genoud@bootlin.com>
---
 drivers/mtd/nand/raw/sunxi_nand.c | 36 ++++++++++++++++++++++++++-----
 1 file changed, 31 insertions(+), 5 deletions(-)
diff --git a/drivers/mtd/nand/raw/sunxi_nand.c b/drivers/mtd/nand/raw/sunxi_nand.c
index 8f5d8df19e33..4cfb5d3e9c06 100644
--- a/drivers/mtd/nand/raw/sunxi_nand.c
+++ b/drivers/mtd/nand/raw/sunxi_nand.c
@@ -29,6 +29,9 @@
 #include <linux/iopoll.h>
 #include <linux/reset.h>
 
+/* non compile-time field get */
+#define field_get(_mask, _reg) (((_reg) & (_mask)) >> (ffs(_mask) -
1))
I see there are already 26 users for this, let's hope it gets merged
soon and this one dropped.

Not a blocker for me.

Miquèl
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help