From patchwork Wed Jan 10 21:35:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tanmay Shah X-Patchwork-Id: 13516581 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E6D95C4707B for ; Wed, 10 Jan 2024 21:36:45 +0000 (UTC) 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=+6bvJ9KlITen21glGpkBVdugld4FPK17ZgFTvf6uvyU=; b=nE3D0xvZw8ZVxD d1M3yxEiFORuCmpY6CprIG763Qwvh3aQgsIjCHWGbLKM224BU2wjcusZ2ohf3wR9wtb2hKPWr40Pd +vG5XiT1hAjLlxxVXMlomgN6SyDfOpSLZM/VeNOvBuSgtxcpJScQUEjY8YrZEe5owDlIUJIiWu7f0 lFT9Mqay5mQe5S/KLcUGdHem8z+0ix0F0u3Z+z8uWPlWg2T4Ds+0MTzvNKEcoY5eGgwFEVDrZNUYo UUI5ntBaqvQEXq3GWr2E80W2RhzGERmVF1KcmqbBVz1qiU4y7JxW1bGLrSGEGtJ4y1ur5VbUzcpQ9 zuAU1ducWWWGhu+Q+Njw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rNgFA-00EI4I-2l; Wed, 10 Jan 2024 21:36:12 +0000 Received: from mail-mw2nam10on20601.outbound.protection.outlook.com ([2a01:111:f403:2412::601] helo=NAM10-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rNgF7-00EI2B-0I for linux-arm-kernel@lists.infradead.org; Wed, 10 Jan 2024 21:36:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CYHrQa0DSro09RBcLlwQ52c5cGqyPSAveA6CCuPybI77X5kSUgWfj1C0FJXEx7VBT+ix/73aHrnhZ9sjzbhemNvStr3VlgjlaHMcjp9SQynQ0XBfKlHQ/1xf5mIXKTowTaviUCRNHVCqkRWHNCz8J5t4UjpkedBG1jAKK7/0jyjWzecT3op2oI+b16th7njBMrqqsE4pfsVfD4YTIwQur90Ty0kOkVV2BXPQt/XCJ4LBINxIzfu0jheImmLPDsRWlcs5D19OsxbMBpIHyWmWya3N+7rRVRZ2/HYaStk4eIW8EFEqX/YgodN7NtVN6GThYtoQqDhD4lq7eVA7dNMNLA== 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=iq269o5QOQbJhUiqAzKMEPjpeVXDjObs0TmQ+z0/BiA=; b=PzfolZzcHknLPcqTMI5HsWhM1RiYTllWGh1PXAiqXkJgLl9g+6NhJ1J2KLQQDIOftdJ/c1KNn3LZ96pPjco5wE90vOaBinycFG0we9nNncNjFbVEDqG5RaEXugiRvOyzor3UP/sNe+7bak4p9Xjc8jDKSBD/ItAhmmbBgc9F1FuzCKih/RHSdtADR4Z4oRxW2lvstXzjAWHpp2QktbKbN4aX0o7VscZmGEIYkhWsYWGMlkhJ80Ch2oHr/B4BnR0d5N39w9e8Asa8pGSRxcrLq9z3JXIfBegFNp9LaHne9gYiRwK1o1PbpIu4BctVbFUdoiTBNk+p2P9N0mLqoHcwGg== 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=iq269o5QOQbJhUiqAzKMEPjpeVXDjObs0TmQ+z0/BiA=; b=wFtpxIeeTu5+sW5mV2cyafuB3T+qzKe4haCSOe6hpkjI0/PDTSClaRehNNJfss5uqPY+iVluKVG6Mq4KzRbU+FHPXt8cRBGWpXcM6nTg8C0AlCqQdwFGI50k/BfPHnuLKuI/ExJJmA3k73NsHTGp3GKw2Ar+7Vvz3koYt49o6vM= Received: from MW2PR16CA0033.namprd16.prod.outlook.com (2603:10b6:907::46) by BN9PR12MB5338.namprd12.prod.outlook.com (2603:10b6:408:103::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.24; Wed, 10 Jan 2024 21:35:58 +0000 Received: from CO1PEPF000042AC.namprd03.prod.outlook.com (2603:10b6:907:0:cafe::8d) by MW2PR16CA0033.outlook.office365.com (2603:10b6:907::46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.17 via Frontend Transport; Wed, 10 Jan 2024 21:35:57 +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=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by CO1PEPF000042AC.mail.protection.outlook.com (10.167.243.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7181.14 via Frontend Transport; Wed, 10 Jan 2024 21:35:57 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Wed, 10 Jan 2024 15:35:57 -0600 Received: from xsjtanmays50.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; Wed, 10 Jan 2024 15:35:56 -0600 From: Tanmay Shah To: , , , , , , , CC: , , , , Radhey Shyam Pandey , Rob Herring Subject: [PATCH v9 1/3] dt-bindings: remoteproc: add Tightly Coupled Memory (TCM) bindings Date: Wed, 10 Jan 2024 13:35:03 -0800 Message-ID: <20240110213504.3626468-2-tanmay.shah@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240110213504.3626468-1-tanmay.shah@amd.com> References: <20240110213504.3626468-1-tanmay.shah@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000042AC:EE_|BN9PR12MB5338:EE_ X-MS-Office365-Filtering-Correlation-Id: e8aaabae-8341-4742-8613-08dc12242207 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ULbn+N0AIlotkJjjGDG94Os9NcvRmnkyx8sl4fCMS7poV5ETiOrMFe4M19BIW4c+6/taMPljYFakppq/IiRl3mbEPak4cXyEhUtDl9O5pz8Mi54yZ2nqN4mwh93UEkPOrp4QW4TtLbpeFTmEFwzT78A3ybnLOC7mBnvK4E2l+Ll04V2FDta7pNFvDn5fZdiTwrlQa6CQTe2w3qtdSQbXo2zqjrXvx9H/MvPr4tWNkdRupDRahw/9+qqcaNkTelwk/6ZtZdqmZ7z9/6/kXpd0bTUCrRi3E+5Np8WfSIajnZHEffRnXEHn9tCgpu6205y7X18rlRyRLopSpamWDdw7hOX/D8yizEmAJoe1lqUT4x6uAOeWkLn27BQyUwcpcmgy9mF8jxr1rQ/yEDqtWEZ4P8gKydMlFnDUQr7qRKUZPvljrbSWVKoOyRdPHvSwuE7iTCDlBj9ug8d1Oa40yCnSeR8mxx4+EyaUFxkNNgGx87ry0klTTAxFd8gdeaPzsMpikMw9o4Kg5Nwzkq6LREmArJ7xdd+fNj977K7FkerC1yXg/FHEidiTNcJsEVWPr/H6kTNlRuIhJd21m5rjQ2D0llyNWHEz+JbV+hL++wIxoTWnpsrj9TxOy7uDhqvb82fC6y9GZOjOGudxRqRBsER1G//aaTOa/d+oUh+8bD99QnXaDfcxDFsMVc3JK+oWR7ZZNfT2m5te+5UKIz3O+KwbF1TdMOEBgaBtBqCCAI0UUKPEJ4dfYLAACT5LsluDc0TP7Mdc+qFzsTG3VLzuLlJhUQ== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(346002)(136003)(39860400002)(396003)(376002)(230922051799003)(451199024)(64100799003)(82310400011)(186009)(1800799012)(36840700001)(40470700004)(46966006)(7416002)(7049001)(478600001)(36860700001)(5660300002)(6666004)(86362001)(8676002)(2616005)(70206006)(316002)(8936002)(70586007)(41300700001)(110136005)(47076005)(54906003)(36756003)(82740400003)(1076003)(26005)(426003)(336012)(83380400001)(81166007)(356005)(4326008)(44832011)(40480700001)(2906002)(40460700003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2024 21:35:57.7402 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e8aaabae-8341-4742-8613-08dc12242207 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=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1PEPF000042AC.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5338 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240110_133609_129983_AC560242 X-CRM114-Status: GOOD ( 12.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Radhey Shyam Pandey Introduce bindings for TCM memory address space on AMD-xilinx Zynq UltraScale+ platform. It will help in defining TCM in device-tree and make it's access platform agnostic and data-driven. Tightly-coupled memories(TCMs) are low-latency memory that provides predictable instruction execution and predictable data load/store timing. Each Cortex-R5F processor contains two 64-bit wide 64 KB memory banks on the ATCM and BTCM ports, for a total of 128 KB of memory. The TCM resources(reg, reg-names and power-domain) are documented for each TCM in the R5 node. The reg and reg-names are made as required properties as we don't want to hardcode TCM addresses for future platforms and for zu+ legacy implementation will ensure that the old dts w/o reg/reg-names works and stable ABI is maintained. It also extends the examples for TCM split and lockstep modes. Signed-off-by: Radhey Shyam Pandey Signed-off-by: Tanmay Shah Acked-by: Rob Herring --- .../remoteproc/xlnx,zynqmp-r5fss.yaml | 131 +++++++++++++++--- 1 file changed, 113 insertions(+), 18 deletions(-) diff --git a/Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml b/Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml index 78aac69f1060..9ecd63ea1b38 100644 --- a/Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +++ b/Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml @@ -20,6 +20,17 @@ properties: compatible: const: xlnx,zynqmp-r5fss + "#address-cells": + const: 2 + + "#size-cells": + const: 2 + + ranges: + description: | + Standard ranges definition providing address translations for + local R5F TCM address spaces to bus addresses. + xlnx,cluster-mode: $ref: /schemas/types.yaml#/definitions/uint32 enum: [0, 1, 2] @@ -37,7 +48,7 @@ properties: 2: single cpu mode patternProperties: - "^r5f-[a-f0-9]+$": + "^r5f@[0-9a-f]+$": type: object description: | The RPU is located in the Low Power Domain of the Processor Subsystem. @@ -54,8 +65,19 @@ patternProperties: compatible: const: xlnx,zynqmp-r5f + reg: + items: + - description: ATCM internal memory region + - description: BTCM internal memory region + + reg-names: + items: + - const: atcm + - const: btcm + power-domains: - maxItems: 1 + minItems: 1 + maxItems: 3 mboxes: minItems: 1 @@ -102,34 +124,107 @@ patternProperties: required: - compatible - power-domains + - reg + - reg-names unevaluatedProperties: false required: - compatible + - "#address-cells" + - "#size-cells" + - ranges additionalProperties: false examples: - | - remoteproc { - compatible = "xlnx,zynqmp-r5fss"; - xlnx,cluster-mode = <1>; - - r5f-0 { - compatible = "xlnx,zynqmp-r5f"; - power-domains = <&zynqmp_firmware 0x7>; - memory-region = <&rproc_0_fw_image>, <&rpu0vdev0buffer>, <&rpu0vdev0vring0>, <&rpu0vdev0vring1>; - mboxes = <&ipi_mailbox_rpu0 0>, <&ipi_mailbox_rpu0 1>; - mbox-names = "tx", "rx"; + #include + + //Split mode configuration + soc { + #address-cells = <2>; + #size-cells = <2>; + + remoteproc@ffe00000 { + compatible = "xlnx,zynqmp-r5fss"; + xlnx,cluster-mode = <0>; + + #address-cells = <2>; + #size-cells = <2>; + ranges = <0x0 0x0 0x0 0xffe00000 0x0 0x10000>, + <0x0 0x20000 0x0 0xffe20000 0x0 0x10000>, + <0x1 0x0 0x0 0xffe90000 0x0 0x10000>, + <0x1 0x20000 0x0 0xffeb0000 0x0 0x10000>; + + r5f@0 { + compatible = "xlnx,zynqmp-r5f"; + reg = <0x0 0x0 0x0 0x10000>, <0x0 0x20000 0x0 0x10000>; + reg-names = "atcm", "btcm"; + power-domains = <&zynqmp_firmware PD_RPU_0>, + <&zynqmp_firmware PD_R5_0_ATCM>, + <&zynqmp_firmware PD_R5_0_BTCM>; + memory-region = <&rproc_0_fw_image>, <&rpu0vdev0buffer>, + <&rpu0vdev0vring0>, <&rpu0vdev0vring1>; + mboxes = <&ipi_mailbox_rpu0 0>, <&ipi_mailbox_rpu0 1>; + mbox-names = "tx", "rx"; + }; + + r5f@1 { + compatible = "xlnx,zynqmp-r5f"; + reg = <0x1 0x0 0x0 0x10000>, <0x1 0x20000 0x0 0x10000>; + reg-names = "atcm", "btcm"; + power-domains = <&zynqmp_firmware PD_RPU_1>, + <&zynqmp_firmware PD_R5_1_ATCM>, + <&zynqmp_firmware PD_R5_1_BTCM>; + memory-region = <&rproc_1_fw_image>, <&rpu1vdev0buffer>, + <&rpu1vdev0vring0>, <&rpu1vdev0vring1>; + mboxes = <&ipi_mailbox_rpu1 0>, <&ipi_mailbox_rpu1 1>; + mbox-names = "tx", "rx"; + }; }; + }; - r5f-1 { - compatible = "xlnx,zynqmp-r5f"; - power-domains = <&zynqmp_firmware 0x8>; - memory-region = <&rproc_1_fw_image>, <&rpu1vdev0buffer>, <&rpu1vdev0vring0>, <&rpu1vdev0vring1>; - mboxes = <&ipi_mailbox_rpu1 0>, <&ipi_mailbox_rpu1 1>; - mbox-names = "tx", "rx"; + - | + //Lockstep configuration + soc { + #address-cells = <2>; + #size-cells = <2>; + + remoteproc@ffe00000 { + compatible = "xlnx,zynqmp-r5fss"; + xlnx,cluster-mode = <1>; + + #address-cells = <2>; + #size-cells = <2>; + ranges = <0x0 0x0 0x0 0xffe00000 0x0 0x20000>, + <0x0 0x20000 0x0 0xffe20000 0x0 0x20000>; + + r5f@0 { + compatible = "xlnx,zynqmp-r5f"; + reg = <0x0 0x0 0x0 0x20000>, <0x0 0x20000 0x0 0x20000>; + reg-names = "atcm", "btcm"; + power-domains = <&zynqmp_firmware PD_RPU_0>, + <&zynqmp_firmware PD_R5_0_ATCM>, + <&zynqmp_firmware PD_R5_0_BTCM>; + memory-region = <&rproc_0_fw_image>, <&rpu0vdev0buffer>, + <&rpu0vdev0vring0>, <&rpu0vdev0vring1>; + mboxes = <&ipi_mailbox_rpu0 0>, <&ipi_mailbox_rpu0 1>; + mbox-names = "tx", "rx"; + }; + + r5f@1 { + compatible = "xlnx,zynqmp-r5f"; + reg = <0x1 0x0 0x0 0x10000>, <0x1 0x20000 0x0 0x10000>; + reg-names = "atcm", "btcm"; + power-domains = <&zynqmp_firmware PD_RPU_1>, + <&zynqmp_firmware PD_R5_1_ATCM>, + <&zynqmp_firmware PD_R5_1_BTCM>; + memory-region = <&rproc_1_fw_image>, <&rpu1vdev0buffer>, + <&rpu1vdev0vring0>, <&rpu1vdev0vring1>; + mboxes = <&ipi_mailbox_rpu1 0>, <&ipi_mailbox_rpu1 1>; + mbox-names = "tx", "rx"; + }; }; }; ... From patchwork Wed Jan 10 21:35:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tanmay Shah X-Patchwork-Id: 13516582 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A9CF4C47073 for ; Wed, 10 Jan 2024 21:36:46 +0000 (UTC) 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=U9QX1ggUnzZZdHUc2pHo5ZPvf4txikzNHwcq3N6P+7I=; b=HvyznJBtGFS3v6 4zly20ZT20e/10Hajjb6EwHn2d7SRxhoqvE5uWFMpMISBKCoi7DARZgJmkN1AHyS3hLiybTGs0EbQ W87HHuLh85sXm4tlCOsIloQ3mJk9NqTqIEMO9Lm631YhXx0oIy8L+lpm4DxEgJIY68Ul9CEsAy5Ko EyK4/lXu9zfFxEwuLY+0jTc2QcgpvfZOFaynO7nyfe3sCoxlGW1sPzu0gN8U1kKtGlcEIbHW0x5UA TJJwPS3RQ/97GM3XP198ZmfehmD/KzhFs7SlvSSaBxeGUgwic/C545F5SYPorD836+Qc8KevYMRKG L7uvJZ2/gMH/JTd/PNZw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rNgFF-00EI7K-2n; Wed, 10 Jan 2024 21:36:17 +0000 Received: from mail-dm3nam02on2062c.outbound.protection.outlook.com ([2a01:111:f400:7e83::62c] helo=NAM02-DM3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rNgF9-00EI1h-0q for linux-arm-kernel@lists.infradead.org; Wed, 10 Jan 2024 21:36:12 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cUs7VQhXhcB5Y1Jmmo1mA92oV5NErAw24tbPVjQkt1QeefoiByNnUBd1HPMz0b6q7JDLfMffm+8WYhgWwl/ozX6LLi2NBy/Fnk/1MD5+i0ORA9/a4UyK/BE53lvuwRQ+9Q9mv/3RJONelXHWjzyFXns4ubnRZby2m1aP0o9pMRkPg/0qTADaFJ4iOC3x6Ye7zg7vS9104v8zgLu4XH/CXlvKyXhVFLnQZybahgpcqpwXNYGMz9MRi1C+TugveIe2WOQZCpPKBPmVkUrAauwQlyn1GGg+RQFduZ/Gp2KzetU+POBobMTmkJdn8oNkKk6Ap4ldIhakJtXF7f4rI3wrhg== 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=jrY+QZb5Ca8Ow9rg7UNssdhiW6V06EIOjAd+S0ikrVM=; b=ZthjIqeY+NUVrRrBjxndTwd/KzfJb7d5j8j+jbu40EFS5YqLTr9j3gR+u5LA7FpbFI/ok8/2SCSabxDuFjB7liP5leYEpyyixCixMYM9WZ/cVmX4wj9UnI4Tx7XNnbcCeFY9jL/DVYLYJeEv0rdqgx4zzV8i40N3F3ekq8e/cZSrm6KXgMleMGjG/iFlgKSSNsvoM+iOgUS5tSLR6UJwUHoYyX0wVJZBNho1+18vV96x4vyE2Up4DxUZD3EgqdPvniFVOB4xyxfNI1wMP6BWmdpjRuZ1vNzWJnpIZP/rmIzO473bp22wlrwSmUW4Qyx+xrO8fRH06YGnSq3oADKzlg== 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=jrY+QZb5Ca8Ow9rg7UNssdhiW6V06EIOjAd+S0ikrVM=; b=PT1W18J7n3hgOuUmmuY9YgRyclrAsS3D4awCh9creseB5KEK5dT0Gz0GiOLTGFmwXJswkl1kRa7Ki48ZMNgsoazrVRt5/tpNPxtLg8jU1ORkRNcUpVGgiKINOx5KJXy+gB0yuR2L6EwPqE8jzgyKx37q60l2e97SNSrlXs6BeX4= Received: from MW2PR16CA0025.namprd16.prod.outlook.com (2603:10b6:907::38) by DM4PR12MB6470.namprd12.prod.outlook.com (2603:10b6:8:b8::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.17; Wed, 10 Jan 2024 21:35:59 +0000 Received: from CO1PEPF000042AC.namprd03.prod.outlook.com (2603:10b6:907:0:cafe::d3) by MW2PR16CA0025.outlook.office365.com (2603:10b6:907::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.18 via Frontend Transport; Wed, 10 Jan 2024 21:35:59 +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=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by CO1PEPF000042AC.mail.protection.outlook.com (10.167.243.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7181.14 via Frontend Transport; Wed, 10 Jan 2024 21:35:58 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Wed, 10 Jan 2024 15:35:58 -0600 Received: from xsjtanmays50.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; Wed, 10 Jan 2024 15:35:57 -0600 From: Tanmay Shah To: , , , , , , , CC: , , , Subject: [PATCH v9 2/3] dts: zynqmp: add properties for TCM in remoteproc Date: Wed, 10 Jan 2024 13:35:04 -0800 Message-ID: <20240110213504.3626468-3-tanmay.shah@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240110213504.3626468-1-tanmay.shah@amd.com> References: <20240110213504.3626468-1-tanmay.shah@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000042AC:EE_|DM4PR12MB6470:EE_ X-MS-Office365-Filtering-Correlation-Id: 657a2b81-4409-420f-b95e-08dc122422bc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: obMPdar1N/lJK3Cv3mk7QQgQy/RO86V7C6uslwUxRbecOrMfx7XnS3zr4GiM4ThRYBCsNsbxoyv2Iqfnt12ZwT611lo+0urAD+7yc2Cmox3FcjpstdpwoZ3w6l0vyao2WUyy6nAlr8quPTBA+AUpGLpHFNlOZlFo578gZHaR5BnZgN35vgDJjsI/YTUhd/ZGUgzGcipzmDvI7giY3DHx8ueogqZ/Bb+N4rG+74OEFreaFe3Z026Xla2A5jKMrg7ufzQr9ayQGdi9jwfwpivbxKJmcFrdQfZvQOAwzFM/6KyYH6/ECtrIL3DmkhhYdGxZkcOb2yBlJGsPJ33f9YlFQCAIA0EnsX06JL2zeQBh14n4gmKnFowV52ozX74V/aFolxfV1XUJ5+onxrqvZiADpRWyOHJYxjqYXoK74NffwBa9T9Q91gIhpWQGXxu7/jPZfx1Wh8Qkp4ANCmS+OF+Z5fzbFp2gkYczb9PDdc245JTQKsOSc1lvFTpE1yvoqLcg5FxG877+MLkEuGigVE85aqR5MhkJTgcx935xv9nJ+d8bD+0ipr27BCc7vkS9+kX1wXkRXOnclGry2WQLIS/dvQY9lSKPewz8V+NDjGfYcWiTPmo2R8ystxUXs6uE+Zik+h8Nrfyb4bj/rhz37ZPVFBWieSR/67l9I5FTfoyytCWk40JdgdR1NGyImryTd/yz+xmrKFGfM//uTZrbykL3xpe4gFe88nYWUJ0Wsgyg4zrDQryxSftZorSj2yl5NbhgaOpc4jyWzAEUJGB4DQzgwA== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(346002)(396003)(39860400002)(136003)(376002)(230922051799003)(451199024)(1800799012)(186009)(82310400011)(64100799003)(40470700004)(46966006)(36840700001)(82740400003)(356005)(81166007)(36756003)(40480700001)(40460700003)(7049001)(86362001)(426003)(336012)(83380400001)(1076003)(2616005)(26005)(70206006)(70586007)(110136005)(54906003)(478600001)(6666004)(316002)(8676002)(8936002)(47076005)(36860700001)(2906002)(41300700001)(44832011)(4326008)(5660300002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2024 21:35:58.9277 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 657a2b81-4409-420f-b95e-08dc122422bc 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=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1PEPF000042AC.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6470 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240110_133611_301687_24FDDEB2 X-CRM114-Status: GOOD ( 14.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add properties as per new bindings in zynqmp remoteproc node to represent TCM address and size. This patch also adds alternative remoteproc node to represent remoteproc cluster in split mode. By default lockstep mode is enabled and users should disable it before using split mode dts. Both device-tree nodes can't be used simultaneously one of them must be disabled. For zcu102-1.0 and zcu102-1.1 board remoteproc split mode dts node is enabled and lockstep mode dts is disabled. Signed-off-by: Tanmay Shah Acked-by: Michal Simek --- Changes in v9: - fix rproc lockstep dts .../boot/dts/xilinx/zynqmp-zcu102-rev1.0.dts | 8 +++ arch/arm64/boot/dts/xilinx/zynqmp.dtsi | 58 +++++++++++++++++-- 2 files changed, 61 insertions(+), 5 deletions(-) diff --git a/arch/arm64/boot/dts/xilinx/zynqmp-zcu102-rev1.0.dts b/arch/arm64/boot/dts/xilinx/zynqmp-zcu102-rev1.0.dts index c8f71a1aec89..495ca94b45db 100644 --- a/arch/arm64/boot/dts/xilinx/zynqmp-zcu102-rev1.0.dts +++ b/arch/arm64/boot/dts/xilinx/zynqmp-zcu102-rev1.0.dts @@ -14,6 +14,14 @@ / { compatible = "xlnx,zynqmp-zcu102-rev1.0", "xlnx,zynqmp-zcu102", "xlnx,zynqmp"; }; +&rproc_split { + status = "okay"; +}; + +&rproc_lockstep { + status = "disabled"; +}; + &eeprom { #address-cells = <1>; #size-cells = <1>; diff --git a/arch/arm64/boot/dts/xilinx/zynqmp.dtsi b/arch/arm64/boot/dts/xilinx/zynqmp.dtsi index b61fc99cd911..cfdd1f68501f 100644 --- a/arch/arm64/boot/dts/xilinx/zynqmp.dtsi +++ b/arch/arm64/boot/dts/xilinx/zynqmp.dtsi @@ -247,19 +247,67 @@ fpga_full: fpga-full { ranges; }; - remoteproc { + rproc_lockstep: remoteproc@ffe00000 { compatible = "xlnx,zynqmp-r5fss"; xlnx,cluster-mode = <1>; - r5f-0 { + #address-cells = <2>; + #size-cells = <2>; + + ranges = <0x0 0x0 0x0 0xffe00000 0x0 0x20000>, + <0x0 0x20000 0x0 0xffe20000 0x0 0x20000>; + + r5f@0 { + compatible = "xlnx,zynqmp-r5f"; + reg = <0x0 0x0 0x0 0x20000>, <0x0 0x20000 0x0 0x20000>; + reg-names = "atcm", "btcm"; + power-domains = <&zynqmp_firmware PD_RPU_0>, + <&zynqmp_firmware PD_R5_0_ATCM>, + <&zynqmp_firmware PD_R5_0_BTCM>; + memory-region = <&rproc_0_fw_image>; + }; + + r5f@1 { + compatible = "xlnx,zynqmp-r5f"; + reg = <0x1 0x0 0x0 0x10000>, <0x1 0x20000 0x0 0x10000>; + reg-names = "atcm", "btcm"; + power-domains = <&zynqmp_firmware PD_RPU_1>, + <&zynqmp_firmware PD_R5_1_ATCM>, + <&zynqmp_firmware PD_R5_1_BTCM>; + memory-region = <&rproc_1_fw_image>; + }; + }; + + rproc_split: remoteproc-split@ffe00000 { + status = "disabled"; + compatible = "xlnx,zynqmp-r5fss"; + xlnx,cluster-mode = <0>; + + #address-cells = <2>; + #size-cells = <2>; + + ranges = <0x0 0x0 0x0 0xffe00000 0x0 0x10000>, + <0x0 0x20000 0x0 0xffe20000 0x0 0x10000>, + <0x1 0x0 0x0 0xffe90000 0x0 0x10000>, + <0x1 0x20000 0x0 0xffeb0000 0x0 0x10000>; + + r5f@0 { compatible = "xlnx,zynqmp-r5f"; - power-domains = <&zynqmp_firmware PD_RPU_0>; + reg = <0x0 0x0 0x0 0x10000>, <0x0 0x20000 0x0 0x10000>; + reg-names = "atcm", "btcm"; + power-domains = <&zynqmp_firmware PD_RPU_0>, + <&zynqmp_firmware PD_R5_0_ATCM>, + <&zynqmp_firmware PD_R5_0_BTCM>; memory-region = <&rproc_0_fw_image>; }; - r5f-1 { + r5f@1 { compatible = "xlnx,zynqmp-r5f"; - power-domains = <&zynqmp_firmware PD_RPU_1>; + reg = <0x1 0x0 0x0 0x10000>, <0x1 0x20000 0x0 0x10000>; + reg-names = "atcm", "btcm"; + power-domains = <&zynqmp_firmware PD_RPU_1>, + <&zynqmp_firmware PD_R5_1_ATCM>, + <&zynqmp_firmware PD_R5_1_BTCM>; memory-region = <&rproc_1_fw_image>; }; }; From patchwork Wed Jan 10 21:35:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tanmay Shah X-Patchwork-Id: 13516583 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E26E6C47422 for ; Wed, 10 Jan 2024 21:36:48 +0000 (UTC) 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=DOmeRe2J3FRaLvM8EjtNEagKTjSn4H6qR7NZr9arz/U=; b=pIwtj72mzaxPDC iGSnADq6AqjVgP3dNtI6FBIukJuqGc8IGhPn/TsFKGW1cYBZ0wZftp81i+W4DNaXRjIQSxA8D77oN tIEeAtEEUgMEJytOXnEToO4l0fGPwsugEoiEBwi5XGB9zhK7M0e0yF4csrKUyABCXTg0sjtUdtcNH xdzYwGmZr3u3E5EljRW0GKfpmXpPYAxNUsFDExk/KTBSXEjPZKsDyHdXGlaLKom+fdUfHMs4yuUoU yPgt1WYLw8MZiRWIk3Z3dfeLIuR1ECziPfYYgAmlcr4210HwuwZG01AGFuOXUtDITDRhNe67OHlWs cXM67g7/zTqfBBitf5UA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rNgFG-00EI7z-1f; Wed, 10 Jan 2024 21:36:18 +0000 Received: from mail-bn1nam02on20608.outbound.protection.outlook.com ([2a01:111:f400:7eb2::608] helo=NAM02-BN1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rNgF9-00EI1m-19 for linux-arm-kernel@lists.infradead.org; Wed, 10 Jan 2024 21:36:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Za3sp3vrT46wRXN1Y5CMElGzl4ORfpHAbw2EddO0qdK9iDNJCECOGIIl9s15fBy4MPPj5mYLWGRZlaTpe0dnrNZMm85nEX3AkY1sBfvfaGc7Z5HPWxl8VQWccUngMvfObbHpEfaxqt1pd3RBE4OR8rDuJTq5rJHvsNJONdC+H5S2X9983DiHOMbsagMYyZLsP96cYn0kcsN8LEZFw1mr/wrD826YZU1az6K+3MrKn7yl9UJD0TNq2JITRV9L2XCRp18OTa8MXQGDKkQiYylTiZGqKiSFHjfeReYEPYNYTkPXehJ4b7IoiJBnOwSW8Bgy2nGelEnX8nCsOwIM0pgE6w== 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=hZQaSRit/J0TP03x89eWNxKGM84p+ZKkNl0p1mHvmCc=; b=K9LedBhSesXNoarkJDQRLoXv0Cj3GgzUizEda3Rl0XUFrwM5ND5hUozclH09DRgW3pt+WoHE9GNewClD74jXcK+9Xf6qWs0vB6E/I2iGLKJ7NCSR9n24ARKtd8qZH8p++OVaNep9hKe95hqBrA9S2XwqNu4vnwyxLd/sJZKeGCWH7LCixHdZlJF0XgGZi6SOEFsXiQbjooevLMi6r2SpH4vvxiyy6su1re7H+K5Ig3EbIwr17/Ev6RXgz85ALkCJv23odOR8WGK/f7+1PiKDTGEaM7/9dGmUKCFBuQ7/VWqa6mJpcgF61DPy0B9YL17zE5e4WwRRWui0cmFL8UPA+w== 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=hZQaSRit/J0TP03x89eWNxKGM84p+ZKkNl0p1mHvmCc=; b=KGOZw2BbHKJ2WFyd8SNV07QZMjM53JHAWvCP70nlgxOcBFyVRTh4kZWTl/ymqR8hBlWuWH26bLLJjyEZeZ3H7VG2vjHfaPrl424NPtOnAJR07FUOJY0oREw8iNk79yXk7GB2c5KfJ2BRt+wqjQNRu1py0PICnvgKwuBv7dqxZks= Received: from MW2PR16CA0036.namprd16.prod.outlook.com (2603:10b6:907::49) by CO6PR12MB5412.namprd12.prod.outlook.com (2603:10b6:5:35e::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.25; Wed, 10 Jan 2024 21:36:01 +0000 Received: from CO1PEPF000042AC.namprd03.prod.outlook.com (2603:10b6:907:0:cafe::49) by MW2PR16CA0036.outlook.office365.com (2603:10b6:907::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.17 via Frontend Transport; Wed, 10 Jan 2024 21:36:01 +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=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by CO1PEPF000042AC.mail.protection.outlook.com (10.167.243.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7181.14 via Frontend Transport; Wed, 10 Jan 2024 21:36:00 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Wed, 10 Jan 2024 15:35:59 -0600 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Wed, 10 Jan 2024 15:35:59 -0600 Received: from xsjtanmays50.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; Wed, 10 Jan 2024 15:35:58 -0600 From: Tanmay Shah To: , , , , , , , CC: , , , Subject: [PATCH v9 3/3] remoteproc: zynqmp: parse TCM from device tree Date: Wed, 10 Jan 2024 13:35:05 -0800 Message-ID: <20240110213504.3626468-4-tanmay.shah@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240110213504.3626468-1-tanmay.shah@amd.com> References: <20240110213504.3626468-1-tanmay.shah@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000042AC:EE_|CO6PR12MB5412:EE_ X-MS-Office365-Filtering-Correlation-Id: bd500a40-826b-44f5-9945-08dc122423df X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tcIf4eiruSVOPsUkVOffiTVYwMi1eyYcSQ+kyl8RWRjRFaktQ16IjsFrneMvbdcC6JD8qKh3c93GonimE82OyoHgFcySTDNWXbBVztf82lwJ5G68UIFDSD9WyAXLxHw1fM6T3kp0YzK2yN3cbcht7Yhpzhfq7T9LHVPCn7t3LDeaKKCXhq4txPcW0CZzwIEflUsKK5C8fA9TwsWnVBmbDzhgvzLMx8h7XNWGzHtbbxHlk2IPlTx/nMS04BwfOkChITHfitPj8DElUmwriGOTdAu0GTKC3ELQpT2Ej4MILjnT1xcaEHkOrTUSjBlSqa3ddMMJoEjWRTgCGaizyDHVekFRR0sRxB0wIJ7rohtD49z9fF5MCqJhSw2K1+8zQ0H2sfuBKFgDxBgH51vru6lKyj1sf3RKRKRek5HgQrz9C0cV035EF2by3p+GArxFiMqlkMhO6MJJlnpU6C1ICh4eQDfN53sjv+Wa7cxM+IBcr/yAZj0MjTDBuCxADBytUEVAS0BFik02S9G2HQN+uo/KfTIlO7NeDKSqHcBCT9PvmSPL9W0c5KafaNpw/jjNoJ+nk+zXiFuGRaD48yiU1tZGeh2JI3TsZOljHJs2c/9qyrHxfYpNjMOpvf07Xa5pEdQl0KnDDfMPgKlD6i31MnzVoz7Elb0wTiX4Oh8xMrGWCV50Ef0danHk5odG11xyyXYYqOAriKIiYYZZgCozAw1cCXWWyS171LjUg6PfP33YtwmUg3ylxyfLgmUD8LLdgD+8k2A7YynlWTvOorwi5jY1yA== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(376002)(396003)(346002)(136003)(39860400002)(230922051799003)(451199024)(1800799012)(64100799003)(186009)(82310400011)(46966006)(40470700004)(36840700001)(478600001)(36860700001)(7049001)(5660300002)(6666004)(8676002)(86362001)(2616005)(70206006)(316002)(70586007)(41300700001)(110136005)(47076005)(54906003)(36756003)(8936002)(82740400003)(26005)(426003)(1076003)(336012)(83380400001)(81166007)(356005)(4326008)(44832011)(40480700001)(2906002)(66899024)(40460700003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2024 21:36:00.8340 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bd500a40-826b-44f5-9945-08dc122423df 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=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1PEPF000042AC.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR12MB5412 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240110_133611_471381_609B4778 X-CRM114-Status: GOOD ( 27.10 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org ZynqMP TCM information was fixed in driver. Now ZynqMP TCM information is available in device-tree. Parse TCM information in driver as per new bindings. Signed-off-by: Tanmay Shah --- Changes in v9: - Introduce new API to request and release core1 TCM power-domains in lockstep mode. This will be used during prepare -> add_tcm_banks callback to enable TCM in lockstep mode. - Parse TCM from device-tree in lockstep mode and split mode in uniform way. - Fix TCM representation in device-tree in lockstep mode. Changes in v8: - Remove pm_domains framework - Remove checking of pm_domain_id validation to power on/off tcm - Remove spurious change - parse power-domains property from device-tree and use EEMI calls to power on/off TCM instead of using pm domains framework Changes in v7: - move checking of pm_domain_id from previous patch - fix mem_bank_data memory allocation drivers/remoteproc/xlnx_r5_remoteproc.c | 245 +++++++++++++++++++++++- 1 file changed, 239 insertions(+), 6 deletions(-) diff --git a/drivers/remoteproc/xlnx_r5_remoteproc.c b/drivers/remoteproc/xlnx_r5_remoteproc.c index 4395edea9a64..0f87b984850b 100644 --- a/drivers/remoteproc/xlnx_r5_remoteproc.c +++ b/drivers/remoteproc/xlnx_r5_remoteproc.c @@ -74,8 +74,8 @@ struct mbox_info { }; /* - * Hardcoded TCM bank values. This will be removed once TCM bindings are - * accepted for system-dt specifications and upstreamed in linux kernel + * Hardcoded TCM bank values. This will stay in driver to maintain backward + * compatibility with device-tree that does not have TCM information. */ static const struct mem_bank_data zynqmp_tcm_banks_split[] = { {0xffe00000UL, 0x0, 0x10000UL, PD_R5_0_ATCM, "atcm0"}, /* TCM 64KB each */ @@ -102,6 +102,7 @@ static const struct mem_bank_data zynqmp_tcm_banks_lockstep[] = { * @rproc: rproc handle * @pm_domain_id: RPU CPU power domain id * @ipi: pointer to mailbox information + * @lockstep_core1_np: second core's device_node to use in lockstep mode */ struct zynqmp_r5_core { struct device *dev; @@ -111,6 +112,7 @@ struct zynqmp_r5_core { struct rproc *rproc; u32 pm_domain_id; struct mbox_info *ipi; + struct device_node *lockstep_core1_np; }; /** @@ -539,6 +541,110 @@ static int tcm_mem_map(struct rproc *rproc, return 0; } +int request_core1_tcm_lockstep(struct rproc *rproc) +{ + struct zynqmp_r5_core *r5_core = rproc->priv; + struct of_phandle_args out_args = {0}; + int ret, i, num_pd, pd_id, ret_err; + struct device_node *np; + + np = r5_core->lockstep_core1_np; + + /* Get number of power-domains */ + num_pd = of_count_phandle_with_args(np, "power-domains", + "#power-domain-cells"); + if (num_pd <= 0) + return -EINVAL; + + /* Get individual power-domain id and enable TCM */ + for (i = 1; i < num_pd; i++) { + ret = of_parse_phandle_with_args(np, "power-domains", + "#power-domain-cells", + i, &out_args); + if (ret) { + dev_warn(r5_core->dev, + "failed to get tcm %d in power-domains list, ret %d\n", + i, ret); + goto fail_request_core1_tcm; + } + + pd_id = out_args.args[0]; + of_node_put(out_args.np); + + ret = zynqmp_pm_request_node(pd_id, ZYNQMP_PM_CAPABILITY_ACCESS, 0, + ZYNQMP_PM_REQUEST_ACK_BLOCKING); + if (ret) { + dev_err(r5_core->dev, "failed to request TCM node 0x%x\n", + pd_id); + goto fail_request_core1_tcm; + } + } + + return 0; + +fail_request_core1_tcm: + + /* Cache actual error to return later */ + ret_err = ret; + + /* Release previously requested TCM in case of failure */ + while (--i > 0) { + ret = of_parse_phandle_with_args(np, "power-domains", + "#power-domain-cells", + i, &out_args); + if (ret) + return ret; + pd_id = out_args.args[0]; + of_node_put(out_args.np); + zynqmp_pm_release_node(pd_id); + } + + return ret_err; +} + +void release_core1_tcm_lockstep(struct rproc *rproc) +{ + struct zynqmp_r5_core *r5_core = rproc->priv; + struct of_phandle_args out_args = {0}; + struct zynqmp_r5_cluster *cluster; + int ret, i, num_pd, pd_id; + struct device_node *np; + + /* Get R5 core1 node */ + cluster = dev_get_drvdata(r5_core->dev->parent); + + if (cluster->mode != LOCKSTEP_MODE) + return; + + np = r5_core->lockstep_core1_np; + + /* Get number of power-domains */ + num_pd = of_count_phandle_with_args(np, "power-domains", + "#power-domain-cells"); + if (num_pd <= 0) + return; + + /* Get individual power-domain id and turn off each TCM */ + for (i = 1; i < num_pd; i++) { + ret = of_parse_phandle_with_args(np, "power-domains", + "#power-domain-cells", + i, &out_args); + if (ret) { + dev_warn(r5_core->dev, + "failed to get pd of core1 tcm %d in list, ret %d\n", + i, ret); + continue; + } + + pd_id = out_args.args[0]; + of_node_put(out_args.np); + + if (zynqmp_pm_release_node(pd_id)) + dev_warn(r5_core->dev, + "failed to release core1 tcm pd 0x%x\n", pd_id); + } +} + /* * add_tcm_carveout_split_mode() * @rproc: single R5 core's corresponding rproc instance @@ -633,6 +739,21 @@ static int add_tcm_carveout_lockstep_mode(struct rproc *rproc) r5_core = rproc->priv; dev = r5_core->dev; + /* + * In lockstep mode, R5 core0 uses TCM of R5 core1 via aliased addresses. + * Aliased addresses are contiguous with core0 TCM and embedded in "reg" + * property. However, R5 core1 TCM power-domains needs to be requested + * from firmware to use R5 core1 TCM. Request core1 TCM power-domains + * if TCM is parsed from device-tree. + */ + if (of_find_property(r5_core->np, "reg", NULL)) { + ret = request_core1_tcm_lockstep(rproc); + if (ret) { + dev_err(r5_core->dev, "failed to request core1 TCM power-domains\n"); + return ret; + } + } + /* Go through zynqmp banks for r5 node */ num_banks = r5_core->tcm_bank_count; @@ -689,6 +810,9 @@ static int add_tcm_carveout_lockstep_mode(struct rproc *rproc) pm_domain_id = r5_core->tcm_banks[i]->pm_domain_id; zynqmp_pm_release_node(pm_domain_id); } + + release_core1_tcm_lockstep(rproc); + return ret; } @@ -808,6 +932,8 @@ static int zynqmp_r5_rproc_unprepare(struct rproc *rproc) "can't turn off TCM bank 0x%x", pm_domain_id); } + release_core1_tcm_lockstep(rproc); + return 0; } @@ -878,6 +1004,95 @@ static struct zynqmp_r5_core *zynqmp_r5_add_rproc_core(struct device *cdev) return ERR_PTR(ret); } +static int zynqmp_r5_get_tcm_node_from_dt(struct zynqmp_r5_cluster *cluster) +{ + int i, j, tcm_bank_count, ret, tcm_pd_idx; + struct of_phandle_args out_args = {0}; + struct zynqmp_r5_core *r5_core; + struct platform_device *cpdev; + struct mem_bank_data *tcm; + struct device_node *np; + struct resource *res; + u64 abs_addr, size; + struct device *dev; + + for (i = 0; i < cluster->core_count; i++) { + r5_core = cluster->r5_cores[i]; + dev = r5_core->dev; + np = r5_core->np; + + /* we have address cell 2 and size cell as 2 */ + tcm_bank_count = of_property_count_elems_of_size(np, "reg", + 4 * sizeof(u32)); + if (tcm_bank_count <= 0) { + dev_err(dev, "can't get reg property err %d\n", tcm_bank_count); + return -EINVAL; + } + + r5_core->tcm_banks = devm_kcalloc(dev, tcm_bank_count, + sizeof(struct mem_bank_data *), + GFP_KERNEL); + if (!r5_core->tcm_banks) + ret = -ENOMEM; + + r5_core->tcm_bank_count = tcm_bank_count; + for (j = 0, tcm_pd_idx = 1; j < tcm_bank_count; j++, tcm_pd_idx++) { + tcm = devm_kzalloc(dev, sizeof(struct mem_bank_data), + GFP_KERNEL); + if (!tcm) + return -ENOMEM; + + r5_core->tcm_banks[j] = tcm; + + /* Get power-domains id of TCM. */ + ret = of_parse_phandle_with_args(np, "power-domains", + "#power-domain-cells", + tcm_pd_idx, &out_args); + if (ret) { + dev_err(r5_core->dev, + "failed to get tcm %d pm domain, ret %d\n", + tcm_pd_idx, ret); + return ret; + } + tcm->pm_domain_id = out_args.args[0]; + of_node_put(out_args.np); + + /* Get TCM address without translation. */ + ret = of_property_read_reg(np, j, &abs_addr, &size); + if (ret) { + dev_err(dev, "failed to get reg property\n"); + return ret; + } + + /* + * Remote processor can address only 32 bits + * so convert 64-bits into 32-bits. This will discard + * any unwanted upper 32-bits. + */ + tcm->da = (u32)abs_addr; + tcm->size = (u32)size; + + cpdev = to_platform_device(dev); + res = platform_get_resource(cpdev, IORESOURCE_MEM, j); + if (!res) { + dev_err(dev, "failed to get tcm resource\n"); + return -EINVAL; + } + + tcm->addr = (u32)res->start; + tcm->bank_name = (char *)res->name; + res = devm_request_mem_region(dev, tcm->addr, tcm->size, + tcm->bank_name); + if (!res) { + dev_err(dev, "failed to request tcm resource\n"); + return -EINVAL; + } + } + } + + return 0; +} + /** * zynqmp_r5_get_tcm_node() * Ideally this function should parse tcm node and store information @@ -956,9 +1171,14 @@ static int zynqmp_r5_core_init(struct zynqmp_r5_cluster *cluster, struct zynqmp_r5_core *r5_core; int ret, i; - ret = zynqmp_r5_get_tcm_node(cluster); - if (ret < 0) { - dev_err(dev, "can't get tcm node, err %d\n", ret); + r5_core = cluster->r5_cores[0]; + if (of_find_property(r5_core->np, "reg", NULL)) + ret = zynqmp_r5_get_tcm_node_from_dt(cluster); + else + ret = zynqmp_r5_get_tcm_node(cluster); + + if (ret) { + dev_err(dev, "can't get tcm, err %d\n", ret); return ret; } @@ -1099,7 +1319,19 @@ static int zynqmp_r5_cluster_init(struct zynqmp_r5_cluster *cluster) * then ignore second child node. */ if (cluster_mode == LOCKSTEP_MODE) { - of_node_put(child); + /* + * Get second core's device node only to use its power-domains. + * Also, no need to use of_node_put on first core's device_node + * as it is taken care by of_get_next_available_child. + */ + r5_cores[i]->lockstep_core1_np = + of_get_next_available_child(dev_node, child); + + if (!r5_cores[i]->lockstep_core1_np) { + ret = -EINVAL; + goto release_r5_cores; + } + break; } @@ -1158,6 +1390,7 @@ static void zynqmp_r5_cluster_exit(void *data) r5_core = cluster->r5_cores[i]; zynqmp_r5_free_mbox(r5_core->ipi); of_reserved_mem_device_release(r5_core->dev); + of_node_put(r5_core->lockstep_core1_np); put_device(r5_core->dev); rproc_del(r5_core->rproc); rproc_free(r5_core->rproc);