From nobody Mon Feb 9 20:55:04 2026 Received: from chessie.everett.org (chessie.fmt1.pfcs.com [66.220.13.234]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D4387155CB3 for ; Wed, 25 Sep 2024 07:49:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=66.220.13.234 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727250580; cv=none; b=DWuDWPBq8ooS6rgVlW9GQEnMIpik6rpY5FigxGl2DRycuVBdKTSS7RIxJOkNspx1XyX2gm1oxO8/US51vHMRQ69BM1KEUHp/k0wSV+kDSiLhbHKhizaoNG7UhULYIhOpLWPW9g1NSxhN0IYavgYVy/wRUy9+BXqIOWcO11Z9fBE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727250580; c=relaxed/simple; bh=E4tsaLskgEMw2H9Iq2/9ENkBt88RHnV+oeCPCR3FvNs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=obebKJR5Sa2Exd+WkgCvnJSZ+ZvGXK21173YkhnyRvxRi6PG1WBu+0W+I9rj8Il1mJGAl+xK/Y3rncpo5WUvKgtb/tQdcQGOdZ/ohjfRqixR7gJLhW7MHy6Oaa9tVouVG6bcSIlQQxM+nvd1kl2HTd/Z74j4ecPfnItoPOh5kyM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=nwtime.org; spf=pass smtp.mailfrom=nwtime.org; arc=none smtp.client-ip=66.220.13.234 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=nwtime.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nwtime.org Received: from localhost.localdomain (ip-77-25-16-238.web.vodafone.de [77.25.16.238]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by chessie.everett.org (Postfix) with ESMTPSA id 4XD85349JKzMQlY; Wed, 25 Sep 2024 07:49:27 +0000 (UTC) From: Erez Geva To: linux-mtd@lists.infradead.org, Tudor Ambarus , Pratyush Yadav , Michael Walle Cc: linux-kernel@vger.kernel.org, Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Esben Haabendal , Erez Geva Subject: [PATCH 1/2] mtd: spi-nor: core: add manufacturer flags Date: Wed, 25 Sep 2024 09:49:02 +0200 Message-Id: <20240925074903.1983601-2-erezgeva@nwtime.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20240925074903.1983601-1-erezgeva@nwtime.org> References: <20240925074903.1983601-1-erezgeva@nwtime.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Erez Geva Add flag for always trying reading SFDP. Some vendors reuse all JEDEC IDs on manufacture table with new chips that support SFDP. In this patch series we use the new flags with Macronix. Signed-off-by: Erez Geva --- drivers/mtd/spi-nor/core.c | 9 +++++---- drivers/mtd/spi-nor/core.h | 4 ++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c index 9d6e85bf227b..d77a356d6f40 100644 --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -2891,10 +2891,11 @@ static void spi_nor_init_params_deprecated(struct s= pi_nor *nor) =20 spi_nor_manufacturer_init_params(nor); =20 - if (nor->info->no_sfdp_flags & (SPI_NOR_DUAL_READ | - SPI_NOR_QUAD_READ | - SPI_NOR_OCTAL_READ | - SPI_NOR_OCTAL_DTR_READ)) + if ((nor->info->no_sfdp_flags & (SPI_NOR_DUAL_READ | + SPI_NOR_QUAD_READ | + SPI_NOR_OCTAL_READ | + SPI_NOR_OCTAL_DTR_READ)) || + nor->manufacturer->flags & SPI_NOR_MANUFACT_TRY_SFDP) spi_nor_sfdp_init_params_deprecated(nor); } =20 diff --git a/drivers/mtd/spi-nor/core.h b/drivers/mtd/spi-nor/core.h index 1516b6d0dc37..9237c4ed66cd 100644 --- a/drivers/mtd/spi-nor/core.h +++ b/drivers/mtd/spi-nor/core.h @@ -560,12 +560,16 @@ struct flash_info { * @parts: array of parts supported by this manufacturer * @nparts: number of entries in the parts array * @fixups: hooks called at various points in time during spi_nor_scan() + * @flags: manufacturer flags */ struct spi_nor_manufacturer { const char *name; const struct flash_info *parts; unsigned int nparts; const struct spi_nor_fixups *fixups; + + u8 flags; +#define SPI_NOR_MANUFACT_TRY_SFDP BIT(0) }; =20 /** --=20 2.39.5