From patchwork Sat Jan 6 00:04:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 123585 Delivered-To: patch@linaro.org Received: by 10.80.135.92 with SMTP id 28csp1420900edv; Fri, 5 Jan 2018 16:07:14 -0800 (PST) X-Google-Smtp-Source: ACJfBouh6bt95jxDHdxwups8V308sZ2apk3qO4R7nV2EuF5y2+vsU0JHgpIGsCRbssI1O4SVZZb0 X-Received: by 10.99.0.216 with SMTP id 207mr3837281pga.192.1515197097825; Fri, 05 Jan 2018 16:04:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515197097; cv=none; d=google.com; s=arc-20160816; b=eJoERh67F0UJAzPkXoyJHgdyzPm7VH6T4QL8fuXky/EfuQdRuyYH4fKlm2OoUlb0IV tTIerGMA8qs4U95Ft8qQbXUcy9dHBcwHSLa+9+MuN2AQfvGDDUzdaJgmoYnKyVKQCbet 2rFwWo33LQxetL/Jll0B0RkHuIEJFdC0o1iTJNPrZ+hKysGOqHtEC42l4hX65aR+CmY1 GWQWP4xkwlcqlXjexYv6SxSiL3howT35+O+od4/FSRQWOTg/jo1yqDibeMPtf6t2y5/5 j+2/mGOQEc7pfOKJoFVnmjy08mJyqnQ83m7CQ03J+JcJ+HwcAz8KHT4rucCdp/qrbF7s XQEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=23QbT2DBKCVsJUzMbv75GiHVpcHYLzXmgv6O+KVWW7k=; b=hxYD5h8UOc8rcdAblR4BOATiDsZKhK7o5H00TjOjG12Yk/xUjrplTNSjs/qJF4RXhL Dv0bawYoPA40W8suVj7gghkHlirg6Qd/97M7OfKKZM0WR4Rd7pWdHQHUsV4ZIGW8jc/r aTZHc2vAKHw0GTKfP+Jmxoj0VydidTlJjA46MyUWyahDjubPmhkXJw6KdlctHg9x0buA A/2l6NmvtAFrmlmbYmVqvck6nF8UeKUMI9k+F7mll9E+ILo/28FW5M91WD5WhCwmr8xe egxLGKDyZrDr4VQHC1Al23uAjRMAypP9xWmN2o6VR516L5N5yli2tUGRsasSpbF++4bo zWaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=afMh0pVe; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x1si4762712pfj.295.2018.01.05.16.04.55; Fri, 05 Jan 2018 16:04:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=afMh0pVe; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753463AbeAFAEb (ORCPT + 10 others); Fri, 5 Jan 2018 19:04:31 -0500 Received: from mail-pl0-f65.google.com ([209.85.160.65]:42358 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753393AbeAFAE1 (ORCPT ); Fri, 5 Jan 2018 19:04:27 -0500 Received: by mail-pl0-f65.google.com with SMTP id bd8so3992010plb.9 for ; Fri, 05 Jan 2018 16:04:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=iofOirkLKA0Lu5kMv0lzYQT1jsJL1xNOvOzWNVrugIY=; b=afMh0pVe7j/Ig/OdEbMDtHKQ3Kfy/7jF0FLSRekhi48EqleXajhioScvCYqR4MUX8Z KCWYvE0Fj39AoC62+dxzh0rdqqxAmClzyINFdBW6H0HivKfHAKRfLYtjWdHEOTxDP+DH 7fwBlmYdighu5thTz8X/YwDaEKIzoasarW9ug= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=iofOirkLKA0Lu5kMv0lzYQT1jsJL1xNOvOzWNVrugIY=; b=XPzaixjAaxI3PfUBLw3VSWTEkoVqH/tRnKXczZouDJTq094YMDgtUZEZnbgFwWZQFV NUZVG+bV+A3eCxQro0kJlQyzFtWcH/28I+Y5+XZSlF5eEIPtYys1QDae1pJSkb0B4shq QxQAj8zKaZ6vWF/Urvy3IM7qbbI5bnzezSN7vYeABg3GzdyXdbULdGEBP4lRFRVbU9hW cnVGvfoCDWW5/j1pV1XzFSU2LJ75KF3S/Vv+FCRS3qwKrt8U1USy4r3EFtqMIckZXa7E ZmsINYqW0rHi8NclCPnx9/ZEG/l6WTW1IyvuPJSo5liCIrfV4eR5asokqTAKg+qeT5pD TPyw== X-Gm-Message-State: AKGB3mLJ5xAMYrZ4V7gDfqrqaTLpIedha/J70kNylsXSHXkRt2YtHQDk M0fxjIGjysB2632KofajQd/fog== X-Received: by 10.159.218.67 with SMTP id x3mr4797070plv.45.1515197066391; Fri, 05 Jan 2018 16:04:26 -0800 (PST) Received: from localhost.localdomain (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id n186sm9385177pgn.11.2018.01.05.16.04.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Jan 2018 16:04:25 -0800 (PST) From: Bjorn Andersson To: Ohad Ben-Cohen , Bjorn Andersson Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, Suman Anna , Avaneesh Kumar Dwivedi , Loic Pallardy Subject: [PATCH v3 2/4] remoteproc: Rename "load_rsc_table" to "parse_fw" Date: Fri, 5 Jan 2018 16:04:18 -0800 Message-Id: <20180106000420.10070-3-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20180106000420.10070-1-bjorn.andersson@linaro.org> References: <20180106000420.10070-1-bjorn.andersson@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The resource table is just one possible source of information that can be extracted from the firmware file. Generalize this interface to allow drivers to override this with parsers of other types of information. Signed-off-by: Bjorn Andersson --- Changes since v2: - Improved comment by call to rproc_parse_fw Changes since v1: - New patch drivers/remoteproc/remoteproc_core.c | 6 +++--- drivers/remoteproc/remoteproc_internal.h | 7 +++---- include/linux/remoteproc.h | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) -- 2.15.0 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index 5af7547b9d8d..fd257607a578 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -944,8 +944,8 @@ static int rproc_fw_boot(struct rproc *rproc, const struct firmware *fw) rproc->bootaddr = rproc_get_boot_addr(rproc, fw); - /* load resource table */ - ret = rproc_load_rsc_table(rproc, fw); + /* Load resource table, core dump segment list etc from the firmware */ + ret = rproc_parse_fw(rproc, fw); if (ret) goto disable_iommu; @@ -1555,7 +1555,7 @@ struct rproc *rproc_alloc(struct device *dev, const char *name, /* Default to ELF loader if no load function is specified */ if (!rproc->ops->load) { rproc->ops->load = rproc_elf_load_segments; - rproc->ops->load_rsc_table = rproc_elf_load_rsc_table; + rproc->ops->parse_fw = rproc_elf_load_rsc_table; rproc->ops->find_loaded_rsc_table = rproc_elf_find_loaded_rsc_table; rproc->ops->sanity_check = rproc_elf_sanity_check; rproc->ops->get_boot_addr = rproc_elf_get_boot_addr; diff --git a/drivers/remoteproc/remoteproc_internal.h b/drivers/remoteproc/remoteproc_internal.h index 55a2950c5cb7..7570beb035b5 100644 --- a/drivers/remoteproc/remoteproc_internal.h +++ b/drivers/remoteproc/remoteproc_internal.h @@ -88,11 +88,10 @@ int rproc_load_segments(struct rproc *rproc, const struct firmware *fw) return -EINVAL; } -static inline int rproc_load_rsc_table(struct rproc *rproc, - const struct firmware *fw) +static inline int rproc_parse_fw(struct rproc *rproc, const struct firmware *fw) { - if (rproc->ops->load_rsc_table) - return rproc->ops->load_rsc_table(rproc, fw); + if (rproc->ops->parse_fw) + return rproc->ops->parse_fw(rproc, fw); return 0; } diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h index b60c3a31b75d..f16864acedad 100644 --- a/include/linux/remoteproc.h +++ b/include/linux/remoteproc.h @@ -344,7 +344,7 @@ struct rproc_ops { int (*stop)(struct rproc *rproc); void (*kick)(struct rproc *rproc, int vqid); void * (*da_to_va)(struct rproc *rproc, u64 da, int len); - int (*load_rsc_table)(struct rproc *rproc, const struct firmware *fw); + int (*parse_fw)(struct rproc *rproc, const struct firmware *fw); struct resource_table *(*find_loaded_rsc_table)( struct rproc *rproc, const struct firmware *fw); int (*load)(struct rproc *rproc, const struct firmware *fw);