From patchwork Tue Dec 26 20:38:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 10133261 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DC9D76023A for ; Tue, 26 Dec 2017 20:39:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CFC7D2D275 for ; Tue, 26 Dec 2017 20:39:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C50442D295; Tue, 26 Dec 2017 20:39:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 782C52D275 for ; Tue, 26 Dec 2017 20:39:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751422AbdLZUjQ (ORCPT ); Tue, 26 Dec 2017 15:39:16 -0500 Received: from mail-pl0-f65.google.com ([209.85.160.65]:35883 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751320AbdLZUii (ORCPT ); Tue, 26 Dec 2017 15:38:38 -0500 Received: by mail-pl0-f65.google.com with SMTP id b12so18360729plm.3 for ; Tue, 26 Dec 2017 12:38:38 -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=afH9QSJQWjrL+EdaLzO9his85vlbQcXic6kkHaMxPv0=; b=h9Q928/F3ggMQ2E/ZmaW4AWO1dto5PjUDAE0owLeMpNumGTQ8dhITyIOgAPPkuobKT /qd9hA4JgH3OsjeOvns8vyM8xXuAriaruUoJh8oXP3Gw36ayvF3GB6wuVirdmWkDIopI kAuJMxWRAcdpj3y3zyYpbxsyL/2+fCSbtNpb0= 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=afH9QSJQWjrL+EdaLzO9his85vlbQcXic6kkHaMxPv0=; b=Pk9qVAMyNs+CkDDN6W0NF/2+sKTAyxIlAw9F1TinWuZDzmBaUuztzSq0z6FHwYgHti Q8RnPMsnecoBsUVMh9BLRyFcu4F5Iu/9IhyRI1EoVdyi3quM7fveblxwVlWL+Evfzpxz +LepjJnXHdR+kw3bF+Gpyag9xGHQuf8eOM2RCS6yGdyR40v/BSZ3OjgWR7dY0/l7li0E FGm43J06iZws/i+9OV5FCS8nVxSndDVCPCc1kt/y/eH3fMHQyigQROY97GxwC20GsuQw ndL+yZCG0Fb7kL5dAKwiu690U6ddIgnWbcZOFDj+sHwWkmQwGILET8uCkaIm3x9KoQ5B kdRw== X-Gm-Message-State: AKGB3mLsH02x3VyTKXG11IBsheusW0jGeJmXxeJkdcBoma1Mkw6JCzAv R7z/wmCDXRDgFbVGo5c5bZhhOA== X-Google-Smtp-Source: ACJfBosvp3aoE1K2avNLimdDWsoGdJ2wL23uOs/phH5ps7HQKFc5AxDTiGt0OY9nNaJS91pvPC0g/w== X-Received: by 10.159.206.139 with SMTP id bg11mr25892419plb.216.1514320718248; Tue, 26 Dec 2017 12:38:38 -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 68sm58746339pfx.186.2017.12.26.12.38.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Dec 2017 12:38:37 -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 Subject: [PATCH v2 2/4] remoteproc: Rename "load_rsc_table" to "parse_fw" Date: Tue, 26 Dec 2017 12:38:30 -0800 Message-Id: <20171226203832.14928-3-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171226203832.14928-1-bjorn.andersson@linaro.org> References: <20171226203832.14928-1-bjorn.andersson@linaro.org> Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 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(-) diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index 5af7547b9d8d..6a72daa94673 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); + /* parse firmware resources */ + 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 de6e20a3f061..dc93ac3d1692 100644 --- a/include/linux/remoteproc.h +++ b/include/linux/remoteproc.h @@ -343,7 +343,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);