diff options
author | Chris J Arges <arges@linux.vnet.ibm.com> | 2008-11-04 07:19:06 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-11-19 00:04:23 -0500 |
commit | 8c6531868d4917adbd363030f28a734b76c7471a (patch) | |
tree | 8456c959a1323bc0deb954ed7c5e0595aefd6121 /drivers | |
parent | 9b82f3e61758ed897200f0244b63a77c1791bcba (diff) |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/serial/pmac_zilog.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/serial/pmac_zilog.c b/drivers/serial/pmac_zilog.c index 317b061f7641..ad3488504010 100644 --- a/drivers/serial/pmac_zilog.c +++ b/drivers/serial/pmac_zilog.c | |||
@@ -1383,6 +1383,29 @@ static int pmz_verify_port(struct uart_port *port, struct serial_struct *ser) | |||
1383 | return -EINVAL; | 1383 | return -EINVAL; |
1384 | } | 1384 | } |
1385 | 1385 | ||
1386 | #ifdef CONFIG_CONSOLE_POLL | ||
1387 | |||
1388 | static int pmz_poll_get_char(struct uart_port *port) | ||
1389 | { | ||
1390 | struct uart_pmac_port *uap = (struct uart_pmac_port *)port; | ||
1391 | |||
1392 | while ((read_zsreg(uap, R0) & Rx_CH_AV) == 0) | ||
1393 | udelay(5); | ||
1394 | return read_zsdata(uap); | ||
1395 | } | ||
1396 | |||
1397 | static void pmz_poll_put_char(struct uart_port *port, unsigned char c) | ||
1398 | { | ||
1399 | struct uart_pmac_port *uap = (struct uart_pmac_port *)port; | ||
1400 | |||
1401 | /* Wait for the transmit buffer to empty. */ | ||
1402 | while ((read_zsreg(uap, R0) & Tx_BUF_EMP) == 0) | ||
1403 | udelay(5); | ||
1404 | write_zsdata(uap, c); | ||
1405 | } | ||
1406 | |||
1407 | #endif | ||
1408 | |||
1386 | static struct uart_ops pmz_pops = { | 1409 | static struct uart_ops pmz_pops = { |
1387 | .tx_empty = pmz_tx_empty, | 1410 | .tx_empty = pmz_tx_empty, |
1388 | .set_mctrl = pmz_set_mctrl, | 1411 | .set_mctrl = pmz_set_mctrl, |
@@ -1400,6 +1423,10 @@ static struct uart_ops pmz_pops = { | |||
1400 | .request_port = pmz_request_port, | 1423 | .request_port = pmz_request_port, |
1401 | .config_port = pmz_config_port, | 1424 | .config_port = pmz_config_port, |
1402 | .verify_port = pmz_verify_port, | 1425 | .verify_port = pmz_verify_port, |
1426 | #ifdef CONFIG_CONSOLE_POLL | ||
1427 | .poll_get_char = pmz_poll_get_char, | ||
1428 | .poll_put_char = pmz_poll_put_char, | ||
1429 | #endif | ||
1403 | }; | 1430 | }; |
1404 | 1431 | ||
1405 | /* | 1432 | /* |