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 DUART access routines | |
---|
22 | \*===============================================================*/ |
---|
23 | /* derived from: */ |
---|
24 | /* |
---|
25 | * This include file contains all console driver definations for the nc16550 |
---|
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 <rtems.h> |
---|
38 | #include <bsp.h> |
---|
39 | #include "console.h" |
---|
40 | |
---|
41 | typedef struct uart_reg |
---|
42 | { |
---|
43 | volatile unsigned char reg; |
---|
44 | } uartReg; |
---|
45 | |
---|
46 | uint8_t Read_ns16550_register( |
---|
47 | uint32_t ulCtrlPort, |
---|
48 | uint8_t ucRegNum |
---|
49 | ) |
---|
50 | { |
---|
51 | struct uart_reg *p = (struct uart_reg *)ulCtrlPort; |
---|
52 | uint8_t ucData; |
---|
53 | ucData = p[ucRegNum].reg; |
---|
54 | asm volatile("sync"); |
---|
55 | return ucData; |
---|
56 | } |
---|
57 | |
---|
58 | void Write_ns16550_register( |
---|
59 | uint32_t ulCtrlPort, |
---|
60 | uint8_t ucRegNum, |
---|
61 | uint8_t ucData |
---|
62 | ) |
---|
63 | { |
---|
64 | struct uart_reg *p = (struct uart_reg *)ulCtrlPort; |
---|
65 | p[ucRegNum].reg = ucData; |
---|
66 | asm volatile("sync"); |
---|
67 | } |
---|