From nobody Mon Feb 9 16:51:51 2026 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9FF0F2FC003 for ; Mon, 20 Oct 2025 10:14:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760955250; cv=none; b=ATywifpOYDYk4VKjCCtib2I0EqEXGWKw6DpAZwy0SwPtlwHvjY3whV08fgeFM+qwZhYCkj0H0Le8XCKZ0y0I4CUdPW2TKyMpuyA9BQhptAFuz2yFznfmTet3bo2zU9Fus24DZW2xF24nPAN76GDNy53AbyAIU2iqG/v2aKuf6Zg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760955250; c=relaxed/simple; bh=vo2EsEgL5782s2PoyUx3Sbpe6Jv2LpXCh5yn2MGkOTE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OAtsgGijsJhELtFDH3jz8U0pA2EMJp8WH0ElsesdHhZ9ualYqtxjhkmGHMDY9gVAMFa2t6xAkUkpKgwP5iHb0ID8/ibQu+WZS+Q74TJgfVuvuBZyQv27UGzjpB0J9eES7zmG/haPI3GPJlNiP3WO498ro4cLqCYrcNN8h3JcnM4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=JTi3XvXq; arc=none smtp.client-ip=185.246.85.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="JTi3XvXq" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 14F144E411EF; Mon, 20 Oct 2025 10:14:07 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id DEEF6606D5; Mon, 20 Oct 2025 10:14:06 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 85A58102F0848; Mon, 20 Oct 2025 12:14:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1760955246; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding:in-reply-to:references; bh=FMTlrYQnhBYB/I9vVH4uQ6alkyuaVWds87Lxblu5MFA=; b=JTi3XvXqyLRTc+1kHnPUqWRUc9qyZwtWY0VW5qn0J0rDE6U+sZLJTLmaR8LU8yygaX35fJ Uq470RNzBS0TJKthvzrCIbdrpK6i4jU+74OyjQaz9ufFx3GNS7qWim3I+iQ7Flee+ro7KH x+A3/dXToE7lBwsAXWzCh1dgrZ/ySZVcLRPSTxu+2MVYUWfuRqodXv9/t3xOzz1L4+jylC Z8phuAlG4sP6WWhBcAqnFfy9VudrUXoAdYA/JYsb4SxdS06zazNzqE37SNEaVkr4+09y6O wlrEz9X1nNeTj7Z0PwTRDUiq8M++OSn+dDBsAk9bdemWuv0cFzsHuH3x0gtpwA== From: Richard Genoud To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Wentao Liang , Johan Hovold , Maxime Ripard , Thomas Petazzoni , linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, Richard Genoud Subject: [PATCH v3 11/15] mtd: rawnand: sunxi: introduce ecc_err_mask in sunxi_nfc_caps Date: Mon, 20 Oct 2025 12:13:07 +0200 Message-ID: <20251020101311.256819-12-richard.genoud@bootlin.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251020101311.256819-1-richard.genoud@bootlin.com> References: <20251020101311.256819-1-richard.genoud@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Last-TLS-Session-Version: TLSv1.3 Content-Type: text/plain; charset="utf-8" The H6/H616 error mask register is bigger than the A10/A23 one, so move its mask into sunxi_nfc_caps. No functional change Signed-off-by: Richard Genoud --- drivers/mtd/nand/raw/sunxi_nand.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/nand/raw/sunxi_nand.c b/drivers/mtd/nand/raw/sunxi= _nand.c index da7b8b81d39e..3de5642c05a8 100644 --- a/drivers/mtd/nand/raw/sunxi_nand.c +++ b/drivers/mtd/nand/raw/sunxi_nand.c @@ -155,7 +155,7 @@ =20 /* define bit use in NFC_ECC_ST */ #define NFC_ECC_ERR(x) BIT(x) -#define NFC_ECC_ERR_MSK GENMASK(15, 0) +#define NFC_ECC_ERR_MSK(nfc) (nfc->caps->ecc_err_mask) =20 /* * define bit use in NFC_REG_PAT_FOUND @@ -235,6 +235,7 @@ static inline struct sunxi_nand_chip *to_sunxi_nand(str= uct nand_chip *nand) * @random_en_mask: RANDOM_EN mask in NFC_ECC_CTL register * @random_dir_mask: RANDOM_DIRECTION mask in NFC_ECC_CTL register * @ecc_mode_mask: ECC_MODE mask in NFC_ECC_CTL register + * @ecc_err_mask: NFC_ECC_ERR mask in NFC_ECC_ST register * @pat_found_mask: ECC_PAT_FOUND mask in NFC_REG_PAT_FOUND register * @dma_maxburst: DMA maxburst * @ecc_strengths: Available ECC strengths array @@ -252,6 +253,7 @@ struct sunxi_nfc_caps { unsigned int random_en_mask; unsigned int random_dir_mask; unsigned int ecc_mode_mask; + unsigned int ecc_err_mask; unsigned int pat_found_mask; unsigned int dma_maxburst; const u8 *ecc_strengths; @@ -1030,7 +1032,7 @@ static int sunxi_nfc_hw_ecc_read_chunks_dma(struct na= nd_chip *nand, uint8_t *buf sunxi_nfc_hw_ecc_update_stats(nand, &max_bitflips, ret); } =20 - if (status & NFC_ECC_ERR_MSK) { + if (status & NFC_ECC_ERR_MSK(nfc)) { for (i =3D 0; i < nchunks; i++) { int data_off =3D i * ecc->size; int oob_off =3D i * (ecc->bytes + 4); @@ -2235,6 +2237,7 @@ static const struct sunxi_nfc_caps sunxi_nfc_a10_caps= =3D { .random_en_mask =3D BIT(9), .random_dir_mask =3D BIT(10), .ecc_mode_mask =3D GENMASK(15, 12), + .ecc_err_mask =3D GENMASK(15, 0), .pat_found_mask =3D GENMASK(31, 16), .dma_maxburst =3D 4, .ecc_strengths =3D sunxi_ecc_strengths_a10, @@ -2253,6 +2256,7 @@ static const struct sunxi_nfc_caps sunxi_nfc_a23_caps= =3D { .random_en_mask =3D BIT(9), .random_dir_mask =3D BIT(10), .ecc_mode_mask =3D GENMASK(15, 12), + .ecc_err_mask =3D GENMASK(15, 0), .pat_found_mask =3D GENMASK(31, 16), .dma_maxburst =3D 8, .ecc_strengths =3D sunxi_ecc_strengths_a10,