1 | /*===============================================================*\ |
---|
2 | | Project: RTEMS generic MPC83xx BSP | |
---|
3 | +-----------------------------------------------------------------+ |
---|
4 | | This file has been adapted from the ep1a BSP to MPC83xx by | |
---|
5 | | Thomas Doerfler <Thomas.Doerfler@embedded-brains.de> | |
---|
6 | | Copyright (c) 2007 | |
---|
7 | | Embedded Brains GmbH | |
---|
8 | | Obere Lagerstr. 30 | |
---|
9 | | D-82178 Puchheim | |
---|
10 | | Germany | |
---|
11 | | rtems@embedded-brains.de | |
---|
12 | | | |
---|
13 | | See the other copyright notice below for the original parts. | |
---|
14 | +-----------------------------------------------------------------+ |
---|
15 | | The license and distribution terms for this file may be | |
---|
16 | | found in the file LICENSE in this distribution or at | |
---|
17 | | | |
---|
18 | | http://www.rtems.com/license/LICENSE. | |
---|
19 | | | |
---|
20 | +-----------------------------------------------------------------+ |
---|
21 | | this file contains the console driver configuration tables | |
---|
22 | \*===============================================================*/ |
---|
23 | /* derived from: */ |
---|
24 | /* |
---|
25 | * This file contains the TTY driver table for the EP1A |
---|
26 | * |
---|
27 | * COPYRIGHT (c) 1989-1999. |
---|
28 | * On-Line Applications Research Corporation (OAR). |
---|
29 | * |
---|
30 | * The license and distribution terms for this file may be |
---|
31 | * found in the file LICENSE in this distribution or at |
---|
32 | * http://www.rtems.com/license/LICENSE. |
---|
33 | * |
---|
34 | * $Id$ |
---|
35 | */ |
---|
36 | |
---|
37 | #include <libchip/serial.h> |
---|
38 | #include "ns16550cfg.h" |
---|
39 | #include <bsp.h> |
---|
40 | #include <libcpu/io.h> |
---|
41 | #include <mpc83xx/mpc83xx.h> |
---|
42 | |
---|
43 | /* |
---|
44 | * Based on BSP configuration information decide whether to do polling IO |
---|
45 | * or interrupt driven IO. |
---|
46 | */ |
---|
47 | |
---|
48 | #define NS16550_FUNCTIONS &ns16550_fns_polled |
---|
49 | |
---|
50 | /* |
---|
51 | * The following table configures the console drivers used in this BSP. |
---|
52 | * |
---|
53 | * The first entry which, when probed, is available, will be named /dev/console, |
---|
54 | * all others being given the name indicated. |
---|
55 | * |
---|
56 | * Each field is interpreted thus: |
---|
57 | * |
---|
58 | * sDeviceName This is the name of the device. |
---|
59 | * pDeviceFns This is a pointer to the set of driver routines to use. |
---|
60 | * pDeviceFlow This is a pointer to the set of flow control routines to |
---|
61 | * use. Serial device drivers will typically supply RTSCTS |
---|
62 | * and DTRCTS handshake routines for DCE to DCE communication, |
---|
63 | * however for DCE to DTE communication, no such routines |
---|
64 | * should be necessary as RTS will be driven automatically |
---|
65 | * when the transmitter is active. |
---|
66 | * ulMargin The high water mark in the input buffer is set to the buffer |
---|
67 | * size less ulMargin. Once this level is reached, the driver's |
---|
68 | * flow control routine used to stop the remote transmitter will |
---|
69 | * be called. This figure should be greater than or equal to |
---|
70 | * the number of stages of FIFO between the transmitter and |
---|
71 | * receiver. |
---|
72 | * ulHysteresis After the high water mark specified by ulMargin has been |
---|
73 | * reached, the driver's routine to re-start the remote |
---|
74 | * transmitter will be called once the level in the input |
---|
75 | * buffer has fallen by ulHysteresis bytes. |
---|
76 | * pDeviceParams This contains either device specific data or a pointer to a |
---|
77 | * device specific structure containing additional information |
---|
78 | * not provided in this table. |
---|
79 | * ulCtrlPort1 This is the primary control port number for the device. This |
---|
80 | * may be used to specify different instances of the same device |
---|
81 | * type. |
---|
82 | * ulCtrlPort2 This is the secondary control port number, of use when a given |
---|
83 | * device has more than one available channel. |
---|
84 | * ulDataPort This is the port number for the data port of the device |
---|
85 | * ulIntVector This encodes the interrupt vector of the device. |
---|
86 | * |
---|
87 | */ |
---|
88 | console_tbl Console_Port_Tbl[] = { |
---|
89 | /* |
---|
90 | * NS16550 Chips provide first ttyS0/1 Ports. |
---|
91 | */ |
---|
92 | { |
---|
93 | "/dev/ttyS0", /* sDeviceName */ |
---|
94 | SERIAL_NS16550, /* deviceType */ |
---|
95 | NS16550_FUNCTIONS, /* pDeviceFns */ |
---|
96 | NULL, /* deviceProbe */ |
---|
97 | &ns16550_flow_RTSCTS, /* pDeviceFlow */ |
---|
98 | 16, /* ulMargin */ |
---|
99 | 8, /* ulHysteresis */ |
---|
100 | (void *)9600, /* baud rate */ /* pDeviceParams */ |
---|
101 | (uint32_t)&(mpc83xx.duart[0]), /* ulCtrlPort1e */ |
---|
102 | 0, /* ulCtrlPort2 */ |
---|
103 | (uint32_t)&(mpc83xx.duart[0]), /* ulDataPort */ |
---|
104 | Read_ns16550_register, /* getRegister */ |
---|
105 | Write_ns16550_register, /* setRegister */ |
---|
106 | NULL, /* getData */ |
---|
107 | NULL, /* setData */ |
---|
108 | BSP_CSB_CLK_FRQ, /* ulClock */ |
---|
109 | 0 /* ulIntVector */ |
---|
110 | }, |
---|
111 | { |
---|
112 | "/dev/ttyS1", /* sDeviceName */ |
---|
113 | SERIAL_NS16550, /* deviceType */ |
---|
114 | NS16550_FUNCTIONS, /* pDeviceFns */ |
---|
115 | NULL, /* deviceProbe */ |
---|
116 | &ns16550_flow_RTSCTS, /* pDeviceFlow */ |
---|
117 | 16, /* ulMargin */ |
---|
118 | 8, /* ulHysteresis */ |
---|
119 | (void *)9600, /* baud rate */ /* pDeviceParams */ |
---|
120 | (uint32_t)&(mpc83xx.duart[1]), /* ulCtrlPort1-Filled in at runtime */ |
---|
121 | 0, /* ulCtrlPort2 */ |
---|
122 | (uint32_t)&(mpc83xx.duart[1]), /* ulDataPort-Filled in at runtime*/ |
---|
123 | Read_ns16550_register, /* getRegister */ |
---|
124 | Write_ns16550_register, /* setRegister */ |
---|
125 | NULL, /* getData */ |
---|
126 | NULL, /* setData */ |
---|
127 | BSP_CSB_CLK_FRQ, /* ulClock */ |
---|
128 | 0 /* ulIntVector */ |
---|
129 | } |
---|
130 | }; |
---|
131 | |
---|