All of lore.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Changhuang Liang <changhuang.liang@starfivetech.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>
Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v1 2/2] soc: starfive: Add JHB100 UART Routing driver
Date: Sun, 30 Aug 2026 10:35:39 +0200	[thread overview]
Message-ID: <417251d0-c2cc-4e10-940d-b75ab20acdec@kernel.org> (raw)
In-Reply-To: <20260830065118.51551-3-changhuang.liang@starfivetech.com>

On 30/08/2026 08:51, Changhuang Liang wrote:
> Add driver support for JHB100 UART Routing control, allowing runtime
> configuration of RX muxes between UART controllers and I/O pins.
> 
> A sysfs interface is provided for easy checking and updating of routing
> paths.
> 
> Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com>
> ---
>  .../sysfs-driver-starfive-jhb100-uart-routing |  45 +++
>  MAINTAINERS                                   |   7 +
>  drivers/soc/starfive/Kconfig                  |   1 +
>  drivers/soc/starfive/Makefile                 |   1 +
>  drivers/soc/starfive/uart-routing/Kconfig     |  14 +
>  drivers/soc/starfive/uart-routing/Makefile    |   2 +
>  .../uart-routing/jhb100-uart-routing.c        | 262 ++++++++++++++++++
>  7 files changed, 332 insertions(+)
>  create mode 100644 Documentation/ABI/testing/sysfs-driver-starfive-jhb100-uart-routing
>  create mode 100644 drivers/soc/starfive/uart-routing/Kconfig
>  create mode 100644 drivers/soc/starfive/uart-routing/Makefile
>  create mode 100644 drivers/soc/starfive/uart-routing/jhb100-uart-routing.c
> 
> diff --git a/Documentation/ABI/testing/sysfs-driver-starfive-jhb100-uart-routing b/Documentation/ABI/testing/sysfs-driver-starfive-jhb100-uart-routing
> new file mode 100644
> index 000000000000..2844133bea1b
> --- /dev/null
> +++ b/Documentation/ABI/testing/sysfs-driver-starfive-jhb100-uart-routing
> @@ -0,0 +1,45 @@
> +What:		/sys/bus/platform/drivers/starfive-jhb100-uart-routing/\*/uart\*
> +Date:		August 2026
> +Contact:	Changhuang Liang <changhuang.liang@starfivetech.com>
> +Description:	Selects the RX source of the UARTx device.
> +
> +		When read, each file shows the list of available options with currently
> +		selected option marked by brackets "[]". The list of available options
> +		depends on the selected file.
> +
> +		e.g.
> +		cat /sys/bus/platform/drivers/starfive-jhb100-uart-routing/\*.uart-routing/uart1
> +		io0 [io1] io2 io3 io4 io5 io6 io7 io8 io9 io10 io11 io12 io13 io14 uart0 uart1
> +		uart2 uart3 uart4 uart5 uart6 uart7 uart8 uart9 uart10 uart11 uart12 uart13 uart14
> +
> +		In this case, UART1 gets its input from IO1 (physical serial port 1).
> +
> +		To switch the RX source of UART1 to UART2, write the desired source to the file:
> +		echo uart2 > /sys/bus/platform/drivers/starfive-jhb100-uart-routing/*.uart-routing/uart1
> +
> +		This indicates that UART1 now receives its input from UART2.
> +
> +Users:		OpenBMC.  Proposed changes should be mailed to
> +		openbmc@lists.ozlabs.org
> +
> +What:		/sys/bus/platform/drivers/starfive-jhb100-uart-routing/\*/io\*
> +Date:		August 2026
> +Contact:	Changhuang Liang <changhuang.liang@starfivetech.com>
> +Description:	Selects the RX source of IOx serial port. The current selection
> +		will be marked by brackets "[]". The list of available options
> +		depends on the selected file.
> +
> +		e.g.
> +		cat /sys/bus/platform/drivers/starfive-jhb100-uart-routing/\*.uart-routing/io9
> +		uart0 uart1 uart2 uart3 uart4 uart5 uart6 uart7 uart8 [uart9] uart10 uart11 uart12
> +		uart13 uart14 io0 io1 io2 io3 io4 io5 io6 io7 io8 io9 io10 io11 io12 io13 io14
> +
> +		In this case, IO9 (physical serial port 9) gets its input from UART9.
> +
> +		To switch the RX source of IO9 to UART10, write the desired source to the file:
> +		echo uart10 > /sys/bus/platform/drivers/starfive-jhb100-uart-routing/*.uart-routing/io9
> +
> +		This indicates that IO9 now receives its input from UART10.
> +
> +Users:		OpenBMC.  Proposed changes should be mailed to
> +		openbmc@lists.ozlabs.org

drivers/soc/ should not define user-space interfaces. This is not the
place for them. You need to route user-spaces interfaces only through
one of other approved subsystems, after their review.

This looks like pin multiplexing interface.

Best regards,
Krzysztof

  reply	other threads:[~2026-08-30  8:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-30  6:51 [PATCH v1 0/2] Add support for StarFive JHB100 UART Routing Changhuang Liang
2026-08-30  6:51 ` [PATCH v1 1/2] dt-bindings: soc: starfive: Add JHB100 UART routing controller Changhuang Liang
2026-08-30  6:51 ` [PATCH v1 2/2] soc: starfive: Add JHB100 UART Routing driver Changhuang Liang
2026-08-30  8:35   ` Krzysztof Kozlowski [this message]
2026-08-31  1:35     ` Changhuang Liang
2026-08-31  5:54       ` Krzysztof Kozlowski
2026-08-31  6:01         ` Changhuang Liang
2026-08-31 17:24           ` Conor Dooley
2026-09-01  1:38             ` Changhuang Liang
2026-09-03  9:32               ` Krzysztof Kozlowski
2026-09-03 11:29                 ` Changhuang Liang
2026-09-16 13:11                 ` Linus Walleij
2026-09-19 10:55                   ` Changhuang Liang
2026-09-16 13:09       ` 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=417251d0-c2cc-4e10-940d-b75ab20acdec@kernel.org \
    --to=krzk@kernel.org \
    --cc=changhuang.liang@starfivetech.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@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 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.