Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp380834lqt; Thu, 6 Jun 2024 06:34:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXKowSwm3YU6mrQWsbbbA6fDpWPZMj6GTtdny+i/gfssP9XXJrVwz/NjqXHBM+DVm+oJoKttjvNcq4J/wwCglvwt53WD4j3Q33BRxEFtQ== X-Google-Smtp-Source: AGHT+IHpmk6+lAyGVDqfd3jjShiqFB8W+OforxNZ/Nd4QzVC+y+5FRDeVdkAdY7/pjxSR5nIKU98 X-Received: by 2002:a05:6a21:7886:b0:1af:d206:e572 with SMTP id adf61e73a8af0-1b2b6e4abe6mr6971251637.9.1717680843141; Thu, 06 Jun 2024 06:34:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717680843; cv=pass; d=google.com; s=arc-20160816; b=x9NA73TMDJ33fV1XrPZpst5zpu1oWB+hsDmQ6Kczh/DGWEu1akVFgsTIFqq171QLHr l9fbSNWCwyVf72hnQmzc5ym7eNFgQb070iGiJW7gMwwel9t11OkjXJoyFx0S25bqfRik R9Cd0Tg0s27wcUUiNf6Ao0I4/cAMAKp4o9Sb/PdT/XvcP5UA01HLgJ29uoVDpZSAVt8w RVUDSIFnji8tGM2xwsGwoszPjOZDczmazQplW1BPJmZzNpV0VhoFsehbFycBzXeV7OTI 3W6p5kB0MoF7TyQl7DbGlc1HVennezI6EfJjDpjXkk2A4acWRWx246aFlfbLKYlR/NSd XnmQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=Y9vfJnrIrJKrBEEsqJQfUNJPUu7ekbSS5ajlvoZ3oR8=; fh=wqvWpGxkEYWoxoDVIrzdZ/QYjnJsj2kQhcMSaZGQpNc=; b=0RoANqogmgk39iOC/TRMlN3kS6Yqu2O9L1891bhpx4WZJjE2dSMCVJixRap0CDuRDK IIPK3wdYSmCwjmsTyotIOEIp/QZ31AXXPx8C64ePVzt+nLzSo5wIlzy+XDPeFtBx+UTp C7zqOzuUYRUG+T8uX1YpwWnyIuUzZVhguCFFxT4/A5XVoOJjqhkr6hCCAYsxkfb99z+r bRY40LtmZlk8G6p2TbMAV3D0GUT+dUbHrtPm8n50gKEL1JZ3BQOl+GzNJ4dmpCGpQTbK fCPtm2xOLGgPpkwDXZDJ3ajwWdviilCDVyR+TqGttKmHq0xmRzTRbWeTThUXXjG0wqoD /Qgw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=phrv5Lvc; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-204375-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204375-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-703fd4c741csi1115615b3a.160.2024.06.06.06.34.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 06:34:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-204375-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=phrv5Lvc; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-204375-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204375-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id D85F5283C04 for ; Thu, 6 Jun 2024 13:33:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D8C33195F1C; Thu, 6 Jun 2024 13:33:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="phrv5Lvc" Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3EC7E13E048 for ; Thu, 6 Jun 2024 13:33:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717680802; cv=none; b=nDX5hJ583CGWDkbSQNJk9Rwuaq4i6AXVlTHbipPMXfYxqhLhVpuiKsoodv4sFRPQafbZGBePaK8I3YkHw16JZrQJYlev72Wa2bSwE5wa4OJ6LE3MZNbye3/wPrN2NBf+786pKIrBbe8tepHolFRnK5tdA4u1Ka6K2XUj2F03g3U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717680802; c=relaxed/simple; bh=Lh2gUDPVnlN9p0WrExloiI0bv+g9JrOg7vuZHCMZA4Y=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=VqmuKVN2Eb+rklPpR2veUypgroMKkSV94ShdHGw7NVVGeU3EHTgy0wZAgejMnsVpQ2WnqsI88XE4Iya35k+vWvgZeO5ChOV/Pzbz01giQeJ/xeSA/yGF8BW4uvpnIi5SRHBK+dyOKv3aK64M+BjMfLAZksmJ4zSEWCfF9xfrr00= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=phrv5Lvc; arc=none smtp.client-ip=209.85.208.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ed1-f51.google.com with SMTP id 4fb4d7f45d1cf-57a7dc13aabso1188071a12.0 for ; Thu, 06 Jun 2024 06:33:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717680798; x=1718285598; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Y9vfJnrIrJKrBEEsqJQfUNJPUu7ekbSS5ajlvoZ3oR8=; b=phrv5LvcdQmoAjXq+s69j0xwpCYsSyIkx9zXkzx7kR43ekX+5rtXVV1DpoT/3QGOAM jUxHhmq4TsTqKA3/VhmecOw2qwvOoL2eTi5+PxK4loG3v1RiRuWTIPog9jtFB6rm+5t4 9O67ofusARYELoxg7RM2DoO5e7cV5WcR15F0yr4jkA2WkvV24/IkjRD9D5WsW5MTp9UP dew3TV0UE6pt3RRpNZtbUvx1kYoy1jUTce9AEB9Mg4uP0ptCyQfDTeB3NzYdvHyCPpAP 8HlTr8JbaQ9Bn3wwf0q7evxMmwYncTwdJa8Qa+YF12LReSk4uUCIJ3dYWyKzwUe76ZNQ 6ykg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717680798; x=1718285598; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Y9vfJnrIrJKrBEEsqJQfUNJPUu7ekbSS5ajlvoZ3oR8=; b=O9sSqQuopQHja+ymhz7ifgwSBa9wP7shDaG2JxcomUpJYj53UYT/YCIyx6X6xlmiuZ Regife+cuiZGVVp7B1Xizg1vzIO7ut7cdJeGO7WBYT0TkSbJE9GY60Plmq2hxkkFJQmK Gkxw/I6DR8hhqWGqUjtvr5ur8YEcOqJjm+AaNvltCYEGQYBlcmuLYfskztu/DYMjp4Yf r4OsR0NpekJgByEbGsSBICqHzSvWAFhM2Rv8I54eb8bDO/N7KiXlrLPWGZdBLNY8TBkU axsXtIKu6JLabaaR7Hl3EvZN6eREuFtfN6j/xbF+2wN7rixh5gI0FyYxGEwFuCwRpE19 Ac2Q== X-Forwarded-Encrypted: i=1; AJvYcCVcLAhGe+JwAqk1fxZro89Hxu8wk/gV88x56HcNccA8GWdCiCFTlNYFYz0SkXkPWawD0gM8ktdK5Xs51osiC0ESZB4K5+DtaS5dnc/n X-Gm-Message-State: AOJu0Yzjh2dLhFs1EusK+dsBiEpKFRUrtlW0sxKSCSraXjw9mzaFvtjD g0BhC6BOKfMSi4RvBnUNsjHnph+tk9tXFSNhVXJXRVdXjRXevw4zILU7wIfDQtQ= X-Received: by 2002:a17:906:258f:b0:a61:4224:c998 with SMTP id a640c23a62f3a-a699fcf6586mr351582866b.54.1717680798512; Thu, 06 Jun 2024 06:33:18 -0700 (PDT) Received: from [192.168.2.107] ([79.115.63.17]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6c8070e19dsm96579566b.164.2024.06.06.06.33.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 06 Jun 2024 06:33:17 -0700 (PDT) Message-ID: Date: Thu, 6 Jun 2024 14:33:16 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 2/2] mtd: spi-nor: macronix: enable quad/dual speed for mx25l3205d chips To: Esben Haabendal , Pratyush Yadav , Michael Walle , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Rasmus Villemoes References: <20240603-macronix-mx25l3205d-fixups-v2-0-ff98da26835c@geanix.com> <20240603-macronix-mx25l3205d-fixups-v2-2-ff98da26835c@geanix.com> Content-Language: en-US From: Tudor Ambarus In-Reply-To: <20240603-macronix-mx25l3205d-fixups-v2-2-ff98da26835c@geanix.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 6/3/24 14:09, Esben Haabendal wrote: > Macronix engineers apparantly do not understand the purpose of having > an ID actually identify the chip and its capabilities. Sigh. > > The original Macronix SPI NOR flash that identifies itself as 0xC22016 > with RDID was MX25L3205D. This chip does not support SFDP, but does > support the 2READ command (1-2-2). > > When Macronix announced EoL for MX25L3205D, the recommended > replacement part was MX25L3206E, which conveniently also identifies > itself as 0xC22016. It does not support 2READ, but supports DREAD > (1-1-2) instead, and supports SFDP for discovering this. > > When Macronix announced EoL for MX25L3206E, the recommended > replacement part was MX25L3233F, which also identifies itself as > 0xC22016. It supports DREAD, 2READ, and the quad modes QREAD (1-1-4) > and 4READ (1-4-4). This also support SFDP. > > So far, all of these chips have been handled the same way by the Linux > driver. The SFDP information have not been read, and no dual and quad > read modes have been enabled. > > The trouble begins when we want to enable the faster read modes. The > RDID command only return the same 3 bytes for all 3 chips, so that > doesn't really help. > > Instead, we can use the SPI_NOR_TRY_SFDP flag, which forces the spi-nor > system to try using SFDP, but fallback to the parameters specified in > struct flash_info. > > This way, boards using MX25L3205D will continue as before this change. > That is without taking advantage of the 1-2-2 that it supports. > > For MX25L3206E and MX25L3233F, the SFDP parameters are used, and they will > therefore be using the optimal dual or quad mode supported by the flash > and the SPI controller it is attached to. > > Signed-off-by: Esben Haabendal > --- > drivers/mtd/spi-nor/macronix.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/mtd/spi-nor/macronix.c b/drivers/mtd/spi-nor/macronix.c > index ea6be95e75a5..090f28e05a5d 100644 > --- a/drivers/mtd/spi-nor/macronix.c > +++ b/drivers/mtd/spi-nor/macronix.c > @@ -61,7 +61,7 @@ static const struct flash_info macronix_nor_parts[] = { > .id = SNOR_ID(0xc2, 0x20, 0x16), > .name = "mx25l3205d", > .size = SZ_4M, > - .no_sfdp_flags = SECT_4K, > + .no_sfdp_flags = SECT_4K | SPI_NOR_TRY_SFDP, > }, { let's remove support for MX25L3205D. You'll then be able to drop the flash entry altogether and instead rely on SFDP to discover the flash's capabilities.