Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp1166037rdh; Fri, 24 Nov 2023 06:37:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IGc3UxA+kMLucvIM+pd31r4l/bPAQG50ohZy8jBt7MA84/7KT2mvT/qplnxjI6SI22zQVzw X-Received: by 2002:a05:6a20:2584:b0:189:c852:561e with SMTP id k4-20020a056a20258400b00189c852561emr3469223pzd.1.1700836621370; Fri, 24 Nov 2023 06:37:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700836621; cv=none; d=google.com; s=arc-20160816; b=Ch+ljTjoYv1ngU8J4Lta8WNfC1N9Kvv3yGGmawdhK5xProkfMUO7qpnDwWPEoEJpUY dn1i5QpYhJWLkeogd4krY5Q4LhweOxP+VlVYnC/ulYijg2AzV81hmYytK+1CwKTaq+0L okm/2JXHPhcoC77kfQC4QEHRqg74+ZFZHmZN8ZC78Jcq7U9SsUAQ7SAkLyNIclBjOVit nrhUBYLjowHQXOzt10aNy/X3XITeeYGIjQCemkLpRNALOA9WJ6SL4mLJexcjZxmRp7Qb EceLU3K9VlKR+nUZsASW3vgoPm/WqI9Y1bqFkPkmQKTrteLCrdF02CpAAGBb5UKJc6Pa DazA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:dkim-signature; bh=Vr6HKBw7FWycX3U0VHwGx7i3U9BF6WO+cd65GdSqQQc=; fh=piVietPkKsSVy70JqzcNYFUubP6obnD1OUfITQsuO08=; b=DPMDX5HMjM6GfBY/s/TAlATKUqdl2GSlU/9XujZwyWk+dF8nKFi9n70JkoQk97OVbw LlpWlr80Z3v78sKQOki0IWJqUSXzojnwyQ+rgxGSEWWXZSrztcxpdmRnkZ9dLoDd7lha VDi+Ty2M5R7BXIOIPVTDrcsrxHKfVsLJWgc+jpqgZL22m0eNTWgPJvTSzMNyOAoQoYCp qJ6wauvSLNLFgfikOd4xETmwPr7ekaXzf1//BbrddPr9gv3AApyAm5ULtIg0Il3ZpgR5 bbm514cUbmolKDHP1JktFDGhefRwku37RdHyxMb5Tpn3wVHuG7G0zZOkWJjCtQ6AgT1e MQUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rzqSDjKn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id v28-20020a63481c000000b005c21adcc5absi3577990pga.757.2023.11.24.06.37.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 06:37:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rzqSDjKn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 96604804C210; Fri, 24 Nov 2023 06:36:58 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231156AbjKXOgk (ORCPT + 99 others); Fri, 24 Nov 2023 09:36:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231208AbjKXOgi (ORCPT ); Fri, 24 Nov 2023 09:36:38 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05C9A19AD for ; Fri, 24 Nov 2023 06:36:45 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 95C6DC433CA; Fri, 24 Nov 2023 14:36:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700836604; bh=MdOhhUKumd3kzb9H02LyP8oNeaYzZ+2LZ3UTYMLXOVE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=rzqSDjKnVMIT1WOvjbr9cWJa/zbBDJL1pf4jeyHfhOTVq83WXx9Qk+UXtUnUDQFaG rIW4sQC4/HBhQJzo+2g4ffQ8N7oW3f0ZsljPKUjUzDiy9LrPHscy67npgbuhPQOWQb luGHy5jTRMLkfoor6lk44wZF51xP2ysfsrluz0l+0uIOicSKhjdb7MIslKMTxuV7O+ z0D9ydOrFyErQi92VsJ6RNBvEZppmeCYPeqICtO+lZ3jQvF0ZE8EmFmyZZ6ndY+hfV MxlVMQIBlaTFtpRil+H+MObpob3N/Ej0/oJn7NaJw4KWgA/V8KCSpZg6vqcxfqFBcU feDGnYbW/6Stg== From: Pratyush Yadav To: Tudor Ambarus Cc: pratyush@kernel.org, michael@walle.cc, linux-mtd@lists.infradead.org, linux-doc@vger.kernel.org, corbet@lwn.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] docs: mtd: spi-nor: add sections about flash additions and testing In-Reply-To: <20231123160721.64561-2-tudor.ambarus@linaro.org> (Tudor Ambarus's message of "Thu, 23 Nov 2023 18:07:20 +0200") References: <20231123160721.64561-1-tudor.ambarus@linaro.org> <20231123160721.64561-2-tudor.ambarus@linaro.org> Date: Fri, 24 Nov 2023 15:36:42 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Fri, 24 Nov 2023 06:36:58 -0800 (PST) Hi, On Thu, Nov 23 2023, Tudor Ambarus wrote: > Add sections about how to propose a new flash addition and about the > minimum testing requirements. > > Signed-off-by: Tudor Ambarus > --- > Documentation/driver-api/mtd/spi-nor.rst | 189 +++++++++++++++++++++++ > 1 file changed, 189 insertions(+) > > diff --git a/Documentation/driver-api/mtd/spi-nor.rst b/Documentation/driver-api/mtd/spi-nor.rst > index c22f8c0f7950..cc8e81e09544 100644 > --- a/Documentation/driver-api/mtd/spi-nor.rst > +++ b/Documentation/driver-api/mtd/spi-nor.rst > @@ -63,3 +63,192 @@ The main API is spi_nor_scan(). Before you call the hook, a driver should > initialize the necessary fields for spi_nor{}. Please see > drivers/mtd/spi-nor/spi-nor.c for detail. Please also refer to spi-fsl-qspi.c > when you want to write a new driver for a SPI NOR controller. [...] > +4/ Use `mtd-utils `__ > +and verify that erase, read and page program operations work fine. > + > +a/ Generate a 2 MB file:: > + > + root@1:~# dd if=/dev/urandom of=./spi_test bs=1M count=2 > + 2+0 records in > + 2+0 records out > + 2097152 bytes (2.1 MB, 2.0 MiB) copied, 0.848566 s, 2.5 MB/s > + > +b/ Verify erase:: > + > + root@1:~# mtd_debug write /dev/mtd1 0 2097152 spi_test > + Copied 2097152 bytes from spi_test to address 0x00000000 in flash Perhaps mention that the 2 MiB region should already be erased. Otherwise some flashes might refuse the writes (like the ones with ECC -- Cypress S28 family comes to mind). Experienced engineers should know this already but it might trip up some beginners. Looks good otherwise. Thanks for working on this. Reviewed-by: Pratyush Yadav > + > + root@1:~# mtd_debug erase /dev/mtd1 0 2097152 > + Erased 2097152 bytes from address 0x00000000 in flash > + > + root@1:~# mtd_debug read /dev/mtd1 0 2097152 spi_read > + Copied 2097152 bytes from address 0x00000000 in flash to spi_read > + > + root@1:~# hexdump -C spi_read > + 00000000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| > + * > + 00200000 > + [...] -- Regards, Pratyush Yadav