Messages in this thread |  | | From | fabrizio.gennari@philips ... | Subject | Patch for supporting CPR register in 16C950 UART | Date | Fri, 18 May 2001 18:14:23 +0200 |
| |
Hello.
Here is a patch (tested on kernels 2.4.3 and 2.4.4) that adds 2 ioctl's in serial.c. One, TCSSERCPR, sets the CPR register in 16C950 UARTs. This register is a pre-scaler (that is, a divisor) for the clock. If the value is N, the clock is divided by N/8. If N<8, pre-scaling is disabled by setting bit 7 of MCR to 0. The other one, TCGSERCPR,, reads the value of CPR. If pre-scaling is disabled, it returns 8 (i.e., the clock frequency is left intact).
The patch also disables resetting the UART via the CSR register every time the serial device is opened (in the startup() function). This would reset the content of CPR. --------------------------------------------------------- Fabrizio Gennari tel. +39 039 203 7816 Philips Research Monza fax. +39 039 203 7800 via G. Casati 23 fabrizio.gennari@philips.com 20052 Monza (MI) Italy http://www.research.philips.com [unhandled content-type:application/octet-stream] |  |