From patchwork Fri Jul 2 14:41:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 1500155 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=PaaTOylC; 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=eD7TH4wi; 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 4GGd8L4KBbz9sS8 for ; Sat, 3 Jul 2021 00:42:10 +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: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:In-Reply-To:References: List-Owner; bh=e1zH2ULX62V2Qsf+p5yWzjyRtq5IcjZL+zDFtsNpSbQ=; b=PaaTOylCh53Hw5 zOB8Q0eK7jr9fKv1epDWMuyd4hSnoAe4iWjmUtBGLUcs9MXxnGxZMWrGcHc2QvIZR7xTDpqXtyyOn xUng/hfhoO6qDvLdPpwEyWXPkc5h4x2lQGhB+vdwgaGNolthgbH0zi/8OB3Au+ynqP0WxI4vpJKIg 9+ipwHaUFpCQRwjW5hxpcZG90P8n1WfR2x1UAA7blJF01mNvJbXtTl9PUPEMQ7yqf3x3p/bxRozbx UkqA9sQ/wfjN1geOG3/YniQIxA5BQqVM76D3UbDGIr139UVVgIWml4r+zwB3h/YHckt7WKunA7Bs+ xiRE/fXgugVmUYkJ+BZQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lzKM8-003HXo-8Z; Fri, 02 Jul 2021 14:41:24 +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 1lzKM4-003HXJ-IY for linux-mtd@lists.infradead.org; Fri, 02 Jul 2021 14:41:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1625236880; x=1656772880; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=mgcrHVPQSpEiHc+qvPL6zjFcBlaNJ96na3UUkiEk2VM=; b=eD7TH4wiIokOcs0nIFbmUJQBaOm7wZeb5R0jlnFo3X/KEhRynVqcaNlg k6xLBJ0S5tWNVycTLh/OppwXMj6IOnzIsHhRP8NOC0A3uQlZhiHm+6J5i 55ZAyACGncUOWaoTM/hyzYs7Yuykmosq7toWxIJcTJFIUjhNUcTjEapWW WLo2qHt+Eyip47OkBTQ6Ooy1hBNHx+Ii6DFZ6jWMX+qhdeWZrQ/EQWjDy Srm1wMp9idNdUhqo851WjhKce+ZdDELHmfAJqd62JnNcg31+lhttDAMk4 rxwQ0sIr/vIkkfXqhfx7u7eFPGF1eT5bcJU7hVMfkd1mgLJfJPVn4m/tM A==; IronPort-SDR: vhVIM/MGeqnbHpAAzh8XWfCHWjdDRQHvVf+HEU4GCHAgWajejRA37AztD+e/E3cdHiT1VhPZ6h st6jGaqCilADRdeQ51RjuwteHdgvxlEQ5sgZJJrMAyydSWPhgCDQZ0x2Ts4gWKvuTB/HuNX9Ps zHyK6M3AJxAY43fu14yPDFiY18RSkcBnibNCed4iw0a0VFo8C6/C0N2gzz85cvuA4HpB8oLA/f 5nPDXC11KqN0Vwvu48yl9H/RUoYJBo4dPSf4w6L5SAQ3SzXlJDaBgvmeTEKADYVEE+f9SHuB/d ClY= X-IronPort-AV: E=Sophos;i="5.83,317,1616482800"; d="scan'208";a="134398738" 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:18 -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:17 -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:13 -0700 From: Tudor Ambarus To: , , , , , , , , , , , CC: , , , , , Tudor Ambarus Subject: [PATCH 0/7] mtd: spi-nor: Handle flash ID collisions Date: Fri, 2 Jul 2021 17:41:03 +0300 Message-ID: <20210702144110.250481-1-tudor.ambarus@microchip.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210702_074120_688372_BC6115D5 X-CRM114-Status: GOOD ( 13.28 ) 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: I've started working on the flash ID collisions problems, and also on the read SFDP first idea, to stop the spagetti init of params. I see the ID collision thing is a hot topic, so I post the first pa [...] 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.153.233 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [68.232.153.233 listed in wl.mailspike.net] -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 I've started working on the flash ID collisions problems, and also on the read SFDP first idea, to stop the spagetti init of params. I see the ID collision thing is a hot topic, so I post the first part of the work, to gather comments. Entire series is just compile tested. Introduce the manuf-id-collisions driver in order to address ID collisions between manufacturers. manuf-id-collisions will be the place to add new flash additions, where the manufacturer is ignorant enough, to not implement the ID continuation scheme. 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. I can't dump the SFDP tables for the new flash additions, I'll need support in case someone wants to add them. Tudor Ambarus (7): mtd: spi-nor: core: Introduce SPI_NOR_PARSE_SFDP mtd: spi-nor: core: Report correct name in case of ID collisions mtd: spi-nor: macronix: Handle ID collision b/w MX25L3233F and MX25L3205D mtd: spi-nor: macronix: Handle ID collision b/w MX25L12805D and MX25L12835F mtd: spi-nor: Introduce Manufacturer ID collisions driver mtd: spi-nor: manuf-id-collisions: Add support for xt25f128b mtd: spi-nor: manuf-id-collisions: Add support for xm25qh64c drivers/mtd/spi-nor/Makefile | 1 + drivers/mtd/spi-nor/core.c | 9 ++++- drivers/mtd/spi-nor/core.h | 5 +++ drivers/mtd/spi-nor/macronix.c | 49 +++++++++++++++++++++-- drivers/mtd/spi-nor/manuf-id-collisions.c | 24 +++++++++++ include/linux/mtd/spi-nor.h | 2 + 6 files changed, 85 insertions(+), 5 deletions(-) create mode 100644 drivers/mtd/spi-nor/manuf-id-collisions.c