source: rtems/c/src/lib/libbsp/powerpc/ep1a/console/ns16550cfg.c @ de49de6

4.104.115
Last change on this file since de49de6 was de49de6, checked in by Joel Sherrill <joel.sherrill@…>, on 10/02/08 at 17:27:07

2008-10-02 Joel Sherrill <joel.sherrill@…>

  • console/config.c, console/console.c, console/console.h, console/ns16550cfg.c, console/ns16550cfg.h, include/bsp.h, include/tm27.h, irq/irq_init.c, irq/openpic_xxx_irq.c, pci/no_host_bridge.c: File head clean up.
  • console/debugio.c: Removed.
  • Property mode set to 100644
File size: 1.1 KB
Line 
1/* 
2 *  This include file contains all console driver definations for the nc16550
3 *
4 *  COPYRIGHT (c) 1989-2008.
5 *  On-Line Applications Research Corporation (OAR).
6 *
7 *  The license and distribution terms for this file may be
8 *  found in the file LICENSE in this distribution or at
9 *  http://www.rtems.com/license/LICENSE.
10 *
11 *  $Id$
12 */
13
14#include <rtems.h>
15#include <bsp.h>
16#include "console.h"
17                                                           
18typedef struct uart_reg
19{
20  unsigned char reg;
21  unsigned char pad[7];
22} uartReg;
23
24uint8_t Read_ns16550_register(
25  uint32_t  ulCtrlPort,
26  uint8_t   ucRegNum
27)
28{
29volatile struct uart_reg *p = (volatile struct uart_reg *)ulCtrlPort;
30  uint8_t  ucData;
31  ucData = p[ucRegNum].reg;
32  asm volatile("sync");
33  return ucData;
34}
35
36void  Write_ns16550_register(
37  uint32_t  ulCtrlPort,
38  uint8_t   ucRegNum,
39  uint8_t   ucData
40)
41{
42  volatile struct uart_reg *p = (volatile struct uart_reg *)ulCtrlPort;
43  volatile int i;
44  p[ucRegNum].reg = ucData;
45  asm volatile("sync");
46  asm volatile("isync");
47  asm volatile("eieio");
48  for (i=0;i<0x08ff;i++)
49    asm volatile("isync");
50}
Note: See TracBrowser for help on using the repository browser.