From patchwork Fri Jul 15 10:57:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 1656822 X-Patchwork-Delegate: tudor.ambarus@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=nAU3v90s; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LkpHN2GXnz9s07 for ; Fri, 15 Jul 2022 20:58:08 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bhiR+VNJp5zSo2B0hcp+PhpCkbmB85BmbCwU7KqIT7k=; b=nAU3v90sV7u2ir p0epEVnivquuENhNb1j1gfr4k804bSV4X+yDqdBxkDZ0ajbsgIkRmKMXyNSe8/M9c+bcrewlUmA/Y DMUN/VV/HdDm9oKTRqYtTNIgDVrZJZEDpWOyAgL3T1ukeQX5gDIK/Pqept2T+Qsv4zqSJzjn6v4z0 tkwozOudf7OILYK2AdmgwfuPq1urF8joyBj/uBVM/9YOM5OHkPPIldv+PIOZsDdmN6u65aQCW1mNF iQzT7/lxrtaag4d793/81gpgBgBOSwJQTWFT8Hl8/bqjSdUXkjns/caKeTYrPLLnXMemoePwq/Eej WCWvCoDB3C4uPf2s54Qg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oCJ0w-006S3U-W7; Fri, 15 Jul 2022 10:57:43 +0000 Received: from relmlor1.renesas.com ([210.160.252.171] helo=relmlie5.idc.renesas.com) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oCJ0l-006Ryr-CC for linux-mtd@lists.infradead.org; Fri, 15 Jul 2022 10:57:32 +0000 X-IronPort-AV: E=Sophos;i="5.92,273,1650898800"; d="scan'208";a="126292367" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 15 Jul 2022 19:57:28 +0900 Received: from localhost.localdomain (unknown [10.226.92.160]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 820E34251BF2; Fri, 15 Jul 2022 19:57:24 +0900 (JST) From: Biju Das To: Tudor Ambarus , Pratyush Yadav , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra Cc: Biju Das , Michael Walle , linux-mtd@lists.infradead.org, Geert Uytterhoeven , Chris Paterson , Biju Das , Prabhakar Mahadev Lad , linux-renesas-soc@vger.kernel.org Subject: [PATCH v2 1/2] mtd: spi-nor: Add support for SNOR_ID3 macro Date: Fri, 15 Jul 2022 11:57:15 +0100 Message-Id: <20220715105716.2415068-2-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220715105716.2415068-1-biju.das.jz@bp.renesas.com> References: <20220715105716.2415068-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220715_035731_553850_50028038 X-CRM114-Status: UNSURE ( 8.24 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Add SNOR_ID3 macro to get chip info by parsing sfdp. Signed-off-by: Biju Das --- v2: * New patch --- drivers/mtd/spi-nor/core.h | 9 +++++++++ 1 file changed, 9 insertions(+) Content analysis details: (0.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Add SNOR_ID3 macro to get chip info by parsing sfdp. Signed-off-by: Biju Das --- v2: * New patch --- drivers/mtd/spi-nor/core.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/mtd/spi-nor/core.h b/drivers/mtd/spi-nor/core.h index 61886868cd02..153c1a0b2eda 100644 --- a/drivers/mtd/spi-nor/core.h +++ b/drivers/mtd/spi-nor/core.h @@ -548,6 +548,15 @@ struct flash_info { .n_sectors = (_n_sectors), \ .page_size = 256, \ +#define SNOR_ID3(_jedec_id) \ + .id = { \ + ((_jedec_id) >> 16) & 0xff, \ + ((_jedec_id) >> 8) & 0xff, \ + (_jedec_id) & 0xff, \ + }, \ + .id_len = 3, \ + .parse_sfdp = true, \ + #define CAT25_INFO(_sector_size, _n_sectors, _page_size, _addr_width) \ .sector_size = (_sector_size), \ .n_sectors = (_n_sectors), \