From: Sam Protsenko <semen.protsenko@linaro.org>
To: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
Cc: Krzysztof Kozlowski <krzk+dt@kernel.org>,
Alim Akhtar <alim.akhtar@samsung.com>,
Rob Herring <robh@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 5/5] arm64: dts: exynos2200: define all usi nodes
Date: Fri, 1 Aug 2025 19:29:09 -0500 [thread overview]
Message-ID: <CAPLW+4maFxYv4RrvzUXWwteXAVm64ocj2LSAgtM6RMtzbM_p-w@mail.gmail.com> (raw)
In-Reply-To: <20250730074253.1884111-6-ivo.ivanov.ivanov1@gmail.com>
On Wed, Jul 30, 2025 at 2:44 AM Ivaylo Ivanov
<ivo.ivanov.ivanov1@gmail.com> wrote:
>
> Universal Serial Interface (USI) supports three types of serial
> interfaces - uart, i2c and spi. Each protocol can work independently
> and configured using external configuration inputs.
>
> As each USI instance has access to 4 pins, there are multiple possible
> configurations:
> - the first 2 and the last 2 pins can be i2c (sda/scl) or uart (rx/tx)
> - the 4 pins can be used for 4 pin uart or spi
>
> Such configuration can be achieved by setting the mode property of usiX
> and usiX_i2c nodes correctly - if usiX is set to take up 2 pins, then
> usiX_i2c can be set to take the other 2. If usiX is set for 4 pins, then
> usiX_i2c should be left disabled.
>
The whole naming scheme is a bit confusing: one might think that
because both usiX and usiX_i2c have the same number (X), they
represent the same USI block. I can see how they might share the same
pins, but it doesn't seem enough to me to justify this convention. If
I'm missing something, please help me understand why it should be done
like that?
> Define all the USI nodes from peric0 (usi4), peric1 (usi7-10), peric2
> (usi0-6, usi11) and cmgp (usi0-6_cmgp, 2 pin usi7_cmgp) blocks, as well
> as their respective uart and i2c subnodes. As Samsung, for some reason,
> has decided to restart the counting of usi instances for cmgp, suffix
> labels for nodes of such with _cmgp.
>
Yeah, they probably meant to number CMGP instances, not USI instances.
Because CMGP (stands for Common GPIO) is actually a separate IP block
containing:
- 2 x USIs
- 1 GPIO controller (8 GPIO lines)
- One general purpose ADC
- 6 interrupt combiners
So some USI blocks are separate USIs, and some USI blocks are a part
of bigger CMGP blocks. And instead of using "usi_01_cmgp" for example,
they should've gone with "usi_cmgp01".
Usually it's recommended to follow the naming scheme from the TRM, but
AFAIU you don't have one. And the scheme used in the downstream device
tree looks like comlete garbage. Anyways, I don't have strong
preference on the naming scheme. Frankly I'd just do the consecutive
numbering for all the USI nodes in this case, like: usi0, usi1, etc.
And add the comments when needed, like "USI from CMGP01 block".
> Spi support will be added later on.
>
> Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
> ---
> arch/arm64/boot/dts/exynos/exynos2200.dtsi | 1361 ++++++++++++++++++++
> 1 file changed, 1361 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/exynos/exynos2200.dtsi b/arch/arm64/boot/dts/exynos/exynos2200.dtsi
> index 22c6da907..f83e6cf24 100644
> --- a/arch/arm64/boot/dts/exynos/exynos2200.dtsi
> +++ b/arch/arm64/boot/dts/exynos/exynos2200.dtsi
> @@ -7,6 +7,7 @@
>
> #include <dt-bindings/clock/samsung,exynos2200-cmu.h>
> #include <dt-bindings/interrupt-controller/arm-gic.h>
> +#include <dt-bindings/soc/samsung,exynos-usi.h>
>
> / {
> compatible = "samsung,exynos2200";
> @@ -314,6 +315,76 @@ pinctrl_peric0: pinctrl@10430000 {
> reg = <0x10430000 0x1000>;
> };
>
> + usi4: usi@105000c0 {
> + compatible = "samsung,exynos2200-usi", "samsung,exynos850-usi";
> + reg = <0x105000c0 0x20>;
> + ranges;
> + #address-cells = <1>;
> + #size-cells = <1>;
> + clocks = <&cmu_peric0 CLK_MOUT_PERIC0_NOC_USER>,
> + <&cmu_peric0 CLK_DOUT_PERIC0_USI04>;
> + clock-names = "pclk", "ipclk";
> + samsung,sysreg = <&syscon_peric0 0x1024>;
> + status = "disabled";
> +
> + hsi2c_8: i2c@10500000 {
Why not number all the underlying protocol nodes using the same number
as the USI node? Like it's done in gs101.dtsi. And maybe even follow
USI naming scheme used in gs101 in general? Like, sort all USI nodes
by unit address, and then number them starting from 0. If some other
USIs are missing (like I mentioned in my review for the previous
patch), add those too, first.
[snip]
next prev parent reply other threads:[~2025-08-02 0:29 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-30 7:42 [PATCH v2 0/5] arm64: dts: exynos2200: introduce serial busses, except spi Ivaylo Ivanov
2025-07-30 7:42 ` [PATCH v2 1/5] arm64: dts: exynos2200: fix typo in hsi2c23 bus pins label Ivaylo Ivanov
2025-08-01 20:59 ` Sam Protsenko
2025-07-30 7:42 ` [PATCH v2 2/5] arm64: dts: exynos2200: use 32-bit address space for /soc Ivaylo Ivanov
2025-08-01 21:16 ` Sam Protsenko
2025-07-30 7:42 ` [PATCH v2 3/5] arm64: dts: exynos2200: increase peric1 and cmgp syscon sizes Ivaylo Ivanov
2025-08-01 22:11 ` Sam Protsenko
2025-08-06 14:05 ` Ivaylo Ivanov
2025-07-30 7:42 ` [PATCH v2 4/5] arm64: dts: exynos2200: add serial_0/1 nodes Ivaylo Ivanov
2025-08-01 23:12 ` Sam Protsenko
2025-08-06 14:03 ` Ivaylo Ivanov
2025-07-30 7:42 ` [PATCH v2 5/5] arm64: dts: exynos2200: define all usi nodes Ivaylo Ivanov
2025-08-02 0:29 ` Sam Protsenko [this message]
2025-08-06 13:57 ` Ivaylo Ivanov
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=CAPLW+4maFxYv4RrvzUXWwteXAVm64ocj2LSAgtM6RMtzbM_p-w@mail.gmail.com \
--to=semen.protsenko@linaro.org \
--cc=alim.akhtar@samsung.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=ivo.ivanov.ivanov1@gmail.com \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=robh@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).