From patchwork Mon Jan 30 17:26:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 9546327 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 194F760453 for ; Tue, 31 Jan 2017 01:25:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0CDF82818B for ; Tue, 31 Jan 2017 01:25:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 01BE4281D2; Tue, 31 Jan 2017 01:25:37 +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=-4.7 required=2.0 tests=BAYES_00, DATE_IN_PAST_06_12, DKIM_SIGNED,RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_SPAM,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 73DC32818B for ; Tue, 31 Jan 2017 01:25:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754651AbdAaBZh (ORCPT ); Mon, 30 Jan 2017 20:25:37 -0500 Received: from mail-it0-f48.google.com ([209.85.214.48]:36960 "EHLO mail-it0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753726AbdAaBZW (ORCPT ); Mon, 30 Jan 2017 20:25:22 -0500 Received: by mail-it0-f48.google.com with SMTP id r185so115414318ita.0 for ; Mon, 30 Jan 2017 17:25:15 -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; bh=2EBlsMr8Cp8MJgGPfSayrZanppAthdCpf4NxwEjGf0E=; b=QJ9NxdNDdPBrJcoi5vOMdcINJQUbvauI4B7+aVK+nXLweh5NU2gyb4u3amDozBZSyZ nOmzw5ZliI4gSNtFmj4MX4UTXt8oIdtYj9nwoXvoY79xWsNOD9M0yZlhtySatfC0qXns VECwrmvEOhbGyLTx7x1yPcWj7f4WJ+mgyiYRI= 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; bh=2EBlsMr8Cp8MJgGPfSayrZanppAthdCpf4NxwEjGf0E=; b=YXTEkTECZfI70Q8dBVPmcYTcVeIHaZWZubeA8maE+5BBN4CsD3CwTbAifm5wNJflS5 FhE/rzQzHo9Pwzoq34oGJukKuSj0/wGh36poz2Pvj829sSd7QMyrjaF4bdFYH7tvAMhr 3TFpqYw26e3RWjAaN9C/Sz2Sz2vUoy9wpeVpFA27fcEQMFXiSPGGs8ooGye9VwN3TZKK iYC4f8m1t6/Lmz0+TcDDoh6sXe2kNQkyv/sdyHPTzvPdEctTG7166TFF5vSIf9L8qTIb GAINNWJyr+IApEVjWevqmRuxZrbeAqHQURCID/kwuetGo5HAJBAC51NVxVHj29XiC4m2 sdNg== X-Gm-Message-State: AIkVDXJPiU8wrg0lSpPJbSv6ETdP5p/7C6MZJwNyCQvpuicoxQph6RFT0FvZIKEilRrTbALs X-Received: by 10.99.188.10 with SMTP id q10mr27188675pge.106.1485825914473; Mon, 30 Jan 2017 17:25:14 -0800 (PST) Received: from localhost.localdomain (ip68-111-223-48.sd.sd.cox.net. [68.111.223.48]) by smtp.gmail.com with ESMTPSA id q64sm19436198pga.0.2017.01.30.17.25.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Jan 2017 17:25:13 -0800 (PST) From: Bjorn Andersson To: Ohad Ben-Cohen , Bjorn Andersson Cc: linux-kernel@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [PATCH 1/3] remoteproc: qcom-common: Extract non-mdt related helper Date: Mon, 30 Jan 2017 09:26:21 -0800 Message-Id: <20170130172623.4894-1-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.11.0 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 In preparation for moving the mdt loader out of remoteproc let's move the somewhat unrelated resource table dummy helper to a Qualcomm "common" file. Signed-off-by: Bjorn Andersson --- drivers/remoteproc/Kconfig | 6 +++++ drivers/remoteproc/Makefile | 1 + drivers/remoteproc/qcom_adsp_pil.c | 1 + drivers/remoteproc/qcom_common.c | 46 ++++++++++++++++++++++++++++++++++++ drivers/remoteproc/qcom_common.h | 11 +++++++++ drivers/remoteproc/qcom_mdt_loader.c | 19 --------------- drivers/remoteproc/qcom_mdt_loader.h | 1 - drivers/remoteproc/qcom_q6v5_pil.c | 1 + drivers/remoteproc/qcom_wcnss.c | 1 + 9 files changed, 67 insertions(+), 20 deletions(-) create mode 100644 drivers/remoteproc/qcom_common.c create mode 100644 drivers/remoteproc/qcom_common.h diff --git a/drivers/remoteproc/Kconfig b/drivers/remoteproc/Kconfig index a5e888043f1f..14e57b3e86dc 100644 --- a/drivers/remoteproc/Kconfig +++ b/drivers/remoteproc/Kconfig @@ -78,11 +78,15 @@ config QCOM_ADSP_PIL depends on QCOM_SMEM select MFD_SYSCON select QCOM_MDT_LOADER + select QCOM_RPROC_COMMON select QCOM_SCM help Say y here to support the TrustZone based Peripherial Image Loader for the Qualcomm ADSP remote processors. +config QCOM_RPROC_COMMON + tristate + config QCOM_MDT_LOADER tristate @@ -93,6 +97,7 @@ config QCOM_Q6V5_PIL depends on REMOTEPROC select MFD_SYSCON select QCOM_MDT_LOADER + select QCOM_RPROC_COMMON select QCOM_SCM help Say y here to support the Qualcomm Peripherial Image Loader for the @@ -105,6 +110,7 @@ config QCOM_WCNSS_PIL depends on QCOM_SMEM depends on REMOTEPROC select QCOM_MDT_LOADER + select QCOM_RPROC_COMMON select QCOM_SCM help Say y here to support the Peripheral Image Loader for the Qualcomm diff --git a/drivers/remoteproc/Makefile b/drivers/remoteproc/Makefile index 0938ea3c41ba..d4f9525a226d 100644 --- a/drivers/remoteproc/Makefile +++ b/drivers/remoteproc/Makefile @@ -13,6 +13,7 @@ obj-$(CONFIG_WKUP_M3_RPROC) += wkup_m3_rproc.o obj-$(CONFIG_DA8XX_REMOTEPROC) += da8xx_remoteproc.o obj-$(CONFIG_QCOM_ADSP_PIL) += qcom_adsp_pil.o obj-$(CONFIG_QCOM_MDT_LOADER) += qcom_mdt_loader.o +obj-$(CONFIG_QCOM_RPROC_COMMON) += qcom_common.o obj-$(CONFIG_QCOM_Q6V5_PIL) += qcom_q6v5_pil.o obj-$(CONFIG_QCOM_WCNSS_PIL) += qcom_wcnss_pil.o qcom_wcnss_pil-y += qcom_wcnss.o diff --git a/drivers/remoteproc/qcom_adsp_pil.c b/drivers/remoteproc/qcom_adsp_pil.c index 43a4ed2f346c..284546fedb4d 100644 --- a/drivers/remoteproc/qcom_adsp_pil.c +++ b/drivers/remoteproc/qcom_adsp_pil.c @@ -29,6 +29,7 @@ #include #include +#include "qcom_common.h" #include "qcom_mdt_loader.h" #include "remoteproc_internal.h" diff --git a/drivers/remoteproc/qcom_common.c b/drivers/remoteproc/qcom_common.c new file mode 100644 index 000000000000..bd400336e209 --- /dev/null +++ b/drivers/remoteproc/qcom_common.c @@ -0,0 +1,46 @@ +/* + * Qualcomm Peripheral Image Loader helpers + * + * Copyright (C) 2016 Linaro Ltd + * Copyright (C) 2015 Sony Mobile Communications Inc + * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include +#include +#include +#include + +#include "remoteproc_internal.h" +#include "qcom_common.h" + +/** + * qcom_mdt_find_rsc_table() - provide dummy resource table for remoteproc + * @rproc: remoteproc handle + * @fw: firmware header + * @tablesz: outgoing size of the table + * + * Returns a dummy table. + */ +struct resource_table *qcom_mdt_find_rsc_table(struct rproc *rproc, + const struct firmware *fw, + int *tablesz) +{ + static struct resource_table table = { .ver = 1, }; + + *tablesz = sizeof(table); + return &table; +} +EXPORT_SYMBOL_GPL(qcom_mdt_find_rsc_table); + +MODULE_DESCRIPTION("Qualcomm Remoteproc helper driver"); +MODULE_LICENSE("GPL v2"); diff --git a/drivers/remoteproc/qcom_common.h b/drivers/remoteproc/qcom_common.h new file mode 100644 index 000000000000..caecf27c4ffa --- /dev/null +++ b/drivers/remoteproc/qcom_common.h @@ -0,0 +1,11 @@ +#ifndef __RPROC_QCOM_COMMON_H__ +#define __RPROC_QCOM_COMMON_H__ + +struct resource_table; +struct rproc; + +struct resource_table *qcom_mdt_find_rsc_table(struct rproc *rproc, + const struct firmware *fw, + int *tablesz); + +#endif diff --git a/drivers/remoteproc/qcom_mdt_loader.c b/drivers/remoteproc/qcom_mdt_loader.c index 2ff18cd6c096..897e14512123 100644 --- a/drivers/remoteproc/qcom_mdt_loader.c +++ b/drivers/remoteproc/qcom_mdt_loader.c @@ -27,25 +27,6 @@ #include "qcom_mdt_loader.h" /** - * qcom_mdt_find_rsc_table() - provide dummy resource table for remoteproc - * @rproc: remoteproc handle - * @fw: firmware header - * @tablesz: outgoing size of the table - * - * Returns a dummy table. - */ -struct resource_table *qcom_mdt_find_rsc_table(struct rproc *rproc, - const struct firmware *fw, - int *tablesz) -{ - static struct resource_table table = { .ver = 1, }; - - *tablesz = sizeof(table); - return &table; -} -EXPORT_SYMBOL_GPL(qcom_mdt_find_rsc_table); - -/** * qcom_mdt_parse() - extract useful parameters from the mdt header * @fw: firmware handle * @fw_addr: optional reference for base of the firmware's memory region diff --git a/drivers/remoteproc/qcom_mdt_loader.h b/drivers/remoteproc/qcom_mdt_loader.h index c5d7122755b6..e513548e52ec 100644 --- a/drivers/remoteproc/qcom_mdt_loader.h +++ b/drivers/remoteproc/qcom_mdt_loader.h @@ -5,7 +5,6 @@ #define QCOM_MDT_TYPE_HASH (2 << 24) #define QCOM_MDT_RELOCATABLE BIT(27) -struct resource_table * qcom_mdt_find_rsc_table(struct rproc *rproc, const struct firmware *fw, int *tablesz); int qcom_mdt_load(struct rproc *rproc, const struct firmware *fw, const char *fw_name); int qcom_mdt_parse(const struct firmware *fw, phys_addr_t *fw_addr, size_t *fw_size, bool *fw_relocate); diff --git a/drivers/remoteproc/qcom_q6v5_pil.c b/drivers/remoteproc/qcom_q6v5_pil.c index 9a5149573298..cb2073242506 100644 --- a/drivers/remoteproc/qcom_q6v5_pil.c +++ b/drivers/remoteproc/qcom_q6v5_pil.c @@ -33,6 +33,7 @@ #include #include "remoteproc_internal.h" +#include "qcom_common.h" #include "qcom_mdt_loader.h" #include diff --git a/drivers/remoteproc/qcom_wcnss.c b/drivers/remoteproc/qcom_wcnss.c index ebd61f5d18bb..f158f8243b04 100644 --- a/drivers/remoteproc/qcom_wcnss.c +++ b/drivers/remoteproc/qcom_wcnss.c @@ -32,6 +32,7 @@ #include #include +#include "qcom_common.h" #include "qcom_mdt_loader.h" #include "remoteproc_internal.h" #include "qcom_wcnss.h"