Commit b9a0c3f8 authored by Greg Ungerer's avatar Greg Ungerer

m68knommu: simplify the 54xx UART setup code

Simplify the UART setup code so that it no longer loops for each UART
present. Just make it do all the work it needs in a single function.
This will make the code easier to share when we move to a single set
of platform data for ColdFire UARTs.
Signed-off-by: default avatarGreg Ungerer <gerg@uclinux.org>
parent b77fb7fa
...@@ -59,32 +59,17 @@ static struct platform_device *m54xx_devices[] __initdata = { ...@@ -59,32 +59,17 @@ static struct platform_device *m54xx_devices[] __initdata = {
/***************************************************************************/ /***************************************************************************/
static void __init m54xx_uart_init_line(int line, int irq)
{
int rts_cts;
/* enable io pins */
switch (line) {
case 0:
rts_cts = 0; break;
case 1:
rts_cts = MCF_PAR_PSC_RTS_RTS; break;
case 2:
rts_cts = MCF_PAR_PSC_RTS_RTS | MCF_PAR_PSC_CTS_CTS; break;
case 3:
rts_cts = 0; break;
}
__raw_writeb(MCF_PAR_PSC_TXD | rts_cts | MCF_PAR_PSC_RXD,
MCF_MBAR + MCF_PAR_PSC(line));
}
static void __init m54xx_uarts_init(void) static void __init m54xx_uarts_init(void)
{ {
const int nrlines = ARRAY_SIZE(m54xx_uart_platform); /* enable io pins */
int line; __raw_writeb(MCF_PAR_PSC_TXD | MCF_PAR_PSC_RXD,
MCF_MBAR + MCF_PAR_PSC(0));
for (line = 0; (line < nrlines); line++) __raw_writeb(MCF_PAR_PSC_TXD | MCF_PAR_PSC_RXD | MCF_PAR_PSC_RTS_RTS,
m54xx_uart_init_line(line, m54xx_uart_platform[line].irq); MCF_MBAR + MCF_PAR_PSC(1));
__raw_writeb(MCF_PAR_PSC_TXD | MCF_PAR_PSC_RXD | MCF_PAR_PSC_RTS_RTS |
MCF_PAR_PSC_CTS_CTS, MCF_MBAR + MCF_PAR_PSC(2));
__raw_writeb(MCF_PAR_PSC_TXD | MCF_PAR_PSC_RXD,
MCF_MBAR + MCF_PAR_PSC(3));
} }
/***************************************************************************/ /***************************************************************************/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment