Back to home page

LXR

 
 

    


Warning, /bsps/shared/dev/serial/README.md is written in an unsupported language. File is not indexed.

0001 serial
0002 ======
0003 
0004 This is the serial controller portion of the libchip library.  This 
0005 directory contains the source code for reusable console driver
0006 support code.  Each individual driver is configured using the
0007 console_tbl data structure.  This structure is defined and explained
0008 in the console.h file.
0009 
0010 The reusable chip drivers do not directly access the serial controller.
0011 They access the registers on the controller via a set of up to four 
0012 functions which are provided by the BSP.  These functins set and get
0013 general registers and data buffers.  Some chips can access the data
0014 buffers as general registers and thus the driver may not require
0015 those interface routines.
0016 
0017 
0018 
0019 Status
0020 ======
0021 
0022 + Hardware flow control is not currently supported.  Some of the chip
0023   drivers (in particular the z8530) have support for hardware flow control
0024   but this has not been tested in the libchip context.  There will need
0025   to be a way to totally disabled hardware flow control which is not
0026   currently in this.
0027 
0028 + "ulClockSpeed" configuration item field to become a pointer to a table
0029   of chip specific information.  For example, the z8530 should specify
0030   clock speed and clock divisor setting.
0031 
0032 + A termios structure should be included to specify  the initial settings.
0033   Right now all drivers default to 9600, 8N1.
0034  
0035 + Need to switch to passing pointers rather than a minor number to 
0036   functions which are strictly internal to each chip driver.  This
0037   should be a performance win.
0038 
0039 + Need a test which prompts you for termios settings and tests them.  Until
0040   this happens, testing for the variety of settings possible will be limited.
0041   This test should be able to test any serial port while prompts come to the
0042   console.
0043 
0044 MC68681
0045 -------
0046 
0047 + Works interrupt and polled.
0048 
0049 + Hardware flow control not included.
0050 
0051 NS16650
0052 -------
0053 
0054 + ns16550_set-attributes function is untested.
0055 
0056 + Hardware flow control included but is currently disabled in ISR.
0057 
0058 Z85C30
0059 ------
0060 
0061 + Works polled and interrupt.
0062 
0063 + Hardware flow control included but is currently disabled in ISR.
0064 
0065 + Needs to support mode where more specific vectors are generated.
0066 
0067 
0068 Configuration Table Use
0069 =======================
0070 
0071 sDeviceName
0072 
0073    The name of this device.
0074 
0075 deviceType
0076 
0077    This field must be SERIAL_MC68681.
0078 
0079 pDeviceFns
0080 
0081    The device interface control table.  This may be:
0082       + mc68681_fns for interrupt driven IO
0083       + mc68681_fns_polled for polled IO
0084 
0085 deviceProbe
0086 
0087    This is the address of the routine which probes to see if the device
0088    is present.
0089 
0090 pDeviceFlow
0091 
0092    This field is ignored as hardware flow control is not currently supported.
0093 
0094 ulMargin
0095 
0096     This is currently unused.
0097 
0098 ulHysteresis
0099 
0100     This is currently unused.
0101 
0102 pDeviceParams
0103 
0104     This is set to the default settings.
0105 
0106 ulCtrlPort1
0107 
0108    This field is the base address of the entire DUART.
0109 
0110 ulCtrlPort2
0111 
0112    This field is the base address of the port specific registers.
0113 
0114 ulDataPort
0115 
0116    This field is bit mapped as follows:
0117      bit 0:  baud rate set a or b
0118      bit 1-2: BRG selection ("Select Extend bit")
0119 
0120    Note: If both ports on single DUART are not configured for the same
0121          baud rate set, then unexpected results will occur.
0122 
0123    Note: On the Exar 88c681, if a standard clock of 3.6864 Mhz is used
0124          and the "Select Extend bit" is 0 (disabled), then the default
0125          MC68681 baud rate table is selected.
0126 
0127 getRegister
0128 setRegister
0129 
0130    These follow standard conventions.
0131 
0132 getData
0133 setData
0134 
0135    These are unused since the TX and RX data registers can be accessed
0136    as regular registers.
0137 
0138 ulClock
0139 
0140    This is a pointer to a baud rate mapping table.  If set to
0141    mc68681_baud_rate_table, then the CSR/ACR/X bit mappings shown
0142    in the 68681 and 88681 manuals are used.  Otherwise, the board
0143    specific baud rate mapping is used.
0144 
0145    NULL is not a valid value.
0146 
0147 ulIntVector
0148 
0149    This is the interrupt vector number associated with this chip.
0150 
0151 
0152 
0153 Status
0154 ======
0155 
0156 There are no known problems with this driver.
0157 
0158 Configuration Table Use
0159 -----------------------
0160 
0161 sDeviceName
0162 
0163    The name of this device.
0164 
0165 deviceType
0166 
0167    This field must be SERIAL_NS16550.
0168 
0169 pDeviceFns
0170 
0171    The device interface control table.  This may be:
0172       + ns16550_fns for interrupt driven IO
0173       + ns16550_fns_polled for polled IO
0174 
0175 deviceProbe
0176 
0177    This is the address of the routine which probes to see if the device
0178    is present.
0179 
0180 pDeviceFlow
0181 
0182    This field is ignored as hardware flow control is not currently supported.
0183 
0184 ulMargin
0185 
0186     This is currently unused.
0187 
0188 ulHysteresis
0189 
0190     This is currently unused.
0191 
0192 pDeviceParams
0193 
0194     This is set to the default settings.  At this point, it is the default
0195     baud rate cast as a (void *).
0196 
0197 ulCtrlPort1
0198 
0199    This field is the base address of this port on the UART.
0200 
0201 ulCtrlPort2
0202 
0203    This field is unused for the NS16550.
0204 
0205 ulDataPort
0206 
0207    This field is the base address of this port on the UART. 
0208 
0209 getRegister
0210 setRegister
0211 
0212    These follow standard conventions.
0213 
0214 getData
0215 setData
0216 
0217    These are unused since the TX and RX data registers can be accessed
0218    as regular registers.
0219 
0220 ulClock
0221 
0222    This is the clock constant which is divided by the desired baud
0223    to get the value programmed into the part.  The formula for this
0224    for 9600 baud is:
0225 
0226       chip_divisor_value = ulClock / 9600.
0227 
0228    NOTE: When ulClock is 0, the correct value for a PC (115,200) is
0229    used.
0230 
0231 ulIntVector
0232 
0233    This is the interrupt vector number associated with this chip.
0234 
0235 
0236 
0237 xr88681
0238 =======
0239 The Exar XR88681 is an enhanced version of the Motorola MC68681 and is
0240 supported by the mc68681 driver.
0241 
0242 
0243 z85c30
0244 ======
0245 
0246 Configuration Table Use
0247 -----------------------
0248 
0249 sDeviceName
0250 
0251    The name of this device.
0252 
0253 deviceType
0254 
0255    This field must be SERIAL_Z85C30.
0256 
0257 pDeviceFns
0258 
0259    The device interface control table.  This may be:
0260       + z85c30_fns for interrupt driven IO
0261       + z85c30_fns_polled for polled IO
0262 
0263 deviceProbe
0264 
0265    This is the address of the routine which probes to see if the device
0266    is present.
0267 
0268 pDeviceFlow
0269 
0270    This field is set to one of the following values:
0271       + NULL for no hardware flow control
0272       + z85c30_flow_RTSCTS for RTS/CTS based flow control
0273       + z85c30_flow_DTRCTS for DTR/CTS based flow control
0274 
0275 ulMargin
0276 
0277     This is currently unused.
0278 
0279 ulHysteresis
0280 
0281     This is currently unused.
0282 
0283 pDeviceParams
0284 
0285     This is set to the default settings.
0286 
0287 ulCtrlPort1
0288 
0289    This field is the address of the control register for this port.
0290 
0291 ulCtrlPort2
0292 
0293    This field is the address of the control register for chip.
0294 
0295 ulDataPort
0296 
0297    This field is the address of the data register for this port.
0298 
0299 getRegister
0300 setRegister
0301 
0302    These follow standard conventions.
0303 
0304 getData
0305 setData
0306 
0307    These follow standard conventions.
0308 
0309 ulClock
0310 
0311    This is the clock speed of the baud rate clock.
0312    NULL, then the CSR/ACR/X bit mappings shown in the 68681 and 88681
0313    manuals are used.  Otherwise, the board specific baud rate mapping
0314    is used.
0315 
0316 ulIntVector
0317 
0318    This is the interrupt vector number associated with this chip.