diff options
author | Greg Ungerer <gerg@snapgear.com> | 2005-11-06 23:09:50 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-07 11:00:46 -0500 |
commit | 7f04d62b51828fa3d1dee9fd1ea7f37815595bfa (patch) | |
tree | c3b06bcefd4d7c086de2fa60d412f3b335ce3706 /drivers/serial/mcfserial.c | |
parent | 124df2df0c905b8762cd860a0e3fc9201fba8777 (diff) |
[PATCH] m68knommu: add 5208 ColdFire UART support to ColdFire serial driver
Add support for the Freescale 5208 processor UART's to the common
ColdFire serial port code.
Patch originally from Matt Waddel (from code originally written by
Mike Lavender).
Signed-off-by: Greg Ungerer <gerg@uclinux.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/serial/mcfserial.c')
-rw-r--r-- | drivers/serial/mcfserial.c | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/drivers/serial/mcfserial.c b/drivers/serial/mcfserial.c index e2ebdcad553c..47f7404cb045 100644 --- a/drivers/serial/mcfserial.c +++ b/drivers/serial/mcfserial.c | |||
@@ -57,7 +57,8 @@ struct timer_list mcfrs_timer_struct; | |||
57 | * keep going. Perhaps one day the cflag settings for the | 57 | * keep going. Perhaps one day the cflag settings for the |
58 | * console can be used instead. | 58 | * console can be used instead. |
59 | */ | 59 | */ |
60 | #if defined(CONFIG_ARNEWSH) || defined(CONFIG_MOTOROLA) || defined(CONFIG_senTec) || defined(CONFIG_SNEHA) | 60 | #if defined(CONFIG_ARNEWSH) || defined(CONFIG_FREESCALE) || \ |
61 | defined(CONFIG_senTec) || defined(CONFIG_SNEHA) | ||
61 | #define CONSOLE_BAUD_RATE 19200 | 62 | #define CONSOLE_BAUD_RATE 19200 |
62 | #define DEFAULT_CBAUD B19200 | 63 | #define DEFAULT_CBAUD B19200 |
63 | #endif | 64 | #endif |
@@ -67,7 +68,7 @@ struct timer_list mcfrs_timer_struct; | |||
67 | #define DEFAULT_CBAUD B38400 | 68 | #define DEFAULT_CBAUD B38400 |
68 | #endif | 69 | #endif |
69 | 70 | ||
70 | #if defined(CONFIG_MOD5272) | 71 | #if defined(CONFIG_MOD5272) || defined(CONFIG_M5208EVB) |
71 | #define CONSOLE_BAUD_RATE 115200 | 72 | #define CONSOLE_BAUD_RATE 115200 |
72 | #define DEFAULT_CBAUD B115200 | 73 | #define DEFAULT_CBAUD B115200 |
73 | #endif | 74 | #endif |
@@ -95,7 +96,8 @@ static struct tty_driver *mcfrs_serial_driver; | |||
95 | #undef SERIAL_DEBUG_OPEN | 96 | #undef SERIAL_DEBUG_OPEN |
96 | #undef SERIAL_DEBUG_FLOW | 97 | #undef SERIAL_DEBUG_FLOW |
97 | 98 | ||
98 | #if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) | 99 | #if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) || \ |
100 | defined(CONFIG_M520x) | ||
99 | #define IRQBASE (MCFINT_VECBASE+MCFINT_UART0) | 101 | #define IRQBASE (MCFINT_VECBASE+MCFINT_UART0) |
100 | #else | 102 | #else |
101 | #define IRQBASE 73 | 103 | #define IRQBASE 73 |
@@ -1528,6 +1530,35 @@ static void mcfrs_irqinit(struct mcf_serial *info) | |||
1528 | imrp = (volatile unsigned long *) (MCF_MBAR + MCFICM_INTC0 + | 1530 | imrp = (volatile unsigned long *) (MCF_MBAR + MCFICM_INTC0 + |
1529 | MCFINTC_IMRL); | 1531 | MCFINTC_IMRL); |
1530 | *imrp &= ~((1 << (info->irq - MCFINT_VECBASE)) | 1); | 1532 | *imrp &= ~((1 << (info->irq - MCFINT_VECBASE)) | 1); |
1533 | #elif defined(CONFIG_M520x) | ||
1534 | volatile unsigned char *icrp, *uartp; | ||
1535 | volatile unsigned long *imrp; | ||
1536 | |||
1537 | uartp = info->addr; | ||
1538 | |||
1539 | icrp = (volatile unsigned char *) (MCF_MBAR + MCFICM_INTC0 + | ||
1540 | MCFINTC_ICR0 + MCFINT_UART0 + info->line); | ||
1541 | *icrp = 0x03; | ||
1542 | |||
1543 | imrp = (volatile unsigned long *) (MCF_MBAR + MCFICM_INTC0 + | ||
1544 | MCFINTC_IMRL); | ||
1545 | *imrp &= ~((1 << (info->irq - MCFINT_VECBASE)) | 1); | ||
1546 | if (info->line < 2) { | ||
1547 | unsigned short *uart_par; | ||
1548 | uart_par = (unsigned short *)(MCF_IPSBAR + MCF_GPIO_PAR_UART); | ||
1549 | if (info->line == 0) | ||
1550 | *uart_par |= MCF_GPIO_PAR_UART_PAR_UTXD0 | ||
1551 | | MCF_GPIO_PAR_UART_PAR_URXD0; | ||
1552 | else if (info->line == 1) | ||
1553 | *uart_par |= MCF_GPIO_PAR_UART_PAR_UTXD1 | ||
1554 | | MCF_GPIO_PAR_UART_PAR_URXD1; | ||
1555 | } else if (info->line == 2) { | ||
1556 | unsigned char *feci2c_par; | ||
1557 | feci2c_par = (unsigned char *)(MCF_IPSBAR + MCF_GPIO_PAR_FECI2C); | ||
1558 | *feci2c_par &= ~0x0F; | ||
1559 | *feci2c_par |= MCF_GPIO_PAR_FECI2C_PAR_SCL_UTXD2 | ||
1560 | | MCF_GPIO_PAR_FECI2C_PAR_SDA_URXD2; | ||
1561 | } | ||
1531 | #else | 1562 | #else |
1532 | volatile unsigned char *icrp, *uartp; | 1563 | volatile unsigned char *icrp, *uartp; |
1533 | 1564 | ||