1 | /* |
---|
2 | * Console driver for GUMSTIX by Yang Xi <hiyangxi@gmail.com> |
---|
3 | * |
---|
4 | * This driver uses the shared console driver in |
---|
5 | * ...../libbsp/shared/console.c |
---|
6 | * |
---|
7 | * Copyright (c) 2003 by Cogent Computer Systems |
---|
8 | * Written by Jay Monkman <jtm@lopingdog.com> |
---|
9 | * |
---|
10 | * The license and distribution terms for this file may be |
---|
11 | * found in the file LICENSE in this distribution or at |
---|
12 | * http://www.rtems.org/license/LICENSE. |
---|
13 | */ |
---|
14 | |
---|
15 | #include <bsp.h> |
---|
16 | #include <rtems/libio.h> |
---|
17 | #include <termios.h> |
---|
18 | #include <rtems/bspIo.h> |
---|
19 | |
---|
20 | #include <pxa255.h> |
---|
21 | #include <libchip/serial.h> |
---|
22 | #include <libchip/sersupp.h> |
---|
23 | |
---|
24 | /* How many serial ports? */ |
---|
25 | #define NUM_DEVS 1 |
---|
26 | |
---|
27 | /* These are used by code in console.c */ |
---|
28 | unsigned long Console_Configuration_Count = NUM_DEVS; |
---|
29 | |
---|
30 | extern const console_fns ffuart_fns; |
---|
31 | |
---|
32 | /* |
---|
33 | * There's one item in array for each UART. |
---|
34 | * |
---|
35 | * Some of these fields are marked "NOT USED". They are not used |
---|
36 | * by console.c, but may be used by drivers in libchip |
---|
37 | * |
---|
38 | * when we add other types of UARTS we will need to move this |
---|
39 | * structure to a generic uart.c file with only this in it |
---|
40 | */ |
---|
41 | console_tbl Console_Configuration_Ports[] = { |
---|
42 | { |
---|
43 | "/dev/com0", /* sDeviceName */ |
---|
44 | SERIAL_CUSTOM, /* deviceType */ |
---|
45 | &ffuart_fns, /* pDeviceFns */ |
---|
46 | NULL, /* deviceProbe */ |
---|
47 | NULL, /* pDeviceFlow */ |
---|
48 | 0, /* ulMargin - NOT USED */ |
---|
49 | 0, /* ulHysteresis - NOT USED */ |
---|
50 | NULL, /* pDeviceParams */ |
---|
51 | FFUART_BASE, /* ulCtrlPort1 - Pointer to DBGU regs */ |
---|
52 | 0, /* ulCtrlPort2 - NOT USED */ |
---|
53 | 0, /* ulDataPort - NOT USED */ |
---|
54 | NULL, /* getRegister - NOT USED */ |
---|
55 | NULL, /* setRegister - NOT USED */ |
---|
56 | NULL, /* getData - NOT USED */ |
---|
57 | NULL, /* setData - NOT USED */ |
---|
58 | 0, /* ulClock - NOT USED */ |
---|
59 | 0 /* ulIntVector - NOT USED */ |
---|
60 | }}; |
---|
61 | |
---|
62 | |
---|
63 | console_tbl *BSP_get_uart_from_minor(int minor) |
---|
64 | { |
---|
65 | return Console_Port_Tbl[minor]; |
---|
66 | } |
---|