devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: claudiu beznea <claudiu.beznea@tuxon.dev>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: s.shtylyov@omp.ru, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, robh+dt@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org,
	linux@armlinux.org.uk, geert+renesas@glider.be,
	magnus.damm@gmail.com, mturquette@baylibre.com, sboyd@kernel.org,
	linus.walleij@linaro.org, p.zabel@pengutronix.de, arnd@arndb.de,
	m.szyprowski@samsung.com, alexandre.torgue@foss.st.com,
	afd@ti.com, broonie@kernel.org, alexander.stein@ew.tq-group.com,
	eugen.hristev@collabora.com, sergei.shtylyov@gmail.com,
	prabhakar.mahadev-lad.rj@bp.renesas.com,
	biju.das.jz@bp.renesas.com, linux-renesas-soc@vger.kernel.org,
	netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org,
	linux-gpio@vger.kernel.org,
	Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Subject: Re: [PATCH 11/14] arm64: renesas: rzg3s-smarc-som: Invert the logic for SW_SD2_EN macro
Date: Wed, 6 Dec 2023 13:31:32 +0200	[thread overview]
Message-ID: <6e14077c-ceb6-4921-8db2-1dc4a99856c6@tuxon.dev> (raw)
In-Reply-To: <CAMuHMdXo9Pj1NJ+XK-XKj18ynZ3gOxrXQpjMsTjfziTAyjYMdA@mail.gmail.com>



