Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp1180138pxb; Fri, 1 Oct 2021 05:24:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfSNnLmpJnNOXWkPdeo0ctl9JZmWQKMB7s2OYlU67iQTGZFz8y5uvSRNTFRsZdkWnqwcdR X-Received: by 2002:a05:6a00:2405:b0:3e1:9f65:9703 with SMTP id z5-20020a056a00240500b003e19f659703mr9886789pfh.6.1633091074671; Fri, 01 Oct 2021 05:24:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633091074; cv=none; d=google.com; s=arc-20160816; b=gMMxIcMBbP14Y4Z/LCBd4Ix+L/NCEzj8rBuaYcfsF933KVE1ojQUToHPmuExisR/tA pifR0g3Q725Xy2IB41SWMg4Gc/XrhGn6Fwbe1Hq6AoQiAPi96aRyifkgJGc1/Dii4Xou N4TrAe56lJgco3zhGTHPeIesU9Gdw3Ot67ckzVIyyQADWcUdXcdpdG034r5s/ZTLeL7X A5iNrcRnpMtGGmaKg9gW2yn5J7UGZX3aTVeBtoNE/2WbnKMKeag+DkU0e8cuYR7zmYNS H7PHAsWY4TvAjuttKrX2xqBDGmme1kaHbIrQsTyziBwdU1DA0muANH8BenUgSUehVMRE LvGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=/LjfXOmKXk+IaitYDOXv8APKqHjvEbNKq7xnKRqVamg=; b=PrzDQty7j6WQVICEAHQmCq7DKHX/yb4pAOqKBth4WKdVCXhg0TGiq1MZiEORJo4keB nMYaUZ6g/diJImYq0YvcH7roLI8/DdQuAlAuJZe2gSNTQII3T6otuDGyfIOwA5ewV6sn y2UF6vuqH/AopHK1JKZ8XCrBJlHvq4zgNUNDCJBBdf20lI9iGVCGwNHzfQdqZwvFhbhl YHxXzkxmESuFsl3rvNeqYEpUYMjhf/mFj8/Dz7pWdRmWXT6jFjQI+nH34601UrYbok1a AEEbEtF3zdUuyNdtOpWMt3hlvZvb9vi9IH1KfqlC6wx+uc30aso2cNsAL6PeQkLLdBT9 Tw2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=hsZe6d0Y; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nh12si8526183pjb.121.2021.10.01.05.24.11; Fri, 01 Oct 2021 05:24:34 -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=@foss.st.com header.s=selector1 header.b=hsZe6d0Y; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353452AbhJAKOg (ORCPT + 99 others); Fri, 1 Oct 2021 06:14:36 -0400 Received: from mx07-00178001.pphosted.com ([185.132.182.106]:45660 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353235AbhJAKOf (ORCPT ); Fri, 1 Oct 2021 06:14:35 -0400 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19187LnB030509; Fri, 1 Oct 2021 12:12:45 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=selector1; bh=/LjfXOmKXk+IaitYDOXv8APKqHjvEbNKq7xnKRqVamg=; b=hsZe6d0YU8hqw710UUVLzsYb3ReGh7pfXKxiY5eOnjOk8JNj+Zsp6OyLfCUlXWRLSgG4 TapsD0E7XgiL789Jh40QyAyk8DBU+tgK2qgLt8taYnMSf5CFEYmXi/7shMPA5kv7LBYi dyo7PE4XCOWJTJCGhCPdnMQ8Nzh4Tks8+MGeduSkAtGNCJSPkrXxFbUmczxTkwjsu9aY keW6o1tm74qeG9OsHme2PGbkDYC3cBKVur4Dap7OpWoTFjQ83jLh8lMPLIEvkDImR31z P2lRqBu2GjoxXOzsN/5+b7oJlrgS0lPYm+yUBMQEdSSjCULtfp22fNkIswNaENVAlR6H Fw== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 3bds9njb4t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 01 Oct 2021 12:12:45 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 01A6410002A; Fri, 1 Oct 2021 12:12:43 +0200 (CEST) Received: from Webmail-eu.st.com (sfhdag2node2.st.com [10.75.127.5]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id E657F226FDD; Fri, 1 Oct 2021 12:12:43 +0200 (CEST) Received: from localhost (10.75.127.51) by SFHDAG2NODE2.st.com (10.75.127.5) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Fri, 1 Oct 2021 12:12:43 +0200 From: Arnaud Pouliquen To: Bjorn Andersson , Ohad Ben-Cohen , Mathieu Poirier CC: , , , Rob Herring , Christoph Hellwig , Stefano Stabellini , Bruce Ashfield , Subject: [RFC PATCH 0/7] remoteproc: restructure the remoteproc VirtIO device Date: Fri, 1 Oct 2021 12:12:27 +0200 Message-ID: <20211001101234.4247-1-arnaud.pouliquen@foss.st.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.75.127.51] X-ClientProxiedBy: SFHDAG2NODE1.st.com (10.75.127.4) To SFHDAG2NODE2.st.com (10.75.127.5) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.391,FMLib:17.0.607.475 definitions=2021-10-01_01,2021-09-30_01,2020-04-07_01 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series is a part of the work initiate a long time ago in the series "remoteproc: Decorelate virtio from core"[1] Objective of the work: - Update the remoteproc VirtIO device creation (use platform device) - Allow to declare remoteproc VirtIO device in DT - declare resources associated to a remote proc VirtIO - declare a list of VirtIO supported by the platform. - Prepare the enhancement to more VirtIO devices (e.g audio, video, ...) - Keep the legacy working! - Try to improve the picture about concerns reported by Christoph Hellwing [2][3] [1] https://lkml.org/lkml/2020/4/16/1817 [2] https://lkml.org/lkml/2021/6/23/607 [3] https://patchwork.kernel.org/project/linux-remoteproc/patch/AOKowLclCbOCKxyiJ71WeNyuAAj2q8EUtxrXbyky5E@cp7-web-042.plabs.ch/ In term of device tree this would result in such hiearchy (stm32mp1 example with 2 virtio RPMSG): m4_rproc: m4@10000000 { compatible = "st,stm32mp1-m4"; reg = <0x10000000 0x40000>, <0x30000000 0x40000>, <0x38000000 0x10000>; memory-region = <&retram>, <&mcuram>,<&mcuram2>; mboxes = <&ipcc 2>, <&ipcc 3>; mbox-names = "shutdown", "detach"; status = "okay"; #address-cells = <1>; #size-cells = <0>; vdev@0 { compatible = "rproc-virtio"; reg = <0>; virtio,id = <7>; /* RPMSG */ memory-region = <&vdev0vring0>, <&vdev0vring1>, <&vdev0buffer>; mboxes = <&ipcc 0>, <&ipcc 1>; mbox-names = "vq0", "vq1"; status = "okay"; }; vdev@1 { compatible = "rproc-virtio"; reg = <1>; virtio,id = <7>; /*RPMSG */ memory-region = <&vdev1vring0>, <&vdev1vring1>, <&vdev1buffer>; mboxes = <&ipcc 4>, <&ipcc 5>; mbox-names = "vq0", "vq1"; status = "okay"; }; }; I have divided the work in 4 steps to simplify the review, This series implements only the step 1: step 1: redefine the remoteproc VirtIO device as a platform device - migrate rvdev management in remoteproc virtio.c, - create a remotproc virtio config ( can be disabled for platform that not use VirtIO IPC. step 2: add possibility to declare and prob a VirtIO sub node - VirtIO bindings declaration, - multi DT VirtIO devices support, - introduction of a remote proc virtio bind device mechanism , => https://github.com/arnopo/linux/commits/step2-virtio-in-DT step 3: Add memory declaration in VirtIO subnode => https://github.com/arnopo/linux/commits/step3-virtio-memories step 4: Add mailbox declaration in VirtIO subnode => https://github.com/arnopo/linux/commits/step4-virtio-mailboxes Arnaud Pouliquen (7): remoteproc: core: Introduce virtio device add/remove functions remoteproc: Move rvdev management in rproc_virtio remoteproc: Remove vdev_to_rvdev and vdev_to_rproc from remoteproc API remoteproc: create the REMOTEPROC_VIRTIO config remoteproc: virtio: Create platform device for the remoteproc_virtio remoteproc: virtio: Add helper to create platform device remoteproc: Instantiate the new remoteproc virtio platform device drivers/remoteproc/Kconfig | 11 +- drivers/remoteproc/Makefile | 2 +- drivers/remoteproc/remoteproc_core.c | 142 +++------------- drivers/remoteproc/remoteproc_internal.h | 52 +++++- drivers/remoteproc/remoteproc_virtio.c | 207 +++++++++++++++++++++-- include/linux/remoteproc.h | 18 +- 6 files changed, 282 insertions(+), 150 deletions(-) -- 2.17.1