From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,T_DKIMWL_WL_HIGH,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 211B2C28CC5 for ; Wed, 5 Jun 2019 19:06:28 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E6D0C20717 for ; Wed, 5 Jun 2019 19:06:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="T/+Z7k0x"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="NGNQhr7s" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E6D0C20717 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DunzjqFLWoDXfv5bwNuiSLm4m1QEB9gc8BqE9CxqE58=; b=T/+Z7k0x2xY+pp RMAxP4EVMreckbzu7BJHLGP2z1IllGhb4weBj6x6d4fxHDMIbbA0lHP3SBsysw9YUM2Mm7pKTZM/d 4XfhZrnFOQS4boQAXkI/2IvMPo0y83xxOrU0zJcZSbxuDHrnfnaHry3lTzyMP7sgzef6aDqLM6H3V xvheROqXhITjtY5hlPcyXGSWVdnH7reEeGztlPx89YHIJksl+106fk5OdEuMK9fH+OSa4npdH6Dv4 uWIcxEl76YRKg/3jwqw37wVbAFz4K/sVgWQ+TXh6m3LmDTU0FRnEjmAdxhXlbQAnVVxUP7lOPhqV6 4hlkZgN4cz9hiUZd+dYg==; 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 1hYbEr-0004qe-3r; Wed, 05 Jun 2019 19:06:21 +0000 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hYbEo-0004qK-4p for linux-arm-kernel@lists.infradead.org; Wed, 05 Jun 2019 19:06:19 +0000 Received: by mail-pg1-x541.google.com with SMTP id e6so11654502pgd.9 for ; Wed, 05 Jun 2019 12:06:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=M6BGDN2AyVfgjLFK/UIuQsI5QieCC/mU2xEW0eQBY6c=; b=NGNQhr7s+dSXGA0agT49GCRMN5IBD59uXz3hQDX1aXq4lMe5N67yu52ciH/CgRwHUP oaU5ZJ03dVccEINZLKm3W1zobHhPMqR//HHdjiAQd1g8hmh0CtDIW5Y1pTk1IbY2IaO1 B/VPli8Q2TMnY+VKcvSXoK9/vA/peszAGu4EYmGzokB+0Rl+59FpTDynelw9pT15L2jK 5YCE0Ph6aJcwVoI4t3kz8ujggXCUBpUiYs69ebmhnQtTVw6y9DWv7/bp2SoKFq5ORurU jdB4W+mLQDd8lH8tQIlNHznVWVhnupC3IELyc2LldxJmHthhy8vWRQMMGjYpHQ8rWlau Y+4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=M6BGDN2AyVfgjLFK/UIuQsI5QieCC/mU2xEW0eQBY6c=; b=L3/gNeI9V9TQhGsbiEe7hwRk8/nfqhSfGgdY3+pnNORx9+0GJmPZlayGUDtDrkavBg cRSJlZJ8LIhZx3HQ4yX2ACLvKRmdJAdUSZ7PqRa4fZzSuBgt+Tzd8BdPqJkmyGrfky/P luYrBWd7y6gCsNJ5z4y+8tbigm/Jo4ZzhOrsQkNt6rwooKFR2WH9zH55STk+rA0NEhc2 eo0mM+K1Sc8M0V7pCe0A0GpynDVdQnZo0yMS7bJ8wiHWeRjfPXX1BsPXRk4TWTbdWHoB qrQ+MbFcjfCS9/2AYTmtuRXG2VGOvuFWJyHKJZoyFfUCcaKUVJHCcGssrkfYBJXI6lrr i4xw== X-Gm-Message-State: APjAAAUa5OM8ud8nCa8U05czzY597ZVYAipa2ZiCLtFdbuNFrhhCdUgP AKm5qWg9w9fX3Q0BYzR84Qhdvg== X-Google-Smtp-Source: APXvYqzlT/XPvgcF1v+ffkfX/JPoo7GvSAjnePPEFFPhNx56Xy63K3pCAsqBkSIncUTmupa3p3kRtw== X-Received: by 2002:a17:90a:9308:: with SMTP id p8mr44957549pjo.12.1559761577409; Wed, 05 Jun 2019 12:06:17 -0700 (PDT) Received: from minitux (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id q4sm19489811pgb.39.2019.06.05.12.06.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Jun 2019 12:06:16 -0700 (PDT) Date: Wed, 5 Jun 2019 12:06:14 -0700 From: Bjorn Andersson To: Lee Jones Subject: Re: [PATCH 4/8] pinctrl: qcom: sdm845: Provide ACPI support Message-ID: <20190605190614.GI4814@minitux> References: <20190604104455.8877-1-lee.jones@linaro.org> <20190604104455.8877-4-lee.jones@linaro.org> <20190605061721.GK22737@tuxbook-pro> <20190605073133.GL4797@dell> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190605073133.GL4797@dell> User-Agent: Mutt/1.12.0 (2019-05-25) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190605_120618_210155_BF415184 X-CRM114-Status: GOOD ( 29.56 ) 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: balbi@kernel.org, wsa+renesas@sang-engineering.com, gregkh@linuxfoundation.org, linus.walleij@linaro.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, david.brown@linaro.org, alokc@codeaurora.org, kramasub@codeaurora.org, linux-i2c@vger.kernel.org, linux-gpio@vger.kernel.org, linux-arm-msm@vger.kernel.org, andy.gross@linaro.org, jlhugo@gmail.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed 05 Jun 00:31 PDT 2019, Lee Jones wrote: > On Tue, 04 Jun 2019, Bjorn Andersson wrote: > > > On Tue 04 Jun 03:44 PDT 2019, Lee Jones wrote: > > > > > This patch provides basic support for booting with ACPI instead > > > of the currently supported Device Tree. When doing so there are a > > > couple of differences which we need to taken into consideration. > > > > > > Firstly, the SDM850 ACPI tables omit information pertaining to the > > > 4 reserved GPIOs on the platform. If Linux attempts to touch/ > > > initialise any of these lines, the firmware will restart the > > > platform. > > > > > > Secondly, when booting with ACPI, it is expected that the firmware > > > will set-up things like; Regulators, Clocks, Pin Functions, etc in > > > their ideal configuration. Thus, the possible Pin Functions > > > available to this platform are not advertised when providing the > > > higher GPIOD/Pinctrl APIs with pin information. > > > > > > Signed-off-by: Lee Jones > > > --- > > > drivers/pinctrl/qcom/Kconfig | 2 +- > > > drivers/pinctrl/qcom/pinctrl-sdm845.c | 35 ++++++++++++++++++++++++++- > > > 2 files changed, 35 insertions(+), 2 deletions(-) > > > > > > diff --git a/drivers/pinctrl/qcom/Kconfig b/drivers/pinctrl/qcom/Kconfig > > > index 2e66ab72c10b..aafbe932424f 100644 > > > --- a/drivers/pinctrl/qcom/Kconfig > > > +++ b/drivers/pinctrl/qcom/Kconfig > > > @@ -168,7 +168,7 @@ config PINCTRL_SDM660 > > > > > > config PINCTRL_SDM845 > > > tristate "Qualcomm Technologies Inc SDM845 pin controller driver" > > > - depends on GPIOLIB && OF > > > + depends on GPIOLIB && (OF || ACPI) > > > select PINCTRL_MSM > > > help > > > This is the pinctrl, pinmux, pinconf and gpiolib driver for the > > > diff --git a/drivers/pinctrl/qcom/pinctrl-sdm845.c b/drivers/pinctrl/qcom/pinctrl-sdm845.c > > > index c97f20fca5fd..7188bee3cf3e 100644 > > > --- a/drivers/pinctrl/qcom/pinctrl-sdm845.c > > > +++ b/drivers/pinctrl/qcom/pinctrl-sdm845.c > > > @@ -3,6 +3,7 @@ > > > * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved. > > > */ > > > > > > +#include > > > #include > > > #include > > > #include > > > @@ -1277,6 +1278,10 @@ static const struct msm_pingroup sdm845_groups[] = { > > > UFS_RESET(ufs_reset, 0x99f000), > > > }; > > > > > > +static const int sdm845_acpi_reserved_gpios[] = { > > > + 0, 1, 2, 3, 81, 82, 83, 84, -1 > > > +}; > > > + > > > static const struct msm_pinctrl_soc_data sdm845_pinctrl = { > > > .pins = sdm845_pins, > > > .npins = ARRAY_SIZE(sdm845_pins), > > > @@ -1284,14 +1289,41 @@ static const struct msm_pinctrl_soc_data sdm845_pinctrl = { > > > .nfunctions = ARRAY_SIZE(sdm845_functions), > > > .groups = sdm845_groups, > > > .ngroups = ARRAY_SIZE(sdm845_groups), > > > + .reserved_gpios = sdm845_acpi_reserved_gpios, > > > > The reason why put these in DT is because the list is board/firmware > > dependent. E.g. the firmware on db845c does not support the peripherals > > that sits on these 8 pins and as such these are not reserved. > > If we need to be more particular about which platform(s) this affects, > we could add matching based on their differences (some ACPI HID or F/W > version/descriptor, etc) as and when we enable them for booting with > ACPI. > You're making an assumption that all SDM845 (the platform) devices using ACPI will have this list of GPIOs reserved for secure firmware to use, this is questionable but I don't have any better suggestion. But you do this by adding a new struct msm_pinctrl_soc_data sdm845_acpi_pinctrl, specifically for the ACPI case. And then, on the line I object to here, you add this list as the list of reserved GPIOs for the DT case as well. > > But given that the two structs looks identical now, did you perhaps not > > intend to add.reserved_gpios for the non-ACPI case? > > Given your example above, I think it's best that we let the > configuration tables advertise these in the first instance. I only > add them here because it is not possible to obtain them from > elsewhere. > Then add it for ACPI only - which I still presume you intended to do by adding sdm845_acpi_pinctrl (which is now identical to sdm845_pinctrl). Regards, Bjorn _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel