mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>
Cc: devicetree@vger.kernel.org,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Lukas Wunner <lukas@wunner.de>, Rob Herring <robh@kernel.org>,
	linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org
Subject: Re: [PATCH 1/2] dt-bindings: serial: rs485: add rs485-mux-gpios binding
Date: Wed, 22 Nov 2023 19:00:55 +0100	[thread overview]
Message-ID: <40afeed9-8780-47fa-ac20-6191dd05b239@linaro.org> (raw)
In-Reply-To: <83eeb98d-ea56-4f7c-bed9-fe09aaa4cf7a@rasmusvillemoes.dk>

On 21/11/2023 10:28, Rasmus Villemoes wrote:
> On 21/11/2023 09.34, Krzysztof Kozlowski wrote:
>> On 21/11/2023 09:27, Rasmus Villemoes wrote:
>>> On 21/11/2023 08.52, Krzysztof Kozlowski wrote:
> 
>>>> Anyway, similar comments: this does not look like generic RS485
>>>> property. Are you saying that standard defines such GPIO?
>>>
>>> No, I'm saying that several boards that exist in the wild have the
>>> RX/TX/CTS etc. pins routed to a multiplexer, which in turn routes those
>>> signals to either a rs485 transceiver or an rs232 driver (and those in
>>> turn are connected to different screw terminals). So no, it's not a
>>> property of the rs485 protocol itself, but very much related to making
>>> use of rs485 (and rs232, though of course not simultaneously) on such
>>> boards.
>>
>> Which upstream boards use it?
> 
> None, because the binding doesn't exist.
> 
>> To me it looks like specific to each controller, not to RS485.
> 
> What do you mean "controller"? It's not specific to one particular
> SOC/IP, any uart IP capable of both rs232 and rs485 could be wired to
> circuitry like this.
> 
>>> Would a link to a schematic help?
>>
>> Yes, always :)
> 
> https://ibb.co/B3gzySt
> 
> The UART1.* signals on the right are from the SOC (in this case an
> imx8mp, but I know of other boards e.g. based on powerpc that use a
> similar scheme), and the COM1_Sel is just some gpio. The multiplexer is
> roughly in the middle (U2103).
> 
> As you can see, if one wants to talk rs485, one must set COM1_Sel low
> (and that works just fine by describing the rs485-mux-gpio as
> ACTIVE_LOW), and if one wants to talk rs232, it must be set high. While
> userspace could be tasked with knowing about and handling that gpio on
> top of the ioctl() for switching mode, this really seems like the kind
> of thing that DT is supposed to describe and the kernel is supposed to
> handle.

Yep, the trouble is only the placement. This GPIO mux is neither part of
the UART controller nor connector. Usually such pins in static
configuration are described either as GPIO hogs or as pinctrl. I guess
this matches other GPIOs in that binding, so I think it is fine. You
still though should answer to comments from other folks, including
multiple-GPIO case and mux.

Best regards,
Krzysztof


  reply	other threads:[~2023-11-22 18:01 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-20 15:10 [PATCH 0/2] serial: add rs485-mux-gpio dt binding and support Rasmus Villemoes
2023-11-20 15:10 ` [PATCH 1/2] dt-bindings: serial: rs485: add rs485-mux-gpios binding Rasmus Villemoes
2023-11-21  7:52   ` Krzysztof Kozlowski
2023-11-21  8:27     ` Rasmus Villemoes
2023-11-21  8:34       ` Krzysztof Kozlowski
2023-11-21  9:28         ` Rasmus Villemoes
2023-11-22 18:00           ` Krzysztof Kozlowski [this message]
2023-11-22 14:53   ` Lukas Wunner
2023-11-23 10:07     ` Rasmus Villemoes
2023-11-23 10:38       ` Lukas Wunner
2023-11-23 13:48         ` Rasmus Villemoes
2023-11-25 23:40     ` Lino Sanfilippo
2023-11-27 12:14       ` Christoph Niedermaier
2023-12-06 15:42         ` Lino Sanfilippo
2023-12-07 12:35           ` Andy Shevchenko
2023-12-09 11:24             ` Lino Sanfilippo
2023-12-09 11:47           ` Lino Sanfilippo
2023-12-11 13:07             ` Andy Shevchenko
2023-12-14  8:52               ` Lino Sanfilippo
2023-12-14 10:24               ` Crescent CY Hsieh
2023-12-14 13:41                 ` Christoph Niedermaier
2023-12-14 14:04                   ` Lino Sanfilippo
2023-12-14 14:50                     ` Christoph Niedermaier
2023-12-15 22:13                       ` Lino Sanfilippo
2023-12-18  9:08                         ` Christoph Niedermaier
2023-12-21 15:53                   ` Lukas Wunner
2023-12-23 12:49                     ` Christoph Niedermaier
2023-12-23 13:40                       ` Lino Sanfilippo
2023-12-24 10:11                         ` Christoph Niedermaier
2023-12-28 23:25                         ` Lukas Wunner
2023-11-20 15:10 ` [PATCH 2/2] serial: core: implement support for rs485-mux-gpios Rasmus Villemoes
2023-11-20 23:28   ` Lino Sanfilippo
2023-11-21 10:49   ` Dan Carpenter
2023-11-22 15:10   ` Lukas Wunner
2023-12-04  5:00   ` Dan Carpenter
2023-11-22 14:57 ` [PATCH 0/2] serial: add rs485-mux-gpio dt binding and support Andy Shevchenko
2023-12-27 17:40 [PATCH 1/2] dt-bindings: serial: rs485: add rs485-mux-gpios binding Andy Shevchenko

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=40afeed9-8780-47fa-ac20-6191dd05b239@linaro.org \
    --to=krzysztof.kozlowski@linaro.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=lukas@wunner.de \
    --cc=robh+dt@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

all inboxes | Powered by JetHome®