Hello,
I have got a problem which I am not able to solve. I am trying to do
it for some time but without any positive result.
I have fine-tuned the TRUART driver under Suse Linux. This driver
communicates by the serial link and I have to make its transfer onto
Foxboard.
The problem is the driver uses ports and IRQ UART in PC (03F8
02F8,
IRQ4,3
) going directly on them using outb, inb" commands. I do not
know how to adjust that driver for Foxboard. The TRUART is linked with
/dev/ttyS2 port directly.
How to enter Foxboard ports using low level?
Enclosing you can find the serial inicialization example for Suse Linux :
/*
* This is a support routine for tpuart_open.
* It initializes the serial port
*/
int ser_init (tpuart_t *dev)
{
int port = dev->port;
/* Part of uart autodetection. Stolen from serial.c */
unsigned long flags;
unsigned char scratch, scratch2, scratch3;
spin_lock_irqsave(&dev->lock,flags);
PDEBUGG ("init port 0x%02x\n", port);
scratch = inb (port + IER);
outb (0, port + IER);
#ifdef __i386__
outb (0xff, 0x080);
#endif
scratch2 = inb (port + IER);
outb (0x0F, port + IER);
#ifdef __i386__
outb (0, 0x080);
#endif
scratch3 = inb (port + IER);
outb (scratch, port + IER);
if (scratch2 || scratch3 != 0x0F) {
PDEBUGG("%02x: no uart detected "
"(%02x, %02x)\n", port,
scratch2, scratch3);
spin_unlock_irqrestore(&dev->lock, flags);
return (0);
}
outb (WLEN|PSEL|DLAB, port+LCR); /* set DLAB bit (used for
baud rate selection) */
outb (6, port+DLLB); /* 115200/19200 = 6 */
outb (0, port+DLHB);
outb (WLEN|PSEL, port+LCR); /* clear DLAB bit */
outb (FDTR|OUT2, port+MCR); /* activate DTR-line and
master-interrupt active */
while (inb (port+LSR) & DRDY)
inb (port); /* dummy read all bytes */
outb (0, port+IER);
outb (FEN, port+FCR); /* switch on FIFO, 1 Byte Interrupt
trigger level */
inb (port); /* dummy-read port */
outb (RIE|TIE, port+IER); /* actually switch ints on */
spin_unlock_irqrestore(&dev->lock, flags);
return (1);
}
Thank´s for your help me.
Vladislav.