From patchwork Wed Mar 21 16:58:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 10299871 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 2221A600CC for ; Wed, 21 Mar 2018 17:00:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 17C20285F5 for ; Wed, 21 Mar 2018 17:00:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0C14F286AB; Wed, 21 Mar 2018 17:00:39 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A1194285F5 for ; Wed, 21 Mar 2018 17:00:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=XR0MbvRAXTE/AT998SaSeEdeHep2LS52ha6dMqqHolg=; b=a+RCI8FFumSRstqIAJB5jI8BkV acra8hPuhmuL2Kpl4d6hR+qiRmSw4xPXbE3ndBY9wb9legsT4V1DJL3eQioK7ciFGZ/xzKx5ER3t0 9G+NcUlZCZQK0StLoJmvwySC8VgoCTjApC2CBAmX2V03Bzg/NbrMq4nbPsvGyUy4xp9ykrkwxykvP qhpu6TnyTs/m9ZYA1MPDftYiQ70zf4SdsMr+wbNbM5XtvhtRmVfN27Uy8jJKFx1NcXQYyhjItCbEy bTsatfaB7CsHGujvcMgdjMxsS0So8SGpBTAgy0UfijVTpI2f/ALktIsm13kU91EKcisqVkbzlqc/U tGjNAFCg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1eyh6J-0001zv-3x; Wed, 21 Mar 2018 17:00:35 +0000 Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1eyh4o-0000bA-TZ for linux-arm-kernel@lists.infradead.org; Wed, 21 Mar 2018 16:59:05 +0000 Received: by mail-pf0-x241.google.com with SMTP id x1so2208490pfh.7 for ; Wed, 21 Mar 2018 09:58:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=IsEWvgJNcKsjkd8SgDGPMM8oASotOa0bRX2Uz5aPRz4=; b=eUZE7trArtnpGQ+ass4gltzLJ/Y2c6gKUuqIew50pDpt3ym2qEel822QDk7vVRsD6q SW0LMJ7wnJ+7TUbCN8o/kORcow6QCFrIzv3fSAlw2tX0BpLPVVNfnLuSBHOEURV/Mqhw v5xcLdeh//1xUdmCVyftf9fYcPE+wh6szSIP4= 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=IsEWvgJNcKsjkd8SgDGPMM8oASotOa0bRX2Uz5aPRz4=; b=lKMQNozvlt/8IdGPHN0RKfHDMeWQV+kZ3aOPAIROCPE4GFER/k0wCQkOMEpowkytyZ aKSCkXLIHvQmbxY6wXR1Nolp95Pz4IDRz6wIsZQgwGSYsEkoBSdKf1ka3x+vfe2U6w/m 8irpSoAQWR8rbsMTN6SVEv+p0P+IP/G+RBDxYJ1OWnU+JtZtgNHOcJEmvd6b6iLfrU7W B+oz0RwTHtsjWY5XxHUahg9oj5JB7VFWUp3nC3tNAkOraYdd2K8fP0YfDEGdx44nvpQM 6ACAABWP9jYZ/WkJegJy1Jmr1Q8vYa/MLNkOp6TAv9vdTuuAyYN4nvj2EYq5zJ2+0eoF xVVA== X-Gm-Message-State: AElRT7EuTPnxtmIBp6eP9zHJZ0XmS95g6sJ/o7UNyzSwQQvZThhn8bFG n0WK43vmJHIZ6+2bXkQ5w5pc9g== X-Google-Smtp-Source: AG47ELtPGd0YthNm11m1F03q7ovnUpUTLpstVC0NBR6S5jRRYr4UnEY2ARJHyFn29bC7fgLOTklYhw== X-Received: by 10.98.37.132 with SMTP id l126mr17746314pfl.102.1521651532265; Wed, 21 Mar 2018 09:58:52 -0700 (PDT) Received: from swboyd.mtv.corp.google.com ([2620:0:1000:1511:d30e:62c6:f82c:ff40]) by smtp.gmail.com with ESMTPSA id u28sm10121806pfl.19.2018.03.21.09.58.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Mar 2018 09:58:51 -0700 (PDT) From: Stephen Boyd To: Linus Walleij Subject: [PATCH v3 1/3] dt-bindings: gpio: Add a gpio-reserved-ranges property Date: Wed, 21 Mar 2018 09:58:46 -0700 Message-Id: <20180321165848.89751-2-swboyd@chromium.org> X-Mailer: git-send-email 2.16.2.804.g6dcf76e118-goog In-Reply-To: <20180321165848.89751-1-swboyd@chromium.org> References: <20180321165848.89751-1-swboyd@chromium.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180321_095903_037505_30501D25 X-CRM114-Status: GOOD ( 15.40 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, Timur Tabi , Stephen Boyd , linux-kernel@vger.kernel.org, Bjorn Andersson , Grant Likely , linux-gpio@vger.kernel.org, Andy Shevchenko , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Stephen Boyd Some qcom platforms make some GPIOs or pins unavailable for use by non-secure operating systems, and thus reading or writing the registers for those pins will cause access control issues. Introduce a DT property to describe the set of GPIOs that are available for use so that higher level OSes are able to know what pins to avoid reading/writing. Cc: Grant Likely Cc: Signed-off-by: Stephen Boyd Signed-off-by: Stephen Boyd --- Documentation/devicetree/bindings/gpio/gpio.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/gpio/gpio.txt b/Documentation/devicetree/bindings/gpio/gpio.txt index b5de08e3b1a2..a7c31de29362 100644 --- a/Documentation/devicetree/bindings/gpio/gpio.txt +++ b/Documentation/devicetree/bindings/gpio/gpio.txt @@ -151,9 +151,9 @@ in a lot of designs, some using all 32 bits, some using 18 and some using first 18 GPIOs, at local offset 0 .. 17, are in use. If these GPIOs do not happen to be the first N GPIOs at offset 0...N-1, an -additional bitmask is needed to specify which GPIOs are actually in use, -and which are dummies. The bindings for this case has not yet been -specified, but should be specified if/when such hardware appears. +additional set of tuples is needed to specify which GPIOs are unusable, with +the gpio-reserved-ranges binding. This property indicates the start and size +of the GPIOs that can't be used. Optionally, a GPIO controller may have a "gpio-line-names" property. This is an array of strings defining the names of the GPIO lines going out of the @@ -178,6 +178,7 @@ gpio-controller@00000000 { gpio-controller; #gpio-cells = <2>; ngpios = <18>; + gpio-reserved-ranges = <0 4>, <12 2>; gpio-line-names = "MMC-CD", "MMC-WP", "VDD eth", "RST eth", "LED R", "LED G", "LED B", "Col A", "Col B", "Col C", "Col D", "Row A", "Row B", "Row C", "Row D", "NMI button",