From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from submarine.notk.org (submarine.notk.org [62.210.214.84]) (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 3DA3D3C5522 for ; Sun, 16 Aug 2026 11:19:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.210.214.84 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786879176; cv=none; b=LsNlT32FI/dTch3tKI4l9tU8yIlen5mfvF3a6087EEV8DyKOLBMLL/lQPwgRvgcdZUX41rxtdHsGZrK8BMfdbatnA+Ls+R94HJXLB3g6/BMUjw/caID2PcZHrfOUGg0fPxZvFCYBdLMlgweEnZskdUBolVfVKZLHkH7GKBdY6hQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786879176; c=relaxed/simple; bh=OEMkwjcg9+cmpg2gdnOyEFY0GvIX8sdA1BSuosJQnKU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rpKpvgFyxFJwjpy00IypL3c3P2HBUn7BBIkqsn86TR/1+IrBZzvZHcX/dH6UYHX6JRsCJQzV662tSPN8Osx1BO7CL3v17q17FiqIPLvyncwAohzGdU5mABKKMJfiJcwf36jNb2ZZyjsHwGE2IXSBtsnQqEjIKA7Wjw2BOBprSlQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=codewreck.org; spf=pass smtp.mailfrom=codewreck.org; dkim=pass (2048-bit key) header.d=codewreck.org header.i=@codewreck.org header.b=o5PTRdNf; arc=none smtp.client-ip=62.210.214.84 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=codewreck.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=codewreck.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=codewreck.org header.i=@codewreck.org header.b="o5PTRdNf" Received: from gaia.codewreck.org (localhost [127.0.0.1]) by submarine.notk.org (Postfix) with ESMTPS id 9BECC14C2D6; Sun, 16 Aug 2026 13:19:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codewreck.org; s=2; t=1786879162; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=3v8MA1w26DHXvbEfHlFOLgAI0VEXKENl933YCR6Cw6Y=; b=o5PTRdNf9ZjXx61BQ0JFv4b+/kBdH8j+RkYDrVkXcqefwNpIsosjEcbImJFTiOFxkz6W8Y pBU3rC77rk47QTTiSRs6tAunU0eZg7ZiRj+/gxHSmMei1VMFn1fo2GdMzyFSyIB670L0f5 ilo58mAd+YW52CS57mP0MQzlvRxJgEqeJFRLCBX/r2AMGtxjLFOHr6hLiQzRj380OL8OEF C0cgVJ6DSF1fGQ4rtYcgEOYDnNwAi1O5CcvnU4hRj28wKHRQUh59xBCFFIpJi/AMX/14vr xCU8YKCe4hT1y6MxWIyzJ0uavZPfB+mPfCwnj4aRNCXdbCR2eAd8UDei0j62ew== Received: from localhost (gaia.codewreck.org [local]) by gaia.codewreck.org (OpenSMTPD) with ESMTPA id 91dbc645; Sun, 16 Aug 2026 11:19:17 +0000 (UTC) Date: Sun, 16 Aug 2026 20:19:02 +0900 From: Dominique Martinet To: Huasin Liao Cc: miquel.raynal@bootlin.com, vigneshr@ti.com, richard@nod.at, tudor.ambarus@linaro.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, huasin.liao@airoha.com Subject: Re: [PATCH] mtd: spinand: winbond: add support for W25N04LV Message-ID: References: <20260816093124.12325-1-huasinliao@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20260816093124.12325-1-huasinliao@gmail.com> Huasin Liao wrote on Sun, Aug 16, 2026 at 05:31:24PM +0800: > diff --git a/drivers/mtd/nand/spi/winbond.c b/drivers/mtd/nand/spi/winbond.c > index 9b78c1e6cbc9..892220a12b22 100644 > --- a/drivers/mtd/nand/spi/winbond.c > +++ b/drivers/mtd/nand/spi/winbond.c > @@ -345,6 +345,35 @@ static const struct mtd_ooblayout_ops w25n02kv_ooblayout = { > .free = w25n02kv_ooblayout_free, > }; > > +static int w25n04lv_ooblayout_ecc(struct mtd_info *mtd, int section, > + struct mtd_oob_region *region) > +{ > + if (section > 7) > + return -ERANGE; > + > + region->offset = 128 + (16 * section); > + region->length = 13; > + > + return 0; > +} > + > +static int w25n04lv_ooblayout_free(struct mtd_info *mtd, int section, > + struct mtd_oob_region *region) > +{ > + if (section > 7) > + return -ERANGE; > + > + region->offset = (16 * section) + 2; > + region->length = 14; > + > + return 0; > +} > + > +static const struct mtd_ooblayout_ops w25n04lv_ooblayout = { > + .ecc = w25n04lv_ooblayout_ecc, > + .free = w25n04lv_ooblayout_free, FWIW, these two are the same as what I consolidated in https://lore.kernel.org/r/20260814-w25n04lw-v3-1-c6a7423ac7d0@atmark-techno.com using oobsize, so we probably want to reuse that here too (Should I split the patch?) -- Dominique Martinet | Asmadeus