Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1507577pxf; Fri, 12 Mar 2021 11:08:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJznEyhZckzKiwbTfONMFFlF4UgRhJsUnhH63QEBq54Z3fjmcwMMAvhLIZu/S66x1gk7esXT X-Received: by 2002:a17:906:68c1:: with SMTP id y1mr10218849ejr.289.1615576098178; Fri, 12 Mar 2021 11:08:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615576098; cv=none; d=google.com; s=arc-20160816; b=DnqJWftuSFMau/SNz587lpk6L7YjfGpKB34JQmzeAyS3Mg9G+pD7pejJsMTw4pzjqS 2fFsdwIAz3BRa1kyVLAVxkuJ/FTiD9Z5IJODQlWWbbDrl7oP9CFcAYsHY3r/b+3bIKiU 96KATFy9oPHJSqvTEQvhEdEBULmM24+hy48yhGHOAarz9EDmr+OUruSMOZDz0wJjYwMK a2D71dDmYGJWZ6Odb0X01QCKsLJXEEW9eP0cc2dANitRpJ5B8XuQFlPyEwsWwb5eZYJL E7eqzBWVXrBeLFBzowJlBiisWQNt1E1DdC7+2MOz8nsJMRo1p7xAq5XIkgYqawqKuZuz J9Jw== 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=r1NUXsd8CcCDGSgN9MbS4BQVVK/eEe8OH8TuK2TBWdU=; b=SZfkDhiLofDCNdMjt+unT6dYqBGSYOV/P3DCVNdpgE+c3sa3/roRGmVBe8rImpDh/y lFiSfZ7z6vnqwN8jUsxr46oRG2so174EpyWn7CPg75FHDTzExkOS8Ob6OxFZhoO5u0Y8 plQeuwMzBk7jUA6JaKvbj3tzWLPS88ORkcNNb/nkyysko+zNgnAZj+1QvWGhnuD2slJr dSpSyBmrnkOuVT4K7UE3/I2o6iCT6dad2/2aMVsTtS5tk+yXqom6cld51ey18AOk3mmh iVc92oThOdB5F9auQ7crtTxEzwsWXhunTsXPtoqn8tcjx7sDcOPJQdLFADzAy2DPFuWe q7oA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=ftGn2reI; 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 t19si4782011ejd.179.2021.03.12.11.07.53; Fri, 12 Mar 2021 11:08:18 -0800 (PST) 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=ftGn2reI; 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 S234138AbhCLTGi (ORCPT + 99 others); Fri, 12 Mar 2021 14:06:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234064AbhCLTGF (ORCPT ); Fri, 12 Mar 2021 14:06:05 -0500 Received: from ssl.serverraum.org (ssl.serverraum.org [IPv6:2a01:4f8:151:8464::1:2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7995C061574 for ; Fri, 12 Mar 2021 11:06:05 -0800 (PST) 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 62A1E22238; Fri, 12 Mar 2021 20:06:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1615575963; 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=r1NUXsd8CcCDGSgN9MbS4BQVVK/eEe8OH8TuK2TBWdU=; b=ftGn2reIyDNiSRy7+ia+andf8S1ds8SvJzrxvkFwFQSaXCjjKQI/9IRiqmBCfT/p/yj6Br xdSYqzcSgqh3b5ka6GRW8WUxf7rbHiza67ONaWq8I79FWV+3uWhqHLe8Ch4maVhkdF06is 8g+F4nnA7ZmP25uO28N/KfTQYkXhnEs= 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: [RFC PATCH 1/3] mtd: spi-nor: support dumping sfdp tables Date: Fri, 12 Mar 2021 20:05:45 +0100 Message-Id: <20210312190548.6954-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. There are two ways to provide access to the SFDP data: (1) We just read the SFDP data once and cache it (2) Any userspace access will always read the SFDP data I choose (2) because it isn't as invasive as (1). The current SFDP code reads the SFDP data only partially and only the part which are actually used. Using (1) would mean to change that behavior. Michael Walle (3): mtd: spi-nor: sfdp: remember sfdp_size mtd: spi-nor: sfdp: fix spi_nor_read_sfdp() mtd: spi-nor: add sysfs and SFDP support drivers/mtd/spi-nor/Makefile | 2 +- drivers/mtd/spi-nor/core.c | 5 +++ drivers/mtd/spi-nor/core.h | 3 ++ drivers/mtd/spi-nor/sfdp.c | 24 +++++++++++- drivers/mtd/spi-nor/sfdp.h | 2 + drivers/mtd/spi-nor/sysfs.c | 73 ++++++++++++++++++++++++++++++++++++ include/linux/mtd/spi-nor.h | 1 + 7 files changed, 107 insertions(+), 3 deletions(-) create mode 100644 drivers/mtd/spi-nor/sysfs.c -- 2.20.1