Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3025846iob; Mon, 16 May 2022 11:19:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/WuJKOYlHYTeldDzudch2j3KgpK9IQ/4cvD8hIhPv54pzdD8NFqX1VqYs6u8sYlYjJS6g X-Received: by 2002:a05:6402:3687:b0:428:aafb:23c9 with SMTP id ej7-20020a056402368700b00428aafb23c9mr14642240edb.388.1652725171307; Mon, 16 May 2022 11:19:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652725171; cv=none; d=google.com; s=arc-20160816; b=cpmC8vM/34tuuZq6AKbGI2SxyfUH0DFl05h0IIwl0EDd5P/tJ77eX5QidoytGxUjmd kDs4h1a90M6r6RxJbRcrGDSv3CnCIOEErGEkkTXBP6ViLTkEhpIOJQqTGr5HrMuOes/5 pWnulgokbE4bZtU0ZeI/jWpMN1+g57k89NVrD+0qebh9Hvp57bc/sIlq9fXx/P1RLKjl TU/6HdC25NmIKbVZeCNEUnfVjTszq4Xi8efN1NUwDHWTaH6eRPnsvQEiCCCS+aWXfM8w D5/E7m5JN9RF81z43u5bAyj6JK/cbwJxwGPEaAN1c2b+IUZgG1VuecLUT1DV0neL0omC Il+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=3L9ucVaR/Ejc1j0lbTxJ50RjR5DDft1mXnfjZbe8XHI=; b=c04BUqeM4RrWbFBGUHPabJSIU2H6hkqrKZBkb/Z8cOsdy9NJACD8lFopv2AbywYlmb ka9B0VouRnOvanw03q2NlIPLm8jv2A4273jDB2kBGPbeFn2Zm2+lpYWJCPRjD193mPHx 20hp3qhxsydW+LoSQvqsdLS5CLpXqimrAH3KpdFy1Mnx0BYBvEFZs3JNq3zrM4nyFWM9 N7IZlWOD6v/z/OWR/hjIOo12JCpVdTBcLuuud3f46gNgk7UK2flM9Q/LZm1IGyQ35/KL FbO0EXCpHhJ6CX1KBDeb6iVRe85cziiZoklzXfhJ9qsKLCYjNz99oIpyzgaJOJraDKTT a5rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=kAT+Qhfz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qf24-20020a1709077f1800b006e89cb29660si122550ejc.994.2022.05.16.11.19.02; Mon, 16 May 2022 11:19:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=kAT+Qhfz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244371AbiEPOKY (ORCPT + 99 others); Mon, 16 May 2022 10:10:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244362AbiEPOKW (ORCPT ); Mon, 16 May 2022 10:10:22 -0400 Received: from mail-oo1-xc34.google.com (mail-oo1-xc34.google.com [IPv6:2607:f8b0:4864:20::c34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0AC23B001 for ; Mon, 16 May 2022 07:10:20 -0700 (PDT) Received: by mail-oo1-xc34.google.com with SMTP id c19-20020a4a3813000000b0035ea4a3b97eso4020657ooa.12 for ; Mon, 16 May 2022 07:10:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3L9ucVaR/Ejc1j0lbTxJ50RjR5DDft1mXnfjZbe8XHI=; b=kAT+QhfzSE4Rv08p4UM1CjKAom7zKObZf2OKcy5fXfLNxtuRPYKKwYChwNtwR4Aqce YgYMx7SOIRE6dF0bgdXbmewYbRR0B+MoL0E8fCjvpX5MNFsp1hsUY4lGVYuG09gelIGn p/U41VzFdduU/yYeT2g6XzrPQHrKxNuQW8eXweG6qYsUCtI9hIzkeTtxXZlnUW7TjQG8 YLMjUZdJw17HouZps03Qo2ZJeR+UyX/uL+X+zoDH957b0E8IuMax5dazbUcfyb0Nannv dR4S2vD9ss7OwjfmzGmG5lxLFgc8yDJOA1X1ij4oZoTSrXnlIFW39tmGV4yUHYHX8PfV f8QQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3L9ucVaR/Ejc1j0lbTxJ50RjR5DDft1mXnfjZbe8XHI=; b=Fyr2FbSD+9FtVWYxzevieSuRiWztKutNK+M+2iThWnnFVl3vsoEjrr+1vPq6qF3eeQ sBV5TBUX9l11/lxxz2epI7VN0rTJEV7Z6RnBJCSZmelPlCsi/FxBEt1LrKc96hqGmvfv brkeDXqQ4+SJUbNrVDkgTTLRd+kdarLXKMcDPYj0zg2YoWCmbVkTryPtuydaYQ/iacpQ rGqARUyWzUN/asyG5AorZvdNKUYN6t45YE+BDr/sq1p9azziLHBCnvR4zfysBKiKIGv+ uxoOrpbgahJfJRw4P9WySEIymr0ySDBu7ZAxz+wGpt1dIvGshvwtBT37UCQa7MmEDSnX bBNw== X-Gm-Message-State: AOAM532Z7pqTMvJuRMlW/OkpUiH7nOns01HETl4mI8V7PaKa1kd6j2lF IuCJHmcrFq0sx5ECn/EFntldRbpyLHZD+7joiyk= X-Received: by 2002:a4a:8c41:0:b0:362:19a7:7529 with SMTP id v1-20020a4a8c41000000b0036219a77529mr6055010ooj.38.1652710219915; Mon, 16 May 2022 07:10:19 -0700 (PDT) MIME-Version: 1.0 References: <20220414143426.723168-1-gch981213@gmail.com> <20220414143426.723168-2-gch981213@gmail.com> <05966ece-65c8-ff7c-cb44-55c4d5a5542e@kontron.de> In-Reply-To: <05966ece-65c8-ff7c-cb44-55c4d5a5542e@kontron.de> From: Chuanhong Guo Date: Mon, 16 May 2022 22:10:08 +0800 Message-ID: Subject: Re: [PATCH 1/2] mtd: spinand: add support for detection with param page To: Frieder Schrempf Cc: linux-mtd@lists.infradead.org, Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Patrice Chotard , Boris Brezillon , Christophe Kerello , Mark Brown , Daniel Palmer , open list Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi! On Mon, May 16, 2022 at 3:38 PM Frieder Schrempf wrote: > > Hi Chuanhong, > > Am 14.04.22 um 16:34 schrieb Chuanhong Guo: > > SPI-NAND detection using chip ID isn't always reliable. > > Here are two known cases: > > 1. ESMT uses JEDEC ID from other vendors. This may collapse with future > > chips. > > 2. Winbond W25N01KV uses the exact same JEDEC ID as W25N01GV while > > having completely different chip parameters. > > I think they share the same first byte of the JEDEC ID, but the second > byte actually differs and would allow to differentiate between them, right? No. For the 128M version, all 3 bytes are the same between W25N01GV and W25N01KV. > > I have this patchset [1] that I didn't manage to send upstream yet which > adds support for the W25N02KV. I added the second ID byte to detect them. > > Still your approach using the ONFI data is more flexible of course and > probably a better way to handle this. I will see if I can find some time > to add support for the W25N02KV based on your patches. Don't do that. I abandoned this patchset because I later found that some early W25N01GV doesn't contain a parameter page at all, which means detecting W25N01GV/KV using only the parameter page is unreliable. I think what Boris proposed earlier in v1 (use parameter page just to distinguish the two chips) is the correct way to go. BTW I was making this patchset for a potential future ID conflict between ESMT and GigaDevice, and I don't actually need to deal with the W25N01GV/KV nonsense now, so I don't have a plan for send a new version of this atm. -- Regards, Chuanhong Guo