mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
serial/pmac_zilog: Add console polling support
This implements poll_get_char and poll_put_char for console polling, which enables kgdb to work on machines that use the pmac_zilog serial driver, for example the Apple PowerMac G5. Signed-off-by: Chris J Arges <arges@linux.vnet.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
This commit is contained in:
parent
9b82f3e617
commit
8c6531868d
1 changed files with 27 additions and 0 deletions
|
@ -1383,6 +1383,29 @@ static int pmz_verify_port(struct uart_port *port, struct serial_struct *ser)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_CONSOLE_POLL
|
||||||
|
|
||||||
|
static int pmz_poll_get_char(struct uart_port *port)
|
||||||
|
{
|
||||||
|
struct uart_pmac_port *uap = (struct uart_pmac_port *)port;
|
||||||
|
|
||||||
|
while ((read_zsreg(uap, R0) & Rx_CH_AV) == 0)
|
||||||
|
udelay(5);
|
||||||
|
return read_zsdata(uap);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void pmz_poll_put_char(struct uart_port *port, unsigned char c)
|
||||||
|
{
|
||||||
|
struct uart_pmac_port *uap = (struct uart_pmac_port *)port;
|
||||||
|
|
||||||
|
/* Wait for the transmit buffer to empty. */
|
||||||
|
while ((read_zsreg(uap, R0) & Tx_BUF_EMP) == 0)
|
||||||
|
udelay(5);
|
||||||
|
write_zsdata(uap, c);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
static struct uart_ops pmz_pops = {
|
static struct uart_ops pmz_pops = {
|
||||||
.tx_empty = pmz_tx_empty,
|
.tx_empty = pmz_tx_empty,
|
||||||
.set_mctrl = pmz_set_mctrl,
|
.set_mctrl = pmz_set_mctrl,
|
||||||
|
@ -1400,6 +1423,10 @@ static struct uart_ops pmz_pops = {
|
||||||
.request_port = pmz_request_port,
|
.request_port = pmz_request_port,
|
||||||
.config_port = pmz_config_port,
|
.config_port = pmz_config_port,
|
||||||
.verify_port = pmz_verify_port,
|
.verify_port = pmz_verify_port,
|
||||||
|
#ifdef CONFIG_CONSOLE_POLL
|
||||||
|
.poll_get_char = pmz_poll_get_char,
|
||||||
|
.poll_put_char = pmz_poll_put_char,
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue