Revert "msm_serial_hs: Fix race condition with BAM rx pipe"

This reverts commit 1de358d395cf2a832802dbdb4eb4906aa101ca18.
Revert "msm_serial_hs: vote for clocks in tty functions"

This reverts commit 2ac18d39efb4b962634691b6098b1290c39114bc.
Revert "msm_serial_hs: check the returned value of clock vote"

This reverts commit de5927bc5047a1c34cd6073c2c4b7a79059ec105.
Revert "msm_serial_hs: Fix the unbalanced clk_count"

This reverts commit fb6873449db8876ebd6c6f7002e67a1c38cdab4e.
Revert "msm_serial_hs: fix unbalanced clock vote during shutdown"

This reverts commit 15119e0d07aa2e60e92a60bcd65bd1ea08b8a1f4.
Revert "msm_serial_hs: fix unbalanced clock vote"

This reverts commit fb016c38b9791f154c2876248917762ca07486d3.
Revert "msm_serial_hs: check clk_state in set_mctrl() and fix unbalanced unvote"

This reverts commit 6184a120e2e5f633e8ff27a40e2a14628a89dc0e.
Revert "msm_serial_hs: Vote for clocks during tty close"

This reverts commit 38eff67fd01b47615913c814de7b6c20ec62fcc3.
msm_serial_hs: Configure UART RX gpio line as wakeup irq line

UART wakeup can be triggered by RX activity using a wakeup GPIO on the
UART RX pin. This change adds support for configuring the UART RX gpio
line as wakeup irq line.

CRs-Fixed: 482104
Change-Id: I775c17d4d36b08225b32063131473567c2d16f9c
Signed-off-by: Saket Saurabh <ssaurabh@codeaurora.org>
Signed-off-by: Ram Mohan Korukonda <rkorukon@codeaurora.org>
msm_serial_hs: Vote for clocks during tty close

While BT operation is in progress, it's possible for
client functions to explicitly turn off the
UART clocks without notifying TTY layer.  Then when
TTY layer try to access UART, L2 error happened because
of un-clocked registers.  Since there is no clear way
to notify clients to turn on clocks before TTY access
UART driver will implicilty turn on the clocks.

CRs-Fixed: 505225
Change-Id: Ia9958658465a6c0e5af66cd932e8e694cc12b78c
Signed-off-by: Naveen Kaje <nkaje@codeaurora.org>
msm_serial_hs: Add runtime support for determining UARTDM register offsets

Currently, HSUART uses a Kconfig option to determine the UARTDM core
version register offsets during compile time. This change adds runtime
configuration support for determining the version of the UARTDM core,
and use the same with appropriate register mappings in HSUART driver.

Also with addition of runtime support for determining the UARTDM core
version register offsets, Kconfig CONFIG_MSM_UARTDM_Core_v14 is no longer
required. This change also does clean up of defconfig files for removing
the config and uart register header files for achieving the same.

CRs-Fixed: 459281
Change-Id: Iff4ad1c37a3b04345d68cbe0a8befa284b49a539
Signed-off-by: Saket Saurabh <ssaurabh@codeaurora.org>
tty: serial: Use "no_log" readl/writel variants in hsl_read/write

hsl_read and hsl_write both directly call ioread32/iowrite32, which
leads to either a __raw_readl or __raw_writel call. These
readl/writel call are logged to the register trace buffer (RTB) by
default and generate a very large amount of output. This patch
directly calls __raw_readl_no_log and __raw_writel_no_log in
hsl_read and hsl_write to avoid logging these events to the RTB.

Change-Id: I9b3253996188f0642a4f6dedf449ec23fa1de05a
Signed-off-by: David Garibaldi <dgaribal@codeaurora.org>
msm_serial_hs: Fix race condition with BAM rx pipe

Crash observed due to the race condition with bam
rx pipe during sps_disconnect and sps_transfer_one
operations executed at the same time on two CPUs.

Because of this race condition rx bam descriptor
pointer becomes NULL and accessing of this pointer
leads to crash.

This patch waits for sps_transfer_one function to
complete, if it is in progress, before calling
sps_disconnect function from the set_termios.

CRs-Fixed: 534029
Change-Id: I7581062a17a3dc7ede8eb58e4d25e3b517812ab2
Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
msm_serial_hs: Disable RFR line and auto RFR in set_termios

This change disables the RFR line during set_termios call so that
the remote side does not send data during this call and thus prevents
data omission and corruption.

CRs-Fixed: 557659
Change-Id: I0708168b858a42d102ad3e5ebcbd6ca33943c8b1
Signed-off-by: Naveen Kaje <nkaje@codeaurora.org>
msm_serial_hs: fix compilation warning

Add proper typecasting for the physical address type

Change-Id: Ibf46360c31f3475123e2fe35b4ae89d8afe82abf
Signed-off-by: Naveen Kaje <nkaje@codeaurora.org>
Signed-off-by: Dilip Kota <c_dkota@codeaurora.org>
msm_serial_hs_lite: Handle Tx request during System Suspend
msm_serial_hs: Fix the wrong register offset Macro usage

In the msm_hs_tx_empty() API, accessing wrong register offset
macro UARTDM_SR_ADDR.This leading to the unexpected issues
The right register offset macro is UART_DM_SR.
Also the msm_hs_request_clock_off() API is accessing wrong
register macro UARTDM_IMR instead of UART_DM_IMR.

This patch places the right macros at respective points.

CRs-Fixed: 583426
Change-Id: I0eb966adedc44b8e611da318b6d8f4a9279e95a7
Signed-off-by: Dilip Kota <c_dkota@codeaurora.org>
msm_serial_hs: Add IPC Logging

This patch enables IPC Logging in the high speed UART driver.
The logs are available under sysfs. Log level can be changed by
changing the mask provided in /sys/module.
This patch prints UART Registers while
1)Port Open
2)Port Configuration
3)Rx/Tx Flow
4)Handling ISR and
Prints Tx/Rx Data and Count

Change-Id: I7aef6613ac27a069127ce8450591c97eedb555af
Signed-off-by: Dilip Kota <c_dkota@codeaurora.org>
msm_serial_hs: Fix register access issue

Crash is seen in the dump_uart_hs_registers()
function due to improper array offset passed to
access the registers. This patch corrects the
array index during the register access.

CRs-Fixed: 576874
Change-Id: Iba54b72cefa01ff855b17e981aa4dd2886126003
Signed-off-by: Dilip Kota <c_dkota@codeaurora.org>
msm_serial_hs:Enable Error/Break Char off

Follow the hardware sequence of enabling
RX_ERROR_CHAR_OFF and RX_BREAK_ZERO_CHAR_OFF in
MR2 register, for not allowing the Break and
parity/frame Error characters into Rx FIFO.

CRs-Fixed: 538141
Change-Id: I24f73eea456c4cb2a68b1655bcd5426426ca7d97
Signed-off-by: Dilip Kota <c_dkota@codeaurora.org>
Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>