From patchwork Thu Mar 1 16:23:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Pallardy X-Patchwork-Id: 130336 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp3009226edc; Thu, 1 Mar 2018 08:29:05 -0800 (PST) X-Google-Smtp-Source: AG47ELs6QLB2OLb9oPflfO1Fig3pB+CzQI+kfRqpyZL351yusbm/SThj17V1NxqhxolgoSIdp3Z4 X-Received: by 10.98.35.195 with SMTP id q64mr2471765pfj.161.1519921745745; Thu, 01 Mar 2018 08:29:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519921745; cv=none; d=google.com; s=arc-20160816; b=uC7uTjNzzrZO2BB+V682Hj+stX1o6M5EQHD8kpFzxZ2O9uG16E8hiKTZrxpFYhm1yg KvUK70TMqAiKeXcGQPC+CDBU1l5PtkDA2WRuytJR5gWZjQ5OK2PfIlMkUgZhK0xVnGah lywbl8hf4k+X+9ySjLz1as4/flTSYvs2LaZXWFVtB4fVet/zjrQi0lVII4G3Hx2j2YpB yYV+0ToctTcOPANHzIv5QPxgptEqws5gRBhWmBj8Gs8un05CpmVlCxpAK9s1Y8jSQYSV acAp1VeLiPPxJgiVvZvbvcHVJRG7mBw1bRjTj4l/CxLECRHpV+ehQv1xAr9wGaUMTmpQ skHQ== 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 i124si1895073pgd.576.2018.03.01.08.29.05; Thu, 01 Mar 2018 08:29:05 -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 S1033105AbeCAQ3C (ORCPT + 28 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 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