All of lore.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Chanho Park <chanho61.park@samsung.com>,
	'Krzysztof Kozlowski' <krzysztof.kozlowski+dt@linaro.org>,
	'Rob Herring' <robh+dt@kernel.org>
Cc: 'Alim Akhtar' <alim.akhtar@samsung.com>,
	'Sam Protsenko' <semen.protsenko@linaro.org>,
	'Jaewon Kim' <jaewon02.kim@samsung.com>,
	devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/3] arm64: dts: exynosautov9: add exynosautov9-usi.dtsi
Date: Wed, 29 Jun 2022 13:09:02 +0200	[thread overview]
Message-ID: <eb7275a0-3883-176f-fab0-b5cab5bb09ee@linaro.org> (raw)
In-Reply-To: <025601d88b9d$332049b0$9960dd10$@samsung.com>

On 29/06/2022 11:47, Chanho Park wrote:
>> On 29/06/2022 03:56, Chanho Park wrote:
>>> Universal Serial Interface (USI) supports three types of serial
>>> interface such as Universal Asynchronous Receiver and Transmitter
>>> (UART), Serial Peripheral Interface (SPI), and Inter-Integrated Circuit
>> (I2C).
>>> Each protocols can be working independently and configured as one of
>>> those using external configuration inputs.
>>> Exynos Auto v9 SoC support 12 USIs. When a USI uses two pins such as
>>> i2c and 3 wire uarts(RX/TX only), we can use remain two pins as i2c mode.
>>> So, we can define one USI node that includes serial/spi and hsi2c.
>>> usi_i2c nodes can be used only for i2c mode.
>>>
>>> We can have below combinations for one USI.
>>> 1) The usi node is used either 4 pin uart or 4 pin spi  -> No usi_i2c
>>> can be used
>>> 2) The usi node is used 2 pin uart(RX/TX) and i2c(SDA/SCL)  -> usi_i2c
>>> should be enabled to use the latter i2c
>>> 3) The usi node is used i2c(SDA/SCL) and i2c(SDA/SCL)  -> usi_i2c
>>> should be enabled to use the latter i2c
>>>
>>> By default, all USIs are initially set to uart mode by below setting.
>>> samsung,mode = <USI_V2_UART>;
>>> You can change it either USI_V2_SPI or USI_V2_I2C.
>>>
>>> Signed-off-by: Chanho Park <chanho61.park@samsung.com>
>>> ---
>>>  .../boot/dts/exynos/exynosautov9-usi.dtsi     | 1127 +++++++++++++++++
>>>  1 file changed, 1127 insertions(+)
>>>  create mode 100644 arch/arm64/boot/dts/exynos/exynosautov9-usi.dtsi
>>
>> Put all this directly in exynosautov9.dtsi, because this is not a re-
>> usable piece among different DTSI.
> 
> Okay. I'll move them in the exynosautov9.dtsi. I thought they're too long to put in the exynosautov9.dtsi and I also found a similar case such as exynos5433-bus.dtsi and exynos5433-tmu.dtsi.

Indeed we did like that... The tmu maybe was meant to be re-used,
although it references specific clusters. But the split of bus I don't
understand - it does not help.

I don't think it improved readability.

> 
>>
>>>
>>> diff --git a/arch/arm64/boot/dts/exynos/exynosautov9-usi.dtsi
>>> b/arch/arm64/boot/dts/exynos/exynosautov9-usi.dtsi
>>> new file mode 100644
>>> index 000000000000..0e4c6332770b
>>> --- /dev/null
>>> +++ b/arch/arm64/boot/dts/exynos/exynosautov9-usi.dtsi
>>> @@ -0,0 +1,1127 @@
>>> +// SPDX-License-Identifier: GPL-2.0
>>> +/*
>>> + * Samsung's ExynosAutov9 SoC USI device tree source
>>> + *
>>> + * Copyright (c) 2022 Samsung Electronics Co., Ltd.
>>> + *
>>> + * Samsung's ExynosAutov9 SoC USI(Universal Serial Interface,
>>> +uart/spi/i2c)
>>> + * are listed as device tree nodes in this file.
>>> + */
>>> +
>>> +/* PERIC0 USIs */
>>> +&soc {
>>> +	syscon_peric0: syscon@10220000 {
>>> +		compatible = "samsung,exynosautov9-sysreg", "syscon";
>>> +		reg = <0x10220000 0x2000>;
>>> +	};
>>> +
>>> +	usi_0: usi@103000c0 {
>>> +		compatible = "samsung,exynos850-usi";
>>
>> We should start adding dedicated compatible, so:
>> "samsung,exynosautov9-usi", "samsung,exynos850-usi"
> 
> So, I need to add the compatible to the Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml, right?
> 
> - samsung,exynos850-usi   # for USIv2 (Exynos850, ExynosAutoV9)
> 
> To be>
> - samsung,exynos850-usi
> - samsung,exynosautov9-usi


  compatible:

    oneOf:
     - items:
         - const: samsung,exynosautov9-usi
         - const: samsung,exynos850-usi
     - enum:

         - samsung,exynos850-usi   # for USIv2 (Exynos850, ExynosAutoV9)

> 
>>
>>> +		reg = <0x103000c0 0x20>;
>>> +		samsung,sysreg = <&syscon_peric0 0x1000>;
>>> +		samsung,mode = <USI_V2_UART>;
>>> +		#address-cells = <1>;
>>> +		#size-cells = <1>;
>>> +		ranges;
>>> +		clocks = <&cmu_peric0 CLK_GOUT_PERIC0_PCLK_0>,
>>> +			 <&cmu_peric0 CLK_GOUT_PERIC0_IPCLK_0>;
>>> +		clock-names = "pclk", "ipclk";
>>> +		status = "disabled";
>>> +
>>> +		/* USI: UART */
>>
>> Skip the comments, they are obvious from device node name. Long time ago I
>> was not advocating this, but I see it's benefits - much easier to
>> introduce changes to DTS or binding in case of some differences.

Eh, I think my reply got mixed up. The last sentence was about
compatible, so it should be:

We should start adding dedicated compatible, so:
"samsung,exynosautov9-usi", "samsung,exynos850-usi".
Long time ago I was not advocating this, but I see it's benefits - much
easier to introduce changes to DTS or binding in case of some differences.

and here only about the comment.

> I'll drop them.

Yes, please.

> 
>>
>>> +		serial_0: serial@10300000 {
>>> +			compatible = "samsung,exynos850-uart";
>>
>> Here as well.
> 
> I'll add "samsung,exynosautov9-uart" to the yaml file.
> 
>>

Best regards,
Krzysztof

WARNING: multiple messages have this Message-ID (diff)
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Chanho Park <chanho61.park@samsung.com>,
	'Krzysztof Kozlowski' <krzysztof.kozlowski+dt@linaro.org>,
	'Rob Herring' <robh+dt@kernel.org>
Cc: 'Alim Akhtar' <alim.akhtar@samsung.com>,
	'Sam Protsenko' <semen.protsenko@linaro.org>,
	'Jaewon Kim' <jaewon02.kim@samsung.com>,
	devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/3] arm64: dts: exynosautov9: add exynosautov9-usi.dtsi
Date: Wed, 29 Jun 2022 13:09:02 +0200	[thread overview]
Message-ID: <eb7275a0-3883-176f-fab0-b5cab5bb09ee@linaro.org> (raw)
In-Reply-To: <025601d88b9d$332049b0$9960dd10$@samsung.com>

On 29/06/2022 11:47, Chanho Park wrote:
>> On 29/06/2022 03:56, Chanho Park wrote:
>>> Universal Serial Interface (USI) supports three types of serial
>>> interface such as Universal Asynchronous Receiver and Transmitter
>>> (UART), Serial Peripheral Interface (SPI), and Inter-Integrated Circuit
>> (I2C).
>>> Each protocols can be working independently and configured as one of
>>> those using external configuration inputs.
>>> Exynos Auto v9 SoC support 12 USIs. When a USI uses two pins such as
>>> i2c and 3 wire uarts(RX/TX only), we can use remain two pins as i2c mode.
>>> So, we can define one USI node that includes serial/spi and hsi2c.
>>> usi_i2c nodes can be used only for i2c mode.
>>>
>>> We can have below combinations for one USI.
>>> 1) The usi node is used either 4 pin uart or 4 pin spi  -> No usi_i2c
>>> can be used
>>> 2) The usi node is used 2 pin uart(RX/TX) and i2c(SDA/SCL)  -> usi_i2c
>>> should be enabled to use the latter i2c
>>> 3) The usi node is used i2c(SDA/SCL) and i2c(SDA/SCL)  -> usi_i2c
>>> should be enabled to use the latter i2c
>>>
>>> By default, all USIs are initially set to uart mode by below setting.
>>> samsung,mode = <USI_V2_UART>;
>>> You can change it either USI_V2_SPI or USI_V2_I2C.
>>>
>>> Signed-off-by: Chanho Park <chanho61.park@samsung.com>
>>> ---
>>>  .../boot/dts/exynos/exynosautov9-usi.dtsi     | 1127 +++++++++++++++++
>>>  1 file changed, 1127 insertions(+)
>>>  create mode 100644 arch/arm64/boot/dts/exynos/exynosautov9-usi.dtsi
>>
>> Put all this directly in exynosautov9.dtsi, because this is not a re-
>> usable piece among different DTSI.
> 
> Okay. I'll move them in the exynosautov9.dtsi. I thought they're too long to put in the exynosautov9.dtsi and I also found a similar case such as exynos5433-bus.dtsi and exynos5433-tmu.dtsi.

Indeed we did like that... The tmu maybe was meant to be re-used,
although it references specific clusters. But the split of bus I don't
understand - it does not help.

I don't think it improved readability.

