Received: by 10.223.185.116 with SMTP id b49csp7631575wrg; Thu, 1 Mar 2018 08:30:30 -0800 (PST) X-Google-Smtp-Source: AG47ELv551QPMw/BAzJ2//S2RrYrb8pU3xHj3yBAZXSx6IGROWToG4O4J2Ckjlq/gIHEKAQUfZkP X-Received: by 2002:a17:902:5482:: with SMTP id e2-v6mr2434157pli.65.1519921830568; Thu, 01 Mar 2018 08:30:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519921830; cv=none; d=google.com; s=arc-20160816; b=ByEqMBscCQQs3JhXqBZ23y1hzewrC2gDGXXjzRGyg6TlbRyuisrnaesX8DAlDWdvPA hj3GV21wqSde5uXV/yl23NAMsaPsIZfBgBVb+UI4SC98cyKFswE4v0IJLDd30HQRj2CA e1FtduHqM2AZVy3Ds6yJKa63L3fQwFu9umHzyW0qjoZAhsFF+nxsX2mqFXh6shr7lPTq 6pUwrP0KPtw+4q+ePQETuovOF7U8cbGN03yvg46hXNt2+bDuGnPjGEwclXXNg0fd6C+p LwyEIa1Ibb/358Cy9ImUl/umiwVth/qcftiZTZRD2pWbRyjasrtOiUgYr2Y4+79SKk6m vHwA== 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=PcrX3ALbhuG4TMHrJZLwGHN1Xaa+Io3nj405jG3avtw=; b=ygVkDiYqw60WBrFAr801OU/wZJRWoeWkcyKAzkIOsR+5n8uHl0aF8hFr+IUper4Ipg kKaIN587luaSU/6zvVi3Poy8vhSXxQjo0QSlOrnxripfUwh90osmIKkbw8lGHaTanb8K lyxNP84U9hgl2HCy7CgSfQu3XGUWTO/Lw+UYbucM7G2/bT2xx0eQ0pO1qwJ7oQt9CuXg k7KqGvaF4X3fdVJHnUG6AFNT2JxlNrOZ1bNfftrh9ZpfJCHyGhpmO4UMufTYK3za13sS wijW+ctYIW5Rc0DwbFkYGWNgSb8OhDl74ZgvS1AS3LwkNwHPsFtPN5p0En9FKLnfT7rv m2hA== 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 p184si2642615pga.700.2018.03.01.08.30.15; Thu, 01 Mar 2018 08:30:30 -0800 (PST) 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 S1033063AbeCAQ3C (ORCPT + 99 others); Thu, 1 Mar 2018 11:29:02 -0500 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:43959 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1032934AbeCAQYN (ORCPT ); Thu, 1 Mar 2018 11:24:13 -0500 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w21GJM2s002400; Thu, 1 Mar 2018 17:24:11 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2gaytjb7jm-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 01 Mar 2018 17:24:11 +0100 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 A7F8734; Thu, 1 Mar 2018 16:24:09 +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 8DAE051FC; Thu, 1 Mar 2018 16:24:09 +0000 (GMT) Received: from localhost (10.75.127.49) by SFHDAG7NODE2.st.com (10.75.127.20) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Thu, 1 Mar 2018 17:24:08 +0100 From: Loic Pallardy To: , CC: , , , , Loic Pallardy Subject: [PATCH v3 00/13] remoteproc: add fixed memory region support Date: Thu, 1 Mar 2018 17:23:47 +0100 Message-ID: <1519921440-21356-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.49] X-ClientProxiedBy: SFHDAG6NODE1.st.com (10.75.127.16) To SFHDAG7NODE2.st.com (10.75.127.20) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-03-01_08:,, 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. [1]: http://openamp.github.io/docs/mca/coprocessor-memory-definition-v6.pdf --- Changes sine 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 (13): 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 prepare and unprepare ops remoteproc: modify rproc_handle_carveout to support pre-registered region remoteproc: modify vring allocation to support pre-registered region remoteproc: create vdev subdevice with specific dma memory pool rpmsg: virtio: allocate buffer from parent remoteproc: st: add reserved memory support drivers/remoteproc/remoteproc_core.c | 332 ++++++++++++++++++++++++++++---- drivers/remoteproc/remoteproc_debugfs.c | 1 + drivers/remoteproc/remoteproc_virtio.c | 2 +- drivers/remoteproc/st_remoteproc.c | 68 ++++++- drivers/rpmsg/virtio_rpmsg_bus.c | 2 +- include/linux/remoteproc.h | 22 ++- 6 files changed, 379 insertions(+), 48 deletions(-) -- 1.9.1