* [PATCH 0/3] Add support for uartps controller reset
@ 2024-04-19 12:05 Manikanta Guntupalli
2024-04-19 12:05 ` [PATCH 1/3] dt-bindings: serial: cdsn,uart: Add optional reset property Manikanta Guntupalli
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Manikanta Guntupalli @ 2024-04-19 12:05 UTC (permalink / raw)
To: git, gregkh, jirislaby, robh, krzk+dt, conor+dt, michal.simek,
p.zabel, laurent.pinchart, radhey.shyam.pandey, parth.gajjar,
u.kleine-koenig, tglx, julien.malik, ruanjinjie, linux-kernel,
linux-serial, devicetree, linux-arm-kernel
Cc: srinivas.goud, shubhrajyoti.datta, manion05gk,
Manikanta Guntupalli
Add optional resets property for UART nodes.
Add support for uartps controller reset.
Manikanta Guntupalli (3):
dt-bindings: serial: cdsn,uart: Add optional reset property
arm64: zynqmp: Add resets property for UART nodes
tty: serial: uartps: Add support for uartps controller reset
.../devicetree/bindings/serial/cdns,uart.yaml | 3 +++
arch/arm64/boot/dts/xilinx/zynqmp.dtsi | 2 ++
drivers/tty/serial/xilinx_uartps.c | 17 +++++++++++++++++
3 files changed, 22 insertions(+)
--
2.25.1
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH 1/3] dt-bindings: serial: cdsn,uart: Add optional reset property 2024-04-19 12:05 [PATCH 0/3] Add support for uartps controller reset Manikanta Guntupalli @ 2024-04-19 12:05 ` Manikanta Guntupalli 2024-04-19 13:34 ` Krzysztof Kozlowski 2025-04-18 4:38 ` Mukesh Kumar Savaliya 2024-04-19 12:05 ` [PATCH 2/3] arm64: zynqmp: Add resets property for UART nodes Manikanta Guntupalli 2024-04-19 12:05 ` [PATCH 3/3] tty: serial: uartps: Add support for uartps controller reset Manikanta Guntupalli 2 siblings, 2 replies; 7+ messages in thread From: Manikanta Guntupalli @ 2024-04-19 12:05 UTC (permalink / raw) To: git, gregkh, jirislaby, robh, krzk+dt, conor+dt, michal.simek, p.zabel, laurent.pinchart, radhey.shyam.pandey, parth.gajjar, u.kleine-koenig, tglx, julien.malik, ruanjinjie, linux-kernel, linux-serial, devicetree, linux-arm-kernel Cc: srinivas.goud, shubhrajyoti.datta, manion05gk, Manikanta Guntupalli Add optional reset device-tree property to the uartps controller. Signed-off-by: Manikanta Guntupalli <manikanta.guntupalli@amd.com> --- Documentation/devicetree/bindings/serial/cdns,uart.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/serial/cdns,uart.yaml b/Documentation/devicetree/bindings/serial/cdns,uart.yaml index 2129247d7c81..d7f047b0bf24 100644 --- a/Documentation/devicetree/bindings/serial/cdns,uart.yaml +++ b/Documentation/devicetree/bindings/serial/cdns,uart.yaml @@ -46,6 +46,9 @@ properties: power-domains: maxItems: 1 + resets: + maxItems: 1 + required: - compatible - reg -- 2.25.1 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/3] dt-bindings: serial: cdsn,uart: Add optional reset property 2024-04-19 12:05 ` [PATCH 1/3] dt-bindings: serial: cdsn,uart: Add optional reset property Manikanta Guntupalli @ 2024-04-19 13:34 ` Krzysztof Kozlowski 2025-04-18 4:38 ` Mukesh Kumar Savaliya 1 sibling, 0 replies; 7+ messages in thread From: Krzysztof Kozlowski @ 2024-04-19 13:34 UTC (permalink / raw) To: Manikanta Guntupalli, git, gregkh, jirislaby, robh, krzk+dt, conor+dt, michal.simek, p.zabel, laurent.pinchart, radhey.shyam.pandey, parth.gajjar, u.kleine-koenig, tglx, julien.malik, ruanjinjie, linux-kernel, linux-serial, devicetree, linux-arm-kernel Cc: srinivas.goud, shubhrajyoti.datta, manion05gk On 19/04/2024 14:05, Manikanta Guntupalli wrote: > Add optional reset device-tree property to the uartps controller. > > Signed-off-by: Manikanta Guntupalli <manikanta.guntupalli@amd.com> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Best regards, Krzysztof ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/3] dt-bindings: serial: cdsn,uart: Add optional reset property 2024-04-19 12:05 ` [PATCH 1/3] dt-bindings: serial: cdsn,uart: Add optional reset property Manikanta Guntupalli 2024-04-19 13:34 ` Krzysztof Kozlowski @ 2025-04-18 4:38 ` Mukesh Kumar Savaliya 1 sibling, 0 replies; 7+ messages in thread From: Mukesh Kumar Savaliya @ 2025-04-18 4:38 UTC (permalink / raw) To: Manikanta Guntupalli, git, gregkh, jirislaby, robh, krzk+dt, conor+dt, michal.simek, p.zabel, laurent.pinchart, radhey.shyam.pandey, parth.gajjar, u.kleine-koenig, tglx, julien.malik, ruanjinjie, linux-kernel, linux-serial, devicetree, linux-arm-kernel Cc: srinivas.goud, shubhrajyoti.datta, manion05gk On 4/19/2024 5:35 PM, Manikanta Guntupalli wrote: > Add optional reset device-tree property to the uartps controller. what exactly is uartps ? i Couldn't get from google too. > > Signed-off-by: Manikanta Guntupalli <manikanta.guntupalli@amd.com> > --- > Documentation/devicetree/bindings/serial/cdns,uart.yaml | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/Documentation/devicetree/bindings/serial/cdns,uart.yaml b/Documentation/devicetree/bindings/serial/cdns,uart.yaml > index 2129247d7c81..d7f047b0bf24 100644 > --- a/Documentation/devicetree/bindings/serial/cdns,uart.yaml > +++ b/Documentation/devicetree/bindings/serial/cdns,uart.yaml > @@ -46,6 +46,9 @@ properties: > power-domains: > maxItems: 1 > > + resets: > + maxItems: 1 > + > required: > - compatible > - reg ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/3] arm64: zynqmp: Add resets property for UART nodes 2024-04-19 12:05 [PATCH 0/3] Add support for uartps controller reset Manikanta Guntupalli 2024-04-19 12:05 ` [PATCH 1/3] dt-bindings: serial: cdsn,uart: Add optional reset property Manikanta Guntupalli @ 2024-04-19 12:05 ` Manikanta Guntupalli 2024-04-19 12:05 ` [PATCH 3/3] tty: serial: uartps: Add support for uartps controller reset Manikanta Guntupalli 2 siblings, 0 replies; 7+ messages in thread From: Manikanta Guntupalli @ 2024-04-19 12:05 UTC (permalink / raw) To: git, gregkh, jirislaby, robh, krzk+dt, conor+dt, michal.simek, p.zabel, laurent.pinchart, radhey.shyam.pandey, parth.gajjar, u.kleine-koenig, tglx, julien.malik, ruanjinjie, linux-kernel, linux-serial, devicetree, linux-arm-kernel Cc: srinivas.goud, shubhrajyoti.datta, manion05gk, Manikanta Guntupalli Add resets property for UART0 and UART1 nodes Signed-off-by: Manikanta Guntupalli <manikanta.guntupalli@amd.com> --- arch/arm64/boot/dts/xilinx/zynqmp.dtsi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/boot/dts/xilinx/zynqmp.dtsi b/arch/arm64/boot/dts/xilinx/zynqmp.dtsi index 25d20d803230..935504424ec6 100644 --- a/arch/arm64/boot/dts/xilinx/zynqmp.dtsi +++ b/arch/arm64/boot/dts/xilinx/zynqmp.dtsi @@ -906,6 +906,7 @@ uart0: serial@ff000000 { reg = <0x0 0xff000000 0x0 0x1000>; clock-names = "uart_clk", "pclk"; power-domains = <&zynqmp_firmware PD_UART_0>; + resets = <&zynqmp_reset ZYNQMP_RESET_UART0>; }; uart1: serial@ff010000 { @@ -917,6 +918,7 @@ uart1: serial@ff010000 { reg = <0x0 0xff010000 0x0 0x1000>; clock-names = "uart_clk", "pclk"; power-domains = <&zynqmp_firmware PD_UART_1>; + resets = <&zynqmp_reset ZYNQMP_RESET_UART1>; }; usb0: usb@ff9d0000 { -- 2.25.1 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/3] tty: serial: uartps: Add support for uartps controller reset 2024-04-19 12:05 [PATCH 0/3] Add support for uartps controller reset Manikanta Guntupalli 2024-04-19 12:05 ` [PATCH 1/3] dt-bindings: serial: cdsn,uart: Add optional reset property Manikanta Guntupalli 2024-04-19 12:05 ` [PATCH 2/3] arm64: zynqmp: Add resets property for UART nodes Manikanta Guntupalli @ 2024-04-19 12:05 ` Manikanta Guntupalli 2024-04-20 19:04 ` Pandey, Radhey Shyam 2 siblings, 1 reply; 7+ messages in thread From: Manikanta Guntupalli @ 2024-04-19 12:05 UTC (permalink / raw) To: git, gregkh, jirislaby, robh, krzk+dt, conor+dt, michal.simek, p.zabel, laurent.pinchart, radhey.shyam.pandey, parth.gajjar, u.kleine-koenig, tglx, julien.malik, ruanjinjie, linux-kernel, linux-serial, devicetree, linux-arm-kernel Cc: srinivas.goud, shubhrajyoti.datta, manion05gk, Manikanta Guntupalli Add support for an optional reset for the uartps controller using the reset driver. If the uartps node contains the "resets" property, then cdns_uart_startup performs uartps controller non-pulse out of reset and reset in exit path. Signed-off-by: Manikanta Guntupalli <manikanta.guntupalli@amd.com> --- drivers/tty/serial/xilinx_uartps.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index de3487206bcb..e45d6993ba05 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -25,6 +25,7 @@ #include <linux/gpio.h> #include <linux/gpio/consumer.h> #include <linux/delay.h> +#include <linux/reset.h> #define CDNS_UART_TTY_NAME "ttyPS" #define CDNS_UART_NAME "xuartps" @@ -198,6 +199,7 @@ MODULE_PARM_DESC(rx_timeout, "Rx timeout, 1-255"); * @gpiod_rts: Pointer to the gpio descriptor * @rs485_tx_started: RS485 tx state * @tx_timer: Timer for tx + * @rstc: Pointer to the reset control */ struct cdns_uart { struct uart_port *port; @@ -211,6 +213,7 @@ struct cdns_uart { struct gpio_desc *gpiod_rts; bool rs485_tx_started; struct hrtimer tx_timer; + struct reset_control *rstc; }; struct cdns_platform_data { u32 quirks; @@ -948,6 +951,12 @@ static int cdns_uart_startup(struct uart_port *port) is_brk_support = cdns_uart->quirks & CDNS_UART_RXBS_SUPPORT; + if (cdns_uart->rstc) { + ret = reset_control_deassert(cdns_uart->rstc); + if (ret) + return ret; + } + uart_port_lock_irqsave(port, &flags); /* Disable the TX and RX */ @@ -1721,6 +1730,13 @@ static int cdns_uart_probe(struct platform_device *pdev) dev_err(&pdev->dev, "clock name 'ref_clk' is deprecated.\n"); } + cdns_uart_data->rstc = devm_reset_control_get_optional_exclusive(&pdev->dev, NULL); + if (IS_ERR(cdns_uart_data->rstc)) { + rc = PTR_ERR(cdns_uart_data->rstc); + dev_err_probe(&pdev->dev, rc, "Cannot get UART reset\n"); + goto err_out_unregister_driver; + } + rc = clk_prepare_enable(cdns_uart_data->pclk); if (rc) { dev_err(&pdev->dev, "Unable to enable pclk clock.\n"); @@ -1881,6 +1897,7 @@ static void cdns_uart_remove(struct platform_device *pdev) if (console_port == port) console_port = NULL; #endif + reset_control_assert(cdns_uart_data->rstc); if (!--instances) uart_unregister_driver(cdns_uart_data->cdns_uart_driver); -- 2.25.1 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* RE: [PATCH 3/3] tty: serial: uartps: Add support for uartps controller reset 2024-04-19 12:05 ` [PATCH 3/3] tty: serial: uartps: Add support for uartps controller reset Manikanta Guntupalli @ 2024-04-20 19:04 ` Pandey, Radhey Shyam 0 siblings, 0 replies; 7+ messages in thread From: Pandey, Radhey Shyam @ 2024-04-20 19:04 UTC (permalink / raw) To: Guntupalli, Manikanta, git (AMD-Xilinx), gregkh@linuxfoundation.org, jirislaby@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, Simek, Michal, p.zabel@pengutronix.de, laurent.pinchart@ideasonboard.com, Gajjar, Parth, u.kleine-koenig@pengutronix.de, tglx@linutronix.de, julien.malik@unseenlabs.fr, ruanjinjie@huawei.com, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Goud, Srinivas, Datta, Shubhrajyoti, manion05gk@gmail.com, Guntupalli, Manikanta > -----Original Message----- > From: Manikanta Guntupalli <manikanta.guntupalli@amd.com> > Sent: Friday, April 19, 2024 5:36 PM > To: git (AMD-Xilinx) <git@amd.com>; gregkh@linuxfoundation.org; > jirislaby@kernel.org; robh@kernel.org; krzk+dt@kernel.org; > conor+dt@kernel.org; Simek, Michal <michal.simek@amd.com>; > p.zabel@pengutronix.de; laurent.pinchart@ideasonboard.com; Pandey, > Radhey Shyam <radhey.shyam.pandey@amd.com>; Gajjar, Parth > <parth.gajjar@amd.com>; u.kleine-koenig@pengutronix.de; > tglx@linutronix.de; julien.malik@unseenlabs.fr; ruanjinjie@huawei.com; > linux-kernel@vger.kernel.org; linux-serial@vger.kernel.org; > devicetree@vger.kernel.org; linux-arm-kernel@lists.infradead.org > Cc: Goud, Srinivas <srinivas.goud@amd.com>; Datta, Shubhrajyoti > <shubhrajyoti.datta@amd.com>; manion05gk@gmail.com; Guntupalli, > Manikanta <manikanta.guntupalli@amd.com> > Subject: [PATCH 3/3] tty: serial: uartps: Add support for uartps controller > reset > > Add support for an optional reset for the uartps controller using > the reset driver. If the uartps node contains the "resets" property, > then cdns_uart_startup performs uartps controller non-pulse out of reset > and reset in exit path. > > Signed-off-by: Manikanta Guntupalli <manikanta.guntupalli@amd.com> > --- > drivers/tty/serial/xilinx_uartps.c | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > > diff --git a/drivers/tty/serial/xilinx_uartps.c > b/drivers/tty/serial/xilinx_uartps.c > index de3487206bcb..e45d6993ba05 100644 > --- a/drivers/tty/serial/xilinx_uartps.c > +++ b/drivers/tty/serial/xilinx_uartps.c > @@ -25,6 +25,7 @@ > #include <linux/gpio.h> > #include <linux/gpio/consumer.h> > #include <linux/delay.h> > +#include <linux/reset.h> > > #define CDNS_UART_TTY_NAME "ttyPS" > #define CDNS_UART_NAME "xuartps" > @@ -198,6 +199,7 @@ MODULE_PARM_DESC(rx_timeout, "Rx timeout, 1- > 255"); > * @gpiod_rts: Pointer to the gpio descriptor > * @rs485_tx_started: RS485 tx state > * @tx_timer: Timer for tx > + * @rstc: Pointer to the reset control > */ > struct cdns_uart { > struct uart_port *port; > @@ -211,6 +213,7 @@ struct cdns_uart { > struct gpio_desc *gpiod_rts; > bool rs485_tx_started; > struct hrtimer tx_timer; > + struct reset_control *rstc; > }; > struct cdns_platform_data { > u32 quirks; > @@ -948,6 +951,12 @@ static int cdns_uart_startup(struct uart_port *port) > > is_brk_support = cdns_uart->quirks & CDNS_UART_RXBS_SUPPORT; > > + if (cdns_uart->rstc) { > + ret = reset_control_deassert(cdns_uart->rstc); reset_control_deassert already has NULL check , then any need for this additional if check? > + if (ret) > + return ret; > + } > + > uart_port_lock_irqsave(port, &flags); > > /* Disable the TX and RX */ > @@ -1721,6 +1730,13 @@ static int cdns_uart_probe(struct platform_device > *pdev) > dev_err(&pdev->dev, "clock name 'ref_clk' is > deprecated.\n"); > } > > + cdns_uart_data->rstc = > devm_reset_control_get_optional_exclusive(&pdev->dev, NULL); > + if (IS_ERR(cdns_uart_data->rstc)) { > + rc = PTR_ERR(cdns_uart_data->rstc); > + dev_err_probe(&pdev->dev, rc, "Cannot get UART reset\n"); > + goto err_out_unregister_driver; > + } > + > rc = clk_prepare_enable(cdns_uart_data->pclk); > if (rc) { > dev_err(&pdev->dev, "Unable to enable pclk clock.\n"); > @@ -1881,6 +1897,7 @@ static void cdns_uart_remove(struct > platform_device *pdev) > if (console_port == port) > console_port = NULL; > #endif > + reset_control_assert(cdns_uart_data->rstc); > > if (!--instances) > uart_unregister_driver(cdns_uart_data->cdns_uart_driver); > -- > 2.25.1 ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-04-18 4:39 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2024-04-19 12:05 [PATCH 0/3] Add support for uartps controller reset Manikanta Guntupalli 2024-04-19 12:05 ` [PATCH 1/3] dt-bindings: serial: cdsn,uart: Add optional reset property Manikanta Guntupalli 2024-04-19 13:34 ` Krzysztof Kozlowski 2025-04-18 4:38 ` Mukesh Kumar Savaliya 2024-04-19 12:05 ` [PATCH 2/3] arm64: zynqmp: Add resets property for UART nodes Manikanta Guntupalli 2024-04-19 12:05 ` [PATCH 3/3] tty: serial: uartps: Add support for uartps controller reset Manikanta Guntupalli 2024-04-20 19:04 ` Pandey, Radhey Shyam
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox