source: rtems/c/src/lib/libbsp/sparc/leon2/include/rasta.h @ 183af89

4.115
Last change on this file since 183af89 was 44b06ca, checked in by Ralf Corsepius <ralf.corsepius@…>, on 11/29/09 at 15:33:28

Whitespace removal.

  • Property mode set to 100644
File size: 3.7 KB
Line 
1/*
2 * $Id$
3 */
4
5#ifndef __RASTA_H__
6#define __RASTA_H__
7
8#include <bsp.h>
9
10#include <grcan.h>
11#include <b1553brm_rasta.h>
12#include <grspw.h>
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18extern int rasta_register(void);
19
20/* Address of PCI bus on RASTA local AMBA bus */
21#define RASTA_PCI_BASE             0xe0000000
22
23/* Address of SRAM on RASTA local AMBA bus */
24#define RASTA_LOCAL_SRAM           0x40000000
25
26#define UART0_IRQNO  2
27#define UART1_IRQNO  3
28#define GRCAN_IRQNO  7
29#define SPW0_IRQNO   10
30#define SPW1_IRQNO   11
31#define SPW2_IRQNO   12
32#define BRM_IRQNO    13
33
34#define GRCAN_IRQ   (3<<GRCAN_IRQNO)
35#define SPW0_IRQ    (1<<SPW0_IRQNO)
36#define SPW1_IRQ    (1<<SPW1_IRQNO)
37#define SPW2_IRQ    (1<<SPW2_IRQNO)
38#define SPW_IRQ     (7<<SPW0_IRQNO)
39#define BRM_IRQ     (1<<BRM_IRQNO)
40#define UART0_IRQ   (1<<UART0_IRQNO)
41#define UART1_IRQ   (1<<UART1_IRQNO)
42
43/*
44 *  The following defines the bits in the UART Control Registers.
45 *
46 */
47#define LEON_REG_UART_CONTROL_RTD  0x000000FF /* RX/TX data */
48
49/*
50 *  The following defines the bits in the LEON UART Status Registers.
51 */
52#define LEON_REG_UART_STATUS_DR   0x00000001 /* Data Ready */
53#define LEON_REG_UART_STATUS_TSE  0x00000002 /* TX Send Register Empty */
54#define LEON_REG_UART_STATUS_THE  0x00000004 /* TX Hold Register Empty */
55#define LEON_REG_UART_STATUS_BR   0x00000008 /* Break Error */
56#define LEON_REG_UART_STATUS_OE   0x00000010 /* RX Overrun Error */
57#define LEON_REG_UART_STATUS_PE   0x00000020 /* RX Parity Error */
58#define LEON_REG_UART_STATUS_FE   0x00000040 /* RX Framing Error */
59#define LEON_REG_UART_STATUS_ERR  0x00000078 /* Error Mask */
60
61
62/*
63 *  The following defines the bits in the LEON UART Status Registers.
64 */
65#define LEON_REG_UART_CTRL_RE     0x00000001 /* Receiver enable */
66#define LEON_REG_UART_CTRL_TE     0x00000002 /* Transmitter enable */
67#define LEON_REG_UART_CTRL_RI     0x00000004 /* Receiver interrupt enable */
68#define LEON_REG_UART_CTRL_TI     0x00000008 /* Transmitter interrupt enable */
69#define LEON_REG_UART_CTRL_PS     0x00000010 /* Parity select */
70#define LEON_REG_UART_CTRL_PE     0x00000020 /* Parity enable */
71#define LEON_REG_UART_CTRL_FL     0x00000040 /* Flow control enable */
72#define LEON_REG_UART_CTRL_LB     0x00000080 /* Loop Back enable */
73
74#define UART_SET_SCALER 0
75#define UART_SET_CTRL   1
76#define UART_GET_STAT   2
77#define UART_CLR_STAT   3
78
79struct uart_reg {
80    volatile unsigned int data;              /* 0x00 */
81    volatile unsigned int status;            /* 0x04 */
82    volatile unsigned int ctrl;              /* 0x08 */
83    volatile unsigned int scaler;            /* 0x0C */
84};
85
86
87void uart_register(unsigned int baseaddr);
88rtems_device_driver uart_initialize(rtems_device_major_number  major, rtems_device_minor_number  minor, void *arg);
89rtems_device_driver uart_open(rtems_device_major_number major, rtems_device_minor_number minor, void *arg);
90rtems_device_driver uart_close(rtems_device_major_number major, rtems_device_minor_number minor, void *arg);
91rtems_device_driver uart_read(rtems_device_major_number major, rtems_device_minor_number minor, void *arg);
92rtems_device_driver uart_write(rtems_device_major_number major, rtems_device_minor_number minor, void *arg);
93rtems_device_driver uart_control(rtems_device_major_number major, rtems_device_minor_number minor, void *arg);
94
95
96struct gpio_reg {
97    volatile unsigned int in_data;          /* 0x00 */
98    volatile unsigned int out_data;         /* 0x04 */
99    volatile unsigned int dir;              /* 0x08 */
100    volatile unsigned int imask;            /* 0x0C */
101    volatile unsigned int ipol;             /* 0x10 */
102    volatile unsigned int iedge;            /* 0x14 */
103};
104
105extern struct gpio_reg *gpio0, *gpio1;
106
107#ifdef __cplusplus
108}
109#endif
110
111#endif
Note: See TracBrowser for help on using the repository browser.