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");