Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp1168969rdb; Sat, 18 Nov 2023 05:55:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IGK5LGI5yxuklp4NXFGozEUJmBQY1Y2RwQ90iK500q2cG3/OQn7GOZ6GAsoJhc8ARTz4O3c X-Received: by 2002:a05:6a20:7490:b0:188:9de:9eed with SMTP id p16-20020a056a20749000b0018809de9eedmr2320688pzd.13.1700315705606; Sat, 18 Nov 2023 05:55:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1700315705; cv=pass; d=google.com; s=arc-20160816; b=rIoHC0LBUm+cWqmOUW6qlUxVrE2cBvRc7MwIhQUz7s0OIA+1J/1BKqBFlrKrRYSVNT tc2RZri6d8Qba5m7lPkeRFYQlb8nU9QRMj67MqR6Gmye85cz/Zt7Basr801nsQXanB6d YnTB5ZIRhmj/PSLY0fm6ywTqFW7Hf6pBqnMvaiPj/g42WK8l6zg0a6oo+yYVNaISJhAP ZBO5ADaUCStquekPbbkV/SpsMIlTVhxJpdI/wAczxgU0WhvIYsbiRdzcWZ3vYZxd7Z3E ZyIUSvNC5QbCS5N8ikI6CSFsANlBULgh/D9coS3sfSsUUtq+mCcUB9eP/sx9ShA0XgFI NHag== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=pYyonUaW76Vu+omy17T4VRP6tmFp5uhPhH6dAMvUzNA=; fh=MWwhhBLj6HBpY3LM/DxCok/FDroJWVgeDULky9erVgA=; b=K0uD6lVwFjz2Zxfxi7lwbP4K0u80QJaw0pfJR/CpL6cFSpH9PA5Ujde3X/gOJeUTRA 71W70Ifxwd48rcZ6oQBTgDnf7qqA2NbI70RU7VKxIENDZrJN6CiTignI4myArG/JNuqc maBT+7jFTvBrJMFN8tq1VHm+HCm+AziM+pNkxPNuUULv3QU2Lmc09OWxXUtuvgOko5qm qb4hmN0VuZgNDfrNF4KGb2zThrkTzHZSWOirdGJZD9eMsYQFhfjnpmw+soQIBRB8PLB9 vzhTpUnobtNKU0SPnL6hODe45DtknZCI5gnDzeAFkEMF+oHkgsN5LlWcucHEl+cPOlTx d0WQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=gAunWlby; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id b3-20020a170902d50300b001cc54cc2fe3si4275382plg.398.2023.11.18.05.55.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Nov 2023 05:55:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=gAunWlby; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 66F9880B81EB; Sat, 18 Nov 2023 05:55:04 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229662AbjKRNzC (ORCPT + 99 others); Sat, 18 Nov 2023 08:55:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229469AbjKRNzB (ORCPT ); Sat, 18 Nov 2023 08:55:01 -0500 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2058.outbound.protection.outlook.com [40.107.243.58]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01F52192; Sat, 18 Nov 2023 05:54:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Yvtmsq5npZLCmW2Pv6tGH5UlulOEHZZiuRVff2G/xCPrG5pKryJxvbEJ6gB0qMr0bwUriCxaXF1MTwWcxOlBBLXaooByB5MwIqPtlxLqO/CSfMP3mm/k1ohpBZikPrcnasjkh5uWB4vv5GNOarq6hg8Nn1nVFOvsrcoEzjoqud0dUH/O7jdkzIRLTrihPgYRC7FEwp5zfVYMRCu8K94AjDHDwVNlqSnPpsKMSOnQy+f82FCfJU8qSW9aQuCXWZIidkXAYNUs7VFex1VU8oeTke3dcKPiCnoW3fsQj3T9AgfTqYVmf3/G1kaYRN8U2aG3rWeU75It2velh/nI6hQJCw== 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=pYyonUaW76Vu+omy17T4VRP6tmFp5uhPhH6dAMvUzNA=; b=LFbakIBSo7Kj4sBXUrJRAC1CyrYiUMpcYWoUIbmjsfeTWsfPxkxOS6Eckx+p5CVdJE+boWwDrNwQ0TnQexbGZLI6D6LJAFnPJ68mJHmdMHV7lZ7k4VIK+N9gfFxr5bwUm21ONo7GXUBRu+PycT6iK8oiAjR8c8HTPvebDsQYvKfGPekM1M6KXuo5zY/cBr9V+EIjs33Fp6CTjnau79Oavacs2TBGIzuwzzP1AgdsK0/dF1389i9+E43tH4Y9S4ODCl0M/W/evjQOy0VJc3oBBQ5F81RQnoxv/RjClyBZTYKqwC12HcV0PEMVlqHszPpQ4lBeJM3778xEZnhugj4Thg== 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 (0) 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=pYyonUaW76Vu+omy17T4VRP6tmFp5uhPhH6dAMvUzNA=; b=gAunWlbyQqh/NzvxgyFG8R1q9V0Pqusm1DuaycTxFoxrlY75MxW0+VB34GsPBQA616krXremWYvCn3Rhi72GkPEzTtAWwObsb9GViIr56UsUKOr3qjfiSCdMhtyyBQBxF95zMSrfTOOyQftWzY8gol6rYPW3xnBDmRjx9EnpmWM= Received: from DM6PR06CA0041.namprd06.prod.outlook.com (2603:10b6:5:54::18) by DS7PR12MB6142.namprd12.prod.outlook.com (2603:10b6:8:9a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7002.25; Sat, 18 Nov 2023 13:54:53 +0000 Received: from DS2PEPF0000343F.namprd02.prod.outlook.com (2603:10b6:5:54:cafe::8f) by DM6PR06CA0041.outlook.office365.com (2603:10b6:5:54::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7002.26 via Frontend Transport; Sat, 18 Nov 2023 13:54:53 +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 DS2PEPF0000343F.mail.protection.outlook.com (10.167.18.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7025.12 via Frontend Transport; Sat, 18 Nov 2023 13:54:53 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) 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.2507.34; Sat, 18 Nov 2023 07:54:52 -0600 Received: from xhdakumarma40u.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.34 via Frontend Transport; Sat, 18 Nov 2023 07:54:48 -0600 From: Amit Kumar Mahapatra To: , , , , , , CC: , , , , , , , , , , , Amit Kumar Mahapatra Subject: [PATCH v10 0/8] spi: Add support for stacked/parallel memories Date: Sat, 18 Nov 2023 19:24:38 +0530 Message-ID: <20231118135446.52783-1-amit.kumar-mahapatra@amd.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS2PEPF0000343F:EE_|DS7PR12MB6142:EE_ X-MS-Office365-Filtering-Correlation-Id: ff0e9b43-8583-4340-331c-08dbe83df0db X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: N2Pn0EjEp6+PwCRxgRfXKmnSHbkJVAO4Jr/YmHwbqLpV79gYPqBFUjNrBJuM4Erv3MhXcV9xJ0I1Hg6wBqar9/GrFAC6CSrI6fuZLnTSccn5mdOV5LxZFFXq4W/WgWae0fuz/L+N8p+j5fYLTVp7rhRsDE4AFD5m0l8Z55uHKMMxvpKZc9ETkO0VVcx6cYCpZDyTQafkvhqp9Z4U0VVZuE2idQEXgxR15h9BFffTRBiTGLv+WR9p0vD5+NXgsVlHyeOR2UiIm17Lwu6BwN2cGNfJupJcg+ne/dDJRMa1xbvduzqANRHX1Xk7rLabGFir/7FFXTeqTVuQWLlOThWSeVD7a48p/bODEeKBmGOlirOUdV/vTLB2XyGOgp0QZoZZI1LdTEo83tCNoz1aP40Jj+z/AxVrvI6PUaqkMhxDnnQYQl70edqjN++x9zWcZGj3lpHZLVkWJ78+W4cocTQLS6/mrFLLx/bapr9KR/NaFTwrkL6bLZ/hl/WR4yXi/tSm66IlRnMwolL536ecqxR+qghRvDQIYMjxtGrsp4+g6nz7Dvs8t1cBUM13GHwas/rJ+JvOXoOo8V4MmT9UtE0haNJyy5d8Mrr8DyUcBBV0Owy3uuNlmzJgW+kzv8SXZbIXxgVd0lvUiCDYMhgwEwaFDXRvDOgFTjWPiDFVTXtd/kEeOT+6zJXYzJ1k0aAmFfrDPoI+D6HxxZp7u7wwLZ4BCClGt4f4Rysq7MrtQUphtR8QLobZmXQE+gNrqnooXN1l58q2C57az/7rD14xpOTanJaTd0I51V1Fe6gWsNE0NZYV0+5mBgWA+yS84uEMDHvdU+b9zmeAroAN2r1Dl2IbVA== 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:(13230031)(4636009)(136003)(396003)(376002)(346002)(39860400002)(230173577357003)(230273577357003)(230922051799003)(451199024)(82310400011)(186009)(64100799003)(1800799012)(46966006)(40470700004)(36840700001)(47076005)(1076003)(81166007)(2616005)(356005)(40460700003)(36860700001)(41300700001)(426003)(336012)(83380400001)(36756003)(26005)(82740400003)(4326008)(8676002)(8936002)(40480700001)(7416002)(5660300002)(478600001)(86362001)(966005)(70206006)(70586007)(6666004)(2906002)(110136005)(316002)(54906003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Nov 2023 13:54:53.3822 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ff0e9b43-8583-4340-331c-08dbe83df0db 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: DS2PEPF0000343F.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB6142 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sat, 18 Nov 2023 05:55:04 -0800 (PST) This patch is in the continuation to the discussions which happened on 'commit f89504300e94 ("spi: Stacked/parallel memories bindings")' for adding dt-binding support for stacked/parallel memories. This patch series updated the spi-nor, spi core and the AMD-Xilinx GQSPI driver to add stacked and parallel memories support. The first nine patches https://lore.kernel.org/all/20230119185342.2093323-1-amit.kumar-mahapatra@amd.com/ https://lore.kernel.org/all/20230310173217.3429788-2-amit.kumar-mahapatra@amd.com/ https://lore.kernel.org/all/20230310173217.3429788-3-amit.kumar-mahapatra@amd.com/ https://lore.kernel.org/all/20230310173217.3429788-4-amit.kumar-mahapatra@amd.com/ https://lore.kernel.org/all/20230310173217.3429788-5-amit.kumar-mahapatra@amd.com/ https://lore.kernel.org/all/20230310173217.3429788-6-amit.kumar-mahapatra@amd.com/ https://lore.kernel.org/all/20230310173217.3429788-7-amit.kumar-mahapatra@amd.com/ https://lore.kernel.org/all/20230310173217.3429788-8-amit.kumar-mahapatra@amd.com/ https://lore.kernel.org/all/20230310173217.3429788-9-amit.kumar-mahapatra@amd.com/ of the previous series got applied to https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next But the rest of the patches in the series did not get applied as failure was reported for spi driver with GPIO CS, so send the remaining patches in the series after rebasing it on top of for-next branch and fixing the issue. CS GPIO is not tested due to unavailability of necessary hardware setup. --- BRANCH: for-next Changes in v10: - Rebased patch series on top of latest for-next branch and fixed merge conflicts. Changes in v9: - Updated 1/8 patch description to add an high-level overview of parallel(multi-cs) & stacked design. - Initialized all unused CS to 0xFF. - Moved CS check from spi_add_device() to __spi_add_device(). - Updated __spi_add_device() to check to make sure that multiple logical CS don't map to the same physical CS and same physical CS doesn't map to different logical CS. - Updated 1/8, 5/8 & 7/8 to support arbitrary number of flash devices connected in parallel or stacked mode. - Updated documentation for chip_select. - Added a new spi-nor structure member nor->num_flash to keep track of the number of flashes connected. - Added a new patch in the series 4/8 to move write_enable call just before spi_mem ops call in SPI-NOR. - Added comments in SPI core & SPI-NOR. - Rebased the patch series on top of the latest for-next branch. Changes in v8: - Updated __spi_add_device() and spi_set_cs() to fix spi driver failure with GPIO CS. - Rebased the patch series on top of latest for-next branch and fixed merge conflicts. - Updated cover letter description to add information regarding GPIO CS testing and request Stefan to provide his Tested-by tag for 1/7 patch. - Updated 1/7 patch description. Changes in v7: - Updated spi_dev_check() to avoid failures for spi driver GPIO CS and moved the error message from __spi_add_device() to spi_dev_check(). - Resolved code indentation issue in spi_set_cs(). - In spi_set_cs() call spi_delay_exec( ) once if the controller supports multi cs with both the CS backed by GPIO. - Updated __spi_validate()to add checks for both the GPIO CS. - Replaced cs_index_mask bit mask with SPI_CS_CNT_MAX. - Updated struct spi_controller to represent multi CS capability of the spi controller through a flag bit SPI_CONTROLLER_MULTI_CS instead of a boolen structure member "multi_cs_cap". - Updated 1/7 patch description . Changes in v6: - Rebased on top of latest v6.3-rc1 and fixed merge conflicts in spi-mpc512x-psc.c, sfdp.c, spansion.c files and removed spi-omap-100k.c. - Updated spi_dev_check( ) to reject new devices if any one of the chipselect is used by another device. Changes in v5: - Rebased the patches on top of v6.3-rc1 and fixed the merge conflicts. - Fixed compilation warnings in spi-sh-msiof.c with shmobile_defconfig Changes in v4: - Fixed build error in spi-pl022.c file - reported by Mark. - Fixed build error in spi-sn-f-ospi.c file. - Added Reviewed-by: Serge Semin tag. - Added two more patches to replace spi->chip_select with API calls in mpc832x_rdb.c & cs35l41_hda_spi.c files. Changes in v3: - Rebased the patches on top of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next - Added a patch to convert spi_nor_otp_region_len(nor) & spi_nor_otp_n_regions(nor) macros into inline functions - Added Reviewed-by & Acked-by tags Changes in v2: - Rebased the patches on top of v6.2-rc1 - Created separate patch to add get & set APIs for spi->chip_select & spi->cs_gpiod, and replaced all spi->chip_select and spi->cs_gpiod references with the API calls. - Created separate patch to add get & set APIs for nor->params. --- Amit Kumar Mahapatra (8): spi: Add multi-cs memories support in SPI core mtd: spi-nor: Convert macros with inline functions mtd: spi-nor: Add APIs to set/get nor->params mtd: spi-nor: Move write enable inside specific write & erase APIs mtd: spi-nor: Add stacked memories support in spi-nor spi: spi-zynqmp-gqspi: Add stacked memories support in GQSPI driver mtd: spi-nor: Add parallel memories support in spi-nor spi: spi-zynqmp-gqspi: Add parallel memories support in GQSPI driver drivers/mtd/spi-nor/atmel.c | 17 +- drivers/mtd/spi-nor/core.c | 683 +++++++++++++++++++++++++------ drivers/mtd/spi-nor/core.h | 8 + drivers/mtd/spi-nor/debugfs.c | 4 +- drivers/mtd/spi-nor/gigadevice.c | 4 +- drivers/mtd/spi-nor/issi.c | 11 +- drivers/mtd/spi-nor/macronix.c | 10 +- drivers/mtd/spi-nor/micron-st.c | 35 +- drivers/mtd/spi-nor/otp.c | 48 ++- drivers/mtd/spi-nor/sfdp.c | 33 +- drivers/mtd/spi-nor/spansion.c | 57 +-- drivers/mtd/spi-nor/sst.c | 7 +- drivers/mtd/spi-nor/swp.c | 25 +- drivers/mtd/spi-nor/winbond.c | 2 +- drivers/mtd/spi-nor/xilinx.c | 18 +- drivers/spi/spi-zynqmp-gqspi.c | 58 ++- drivers/spi/spi.c | 192 +++++++-- include/linux/mtd/spi-nor.h | 21 +- include/linux/spi/spi.h | 51 ++- 19 files changed, 1016 insertions(+), 268 deletions(-) -- 2.17.1