From patchwork Tue Nov 8 17:58:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dwivedi, Avaneesh Kumar (avani)" X-Patchwork-Id: 9417867 X-Patchwork-Delegate: agross@codeaurora.org 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 DDA4060720 for ; Tue, 8 Nov 2016 17:58:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D2CF6289EC for ; Tue, 8 Nov 2016 17:58:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C744E28A4C; Tue, 8 Nov 2016 17:58:23 +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=ham 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 48C9F289F1 for ; Tue, 8 Nov 2016 17:58:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752842AbcKHR6R (ORCPT ); Tue, 8 Nov 2016 12:58:17 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:55338 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751479AbcKHR6N (ORCPT ); Tue, 8 Nov 2016 12:58:13 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id D1AAC624AC; Tue, 8 Nov 2016 17:58:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1478627892; bh=mcj0qdYM17XgtRllykEwaCuFNQFOcEWcJjn701IWXl8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Tj+KM7gW7fm8zGgmTfJwi6OrBc12TOk42fTXqVlQt3UzxZTg0SdqvAVlpCslQbQpb 9rHOS9QMF6r0aNU2D76uGAoqyUwsILbhu9M1k7BX+Ey3OI2YDvgQl6EGbCSyyU2f0R eHpISm5TrsObeSapcDBtlkc3vRRHwfHbwIAEbc4g= Received: from akdwived-linux.qualcomm.com (unknown [202.46.23.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: akdwived@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 1B42A62379; Tue, 8 Nov 2016 17:58:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1478627892; bh=mcj0qdYM17XgtRllykEwaCuFNQFOcEWcJjn701IWXl8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Tj+KM7gW7fm8zGgmTfJwi6OrBc12TOk42fTXqVlQt3UzxZTg0SdqvAVlpCslQbQpb 9rHOS9QMF6r0aNU2D76uGAoqyUwsILbhu9M1k7BX+Ey3OI2YDvgQl6EGbCSyyU2f0R eHpISm5TrsObeSapcDBtlkc3vRRHwfHbwIAEbc4g= DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org 1B42A62379 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=pass smtp.mailfrom=akdwived@codeaurora.org From: Avaneesh Kumar Dwivedi To: bjorn.andersson@linaro.org Cc: linux-arm-msm@vger.kernel.org, Avaneesh Kumar Dwivedi Subject: [PATCH 1/2] remoteproc: qcom: Private data support for venus rproc driver. Date: Tue, 8 Nov 2016 23:28:00 +0530 Message-Id: <1478627881-20073-2-git-send-email-akdwived@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1478627881-20073-1-git-send-email-akdwived@codeaurora.org> References: <1478627881-20073-1-git-send-email-akdwived@codeaurora.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP venus remoteproc driver being able to boot standalone venus firmware, need to initialize and enable clock resource. So providing private data binding to device structure so that each new venus remoteproc driver can manage its own clock. Signed-off-by: Avaneesh Kumar Dwivedi --- .../devicetree/bindings/remoteproc/qcom,venus.txt | 3 ++- drivers/remoteproc/qcom_venus_pil.c | 31 +++++++++++++++++++++- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,venus.txt b/Documentation/devicetree/bindings/remoteproc/qcom,venus.txt index 2d73ba1..9d7865e 100644 --- a/Documentation/devicetree/bindings/remoteproc/qcom,venus.txt +++ b/Documentation/devicetree/bindings/remoteproc/qcom,venus.txt @@ -6,7 +6,8 @@ on the Qualcomm Venus remote processor core. - compatible: Usage: required Value type: - Definition: must contain "qcom,venus-pil" + Definition: must contain "qcom,venus-pil" or + "qcom,venus-8996-pil" - memory-region: Usage: required diff --git a/drivers/remoteproc/qcom_venus_pil.c b/drivers/remoteproc/qcom_venus_pil.c index 6d4e55b..5b4ea10 100644 --- a/drivers/remoteproc/qcom_venus_pil.c +++ b/drivers/remoteproc/qcom_venus_pil.c @@ -21,6 +21,7 @@ #include #include #include +#include #include "qcom_mdt_loader.h" #include "remoteproc_internal.h" @@ -30,6 +31,11 @@ #define VENUS_PAS_ID 9 #define VENUS_FW_MEM_SIZE SZ_8M +struct qcom_venus_rproc_res { + char **venus_clks; + int venus_clk_cnt; + int *venus_clk_rate; +}; struct qcom_venus { struct device *dev; struct rproc *rproc; @@ -37,6 +43,8 @@ struct qcom_venus { phys_addr_t mem_phys; void *mem_va; size_t mem_size; + const struct qcom_venus_rproc_res *venus_rproc_res; + struct clk **venus_clks; }; static int venus_load(struct rproc *rproc, const struct firmware *fw) @@ -128,8 +136,13 @@ static int venus_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct qcom_venus *venus; struct rproc *rproc; + const struct qcom_venus_rproc_res *desc; int ret; + desc = of_device_get_match_data(&pdev->dev); + if (!desc) + return -EINVAL; + if (!qcom_scm_is_available()) return -EPROBE_DEFER; @@ -158,6 +171,7 @@ static int venus_probe(struct platform_device *pdev) platform_set_drvdata(pdev, venus); + venus->venus_rproc_res = desc; venus->mem_va = dma_alloc_coherent(dev, venus->mem_size, &venus->mem_phys, GFP_KERNEL); if (!venus->mem_va) { @@ -194,8 +208,23 @@ static int venus_remove(struct platform_device *pdev) return 0; } +char *venus_clk_str[] = {"core_clk", "iface_clk", "bus_clk", "maxi_clk"}; +int venus_clk_rate[] = {19200000, 19200000, 19200000, 80000000}; +static const struct qcom_venus_rproc_res venus_8996_res = { + .venus_clks = venus_clk_str, + .venus_clk_cnt = 4, + .venus_clk_rate = venus_clk_rate, +}; + +static const struct qcom_venus_rproc_res venus_8916_res = { + .venus_clks = NULL, + .venus_clk_cnt = 0, + .venus_clk_rate = NULL, +}; + static const struct of_device_id venus_of_match[] = { - { .compatible = "qcom,venus-pil" }, + { .compatible = "qcom,venus-8996-pil", .data = &venus_8996_res }, + { .compatible = "qcom,venus-pil", .data = &venus_8916_res}, { }, };