Received: by 10.223.176.5 with SMTP id f5csp1056696wra; Tue, 6 Feb 2018 11:50:46 -0800 (PST) X-Google-Smtp-Source: AH8x224Dsk8tLLUhYfg9xohIVItnkocdUUICG/pCAiV/0rdThVjLOnt0UmnFAXoXeBV6bMN9FkZd X-Received: by 2002:a17:902:15a8:: with SMTP id m37-v6mr3538899pla.186.1517946646817; Tue, 06 Feb 2018 11:50:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517946646; cv=none; d=google.com; s=arc-20160816; b=RqihaMhFehmYuvFhRv0DjLkee8GdM9H8qBTJ6p7av3Ts/tlHYpRt+mwZPtS+xlxK3i 3Suotawlt07Ckah9L/BjDDKondgNKptYUyARMZmHAtnByW28AWynGXBhIQHz5o9wO5Xn oG9nziWOLJtgy4WoC2Y3VFNTFY0lL4P7tq+xXcL8/AiLTUZrlFy5SrixUEyVL4Hf5DRu fhTC1tDRh9SpSSaoFqZ8NrZzpKjksrysonazQvOyndm/bBMu0pKPAd4isJBaX1jf3R3b ZPHa4lxvbtdT+6SNLcGi9UW4LDlpTXJMS2s/AYi1nCFqWV68UmzVIU8QwzGYj1xihhIV GVTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature:dkim-signature :arc-authentication-results; bh=8k0HOXiF4voxAROws893iS8K0JlFXuUgKNg+ri0ixMM=; b=m969eXvGThoJk8vCwRjLauZz6cJc/PxBCaMaRjW5yPMh/Bv+v0VbvbQ1l3JPjwprja jXMY91BkGaNEt+Nu2222pCm/sc8zIkZFtmQ3v31aHNvymjG3UQfTnndiI+IGmBBFzZof Wp2gbvudv7lbttjO8pEcnZVQeMnd7CHPr1lmt+SiZB05e7BiZiSRMxUAelPiFwhTKKo2 u+Iz1LlsbtGNvDJzsFXCdgUECHGvABbGGvG0a/Ga8gaspusBwlXd/p2lE55f/NPmVJQL GkGGj22dJJNlg8fQiX9eW0tu5A/1bzD9Uipg/yITXH4Bkvdsux0NhGCjWKK7p4hpd7rZ LG7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@google.com header.s=20161025 header.b=DaZFZGJk; dkim=fail header.i=@chromium.org header.s=google header.b=IaylBm6p; 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=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q5-v6si7059144pll.88.2018.02.06.11.50.33; Tue, 06 Feb 2018 11:50:46 -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=fail header.i=@google.com header.s=20161025 header.b=DaZFZGJk; dkim=fail header.i=@chromium.org header.s=google header.b=IaylBm6p; 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=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932141AbeBFTtn (ORCPT + 99 others); Tue, 6 Feb 2018 14:49:43 -0500 Received: from mail-vk0-f68.google.com ([209.85.213.68]:39914 "EHLO mail-vk0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753320AbeBFTtk (ORCPT ); Tue, 6 Feb 2018 14:49:40 -0500 Received: by mail-vk0-f68.google.com with SMTP id a63so1902498vkg.6 for ; Tue, 06 Feb 2018 11:49:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=8k0HOXiF4voxAROws893iS8K0JlFXuUgKNg+ri0ixMM=; b=DaZFZGJk1ln42nEgd5eb7CWkXz5oTs0onOfgyXonHpAaMrI6Q78Heet8t9fU0xxaV6 HHUHtkXVLVZV0MCaILDSE4AhXmvqtZQwyNTfRZU7hEiBQ+vZiwyRJIfiELSlFtLHZiPg iAhjSuxqcfW4XKA/AMlo6pAvLUaKMBAbzorNEX73xQD8zBMwPY1WQsRBVXc8YX8qhvrD 475M08S3TaGoxOUROurFGbP6u4Ir+Iq8ThjO755Cpg3UiNuhG99u2CsfvtfU0m8PUKNW leBJQGR7hEQk1IzGP1njyIo7coW4R/3Gd+NC0CpGb7QXAMlNy+Zq3DVLaKZdtK9G4vD0 rmBA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=8k0HOXiF4voxAROws893iS8K0JlFXuUgKNg+ri0ixMM=; b=IaylBm6pnPnEkj0gx635HKxyV0BshzGMaV/SFFleMgVbIvLUVfOgYN/x8q6/hYOPSy 98WhYxFTpNSLkKi16B4CXtexVidPfYOPspz1wiwok3OCPoBzCz1glN13KyHZUUBAzrEa OK4yNNwwaG56kaV9re31s3IGH1nMPUEF6TDGA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=8k0HOXiF4voxAROws893iS8K0JlFXuUgKNg+ri0ixMM=; b=tEZ+HoDpjqWvuCq4CYPXhxJly2KhF341sqfg6vYxCLdvgsm7DJUSqF5hhXImyf5G2y b78qAdy3114EX4VhYCG4ksnzITqPksVwLZc5lUYncvwfT/003GBOG9RTCX8XUwMBv9MO BmrWAwXDYV5dPHomwJRM5mqcMZ04HOJRJy/Qp+MzyDztfv6ls4NwWTs3SZE1bFXbJFf3 7ipizeHe2lBSGnYpR6yTxci1CvVqfpeVTXTQ4jzVHGeHOXj6N4gtJfKRhqgsG/LnMDJW SqEqu6buAtYG4O+3sUarx0sgJGHPa4AM4Tl+lDmAmxY/nDWvGrsqDPja1iXYftV7oMcb jaNQ== X-Gm-Message-State: APf1xPDi5EL4QxqUxKkLTsOGYUkvSm4Je2cuwWvRm5KHNPd5fqSrXq/f Vz8BABaY5Ud8x8ZYJKY/6ytExWXbjrd1gjfpht6aHg== X-Received: by 10.31.201.133 with SMTP id z127mr3405511vkf.129.1517946579005; Tue, 06 Feb 2018 11:49:39 -0800 (PST) MIME-Version: 1.0 Received: by 10.31.95.139 with HTTP; Tue, 6 Feb 2018 11:49:37 -0800 (PST) In-Reply-To: <20180206190614.GL9465@builder> References: <20180125163216.29018-1-rnayak@codeaurora.org> <20180125163216.29018-3-rnayak@codeaurora.org> <20180126221808.GE28313@codeaurora.org> <20180206190614.GL9465@builder> From: Doug Anderson Date: Tue, 6 Feb 2018 11:49:37 -0800 X-Google-Sender-Auth: SUryFvK3IMydiz_NbEK0KUMWnIU Message-ID: Subject: Re: [PATCH 2/2] arm64: dts: sdm845: Add serial console support To: Bjorn Andersson Cc: Stephen Boyd , Rajendra Nayak , Andy Gross , LKML , linux-arm-msm@vger.kernel.org, Linux ARM , devicetree@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; }; };