From patchwork Tue Feb 7 06:09:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Potthuri, Sai Krishna" X-Patchwork-Id: 1738659 X-Patchwork-Delegate: tudor.ambarus@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.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=) Authentication-Results: legolas.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=ruecT8ll; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=QFdfdE4S; dkim-atps=neutral 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 ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4P9t653wNMz23j7 for ; Tue, 7 Feb 2023 17:10:37 +1100 (AEDT) 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=cW4apuS/ApzPirjhWudbS9bify0xLvf3XucJNX8cHQw=; b=ruecT8llLwvFFL OdZlgOEE6ePRmcxKcncFaSEc5eNpMXVtn5cYo7JWd4mmstiLFZ6uK3KZUnJjgQXGqhbgsC4xrILiB g88aF1GbmYHia51KG3IBpQgTaGzKcwKbY12si1Xcp/MeWvs8xQndF9TrQFiiIEM8EPyxhvWQo0V/c NKCq1MlGCmeKKAcWdaRcfIm6z6auovY5eemd0LidzxpqpjsWinh1Z0rRzWfRdumImtu6dE+ahHJue cFl6pUG4H7jA0cRkwzjpg8vewAEE8WQp4UL50Lyk2933U6gp6d6vYdIr8po0XMrBFaJWVsjlTc9jw SgE0GknZRqh0W8rRE1uw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pPHAy-00AvaQ-0O; Tue, 07 Feb 2023 06:09:56 +0000 Received: from mail-dm6nam11on20630.outbound.protection.outlook.com ([2a01:111:f400:7eaa::630] helo=NAM11-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pPHAu-00AvZ3-LS for linux-mtd@lists.infradead.org; Tue, 07 Feb 2023 06:09:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oYlF2ONuqAUovnJFN5E4lcpjQouT6KTR6dJwtWeHgn4jSWzWdLbAN0Ro4WCEobB/zcXVJoI8kvuF48+kGnh3Gnb0OSXlmmDwX7mLGpbsh2hbiea1kkKgHWz/NzRP7eCOGzNFABqCrUaMupeYk9ld+WI6VsK7Y2+3+dZK9hQ6TiN5OQOnH+EJVGnhBPI5s4c5U9aWHH12SAmby+S6wTAVFGzQY2mJ7Awl8jTcLoGNkcmkW+Shh4GtM2sSh6blCNHsqjQ4Ed0QwiD7mWbTRqI/Tqr3pxOcQpkrlDpcT1WhHwGiTqQ5LAmm7GklLMMXxanHT4nIFR1uKFTp4kl3rxFu3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nPY6ZmdggQJDaY7b+MJS0Ehlu01syJw8PLd4AJejj8E=; b=jR07Etlaph1pF9Opv+PCPleABflvLD60eDzIAw4iaX8UWkTxVVrhud54kzfrrWnm41qnFKXA3kkGGiOFJ0QS42NF/CixfSDsfaMNBK86sFId7hzmitUYexBzWzNUyFcH0ZHNCOJdELTRNsmWnWPhGSAVwUv/Er6sawAhliYRahG+mefZ+RnRr9Ko6w3HSL3I5nzpkf6dM4Q3eWSd/5N8tW2A5ftWAWy+POyARBzztydGnsmGc0qERcqRKGGPD0K3RAA4vOv9VrkQqQNJLwhXvhL+2saQZmfVUPDznufu6eLKqnDv8J1uujYQzRffwFDL/SqWS7E+O1DabDqkWnfQjQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nPY6ZmdggQJDaY7b+MJS0Ehlu01syJw8PLd4AJejj8E=; b=QFdfdE4S61bIfhQTh7yg5mepBvZPXAjTt2emrr4zI0sSIN9z142hQPLnz7EB3/TihyqgwaFblYLp39h3K7DZErWG4NI/VRTe/UIYARNgDf13s3NAwAcdvSPYlQ0VUwnhB85Si1H1NHPphMPZA8OvKzR0LHwt/61S4RzE0DbaxR8= Received: from DM6PR11CA0003.namprd11.prod.outlook.com (2603:10b6:5:190::16) by PH7PR12MB7116.namprd12.prod.outlook.com (2603:10b6:510:1ef::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.34; Tue, 7 Feb 2023 06:09:46 +0000 Received: from DM6NAM11FT100.eop-nam11.prod.protection.outlook.com (2603:10b6:5:190:cafe::bb) by DM6PR11CA0003.outlook.office365.com (2603:10b6:5:190::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.36 via Frontend Transport; Tue, 7 Feb 2023 06:09:46 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT100.mail.protection.outlook.com (10.13.172.247) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6064.35 via Frontend Transport; Tue, 7 Feb 2023 06:09:45 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 7 Feb 2023 00:09:45 -0600 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 7 Feb 2023 00:09:45 -0600 Received: from xhdlakshmis40.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Tue, 7 Feb 2023 00:09:41 -0600 From: Sai Krishna Potthuri To: Mark Brown , Tudor Ambarus , Pratyush Yadav , "Michael Walle" , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra CC: , , , , , Sai Krishna Potthuri Subject: [PATCH 2/3] mtd: spi-nor: Add and update device_id field in spi_mem structure Date: Tue, 7 Feb 2023 11:39:23 +0530 Message-ID: <20230207060924.265789-3-sai.krishna.potthuri@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230207060924.265789-1-sai.krishna.potthuri@amd.com> References: <20230207060924.265789-1-sai.krishna.potthuri@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT100:EE_|PH7PR12MB7116:EE_ X-MS-Office365-Filtering-Correlation-Id: c44c8167-6a1e-451a-87a4-08db08d1e969 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /Si8CGytmSLmdo4OLRe30DyvB5yQdtqxg902QQTCQSnm369i4JAvfv09zG4iiPEk3gYa9B5zJiD8M3UYJ056UaBZkozmx9mgFwab5UULQBrTHMSzBewPBNpnUwX/wzifKTWJRzvpy05pUaN7YIchCUJFnZLrHZYwlWpuDROCa1JLYds+rhrfgOpIPo3bw/h6NmhCv3pWymdQD+fGG04Gr8izpkDMEpCYYAxesaZL4uX0ieWXlHP6zSFIc+N0zrNtTDquTiHN5R9u6WnbkuTbEUOWCStSoiBAyr6W60RArqoBclOaflmu7kSz+qUxz4D/lUsHFYaC1iN0xeazCNnzlgcaOTAcO0e2K+30CYl3Y9/aTx/6XVRGLXLifLek577v5Ont8EA548LLTFvCJEOouaOInyP7wQMCs9wT9Chem4KXiowopIeql+s0bEld+GWbiEsqmeZdatBK6UOcIEjW1/Te4wEyDMVqXj057aXtW6rfFxRsFoPGeIycxFkhcuw5uQutmXpHaDb+48NMS9rF+lCVUDt11wA5ZDC68txJyPWh52gB+H+IxD3foMdIET7zfkeubpsNYq0xnoiwaUgUNcxe6VK9c3nPLaoT0ODYSuhbGv7wVeE8W1zxGC1JcktLN6rwv2iZdlJcRp9P2WSlcDcohXm8fLmqJQSyiCdSgXxHsxLLSpdHvMgnTRcsa97hxVA8J7DeFqr8erxaIQx65UEbmUqQU3SNvRS0wnrOEGo= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230025)(4636009)(396003)(376002)(346002)(39860400002)(136003)(451199018)(46966006)(40470700004)(36840700001)(356005)(8676002)(86362001)(40460700003)(103116003)(316002)(70586007)(36756003)(70206006)(4326008)(41300700001)(82310400005)(110136005)(54906003)(8936002)(7416002)(5660300002)(2906002)(15650500001)(40480700001)(83380400001)(82740400003)(26005)(1076003)(186003)(36860700001)(6666004)(47076005)(336012)(426003)(81166007)(478600001)(2616005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Feb 2023 06:09:45.9470 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c44c8167-6a1e-451a-87a4-08db08d1e969 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT100.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7116 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230206_220952_726783_F1DFE1A2 X-CRM114-Status: GOOD ( 13.30 ) X-Spam-Score: -0.2 (/) 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: Xilinx Versal Octal SPI controller drivers might require the device id information to perform the Rx tuning operation. Since there is no common Tuning Data Pattern defined across all vendors, controll [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -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 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 Xilinx Versal Octal SPI controller drivers might require the device id information to perform the Rx tuning operation. Since there is no common Tuning Data Pattern defined across all vendors, controllers which requires Rx tuning to find out the optimal sampling point for data lines, this device id information will be used as a golden data. spi-nor core updates the device id information in device_id field while reading the id of the flash device. Signed-off-by: Sai Krishna Potthuri --- drivers/mtd/spi-nor/core.c | 1 + include/linux/spi/spi-mem.h | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c index bee8fc4c9f07..9811e74ef3b6 100644 --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -1644,6 +1644,7 @@ static const struct flash_info *spi_nor_match_id(struct spi_nor *nor, if (part->id_len && !memcmp(part->id, id, part->id_len)) { nor->manufacturer = manufacturers[i]; + memcpy(nor->spimem->device_id, id, SPI_NOR_MAX_ID_LEN); return part; } } diff --git a/include/linux/spi/spi-mem.h b/include/linux/spi/spi-mem.h index 8e984d75f5b6..e9ae5c1b7391 100644 --- a/include/linux/spi/spi-mem.h +++ b/include/linux/spi/spi-mem.h @@ -181,11 +181,14 @@ struct spi_mem_dirmap_desc { void *priv; }; +#define SPI_MEM_DEV_MAX_ID_LEN 6 + /** * struct spi_mem - describes a SPI memory device * @spi: the underlying SPI device * @drvpriv: spi_mem_driver private data * @name: name of the SPI memory device + * @device_id: device id of the SPI memory device * * Extra information that describe the SPI memory device and may be needed by * the controller to properly handle this device should be placed here. @@ -197,6 +200,7 @@ struct spi_mem { struct spi_device *spi; void *drvpriv; const char *name; + u8 device_id[SPI_MEM_DEV_MAX_ID_LEN]; }; /**