[PATCH V3 1/4] dt-bindings: serial: rs485: Add GPIO controlling RX enable during TX

Rob Herring robh at kernel.org
Thu Dec 1 15:56:37 PST 2022


On Thu, 01 Dec 2022 12:02:34 +0100, Christoph Niedermaier wrote:
> Add a binding for a generic definition of an output GPIO that sets the
> state of rs485-rx-during-tx. The idea is that the hardware already controls
> the option receiving during sending before it gets to the signal receiving
> hardware. The standard RS485 is a half-duplex bus that in most cases is
> driven by an UART controller. The advantage of using this GPIO is that it
> is independent of the capabilities of the UART core and the UART driver.
> On the hardware side the interface to the bus is controlled by a transceiver,
> that has a pin called RE (RX Enable) or similar, which connects the bus to
> the RX signal of the UART controller. The GPIO can switch between two states
> to control the RE pin via an electrical circuit:
> - Active:
>   The RE pin is always active. The UART RX see everything on the bus and
>   therefore also what happens with the TX signal on the bus.
> - Inactive:
>   The RE pin is always active, but during sending on the bus the pin RE is
>   inactive. So basically the receiving during sending is suppressed.
> 
> A possible circuit diagram could look like this:
>                                   ┌──────────────────┐
>                                   │       RS485      │
>                 TX ───────────────┤D                 │
>                                   │    Transceiver   │
>                RTS ────┬──────────┤DE                │
>                        │          │                  │
>                        │ ┌─────┐  │                  │
>                        └─┤&    │  │                  │
>                          │     ├──┤!RE               │
> !rx_during_tx_gpio ──────┤     │  │                  │
>                          └─────┘  │                  │
>                                   │                  │
>                 RX ───────────────┤R                 │
>                                   │                  │
>                                   └──────────────────┘
> 
> Here the RTS pin of the UART core is used to control TX via the transceiver
> pin DE (Drive Enable). RE and rx_during_tx_gpio are active low.
> 
> Signed-off-by: Christoph Niedermaier <cniedermaier at dh-electronics.com>
> ---
> Cc: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
> Cc: Rob Herring <robh+dt at kernel.org>
> Cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt at linaro.org>
> Cc: Alexander Dahl <ada at thorsis.com>
> Cc: Marek Vasut <marex at denx.de>
> Cc: kernel at dh-electronics.com
> Cc: devicetree at vger.kernel.org
> To: linux-serial at vger.kernel.org
> To: linux-arm-kernel at lists.infradead.org
> ---
> V2: - Rework of the commit message
>     - Rework GPIO property comment
> V3: - Rework the binding description
>     - Rework message title
>     - Rework of the commit message
> ---
>  Documentation/devicetree/bindings/serial/rs485.yaml | 6 ++++++
>  1 file changed, 6 insertions(+)
> 

Reviewed-by: Rob Herring <robh at kernel.org>



More information about the linux-arm-kernel mailing list