From nobody Fri Dec 19 17:00:24 2025 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (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 E92D2316902 for ; Mon, 13 Oct 2025 15:27:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760369275; cv=none; b=SZKGUdPZY60pDgL0RzGeJvKFuvErbHKgEBm10r3w4qv1rvfL26TrcdmeA4aLW9xe0jL4Oxv/DE5n7sWixMUFSx1btxlmI4emVbxb21tTPVyQT3f6UDwOtq8k7nhdvTBtn0/c/ofanUAHpdeg37cGM2N0S06uSVB4UxaUOSQQ1X0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760369275; c=relaxed/simple; bh=MFyDMcWCo+UWJUpYXu4+2EBMuo5mynEUx0dy7DIkUfU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=f50oyi8Ob8xRDxfmO4okElqGqZFlZ0RDE3J5N4WWXp80+UPsi+JWI8CGo4gp3s0zcCmAmFg3wn/d3CGPBHWbFjwM+KzT9EAWOpgG+XdI2x5Gf+di9TwTgkXnbAs6eP7ttYqx4QQWzMljUgUiis8I9RXZAXSfXVL+zBAxhKzTW9U= 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=2xCN4Z5f; arc=none smtp.client-ip=185.171.202.116 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="2xCN4Z5f" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id A6944C093AF; Mon, 13 Oct 2025 15:27:33 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 9A6766067B; Mon, 13 Oct 2025 15:27:52 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 6D3FB102F1D5C; Mon, 13 Oct 2025 17:27:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1760369271; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding:in-reply-to:references; bh=SOkpWr5UpB5E+C7Aw7jnme4f1BA7kVlONeX9qzjGraw=; b=2xCN4Z5fCtG6eF8GhirqyrKJORF6cugZWA01bk3rit2QSiS8FzJ2TaH1391HhDeGCNk6DH S8H/GQ62urGPWfxWoFUlA6g0pDdFb7PVFcQ73IL8w4HA5QP/Gb7f3Ywt7/t2OGyZLrYFB3 kCl8RmWDvhhaoKqtrUfeLtYFnBbobWYMSexntp520mQXRxRNHduZZKGQOFpE6+yHc5wYk0 yBSLC4griHscEYx01KZYkwufm7rl5A8BEIKXhXTo5K0rRkWyQi3+IttJ0bndHrrr/+44KX ed0pZmLgDk36baSI+56+7UbIN+R7dEzsssFD1rrHdIPjPqAmi3YPyDrcY++9HQ== 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 v2 10/15] mtd: rawnand: sunxi: introduce reg_spare_area in sunxi_nfc_caps Date: Mon, 13 Oct 2025 17:26:40 +0200 Message-ID: <20251013152645.1119308-11-richard.genoud@bootlin.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251013152645.1119308-1-richard.genoud@bootlin.com> References: <20251013152645.1119308-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 spare area register is not at the same offset as the A10/A23 one, so move its offset into sunxi_nfc_caps. No functional change. Signed-off-by: Richard Genoud --- drivers/mtd/nand/raw/sunxi_nand.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/nand/raw/sunxi_nand.c b/drivers/mtd/nand/raw/sunxi= _nand.c index e8c08f0139d2..da7b8b81d39e 100644 --- a/drivers/mtd/nand/raw/sunxi_nand.c +++ b/drivers/mtd/nand/raw/sunxi_nand.c @@ -54,7 +54,8 @@ #define NFC_REG_ECC_ERR_CNT(nfc, x) ((nfc->caps->reg_ecc_err_cnt + (x)) & = ~0x3) #define NFC_REG_A10_USER_DATA 0x0050 #define NFC_REG_USER_DATA(nfc, x) (nfc->caps->reg_user_data + ((x) * 4)) -#define NFC_REG_SPARE_AREA 0x00A0 +#define NFC_REG_SPARE_AREA(nfc) (nfc->caps->reg_spare_area) +#define NFC_REG_A10_SPARE_AREA 0x00A0 #define NFC_REG_PAT_ID(nfc) (nfc->caps->reg_pat_id) #define NFC_REG_A10_PAT_ID 0x00A4 #define NFC_REG_MDMA_ADDR 0x00C0 @@ -228,6 +229,7 @@ static inline struct sunxi_nand_chip *to_sunxi_nand(str= uct nand_chip *nand) * @reg_io_data: I/O data register * @reg_ecc_err_cnt: ECC error counter register * @reg_user_data: User data register + * @reg_spare_area: Spare Area Register * @reg_pat_id: Pattern ID Register * @reg_pat_found: Data Pattern Status Register * @random_en_mask: RANDOM_EN mask in NFC_ECC_CTL register @@ -244,6 +246,7 @@ struct sunxi_nfc_caps { unsigned int reg_io_data; unsigned int reg_ecc_err_cnt; unsigned int reg_user_data; + unsigned int reg_spare_area; unsigned int reg_pat_id; unsigned int reg_pat_found; unsigned int random_en_mask; @@ -466,7 +469,7 @@ static void sunxi_nfc_select_chip(struct nand_chip *nan= d, unsigned int cs) if (sel->rb >=3D 0) ctl |=3D NFC_RB_SEL(sel->rb); =20 - writel(mtd->writesize, nfc->regs + NFC_REG_SPARE_AREA); + writel(mtd->writesize, nfc->regs + NFC_REG_SPARE_AREA(nfc)); =20 if (nfc->clk_rate !=3D sunxi_nand->clk_rate) { clk_set_rate(nfc->mod_clk, sunxi_nand->clk_rate); @@ -2226,6 +2229,7 @@ static const struct sunxi_nfc_caps sunxi_nfc_a10_caps= =3D { .reg_io_data =3D NFC_REG_A10_IO_DATA, .reg_ecc_err_cnt =3D NFC_REG_A10_ECC_ERR_CNT, .reg_user_data =3D NFC_REG_A10_USER_DATA, + .reg_spare_area =3D NFC_REG_A10_SPARE_AREA, .reg_pat_id =3D NFC_REG_A10_PAT_ID, .reg_pat_found =3D NFC_REG_ECC_ST, .random_en_mask =3D BIT(9), @@ -2243,6 +2247,7 @@ static const struct sunxi_nfc_caps sunxi_nfc_a23_caps= =3D { .reg_io_data =3D NFC_REG_A23_IO_DATA, .reg_ecc_err_cnt =3D NFC_REG_A10_ECC_ERR_CNT, .reg_user_data =3D NFC_REG_A10_USER_DATA, + .reg_spare_area =3D NFC_REG_A10_SPARE_AREA, .reg_pat_id =3D NFC_REG_A10_PAT_ID, .reg_pat_found =3D NFC_REG_ECC_ST, .random_en_mask =3D BIT(9),