From patchwork Fri Oct 27 12:41:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Pallardy X-Patchwork-Id: 117308 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp724797qgn; Fri, 27 Oct 2017 05:42:07 -0700 (PDT) X-Google-Smtp-Source: ABhQp+QaPNk0a+AUJmiS1aBbv1zXW4WGORtUFIIjjjEuIshw402RbtD4yREmrMm3Lfnd5YSIinlc X-Received: by 10.98.155.219 with SMTP id e88mr379514pfk.218.1509108126890; Fri, 27 Oct 2017 05:42:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509108126; cv=none; d=google.com; s=arc-20160816; b=n70ZUyp0Rq17c7xMr0XjEzxFe3s6msvf6oAwGJEYCpePv4Dh7phe5a6bKi5gCGzCzL lpKVJNRNgLXqcB9LB/tORtzHqVE95ju/+aIQiZScXup5NPHhOHxkPctp9Ixtomd593nU BYEdDSAZMT4IU1AtBzMhbQqTzsN9coZ0wU0MoRf9EtygqW11KHs6yBnU6WArQGAI6fo2 riyFxN0gfJ8WE9AjSHwUEuAyzGH+eQCHpQfHRjjSTESNNlwAfiH10OfFUvEwePCt5N8s wcwlZmpR8PTPux98rtYtcxO5NnaRC9Sv6M6WQ1cUtaZSWXXnYDRChsv/mPKecoYCW1KJ 8Hyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=kN/Tr8oOHD74FxotV/PdGAO2jvQWRubXjzcxldVojOU=; b=mpI0R7h4/vby0DLNEhMGzkryBrVL/7zh3eg+FIQdOsFhB73Wyiz+wwARWqp7Vl8FXW JDNZYria6z7NTKj86Lrrgk0+d1iU77PTUr7I1Fp8u10nZs1jcv2y+wWTD2OIoijBDpZJ HoZmj559iMQ6kPV3tWQcjvl3Pa9Pa2+WZ1LXRzUYqpdY4SjstGaKZ+RdO/e4l3BKtZrs SlafkL9HczA7EUBwFxUR9Uj2urOQ5T4Gp6pgG6C5zf9QG4yJyJhXXHW9YWiusIytnlRM bc/+qBg2GrFVsLcqNvxzgSgWfqaI4bYqshLzj27EZVNa0+u7UmtkKPv4il+l/IajIl/+ 5N3Q== 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 r8si4349751plo.828.2017.10.27.05.42.06; Fri, 27 Oct 2017 05:42:06 -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 S1752664AbdJ0MmE (ORCPT + 27 others); Fri, 27 Oct 2017 08:42:04 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:33671 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752622AbdJ0Mlx (ORCPT ); Fri, 27 Oct 2017 08:41:53 -0400 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 v9RCdU7n030382; Fri, 27 Oct 2017 14:41:51 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2duapy88n9-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 27 Oct 2017 14:41:51 +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 22AA534; Fri, 27 Oct 2017 12:41:51 +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 ED72A2702; Fri, 27 Oct 2017 12:41:50 +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 Oct 2017 14:41:50 +0200 From: Loic Pallardy To: , CC: , , , Loic Pallardy Subject: [PATCH 2/2] remoteproc: debug: add carveouts list dump feature Date: Fri, 27 Oct 2017 14:41:22 +0200 Message-ID: <1509108082-22201-3-git-send-email-loic.pallardy@st.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1509108082-22201-1-git-send-email-loic.pallardy@st.com> References: <1509108082-22201-1-git-send-email-loic.pallardy@st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.48] X-ClientProxiedBy: SFHDAG4NODE3.st.com (10.75.127.12) To SFHDAG7NODE2.st.com (10.75.127.20) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-10-27_07:, , signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch offers the capability to dump memory carveouts associated to one remoteprocessor. Signed-off-by: Loic Pallardy --- drivers/remoteproc/remoteproc_debugfs.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) -- 1.9.1 diff --git a/drivers/remoteproc/remoteproc_debugfs.c b/drivers/remoteproc/remoteproc_debugfs.c index c1c9f58..982e6a7 100644 --- a/drivers/remoteproc/remoteproc_debugfs.c +++ b/drivers/remoteproc/remoteproc_debugfs.c @@ -252,6 +252,35 @@ static ssize_t rproc_rsc_table_open(struct inode *inode, struct file *file) .release = single_release, }; +/* Expose carveout content via debugfs */ +static int rproc_carveouts_show(struct seq_file *seq, void *p) +{ + struct rproc *rproc = seq->private; + struct rproc_mem_entry *carveout; + + list_for_each_entry(carveout, &rproc->carveouts, node) { + seq_puts(seq, "Carveout memory entry:\n"); + seq_printf(seq, "\tVirtual address: %p\n", carveout->va); + seq_printf(seq, "\tDMA address: %pad\n", &carveout->dma); + seq_printf(seq, "\tDevice address: 0x%x\n", carveout->da); + seq_printf(seq, "\tLength: 0x%x Bytes\n\n", carveout->len); + } + + return 0; +} + +static ssize_t rproc_carveouts_open(struct inode *inode, struct file *file) +{ + return single_open(file, rproc_carveouts_show, inode->i_private); +} + +static const struct file_operations rproc_carveouts_ops = { + .open = rproc_carveouts_open, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, +}; + void rproc_remove_trace_file(struct dentry *tfile) { debugfs_remove(tfile); @@ -297,6 +326,8 @@ void rproc_create_debug_dir(struct rproc *rproc) rproc, &rproc_recovery_ops); debugfs_create_file("resource_table", 0400, rproc->dbg_dir, rproc, &rproc_rsc_table_ops); + debugfs_create_file("carveout_memories", 0400, rproc->dbg_dir, + rproc, &rproc_carveouts_ops); } void __init rproc_init_debugfs(void)