* [PATCH 5/6] tty: serial: qcom_geni_serial: Add interconnect support [not found] <1548069703-26595-1-git-send-email-alokc@codeaurora.org> @ 2019-01-21 11:21 ` Alok Chauhan 0 siblings, 0 replies; 3+ messages in thread From: Alok Chauhan @ 2019-01-21 11:21 UTC (permalink / raw) To: linux-arm-msm, devicetree, Greg Kroah-Hartman, Jiri Slaby, linux-serial, linux-kernel Cc: andy.gross, david.brown, georgi.djakov, dianders, swboyd, bjorn.andersson, Alok Chauhan Get the interconnect paths for Uart based Serial Engine device and vote accordingly based on maximum supported Uart frequency. Signed-off-by: Alok Chauhan <alokc@codeaurora.org> --- drivers/tty/serial/qcom_geni_serial.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c index a72d6d9..e2ea499 100644 --- a/drivers/tty/serial/qcom_geni_serial.c +++ b/drivers/tty/serial/qcom_geni_serial.c @@ -19,6 +19,7 @@ #include <linux/slab.h> #include <linux/tty.h> #include <linux/tty_flip.h> +#include <linux/interconnect.h> /* UART specific GENI registers */ #define SE_UART_LOOPBACK_CFG 0x22c @@ -1348,6 +1349,22 @@ static int qcom_geni_serial_probe(struct platform_device *pdev) return ret; } + /* Set the bus quota to a reasonable value */ + port->se.avg_bw = console ? Bps_to_icc(1000) : Bps_to_icc(2500); + port->se.peak_bw = Bps_to_icc(76800000); + ret = geni_interconnect_init(&port->se); + if (ret) { + dev_err(&pdev->dev, "interconnect_init failed %d\n", ret); + return ret; + } + + /* + * Vote for interconnect path early. This has to move as part of + * Runtime PM APIs when implemented for better control betwen + * console and non-console usecases + */ + geni_icc_update_bw(&port->se, true); + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) return -EINVAL; @@ -1385,8 +1402,15 @@ static int __maybe_unused qcom_geni_serial_sys_suspend(struct device *dev) { struct qcom_geni_serial_port *port = dev_get_drvdata(dev); struct uart_port *uport = &port->uport; + int ret; + + ret = uart_suspend_port(uport->private_data, uport); + if (ret) + return ret; + + geni_icc_update_bw(&port->se, false); - return uart_suspend_port(uport->private_data, uport); + return 0; } static int __maybe_unused qcom_geni_serial_sys_resume(struct device *dev) @@ -1394,6 +1418,7 @@ static int __maybe_unused qcom_geni_serial_sys_resume(struct device *dev) struct qcom_geni_serial_port *port = dev_get_drvdata(dev); struct uart_port *uport = &port->uport; + geni_icc_update_bw(&port->se, true); return uart_resume_port(uport->private_data, uport); } -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project ^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 0/6] Add interconnect support for GENI QUPs @ 2019-01-22 6:33 Alok Chauhan 2019-01-22 6:33 ` [PATCH 5/6] tty: serial: qcom_geni_serial: Add interconnect support Alok Chauhan 0 siblings, 1 reply; 3+ messages in thread From: Alok Chauhan @ 2019-01-22 6:33 UTC (permalink / raw) To: linux-arm-msm, devicetree, linux-kernel, linux-i2c, linux-spi, linux-serial Cc: andy.gross, david.brown, georgi.djakov, dianders, swboyd, bjorn.andersson, Alok Chauhan This patch series contains following: * Add wrapper framework to support interconnect path from GENI QUPs. This wrapper enabled and help individual SEs to put their BW request. Adding this wrapper make sense because we don't want individual SEs to request to interconnect driver separately and put individual bw votes from QUP. This wrapper framework does the following: - Request for interconnect path handle - Maintain record of individual SEs' avg/peak bw. - Aggregated avg/peak bw based on how many SE's are active and put single bw request from QUP * Interconnect wrapper API calling from I2C, SPI & Uart driver * dt binding in sdm845 soc for Interconnect path for GENI QUPs * dt binding documentation Alok Chauhan (6): dt-bindings: soc: qcom: Add interconnect binding for GENI QUP soc: qcom: Add wrapper to support for Interconnect path i2c: i2c-qcom-geni: Add interconnect support spi: spi-geni-qcom: Add interconnect support tty: serial: qcom_geni_serial: Add interconnect support arm64: dts: sdm845: Add interconnect for GENI QUP .../devicetree/bindings/soc/qcom/qcom,geni-se.txt | 10 ++ arch/arm64/boot/dts/qcom/sdm845.dtsi | 14 +++ drivers/i2c/busses/i2c-qcom-geni.c | 13 +++ drivers/soc/qcom/qcom-geni-se.c | 129 +++++++++++++++++++++ drivers/spi/spi-geni-qcom.c | 20 +++- drivers/tty/serial/qcom_geni_serial.c | 27 ++++- include/linux/qcom-geni-se.h | 11 ++ 7 files changed, 222 insertions(+), 2 deletions(-) -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project ^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 5/6] tty: serial: qcom_geni_serial: Add interconnect support 2019-01-22 6:33 [PATCH 0/6] Add interconnect support for GENI QUPs Alok Chauhan @ 2019-01-22 6:33 ` Alok Chauhan 2019-01-23 6:53 ` alokc 0 siblings, 1 reply; 3+ messages in thread From: Alok Chauhan @ 2019-01-22 6:33 UTC (permalink / raw) To: linux-arm-msm, devicetree, linux-kernel, linux-i2c, linux-spi, linux-serial, Greg Kroah-Hartman, Jiri Slaby Cc: andy.gross, david.brown, georgi.djakov, dianders, swboyd, bjorn.andersson, Alok Chauhan Get the interconnect paths for Uart based Serial Engine device and vote accordingly based on maximum supported Uart frequency. Signed-off-by: Alok Chauhan <alokc@codeaurora.org> --- drivers/tty/serial/qcom_geni_serial.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c index a72d6d9..e2ea499 100644 --- a/drivers/tty/serial/qcom_geni_serial.c +++ b/drivers/tty/serial/qcom_geni_serial.c @@ -19,6 +19,7 @@ #include <linux/slab.h> #include <linux/tty.h> #include <linux/tty_flip.h> +#include <linux/interconnect.h> /* UART specific GENI registers */ #define SE_UART_LOOPBACK_CFG 0x22c @@ -1348,6 +1349,22 @@ static int qcom_geni_serial_probe(struct platform_device *pdev) return ret; } + /* Set the bus quota to a reasonable value */ + port->se.avg_bw = console ? Bps_to_icc(1000) : Bps_to_icc(2500); + port->se.peak_bw = Bps_to_icc(76800000); + ret = geni_interconnect_init(&port->se); + if (ret) { + dev_err(&pdev->dev, "interconnect_init failed %d\n", ret); + return ret; + } + + /* + * Vote for interconnect path early. This has to move as part of + * Runtime PM APIs when implemented for better control betwen + * console and non-console usecases + */ + geni_icc_update_bw(&port->se, true); + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) return -EINVAL; @@ -1385,8 +1402,15 @@ static int __maybe_unused qcom_geni_serial_sys_suspend(struct device *dev) { struct qcom_geni_serial_port *port = dev_get_drvdata(dev); struct uart_port *uport = &port->uport; + int ret; + + ret = uart_suspend_port(uport->private_data, uport); + if (ret) + return ret; + + geni_icc_update_bw(&port->se, false); - return uart_suspend_port(uport->private_data, uport); + return 0; } static int __maybe_unused qcom_geni_serial_sys_resume(struct device *dev) @@ -1394,6 +1418,7 @@ static int __maybe_unused qcom_geni_serial_sys_resume(struct device *dev) struct qcom_geni_serial_port *port = dev_get_drvdata(dev); struct uart_port *uport = &port->uport; + geni_icc_update_bw(&port->se, true); return uart_resume_port(uport->private_data, uport); } -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 5/6] tty: serial: qcom_geni_serial: Add interconnect support 2019-01-22 6:33 ` [PATCH 5/6] tty: serial: qcom_geni_serial: Add interconnect support Alok Chauhan @ 2019-01-23 6:53 ` alokc 0 siblings, 0 replies; 3+ messages in thread From: alokc @ 2019-01-23 6:53 UTC (permalink / raw) To: linux-arm-msm, devicetree, linux-kernel, linux-i2c, linux-spi, linux-serial, Greg Kroah-Hartman, Jiri Slaby, Mark Brown Cc: andy.gross, david.brown, georgi.djakov, dianders, swboyd, bjorn.andersson, linux-serial-owner +Mark Brown On 2019-01-22 12:03, Alok Chauhan wrote: > Get the interconnect paths for Uart based Serial Engine device > and vote accordingly based on maximum supported Uart frequency. > > Signed-off-by: Alok Chauhan <alokc@codeaurora.org> > --- > drivers/tty/serial/qcom_geni_serial.c | 27 ++++++++++++++++++++++++++- > 1 file changed, 26 insertions(+), 1 deletion(-) > > diff --git a/drivers/tty/serial/qcom_geni_serial.c > b/drivers/tty/serial/qcom_geni_serial.c > index a72d6d9..e2ea499 100644 > --- a/drivers/tty/serial/qcom_geni_serial.c > +++ b/drivers/tty/serial/qcom_geni_serial.c > @@ -19,6 +19,7 @@ > #include <linux/slab.h> > #include <linux/tty.h> > #include <linux/tty_flip.h> > +#include <linux/interconnect.h> > > /* UART specific GENI registers */ > #define SE_UART_LOOPBACK_CFG 0x22c > @@ -1348,6 +1349,22 @@ static int qcom_geni_serial_probe(struct > platform_device *pdev) > return ret; > } > > + /* Set the bus quota to a reasonable value */ > + port->se.avg_bw = console ? Bps_to_icc(1000) : Bps_to_icc(2500); > + port->se.peak_bw = Bps_to_icc(76800000); > + ret = geni_interconnect_init(&port->se); > + if (ret) { > + dev_err(&pdev->dev, "interconnect_init failed %d\n", ret); > + return ret; > + } > + > + /* > + * Vote for interconnect path early. This has to move as part of > + * Runtime PM APIs when implemented for better control betwen > + * console and non-console usecases > + */ > + geni_icc_update_bw(&port->se, true); > + > res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > if (!res) > return -EINVAL; > @@ -1385,8 +1402,15 @@ static int __maybe_unused > qcom_geni_serial_sys_suspend(struct device *dev) > { > struct qcom_geni_serial_port *port = dev_get_drvdata(dev); > struct uart_port *uport = &port->uport; > + int ret; > + > + ret = uart_suspend_port(uport->private_data, uport); > + if (ret) > + return ret; > + > + geni_icc_update_bw(&port->se, false); > > - return uart_suspend_port(uport->private_data, uport); > + return 0; > } > > static int __maybe_unused qcom_geni_serial_sys_resume(struct device > *dev) > @@ -1394,6 +1418,7 @@ static int __maybe_unused > qcom_geni_serial_sys_resume(struct device *dev) > struct qcom_geni_serial_port *port = dev_get_drvdata(dev); > struct uart_port *uport = &port->uport; > > + geni_icc_update_bw(&port->se, true); > return uart_resume_port(uport->private_data, uport); > } -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,a Linux Foundation Collaborative Project ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-01-23 6:53 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <1548069703-26595-1-git-send-email-alokc@codeaurora.org> 2019-01-21 11:21 ` [PATCH 5/6] tty: serial: qcom_geni_serial: Add interconnect support Alok Chauhan 2019-01-22 6:33 [PATCH 0/6] Add interconnect support for GENI QUPs Alok Chauhan 2019-01-22 6:33 ` [PATCH 5/6] tty: serial: qcom_geni_serial: Add interconnect support Alok Chauhan 2019-01-23 6:53 ` alokc
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).