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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 10135CA0FE6 for ; Fri, 1 Sep 2023 15:04:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232461AbjIAPEP (ORCPT ); Fri, 1 Sep 2023 11:04:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350097AbjIAPEP (ORCPT ); Fri, 1 Sep 2023 11:04:15 -0400 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9230610D2 for ; Fri, 1 Sep 2023 08:04:10 -0700 (PDT) Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-4013454fa93so21467405e9.0 for ; Fri, 01 Sep 2023 08:04:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693580649; x=1694185449; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=IWnLKgy4psQAOPCmq/KJu4X6vCCHFBpqjxEL4HJlAgs=; b=n+wE5ieHXurAgi1byUSaX4KsGtfy3zHADC/OQfi33+CpznUU88VFfpnwzeadHwAB9X p7E6XSZl8+Abe807eKpCY7RWgOJI5o+tUU/A7Xu976iTwL1jq2IJCCWyFp21lq4Ts7i7 zWDJsHJSts+DpNLsrvpIROaS4vKL8qSU3Pxv2wr1CvrjE8gXAYv4oAFzYrPCjsD2N0ts BxiucjC8NLNTf48cAn4tzId3mPxfiprB93zTnetJR29kx2PzhipHbxyTMg4TN0Z459qB b4aTJeCL6Mp8DLa9ivC8f3UO8atxx/SKLgoksCMUDZCeVuIsA8YgpZ7xHGSRgSjBjC+4 8Kbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693580649; x=1694185449; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=IWnLKgy4psQAOPCmq/KJu4X6vCCHFBpqjxEL4HJlAgs=; b=Lu+PlL7ROazqJLORQ4NKyeq7PoWi6jhi66ODr5ruJIMXSK4PMqjdzuF8IPTtEeN50x cf1gZcVyfLw+yO69UKdnnSjW/gihW0iki22y5m3+IqYP6a6/Zt0QEi9OlH2qEB4do7kk fGf+hOWsyWen0yVw4y6Mb88ZdwMu791heaZO9XbvL9EYfNYvsP9Bvcx8mieXI3vxSd8c S08hVpQqLu1Jqp6fcZEEfjjQbCGNoAkNE5w4UiYQ8WhEtXBmYIQd0MRMr3rpHVbyqS0o BXidLQ7V6YZdtXRR6oY4F/p7S0Qx8gnO2MpiJTUSlLMJp3SUyh+I9r67rX371Bk58IT5 HBhw== X-Gm-Message-State: AOJu0YymnggVrvQHXWx80/j6Y3rx2LTiYak1R7DYQCn4FCF44ZTNAKQb aCD040o/p4tl1dEfSd299Ahy8Q== X-Google-Smtp-Source: AGHT+IGhXUcSeTC1y/HbwZL6d49yRvC6KlJjPuI32snrfXHFombXdShnxsysYVpAb4HQE5xETHL9yw== X-Received: by 2002:a05:600c:205a:b0:401:264b:5df7 with SMTP id p26-20020a05600c205a00b00401264b5df7mr1938908wmg.35.1693580648493; Fri, 01 Sep 2023 08:04:08 -0700 (PDT) Received: from [192.168.0.162] (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id o18-20020a05600c379200b003fee65091fdsm8347949wmr.40.2023.09.01.08.04.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 01 Sep 2023 08:04:07 -0700 (PDT) Message-ID: Date: Fri, 1 Sep 2023 16:04:06 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH v3] arm64: dts: ipq5018: Correct uart1_pins pinconf Content-Language: en-US To: Ziyang Huang , agross@kernel.org Cc: andersson@kernel.org, konrad.dybcio@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, quic_gokulsri@quicinc.com, quic_srichara@quicinc.com, quic_varada@quicinc.com, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: From: Bryan O'Donoghue In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On 01/09/2023 15:10, Ziyang Huang wrote: > In pinctrl, the pinconfigs for uart are named "blspX_uartY". > X is the UART ID. Starts from 1. > 1-6 are in BLSP Block 1. > 7-12 are in BLSP Block 2. > Y is the index of mux config. Starts from 0. > > In dts, the serials are also named "blspX_uartY", but with different logic. > X is the BLSP Block ID. Starts from 1. > Y is the uart id inside block. > In "ipq6018.dtsi" and "ipq8074.dtsi", it starts from 1. > But in "ipq5332.dtsi" and "ipq9574.dtsi", it starts from 0. > > +-----------------+-----------------+-------------+-----------------+ > | Block ID | ID inside Block | dts name | pinconfig name | > | (Starts from 1) | (Starts from 1) | | | > +-----------------+-----------------+-------------+-----------------+ > | 1 | 1 | blsp1_uart1 | blsp0_uartY | > | 1 | 2 | blsp1_uart2 | blsp1_uartY | > | 1 | 6 | blsp1_uart6 | blsp5_uartY | > | 2 | 1 | blsp2_uart1 | blsp6_uartY | > | 2 | 6 | blsp2_uart6 | blsp12_uartY | > +-----------------+-----------------+-------------+-----------------+ > > In "ipq5018.dts", "blsp1_uart1" (dts name) is the first serial (confimed > by the address), So its pinconfig should be "blsp0_uart0" (pinconfig name, > use GPIO 20 and 21) or "blsp0_uart1" (pinconfig name, use GPIO 28 and 29). > > Fixes: 570006756a16 ("arm64: dts: Add ipq5018 SoC and rdp432-c2 board support") > Signed-off-by: Ziyang Huang > --- > Changes since v1: > - Use corrent name in From > > Changes since v2: > - Define 2 pinconfs for uart1 in ipq5018.dtsi > - rdp432-c2 use uart1_pins_a > > arch/arm64/boot/dts/qcom/ipq5018-rdp432-c2.dts | 2 +- > arch/arm64/boot/dts/qcom/ipq5018.dtsi | 15 +++++++++++---- > 2 files changed, 12 insertions(+), 5 deletions(-) > > diff --git a/arch/arm64/boot/dts/qcom/ipq5018-rdp432-c2.dts b/arch/arm64/boot/dts/qcom/ipq5018-rdp432-c2.dts > index e636a1cb9b77..e83d1863e89c 100644 > --- a/arch/arm64/boot/dts/qcom/ipq5018-rdp432-c2.dts > +++ b/arch/arm64/boot/dts/qcom/ipq5018-rdp432-c2.dts > @@ -23,7 +23,7 @@ chosen { > }; > > &blsp1_uart1 { > - pinctrl-0 = <&uart1_pins>; > + pinctrl-0 = <&uart1_pins_a>; > pinctrl-names = "default"; > status = "okay"; > }; > diff --git a/arch/arm64/boot/dts/qcom/ipq5018.dtsi b/arch/arm64/boot/dts/qcom/ipq5018.dtsi > index 9f13d2dcdfd5..50b4a2bd6fd3 100644 > --- a/arch/arm64/boot/dts/qcom/ipq5018.dtsi > +++ b/arch/arm64/boot/dts/qcom/ipq5018.dtsi > @@ -103,11 +103,18 @@ tlmm: pinctrl@1000000 { > interrupt-controller; > #interrupt-cells = <2>; > > - uart1_pins: uart1-state { > - pins = "gpio31", "gpio32", "gpio33", "gpio34"; > - function = "blsp1_uart1"; > + uart1_pins_a: uart1@0 { > + pins = "gpio20", "gpio21"; > + function = "blsp0_uart0"; > drive-strength = <8>; > - bias-pull-down; > + bias-disabled; > + }; > + > + uart1_pins_b: uart1@1 { > + pins = "gpio28", "gpio29"; > + function = "blsp0_uart1"; > + drive-strength = <8>; > + bias-disabled; > }; > }; > The assignment of pins 20 and 21 to blsp1_uart1 is not correct. The blspX_uartY in pinctrl should match what is in the dtsi so assigning pins_a above to blsp1_uart1 is not right. The dts name and pinctrl name should be the same. Your console is on blsp0_uart0. https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016/-/blob/5343739b4070bcec2fecd72f758c16adc31a3083/arch/arm/dts/ipq5018-mp03.3.dts#L33 So roughly speaking arch/arm64/boot/dts/qcom/ipq5018-rdp432-c2.dts aliases { serial0 = &blsp0_uart0; }; chosen { stdout-path = "serial0:115200n8"; }; &blsp0_uart0 { pinctrl-0 = <&uart0_pins>; pinctrl-names = "default"; status = "okay"; }; arch/arm64/boot/dts/qcom/ipq5018.dtsi blsp0_uart0: serial@78af000 either that or blsp0_uart1 for pins28 and pins29 - you seem to indicate pins_1 => blsp0_uart0. The two roots of the problem are 1. Mislabeling of the uart block in the dtsi 2. Invalid miscongiruation of pins for that misnamed block The fix should be 1. Fix the labeling of uart in the dtsi 2. Decide on which pins gpio20, gpio21 ? are the right ones to configure I thought you said in a previous email if you changed pins gpio28 and gpio29 that the UART would fail if so that implies blsp0_uart1. Either way the pinctrl and dts should agree. --- bod