Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp793617imm; Fri, 27 Jul 2018 06:17:04 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeXf0wCIpXwa9B0P5hIfzbhii61DJbCE/6qYQ28eIe6o4xmOtQ5gQf6knuwRe6K2Z+R1/BX X-Received: by 2002:a17:902:9883:: with SMTP id s3-v6mr6038775plp.194.1532697424088; Fri, 27 Jul 2018 06:17:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532697424; cv=none; d=google.com; s=arc-20160816; b=nEtiiUpO3lOshC0GpFZPV/Xok1Djbn5SRsJmp0/6DUUMUx0QVcNFiSSiIwc8uGR+uV WZh59NRSCsMF7UMu8qM016BrrZKlKvFkwcPnEb5dMIuc6qoGKxU25XZgFCyudO0tIpMR crnslRpE/rQFsXcEBDY/zo7LXp66b96H7GDmUOm91U+k3wtsElCha+b//qMW7i1TUAys galHAwrXpA0piu20+AHY1tkabAmsePoI7tPImn6QSSKA1/8NBj8tiw8Y7FitJdSlqgio pNW4apBCP/kqoZizJdBV1P7jw8T0gBNsmXDt4lV/SA6Z344QWleook2vet5eSEdlGA1n ZHnA== ARC-Message-Signature: i=1; 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:arc-authentication-results; bh=xr1y6DOXjK750XRV1jhbmtH8328W4fhHlkSSRL/xY+k=; b=nsFKPQAjQw7DQBWYZFIRDtXhCq9lAokgDUr771OfI7G4jZJgEdy996np6s4gmBfYiE +qVELiI3h8nt8qHjH8X1eZ20/9vAop1cQ1R7ldvpb4wiNPPojoiZ7G4IiE6n/MJHCg1t cjzaRfuljYcRLOOrqKa9MHiq4t2+NQCLziSZy6uHurVvehBzjzCI7G3qVJBiMClgs2xX MNJiszRHv29bqqlfM82eQrIkye0SXEt3/K5dnQxGVwTfLJmIr33hnTXhFLa1xYC9MheO +xHIiNiVjTlICxgAJIqr+9EDO2fJEdFkoItplPy4Q2b8choeLBfvTXPydpRMu92PvO0k zj9w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h90-v6si3472453plb.484.2018.07.27.06.16.49; Fri, 27 Jul 2018 06:17:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732144AbeG0OhM (ORCPT + 99 others); Fri, 27 Jul 2018 10:37:12 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:22460 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730395AbeG0OhM (ORCPT ); Fri, 27 Jul 2018 10:37:12 -0400 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w6RDE7MR020140; Fri, 27 Jul 2018 15:15:14 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2kg25fgjt7-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 27 Jul 2018 15:15:14 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 44F7631; Fri, 27 Jul 2018 13:15:13 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag7node2.st.com [10.75.127.20]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 21658577A; Fri, 27 Jul 2018 13:15:13 +0000 (GMT) Received: from localhost (10.75.127.48) by SFHDAG7NODE2.st.com (10.75.127.20) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 27 Jul 2018 15:15:12 +0200 From: Loic Pallardy To: , CC: , , , , , Loic Pallardy Subject: [PATCH v4 00/17] remoteproc: add fixed memory region support Date: Fri, 27 Jul 2018 15:14:35 +0200 Message-ID: <1532697292-14272-1-git-send-email-loic.pallardy@st.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.75.127.48] X-ClientProxiedBy: SFHDAG8NODE3.st.com (10.75.127.24) To SFHDAG7NODE2.st.com (10.75.127.20) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-07-27_06:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The aim of the series is to implement carveout memory management as discussed during OpenAMP weekly call and defined in proposed document [1] This first series focus only on adding support of the different types of carveout memories (dynamic, fixed, platform driver depend...). 64bit resource table will be addressed in a next series. Cent [1]: http://openamp.github.io/docs/mca/coprocessor-memory-definition-v6.pdf --- Changes since V3: - Rebase on top of Bjorn remoteproc next git (3d065621c921) - Apply on top of "remoteproc: replace "%p" with "%pK"" [2] - Lot of changes to centralize carveout allocation before rproc_start() - Remove prepare/unprepare ops and rely on parse_fw instead of - Add possibility to assign reserved memory region to vdev device - Adapt TI da8xx and keystone remoteproc driver As V3 series, V4 series takes some assumptions for carveout names associated to vdev: - For vring: "vdev%xvring%x" with vdev index from resource table and vring index in vdev. - For vdev buffer: "vdev%xbuffer" with vdev index from resource table [2] https://patchwork.kernel.org/patch/10511599 Changes since V2: Reshuffle the series to: - Take into account Bjorn's comments. - Add patch to check consistency between carveout resource request and IOMMU support. - Introduce platform specific prepare and unprepare ops to enable HW like clock, bus, regulator, memory region... before loading co-processor firmware. - Rely on memory carveout management for all remoteproc memory allocations. - Lookup pre-registered carveout by name first. - Create a subdevice for each vdev declared in firmware resource table that will be used by virtio based driver to retrieve specific memory pool. This series takes some assumptions for carveout names associated to vdev: - For vring: "vdev%xvring%x" with vdev index from resource table and vring index in vdev. - For vdev buffer: "vdev%xbuffer" with vdev index from resource table This will be changed in the future, adding names field in vdev resource in next resource table version. Changes since V1: - Minor corrections on first 7 patches (error management) - Add "memory device" support on the top of first 7 patches. Goal is to answer use case reported during OpenAMP weekly discussion: - "Be able to specify memory region for vring and buffer allocation, even if no specific request defined in firmware resource table." Patches offer the capability to create a "memory device" associated to a carveout with a dedicated DMA memory pool. Different resource handlers are modified to look-up for specific carveout by name. If match found and associated "memory device" present, device is used instead of rproc platform device for allocation. Loic Pallardy (17): remoteproc: configure IOMMU only if device address requested remoteproc: add rproc_va_to_pa function remoteproc: add release ops in rproc_mem_entry struct remoteproc: add name in rproc_mem_entry struct remoteproc: add helper function to allocate and init rproc_mem_entry struct remoteproc: introduce rproc_add_carveout function remoteproc: introduce rproc_find_carveout_by_name function remoteproc: add alloc ops in rproc_mem_entry struct remoteproc: add helper function to allocate rproc_mem_entry from reserved memory remoteproc: add helper function to check carveout device address remoteproc: modify rproc_handle_carveout to support pre-registered region remoteproc: modify vring allocation to rely on centralized carveout allocator remoteproc: create vdev subdevice with specific dma memory pool remoteproc: keystone: declare reserved memory region for vdev device remoteproc: da8xx: declare reserved memory region for vdev device remoteproc: st: add reserved memory support rpmsg: virtio: allocate buffer from parent drivers/remoteproc/da8xx_remoteproc.c | 38 ++ drivers/remoteproc/keystone_remoteproc.c | 53 ++- drivers/remoteproc/remoteproc_core.c | 572 +++++++++++++++++++++++++------ drivers/remoteproc/remoteproc_debugfs.c | 1 + drivers/remoteproc/remoteproc_internal.h | 3 + drivers/remoteproc/remoteproc_virtio.c | 56 ++- drivers/remoteproc/st_remoteproc.c | 96 +++++- drivers/rpmsg/virtio_rpmsg_bus.c | 6 +- include/linux/remoteproc.h | 35 +- 9 files changed, 728 insertions(+), 132 deletions(-) -- 1.9.1