Received: by 10.223.176.5 with SMTP id f5csp1072712wra; Tue, 6 Feb 2018 12:07:23 -0800 (PST) X-Google-Smtp-Source: AH8x225+5RIZw3+tSmjR2gQANRetfvrUO2k1bD4PQK1lSpIU3AXFmMOxHAalQNOh0prM7Hzca1MH X-Received: by 10.99.6.201 with SMTP id 192mr2845746pgg.50.1517947643591; Tue, 06 Feb 2018 12:07:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517947643; cv=none; d=google.com; s=arc-20160816; b=pIHWCCwvg7kZRNgu/91sF9sCvj1hBKvkng7tWymfQlu7Znu8mqXd6SSC90xep0UAGm sUHLF1CWsJ7cgLK/yN1FYcAhnRp5VlZQ75l2Djphu+FjMz/5K3K6La7Zimc1vEEsMMpM Bj082EOkzIgmBcS5aDy3XuFJlSWSGlCar/7tpgjFqhw9/vqW0va51tjks4IYvJnyq2B2 PhYHGtPeBHqcDI6BRSwXrMnToAui5VA2q4DHs/07bWmarw5U5Xc6MjotrD39FgNhOW9f IwEwEEI0WRBu+xS+THyBSUAuPNkZfdnuAHiMV3wSHoMjTuym9H+R0lgrukj5bLnfe19L 4dcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=OfeAONgvy38wyMv2/Mzs8T/DuZygNaVzno/OedcZD+8=; b=ehpy1+HY/OA/0EaDw0AsNL9ypQJi9sdWeEStlGlRi+d01MOkv3fmUrL9IvqtbpQrhD t7H9Ue7BnFz4d3Ltuzk3vUzK2WWhBhLoYcwzrTTybz0PECG1tUe6ImFfibVjUed7Kn0j 8BOAx1xl76Cj4yR8O3RUNioTudu6AsdX44QklrkXGOjV4LEtH8gcEoTOsfxLN709v0Qd goeBIV6JyLd4lswVh6MDDQWxvjkM3FES/gMK3tU1gyrqIrETzmaODYOKxx1g4Ae0bdm5 5wXrU6UMGxact59fmTQdcnDHikfEIrR5q5n1s1Uz/JcX7BGMeCtTprdlt1ZWfaFdhHWC G2KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=chcmTGpv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (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 u4-v6si2089501plj.501.2018.02.06.12.07.09; Tue, 06 Feb 2018 12:07:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=chcmTGpv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752909AbeBFUFd (ORCPT + 99 others); Tue, 6 Feb 2018 15:05:33 -0500 Received: from mail-pl0-f66.google.com ([209.85.160.66]:37954 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752845AbeBFUFb (ORCPT ); Tue, 6 Feb 2018 15:05:31 -0500 Received: by mail-pl0-f66.google.com with SMTP id 13so1944954plb.5 for ; Tue, 06 Feb 2018 12:05:31 -0800 (PST) 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=OfeAONgvy38wyMv2/Mzs8T/DuZygNaVzno/OedcZD+8=; b=chcmTGpvZXAEWaB4tMf4IzX/4nlBnF47AN9Dx4dQk9JV9TSjNhdP77rTKifwZpRdxu k/+Cxn46p6ZeGklbnzvuG8HEWZgk9Xc0XHgiD4P10jD/Lt/MS2/WjWDthuVYdSOm7gSF kMynyZD+T4LmAZwp1FGosrpN/k+lqNi6Q4vfU= 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=OfeAONgvy38wyMv2/Mzs8T/DuZygNaVzno/OedcZD+8=; b=AIEjz8yCmPk/8ZXPBJlXfEvt8aHavo+mRC/2NRJo/k2//AjQni1Ruuhxh97tUso4Hi lIeT9JUyLKFOv8c3+9EaJxy3FIW71TKkLlRcKh8RWNYIHXkrHVyi+jlZpWll4WxVr8ih YPZDUVVDB7w6+cPZihWEQ+QpbK+BehZDF9fbRq8bXRu4FfaRMDKBlthYTl4qo//UAWND UlwJaLA/VdVEBOFqfxoOtcT1dvPJbgT5f/fTt1xZthJrcUBPDPfItojsjknVMIbfk1Bp CmjJfCrVsJsbW/ENbVECJOp89Y7kFgx5waxAahdJjpRCYLjmkqv0JExuPpm8awkcgivM +mVA== X-Gm-Message-State: APf1xPCtwurramM15BYdTE2hlx+M34sgnzcEtrCUYYsnQ5w+Sk1EmF4E bA4e/+qxBP/pHKyIik424pL8BA== X-Received: by 2002:a17:902:7848:: with SMTP id e8-v6mr3551999pln.386.1517947530559; Tue, 06 Feb 2018 12:05:30 -0800 (PST) Received: from builder (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id s14sm18954944pgc.36.2018.02.06.12.05.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 06 Feb 2018 12:05:29 -0800 (PST) Date: Tue, 6 Feb 2018 12:05:27 -0800 From: Bjorn Andersson To: Doug Anderson Cc: Stephen Boyd , Rajendra Nayak , Andy Gross , LKML , linux-arm-msm@vger.kernel.org, Linux ARM , devicetree@vger.kernel.org Subject: Re: [PATCH 2/2] arm64: dts: sdm845: Add serial console support Message-ID: <20180206200527.GM9465@builder> References: <20180125163216.29018-1-rnayak@codeaurora.org> <20180125163216.29018-3-rnayak@codeaurora.org> <20180126221808.GE28313@codeaurora.org> <20180206190614.GL9465@builder> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 06 Feb 11:49 PST 2018, Doug Anderson wrote: > Hi, > > On Tue, Feb 6, 2018 at 11:06 AM, Bjorn Andersson > wrote: > > On Tue 06 Feb 10:37 PST 2018, Doug Anderson wrote: > > > >> Hi, > >> > >> On Fri, Jan 26, 2018 at 2:18 PM, Stephen Boyd wrote: > >> > On 01/25, Rajendra Nayak wrote: > >> >> diff --git a/arch/arm64/boot/dts/qcom/sdm845-pins.dtsi b/arch/arm64/boot/dts/qcom/sdm845-pins.dtsi > >> >> new file mode 100644 > >> >> index 000000000000..b97f99e6f4b4 > >> >> --- /dev/null > >> >> +++ b/arch/arm64/boot/dts/qcom/sdm845-pins.dtsi > >> >> @@ -0,0 +1,32 @@ > >> >> +// SPDX-License-Identifier: GPL-2.0 > >> >> +/* > >> >> + * Copyright (c) 2018, The Linux Foundation. All rights reserved. > >> >> + */ > >> >> + > >> >> +&tlmm { > >> > > >> > I'm not the maintainer, but I find this approach to the pins > >> > really annoying. I have to flip to another file to figure out how > >> > a board has configured the pins. And we may bring in a bunch of > >> > settings that we don't ever use on some board too. Why can't we > >> > put the settings in the board file directly? > >> > >> I'm not so familiar with how things work with Qualcomm, but in general > >> I think putting this in the "board" file is a bad idea. I'd be OK > >> with putting this directly in the SoC file (though it might get > >> unwieldy?), but not moving things to the board file as was done with > >> v2 of this patch. > >> > >> Said another way: nearly board that uses SDM845 that uses UART2 will > >> have the same definitions for these pins so we shouldn't be > >> duplicating it across every board, right? > >> > > > > We've run into several cases where different boards uses the same > > function but requires board specific electrical configuration. > > > > So what we decided was to keep the pinmux in the soc-file (where e.g. > > the uart definition is) and then extend it with the board specific > > electrical properties (the pinconf), in the board files. > > > > This does come with the complexity of having the pinctrl nodes split in > > two places, but the responsibilities of the two parts is clear and we > > remove the need for all board files to ensure the appropriate pinmux is > > in place. > > > > > > NB. We did discuss adding "sane defaults" for the pinconf in the soc > > dtsi, but we end up spending considerable time debugging issues stemming > > from not having the right pinconf; so better make this explicit and say > > that the board has to specify it's config. > > Whoops, saw your responses _after_ I sent my response to v2. In any > case this makes sense to me then! On Rockchip boards I've been > involved in we often added "sane defaults", but I can see how that > could be confusing in different ways. I'm happy with your choice and > it seems like a happy medium. The sdm845.dtsi file can have the main > definition of the nodes and can thus refer to the nodes. Then you > just add the extra bit in the board file. > > What you propose is not what happened in v2 of the series > though. In v2 _both_ > the pinconf and the pinmux moved to the board file. That's wrong. > > > To make it concrete, you'd have something like this (this has the > wrong bindings from the UART, but folks get the picture hopefully): > > > In sdm845.dtsi: > > qup_uart2: serial@a84000 { > compatible = "qcom,geni-console", "qcom,geni-uart"; > reg = <0xa84000 0x4000>; > reg-names = "se_phys"; > clock-names = "se-clk", "m-ahb", "s-ahb"; > clocks = <&gcc GCC_QUPV3_WRAP1_S1_CLK>, > <&gcc GCC_QUPV3_WRAP_1_M_AHB_CLK>, > <&gcc GCC_QUPV3_WRAP_1_S_AHB_CLK>; > pinctrl-names = "default", "sleep"; > pinctrl-0 = <&qup_uart2_default>; > pinctrl-1 = <&qup_uart2_sleep>; > interrupts = ; > qcom,wrapper-core = <&qup_1>; > status = "disabled"; > }; > > tlmm: pinctrl@3400000 { > compatible = "qcom,sdm845-pinctrl"; > reg = <0x03400000 0xc00000>; > interrupts = ; > gpio-controller; > #gpio-cells = <2>; > interrupt-controller; > #interrupt-cells = <2>; > > qup_uart2_default: qup_uart2_default { > pinmux { > function = "qup9"; > pins = "gpio4", "gpio5"; > }; > }; > > qup_uart2_sleep: qup_uart2_sleep { > pinmux { > function = "gpio"; > pins = "gpio4", "gpio5"; > }; > }; > }; > > In sdm845-mtp.dts: > > &qup_uart2_default { > pinconf { > pins = "gpio4", "gpio5"; > drive-strength = <2>; > bias-disable; > }; > }; > > &qup_uart2_sleep { > pinconf { > pins = "gpio4", "gpio5"; > drive-strength = <2>; > bias-disable; > }; > }; Correct. This example does however show another thing that I really do not like; When you have a lot of nodes I find it very useful to maintain some sort of grouping, to know that I can find a node describing properties related to some block close to related blocks - e.g. nodes describing a pmic block is close to other nodes for that pmic. Today we seem to have a mixture of bus-based grouping, arbitrary grouping and no grouping at all in our upstream dtsi files, so I think we should set some guidelines here as well. Regards, Bjorn