From: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
To: Ziyang Huang <hzyitc@outlook.com>,
Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Cc: agross@kernel.org, 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
Subject: Re: [PATCH v3] arm64: dts: ipq5018: Correct uart1_pins pinconf
Date: Mon, 4 Sep 2023 01:57:26 +0100 [thread overview]
Message-ID: <c6f4b93c-aa80-e250-d06b-6b3bdfbfc64b@linaro.org> (raw)
In-Reply-To: <TYZPR01MB555673C1E12A27DA8109DBEAC9EAA@TYZPR01MB5556.apcprd01.prod.exchangelabs.com>
On 03/09/2023 14:02, Ziyang Huang wrote:
> 在 2023/9/1 23:04, Bryan O'Donoghue 写道:
>> <...>
>>
>> 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
>>
>
> No, please read my commit message carefully.
>
> The Y of pinctrl is the index of pinmux config. So it can't be used in
> the serial node definition.
>
> Please note that the physical port of first serial is configurable. It
> can use gpio20, gpio21 or/and gpio28,29. All of these pins are for the
> first serial.
>
> Let's take the second serial as an example. It has 3 configurable
> physical port groups - "blsp1_uart0" (pinconfig name, use GPIO
> 10,11,12,13), "blsp1_uart1" (gpio 31,32,33,34), "blsp1_uart2" (gpio
> 23,24,25,26).
>
> But the dts name of the second serial definition is "blsp1_uart2".
> Because it the second serial of the first BLSP block.
>
> Same logic. The dts name of the first serial definition is
> "blsp1_uart1". Because it the first serial of the first BLSP block.
>
> I think I need to introduce the architecture of these SoC. It has two
> BLSP block. Each BLSP block has several uart port.
>
> So the dts name of serial contains the BLSP index and the serial index
> inside BLSP. But pinconf name doesn't care about it. So it use global
> index. And due to the physical ports are configurable, it need pinmux
> index.
>
> The equation will be like this:
>
> dts name of serial definition: "blspX_uartY"
> pinconf name: "blspU_uartV"
> U = (uart_number_inside_each_blsp * (X - 1)) + (Y - 1)
I've checked the documentation for this chip.
gpio20, gpio21 = blsp0_uart0
gpio28, gpio29 = blsp0_uart0
These pins are muxed to UART0, I agree, the u-boot dts also indicates
this also.
If we open the documentation further we see
0x78AF000 = BLSP1_BLSP_UART0
0x79b0000 = BLSP1_BLSP_UART1
So for starters the dtsi has the _wrong_ label.
Here/anseo
grep uart0: arch/arm64/boot/dts/qcom/*
arch/arm64/boot/dts/qcom/ipq5332.dtsi: blsp1_uart0: serial@78af000 {
arch/arm64/boot/dts/qcom/ipq9574.dtsi: blsp1_uart0: serial@78af000 {
That's how that label ought to be the main hint something is askance is
assigning a pin named "blsp0_uart0" to a dts entry named "blsp1_uart1".
Please update the label in your next revision.
---
bod
next prev parent reply other threads:[~2023-09-04 0:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-01 14:10 [PATCH v3] arm64: dts: ipq5018: Correct uart1_pins pinconf Ziyang Huang
2023-09-01 15:04 ` Bryan O'Donoghue
2023-09-03 13:02 ` Ziyang Huang
2023-09-04 0:57 ` Bryan O'Donoghue [this message]
2023-09-05 11:19 ` Sricharan Ramabadhran
2023-09-13 0:39 ` Ziyang Huang
2023-09-02 12:22 ` Konrad Dybcio
2023-09-03 13:11 ` Ziyang Huang
2023-09-03 17:15 ` Krzysztof Kozlowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c6f4b93c-aa80-e250-d06b-6b3bdfbfc64b@linaro.org \
--to=bryan.odonoghue@linaro.org \
--cc=agross@kernel.org \
--cc=andersson@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=hzyitc@outlook.com \
--cc=konrad.dybcio@linaro.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=quic_gokulsri@quicinc.com \
--cc=quic_srichara@quicinc.com \
--cc=quic_varada@quicinc.com \
--cc=robh+dt@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).