From patchwork Tue Jul 25 14:06:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tanmay Shah X-Patchwork-Id: 1812709 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) 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=gRSWDy80; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4R9LqC3t1Cz1yYc for ; Wed, 26 Jul 2023 01:41:27 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B2D648670A; Tue, 25 Jul 2023 17:40:45 +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="gRSWDy80"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BFDAD86380; Tue, 25 Jul 2023 16:08:09 +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,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 NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2062e.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eab::62e]) (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 E557B860AC for ; Tue, 25 Jul 2023 16:08:05 +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=tanmay.shah@amd.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f4Ua7MJU0A3mJ+X4uGVOJXM7KSAU7MXqUs25TI+Ur+uMsG+HvGQ9oVs/l5Od9Bp3OQVqJ1F1/6WIdwANiAmuHCdKwTu7TLDmiT/S4M0g64+7iCz+QNsNy4QlO0F9lz+Id+6RY1V2W/kTNV7bP3nNuuXdgNac2iDBI86fgSKB0XBpT6WhtlF8XNlnRnTZlN58ZmMi5gE3HlSELCeYBO6OlC8LjHJe5fz3ubbRT4dmyYDZR7ePIPbtP3BnSzZ17XkR/NYlSxx3y4xhVgQuneJPRXn6gJLdJml0Eqv8vcgmx7b9V4WDyZh+pYBr0Rbyg18inaOgYtD13gj7HCq0cTBfDA== 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=QojyGZYAUFsLrbGGiV4QyiU1zn/V5FEP3k//uCPGVyY=; b=Bcmvetl1aKEeWzWy7D/kmMDztA7vOfMw1Xt6JgQUhB/wtxfC/FhXu0Ni1q7o0dPWfp/wwYPGKbEWpY9EJUW/JXtnewKzR4IjO8dSTAra8e6LgFoRl4u5+OfoU8f3y4XnVZu0ga/zheg7cEfqMplTn9y+6b4W30ncc4KvbChAvAIvRtZEr8ZOoBDDt4vdbKY2UA6V8AYfob0/guaT+LCLVNSSq/WBDKmFMIyaQVb5XLSPDk+BY0SxP+8jYiXaieh1PY6cSWxjhqVOHoR1nQHHSh8HE143g0gMfQMzJ2pv3aej0RSSLTPV0ENsVu5xqNV/ypHe+n6hHEdv4J2rUzQjPQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=chromium.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 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=QojyGZYAUFsLrbGGiV4QyiU1zn/V5FEP3k//uCPGVyY=; b=gRSWDy8047s9ziyz71FGvU1nWh5gG/0NKEB1JkJoreoE2CtXTWgFrpNev//wTyPGGeTVxdaN3DoGnUz40d1oQ1SBxd2bXICau7lU2ExTt/P1CzeMEin/ziHQEzxP4hsDSMSdCG81BByOqgbV1JCMLX9wYAxlo5H68SLe1p4ajAM= Received: from DS7PR05CA0083.namprd05.prod.outlook.com (2603:10b6:8:57::29) by MW3PR12MB4473.namprd12.prod.outlook.com (2603:10b6:303:56::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Tue, 25 Jul 2023 14:08:01 +0000 Received: from DM6NAM11FT082.eop-nam11.prod.protection.outlook.com (2603:10b6:8:57:cafe::cf) by DS7PR05CA0083.outlook.office365.com (2603:10b6:8:57::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.25 via Frontend Transport; Tue, 25 Jul 2023 14:08: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=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT082.mail.protection.outlook.com (10.13.173.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6631.29 via Frontend Transport; Tue, 25 Jul 2023 14:07:44 +0000 Received: from SATLEXMB07.amd.com (10.181.41.45) 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.27; Tue, 25 Jul 2023 09:07:43 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB07.amd.com (10.181.41.45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Tue, 25 Jul 2023 07:07:43 -0700 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.27 via Frontend Transport; Tue, 25 Jul 2023 09:07:42 -0500 From: Tanmay Shah To: Simon Glass , Tom Rini CC: , , , Michal Simek , Venkatesh Abbarapu , Mathieu Poirier , Nishanth Menon , Tanmay Shah Subject: [RFC PATCH 00/10] Add RPMsg framework Date: Tue, 25 Jul 2023 07:06:40 -0700 Message-ID: <20230725140650.951581-1-tanmay.shah@amd.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT082:EE_|MW3PR12MB4473:EE_ X-MS-Office365-Filtering-Correlation-Id: f44d0a5f-9dc3-4cae-7498-08db8d188eb1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vQ83TsGD6IvaiHSQ6rUk6/rpyZuE5FE15rivuzf5j4lRQarXz0Ir2ymYhvVTO/N5wzumTsHaXmGwDVtERbocGPTR5n6JNSTesWGYeFh3hFZ3gPomupvbbS96uYgseRZkC3axCq3mz/zZWa3R7C2DHN55lmFj4jtgsgbWp7kz3pK11OgjDJf0ydAd4V6nBtbipMW63EdvS3EszKOqDjhf5a+6knecO/qvgayLcZQiB5CYOt0IQ2109PzS8YcTJ3iggzitBKMf2RY7rDLCQjFCUGL56O1XGf+GJoSxaoXqkEFWvDQJOpqvpse6xOkJyJcSesUyx0EpDs2QIgiQ2tAomSB32mi9bCNY2WheM0TSqTHbHWOJdjE1TEjIRg1pq1I1N7oiJuCJR/nlAAaSDZ4XGYbfu0P1EmYAwSe22vFJ1Cb2YCCKcRvSkk2ypJcLO6mjklSa+F7pf9Wb4ZJD5oze2yL5FlPHZKD7ctt/hC+/92CqFjg8f7yUmfC1iUB2rcPh9xZPqMEmn7Rw9B7OvzKBEXtlKhIDbm6Q+kShUOyc1R2+02LmJyhOx+Z2psPsOWk3OP0HTKwzJI2T6t1ZAI+rk8a/peez+5GBEgdRR4x0Y4ToEuCnG1x4gkEho3zVxV2D2rkyH4FSNvCsFIg0aM7Burv+SywY4M7IiclR9Fw+A3J8tHSioZCsOtpzwMu1tn/ftERKDQtBFF2f62BOXyJ2eMvOmtQS0HVJ3YX/uOZL8mKA6j9oxt5zxhxlAEQ7i1AYYI8pMPBUmuzcJMm/pMagzw== 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:(13230028)(4636009)(376002)(346002)(39860400002)(136003)(396003)(82310400008)(451199021)(36840700001)(40470700004)(46966006)(36756003)(86362001)(356005)(81166007)(40460700003)(2906002)(110136005)(54906003)(478600001)(82740400003)(40480700001)(36860700001)(26005)(186003)(2616005)(426003)(336012)(1076003)(47076005)(41300700001)(8676002)(44832011)(5660300002)(70586007)(70206006)(8936002)(83380400001)(4326008)(316002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2023 14:07:44.0006 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f44d0a5f-9dc3-4cae-7498-08db8d188eb1 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: DM6NAM11FT082.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4473 X-Mailman-Approved-At: Tue, 25 Jul 2023 17:40:30 +0200 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 Remote Processor Messaging (RPMsg) framework is used to communicate with remote processor. RPMsg is a virtio-based messaging bus that allows U-Boot drivers to communicate with remote processors available on the system. This patch also introduces new virtio transport layer driver. To keep things minimal for now hard-coded endpoint is used in U-Boot to communicate with remote processor using RPMsg protocol. This will be modified to use multiple endpoints in future. U-Boot can't receive interrupts from remote processor as per design. Hence, user has to know when the data will be available from remote processor and call rpmsg_recv accordingly. Mostly it will be called to receive response of query done using rpmsg_send. Some code is already available to allocate memory for RPMsg however, that framework is mostly TI platform specific and isn't used by any other platforms. This series makes sure it does not break previous code for other platforms. If platforms wants to use this new framework it is expected to set "support_rpmsg_virtio" flag in relative remoteproc device's platform data. Also the framework introduced by this series is ported from the Linux kernel so other platforms which already support RPMsg in the Linux kernel can easily use this framework in U-Boot as well. --- Tanmay Shah (10): remoteproc: move resource table definition firmware: zynqmp: move zynqmp_pm_request_node API remoteproc: add remoteproc virtio transport driver drivers: add RPMsg framework rpmsg: add sample client driver cmd: add rpmsg framework commands remoteproc: add attach/detach commands remoteproc: add zynqmp driver configs: zynqmp: enable remoteproc and rpmsg configs: sandbox: enable rpmsg MAINTAINERS | 15 + arch/sandbox/dts/test.dts | 8 + cmd/Kconfig | 6 + cmd/Makefile | 1 + cmd/remoteproc.c | 14 +- cmd/rpmsg.c | 61 +++ configs/sandbox_defconfig | 4 + configs/xilinx_zynqmp_virt_defconfig | 6 + drivers/Kconfig | 2 + drivers/Makefile | 1 + drivers/firmware/firmware-zynqmp.c | 27 ++ drivers/power/domain/zynqmp-power-domain.c | 7 - drivers/remoteproc/Kconfig | 20 + drivers/remoteproc/Makefile | 2 + drivers/remoteproc/rproc-elf-loader.c | 33 -- drivers/remoteproc/rproc-uclass.c | 125 +++++- drivers/remoteproc/rproc_virtio.c | 422 +++++++++++++++++++++ drivers/remoteproc/xlnx_rproc.c | 411 ++++++++++++++++++++ drivers/rpmsg/Kconfig | 39 ++ drivers/rpmsg/Makefile | 13 + drivers/rpmsg/rpmsg-uclass.c | 156 ++++++++ drivers/rpmsg/rpmsg_internal.h | 52 +++ drivers/rpmsg/rpmsg_sample_client.c | 63 +++ drivers/rpmsg/sandbox_test_rpmsg.c | 88 +++++ drivers/rpmsg/virtio_rpmsg_bus.c | 384 +++++++++++++++++++ drivers/virtio/virtio-uclass.c | 1 + drivers/virtio/virtio_ring.c | 16 + include/dm/uclass-id.h | 1 + include/remoteproc.h | 130 ++++++- include/rpmsg.h | 145 +++++++ include/rproc_virtio.h | 33 ++ include/virtio.h | 7 +- include/virtio_ring.h | 32 ++ include/zynqmp_firmware.h | 30 +- test/dm/Makefile | 1 + test/dm/rpmsg.c | 41 ++ 36 files changed, 2321 insertions(+), 76 deletions(-) create mode 100644 cmd/rpmsg.c create mode 100644 drivers/remoteproc/rproc_virtio.c create mode 100644 drivers/remoteproc/xlnx_rproc.c create mode 100644 drivers/rpmsg/Kconfig create mode 100644 drivers/rpmsg/Makefile create mode 100644 drivers/rpmsg/rpmsg-uclass.c create mode 100644 drivers/rpmsg/rpmsg_internal.h create mode 100644 drivers/rpmsg/rpmsg_sample_client.c create mode 100644 drivers/rpmsg/sandbox_test_rpmsg.c create mode 100644 drivers/rpmsg/virtio_rpmsg_bus.c create mode 100644 include/rpmsg.h create mode 100644 include/rproc_virtio.h create mode 100644 test/dm/rpmsg.c base-commit: 94e7cb181ad6bd25d36a11c58e0df64e9f815888