From patchwork Fri Jul 2 14:41:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 1500156 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: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: 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=iN1C25L1; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=microchip.com header.i=@microchip.com header.a=rsa-sha256 header.s=mchp header.b=10FtDu1c; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GGd8R5fxJz9sS8 for ; Sat, 3 Jul 2021 00:42:15 +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=pDAZvuxH1yn9v+rOpEMMwgfl48nZ1XTzirNLMkqVgFc=; b=iN1C25L1hQJhO8 QiNdQ0NBo1acH7cTZT1e3cFivG7fnLsAI91z9WJkrS2KkcMeOiXQTGzQ30mk+MaAPG7DbmHggiUEF vn4DWawLRGP6i/p/PXzhim6WNZcXDLNfldmpSvz9V8SAPZyL1iyLo+gTKCVITlvxP3JgXEgL6F67a vTOj4oq2HFm4UQjpBSu6rKbO/fbEUkfZZNxe44Sesfn0WdK18SeHMNAPq2cazD9Jaa2NzoWWHyvpM jHCTjsGYXr8C1kh6uJ67GARdvkiOuCVIySGFsaqaDHfon7zYU2M3LAokTi/t7/7jsTPhyoTwpGhHt AkujOGBKNlo1rxxquCbQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lzKMM-003HZv-2U; Fri, 02 Jul 2021 14:41:38 +0000 Received: from esa.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lzKM9-003HXs-61 for linux-mtd@lists.infradead.org; Fri, 02 Jul 2021 14:41:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1625236885; x=1656772885; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/imY89DZLDG1KRu8xotZ6z2LJ1EbbTa5LUuP0kfEfNQ=; b=10FtDu1cMZ7tRRT1UNup6/tkYzWc9oZKt2EZIlXUIIerGif6fAfYIXiV J9uO/U5USyZPufntUrirllbAru48LFVI1N5USbNQXY0jzwfH1As30oR0A C7ItnNjESo6UQns2iKqIoh9j5r+uOM8dUa+d7UEDXb+mlnse33Y4hj3EZ iJ5yWybH6Ig3FIxOBwf7hmmH49pkW85cj1wQsXQ7ikY6l8H/3lnNVdSZo fKbL0tamceGlf0apOpc4QJTt95pbj6QLLH9Ftd0TE9nEymqjRLxJRMgrT /amJnDQMraOVxpMTRoaB1dyQUuyfjk55IFRonKJ/yqOnP4d048T47M53a g==; IronPort-SDR: Kn+Zrkf1FrFycurQJ/uwqx2cYe8Q0p0t6amgiPo8b3InKa0uypefOhntun4VXCAxP3oxvWCIhU VobmFGXXU3J/psmmVUMPtE9oBB1IFKjJZpehujUeLbwJqVnWoiIyUAbkG46R6qvzdhFX41PB5n 8rLravBii24vpsq+HYFGlzEzaSEKbdG0Akm5SpnTOwu77KQfUmjrGKSZqKiVY3q5FMHtmpsEYy r/FUTJbpNE72kyAZ5Xy84k7T+1NJgPA+E1w4R+KOa00rv3P5zfXaov/va5SprSC4jIvgpdXdfa COg= X-IronPort-AV: E=Sophos;i="5.83,317,1616482800"; d="scan'208";a="123330203" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 02 Jul 2021 07:41:22 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 2 Jul 2021 07:41:22 -0700 Received: from ROB-ULT-M18064N.mchp-main.com (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Fri, 2 Jul 2021 07:41:18 -0700 From: Tudor Ambarus To: , , , , , , , , , , , CC: , , , , , Tudor Ambarus Subject: [PATCH 1/7] mtd: spi-nor: core: Introduce SPI_NOR_PARSE_SFDP Date: Fri, 2 Jul 2021 17:41:04 +0300 Message-ID: <20210702144110.250481-2-tudor.ambarus@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210702144110.250481-1-tudor.ambarus@microchip.com> References: <20210702144110.250481-1-tudor.ambarus@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210702_074125_331830_AE0EECDE X-CRM114-Status: GOOD ( 14.85 ) X-Spam-Score: -2.7 (--) 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: SPI NOR flashes that statically declare one of the SPI_NOR_{DUAL, QUAD, OCTAL, OCTAL_DTR}_READ flags, and do not support the RDSFDP command, are gratuiously receiving the RDSFDP command, in the attemp [...] Content analysis details: (-2.7 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.154.123 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [68.232.154.123 listed in wl.mailspike.net] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -0.2 DKIMWL_WL_HIGH DKIMwl.org - High trust sender 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 SPI NOR flashes that statically declare one of the SPI_NOR_{DUAL, QUAD, OCTAL, OCTAL_DTR}_READ flags, and do not support the RDSFDP command, are gratuiously receiving the RDSFDP command, in the attempt of parsing the SFDP tables. It is not desirable to issue comands that are not supported, so introduce a flag to help on this situation. New flash additions that support the SFDP standard should be declared using SPI_NOR_PARSE_SFDP. Support that can be discovered when parsing SFDP should not be duplicated by explicit flags at flash declaration. All the flash parameters will be discovered when parsing SFDP. Sometimes manufacturers wrongly define some fields in the SFDP tables. If that's the case, SFDP data can be ammended with the fixups() hooks. It is not common, but if the SFDP tables are entirely wrong, and it does not worth the hassle to tweak the SFDP parameters by using the fixups hooks, or if the flash does not define the SFDP tables at all, then statically init the flash with the SPI_NOR_SKIP_SFDP flag and specify the reset of flash capabilities with the flash info flags. With time, we want to convert all flashes to SPI_NOR_PARSE_SFDP and stop triggering the SFDP parsing with the SPI_NOR_{DUAL, QUAD, OCTAL*}_READ flags. Getting rid of the SPI_NOR_{OCTAL, OCTAL_DTR}_READ trigger is easy achievable, the reset are a long term goal. Signed-off-by: Tudor Ambarus Reviewed-by: Heiko Thiery Reviewed-by: Pratyush Yadav --- drivers/mtd/spi-nor/core.c | 3 ++- drivers/mtd/spi-nor/core.h | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c index cc08bd707378..3d9f3698fb7b 100644 --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -2726,7 +2726,8 @@ static int spi_nor_init_params(struct spi_nor *nor) spi_nor_manufacturer_init_params(nor); - if ((nor->info->flags & (SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | + if ((nor->info->flags & (SPI_NOR_PARSE_SFDP | + SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_OCTAL_READ | SPI_NOR_OCTAL_DTR_READ)) && !(nor->info->flags & SPI_NOR_SKIP_SFDP)) spi_nor_sfdp_init_params(nor); diff --git a/drivers/mtd/spi-nor/core.h b/drivers/mtd/spi-nor/core.h index 3348e1dd1445..55fceb0ec894 100644 --- a/drivers/mtd/spi-nor/core.h +++ b/drivers/mtd/spi-nor/core.h @@ -382,6 +382,10 @@ struct flash_info { * protection bits. Usually these will * power-up in a write-protected state. */ +#define SPI_NOR_PARSE_SFDP BIT(23) /* + * Flash initialized based on the SFDP + * tables. + */ const struct spi_nor_otp_organization otp_org; From patchwork Fri Jul 2 14:41:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 1500158 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: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: 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=Ga4R9BJy; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=microchip.com header.i=@microchip.com header.a=rsa-sha256 header.s=mchp header.b=I4G1anJn; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GGd8c0xdpz9sS8 for ; Sat, 3 Jul 2021 00:42:24 +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=0AwwvPMa3kRLbdhdwPjtABunVee+bNRo5+VmtakZ2ZQ=; b=Ga4R9BJyIcWkja jTWa6nGRECOCOEo3YpxjawjAk//AisXadO3GNf1KjfHhjHiNtMVWiTAJeKFVnArzv8yenYRXebCEq GP7H/oMmTa2dIP13xfWLep28GCMRWtSCgepEoimutz0chuQddPUg7i1uFJaXnC3rYIomSZsid9dEn rABMmW6KVcjOcwl0b35WW6Lm1411UHkGaZQhpVzVy0vfeCMQd32OtBIiGuR9cFNXAoXXpx6yydAYg rnjY+y4j3SGgKwSx7RQS8BCnxFtq/0O7F51wDrUdBIocbmURwz8RxtYRDmkyvvIRc5+G00bO1e8+A N9eR5jcuxfmEMiRjVDig==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lzKMa-003Hd1-VA; Fri, 02 Jul 2021 14:41:53 +0000 Received: from esa.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lzKMB-003HXs-Ju for linux-mtd@lists.infradead.org; Fri, 02 Jul 2021 14:41:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1625236887; x=1656772887; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=DkXbwSjE6ZgRVN3HbrZJTRDfcahmmCwoTtcQANFjcBk=; b=I4G1anJn8+a0NgnKWUQ4g/KH3YYnjhqjmLxifpZEMkfPDfZz5OMcBCIK aTPbM3I51MkreARm6x5fH3OSGryMhoDd6LimwdcZQ9bW2yjCYUeA+D0Iu w0+xk4IpPIk5HWn4ZXJcZX3DIu/r0+9Vva/PPTr/A7oGmaMyhd7Sa6RZe VkYWvV46DzMKCDIFXMDtOSBHdkktwBpWfw3Nu7nxxhQvQzBVmUM/dWA3z foDMIC7VxfdVykUflJHINhdfUjcGnvPdXCI//fDi2No6nQeMIYb0NlIui W8UlrrKZcR9erq3wxKBonBFOYOc6D1rhpQS4o2v6xQc8t1DP01Kkgb/bu Q==; IronPort-SDR: NjLZKn6GhCisG7evFxn76Uv7t74ekQ8v4Rec9GKDkQhijuwDKD1AiIlhRzV1wueA4aKpOVUtA9 yMBKc+8UWWhlzfQ42kvYQhlUp7uPS47joKjXZPS+fBfSucmeqOumgq3flHSpIwxxUL1PV99pzt NXITh1kR2rZt72uB1lXFSXr+n3P9DUZObZRRlFhzGvoIrJah/UlbQoQdR59XNV2Sw0eX2sMS33 wc8J1VJ/c/gHHv9oK/JwMXe8Gr8O1VqLaBEU275AnsUuYjzdZmpgsgP/hLtsK5ho0EWJxdL2UB Pr0= X-IronPort-AV: E=Sophos;i="5.83,317,1616482800"; d="scan'208";a="123330209" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 02 Jul 2021 07:41:27 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 2 Jul 2021 07:41:26 -0700 Received: from ROB-ULT-M18064N.mchp-main.com (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Fri, 2 Jul 2021 07:41:22 -0700 From: Tudor Ambarus To: , , , , , , , , , , , CC: , , , , , Tudor Ambarus Subject: [PATCH 2/7] mtd: spi-nor: core: Report correct name in case of ID collisions Date: Fri, 2 Jul 2021 17:41:05 +0300 Message-ID: <20210702144110.250481-3-tudor.ambarus@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210702144110.250481-1-tudor.ambarus@microchip.com> References: <20210702144110.250481-1-tudor.ambarus@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210702_074127_739381_EE8C6839 X-CRM114-Status: GOOD ( 13.08 ) X-Spam-Score: -2.7 (--) 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: Provide a way to report the correct flash name in case of ID collisions. There will be a single flash_info entry when flash IDs collide, and the differentiation between the flash types will be made at [...] Content analysis details: (-2.7 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [68.232.154.123 listed in wl.mailspike.net] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.154.123 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -0.2 DKIMWL_WL_HIGH DKIMwl.org - High trust sender 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 Provide a way to report the correct flash name in case of ID collisions. There will be a single flash_info entry when flash IDs collide, and the differentiation between the flash types will be made at runtime if possible. Signed-off-by: Tudor Ambarus Reviewed-by: Heiko Thiery --- drivers/mtd/spi-nor/core.c | 5 ++++- include/linux/mtd/spi-nor.h | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c index 3d9f3698fb7b..d528e28995c6 100644 --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -3208,7 +3208,10 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, /* Configure OTP parameters and ops */ spi_nor_otp_init(nor); - dev_info(dev, "%s (%lld Kbytes)\n", info->name, + if (!nor->name) + nor->name = info->name; + + dev_info(dev, "%s (%lld Kbytes)\n", nor->name, (long long)mtd->size >> 10); dev_dbg(dev, diff --git a/include/linux/mtd/spi-nor.h b/include/linux/mtd/spi-nor.h index f67457748ed8..bd92acdd1899 100644 --- a/include/linux/mtd/spi-nor.h +++ b/include/linux/mtd/spi-nor.h @@ -369,6 +369,7 @@ struct spi_nor_flash_parameter; * @bouncebuf: bounce buffer used when the buffer passed by the MTD * layer is not DMA-able * @bouncebuf_size: size of the bounce buffer + * @name: used to point to correct name in case of ID collisions. * @info: SPI NOR part JEDEC MFR ID and other info * @manufacturer: SPI NOR manufacturer * @page_size: the page size of the SPI NOR @@ -399,6 +400,7 @@ struct spi_nor { struct spi_mem *spimem; u8 *bouncebuf; size_t bouncebuf_size; + const char *name; const struct flash_info *info; const struct spi_nor_manufacturer *manufacturer; u32 page_size; From patchwork Fri Jul 2 14:41:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 1500159 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: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: 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=ORNSBmEX; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=microchip.com header.i=@microchip.com header.a=rsa-sha256 header.s=mchp header.b=nyZCCAQk; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GGd8z75Tfz9sS8 for ; Sat, 3 Jul 2021 00:42:43 +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=iUrWvaQ6tLsb3aOO5Lep4aOc4f65XplHdC1WyA4oM+c=; b=ORNSBmEXzHRtpf Pu5R5H5mo0gQBh9G1x1V/YtXfTkxQFLvxROk/2mp82stE6+pTRMGSbotwJzTY269Oms/5xJJRQDsq jYAo2jF7wIq5A9wsPf/OYEN5EfaIPVhvqYTQZ5u2bUFke817a175Dc3SSh7VgDjkppkBrlw1GCG7F 07jCo3bY5nrlMDlTeQSyGKbvcvwepPD79hjlgfn+oK84qD8FnGDwSS2iuIQa+/llRbn0wlZMwJwx7 47SEj+hy+eUEB9UGi4ocvU33jKiFnsfhGUvuvvuWcb7vCvHPW4mVQ+Id58c9CE6BIvpGcLE3Mv/Uj 6JMRpleSTOQbUVhNoCNg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lzKMr-003HhC-M1; Fri, 02 Jul 2021 14:42:09 +0000 Received: from esa.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lzKMI-003HYx-4F for linux-mtd@lists.infradead.org; Fri, 02 Jul 2021 14:41:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1625236893; x=1656772893; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=CSXeHhHRroysqBWxbW4/LrUR1oh+ZN80pio3MzNvJmQ=; b=nyZCCAQkXR9GFmiuK59QjxAhU7VF5/kJpL6bE/k4FzCjIjA/xpIeJLcR RbB9DwKR373VJ+4ykxRyCg2xV9AY5PomjwJgJx5OhdkEybbmiPfAXE/49 OUcXiLKJiUn8XxPQ2Fsjho91ExiKi/SYB4z6C4NaliyQPAkTBh02ylJgb IkmnfuduLcd6dxnDB6tytQcjQI8lt+p35IyogM2ir0nl8WXYRopHqnFi1 DMQvke80544zn1V15D4ZvkpicDvPtUFlWGwQt1xonr8JbiXCgdt2ewFIT D5xCMuRE/Zolgh68spnEuUipDy33ky1TS01lzxEy3+EudoBLchcYJMxBf g==; IronPort-SDR: F+KEs8aXVUcK4VJSB5/8fpYGhdDzZ20um8uWtAhhFrS353BfCfaRDyOcQOGEbBrvf6LmmY5hcG PfyDIwY1HMhGp3siKt9VdekBwsidK23S7bNkXqa877QL35u9NotaL+Aa9oQowvI4mZ2hzL+UhO VHMIuwf4PSp0epENJCGA37dCd1XMbsgMoCYHPvsiW6L3Q0oaPFyuf1EF/L6s7UrHLufXUNjSwn bN4ZRGhhFmYhPHl58lk53u1UWnWfPivoxvQg/frDZ+ZtFHxV8KE+OzwQRbX+OZr85yNd6bUkYD 4y0= X-IronPort-AV: E=Sophos;i="5.83,317,1616482800"; d="scan'208";a="60983587" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 02 Jul 2021 07:41:31 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 2 Jul 2021 07:41:30 -0700 Received: from ROB-ULT-M18064N.mchp-main.com (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Fri, 2 Jul 2021 07:41:26 -0700 From: Tudor Ambarus To: , , , , , , , , , , , CC: , , , , , Tudor Ambarus Subject: [PATCH 3/7] mtd: spi-nor: macronix: Handle ID collision b/w MX25L3233F and MX25L3205D Date: Fri, 2 Jul 2021 17:41:06 +0300 Message-ID: <20210702144110.250481-4-tudor.ambarus@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210702144110.250481-1-tudor.ambarus@microchip.com> References: <20210702144110.250481-1-tudor.ambarus@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210702_074134_290775_2246DECA X-CRM114-Status: GOOD ( 13.53 ) X-Spam-Score: -2.7 (--) 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: Macronix has a bad habbit of reusing flash IDs. While MX25L3233F supports RDSFDP opcode, MX25L3205D does not support it and does not recommend issuing opcodes that are not supported ("It is not recomm [...] Content analysis details: (-2.7 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [68.232.154.123 listed in wl.mailspike.net] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.154.123 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -0.2 DKIMWL_WL_HIGH DKIMwl.org - High trust sender 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 Macronix has a bad habbit of reusing flash IDs. While MX25L3233F supports RDSFDP opcode, MX25L3205D does not support it and does not recommend issuing opcodes that are not supported ("It is not recommended to adopt any other code not in the command definition table, which will potentially enter the hidden mode."). We tested the RDSFDP on the MX25L3205D and the conclusion is that the flash didn't reply anything. Given that it is unlikely that RDSFDP will cause any problems for the old MX25L3205D, differentiate between the two flashes by parsing SFDP. Signed-off-by: Tudor Ambarus Acked-by: Pratyush Yadav --- drivers/mtd/spi-nor/macronix.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/spi-nor/macronix.c b/drivers/mtd/spi-nor/macronix.c index 27498ed0cc0d..83a097708949 100644 --- a/drivers/mtd/spi-nor/macronix.c +++ b/drivers/mtd/spi-nor/macronix.c @@ -8,6 +8,26 @@ #include "core.h" +static const char *mx25l3233f = "mx25l3233f"; + +static int mx25l3233f_post_bfpt_fixups(struct spi_nor *nor, + const struct sfdp_parameter_header *bfpt_header, + const struct sfdp_bfpt *bfpt) +{ + /* + * Macronix has a bad habit of reusing flash IDs: MX25L3233F collides + * with MX25L3205D. MX25L3233F defines SFDP tables, while the older + * variant does not. + */ + nor->name = mx25l3233f; + + return 0; +} + +static struct spi_nor_fixups mx25l3233f_fixups = { + .post_bfpt = mx25l3233f_post_bfpt_fixups, +}; + static int mx25l25635_post_bfpt_fixups(struct spi_nor *nor, const struct sfdp_parameter_header *bfpt_header, @@ -39,7 +59,9 @@ static const struct flash_info macronix_parts[] = { { "mx25l4005a", INFO(0xc22013, 0, 64 * 1024, 8, SECT_4K) }, { "mx25l8005", INFO(0xc22014, 0, 64 * 1024, 16, 0) }, { "mx25l1606e", INFO(0xc22015, 0, 64 * 1024, 32, SECT_4K) }, - { "mx25l3205d", INFO(0xc22016, 0, 64 * 1024, 64, SECT_4K) }, + { "mx25l3205d", INFO(0xc22016, 0, 64 * 1024, 64, SPI_NOR_PARSE_SFDP | + SECT_4K) + .fixups = &mx25l3233f_fixups }, { "mx25l3255e", INFO(0xc29e16, 0, 64 * 1024, 64, SECT_4K) }, { "mx25l6405d", INFO(0xc22017, 0, 64 * 1024, 128, SECT_4K) }, { "mx25u2033e", INFO(0xc22532, 0, 64 * 1024, 4, SECT_4K) }, From patchwork Fri Jul 2 14:41:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 1500160 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: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: 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=aYID6LAh; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=microchip.com header.i=@microchip.com header.a=rsa-sha256 header.s=mchp header.b=M9offk1w; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GGd9N2rvXz9sS8 for ; Sat, 3 Jul 2021 00:43:04 +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=eghNBmmPR03aotwFJ7sH6qq4QBoqttXHvLbITrK6elM=; b=aYID6LAh/WPpDb UzFiVOxAf+BYiQ/In1PLLrHrFmORu2Mx0xbNZHzjywJRSaS5F0hV56Pcb9XSI89BaMjTvFA0BBOBb Hr3md8pq01RT6gS4gqP8j+fXwrmM6emwvnDwj7xAvST+t+1KbAcXW43FlZVOph1WgcV+SOhsvGdH3 qLkIU6i53iapbL7OT27336ndDTbg8TtdxjcfKSD/F/Qn4dkOau4qHUE0VWJOm0DZO+kFmc1m0Ao/L o0EOvT6NtN7zblp3Ut1/9wM5aYberI6eTGWDjNBMxf4ekFRt7L52M358J1cloh7gNdJgqAPlGmeIa O6r6AjUnSF5hPZm570RA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lzKN9-003Hma-Mz; Fri, 02 Jul 2021 14:42:27 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lzKMK-003HZW-Ly for linux-mtd@lists.infradead.org; Fri, 02 Jul 2021 14:41:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1625236896; x=1656772896; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=eqTU3Jz/C7GI76tyocrX+Y71mG+HdvIsC1seTpPkvFE=; b=M9offk1wlg7Yjx5QDtTdVpIKqdYlohWKvDUBtbbz4lbQzfND5ySNKFBg eY/2kneq1clD7FPmRRPrxVyFS00d/DlwcIdfOhtYDxQi2wcA1c2FPg/Y/ WA/VICpO98sa2r8MFpfFlmdWGWObK8IZQp4qupzqyk7ckOlcKSLt9Pmsy WC33mfIxq5MjweIWq9h077YOE2FybmS7a5xIXABBwGhqIxbZw5NGiLth7 ElQytUrs5RiFjAdzdxSq6KClP0unZ7uES1+6dPmY0oJ6CIsOXAVBxZHhu wpwSh/0Cf/z9/eqOyUWIyK5jYyTwEE756YwdmTo3IgH4a7wGO+H3r8qH7 g==; IronPort-SDR: YdFkSN3iq7nL/h/+Vzmy4ClvVJQRkJNmAdkC08JcRlvdOXOsdA3YGG0qfiozU8KzV89V3ZcncK j9QDvNWSbY6ncnhZxekNJr1915RldkuGNBTcd65zeFr+DYJkdS4aKLKP07oxlzzxwJNNnrr+mr 6AKqSkMqAiHeNuZ02fg2K3+xWJnSezK0q8F19tMKFwMzv8pEXK7JE8HEvCLoVqBIWfGhcgDMEv V26AcPg1GJvV+GJjPdW/8Eb7pPtP5sH81/Xvqyt6ANDLMMwJUMq/bzZ7dDImffWWis/i/DrKEe F4E= X-IronPort-AV: E=Sophos;i="5.83,317,1616482800"; d="scan'208";a="127485999" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 02 Jul 2021 07:41:35 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 2 Jul 2021 07:41:35 -0700 Received: from ROB-ULT-M18064N.mchp-main.com (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Fri, 2 Jul 2021 07:41:31 -0700 From: Tudor Ambarus To: , , , , , , , , , , , CC: , , , , , Tudor Ambarus Subject: [PATCH 4/7] mtd: spi-nor: macronix: Handle ID collision b/w MX25L12805D and MX25L12835F Date: Fri, 2 Jul 2021 17:41:07 +0300 Message-ID: <20210702144110.250481-5-tudor.ambarus@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210702144110.250481-1-tudor.ambarus@microchip.com> References: <20210702144110.250481-1-tudor.ambarus@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210702_074136_765488_F1FE5DFC X-CRM114-Status: GOOD ( 12.32 ) X-Spam-Score: -2.7 (--) 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: MX25L12835F define SFDP, while MX25L12805D does not. Signed-off-by: Tudor Ambarus --- drivers/mtd/spi-nor/macronix.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) Content analysis details: (-2.7 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [68.232.153.233 listed in wl.mailspike.net] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.153.233 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -0.2 DKIMWL_WL_HIGH DKIMwl.org - High trust sender 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 MX25L12835F define SFDP, while MX25L12805D does not. Signed-off-by: Tudor Ambarus Acked-by: Pratyush Yadav --- drivers/mtd/spi-nor/macronix.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/spi-nor/macronix.c b/drivers/mtd/spi-nor/macronix.c index 83a097708949..38701347bf04 100644 --- a/drivers/mtd/spi-nor/macronix.c +++ b/drivers/mtd/spi-nor/macronix.c @@ -8,6 +8,26 @@ #include "core.h" +static const char *mx25l12835f = "mx25l12835f"; + +static int mx25l12835f_post_bfpt_fixups(struct spi_nor *nor, + const struct sfdp_parameter_header *bfpt_header, + const struct sfdp_bfpt *bfpt) +{ + /* + * Macronix has a bad habit of reusing flash IDs: MX25L12835F collides + * with MX25L12805D. MX25L12835F defines SFDP tables, while the older + * variant does not. + */ + nor->name = mx25l12835f; + + return 0; +} + +static struct spi_nor_fixups mx25l12835f_fixups = { + .post_bfpt = mx25l12835f_post_bfpt_fixups, +}; + static const char *mx25l3233f = "mx25l3233f"; static int mx25l3233f_post_bfpt_fixups(struct spi_nor *nor, @@ -71,8 +91,9 @@ static const struct flash_info macronix_parts[] = { { "mx25u4035", INFO(0xc22533, 0, 64 * 1024, 8, SECT_4K) }, { "mx25u8035", INFO(0xc22534, 0, 64 * 1024, 16, SECT_4K) }, { "mx25u6435f", INFO(0xc22537, 0, 64 * 1024, 128, SECT_4K) }, - { "mx25l12805d", INFO(0xc22018, 0, 64 * 1024, 256, SECT_4K | - SPI_NOR_HAS_LOCK | SPI_NOR_4BIT_BP) }, + { "mx25l12805d", INFO(0xc22018, 0, 64 * 1024, 256, SPI_NOR_PARSE_SFDP | + SECT_4K | SPI_NOR_HAS_LOCK | SPI_NOR_4BIT_BP) + .fixups = &mx25l12835f_fixups }, { "mx25l12855e", INFO(0xc22618, 0, 64 * 1024, 256, 0) }, { "mx25r1635f", INFO(0xc22815, 0, 64 * 1024, 32, SECT_4K | SPI_NOR_DUAL_READ | From patchwork Fri Jul 2 14:41:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 1500161 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: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: 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=XeDGizjR; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=microchip.com header.i=@microchip.com header.a=rsa-sha256 header.s=mchp header.b=c0t0KRvy; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GGd9q5xN8z9sS8 for ; Sat, 3 Jul 2021 00:43:27 +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=HsayEBy2GcGjScnlrvibYkae3fi0+QTvUpw6v0MY8Ac=; b=XeDGizjR2lQoHq XGB3e6YAI3EHL3OgVE/WSUYo+Z/3Sizol45apPRDi2zLhxBJ/Hhvfm3kv5CWqQ1IugLuUT0JbESae BpJgrX4Ss1zLCtY777ODoENoVbR1Kr13pMag/VLrFzXNbcBoNsOeb5BbE9djVm+SE8gBnRNjxFQDf Huj09k4MS8o5TA8HPX9neZc99XBoCQZ+pFgACzUj/3iSUew5l0x/1Duq99DDhx0JWB4t6/gej2wna iMn/PJIG6oPaAT4ls9XLMtY26PottbyzZni5ry57ae24Yfnq/2LKyPj+dpfJ9GyzBsH9vPvygZgH1 E+MmqN53lGYFnLfhaAhw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lzKNZ-003I0O-21; Fri, 02 Jul 2021 14:42:53 +0000 Received: from esa.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lzKMP-003Hac-LY for linux-mtd@lists.infradead.org; Fri, 02 Jul 2021 14:41:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1625236901; x=1656772901; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=zvI7X+DNvUyXaJMrXpd3MxDgKlPvfK4c/SJWXEjv0o0=; b=c0t0KRvyD13ZqU3ek9nloOy9NC525arHxJNdDpRlbKFxwM266TvrOg7e 0L7HmWiN0BB9p0+HhbL4BQANjKGnnhjiYT0B24yShNoNOZomDB1bAcxuK Xs4zS/bXRRbyDUqTyz9T94mEFAef4RxT2pWhAIDQHKpgI8axqzld1kvlo Hb5X7Vs6IL+TDXwxHZPwr2N3Fj44fa+4fevKO4uBkS51ZGhweNrQnsvv1 mAcU29GiQ0/vvInND2i4OKHI9X3ImSRDLnxrHKwvj73YLismkiLwcIWUj 2MHZv4xqyX79mqA+EnnP1I/xOSBWb0ZSdASqJuJe6SKIzDgTh9G+ViFkP A==; IronPort-SDR: s2TzoRAsMGtU0ISwBVYCm4rNAInY4fIJmW0YFx6v3xcW3wBZSQNeSJOekz7kFk2m6PZYkvVFbi bJdycDCgFzhjP2hV6QQaZ1qCY6s9skTXs3N8aMmTUbooUBcign4L8GGeloTv1qkomxIP0lQ+In 2KEpmcPFvW0DFDIGKJoE2B2LSihOHTdX5RYPRohCPmQ1BQcqVNQKEe1+q3UmNlC3lvQrrc+OTC GOiAy9oFUtWuWSKLUmmrGhl7MtF/dc0lHL23gPdvmkVI9CaTfQEuBZWkH1g1Lbzatf2UaCo1/J zsE= X-IronPort-AV: E=Sophos;i="5.83,317,1616482800"; d="scan'208";a="60983598" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 02 Jul 2021 07:41:40 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 2 Jul 2021 07:41:39 -0700 Received: from ROB-ULT-M18064N.mchp-main.com (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Fri, 2 Jul 2021 07:41:35 -0700 From: Tudor Ambarus To: , , , , , , , , , , , CC: , , , , , Tudor Ambarus Subject: [PATCH 5/7] mtd: spi-nor: Introduce Manufacturer ID collisions driver Date: Fri, 2 Jul 2021 17:41:08 +0300 Message-ID: <20210702144110.250481-6-tudor.ambarus@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210702144110.250481-1-tudor.ambarus@microchip.com> References: <20210702144110.250481-1-tudor.ambarus@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210702_074141_815533_ABFAB574 X-CRM114-Status: GOOD ( 17.10 ) X-Spam-Score: -2.7 (--) 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: Some manufacturers completely ignore the manufacturer's identification code standard (JEP106) and do not define the manufacturer ID continuation scheme. This will result in manufacturer ID collisions. Content analysis details: (-2.7 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [68.232.154.123 listed in wl.mailspike.net] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.154.123 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -0.2 DKIMWL_WL_HIGH DKIMwl.org - High trust sender 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 Some manufacturers completely ignore the manufacturer's identification code standard (JEP106) and do not define the manufacturer ID continuation scheme. This will result in manufacturer ID collisions. An an example, JEP106BA requires Boya that it's manufacturer ID to be preceded by 8 continuation codes. Boya's identification code must be: 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x68. But Boya ignores the continuation scheme and its ID collides with the manufacturer defined in bank one: Convex Computer. Introduce the manuf-id-collisions driver in order to address ID collisions between manufacturers. flash_info entries will be added in a first come, first served manner. Differentiation between flashes will be done at runtime if possible. Where runtime differentiation is not possible, new compatibles will be introduced, but this will be done as a last resort. Every new flash addition that define the SFDP tables, should dump its SFDP tables in the patch's comment section below the --- line, so that we can reference it in case of collisions. Signed-off-by: Tudor Ambarus Acked-by: Pratyush Yadav --- drivers/mtd/spi-nor/Makefile | 1 + drivers/mtd/spi-nor/core.c | 1 + drivers/mtd/spi-nor/core.h | 1 + drivers/mtd/spi-nor/manuf-id-collisions.c | 17 +++++++++++++++++ 4 files changed, 20 insertions(+) create mode 100644 drivers/mtd/spi-nor/manuf-id-collisions.c diff --git a/drivers/mtd/spi-nor/Makefile b/drivers/mtd/spi-nor/Makefile index 6b904e439372..48763d10daad 100644 --- a/drivers/mtd/spi-nor/Makefile +++ b/drivers/mtd/spi-nor/Makefile @@ -1,6 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 spi-nor-objs := core.o sfdp.o swp.o otp.o sysfs.o +spi-nor-objs += manuf-id-collisions.o spi-nor-objs += atmel.o spi-nor-objs += catalyst.o spi-nor-objs += eon.o diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c index d528e28995c6..206a54c20fef 100644 --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -1829,6 +1829,7 @@ int spi_nor_sr2_bit7_quad_enable(struct spi_nor *nor) } static const struct spi_nor_manufacturer *manufacturers[] = { + &spi_nor_manuf_id_collisions, &spi_nor_atmel, &spi_nor_catalyst, &spi_nor_eon, diff --git a/drivers/mtd/spi-nor/core.h b/drivers/mtd/spi-nor/core.h index 55fceb0ec894..e9896cd60695 100644 --- a/drivers/mtd/spi-nor/core.h +++ b/drivers/mtd/spi-nor/core.h @@ -476,6 +476,7 @@ struct sfdp { }; /* Manufacturer drivers. */ +extern const struct spi_nor_manufacturer spi_nor_manuf_id_collisions; extern const struct spi_nor_manufacturer spi_nor_atmel; extern const struct spi_nor_manufacturer spi_nor_catalyst; extern const struct spi_nor_manufacturer spi_nor_eon; diff --git a/drivers/mtd/spi-nor/manuf-id-collisions.c b/drivers/mtd/spi-nor/manuf-id-collisions.c new file mode 100644 index 000000000000..9efcba9d18a0 --- /dev/null +++ b/drivers/mtd/spi-nor/manuf-id-collisions.c @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: GPL-2.0 + +#include +#include "core.h" + +static const struct flash_info id_collision_parts[] = { + /* Boya */ + { "by25q128as", INFO(0x684018, 0, 64 * 1024, 256, SPI_NOR_SKIP_SFDP | + SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | + SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB) }, +}; + +const struct spi_nor_manufacturer spi_nor_manuf_id_collisions = { + .name = "manufacturer ID collisions", + .parts = id_collision_parts, + .nparts = ARRAY_SIZE(id_collision_parts), +}; From patchwork Fri Jul 2 14:41:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 1500162 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: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: 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=iZrE6FMt; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=microchip.com header.i=@microchip.com header.a=rsa-sha256 header.s=mchp header.b=LUX9FT1L; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GGdBc54JNz9sS8 for ; Sat, 3 Jul 2021 00:44: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=q8N/v0oWH8KJVuqQpRM4IK2VHEptVMsO/CesbG1yj1U=; b=iZrE6FMtdURsq1 hV3PTA+ShH3KO+FcLaaUxH9iSSipzMjDYBCgxbIse8ZOYH2Rus9GtbVMEXcBd/p1+ZF/aqOqLak0g lM/hEGcFyxHIy/g/Q0KpU9vA3dtuAivhkYCIHxtV3UFLUnWAjUA/NlhkD39GHhyC8k/JvDAjrYmUr cKAIZQ2FUslQa28Cr/t3ZjmPkl3spXivHyHaatlvzC1U6DzC6VZcZLDlkftn//N7qUia6VyJ0xL+F XaxHWTiTP43Mr2TMZ4VQQFa0r91ZbQgbOh5O0qlYt37BylRk6J+9X5EiEDV4kzKv3MJI0dDnp3yNl NU5czM/NtBPTO9fnx9Vg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lzKOC-003IEv-1v; Fri, 02 Jul 2021 14:43:32 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lzKMT-003HbG-89 for linux-mtd@lists.infradead.org; Fri, 02 Jul 2021 14:41:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1625236905; x=1656772905; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=OAx1qd5nU8ouZMT7EtkbpXvykcr/bjwHPjPtj238jaM=; b=LUX9FT1LDbb04P1VBrAtC6uBPlM/6ZdyK+xQe6nXr5awzkMC2eM2ODbb srKKswwaFaAt35FQYkbNhOd0TJ8pqPMn+0yw+i2/yWFFN2TF/m59JGJrL tIPK8FSCYYgKQqJ1tf++jZV5Qly1JA+j1fIPM5cuasOgznA8mkoL5+aRF rSpX3dM9ZCErGST+EkppgJEc1eIjuzeKlpePkeYn9u78AK0oBKvoBJrij d0g8lN4LNALl89YLUDOlCrxXUcDO5jClaz/U053uFgR8MjoYVDdSvu0RN Sz2lFR+HKx78OZc8JI6u4W7aRYPkfx7ChUTb2Dbxa8Yt1xmbNt0rjzaNB Q==; IronPort-SDR: 2Ew+W1nVYpwLyME346VkRKve0HpBixIUWd92tZOIPMkA0m3gWesjS0ygtIQU59/ukys0SPTkQZ Xk5uRtqLP47rGvbawAjv+bJBhjtbWqKxEB4rvT/5yZkvHSqK4j2kw0DydIW1F2Je4IacVg0DJg HoTzms6RnS+V7xOIJ5LoK7GIjLU6ythx/YrIEStwYdeM3YELi0K96KvFuuvgCUVFoLviXFLFWO 1qZUhFLsnyP++kt2khHyzCLMpJDPx8xhqgmLMnT0zPpM656haFDHuCFyGFeKCixz+U8rY7382K 34k= X-IronPort-AV: E=Sophos;i="5.83,317,1616482800"; d="scan'208";a="134398777" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 02 Jul 2021 07:41:44 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 2 Jul 2021 07:41:44 -0700 Received: from ROB-ULT-M18064N.mchp-main.com (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Fri, 2 Jul 2021 07:41:40 -0700 From: Tudor Ambarus To: , , , , , , , , , , , CC: , , , , , Tudor Ambarus Subject: [PATCH 6/7] mtd: spi-nor: manuf-id-collisions: Add support for xt25f128b Date: Fri, 2 Jul 2021 17:41:09 +0300 Message-ID: <20210702144110.250481-7-tudor.ambarus@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210702144110.250481-1-tudor.ambarus@microchip.com> References: <20210702144110.250481-1-tudor.ambarus@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210702_074145_343098_60C7C86C X-CRM114-Status: GOOD ( 11.52 ) X-Spam-Score: -2.7 (--) 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: Flash does not support continuation codes and may collide with a flash of other manufacturer, Intersil being an example . This flash addition is just for demonstration purposes. As I don't have the flash, I assumed that it supports SFDP. If the flash does not define the SFDP tables, it should be statically initialized wi [...] Content analysis details: (-2.7 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [68.232.153.233 listed in wl.mailspike.net] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.153.233 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -0.2 DKIMWL_WL_HIGH DKIMwl.org - High trust sender 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 Flash does not support continuation codes and may collide with a flash of other manufacturer, Intersil being an example . This flash addition is just for demonstration purposes. As I don't have the flash, I assumed that it supports SFDP. If the flash does not define the SFDP tables, it should be statically initialized with: /* XTX (XTX Technology Limited) */ { "XT25F128B", INFO(0x0b4018, 0, 64 * 1024, 256, SPI_NOR_SKIP_SFDP | SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB) }, }; Signed-off-by: Tudor Ambarus --- drivers/mtd/spi-nor/manuf-id-collisions.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/mtd/spi-nor/manuf-id-collisions.c b/drivers/mtd/spi-nor/manuf-id-collisions.c index 9efcba9d18a0..c473c7d40d09 100644 --- a/drivers/mtd/spi-nor/manuf-id-collisions.c +++ b/drivers/mtd/spi-nor/manuf-id-collisions.c @@ -8,6 +8,10 @@ static const struct flash_info id_collision_parts[] = { { "by25q128as", INFO(0x684018, 0, 64 * 1024, 256, SPI_NOR_SKIP_SFDP | SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB) }, + + /* XTX (XTX Technology Limited) */ + { "xt25f128b", INFO(0x0b4018, 0, 64 * 1024, 256, SPI_NOR_PARSE_SFDP | + SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB) }, }; const struct spi_nor_manufacturer spi_nor_manuf_id_collisions = { From patchwork Fri Jul 2 14:41:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 1500163 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: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: 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=ng/AM60r; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=microchip.com header.i=@microchip.com header.a=rsa-sha256 header.s=mchp header.b=MIiKO/wq; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GGdCW3sZtz9sV8 for ; Sat, 3 Jul 2021 00:44:54 +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=MnNI+egZJzJGf5wHK73d7LQsJFttkWXy1p4iPC9FTd8=; b=ng/AM60rnIoLzg M/ADTm1i2pYga59jZkEpf1o495fo5PyRJm6YWV0YGMPPhoNoyBRpaJ4bEgvJh5EWXreLjjSVIGbkz MioMCi17ZlRQW4w0p/itC4cLr/OY/ARnIULKtuaomgqV/g8Y0oURTnc2Eedn0Ov0izWlUgLFlxq+d 0cXXlqY3GHg/Hr+0YMYLcMEhclQ2QA68swBqarfEnozQ7/EUOGTTPK/xFQsjSwzErdpgR8vXO96uU 3/CLUxQBEiM5tvpN6rfDirgTMcxwOtdA+Q1WMBZix3ImgaemPZoGHU8JXXgJQH3ouUbhZHHuiSnXM /ZZKFT4qQLKxSpdv1JEg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lzKOw-003IRf-JY; Fri, 02 Jul 2021 14:44:18 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lzKMZ-003HcN-3K for linux-mtd@lists.infradead.org; Fri, 02 Jul 2021 14:41:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1625236911; x=1656772911; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=F2UAtD8ntgMYYRa7miQJwveO3Z4av6kKZh8pk/C1MR0=; b=MIiKO/wqmOun2+czof+NJQvKukSUYO0mm5ql70vEZZqUtUlvKp3Ljedn KOzNLxLjwTVv34p13TMCmRoGzCMZASHEcqcJc4NYFsmzY+PS7RB98mF/w bVKquEZzf/YFs7b92fI9hb1C3sa8E/+FjJmTV9VREA8fNym6FLcOudanI /kH7+fzgXZYw1Xp4Di4n6w7Tg8fuTv0malYUnowdA5f3VdSQ8co091TTF U+//H+VSKf0/dEiZz92Q6ftktRqUaQNTx1GDmOLhFPG5SntHpHbAhq+5A lZjt7KJg5j+RgwgH+1KsqFMZO/foiAkv6m4miBHkDzrCTw0Umy4xYsUP4 Q==; IronPort-SDR: nDc3FhO0P4bjyRFGSYi0mzcDRuxCRdMWfTMUvuUoo2Tkp4FyRhlKWOhnlNqgBl3kFk9kmo5yg2 5nJs1Pq+ikxzEV9QsrLt3ap4fOZppXgy86WMZ4S/R6R+D70ePmDYlpisKEnblUC4zyYBP1TOA9 o9z6wthHEm5oHaHmkUf9H1907F0f8860ZsetIWzo69HVVHDx2qL7gpnTyEGpthrABBHXWrsKDV K7Vh7NYNuDESiSUE2pxWlzdyNmdUh7kJ2eTndTz371m/OL+XLPwH5jG4VJAsTJqj0TdY8aIeWq qss= X-IronPort-AV: E=Sophos;i="5.83,317,1616482800"; d="scan'208";a="126910369" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 02 Jul 2021 07:41:49 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 2 Jul 2021 07:41:48 -0700 Received: from ROB-ULT-M18064N.mchp-main.com (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Fri, 2 Jul 2021 07:41:44 -0700 From: Tudor Ambarus To: , , , , , , , , , , , CC: , , , , , Tudor Ambarus Subject: [PATCH 7/7] mtd: spi-nor: manuf-id-collisions: Add support for xm25qh64c Date: Fri, 2 Jul 2021 17:41:10 +0300 Message-ID: <20210702144110.250481-8-tudor.ambarus@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210702144110.250481-1-tudor.ambarus@microchip.com> References: <20210702144110.250481-1-tudor.ambarus@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210702_074151_200378_16EEEB4B X-CRM114-Status: GOOD ( 11.37 ) X-Spam-Score: -2.7 (--) 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: Do not apply! SFDP needs to be dumped. mw: ''' NB. XMC ignores the continuation codes and this particular device will collide with M25PE64/M45PE64. Although I couldn't find any datasheet, so I don't k [...] Content analysis details: (-2.7 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [68.232.153.233 listed in wl.mailspike.net] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.153.233 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -0.2 DKIMWL_WL_HIGH DKIMwl.org - High trust sender 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 Do not apply! SFDP needs to be dumped. mw: ''' NB. XMC ignores the continuation codes and this particular device will collide with M25PE64/M45PE64. Although I couldn't find any datasheet, so I don't know if these devices actually exist. ''' The data sheets can be found here: http://xmcwh.com/Uploads/2020-12-17/XM25QH64C_Ver1.1.pdf Signed-off-by: Tudor Ambarus --- drivers/mtd/spi-nor/manuf-id-collisions.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/mtd/spi-nor/manuf-id-collisions.c b/drivers/mtd/spi-nor/manuf-id-collisions.c index c473c7d40d09..c41d6e8f2f95 100644 --- a/drivers/mtd/spi-nor/manuf-id-collisions.c +++ b/drivers/mtd/spi-nor/manuf-id-collisions.c @@ -9,6 +9,9 @@ static const struct flash_info id_collision_parts[] = { SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB) }, + /* XMC (Wuhan Xinxin Semiconductor Manufacturing Corp.) */ + { "xm25qh64c", INFO(0x204017, 0, 64 * 1024, 128, SPI_NOR_PARSE_SFDP) }, + /* XTX (XTX Technology Limited) */ { "xt25f128b", INFO(0x0b4018, 0, 64 * 1024, 256, SPI_NOR_PARSE_SFDP | SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB) },