From patchwork Thu May 4 20:05:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 98563 Delivered-To: patch@linaro.org Received: by 10.140.89.200 with SMTP id v66csp787785qgd; Thu, 4 May 2017 13:05:46 -0700 (PDT) X-Received: by 10.99.44.209 with SMTP id s200mr47968853pgs.25.1493928346883; Thu, 04 May 2017 13:05:46 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t19si3032852plj.255.2017.05.04.13.05.46; Thu, 04 May 2017 13:05:46 -0700 (PDT) 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; 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 S1752198AbdEDUFp (ORCPT + 10 others); Thu, 4 May 2017 16:05:45 -0400 Received: from mail-pg0-f49.google.com ([74.125.83.49]:35610 "EHLO mail-pg0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751749AbdEDUFn (ORCPT ); Thu, 4 May 2017 16:05:43 -0400 Received: by mail-pg0-f49.google.com with SMTP id o3so13895596pgn.2 for ; Thu, 04 May 2017 13:05:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=5RmBxZtkWqDefrc6O42ln4k8bFBqi11AYM1suYccBAU=; b=aLCsnq7b+GeHa3gDMg1/VtGONhMKcw5XGjlSeLb818/YDXSvTdey2C5fzYkx2ooKDC O5CRg0+OLFyTs25GmS01jFiWXKAE0d83ceN6/6xGt7j3uslFQEjNyxy1yEstN5HnREi9 PrvRlZ4db7xDhv7mHW8HhGvnBI5jTOI0mGifA= 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=5RmBxZtkWqDefrc6O42ln4k8bFBqi11AYM1suYccBAU=; b=P6+F7jQ3g1uBZ30epVOFmoIjOQPQNQut+Yu+txE8Gz3Ar6Igs/+TlAf/Wxg9n6CwRt bOONRuLXP/opFQ6ikay+faZbXXDVN8kafiMq9KuRVKREXcyKBPh9xcHM9kSyjZ5CTOnP HpgN2cJp9vuRi+IibGRKgPjriJblgsusdvamvYcVDRXGxcUozY8XtMmYS38C3gmXyOpA SxlpNsHh8H9bhE29Kl0Cjv6jBujyls16e9fbviiwjpCRMD4NGUG5bZebQPRm4r3x3Rqd FpcchCKnaQOPGlLzg9mTryznBWKj+FvbWVnCYy8SCQWvZIaBwR1iqWNqZcjkPuclOCES AasQ== X-Gm-Message-State: AN3rC/76h5z02HBYQvIiEiKzZrmV4pqbf+SbGMEE32Pwl1X/vVJWEfh7 Zmhy6nkIunWMwux7dECO5w== X-Received: by 10.84.197.1 with SMTP id m1mr59264226pld.183.1493928343155; Thu, 04 May 2017 13:05:43 -0700 (PDT) Received: from localhost.localdomain (ip68-111-223-48.sd.sd.cox.net. [68.111.223.48]) by smtp.gmail.com with ESMTPSA id s68sm5969712pgc.5.2017.05.04.13.05.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 May 2017 13:05:42 -0700 (PDT) From: Bjorn Andersson To: Andy Gross , Rob Herring , Mark Rutland , Ohad Ben-Cohen , Jassi Brar Cc: linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-remoteproc@vger.kernel.org Subject: [PATCH v4 1/5] mailbox: Make startup and shutdown ops optional Date: Thu, 4 May 2017 13:05:35 -0700 Message-Id: <20170504200539.27027-1-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.12.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Some mailbox hardware doesn't have to perform any additional operations on startup of shutdown, so make these optional. Signed-off-by: Bjorn Andersson --- Changes since v3: - New patch drivers/mailbox/mailbox.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) -- 2.12.0 -- 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 Reviewed-by: Sudeep Holla Acked-by: Rob Herring diff --git a/drivers/mailbox/mailbox.c b/drivers/mailbox/mailbox.c index 4671f8a12872..c88de953394a 100644 --- a/drivers/mailbox/mailbox.c +++ b/drivers/mailbox/mailbox.c @@ -137,6 +137,20 @@ static enum hrtimer_restart txdone_hrtimer(struct hrtimer *hrtimer) return HRTIMER_NORESTART; } +static int mbox_startup(struct mbox_chan *chan) +{ + if (chan->mbox->ops->startup) + return chan->mbox->ops->startup(chan); + + return 0; +} + +static void mbox_shutdown(struct mbox_chan *chan) +{ + if (chan->mbox->ops->shutdown) + chan->mbox->ops->shutdown(chan); +} + /** * mbox_chan_received_data - A way for controller driver to push data * received from remote to the upper layer. @@ -352,7 +366,7 @@ struct mbox_chan *mbox_request_channel(struct mbox_client *cl, int index) spin_unlock_irqrestore(&chan->lock, flags); - ret = chan->mbox->ops->startup(chan); + ret = mbox_startup(chan); if (ret) { dev_err(dev, "Unable to startup the chan (%d)\n", ret); mbox_free_channel(chan); @@ -405,7 +419,7 @@ void mbox_free_channel(struct mbox_chan *chan) if (!chan || !chan->cl) return; - chan->mbox->ops->shutdown(chan); + mbox_shutdown(chan); /* The queued TX requests are simply aborted, no callbacks are made */ spin_lock_irqsave(&chan->lock, flags); From patchwork Thu May 4 20:05:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 98567 Delivered-To: patch@linaro.org Received: by 10.140.89.200 with SMTP id v66csp788316qgd; Thu, 4 May 2017 13:06:56 -0700 (PDT) X-Received: by 10.98.112.134 with SMTP id l128mr12645859pfc.161.1493928416504; Thu, 04 May 2017 13:06:56 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d66si2907534pfa.389.2017.05.04.13.06.56; Thu, 04 May 2017 13:06:56 -0700 (PDT) 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; 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 S1757265AbdEDUGy (ORCPT + 10 others); Thu, 4 May 2017 16:06:54 -0400 Received: from mail-pg0-f47.google.com ([74.125.83.47]:32977 "EHLO mail-pg0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752149AbdEDUFp (ORCPT ); Thu, 4 May 2017 16:05:45 -0400 Received: by mail-pg0-f47.google.com with SMTP id y4so13925755pge.0 for ; Thu, 04 May 2017 13:05:45 -0700 (PDT) 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=IrtcRiTVsDeazFk/i/tZ6B9ijrplW1iTQlRqWWjjPlE=; b=fw+YMb/QVooQ0nxn8kA2Tq1YafnuKRCU9epgzyBcfVCIsr/4Ur1p2IZuU+lAtCfwiX 4RtLKXjCTaHwN3EYoVM6yvMNmoZiqCRuf6lW0cgWvFv+L7gDygPLzfqrDVwSW3SkdF+9 H4hCqLa8Uho5gl+9xp5Yiz66GnX62xEXWuQb4= 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=IrtcRiTVsDeazFk/i/tZ6B9ijrplW1iTQlRqWWjjPlE=; b=lwOG0bWWxH70tuiomlSIBSCZlVyYlHfnGKSDX48pqV0BaukBSZlzpYizsaXNr4eT6q 4qeAEGatVbiuNO5mfVbIAHjw3Uk1dtMWZOCWRIIlzezIjq/77pY+g2xBce5Ntso2vrxP pBClAl/9JEov1x2o4JciR8pemr2MGdMBtayPm5z/P5cSgMqvQQ85/ie5bT0byTqw5PxQ /+HN8wKdtf0fOoKR0G9ojB3i3ueopqOlpgI+gwaW7ph23+5tIVxORjYA9SNUfQVGrrgv PiyYPTjW1at+jxrrXx76zw+mUA36e1v6ycaZq+0YtKMociTJsYQ7LyoSyE2hRYk8VxF8 EF1Q== X-Gm-Message-State: AN3rC/7schTMQ10BqdqgaQTG28WIH9I5xcIqScJNElv/8TBS78PoFnPe d8gIo20GjoVQVLyr X-Received: by 10.98.197.194 with SMTP id j185mr12590901pfg.239.1493928344420; Thu, 04 May 2017 13:05:44 -0700 (PDT) Received: from localhost.localdomain (ip68-111-223-48.sd.sd.cox.net. [68.111.223.48]) by smtp.gmail.com with ESMTPSA id s68sm5969712pgc.5.2017.05.04.13.05.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 May 2017 13:05:43 -0700 (PDT) From: Bjorn Andersson To: Andy Gross , Rob Herring , Mark Rutland , Ohad Ben-Cohen , Jassi Brar Cc: linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-remoteproc@vger.kernel.org Subject: [PATCH v4 2/5] dt-bindings: mailbox: Introduce Qualcomm APCS global binding Date: Thu, 4 May 2017 13:05:36 -0700 Message-Id: <20170504200539.27027-2-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170504200539.27027-1-bjorn.andersson@linaro.org> References: <20170504200539.27027-1-bjorn.andersson@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Introduce a binding for the Qualcomm APCS global block, exposing a mailbox for invoking interrupts on remote processors in the system. Signed-off-by: Bjorn Andersson --- Changes since v3: - Transition to mailbox binding Changes since v2: - New binding .../bindings/mailbox/qcom,apcs-kpss-global.txt | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.txt -- 2.12.0 -- 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/mailbox/qcom,apcs-kpss-global.txt b/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.txt new file mode 100644 index 000000000000..eaa9e780f412 --- /dev/null +++ b/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.txt @@ -0,0 +1,46 @@ +Binding for the Qualcomm APCS global block +========================================== + +This binding describes the APCS "global" block found in various Qualcomm +platforms. + +- compatible: + Usage: required + Value type: + Definition: must be one of: + "qcom,msm8916-apcs-kpss-global", + "qcom,msm8996-apcs-hmss-global" + +- reg: + Usage: required + Value type: + Definition: must specify the base address and size of the global block + +- #mbox-cells: + Usage: required + Value type: + Definition: as described in mailbox.txt, must be 1 + + += EXAMPLE +The following example describes the APCS HMSS found in MSM8996 and part of the +GLINK RPM referencing the "rpm_hlos" doorbell therein. + + apcs_glb: apcs-glb@9820000 { + compatible = "qcom,msm8996-apcs-hmss-global"; + reg = <0x9820000 0x1000>; + + #mbox-cells = <1>; + }; + + rpm-glink { + compatible = "qcom,glink-rpm"; + + interrupts = ; + + qcom,rpm-msg-ram = <&rpm_msg_ram>; + + mboxes = <&apcs_glb 0>; + mbox-names = "rpm_hlos"; + }; +