On 06.12.2023 13:27, Geert Uytterhoeven wrote:
> Hi Claudiu,
> 
> On Wed, Dec 6, 2023 at 12:12 PM claudiu beznea <claudiu.beznea@tuxon.dev> wrote:
>> On 06.12.2023 12:56, Geert Uytterhoeven wrote:
>>> On Wed, Dec 6, 2023 at 11:33 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>>>> On Mon, Nov 20, 2023 at 8:03 AM Claudiu <claudiu.beznea@tuxon.dev> wrote:
>>>>> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>>>>>
>>>>> The intention of SW_SD2_EN macro was to reflect the state of SW_CONFIG3
>>>>> switch available on RZ/G3S Smarc Module. According to documentation SD2
>>>>> is enabled when switch is in OFF state. For this, changed the logic of
>>>>> marco to map value 0 to switch's OFF state and value 1 to switch's ON
>>>>> state. Along with this update the description for each state for better
>>>>> understanding.
>>>>>
>>>>> The value of SW_SD2_EN macro was not changed in file because, according to
>>>>> documentation, the default state for this switch is ON.
>>>>>
>>>>> Fixes: adb4f0c5699c ("arm64: dts: renesas: Add initial support for RZ/G3S SMARC SoM")
>>>>> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>>>>
>>>> Thanks for your patch!
>>>>
>>>>> --- a/arch/arm64/boot/dts/renesas/rzg3s-smarc-som.dtsi
>>>>> +++ b/arch/arm64/boot/dts/renesas/rzg3s-smarc-som.dtsi
>>>>> @@ -14,8 +14,8 @@
>>>>>   *     0 - SD0 is connected to eMMC
>>>>>   *     1 - SD0 is connected to uSD0 card
>>>>>   * @SW_SD2_EN:
>>>>> - *     0 - SCIF1, SSI0, IRQ0, IRQ1 connected to SoC
>>>>> - *     1 - SD2 is connected to SoC
>>>>> + *     0 - (switch OFF) SD2 is connected to SoC
>>>>> + *     1 - (switch ON)  SCIF1, SSI0, IRQ0, IRQ1 connected to SoC
>>>>
>>>> I think this is still confusing: SW_SD2_EN refers to an active-low signal
>>>> (SW_SD2_EN#) in the schematics.
>>>
>>> OMG, while the signal is called "SW_SD2_EN#" in the schematics, it is
>>> _not_ active-low!
>>> SW_D2_EN# drives a STG3692 quad SPDT switch, and SD2 is enabled
>>> if SW_D2_EN# is high...
>>>
>>> The RZ/G3S SMARC Module User Manual says:
>>>
>>> Signal SW_SD2_EN ON: SD2 is disabled.
>>> Signal SW_SD2_EN OFF: SD2 is enabled.
>>
>> I followed the description in this manual, chapter 2.1.1 SW_CONFIG. The
>> idea was that these macros to correspond to individual switches, to match
>> that table (describing switches position) with this code as the user in the
>> end sets those switches described in table at 2.1.1 w/o necessary going
>> deep into schematic (at least in the beginning when trying different
>> functionalities).
>>
>> Do you think it would be better if we will have these macros named
>> SWCONFIGX, X in {1, 2, 3, 4, 5, 6} ?
> 
> Perhaps. A disadvantage would be that SW_CONFIG%u doesn't
> give any indication about its purpose...

That's the reason I chose initially to have the signal names instead of
SWCONFIGX.

Now seeing that signal names could be confusing I tend to go with SWCONFIGx
instead.

> 
>>> So whatever we do, something will look odd :-(
>>>
>>>> Before, SW_SD2_EN used assertion-logic (1 is enabled), and didn't
>>>> match the physical signal level.
>>>> After your patch, SW_SD2_EN matches the active-low physical level, but
>>>> this is not reflected in the name...
>>>>
>>>>>   */
>>>>>  #define SW_SD0_DEV_SEL 1
>>>>>  #define SW_SD2_EN      1
>>>>> @@ -25,7 +25,7 @@ / {
>>>>>
>>>>>         aliases {
>>>>>                 mmc0 = &sdhi0;
>>>>> -#if SW_SD2_EN
>>>>> +#if !SW_SD2_EN
>>>>
>>>> ... so this condition looks really weird.
>>>
>>> Still, I think the original looks nicer here.
>>>
>>> So I suggest to keep the original logic, but clarify the position of
>>> the switch.
>>> Does that make sense?
>>
>> It will still be odd, AFAICT, as this way as we will map 0 to ON and 1 to
>> OFF... A bit counterintuitive.
> 
> Most switches on board pull signals LOW when the switch is ON...
> 
> Gr{oetje,eeting}s,
> 
>                         Geert
> 

  reply	other threads:[~2023-12-06 11:31 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-20  7:00 [PATCH 00/14] renesas: rzg3s: Add support for Ethernet Claudiu
2023-11-20  7:00 ` [PATCH 01/14] clk: renesas: rzg2l-cpg: Reuse code in rzg2l_cpg_reset() Claudiu
2023-11-23 15:48   ` Geert Uytterhoeven
2023-11-20  7:00 ` [PATCH 02/14] clk: renesas: rzg2l-cpg: Check reset monitor registers Claudiu
2023-11-23 15:53   ` Geert Uytterhoeven
2023-11-23 17:19     ` claudiu beznea
2023-11-20  7:00 ` [PATCH 03/14] clk: renesas: rzg2l-cpg: Add support for MSTOP Claudiu
2023-11-23 16:35   ` Geert Uytterhoeven
2023-11-24  9:08     ` Geert Uytterhoeven
2023-11-27  7:37       ` claudiu beznea
2023-12-01 15:36         ` Geert Uytterhoeven
2023-11-24  9:24     ` claudiu beznea
2023-11-20  7:00 ` [PATCH 04/14] clk: renesas: r9a08g045-cpg: Add clock and reset support for ETH0 and ETH1 Claudiu
2023-12-01 15:59   ` Geert Uytterhoeven
2023-12-04  7:34     ` claudiu beznea
2023-11-20  7:00 ` [PATCH 05/14] pinctrl: renesas: rzg2l: Move arg in the main function block Claudiu
2023-12-01 16:15   ` Geert Uytterhoeven
2023-12-04  7:37     ` claudiu beznea
2023-11-20  7:00 ` [PATCH 06/14] pinctrl: renesas: rzg2l: Add pin configuration support for pinmux groups Claudiu
2023-12-01 16:51   ` Geert Uytterhoeven
2023-11-20  7:00 ` [PATCH 07/14] pinctrl: renesas: rzg2l: Add support to select power source for Ethernet pins Claudiu
2023-12-01 17:11   ` Geert Uytterhoeven
2023-11-20  7:00 ` [PATCH 08/14] pinctrl: renesas: rzg2l: Add output enable support Claudiu
2023-12-01 17:25   ` Geert Uytterhoeven
2023-11-20  7:00 ` [PATCH 09/14] dt-bindings: net: renesas,etheravb: Document RZ/G3S support Claudiu
2023-11-20 15:39   ` Conor Dooley
2023-11-20 18:39   ` Sergey Shtylyov
2023-11-21 16:29   ` Geert Uytterhoeven
2023-11-20  7:00 ` [PATCH 10/14] arm64: renesas: r9a08g045: Add Ethernet nodes Claudiu
2023-12-01 17:35   ` Geert Uytterhoeven
2023-12-04  7:41     ` claudiu beznea
2023-12-04  8:02       ` Geert Uytterhoeven
2023-12-04  8:38         ` claudiu beznea
2023-12-04  9:00           ` Geert Uytterhoeven
2023-11-20  7:00 ` [PATCH 11/14] arm64: renesas: rzg3s-smarc-som: Invert the logic for SW_SD2_EN macro Claudiu
2023-12-06 10:33   ` Geert Uytterhoeven
2023-12-06 10:56     ` Geert Uytterhoeven
2023-12-06 11:11       ` claudiu beznea
2023-12-06 11:27         ` Geert Uytterhoeven
2023-12-06 11:31           ` claudiu beznea [this message]
2023-11-20  7:00 ` [PATCH 12/14] arm64: dts: renesas: Improve documentation for SW_SD0_DEV_SEL Claudiu
2023-11-20  8:41   ` Sergey Shtylyov
2023-12-06 11:03   ` Geert Uytterhoeven
2023-11-20  7:00 ` [PATCH 13/14] arm64: dts: renesas: rzg3s-smarc-som: Enable Ethernet interfaces Claudiu
2023-12-06 11:22   ` Geert Uytterhoeven
2023-12-06 11:48     ` claudiu beznea
2023-11-20  7:00 ` [PATCH 14/14] arm: multi_v7_defconfig: Enable CONFIG_RAVB Claudiu
2023-11-20  8:44   ` Arnd Bergmann
2023-11-20  8:56     ` claudiu beznea
2023-11-20  8:58     ` Geert Uytterhoeven
2023-11-20  9:05       ` claudiu beznea
2023-11-27 10:01       ` Geert Uytterhoeven
2023-11-23 15:01 ` [PATCH 00/14] renesas: rzg3s: Add support for Ethernet Linus Walleij

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=6e14077c-ceb6-4921-8db2-1dc4a99856c6@tuxon.dev \
    --to=claudiu.beznea@tuxon.dev \
    --cc=afd@ti.com \
    --cc=alexander.stein@ew.tq-group.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=arnd@arndb.de \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=broonie@kernel.org \
    --cc=claudiu.beznea.uj@bp.renesas.com \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=eugen.hristev@collabora.com \
    --cc=geert+renesas@glider.be \
    --cc=geert@linux-m68k.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=kuba@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=m.szyprowski@samsung.com \
    --cc=magnus.damm@gmail.com \
    --cc=mturquette@baylibre.com \
    --cc=netdev@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=pabeni@redhat.com \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
    --cc=robh+dt@kernel.org \
    --cc=s.shtylyov@omp.ru \
    --cc=sboyd@kernel.org \
    --cc=sergei.shtylyov@gmail.com \
    /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).