Received: by 2002:a19:771d:0:0:0:0:0 with SMTP id s29csp1266395lfc; Wed, 1 Jun 2022 13:35:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMBdMqtoRLdGanmisejkDaoc3sx5LUCo3gUImRXp3kNZPDg1xU4nLX9mhfpYY9LglyAI2C X-Received: by 2002:a62:b612:0:b0:518:dd80:7876 with SMTP id j18-20020a62b612000000b00518dd807876mr1344917pff.34.1654115727672; Wed, 01 Jun 2022 13:35:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1654115727; cv=pass; d=google.com; s=arc-20160816; b=JcHHc6svPugrwr2OIH1ww6J0wXlgns/t9qWgetJnp29kq2EBYhpC2EMBRb821B3zg0 oIisSH2Kj3vizMrOcYepBr9mmn/Ohy8kIljvo8e/PUaKHE3OVQhWRwehf04JIi4EbU1+ UvsnO8/rqhsEPi7HylHpqFdvwg71BETEiAgHKwyRsUH/dVDP6nxc1XhzxYfoywmjRooB 2I9I8lSOtZOMXPyKg8yd2EDEUpFAUZzgcKwFZT8CFeCVVTv4aa0cgj2IuUu3HXXeuUnh OXCYYTB2TPtvrDMzyjAMofc+1Lss/G/a+WBeVd0NL44qppYKvFYTEGBlzazqy5rv3AVj CJlg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:envelope-to:dkim-signature; bh=21ycIIGJY8rMS8OIfeYr0C+IRzsawuB5vVgz1CYe9MQ=; b=Y2x+AHNZ1dKXuKBvLfnkVaUhDfL/wjO4E+3Xi20ZmTyCvOYMPZjsdXk+m05wptYqCh 996+zkRFyBPFtBJe64vv19dH//ZNxmiDa/mp+zcpzFz1qe8L4xL8ZyEpEnd/WePHGiT/ UjkUjBoBBdF1dkD+0/J0spXMG+0rw+LMavvZqzdo7T4JiTc9CFIRAcFERgl84gDp6fEw 3/h+B/aqhgKchJwxs45py2b7tELtHpc61el7KXWRFdPOZzQ61mair1wyr4UH3XtUsNs4 ABngw+wLIf3nVQG9mBjc08lAIvfixQ0Nyv+UYAw3AIy89K+Y3UFQqFP8JQyyEnEOZlQG ktFw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@xilinx.onmicrosoft.com header.s=selector2-xilinx-onmicrosoft-com header.b=Q4EsoAEB; arc=pass (i=1 spf=pass spfdomain=xilinx.com dmarc=pass fromdomain=xilinx.com); spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xilinx.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id ru10-20020a17090b2bca00b001e19ff4fd24si3242648pjb.56.2022.06.01.13.35.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 13:35:27 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@xilinx.onmicrosoft.com header.s=selector2-xilinx-onmicrosoft-com header.b=Q4EsoAEB; arc=pass (i=1 spf=pass spfdomain=xilinx.com dmarc=pass fromdomain=xilinx.com); spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xilinx.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 04817703F3; Wed, 1 Jun 2022 12:45:04 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356095AbiFAQV4 (ORCPT + 99 others); Wed, 1 Jun 2022 12:21:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354136AbiFAQVr (ORCPT ); Wed, 1 Jun 2022 12:21:47 -0400 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2081.outbound.protection.outlook.com [40.107.100.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E17702ADB; Wed, 1 Jun 2022 09:21:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n1u6GJy/OthropuACyTISxORzSTXWzDwekoES0o1TKUQkfXUjBiQF12kno+ELAVQvlgOFt9pW7QgEPgw7kxYJD+2xEPcMSTCuDm6EKLPvTdL4hzSXEuFfFMhMa8H3fLDjjnPuVp0I8Rmek1Iq+KmIH8YFPKkMd2Zz/c6U9PdXno74VxtIK42giR3qtCk0uzx31pY8CSq7VHebIq2tIliZSXtAJTcV4NSlRnqXxkqJj35IoA63DLNrfgWa2l9C0Ku8jtBBnWpGCi9MaNyoPxHVPnuZy3g9QgSTn7pL1hiqZxEz3BzHaD5wGwy0biNXndhmD3e2ahNJzQ49zvUfkJLcw== 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=21ycIIGJY8rMS8OIfeYr0C+IRzsawuB5vVgz1CYe9MQ=; b=ZaUmmAJx/RKDNZ6pg0SKbgV7a29akF1vlKhwUj8H3iQy/EpGYSBBjVRPeVy02deWldCz6ODyHLxv+9o/NK/h8izpfDCV779R29K612yLAzmIXj8XWeK9aw9OtEs9k2opp4ZUahmDtAwjVMMlKN0Dd0sQcqWc+iIy4Zm0uEYBpuQNliHjtB7DLHujouGYLmjjx/wvOilCm7mN8zoefAMpNIjB6f8NsejpWJTTRgrQ41oH+sl6Mx4hV272VEIfipP82Lhsr83XZky4I/9oHjgPuTowY9Gd6WucQIWxmV+j9nWRerYRAebUz5JapRimxSTy6v4ITCCUJ+DatXplD1/pRg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=lists.openampproject.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=21ycIIGJY8rMS8OIfeYr0C+IRzsawuB5vVgz1CYe9MQ=; b=Q4EsoAEBYjZ5lQ9ZmvMkyw42hncGTmLtuYZyyWNtQVsTx7vEOxEADhANvW4GEmb0ZhQBlEW5BbJkm9EdhF3hPqW9jEhDAYJo+/io4HRGj9eDTm/ERjIElJjVReQtzxNMsDD06HI27PomcleK8SXKyiqcmVhqixnEwfSgiGCnRqg= Received: from SN6PR08CA0013.namprd08.prod.outlook.com (2603:10b6:805:66::26) by BYAPR02MB4792.namprd02.prod.outlook.com (2603:10b6:a03:4a::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.13; Wed, 1 Jun 2022 16:21:39 +0000 Received: from SN1NAM02FT0052.eop-nam02.prod.protection.outlook.com (2603:10b6:805:66:cafe::80) by SN6PR08CA0013.outlook.office365.com (2603:10b6:805:66::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.13 via Frontend Transport; Wed, 1 Jun 2022 16:21:39 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; pr=C Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by SN1NAM02FT0052.mail.protection.outlook.com (10.97.5.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5314.12 via Frontend Transport; Wed, 1 Jun 2022 16:21:39 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Wed, 1 Jun 2022 09:21:38 -0700 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Wed, 1 Jun 2022 09:21:38 -0700 Envelope-to: openamp-system-reference@lists.openampproject.org, bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, robh+dt@kernel.org, krzk+dt@kernel.org, linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Received: from [172.19.3.14] (port=50642 helo=xsjtanmays50.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1nwR6I-0003Rb-Bi; Wed, 01 Jun 2022 09:21:38 -0700 From: Tanmay Shah To: , , , , , , , CC: , , , Subject: [PATCH v7 0/6] Add Xilinx RPU subsystem support Date: Wed, 1 Jun 2022 09:21:06 -0700 Message-ID: <20220601162111.3505458-1-tanmay.shah@xilinx.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6e580567-64a5-4f40-580b-08da43eaceb0 X-MS-TrafficTypeDiagnostic: BYAPR02MB4792:EE_ X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: B3RNEVGwPuIlLT/S/8hShgujaQZzQKxyvoJcVh1PECZZDY90QgRkE6Gs15heWmW/eaFm3OavP3OC0tAaPFu5wpVJQKHiUbuiMFkvYzkE0BLLrUYu15Lzd2lyVVFCzpbb+lCOIWNx5FNRYagEKRDeudSVk+Id+ZR7z06xL81Khyo3anDylZcaUOz+4fpy5U1rZPgF9lb8S5yeYyAws+VLWvJz7koKGYacXz81AHDJoeueuS+u1doHl94Q7soenfDCgB53USj+m6iYTZKo+dOyInnQYrrqTkK6r8g0h8hQJYmMpeUxwWcHASb3uS9ZOKWKl0rvCOMkyO0c/bJ6hhBtXB/8NjFvUs572ePxe5s6vdJZERX7k+951MJ82RemuGRTvWrZsr5oSdVfKpbAGq9MaYJNaNlacS8AXwPXoKcwMbKhirUrD/Mbp1Z2aDW9lN69/QcpfQLjekv5aofBJHDil1ezehdnoeAg3DF4sFuxnmO9F5UIrVAZ+0o1RKtDhbWQgppsN5cNbUtt4MDcS5jBFo7CdRpxfAvwzzanD0BHLbz02+1pA/3FEOdO9ktbbrPlYAYa6KmXmZ3INtUAStMo/q8jxqQ8jEP59sFzD4Kyec2rVzkHZFyBcZV/MMPO7Do2QAOo0gBqdxNxvMRbZ8r6XBlx4E2uCo1NuIuWxVIsJe5OepQhydq5lbMkFFb31Ylu8UpWRXrUnTn55bwezejOoQ== X-Forefront-Antispam-Report: CIP:149.199.62.198;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:xsj-pvapexch02.xlnx.xilinx.com;PTR:unknown-62-198.xilinx.com;CAT:NONE;SFS:(13230001)(4636009)(40470700004)(36840700001)(46966006)(82310400005)(186003)(1076003)(8936002)(8676002)(316002)(110136005)(4326008)(36756003)(70206006)(47076005)(426003)(336012)(70586007)(83380400001)(54906003)(7696005)(2616005)(9786002)(508600001)(44832011)(5660300002)(7636003)(356005)(36860700001)(26005)(6666004)(40460700003)(7049001)(2906002)(102446001);DIR:OUT;SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jun 2022 16:21:39.4636 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6e580567-64a5-4f40-580b-08da43eaceb0 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.62.198];Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: SN1NAM02FT0052.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR02MB4792 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_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 This patch series adds bindings document for RPU subsystem found on Xilinx ZynqMP platforms. It also adds device nodes and driver to enable RPU subsystem in split mode and lockstep mode. Xilinx ZynqMP platform contains Remote Processing Unit(RPU). RPU subsystem contains two arm cortex r5f cores. RPU subsystem can be configured in split mode, lockstep mode and single-cpu mode. RPU subsystem also contains 4 Tightly Coupled Memory(TCM) banks. In lockstep mode, all 4 banks are combined and total of 256KB memory is made available to r5 core0. In split mode, both cores can access two TCM banks i.e. 128 KB. RPU can also fetch data and execute instructions from DDR memory along with TCM memory. --- Changes in v7: - Add minItems in sram property Changes in v6: - Add maxItems to sram and memory-region property Changes in v5: - Add constraints of the possible values of xlnx,cluster-mode property - fix description of power-domains property for r5 core - Remove reg, address-cells and size-cells properties as it is not required - Fix description of mboxes property - Add description of each memory-region and remove old .txt binding link reference in the description - Remove optional reg property from r5fss node - Move r5fss node out of axi node Changes in v4: - Add memory-region, mboxes and mbox-names properties in dt-bindings example - Add reserved memory region node and use it in Xilinx dt RPU subsystem node - Remove redundant header files - use dev_err_probe() to report errors during probe - Fix missing check on error code returned by zynqmp_r5_add_rproc_core() - Fix memory leaks all over the driver when resource allocation fails for any core - make cluster mode check only at one place - remove redundant initialization of variable - remove redundant use of of_node_put() - Fix Comment format problem - Assign offset of zynqmp_tcm_banks instead of duplicating it - Add tcm and memory regions rproc carveouts during prepare instead of parse_fw - Remove rproc_mem_entry object from r5_core - Use put_device() and rproc_del() APIs to fix memory leaks - Replace pr_* with dev_*. This was missed in v3, fix now. - Use "GPL" instead of "GPL v2" in MODULE_LICENSE macro. This was reported by checkpatch script. Changes in v3: - Fix checkpatch script indentation warning - Remove unused variable from xilinx remoteproc driver - use C style comments, i.e /*...*/ - Remove redundant debug information which can be derived using /proc/device-tree - Fix multiline comment format - s/"final fot TCM"/"final for TCM" - Function devm_kzalloc() does not return an code on error, just NULL. Remove redundant error check for this function throughout the driver. - Fix RPU mode configuration and add documentation accordingly - Get rid of the indentations to match function documentation style with rest of the driver - Fix memory leak by only using r5_rproc->priv and not replace it with new instance - Use 'i' for the outer loop and 'j' for the inner one as per convention - Remove redundant error and NULL checks throughout the driver - Use devm_kcalloc() when more than one element is required - Add memory-regions carveouts during driver probe instead of parse_fw call This removes redundant copy of reserved_mem object in r5_core structure. - Fix memory leak by using of_node_put() - Fix indentation of tcm_mem_map function args - Remove redundant init of variables - Initialize tcm bank size variable for lockstep mode - Replace u32 with phys_addr_t for variable stroing memory bank address - Add documentation of TCM behavior in lockstep mode - Use dev_get_drvdata instead of platform driver API - Remove info level messages - Fix checkpatch.pl warnings - Add documentation for the Xilinx r5f platform to understand driver design Changes in v2: - Remove proprietary copyright footer from cover letter Ben Levinsky (3): firmware: xilinx: Add ZynqMP firmware ioctl enums for RPU configuration. firmware: xilinx: Add shutdown/wakeup APIs firmware: xilinx: Add RPU configuration APIs Tanmay Shah (3): dt-bindings: remoteproc: Add Xilinx RPU subsystem bindings arm64: dts: xilinx: zynqmp: Add RPU subsystem device node drivers: remoteproc: Add Xilinx r5 remoteproc driver .../bindings/remoteproc/xlnx,r5f-rproc.yaml | 130 ++ arch/arm64/boot/dts/xilinx/zynqmp.dtsi | 33 + drivers/firmware/xilinx/zynqmp.c | 97 ++ drivers/remoteproc/Kconfig | 12 + drivers/remoteproc/Makefile | 1 + drivers/remoteproc/xlnx_r5_remoteproc.c | 1045 +++++++++++++++++ include/dt-bindings/power/xlnx-zynqmp-power.h | 6 + include/linux/firmware/xlnx-zynqmp.h | 60 + 8 files changed, 1384 insertions(+) create mode 100644 Documentation/devicetree/bindings/remoteproc/xlnx,r5f-rproc.yaml create mode 100644 drivers/remoteproc/xlnx_r5_remoteproc.c base-commit: 01a1a0c8d456b11f2f6b9b822414481beaa44d6f -- 2.25.1