Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp1235123rdh; Fri, 24 Nov 2023 07:57:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IEIzaq11XTAy6oUlbAEbsxBgoNOMTpEq3joOeO9vyrLwxSqoW/itz6XbpbuUHQlmb6eD093 X-Received: by 2002:a17:902:b20a:b0:1cf:9efe:47f0 with SMTP id t10-20020a170902b20a00b001cf9efe47f0mr2605197plr.31.1700841453037; Fri, 24 Nov 2023 07:57:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700841453; cv=none; d=google.com; s=arc-20160816; b=eAe3QMbn3oSi/zKUps9hu8nMAmHN6R8vU3HmqslDjrK7zN6HUXPAH9ELVn941NSIuN rhqGGPa3sCZ+B9vj0zPDPFCt4a5p9FrtjBFzHfv16WUTfwS04NVpMDhtid8akNiXaBt9 5T7mckUpmzPxZjRxTX8gJ4YIjIf5PXIOxHJ4E8834/uasn86Gv/0tm03JmvLogdgb2H8 jOmR/iJyTH/v6vT6h7d/9AG+uzGvR6LzfD8beExrRq+cqF7qsUpToFe0kFXpohtpa03p U9VHChgujW3O15saCjwZ0yZwC5bBz1TPTSZMZBKVixHM7dxbH2fHW2M/5Asdu8Z1jkWN Rfig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=ZF6yae9bb5tDXC/CsnvGYPJ3X5s4815eVzyjB3BR8k8=; fh=RXzRnkda2hzUBYDCVA7c7u1nmOOdRCx1WGg0i2l5A9A=; b=nb/O0nJMqPOgcXfyKzTW14Gh1pmcKpgMUJ1xf0HWRYt8uLXZBxUq4ZHrFfg9zD6YPY M8vWOOUAuLH582KmAQzGj2dCrSJ1bGbYBxPDa8nFOIHnuZYuQPeCQetRNTldNAlc54l/ 012HouH5kAnY+SeCusXIGH7GAp7iw/rxDyHiW9aeq1d3HFz+0LPgSutMU+gigaahqX/F baoIKpmCivOjFp23yXeBGpg093jnpnbP7nB7nXqN8LUKiYW8XQmrJZ/P4mNCFuWimyZ0 VWDdwQuphkJ3HK3A++5ieH0WrNGprWRgQX31a3GWXHAAoKCQb4R4fJgY+/vl7CHPTEDw zjDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RVexKku5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id i15-20020a17090332cf00b001cf57827d25si3874856plr.329.2023.11.24.07.57.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 07:57:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RVexKku5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 2DBFF80C5C97; Fri, 24 Nov 2023 07:57:30 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345902AbjKXP5E (ORCPT + 99 others); Fri, 24 Nov 2023 10:57:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229715AbjKXP5B (ORCPT ); Fri, 24 Nov 2023 10:57:01 -0500 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 204CF1998 for ; Fri, 24 Nov 2023 07:57:08 -0800 (PST) Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-a00cbb83c80so299089366b.0 for ; Fri, 24 Nov 2023 07:57:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700841426; x=1701446226; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=ZF6yae9bb5tDXC/CsnvGYPJ3X5s4815eVzyjB3BR8k8=; b=RVexKku5lciK7stmLKBVUIcyJ/EvkeoI2yvaHDdoUJrWwmzZNdDDN5uHDs+3VnMFUK zBUlvNmOZOoTfvEw+F9bI1F8MF3DxAz2eOJA6VwSbWpuICdjALsTbyICPaU7UwlIURCf ChQzkJLMRnAxm9d0WchcYDH0Ia6xuNTPitggNAZOMsMgPRiyHfuhkPN+NoVnM7QRJs7+ bGEWyF+a7F6rWjqJGakN6yenzs3RhUv3GglOen0c+tNpbybGHhAhcQfoeuN00yVLEb1r WWAOiFUtnooVlUJMLZ/1BCCh6HlOhZG+NYmwEE6TXvVPiYo3hW+3KB6Ud8MzPPj4SKIL 5RMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700841426; x=1701446226; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ZF6yae9bb5tDXC/CsnvGYPJ3X5s4815eVzyjB3BR8k8=; b=XM+wKcAcik6y+9VDSifMpIl9BFc5ZNk9/C/M4DRVoGH8SvIv1n/7tjKt40O6reW2vO MxA7MVWdlE/HFieDUCsXUx2Tz4rxChSKj2m5WPG/W6d2+68tR3gWg4dJh64nZ5mRUMrl yOr1ZPzhujVwH1ilJq9UVmDUXJbpdKwd3EiKxke6s7KRlocKmmdHDv6edCK58W+lK3PQ PoQtwf6SPtC6CVKtWAvKMehLvaCip58UbI17T5ZBI6snSB8TsnULyuUobsW1uMEOL424 DaSzGgBIMdVbO2/jaRCvFEFMq5EKIJGY9A0YMLWS8umhXVBNkpNtz5tsL2HXPkOTuAqO K3hQ== X-Gm-Message-State: AOJu0YzmxPVITpUM9T+73BUkAM1NqMRBSVvgwGUMyiBuiclwBnHfjQJy V1Ptz8e1Bhg0CDPuFooQe7Efsw== X-Received: by 2002:a17:907:740a:b0:9e5:d618:d6c1 with SMTP id gj10-20020a170907740a00b009e5d618d6c1mr2310550ejc.19.1700841426518; Fri, 24 Nov 2023 07:57:06 -0800 (PST) Received: from [192.168.2.107] ([79.115.63.75]) by smtp.gmail.com with ESMTPSA id jj13-20020a170907984d00b009b65a834dd6sm2195878ejc.215.2023.11.24.07.57.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 24 Nov 2023 07:57:06 -0800 (PST) Message-ID: <42cc0ae2-d61a-41cc-b46e-132dace301b0@linaro.org> Date: Fri, 24 Nov 2023 15:57:04 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] docs: mtd: spi-nor: add sections about flash additions and testing Content-Language: en-US To: Pratyush Yadav Cc: michael@walle.cc, linux-mtd@lists.infradead.org, linux-doc@vger.kernel.org, corbet@lwn.net, linux-kernel@vger.kernel.org References: <20231123160721.64561-1-tudor.ambarus@linaro.org> <20231123160721.64561-2-tudor.ambarus@linaro.org> From: Tudor Ambarus In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,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 pete.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 (pete.vger.email [0.0.0.0]); Fri, 24 Nov 2023 07:57:30 -0800 (PST) On 11/24/23 14:36, Pratyush Yadav wrote: > 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 right, then maybe we could do a /erase /read /dump and see 0xff /sha1sum to have the 0xff checksum /write /read what was written /sha1sum on the read to make it's different that the 0xff checksum and that the write worked > -- 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 >> + > [...] >