2 #include "kernel/kernel.h"
6 /* Documentation is at http://www.plxtech.com/products/uart/oxpcie952 */
11 static unsigned char *oxpcie_vaddr
= NULL
;
13 void oxpcie_set_vaddr(unsigned char *vaddr
)
18 static void oxpcie_init(void)
20 printf("oxpcie_init\n");
21 /* Enable access to EFR and DLM+DLL */
24 /* Set FICR[1] to increase FIFO */
27 /* Set enhanced mode [4]
29 * no special char detection [5]
30 * no in-band receive flow control [1:0]
31 * no in-band transmit flow control [3:2]
35 /* Set divisor register to 115200 baud. */
39 /* Forget DLM and DLL, set LCR to config. */
40 OXPCIE_LCR
= LCR_CONFIG
;
41 OXPCIE_LCR
= LCR_CONFIG
;
48 void oxpcie_putc(char c
)
52 if(vm_running
&& oxpcie_vaddr
&& !inuse
) {
62 for (i
= 0; i
<100000; i
++) {
63 if(OXPCIE_LSR
& LSR_THRE
)
73 if(vm_running
&& oxpcie_vaddr
) {
77 return (int) OXPCIE_RBR
;