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), \ From patchwork Fri Jul 15 10:57:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 1656823 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=vsjErTxM; 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 4LkpHZ3dyQz9s07 for ; Fri, 15 Jul 2022 20:58:18 +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=KoX9Pz2uoLoa14saQNefz5m3Y5ySa8Wf8Cn2YN7fTnc=; b=vsjErTxMLxN0m8 RPGK4dK4bSkBQ2XaS+y6/viNuPH3nmKJ804VIupa4TqSz2UGSFLoNgrabKxvtw7Rap3tcigEnyRTt aiTvE1cuYzNRozcfSFQjI4/DLuUWBHRFhhtawWA2eHWFOuuyHRPi0eAAc/PLkapWT/Pp13bkEbkPA v/SxN/ERvfHo3IvNkIbRI3pdGB3PoWKRoj7JwwmtbxDyOa0l3nSYbd6CaaDPvM1Jd0oYLUg1EU6rY pJULnpTCJxNEc3FRZAtC6PBxg2SG57z/Q456ghtxXvFhGCimC0blQ6ogW5qChBDUY6SXGeeSsatvn bCohKBJvKhC/nTWVMWXQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oCJ16-006S6z-K0; Fri, 15 Jul 2022 10:57:52 +0000 Received: from relmlor2.renesas.com ([210.160.252.172] helo=relmlie6.idc.renesas.com) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oCJ0o-006Ry8-G1; Fri, 15 Jul 2022 10:57:36 +0000 X-IronPort-AV: E=Sophos;i="5.92,273,1650898800"; d="scan'208";a="127981317" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 15 Jul 2022 19:57:34 +0900 Received: from localhost.localdomain (unknown [10.226.92.160]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 003B14251BF2; Fri, 15 Jul 2022 19:57:28 +0900 (JST) From: Biju Das To: Tudor Ambarus , Pratyush Yadav , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra Cc: Biju Das , Michael Walle , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , linux-mtd@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Geert Uytterhoeven , Chris Paterson , Biju Das , Prabhakar Mahadev Lad , linux-renesas-soc@vger.kernel.org Subject: [PATCH v2 2/2] mtd: spi-nor: Add Renesas AT25QL128A serial nor flash Date: Fri, 15 Jul 2022 11:57:16 +0100 Message-Id: <20220715105716.2415068-3-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_035734_668700_F2DA53BA X-CRM114-Status: UNSURE ( 8.94 ) 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 support for Renesas AT25QL128A serial nor flash. Details of flash chip can be found here [1] [1] https://www.dialog-semiconductor.com/sites/default/files/2022-04/DS-AT25QL128A-129F-022022.pdf Signed-off-by: Biju Das --- $ xxd -p sfdp 53464450060101ff00060110300000ff1f00010280000001ffffffffffff ffffffffffffffffffffffffffffffffffffe520f1ffffffff0744eb086b 083b80b [...] 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 support for Renesas AT25QL128A serial nor flash. Details of flash chip can be found here [1] [1] https://www.dialog-semiconductor.com/sites/default/files/2022-04/DS-AT25QL128A-129F-022022.pdf Signed-off-by: Biju Das Reviewed-by: Michael Walle Acked-by: Pratyush Yadav --- $ xxd -p sfdp 53464450060101ff00060110300000ff1f00010280000001ffffffffffff ffffffffffffffffffffffffffffffffffffe520f1ffffffff0744eb086b 083b80bbfeffffffffff00ffffff42eb0c200f5210d800ff3362d5008429 01ceeca1073d7a757a75f7a2d55c19f61cffe810c080ffffffffffffffff ffffffffffffffff501650190000ffff $ md5sum /sys/devices/platform/soc/10060000.spi/rpc-if-spi/spi_master/spi1/spi1.0/spi-nor/sfdp 23e3ec56b5b8f986d0488ba4727239dd /sys/devices/platform/soc/10060000.spi/rpc-if-spi/spi_master/spi1/spi1.0/spi-nor/sfdp $ cat /sys/devices/platform/soc/10060000.spi/rpc-if-spi/spi_master/spi1/spi1.0/spi-nor/jedec_id 1f4218 $ cat /sys/devices/platform/soc/10060000.spi/rpc-if-spi/spi_master/spi1/spi1.0/spi-nor/partname at25ql128a $ cat /sys/devices/platform/soc/10060000.spi/rpc-if-spi/spi_master/spi1/spi1.0/spi-nor/manufacturer atmel v2->v1: * Added flash definitions into Atmel table. RFC->v1: * Moved the flash definitions to atmel.c * Remove macro related to locking as it is untested. * Replaced INFO macro with SNOR_ID3 RFC: * https://patchwork.kernel.org/project/linux-renesas-soc/patch/20220501185512.51158-1-biju.das.jz@bp.renesas.com/ --- drivers/mtd/spi-nor/atmel.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mtd/spi-nor/atmel.c b/drivers/mtd/spi-nor/atmel.c index 656dd80a0be7..80c24d138b27 100644 --- a/drivers/mtd/spi-nor/atmel.c +++ b/drivers/mtd/spi-nor/atmel.c @@ -186,6 +186,7 @@ static const struct flash_info atmel_nor_parts[] = { .fixups = &atmel_nor_global_protection_fixups }, { "at25sl321", INFO(0x1f4216, 0, 64 * 1024, 64) NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, + { "at25ql128a", SNOR_ID3(0x1f4218) }, { "at26f004", INFO(0x1f0400, 0, 64 * 1024, 8) NO_SFDP_FLAGS(SECT_4K) }, { "at26df081a", INFO(0x1f4501, 0, 64 * 1024, 16)