Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp853182pxk; Thu, 3 Sep 2020 14:25:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqxTuPrExowcY7h0VLoxE3v2F3pvZZsg7Ny/Ohy4CRhU/OllSDoBTyeTb54AeAHf5RCocW X-Received: by 2002:a17:906:380d:: with SMTP id v13mr4102954ejc.152.1599168350688; Thu, 03 Sep 2020 14:25:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1599168350; cv=pass; d=google.com; s=arc-20160816; b=Bv/oVBiqj8a1wGUwzpkDVLUModUH1mMcSWyf6+6sCcXUaQbuwXEW+IMVmElMdn5jjn 39bl7LXHhqS+Ys/7jTY5MECrSikmUtOQ6BdKOR8Mv3dFxrT8cZfIieLXvv+4l23EwLgH aQbaMSQN2+1KKy5471i7R+Bv0Phs9yymVBZMrdYmAV6zm5pEbAqp1ScXTHVb8adPIQpk mWj8N2S/9mtf5Qeatka7R1lR19aqEi4mfr7qWUjNqywzAseghUc+La6bFDy6wzitI4dq 4scX0jFqooYh/MUMamMjqoMHs2Xo9hf1cgwRu16BkNoPdhIVfTjN/3j1pgWHV7yFiR1y C0WQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=FE7SyV2TPnmYFkfMnRRZVk1QXDyibyNa11tY9yiClJk=; b=v9zcfvxiFtMeGK0aX04xtS9E/DbeSqiBlmqAc+F06kwLEDraV26odpYW2EVA0cj0Ea j32KMpvJlW4MMDp4VeChh5P1M1Cnme2FLd9FL9E48FWvH4hh163zN5uaCo45N8/IEbXz A5Hxzkshv2WXAcmqhgQBQebb7w4d6hjLVnBXnbFEfbwz88GC2yOjcWozX3waCgY0Q7VY CkLgixZVvcbGnfSs+LijC441zw8JqiOqpdS7DoeYHD8639DYqTRT0aoTJxLH6cZ09//j WVIPQRP9A4b57AIYcTAc7RwCXLJaRMjbKUsyEFpxZ+Rupbwh/q2XdKFMWdV99I6Z6RaH NOBg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@xilinx.onmicrosoft.com header.s=selector2-xilinx-onmicrosoft-com header.b="QyBuIV/3"; arc=pass (i=1 spf=pass spfdomain=xilinx.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x20si1158462edv.305.2020.09.03.14.25.28; Thu, 03 Sep 2020 14:25:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@xilinx.onmicrosoft.com header.s=selector2-xilinx-onmicrosoft-com header.b="QyBuIV/3"; arc=pass (i=1 spf=pass spfdomain=xilinx.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729088AbgICVXl (ORCPT + 99 others); Thu, 3 Sep 2020 17:23:41 -0400 Received: from mail-bn8nam12on2042.outbound.protection.outlook.com ([40.107.237.42]:37153 "EHLO NAM12-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726528AbgICVXW (ORCPT ); Thu, 3 Sep 2020 17:23:22 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MdKs3nMDTrSmaxDm9AE2qIUJDyKzpF5cEAzLqHtyNDxWsU9nl2hXGATUBYKe9/lpY9yG8UxS+A/DbFRfJVESQ58Y+oo27nSSHzMQSvJpNI9qfvczV8W8x2sj54S+hEHrm4sgcTFg3ah3W3bEOd0ofsl4i+/za5FcX+kCsldyHAZzyRLj01wrXU9mcahwyv8EcZMZFxXHVw0nEUzKT0RP5nv2ACnFcgj+Wt9/02JmnE8UhYv6r/CeN7V5g7w5ZDGO/SqfRBS97IMqG5Dv0RogG/OKZiin2jPC15oUxIKem0Qquw97PR8ETZ5wf2n9+OsNQ/lGyMOQaEonM07i05JsIA== 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-SenderADCheck; bh=FE7SyV2TPnmYFkfMnRRZVk1QXDyibyNa11tY9yiClJk=; b=Dujsad6oiMOp9P8MxRcZgsGvvkOO8gNauMALDA36EI9DgfwMILogV0uuGr/f+gNhAOzAVbBMTCF7yihgARuoLiYeILE9vGYoea26BXoiY/EIqaYafam2mUgwEPW+gkhnJoAURdE+gFGOpWyD1feVKx3zhA2oPVvd1Q2kysjtT7FpVVsa0DAUBMv/m/wMd2o6Rs66TZX2KjJqqXCPXYvy8P6MbK3lR/acnI9Z5bB6j4sz+/UW4wxOqG7p9wJ8DY8IvGIWMGnWwG0kW9LYZqKv6oRhDTANtWmo/npCzY5giW+ipZ+03hVHDkPuJU2OQXgK9feaJPsPGov5W2QNcDhW7A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=lists.infradead.org smtp.mailfrom=xilinx.com; dmarc=bestguesspass 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=FE7SyV2TPnmYFkfMnRRZVk1QXDyibyNa11tY9yiClJk=; b=QyBuIV/3f+SSMibrCr6BFnSlNcIOqwz+1U3LuzCpxz9Hm/ibdaR0LbveZ0Pz4DRFN0ZuhA8J88/IMLYy7r1enKvGi6f+xQS0mElr7WVRfVGZswC3Hu4Vcc7LbG/BQDgsv2JGOefI9zo2RGHf67zRzcS8Nq4FRX2CUbEhRiMymKc= Received: from BL0PR02CA0075.namprd02.prod.outlook.com (2603:10b6:208:51::16) by CY4PR0201MB3604.namprd02.prod.outlook.com (2603:10b6:910:8d::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3348.15; Thu, 3 Sep 2020 21:23:16 +0000 Received: from BL2NAM02FT037.eop-nam02.prod.protection.outlook.com (2603:10b6:208:51:cafe::ab) by BL0PR02CA0075.outlook.office365.com (2603:10b6:208:51::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3348.15 via Frontend Transport; Thu, 3 Sep 2020 21:23:16 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; lists.infradead.org; dkim=none (message not signed) header.d=none;lists.infradead.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by BL2NAM02FT037.mail.protection.outlook.com (10.152.77.11) with Microsoft SMTP Server id 15.20.3326.19 via Frontend Transport; Thu, 3 Sep 2020 21:23:16 +0000 Received: from [149.199.38.66] (port=37602 helo=smtp.xilinx.com) by xsj-pvapsmtpgw01 with esmtp (Exim 4.90) (envelope-from ) id 1kDwhJ-0006tl-GR; Thu, 03 Sep 2020 14:23:09 -0700 Received: from [127.0.0.1] (helo=localhost) by smtp.xilinx.com with smtp (Exim 4.63) (envelope-from ) id 1kDwhP-0000OF-Qr; Thu, 03 Sep 2020 14:23:15 -0700 Received: from xsj-pvapsmtp01 (xsj-pvapsmtp01.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id 083LNAB6023387; Thu, 3 Sep 2020 14:23:10 -0700 Received: from [172.19.2.206] (helo=xsjblevinsk50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1kDwhK-0000M3-47; Thu, 03 Sep 2020 14:23:10 -0700 From: Ben Levinsky To: punit1.agrawal@toshiba.co.jp, stefanos@xilinx.com, michals@xilinx.com Cc: michael.auchter@ni.com, devicetree@vger.kernel.org, mathieu.poirier@linaro.org, emooring@xilinx.com, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, jliang@xilinx.com, robh+dt@kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v12 0/5] Provide basic driver to control Arm R5 co-processor found on Xilinx ZynqMP Date: Thu, 3 Sep 2020 14:23:05 -0700 Message-Id: <20200903212310.17990-1-ben.levinsky@xilinx.com> X-Mailer: git-send-email 2.17.1 X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 5f97e7a4-44ab-4034-ffec-08d8504f9266 X-MS-TrafficTypeDiagnostic: CY4PR0201MB3604: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bLlcHSBphkh6BoTZQTAUwzn29rvGFJg8QqKmm7UcCtLWZ2Xb0mwCRfP8c0+K9uy+hnrwrsY0CnRQZ3+klKtcH3cvf9HfR+aWI6HIslm/rPo+9jHWOLyPjG6ijCBpMuAFqApvqWh+nkwyZRQ2Eb6SNL940llEwgfuuVRZGAvBq61sBoLRfRt/Krcrob2eTMTJf+MlDlBW0QBg9o0T99Xg5yB4IP4yNQ0Zj8WS6aNOB3K5pdY6ia5YfmgcwvCYZJPjKArsapasD0sgN56hIHw5t1Gvw67LhzLwHUDMFDOSzz9WgKkcbGEamwnelKYz0hITKJHGPY1Zqi+IHBhg55uxIiGrZTABYJqUtXAHyJjzEO37ajLLVhTHhWqV6TUs09xy2gpoohEUM1tM2wb364xOQw== X-Forefront-Antispam-Report: CIP:149.199.60.83;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:xsj-pvapsmtpgw01;PTR:unknown-60-83.xilinx.com;CAT:NONE;SFS:(136003)(39860400002)(396003)(346002)(376002)(46966005)(47076004)(8936002)(82740400003)(1076003)(5660300002)(44832011)(8676002)(4326008)(2616005)(7696005)(2906002)(82310400003)(336012)(6666004)(478600001)(70586007)(316002)(26005)(6636002)(356005)(426003)(9786002)(83380400001)(81166007)(186003)(70206006)(36756003);DIR:OUT;SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Sep 2020 21:23:16.1687 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5f97e7a4-44ab-4034-ffec-08d8504f9266 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.60.83];Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-AuthSource: BL2NAM02FT037.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR0201MB3604 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The driver was tested on Xilinx ZynqMP QEMU For sake of ease of review, only support ZynqMP. Once accepted, then add support for Versal platform and R5 loading onto OCM. v2: - remove domain struct v3: - add xilinx-related platform mgmt fn's instead of wrapping around function pointer in xilinx eemi ops struct - update zynqmp_r5 yaml parsing to not raise warnings for extra information in children of R5 node. The warning "node has a unit name, but no reg or ranges property" will still be raised though as this particular node is needed to describe the '#address-cells' and '#size-cells' information. v4: - add default values for enums - fix formatting as per checkpatch.pl --strict. Note that 1 warning and 1 check are still raised as each is due to fixing the warning results in that particular line going over 80 characters. - remove warning '/example-0/rpu@ff9a0000/r5@0: node has a unit name, but no reg or ranges property' by adding reg to r5 node. v5: - update device tree sample and yaml parsing to not raise any warnings - description for memory-region in yaml parsing - compatible string in yaml parsing for TCM - parse_fw change from use of rproc_of_resm_mem_entry_init to rproc_mem_entry_init and use of alloc/release - var's of type zynqmp_r5_pdata all have same local variable name - use dev_dbg instead of dev_info v6: - adding memory carveouts is handled much more similarly. All mem carveouts are now described in reserved memory as needed. That is, TCM nodes are not coupled to remoteproc anymore. This is reflected in the remoteproc R5 driver and the device tree binding. - remove mailbox from device tree binding as it is not necessary for elf loading v7: - remove unused headers - zynqmp_r5_remoteproc_probe:lockstep_mode from u32* to u32 - device-tree binding "lockstep-mode" to "xlnx,cluster-mode" - remove zynqmp_r5_mem_probe and loop to Probe R5 memory devices at probe() - remove is_r5_mode_set from zynqmp rpu remote processor private data - do not error out if no mailbox is provided since mailboxes are optional - remove zynqmp_r5_remoteproc_probe call of platform_set_drvdata as pdata is handled in zynqmp_r5_remoteproc_remove v8: - remove old acks, reviewed-by's in commit message v9: - if zynqmp_r5_remoteproc.c pdata->tx_mc_skbs not initialized, then do not call skb_queue_empty - update arguments and documentation for zynqmp_pm_set_rpu_mode - in fn zynqmp_pm_force_powerdown, change arg 'target' to 'node' - zynqmp_pm_request_wakeup update code style - edit 3/5 patch commit message - document zynqmp_pm_set_tcm_config and zynqmp_pm_get_rpu_mode documentation to include expected return val - remove unused fn zynqmp_pm_get_node_status - update 5/5 patch commit message to document supported configurations and how they are booted by the driver. - remove copyrights other than SPDX from zynqmp_r5_remoteproc.c - compilation warnings no longer raised - remove unused includes from zynqmp_r5_remoteproc.c - remove unused var autoboot from zynqmp_r5_remoteproc.c - reorder zynqmp_r5_pdata fpr small mem savings due to alignment - zynqmp_pm_set_tcm_config and zynqmp_pm_set_rpu_mode uses second arg - zynqmp_r5_remoteproc.c use of zynqmp_pm_set_tcm_config now does not have output arg - in tcm handling, unconditionally use &= 0x000fffff mask since all nodes in this fn are for tcm - update comments for translating dma field in tcm handling to device address - update calls to rproc_mem_entry_init in parse_mem_regions so that there are only 2 cases for types of carveouts instead of 3 - in parse_mem_regions, check if device tree node is null before using it - add example device tree nodes used in parse_mem_regions and tcm parsing - add comment for vring id node length - add check for string length so that vring id is at least min length - move tcm nodes from reserved mem to instead own device tree nodes and only use them if enabled in device tree - add comment for explaining handling of rproc_elf_load_rsc_table - remove obsolete check for "if (vqid < 0)" in zynqmp_r5_rproc_kick - remove unused field mems in struct zynqmp_r5_pdata - remove call to zynqmp_r5_mem_probe and the fn itself as tcm handling is done by zyqmp_r5_pm_request_tcm - remove obsolete setting of dma_ops and parent device dma_mask - remove obsolete use of of_dma_configure - add comment for call to r5_set_mode fn - make mbox usage optional and gracefully inform user via dev_dbg if not present - change lockstep_mode from u32* to u32 - update zynqmp_pm_set_rpu_mode and zynqmp_pm_set_rpu_mode documentation and remove unused args v10: - add include types.h to xlnx-zynqmp.h for compilation v11: - update usage of zynqmp_pm_get_rpu_mode to return rpu mode in enum - update zynqmp_pm_set_tcm_config and zynqmp_pm_set_rpu_mode arguments to remove unused args - use enums instead of u32 where possible in zynqmp_r5_remoteproc - zynqmp_r5_remoteproc: update prints to not use carriage return, just newline - zynqmp_r5_remoteproc: look up tcm banks via property instead of string name - print device tree nodes with %pOF instead of %s with node name field - update tcm release to unmap VA - handle r5-1 use case - device tree binding r5 node to have link to TCMs via meta-memory-regions property - fix device tree binding so no warnings from 'make dt_binding_check' v12: - update signed off by so that latest developer name is last - in drivers/firmware/zynqmp.c, update zynqmp_pm_set_rpu_mode so rpu_mode is only set if no error - update args for zynqmp_pm_set_rpu_mode, zynqmp_pm_set_tcm_config fn arg's to reflect what is expected in the function and the usage in zynqmp_r5_remoteproc accordingly Ben Levinsky (5): firmware: xilinx: Add ZynqMP firmware ioctl enums for RPU configuration. firmware: xilinx: Add shutdown/wakeup APIs firmware: xilinx: Add RPU configuration APIs dt-bindings: remoteproc: Add documentation for ZynqMP R5 rproc bindings remoteproc: Add initial zynqmp R5 remoteproc driver .../xilinx,zynqmp-r5-remoteproc.yaml | 123 +++ drivers/firmware/xilinx/zynqmp.c | 95 ++ drivers/remoteproc/Kconfig | 10 + drivers/remoteproc/Makefile | 1 + drivers/remoteproc/zynqmp_r5_remoteproc.c | 898 ++++++++++++++++++ include/linux/firmware/xlnx-zynqmp.h | 60 ++ 6 files changed, 1187 insertions(+) create mode 100644 Documentation/devicetree/bindings/remoteproc/xilinx,zynqmp-r5-remoteproc.yaml create mode 100644 drivers/remoteproc/zynqmp_r5_remoteproc.c -- 2.17.1