Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp373148pxf; Thu, 18 Mar 2021 02:25:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+cPLjH6Xo1TL3i+hH3QQ1XgatHn+8e60CHLwFQSyTbu5FPdKj8sR3XaZrVncR6MJ2FicT X-Received: by 2002:a17:906:1a44:: with SMTP id j4mr40458236ejf.401.1616059547294; Thu, 18 Mar 2021 02:25:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616059547; cv=none; d=google.com; s=arc-20160816; b=mLCoby1a+fDSnfthPGaeZhPGGVLLwByjaNAa6z7f8MKQMjRaxBevgEOQHDP1x6+eAV n7spiM+i5Gf9ece8dwZrAN/ZdM2jGYTp8UysZZEWKQWY2THfIVqEY2lYBzytKOJQ0gBp UUFlGHxQh2Yg/8GBQaRCv5TqYa5fyLp1NyNflhLmDNzo2Xmy2jcAh+RbKIjJ7vj1cqJB mnAcumwO2nN22DDFV4NXjX6pOuORH9xP2ye9M7HA9tZWBYf4lHs6ijoqz/uXmvaW/ek+ PX7HQvnnOxbzQa5Z8I+zjRPVByjk4jqNzGzYIHJ6zza5pF1a8LOPibII79wyiARWmm0N 0WJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=PUtOX934IZqe0szWUA2kSFISdL5hUZER7MzcKcv5vrE=; b=GHFjCuR+e7+MezNpadaFLSln3kZBWuF743G940+8vlhIWX2vV8fFeFzYKXpYU9vRaz adNgkF3WR6LjOKGRA/8IPVanN/OX2Rs+D5N0Ls/bcHM57u/IJd4TxYKMMKBOiqOKG7WG f1bsWRStvNNRdWy/Vp41tFChipTRlazZfbl6uCF2J4oc++d+YAmS4MmRPawPB7m2NURk nE1c1o1L0TwUCqqDYBoAZ1zyiiWynewu9zGdfSzvPmBvPlRk6LmLKUOhFfFTFUWsE7D8 tUYljx/cG3zx4OS3lKWos3YJ/rGvVSVF7equs+piMC0ymQocfLKPZmXv3dSh9PIi8+c0 97dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=BR61BpLN; 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 hd31si1041724ejc.257.2021.03.18.02.25.24; Thu, 18 Mar 2021 02:25:47 -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=@walle.cc header.s=mail2016061301 header.b=BR61BpLN; 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 S229866AbhCRJYa (ORCPT + 99 others); Thu, 18 Mar 2021 05:24:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229690AbhCRJYR (ORCPT ); Thu, 18 Mar 2021 05:24:17 -0400 Received: from ssl.serverraum.org (ssl.serverraum.org [IPv6:2a01:4f8:151:8464::1:2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 236A2C06174A for ; Thu, 18 Mar 2021 02:24:17 -0700 (PDT) Received: from mwalle01.fritz.box (unknown [IPv6:2a02:810c:c200:2e91:fa59:71ff:fe9b:b851]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id A30C322234; Thu, 18 Mar 2021 10:24:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1616059455; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=PUtOX934IZqe0szWUA2kSFISdL5hUZER7MzcKcv5vrE=; b=BR61BpLNzq9MS3peXCe46hyj4F9jXx0Apimzrxmn2Ugs2egeT1Qn7FGRynpBQbqL+Op+bb IuCQnsrnlfnWY46aNKeW4LFoOz8kJxsC0P3diXpQEkTwWtTxpXBb9U3o3+ZT5QTX46U4RR sp45IyHw0NW/ez3Rx2KgG/cvjHUp/Rc= From: Michael Walle To: linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org Cc: Tudor Ambarus , Pratyush Yadav , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Michael Walle Subject: [PATCH 0/2] mtd: spi-nor: support dumping sfdp tables Date: Thu, 18 Mar 2021 10:24:04 +0100 Message-Id: <20210318092406.5340-1-michael@walle.cc> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add the possibility to dump the SFDP data of a flash device. More and more flash devices share the same flash ID and we need per device fixups. Usually, these fixups differentiate flashes by looking at differences in the SFDP data. Determining the difference is only possible if we have the SFDP data for all the flashes which share a flash ID. This will lay the foundation to dump the whole SFDP data of a flash device. This is even more important, because some datasheets doesn't even contain the SFDP data. Fixups for these kind of flashes are nearly impossible to do. I envision having a database of all the SFDP data for the flashes we support and make it a requirement to submit it when a new flash is added. This might or might not have legal implications. Thus I'd start with having that database private to the SPI NOR maintainers. Changes since RFC: - Don't read SFDP data after probe. The flash might already be switched to 8D-8D-8D mode. Instead, cache the SFDP data - add two sysfs files: jedec-id and name - change the file mode of the sfdp file from 0400 to 0444. There is no hardware access anymore. Michael Walle (2): mtd: spi-nor: sfdp: save a copy of the SFDP data mtd: spi-nor: add initial sysfs support drivers/mtd/spi-nor/Makefile | 2 +- drivers/mtd/spi-nor/core.c | 5 +++ drivers/mtd/spi-nor/core.h | 13 ++++++ drivers/mtd/spi-nor/sfdp.c | 49 ++++++++++++++++++++ drivers/mtd/spi-nor/sysfs.c | 86 ++++++++++++++++++++++++++++++++++++ include/linux/mtd/spi-nor.h | 3 ++ 6 files changed, 157 insertions(+), 1 deletion(-) create mode 100644 drivers/mtd/spi-nor/sysfs.c -- 2.20.1