summaryrefslogtreecommitdiff
path: root/drivers/ps2ser.c
diff options
context:
space:
mode:
authorWolfgang Denk <wd@pollux.denx.de>2006-07-19 14:49:35 +0200
committerWolfgang Denk <wd@pollux.denx.de>2006-07-19 14:49:35 +0200
commitbd3143f040ab186f8b665b3ada35840e3fc491e9 (patch)
treea84d3b938d5d35f1374515eb5ecedeeb6dff8c03 /drivers/ps2ser.c
parentedd0b509bad5e8e9dc3b01e9805cf6da5e4343dd (diff)
Fix support for PS/2 keyboard on TQM85xx boards
The PS/2 keyobard driver for the TQM85xx modules only supports the internal DUART of the MPC85xx CPU. Since the MPC8560 doesn't include a DUART, the TQM8560 modules can't be used with the PS/2 keyboard controller on the STK85xx board. The PS/2 keyboard driver should work with the modules TQM8540, TQM8541 and TQM8555, but it only has been tested on a TQM8540, yet. Make sure the PS/2 controller on the STK85xx is programmed. Jumper settings: X66 1-2, 9-10; X61 2-3 Patch by Martin Krause, 21 Jun 2006
Diffstat (limited to 'drivers/ps2ser.c')
-rw-r--r--drivers/ps2ser.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/ps2ser.c b/drivers/ps2ser.c
index 8aea8fd44a..ec32ed2df4 100644
--- a/drivers/ps2ser.c
+++ b/drivers/ps2ser.c
@@ -49,7 +49,7 @@ DECLARE_GLOBAL_DATA_PTR;
#error CONFIG_PS2SERIAL must be in 1 ... 6
#endif
-#elif defined(CONFIG_MPC85xx)
+#elif defined(CONFIG_MPC8540) || defined(CONFIG_MPC8541) || defined(CONFIG_MPC8555)
#if CONFIG_PS2SERIAL == 1
#define COM_BASE (CFG_CCSRBAR+0x4500)
@@ -59,13 +59,13 @@ DECLARE_GLOBAL_DATA_PTR;
#error CONFIG_PS2SERIAL must be in 1 ... 2
#endif
-#endif /* CONFIG_MPC5xxx / CONFIG_MPC85xx */
+#endif /* CONFIG_MPC5xxx / CONFIG_MPC8540 / other */
static int ps2ser_getc_hw(void);
static void ps2ser_interrupt(void *dev_id);
extern struct serial_state rs_table[]; /* in serial.c */
-#if !defined(CONFIG_MPC5xxx) && !defined(CONFIG_MPC85xx)
+#if !defined(CONFIG_MPC5xxx) && !defined(CONFIG_MPC8540) && !defined(CONFIG_MPC8541) && !defined(CONFIG_MPC8555)
static struct serial_state *state;
#endif
@@ -120,7 +120,7 @@ int ps2ser_init(void)
return (0);
}
-#elif defined(CONFIG_MPC85xx)
+#elif defined(CONFIG_MPC8540) || defined(CONFIG_MPC8541) || defined(CONFIG_MPC8555)
int ps2ser_init(void)
{
NS16550_t com_port = (NS16550_t)COM_BASE;
@@ -136,7 +136,7 @@ int ps2ser_init(void)
return (0);
}
-#else /* !CONFIG_MPC5xxx && !CONFIG_MPC85xx */
+#else /* !CONFIG_MPC5xxx && !CONFIG_MPC8540 / other */
static inline unsigned int ps2ser_in(int offset)
{
@@ -180,13 +180,13 @@ int ps2ser_init(void)
return 0;
}
-#endif /* CONFIG_MPC5xxx / CONFIG_MPC85xx / other */
+#endif /* CONFIG_MPC5xxx / CONFIG_MPC8540 / other */
void ps2ser_putc(int chr)
{
#ifdef CONFIG_MPC5xxx
volatile struct mpc5xxx_psc *psc = (struct mpc5xxx_psc *)PSC_BASE;
-#elif defined(CONFIG_MPC85xx)
+#elif defined(CONFIG_MPC8540) || defined(CONFIG_MPC8541) || defined(CONFIG_MPC8555)
NS16550_t com_port = (NS16550_t)COM_BASE;
#endif
#ifdef DEBUG
@@ -197,7 +197,7 @@ void ps2ser_putc(int chr)
while (!(psc->psc_status & PSC_SR_TXRDY));
psc->psc_buffer_8 = chr;
-#elif defined(CONFIG_MPC85xx)
+#elif defined(CONFIG_MPC8540) || defined(CONFIG_MPC8541) || defined(CONFIG_MPC8555)
while ((com_port->lsr & LSR_THRE) == 0);
com_port->thr = chr;
#else
@@ -211,7 +211,7 @@ static int ps2ser_getc_hw(void)
{
#ifdef CONFIG_MPC5xxx
volatile struct mpc5xxx_psc *psc = (struct mpc5xxx_psc *)PSC_BASE;
-#elif defined(CONFIG_MPC85xx)
+#elif defined(CONFIG_MPC8540) || defined(CONFIG_MPC8541) || defined(CONFIG_MPC8555)
NS16550_t com_port = (NS16550_t)COM_BASE;
#endif
int res = -1;
@@ -220,7 +220,7 @@ static int ps2ser_getc_hw(void)
if (psc->psc_status & PSC_SR_RXRDY) {
res = (psc->psc_buffer_8);
}
-#elif defined(CONFIG_MPC85xx)
+#elif defined(CONFIG_MPC8540) || defined(CONFIG_MPC8541) || defined(CONFIG_MPC8555)
if (com_port->lsr & LSR_DR) {
res = com_port->rbr;
}
@@ -279,7 +279,7 @@ static void ps2ser_interrupt(void *dev_id)
{
#ifdef CONFIG_MPC5xxx
volatile struct mpc5xxx_psc *psc = (struct mpc5xxx_psc *)PSC_BASE;
-#elif defined(CONFIG_MPC85xx)
+#elif defined(CONFIG_MPC8540) || defined(CONFIG_MPC8541) || defined(CONFIG_MPC8555)
NS16550_t com_port = (NS16550_t)COM_BASE;
#endif
int chr;
@@ -289,7 +289,7 @@ static void ps2ser_interrupt(void *dev_id)
chr = ps2ser_getc_hw();
#ifdef CONFIG_MPC5xxx
status = psc->psc_status;
-#elif defined(CONFIG_MPC85xx)
+#elif defined(CONFIG_MPC8540) || defined(CONFIG_MPC8541) || defined(CONFIG_MPC8555)
status = com_port->lsr;
#else
status = ps2ser_in(UART_IIR);
@@ -305,7 +305,7 @@ static void ps2ser_interrupt(void *dev_id)
}
#ifdef CONFIG_MPC5xxx
} while (status & PSC_SR_RXRDY);
-#elif defined(CONFIG_MPC85xx)
+#elif defined(CONFIG_MPC8540) || defined(CONFIG_MPC8541) || defined(CONFIG_MPC8555)
} while (status & LSR_DR);
#else
} while (status & UART_IIR_RDI);