Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4185395pxv; Tue, 29 Jun 2021 00:43:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXTEyB7zKM/STXLKdp/qaB9ksvZh1wJNylG/+X+akzZIvk3laFkFlJiEsXv24C0qJDi1Tz X-Received: by 2002:a17:907:3e1b:: with SMTP id hp27mr28295600ejc.470.1624952618981; Tue, 29 Jun 2021 00:43:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624952618; cv=none; d=google.com; s=arc-20160816; b=P13ObzBm55Ifilvx6K8lexi1mYSpXgv0fB5QZsXne/psxDNLpSe0YtL1P0GJay6BVW 3Xw+tjqKjVVncK9teXwa1vE4qkGdbY/D8VtP3lh8sWgl4wrXBP4mmWXxiK3kmJcc2NvO fwn1ATr2fwk7L3QpeiDHlkAGRn15NHEyi7Dhxro35uqY1GogISkInNZdw+/97xYRzssx tBCbg64Wc3UJM6q7wXiOZbrEi19zYivXuy5ffCjFoc+BO1mwmF/o3XuMkFG2QKUyQsmO abQUdKC7e/N9IViyoPkJQ7IesWclOjD9AyUJXkbI9M1NG+PMCUggm1ULIG/Mx7UmDDiD SU5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=FReXYEj5Ibwbff/u+KhknD1QWDTjlXsVnChFbqLOhzY=; b=rsy5Ts/QucMhVggZ/B720FFJ50ckun8nkLaP4gLLsqiR1sIEwLTRIL6ERP1O66UXp7 lvs3zeA2NPzvvRV3ySpmefXH1MXG3z6mYukBHgGJJRKtG6YqMA3SxFUQ/ioysSOH25p9 tYnQcpGn5yvjKuXC/pFeaDITKT7whHgXwEx3fjt9CpR5v6OwrBUxeSzqMCiiURMIh0cD b+HLcuoKH/sZ3tGvAvWxiNUN25WAwVuFw4cvYNJi18IS/SZjhWHIgJ8xMcuOIK9bFpw4 VMDeLgWVXdjQYReEZLmiV40ZGkwq/ons2vG+5phAbpDozrSZGZZ6CkccHuEbuv/de7Vk DEJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=JYxocqHR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id eb10si16447674ejc.649.2021.06.29.00.43.15; Tue, 29 Jun 2021 00:43:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=JYxocqHR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232272AbhF2Hos (ORCPT + 99 others); Tue, 29 Jun 2021 03:44:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232254AbhF2Hor (ORCPT ); Tue, 29 Jun 2021 03:44:47 -0400 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE289C061574 for ; Tue, 29 Jun 2021 00:42:20 -0700 (PDT) Received: by mail-lf1-x12a.google.com with SMTP id a18so15595556lfs.10 for ; Tue, 29 Jun 2021 00:42:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=FReXYEj5Ibwbff/u+KhknD1QWDTjlXsVnChFbqLOhzY=; b=JYxocqHRpwAlODdbmKohYKIbIbv71wQb1E1PD3TTEuDq7X6IDLfJhT38RIp2gfV3hJ +K9HtXpO1GVXxKvBaYBWotimOv0iH3VVdA6U5z7IMHXT9O36/aTZl8gkoVBuy4aK0+lf CogXeLJKTeMX4VnH1KJOgm/Qt949H69ANb//8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=FReXYEj5Ibwbff/u+KhknD1QWDTjlXsVnChFbqLOhzY=; b=p3cn9dOEyUnj6Hdo/kjfgFw1Q0t4F8CX4JMkC2NB2CFtdW+fdu/u2SKuI0F6CSgACf EwjC8HNNtONUkaLZpNKoDEPAGX0kYSr8ZyVNAy9WrzCEnAlW21cEOI4HfZH221cB8e5H T7UlpunIgVy0WHeMDhBQYnz258wj3B4NCq7oEGY+2BmkzpaH8TcbxmVlxHSCO64C7dRd Rpiueb6IAK+SX5TxlPz7Eash4AVpnUqaVmHMgBB/O73Aq+jNKdUVGdhCQY7rBV2D/o4z EunCFrOV/aEs6KZf1PhdYdWsLpjp/qzyldSE6T4MIo+3bR6JX1BC+syQKBJRXm+Tirwv qrow== X-Gm-Message-State: AOAM531vT8jSzQe+sX9KOl12qkzmcpZmutAenbZyHZJ70eSiXbyXGwkB hdOTZ3D/CIjI3T5RJsNxQHsZPsUrGyT8AZ9n X-Received: by 2002:a05:6512:b8e:: with SMTP id b14mr22374104lfv.287.1624952538027; Tue, 29 Jun 2021 00:42:18 -0700 (PDT) Received: from [172.17.20.254] ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id e20sm1735414ljk.67.2021.06.29.00.42.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 29 Jun 2021 00:42:17 -0700 (PDT) Subject: =?UTF-8?B?UmU6IOWbnuS/oTogUmU6IFtSRkMgMi8zXSBtdGQ6IHNwaS1ub3I6IGNv?= =?UTF-8?Q?re=3a_compare_JEDEC_bytes_to_already_found_flash=5finfo?= To: Tudor.Ambarus@microchip.com, jaimeliao@mxic.com.tw, michael@walle.cc Cc: bbrezillon@kernel.org, esben@geanix.com, frieder.schrempf@kontron.de, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, masonccyang@mxic.com.tw, p.yadav@ti.com, ycllin@mxic.com.tw, zhengxunli@mxic.com.tw References: <20210621152320.3811194-1-linux@rasmusvillemoes.dk> <20210621152320.3811194-3-linux@rasmusvillemoes.dk> <223232ecd0865e819477f17cd464ab08@walle.cc> From: Rasmus Villemoes Message-ID: <1767e220-b76f-a661-b274-7fec3e7dd8b5@rasmusvillemoes.dk> Date: Tue, 29 Jun 2021 09:42:15 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23/06/2021 10.33, Tudor.Ambarus@microchip.com wrote: > On 6/23/21 10:17 AM, jaimeliao@mxic.com.tw wrote: >> You don't often get email from jaimeliao@mxic.com.tw. Learn why this is important >> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe >> Hi Michael and Rasmus >> >> >>> >>> Re: [RFC 2/3] mtd: spi-nor: core: compare JEDEC bytes to already >>> found flash_info >>> >>> [+ some people from MXIC as they are ones who posted to the ML >>> lately. Feel free to forward this mail to the corresponding people.] >>> >>> Am 2021-06-21 17:23, schrieb Rasmus Villemoes: >>>> Macronix engineers, in their infinite wisdom, have a habit of reusing >>>> JEDEC ids for different chips. There's already one >>>> workaround (MX25L25635F v MX25L25635E), but the same problem exists >>>> for MX25L3205D v MX25L3233F, the latter of which is not currently >>>> supported by linux. >>>> >>>> AFAICT, that case cannot really be handled with any of the ->fixup >>>> machinery: The correct entry for the MX25L3233F would read >>>> >>>> { "mx25l3233f", INFO(0xc22016, 0, 64 * 1024, 64, SECT_4K | >>>> SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ ) }, >>>> >>>> while the existing one is >>>> >>>> { "mx25l3205d", INFO(0xc22016, 0, 64 * 1024, 64, SECT_4K) }, >>>> >>>> So in spi_nor_init_params(), we won't even try reading the sfdp >>>> info (i.e. call spi_nor_sfdp_init_params), and hence >>>> spi_nor_post_sfdp_fixups() has no way of distinguishing the >>>> chips. >>>> >>>> Replacing the existing entry with the mx25l3233f one to coerce the >>>> core into issuing the SPINOR_OP_RDSFDP is also not really an option, >>>> because the data sheet for the mx25l3205d explicitly says not to issue >>>> any commands not listed ("It is not recommended to adopt any other >>>> code not in the command definition table, which will potentially enter >>>> the hidden mode.", whatever that means). >>> > Do any of these flashed define an extended ID, i.e. more that 3 bytes of ID? > Rasmus, would you please try to read more bytes of ID? > No, neither mx25l3205d nor mx25l3233f do according to their data sheets. And when actually reading more bytes, one gets as expected just the c2 20 16 repeating all over. Rasmus