> 
>>
>>>
>>> diff --git a/arch/arm64/boot/dts/exynos/exynosautov9-usi.dtsi
>>> b/arch/arm64/boot/dts/exynos/exynosautov9-usi.dtsi
>>> new file mode 100644
>>> index 000000000000..0e4c6332770b
>>> --- /dev/null
>>> +++ b/arch/arm64/boot/dts/exynos/exynosautov9-usi.dtsi
>>> @@ -0,0 +1,1127 @@
>>> +// SPDX-License-Identifier: GPL-2.0
>>> +/*
>>> + * Samsung's ExynosAutov9 SoC USI device tree source
>>> + *
>>> + * Copyright (c) 2022 Samsung Electronics Co., Ltd.
>>> + *
>>> + * Samsung's ExynosAutov9 SoC USI(Universal Serial Interface,
>>> +uart/spi/i2c)
>>> + * are listed as device tree nodes in this file.
>>> + */
>>> +
>>> +/* PERIC0 USIs */
>>> +&soc {
>>> +	syscon_peric0: syscon@10220000 {
>>> +		compatible = "samsung,exynosautov9-sysreg", "syscon";
>>> +		reg = <0x10220000 0x2000>;
>>> +	};
>>> +
>>> +	usi_0: usi@103000c0 {
>>> +		compatible = "samsung,exynos850-usi";
>>
>> We should start adding dedicated compatible, so:
>> "samsung,exynosautov9-usi", "samsung,exynos850-usi"
> 
> So, I need to add the compatible to the Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml, right?
> 
> - samsung,exynos850-usi   # for USIv2 (Exynos850, ExynosAutoV9)
> 
> To be>
> - samsung,exynos850-usi
> - samsung,exynosautov9-usi


  compatible:

    oneOf:
     - items:
         - const: samsung,exynosautov9-usi
         - const: samsung,exynos850-usi
     - enum:

         - samsung,exynos850-usi   # for USIv2 (Exynos850, ExynosAutoV9)

> 
>>
>>> +		reg = <0x103000c0 0x20>;
>>> +		samsung,sysreg = <&syscon_peric0 0x1000>;
>>> +		samsung,mode = <USI_V2_UART>;
>>> +		#address-cells = <1>;
>>> +		#size-cells = <1>;
>>> +		ranges;
>>> +		clocks = <&cmu_peric0 CLK_GOUT_PERIC0_PCLK_0>,
>>> +			 <&cmu_peric0 CLK_GOUT_PERIC0_IPCLK_0>;
>>> +		clock-names = "pclk", "ipclk";
>>> +		status = "disabled";
>>> +
>>> +		/* USI: UART */
>>
>> Skip the comments, they are obvious from device node name. Long time ago I
>> was not advocating this, but I see it's benefits - much easier to
>> introduce changes to DTS or binding in case of some differences.

Eh, I think my reply got mixed up. The last sentence was about
compatible, so it should be:

We should start adding dedicated compatible, so:
"samsung,exynosautov9-usi", "samsung,exynos850-usi".
Long time ago I was not advocating this, but I see it's benefits - much
easier to introduce changes to DTS or binding in case of some differences.

and here only about the comment.

> I'll drop them.

Yes, please.

> 
>>
>>> +		serial_0: serial@10300000 {
>>> +			compatible = "samsung,exynos850-uart";
>>
>> Here as well.
> 
> I'll add "samsung,exynosautov9-uart" to the yaml file.
> 
>>

Best regards,
Krzysztof

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-06-29 11:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20220629015913epcas2p3e5cafc2ae9415ca0568afdf1b3ca842b@epcas2p3.samsung.com>
2022-06-29  1:56 ` [PATCH 0/3] support USI for Exynos Auto v9 SoC Chanho Park
2022-06-29  1:56   ` Chanho Park
     [not found]   ` <CGME20220629015913epcas2p2403ccfdc43853ec60498b91b7ef374ea@epcas2p2.samsung.com>
2022-06-29  1:56     ` [PATCH 1/3] arm64: dts: exynosautov9: add pdma0 device tree node Chanho Park
2022-06-29  1:56       ` Chanho Park
     [not found]   ` <CGME20220629015913epcas2p1dcfcc81c026aa524a1f35c8e393be4f0@epcas2p1.samsung.com>
2022-06-29  1:56     ` [PATCH 2/3] arm64: dts: exynosautov9: add exynosautov9-usi.dtsi Chanho Park
2022-06-29  1:56       ` Chanho Park
2022-06-29  8:40       ` Krzysztof Kozlowski
2022-06-29  8:40         ` Krzysztof Kozlowski
2022-06-29  9:47         ` Chanho Park
2022-06-29  9:47           ` Chanho Park
2022-06-29 11:09           ` Krzysztof Kozlowski [this message]
2022-06-29 11:09             ` Krzysztof Kozlowski
     [not found]   ` <CGME20220629015913epcas2p4b7839d1d66027cfa01cba73f7593902c@epcas2p4.samsung.com>
2022-06-29  1:56     ` [PATCH 3/3] arm64: dts: exynosautov9: include exynosautov9-usi.dtsi Chanho Park
2022-06-29  1:56       ` Chanho Park

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=eb7275a0-3883-176f-fab0-b5cab5bb09ee@linaro.org \
    --to=krzysztof.kozlowski@linaro.org \
    --cc=alim.akhtar@samsung.com \
    --cc=chanho61.park@samsung.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jaewon02.kim@samsung.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=semen.protsenko@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.