Changes in V2:
- As per Matthias's comment added wakeup support for all the UARTs
of SC7180.
- Added sleep state in sc7180-idp.dts file.
- Modify the if check in set_mctrl API in serial driver to avoid
making RFR high during suspend.
Changes in V3:
- As per Matthias's comments modify the idp dts pin config to keep
only the required pin settings.
- Remove the extra parentheses from serial driver patch.
Changes in V4:
- As per Matthias's comments, change the commit text to mention why
GPIO function needs to be selected in sleep.
- Add separate patch for improvements made in pin conf settings.
Changes in V5:
- Moved pinctrl and interrupt configuration to board specific files.
- Added new patch for trogdor board specific changes.
satya priya (4):
arm64: dts: qcom: sc7180: Improve the pin config settings for CTS and
TX
arm64: dts: qcom: sc7180: Add necessary pinctrl and interrupt config
for BT UART
arm64: dts: qcom: sc7180-trogdor: Add pinctrl and interrupt config for
BT UART
tty: serial: qcom_geni_serial: Fix the UART wakeup issue
arch/arm64/boot/dts/qcom/sc7180-idp.dts | 58 +++++++++++++++++++++++++---
arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi | 48 +++++++++++++++++++++++
drivers/tty/serial/qcom_geni_serial.c | 2 +-
3 files changed, 101 insertions(+), 7 deletions(-)
--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation
As a part of system suspend uart_port_suspend is called from the
Serial driver, which calls set_mctrl passing mctrl as 0. This
makes RFR high(NOT_READY) during suspend.
Due to this BT SoC is not able to send wakeup bytes to UART during
suspend. Include if check for non-suspend case to keep RFR low
during suspend.
Signed-off-by: satya priya <[email protected]>
Acked-by: Greg Kroah-Hartman <[email protected]>
Reviewed-by: Akash Asthana <[email protected]>
---
Changes in V2:
- This patch fixes the UART flow control issue during suspend.
Newly added in V2.
Changes in V3:
- As per Matthias's comment removed the extra parentheses.
Changes in V4:
- No change.
Changes in V5:
- As per Matthias comment, fixed nit-pick in commit text.
drivers/tty/serial/qcom_geni_serial.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c
index 3aa29d2..bc63c54 100644
--- a/drivers/tty/serial/qcom_geni_serial.c
+++ b/drivers/tty/serial/qcom_geni_serial.c
@@ -242,7 +242,7 @@ static void qcom_geni_serial_set_mctrl(struct uart_port *uport,
if (mctrl & TIOCM_LOOP)
port->loopback = RX_TX_CTS_RTS_SORTED;
- if (!(mctrl & TIOCM_RTS))
+ if (!(mctrl & TIOCM_RTS) && !uport->suspended)
uart_manual_rfr = UART_MANUAL_RFR_EN | UART_RFR_NOT_READY;
writel(uart_manual_rfr, uport->membase + SE_UART_MANUAL_RFR);
}
--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation
Add a suitable sleep configuration for uart3 to support Bluetooth wakeup.
If QUP function is selected in sleep state, UART RTS/RFR is pulled high
during suspend and BT SoC not able to send wakeup bytes. So, configure
GPIO mode in sleep state to keep it low during suspend.
Signed-off-by: satya priya <[email protected]>
---
Changes in V5:
- Newly added in V5. This patch adds wakeup support for trogdor board files.
arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi | 48 ++++++++++++++++++++++++++++
1 file changed, 48 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi b/arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi
index a6b9beb..96b5331 100644
--- a/arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi
@@ -792,6 +792,11 @@ ap_spi_fp: &spi10 {
#include <arm/cros-ec-sbs.dtsi>
&uart3 {
+ pinctrl-names = "default", "sleep";
+ pinctrl-1 = <&qup_uart3_sleep>;
+ interrupts-extended = <&intc GIC_SPI 604 IRQ_TYPE_LEVEL_HIGH>,
+ <&tlmm 41 IRQ_TYPE_EDGE_FALLING>;
+
status = "okay";
bluetooth: bluetooth {
@@ -1345,4 +1350,47 @@ ap_spi_fp: &spi10 {
drive-strength = <2>;
};
};
+
+ qup_uart3_sleep: qup-uart3-sleep {
+ pinmux {
+ pins = "gpio38", "gpio39",
+ "gpio40", "gpio41";
+ function = "gpio";
+ };
+
+ pinconf-cts {
+ /*
+ * Configure a pull-down on CTS to match the pull of
+ * the Bluetooth module.
+ */
+ pins = "gpio38";
+ bias-pull-down;
+ };
+
+ pinconf-rts {
+ /*
+ * Configure pull-down on RTS to make sure that the BT SoC can
+ * wake up the system by sending wakeup bytes during suspend.
+ */
+ pins = "gpio39";
+ bias-pull-down;
+ };
+
+ pinconf-tx {
+ /* Configure pull-up on TX when it isn't actively driven */
+ pins = "gpio40";
+ bias-pull-up;
+ };
+
+ pinconf-rx {
+ /*
+ * Configure a pull-up on RX. This is needed to avoid
+ * garbage data when the TX pin of the Bluetooth module is
+ * in tri-state (module powered off or not driving the
+ * signal yet).
+ */
+ pins = "gpio41";
+ bias-pull-up;
+ };
+ };
};
--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation
On Thu 10 Sep 12:53 UTC 2020, satya priya wrote:
> As a part of system suspend uart_port_suspend is called from the
> Serial driver, which calls set_mctrl passing mctrl as 0. This
> makes RFR high(NOT_READY) during suspend.
>
> Due to this BT SoC is not able to send wakeup bytes to UART during
> suspend. Include if check for non-suspend case to keep RFR low
> during suspend.
>
Seems reasonable.
Reviewed-by: Bjorn Andersson <[email protected]>
> Signed-off-by: satya priya <[email protected]>
> Acked-by: Greg Kroah-Hartman <[email protected]>
Greg, I don't see this depending on anything else, will you pick this
patch through your tree? I will take the dts patches through the qcom
tree.
Regards,
Bjorn
> Reviewed-by: Akash Asthana <[email protected]>
> ---
> Changes in V2:
> - This patch fixes the UART flow control issue during suspend.
> Newly added in V2.
>
> Changes in V3:
> - As per Matthias's comment removed the extra parentheses.
>
> Changes in V4:
> - No change.
>
> Changes in V5:
> - As per Matthias comment, fixed nit-pick in commit text.
>
> drivers/tty/serial/qcom_geni_serial.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c
> index 3aa29d2..bc63c54 100644
> --- a/drivers/tty/serial/qcom_geni_serial.c
> +++ b/drivers/tty/serial/qcom_geni_serial.c
> @@ -242,7 +242,7 @@ static void qcom_geni_serial_set_mctrl(struct uart_port *uport,
> if (mctrl & TIOCM_LOOP)
> port->loopback = RX_TX_CTS_RTS_SORTED;
>
> - if (!(mctrl & TIOCM_RTS))
> + if (!(mctrl & TIOCM_RTS) && !uport->suspended)
> uart_manual_rfr = UART_MANUAL_RFR_EN | UART_RFR_NOT_READY;
> writel(uart_manual_rfr, uport->membase + SE_UART_MANUAL_RFR);
> }
> --
> QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
> of Code Aurora Forum, hosted by The Linux Foundation
>
On Thu, Sep 10, 2020 at 11:06:39PM +0000, Bjorn Andersson wrote:
> On Thu 10 Sep 12:53 UTC 2020, satya priya wrote:
>
> > As a part of system suspend uart_port_suspend is called from the
> > Serial driver, which calls set_mctrl passing mctrl as 0. This
> > makes RFR high(NOT_READY) during suspend.
> >
> > Due to this BT SoC is not able to send wakeup bytes to UART during
> > suspend. Include if check for non-suspend case to keep RFR low
> > during suspend.
> >
>
> Seems reasonable.
>
> Reviewed-by: Bjorn Andersson <[email protected]>
>
> > Signed-off-by: satya priya <[email protected]>
> > Acked-by: Greg Kroah-Hartman <[email protected]>
>
> Greg, I don't see this depending on anything else, will you pick this
> patch through your tree? I will take the dts patches through the qcom
> tree.
Sure, will pick it up now, thanks.
greg k-h