From nobody Fri Feb 13 00:23:27 2026 Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) (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 924AE190051 for ; Thu, 2 Jan 2025 11:51:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.19.141 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735818710; cv=none; b=a1IzSzZLHOkRJ6eGjqZGFZUZuQ6I9u8g1rqUV7qwNf705djCZ/MyJ+fSTqURAfmE8ZXoAwuCg2x4fdV7qDZP3R42V/wrWmAOqtne/1cO9zgOJfNGKNagHVJBn9IEA7/qkp0q2BgzQHKSOXi9EBi4EFSu7r0HD3Fw866E/cnz+TA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735818710; c=relaxed/simple; bh=ejhuPG3PLm7XPaTvQW/573celeztX5NeLQVvx9SdsBs=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=uERjzer/sedo6TBE+dlRVHbfQGyrTy4Nn37ondkg17UTRzfjRUYT0v4OfYLemi2EVAjRwr/iMKYov9mnp8D9FI2lrQVaDOVF7t5AKiWOLyOsTURS+egLo9X9zUS23aeqMdlewYMXEeLe0iZiGImLcVTjTJBE8L8cvYxIv2VaiT8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=J14/uFTC; arc=none smtp.client-ip=198.47.19.141 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="J14/uFTC" Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 502BpX2c066186; Thu, 2 Jan 2025 05:51:33 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1735818693; bh=2ihi518FrpHlUh7aqD5W5G2gv9XA3z0+PgM902AWRhQ=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=J14/uFTCTJucpIaQMUh4w3GB5hJevBNMiTavzqwJn8qQiZ4eZFsbM+xaqHs8zgb68 UamOJqZYTOQtLk9eN8yYM1wTgxh4+t93K9tUPnoe9c3JtBrCtpWA/XpfC/dZ9qqDO3 FvWqxX997Kf8C9pkmqAQyJ/nqnUMGa7Pvm4tg5Ug= Received: from DLEE113.ent.ti.com (dlee113.ent.ti.com [157.170.170.24]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 502BpXKf126459 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 2 Jan 2025 05:51:33 -0600 Received: from DLEE108.ent.ti.com (157.170.170.38) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Thu, 2 Jan 2025 05:51:32 -0600 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Thu, 2 Jan 2025 05:51:33 -0600 Received: from santhoshkumark.dhcp.ti.com (santhoshkumark.dhcp.ti.com [172.24.227.241]) by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 502BpLpH030343; Thu, 2 Jan 2025 05:51:30 -0600 From: Santhosh Kumar K To: , , , , CC: , , , Subject: [PATCH 3/3] mtd: spinand: winbond: Fix oob_layout for W25N01JW Date: Thu, 2 Jan 2025 17:21:10 +0530 Message-ID: <20250102115110.1402440-4-s-k6@ti.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250102115110.1402440-1-s-k6@ti.com> References: <20250102115110.1402440-1-s-k6@ti.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-C2ProcessedOrg: 333ef613-75bf-4e12-a4b1-8e3623f5dcea Content-Type: text/plain; charset="utf-8" Fix the W25N01JW's oob_layout according to the datasheet. [1] [1] https://www.winbond.com/hq/product/code-storage-flash-memory/qspinand-f= lash/?__locale=3Den&partNo=3DW25N01JW Fixes: 6a804fb72de5 ("mtd: spinand: winbond: add support for serial NAND fl= ash") CC: Sridharan S N Signed-off-by: Santhosh Kumar K --- Hi, Sridharan, Do you have a different revision of W25N01JW with a different oob_layout? If yes, can you please provide the datasheet of that? Regards, Santhosh. drivers/mtd/nand/spi/winbond.c | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/nand/spi/winbond.c b/drivers/mtd/nand/spi/winbond.c index fbe41e76ad64..de05b3e2b9df 100644 --- a/drivers/mtd/nand/spi/winbond.c +++ b/drivers/mtd/nand/spi/winbond.c @@ -115,6 +115,30 @@ static int w25n02kv_ooblayout_free(struct mtd_info *mt= d, int section, return 0; } =20 +static int w25n01jw_ooblayout_ecc(struct mtd_info *mtd, int section, + struct mtd_oob_region *region) +{ + if (section > 3) + return -ERANGE; + + region->offset =3D (16 * section) + 12; + region->length =3D 4; + + return 0; +} + +static int w25n01jw_ooblayout_free(struct mtd_info *mtd, int section, + struct mtd_oob_region *region) +{ + if (section > 3) + return -ERANGE; + + region->offset =3D (16 * section) + 2; + region->length =3D 10; + + return 0; +} + static int w35n01jw_ooblayout_ecc(struct mtd_info *mtd, int section, struct mtd_oob_region *region) { @@ -154,6 +178,11 @@ static const struct mtd_ooblayout_ops w35n01jw_ooblayo= ut =3D { .free =3D w35n01jw_ooblayout_free, }; =20 +static const struct mtd_ooblayout_ops w25n01jw_ooblayout =3D { + .ecc =3D w25n01jw_ooblayout_ecc, + .free =3D w25n01jw_ooblayout_free, +}; + static int w25n02kv_ecc_get_status(struct spinand_device *spinand, u8 status) { @@ -230,7 +259,7 @@ static const struct spinand_info winbond_spinand_table[= ] =3D { &write_cache_variants, &update_cache_variants), 0, - SPINAND_ECCINFO(&w25m02gv_ooblayout, NULL)), + SPINAND_ECCINFO(&w25n01jw_ooblayout, NULL)), SPINAND_INFO("W25N01KV", /* 3.3V */ SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xae, 0x21), NAND_MEMORG(1, 2048, 96, 64, 1024, 20, 1, 1, 1), --=20 2.34.1