From patchwork Tue Jan 16 19:02:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 124760 Delivered-To: patch@linaro.org Received: by 10.46.64.148 with SMTP id r20csp1116744lje; Tue, 16 Jan 2018 11:07:05 -0800 (PST) X-Google-Smtp-Source: ACJfBosDHnlFcTbIxeBZ291/+Sr1uTpLik+LH9O2MqAJ0xX6Ax5GvtNgOlALXLcTZElFftKYKEe7 X-Received: by 10.84.235.137 with SMTP id p9mr18872493plk.377.1516129625047; Tue, 16 Jan 2018 11:07:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516129625; cv=none; d=google.com; s=arc-20160816; b=CE/scvpOVY5xkZZkmmjuY01An/rTGcZlPlvgG7cjNxzzpqRNYY3r8W63iTD/EZothb FAV0xmRjL/u2SDMVWKw1nBYo5DWoCG7toAfZAdbtrRCzajjxdNiCbBdR5sABcpiL/dAP c9EyYLpBm1IQIolNwPP6I4HhI07p3C31k2U3DpE51a+uvWOQqBE3EMmiHqBdRSwiKt6U BkIwMyNVwzlYwM1a9+mq7a+QtEHwMEGIz97WwbhUhoejatlPd4YUbRSS4HNi04ElGhW9 v1ypTwiH5FuhyHSUix/0/HvaT4xAL6JmxRby31pzpz4cbOu4C/ZHZDQTLg+7FpQh6pni 2bwA== 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=SvTpxYbPSHFHzq232hwQpFVBSBQrQYhEzR1jWj5vFAI=; b=0ZW6dBnFSbQ6WjEG7NL4MsAfH77Td3saNVn+Z/rGJyAsQ6j2eF6myUu5YZc6lZ+Ejn mehSMcDvjdiXpoh/vCQwnJfBsPvRUbjxkTzWxHCA5b2wf88RUrWYYLJ4e99UgNHEk6W3 ZtdqDymQVjpE3Fltc4WY1yyZ+AME2CeEwnehEHmyKHsom5VakgtVPXCCQ3OaM1hiruxL 8OI/mdQlgqW8qcURu+btGP60k3HkgXJKr6WY9pXTgjGVUkth6SpVkFH8PBD1Od1S7WrC /ozFxFf2pN/8s4O0bQomOzn9QejwIGGIgBd8GBEdbUzAC9vHev/ydsFQua/EIg40maYE gZmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=ifEM9WDl; 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 j188si2072164pgc.524.2018.01.16.11.07.04; Tue, 16 Jan 2018 11:07:05 -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=ifEM9WDl; 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 S1751641AbeAPTHC (ORCPT + 9 others); Tue, 16 Jan 2018 14:07:02 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:46431 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751110AbeAPTHA (ORCPT ); Tue, 16 Jan 2018 14:07:00 -0500 Received: by mail-wm0-f67.google.com with SMTP id 143so10423438wma.5 for ; Tue, 16 Jan 2018 11:06:59 -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=XGIf9SPtoDfNF6br+/LkXDsguO5GPewMxs2tCr1J5d4=; b=ifEM9WDlbIhvdf2ehOaXU7srP9Sq3UGhJPNDPDUbz0QgnAoZR9kj2pOuTCc8mklqEg 0rLnOii7grqdix+RdnF8ehAuEORk4Y8n+dEKE1JMtEFbuiYLd1vF7jbDr6XhjKpejdV6 JGy208wzfRnM/HPzvZLUnHXW6NE6CFs+5oP5M= 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=XGIf9SPtoDfNF6br+/LkXDsguO5GPewMxs2tCr1J5d4=; b=Cl9nGmS+Hax/zP2soCU7eK8d8YJmoy+ac7VkZjSGuia1zw4R9otXPPijxxeBJzYO0n kb/APuXn1+fxhNhsk9g8D7RtltnhWFQSl8CBUVysAUn8hG5k5vGpqvVeyHTfvfcZOVsD QG46oymBiAp3GhARa1bWyxnvLBbka8xEwGo0iMOBCTZlzHj/5YRn1nKD9a8tB64yxMzI kMcuQImxxeu86CyEUcL0iEWvSblCPyR3O+JoF1xXBPDvOElVyMIaanJjkxf5OoFsG+AY mpRM0VK5QjEmq2uwdL8d6MsKgSSwRLwqXEOM2rzAc2jVsaQuSlU75XMxz29CuiG/8lBG /Vzw== X-Gm-Message-State: AKwxytf3vL9FtnYJ6neKsIs+7dj1RATsJS8iNubZ6aSEMkc94IZ+5U/l vYmWM+cZNLghvtza27rxcdO5Yw== X-Received: by 10.28.31.133 with SMTP id f127mr111898wmf.140.1516129619214; Tue, 16 Jan 2018 11:06:59 -0800 (PST) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id 198sm3257074wmo.21.2018.01.16.11.06.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 16 Jan 2018 11:06:58 -0800 (PST) From: srinivas.kandagatla@linaro.org To: Vinod Koul , Andy Gross , dmaengine@vger.kernel.org Cc: Rob Herring , Mark Rutland , David Brown , Dan Williams , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, yanhe@quicinc.com, ramkri@qti.qualcomm.com, sdharia@quicinc.com, Srinivas Kandagatla Subject: [PATCH 1/4] dmaengine: qcom: bam_dma: make bam clk optional Date: Tue, 16 Jan 2018 19:02:33 +0000 Message-Id: <20180116190236.14558-2-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180116190236.14558-1-srinivas.kandagatla@linaro.org> References: <20180116190236.14558-1-srinivas.kandagatla@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Srinivas Kandagatla When BAM is remotely controlled it does not sound correct to control its clk on Linux side. Make it optional, so that its not madatory for remote controlled BAM instances. Signed-off-by: Srinivas Kandagatla --- drivers/dma/qcom/bam_dma.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) -- 2.15.1 -- 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/dma/qcom/bam_dma.c b/drivers/dma/qcom/bam_dma.c index 03c4eb3fd314..78e488e8f96d 100644 --- a/drivers/dma/qcom/bam_dma.c +++ b/drivers/dma/qcom/bam_dma.c @@ -1180,13 +1180,14 @@ static int bam_dma_probe(struct platform_device *pdev) "qcom,controlled-remotely"); bdev->bamclk = devm_clk_get(bdev->dev, "bam_clk"); - if (IS_ERR(bdev->bamclk)) - return PTR_ERR(bdev->bamclk); - - ret = clk_prepare_enable(bdev->bamclk); - if (ret) { - dev_err(bdev->dev, "failed to prepare/enable clock\n"); - return ret; + if (IS_ERR(bdev->bamclk)) { + bdev->bamclk = NULL; + } else { + ret = clk_prepare_enable(bdev->bamclk); + if (ret) { + dev_err(bdev->dev, "failed to prepare/enable clock\n"); + return ret; + } } ret = bam_init(bdev); From patchwork Tue Jan 16 19:02:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 124761 Delivered-To: patch@linaro.org Received: by 10.46.64.148 with SMTP id r20csp1116792lje; Tue, 16 Jan 2018 11:07:14 -0800 (PST) X-Google-Smtp-Source: ACJfBovlFChG7/Y40ch0Ee3k4yI6PoZqIrZUV+TCUySWbEE0T5CEt4heRf4PHz0j0NVb8OgPumXr X-Received: by 10.99.67.133 with SMTP id q127mr23903111pga.365.1516129634516; Tue, 16 Jan 2018 11:07:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516129634; cv=none; d=google.com; s=arc-20160816; b=W+jfxaQstCwigoXqZ+opv6pDa8GqeLWoQqozvdgP8jVd4C7gn6wqsU3OSLF+eUDnf1 qKXHyelsr/DPL7CuoqZG7fa+NvH7XUHSCZHK8P+16pE/GTYg8MNglog3iCTrn6+aQGZ4 w14IS+iSywm1xWjekU+N2ZEs5JsxeEeh/FHwHocX8Sn0IVF8oOogZq2QbEpglx4GFpUj +fsb/aDbrVuiMExFwjSMWzSC3eqv+qvgMrlUoyWb+2yiJk6j/zp0OkeSfUoO7w5oCvAR MzDk4EuhBM4UZTf+kmrLzr1glhx+xNInvwJcHPBF99KzhXmL0rGQRmCSQBFszuolnShH ueCA== 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=WG5kPO5vTffMyznwjPj5Tj6tzrFxPGdD2FhltX2/3us=; b=gLG1RGMi+dbmNfXeSUamUtSdWky37xqyppuIhSLiT8upOZZq/bu+QFhTOoQWXX6BEd 2VPDKyeBfDNwleZx21FRX0LWORjbHfy0gkau5Je3PIyyduPz6Wtn17pWqig61CfbafiM ZqZmlu76z5o+K5MUMDea6+NAq9m3YPBfQhgS5/KLgqHvcBRaq0kPJ1doHuGoa0MCmtlZ Q/ESSLNDBoNz5D7Puv8/ovsjTr0xPG7NZCzCTCAFXH+olPaDhKrtgYpsKYer5cU9h0Mb KkJWwFqkwLq0cKEn/fjg43lWWjNu4TLAurOgbfux55Y1BgFEhiUphTJZRTrcblDjlUNN OpNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=axIfcy5P; 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 l59si2380971plb.743.2018.01.16.11.07.14; Tue, 16 Jan 2018 11:07:14 -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=axIfcy5P; 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 S1751434AbeAPTHM (ORCPT + 9 others); Tue, 16 Jan 2018 14:07:12 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:44828 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751704AbeAPTHE (ORCPT ); Tue, 16 Jan 2018 14:07:04 -0500 Received: by mail-wm0-f66.google.com with SMTP id t74so10547252wme.3 for ; Tue, 16 Jan 2018 11:07:03 -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=oF6+dRw4nfaawgP/82Squ5eqFxopV2zfT91f1nTBebI=; b=axIfcy5PWLmEpHZb0HQn4FnLq3P+Dmxu79TN9SAxN07L8KvLcNgwA8BWPptdO/QHgA YFW6MW87cOfqPM7fG1CNSROccoZzmIbO+96PJYXICoYxNAY61CVAeOrS7mpvYZWNQ/nN zCMeAgXCet2k/coUwkfA/gGm5TXY7NB1yGVPY= 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=oF6+dRw4nfaawgP/82Squ5eqFxopV2zfT91f1nTBebI=; b=P5ffs0eyeaF5GEMei+fvSvNiYK8D6yyLh4tp7+PN53OYPxQ2f8ekTvOGv9AiDJvKF7 EkcIF1243POoRCw5+VUwGEiz8oHE4p2OqoZkbm+3Ql4x7ktt1cgjxAqWlEKyYISP1vHM lhxc9SKOaWxRQCKDesF5cZxVesDVlzHPhxCE24lIbntc1Nfeo2WR74bhUkOccFPxcMh5 0b6srz0LnfQW1bqvNaG5MY3P95KS5ijqkuQ5q4Wp1h+8dkPP29efykCnLxVs4CrZCTVV oJOBV3gXs5FFx9a6Eo1DUxr6J1yDd4t8kBBPROQWYsUPwxkumPUSToj5/1euJI6mo/79 35hQ== X-Gm-Message-State: AKwxytfBInlqcsiw+LYQUfN6Tyt7Qb+VsOM6CtDJ3Ypx6nx64ph+mq11 Wo57h+bEcqRlR1enRAhiZ/Rdig== X-Received: by 10.28.125.19 with SMTP id y19mr84964wmc.101.1516129622564; Tue, 16 Jan 2018 11:07:02 -0800 (PST) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id 198sm3257074wmo.21.2018.01.16.11.07.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 16 Jan 2018 11:07:02 -0800 (PST) From: srinivas.kandagatla@linaro.org To: Vinod Koul , Andy Gross , dmaengine@vger.kernel.org Cc: Rob Herring , Mark Rutland , David Brown , Dan Williams , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, yanhe@quicinc.com, ramkri@qti.qualcomm.com, sdharia@quicinc.com, Srinivas Kandagatla Subject: [PATCH 4/4] dmaengine: qcom: bam_dma: Add num-ees dt binding for remotely controlled Date: Tue, 16 Jan 2018 19:02:36 +0000 Message-Id: <20180116190236.14558-5-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180116190236.14558-1-srinivas.kandagatla@linaro.org> References: <20180116190236.14558-1-srinivas.kandagatla@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Srinivas Kandagatla When Linux is master of BAM, it can directly read registers to know number of supported execution enviroments, however when its remotely controlled reading these registers would trigger a crash if the BAM is not yet intialized/powered up on the remote side. This patch adds new binding num-ees to specify supported number of Execution Environments when BAM is remotely controlled. Signed-off-by: Srinivas Kandagatla --- Documentation/devicetree/bindings/dma/qcom_bam_dma.txt | 2 ++ drivers/dma/qcom/bam_dma.c | 15 ++++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) -- 2.15.1 -- 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/Documentation/devicetree/bindings/dma/qcom_bam_dma.txt b/Documentation/devicetree/bindings/dma/qcom_bam_dma.txt index aa6822cbb230..f0d10c2b393e 100644 --- a/Documentation/devicetree/bindings/dma/qcom_bam_dma.txt +++ b/Documentation/devicetree/bindings/dma/qcom_bam_dma.txt @@ -17,6 +17,8 @@ Required properties: remote proccessor i.e. execution environment. - num-channels : optional, indicates supported number of DMA channels in a remotely controlled bam. +- num-ees : optional, indicates supported number of Execution Environments in a + remotely controlled bam. Example: diff --git a/drivers/dma/qcom/bam_dma.c b/drivers/dma/qcom/bam_dma.c index bbbb755d7549..7a8727271d60 100644 --- a/drivers/dma/qcom/bam_dma.c +++ b/drivers/dma/qcom/bam_dma.c @@ -387,6 +387,7 @@ struct bam_device { struct device_dma_parameters dma_parms; struct bam_chan *channels; u32 num_channels; + u32 num_ees; /* execution environment ID, from DT */ u32 ee; @@ -1079,11 +1080,14 @@ static int bam_init(struct bam_device *bdev) u32 val; /* read revision and configuration information */ - val = readl_relaxed(bam_addr(bdev, 0, BAM_REVISION)) >> NUM_EES_SHIFT; - val &= NUM_EES_MASK; + if (!bdev->num_ees) { + val = readl_relaxed(bam_addr(bdev, 0, BAM_REVISION)) >> NUM_EES_SHIFT; + val &= NUM_EES_MASK; + bdev->num_ees = val; + } /* check that configured EE is within range */ - if (bdev->ee >= val) + if (bdev->ee >= bdev->num_ees) return -EINVAL; if (!bdev->num_channels) { @@ -1189,6 +1193,11 @@ static int bam_dma_probe(struct platform_device *pdev) &bdev->num_channels); if (ret) dev_err(bdev->dev, "num-channels unspecified in dt\n"); + + ret = of_property_read_u32(pdev->dev.of_node, "num-ees", + &bdev->num_ees); + if (ret) + dev_err(bdev->dev, "num-ees unspecified in dt\n"); } bdev->bamclk = devm_clk_get(bdev->dev, "bam_clk");