From patchwork Wed May 29 14:48:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1941301 X-Patchwork-Delegate: monstr@monstr.eu Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=hWI6EuhK; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VqC1v2ldRz20Pc for ; Thu, 30 May 2024 00:48:51 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7ED9C8861A; Wed, 29 May 2024 16:48:35 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.b="hWI6EuhK"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 575AD8860B; Wed, 29 May 2024 16:48:34 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on20624.outbound.protection.outlook.com [IPv6:2a01:111:f400:7ea9::624]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 45CB688621 for ; Wed, 29 May 2024 16:48:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=michal.simek@amd.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LFrUfqwWZbIVIEjkU41PD1KtLLwHIuUeVWbJ+PMkFRbKkGJS8i8xGLNenTNZiySmpuc0o2RP8Eik4jhqr2Xkg0zS5E314P9GMcpdwHe/Kdi1IC1X7oq0KoZuors4wa0Rb34aMif+do+n4dVMEhPDRakIrSS4RRabsIYz5cBaNUSvK9Z6oeKGhILlMpwxfQga2KIfedrEpXXg+c6yOWQIwpt5FcRVGYpXuOm/gg3yfiISO4t4oSwOD3nPxElOZ5DSVPcqoK1yA4YBPfncUvNJule0jZzXML3npmsQlY491K7srqXDCP8Ry9rMl2GoKV7kFeQ154ValgpV6McglUXjxg== 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=0+jNMtQzIPUII7l0t97HLzJI0By+Ws+b+o5LtswD6n0=; b=ORkbyYA8WS3PZ/uVPXW5MIOPoEljE2a0VhnV7YcVPaJ2S6+fYITd0rYWmAnFu7gIt9IFhA1cZEnlrjpHeaGgpcFdykV6yZQY01QA9YqKmjm6YdVsV2fc2bbJvQMjJF01LO99UW1kCvQa1hHH0n4HoxQydjITZZmENrrJM+SBB9ELvJZPWaWBXPqIs8Wm+ty4YMh8r4qu3qYiSNQLzuVD2sDqTlbPPhcMk+HcRzQ2z5C/Zra/xPlzh2IyPOkn74HFjGDfetQlX/M73Zy2S5RHxBcoLLwrdlwvP9S22d98xY0aYG847Nq9WaJKP0M1wgQBG7vyx2mVCxjJZKcZf+fp2Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.denx.de 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=0+jNMtQzIPUII7l0t97HLzJI0By+Ws+b+o5LtswD6n0=; b=hWI6EuhKz6RDSyVfZ9dNI7dRGqAUyUXaEok51ZU0duglsxG/rjbmro3hT2sQHDPX53TgmqBcWW+bJLeyfLy2fnvduJJ61A10M4PXjO1qmiqkwoYkYnHIEzkEdVTHeUpXVxrSrTH8flm3qPg9pj8X5jXFqw1za/GJ4iMStghvg60= Received: from MN2PR14CA0011.namprd14.prod.outlook.com (2603:10b6:208:23e::16) by SN7PR12MB8433.namprd12.prod.outlook.com (2603:10b6:806:2e5::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.29; Wed, 29 May 2024 14:48:27 +0000 Received: from MN1PEPF0000ECD5.namprd02.prod.outlook.com (2603:10b6:208:23e:cafe::bf) by MN2PR14CA0011.outlook.office365.com (2603:10b6:208:23e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.30 via Frontend Transport; Wed, 29 May 2024 14:48:27 +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 MN1PEPF0000ECD5.mail.protection.outlook.com (10.167.242.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7633.15 via Frontend Transport; Wed, 29 May 2024 14:48:27 +0000 Received: from localhost (10.180.168.240) 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.35; Wed, 29 May 2024 09:48:26 -0500 From: Michal Simek To: , CC: Angelo Dureghello , Ashok Reddy Soma , Christophe Leroy , =?utf-8?q?C=C3=A9dric_Le_Go?= =?utf-8?q?ater?= , Eugen Hristev , Hai Pham , "Ibai Erkiaga" , Igor Prusov , Jagan Teki , Kongyang Liu , Marek Vasut , Patrice Chotard , Sean Anderson , Simon Glass , Tejas Bhumkar , Tom Rini , Udit Kumar , Venkatesh Yadav Abbarapu , William Zhang Subject: [PATCH 4/4] spi: versal2: Enable spi drivers for Versal Gen 2 Date: Wed, 29 May 2024 16:48:01 +0200 Message-ID: <691782470f56f7d49a3204f6757296f2752d4156.1716994063.git.michal.simek@amd.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3237; i=michal.simek@amd.com; h=from:subject:message-id; bh=mZY1b/QoFgoUu59Gjk5KLzZyVWEGgrAgONibiYZqb4M=; b=owGbwMvMwCR4yjP1tKYXjyLjabUkhrRwB7kDgUGpt989uPug9cl2gfKEZ3e/LXkcq7vHhXvXf oZXLQVWHbEsDIJMDLJiiizSNlfO7K2cMUX44mE5mDmsTCBDGLg4BWAifv0M82y+eN0+05VQZvY1 s39B87H8H+orvzPMr534tXKHuf3NN8/uHvJVqTApP56/BgA= X-Developer-Key: i=michal.simek@amd.com; a=openpgp; fpr=67350C9BF5CCEE9B5364356A377C7F21FE3D1F91 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN1PEPF0000ECD5:EE_|SN7PR12MB8433:EE_ X-MS-Office365-Filtering-Correlation-Id: 09a1afef-9592-4295-b452-08dc7fee667f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|36860700004|376005|82310400017|7416005|1800799015; X-Microsoft-Antispam-Message-Info: RaTF1fcDOvXVzBUB5Tbj6ETmZlsNZC0WQGX4buVRJ07211tWgHIn6iv4hRiH+Mx7x8eJG01tLYD5huLvrZJ0VFg4s278iBZfKoadN4r5WGfUn67vlyPdkSckDn76sTvhmShuiIhwopKyuOxx+jEjHk1A266pSePVkVV1oG5VWYOaLRJrLF0N4u/NAIHVRLvVouVs7NlJhkt8hs1x53cSN2+XLzXravZhRLZQx2KY4ceLutqvQ+f385wwZusjN6YERCHmrAB5fyf/VEgaWTOnElFngo/BYS5qdn93Og8RnBn8Feta5kWi9gtJXNNzDQCSiz1+V+YTF8fQLxTI8gjiMoQJ03Jjzw9VI6g9eqmeR1cvRkSUiA5M2Jmf4nhzmyMEOwveHAyxLz6ZM1SZ1fDIYyFVxJnW+uTi8CRv0Wou/WLZ1SXcLb5DjsKpmHAG2qN1cLX9Lkl8hzn2RzmXXaggw1rqiaosvWzcu6Rc1uU4NP3RXcua6QRySaFPJjQGBQrggwOT4yiSbUsPW8Z1WUcxfU6TDUZevIdRPkRRC0nFdKhKpLQh8EjTbQGhhysI0TjQECXPE8shNlqwIqRrgRmRTFsEi5mxSgFc1AUifowCAPFQMk+7AQQU4oTqnT1vz6AYKFMTT0jLNJm/xUckzRm6Yku4EV2EJl384kniJVzyW5zPbXvt0L7cvFy2WZMGHJsIqp/Vo/7OoCsyQSIdU0QJPlc671ERMLbu96Y85k47MwxwVwPN0Y9lRvHZiqB41jPuXVcU4L2BAiuNBP2DE6Ze7rmwWCCFGhmvQ86dDY3nC18wJmoZkKb+tDuZnHI5hq20VgKEhDfOkTLP2eru5yI33KewaG9wtoYwA5DDLznhku0L12cSlE36zL8kSDwT/QeoO0xZ98Af6i89dUPaP3yudk0duYRvftKfcxIaiXSIwICBJEF5d7cchbnkcxq+XcQHKAj3sAljKtfhd5z40QjYF9Z9nJ+GNaGRdy5Jpr+b0fWzXzHeTXwE9oAzAYZaTC93t3ROkLtk5us2BzH9d9NctkbmWIH0/lK6kIISv6UVGYrhruCvuZWpk3ChyJj2AmMaezuz3RnnGpxDRxrnk67nJe4QThANW5r+InunO5bhRJeLiLEj/FvuO6bC/ym3SQjBYH/EiuMAUF0N2F7suRStewPTSZkFfcyUj4hSIWeWGL7sHmqmKawwYXKs+g4eMwXhUbPLskq5uMNUON0jbtFwE5AX+vqQXomRiU2C3E9g5l2MKl1aMIksjZ7igXewyNsfdQsxlFzRCPrPFwtKjeMbGG/+ryXIHWbwNuWe2pis7r45A9wHMIxGEfoLzrRiiUgd9oeSFwX6pdHhgOH5JUcTltodMM0ol2in2Od7MfzpwUa3gE7Kw21dnO1/NbOlCppZ 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)(36860700004)(376005)(82310400017)(7416005)(1800799015); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 May 2024 14:48:27.7888 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 09a1afef-9592-4295-b452-08dc7fee667f 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: MN1PEPF0000ECD5.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB8433 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Enable and update OSPI/QSPI/GQSPI drivers to support Versal Gen 2 SoCs. Signed-off-by: Michal Simek --- configs/amd_versal2_virt_defconfig | 4 +++- drivers/spi/Kconfig | 2 +- drivers/spi/cadence_qspi.c | 3 ++- drivers/spi/zynqmp_gqspi.c | 6 ++++-- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/configs/amd_versal2_virt_defconfig b/configs/amd_versal2_virt_defconfig index b74e69be28c4..6e4adddf2c02 100644 --- a/configs/amd_versal2_virt_defconfig +++ b/configs/amd_versal2_virt_defconfig @@ -5,7 +5,6 @@ CONFIG_SYS_INIT_SP_BSS_OFFSET=1572864 CONFIG_ARCH_VERSAL2=y CONFIG_TEXT_BASE=0x8000000 CONFIG_SYS_MALLOC_F_LEN=0x100000 -CONFIG_DM_GPIO=y CONFIG_DEFAULT_DEVICE_TREE="amd-versal2-virt" CONFIG_OF_LIBFDT_OVERLAY=y CONFIG_DM_RESET=y @@ -124,7 +123,10 @@ CONFIG_SOC_DEVICE=y CONFIG_SOC_AMD_VERSAL2=y CONFIG_SPI=y CONFIG_DM_SPI=y +CONFIG_CADENCE_QSPI=y +CONFIG_CADENCE_OSPI_VERSAL=y CONFIG_ZYNQ_SPI=y +CONFIG_ZYNQMP_GQSPI=y CONFIG_TPM2_TIS_SPI=y CONFIG_USB=y CONFIG_DM_USB_GADGET=y diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig index 35030ab35561..cd785aefd56e 100644 --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig @@ -156,7 +156,7 @@ config CQSPI_REF_CLK config CADENCE_OSPI_VERSAL bool "Configure Versal OSPI" - depends on (ARCH_VERSAL || ARCH_VERSAL_NET) && CADENCE_QSPI + depends on (ARCH_VERSAL || ARCH_VERSAL_NET || ARCH_VERSAL2) && CADENCE_QSPI imply DM_GPIO help This option is used to enable Versal OSPI DMA operations which diff --git a/drivers/spi/cadence_qspi.c b/drivers/spi/cadence_qspi.c index 75e522320101..9c466f8695e2 100644 --- a/drivers/spi/cadence_qspi.c +++ b/drivers/spi/cadence_qspi.c @@ -253,7 +253,8 @@ static int cadence_spi_probe(struct udevice *bus) /* Versal and Versal-NET use spi calibration to set read delay */ if (CONFIG_IS_ENABLED(ARCH_VERSAL) || - CONFIG_IS_ENABLED(ARCH_VERSAL_NET)) + CONFIG_IS_ENABLED(ARCH_VERSAL_NET) || + CONFIG_IS_ENABLED(ARCH_VERSAL2)) if (priv->read_delay >= 0) priv->read_delay = -1; diff --git a/drivers/spi/zynqmp_gqspi.c b/drivers/spi/zynqmp_gqspi.c index 61349a4da53f..ae795e50b0a5 100644 --- a/drivers/spi/zynqmp_gqspi.c +++ b/drivers/spi/zynqmp_gqspi.c @@ -106,7 +106,8 @@ #define TAP_DLY_BYPASS_LQSPI_RX_SHIFT 2 #define GQSPI_DATA_DLY_ADJ_OFST 0x000001F8 #define IOU_TAPDLY_BYPASS_OFST !(IS_ENABLED(CONFIG_ARCH_VERSAL) || \ - IS_ENABLED(CONFIG_ARCH_VERSAL_NET)) ? \ + IS_ENABLED(CONFIG_ARCH_VERSAL_NET) || \ + IS_ENABLED(CONFIG_ARCH_VERSAL2)) ? \ 0xFF180390 : 0xF103003C #define GQSPI_LPBK_DLY_ADJ_LPBK_MASK 0x00000020 #define GQSPI_FREQ_37_5MHZ 37500000 @@ -316,7 +317,8 @@ static void zynqmp_qspi_set_tapdelay(struct udevice *bus, u32 baudrateval) __func__, clk_rate, baudrateval, reqhz); if (!(IS_ENABLED(CONFIG_ARCH_VERSAL) || - IS_ENABLED(CONFIG_ARCH_VERSAL_NET))) { + IS_ENABLED(CONFIG_ARCH_VERSAL_NET) || + IS_ENABLED(CONFIG_ARCH_VERSAL2))) { if (reqhz <= GQSPI_FREQ_40MHZ) { tapdlybypass = TAP_DLY_BYPASS_LQSPI_RX_VALUE << TAP_DLY_BYPASS_LQSPI_RX_SHIFT;