source: rtems/c/src/lib/libbsp/sparc/leon2/include/rasta.h @ 8d830fae

4.115
Last change on this file since 8d830fae was 8d830fae, checked in by Radu <radustoma@…>, on 12/02/13 at 20:07:35

leon2_doxygen_1

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