source: rtems/c/src/lib/libbsp/sparc/shared/include/grspw.h @ e16e0ca

4.104.114.84.95
Last change on this file since e16e0ca was e16e0ca, checked in by Joel Sherrill <joel.sherrill@…>, on 09/06/07 at 13:25:42

2007-09-06 Daniel Hellstrom <daniel@…>

  • Makefile.am: Add the following new drivers: PCI, b1553BRM, SpaceWire?(GRSPW), CAN (GRCAN,OC_CAN), Raw UART.
  • shared/include/apbuart.h, shared/include/apbuart_pci.h, shared/include/apbuart_rasta.h, shared/include/b1553brm.h, shared/include/b1553brm_pci.h, shared/include/b1553brm_rasta.h, shared/include/debug_defs.h, shared/include/grcan.h, shared/include/grcan_rasta.h, shared/include/grcan_spwrtc.h, shared/include/grspw.h, shared/include/grspw_pci.h, shared/include/grspw_rasta.h, shared/include/occan.h, shared/include/occan_pci.h, shared/include/pci.h: New files.
  • Property mode set to 100644
File size: 4.0 KB
Line 
1/*
2 *  Macros used for Spacewire bus
3 *
4 *  COPYRIGHT (c) 2007.
5 *  Gaisler Research
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
12#ifndef __GRSPW_H__
13#define __GRSPW_H__
14
15#include <ambapp.h>
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
21#define SPW_LINKERR_EVENT RTEMS_EVENT_0
22
23typedef struct {
24   unsigned int rxsize;
25   unsigned int txdsize;
26   unsigned int txhsize;
27} spw_ioctl_packetsize;
28
29typedef struct {
30   unsigned int hlen;
31   char *hdr;
32   unsigned int dlen;
33   char *data;
34   unsigned int sent;
35} spw_ioctl_pkt_send;
36
37typedef struct {
38   unsigned int tx_link_err;
39   unsigned int rx_rmap_header_crc_err;
40   unsigned int rx_rmap_data_crc_err;
41   unsigned int rx_eep_err;
42   unsigned int rx_truncated;
43   unsigned int parity_err;
44   unsigned int escape_err;
45   unsigned int credit_err;
46   unsigned int write_sync_err;
47   unsigned int disconnect_err;
48   unsigned int early_ep;
49   unsigned int invalid_address;
50   unsigned int packets_sent;
51   unsigned int packets_received;
52} spw_stats;
53
54typedef struct {
55   unsigned int nodeaddr;
56   unsigned int destkey;
57   unsigned int clkdiv;
58   unsigned int rxmaxlen;
59   unsigned int timer;
60   unsigned int disconnect;
61   unsigned int promiscuous;
62   unsigned int rmapen;
63   unsigned int rmapbufdis;
64   unsigned int linkdisabled;
65   unsigned int linkstart;
66
67   unsigned int check_rmap_err; /* check incoming packets for rmap errors */
68   unsigned int rm_prot_id; /* remove protocol id from incoming packets */
69   unsigned int tx_blocking; /* use blocking tx */
70   unsigned int tx_block_on_full; /* block when all tx_buffers are used */
71   unsigned int rx_blocking; /* block when no data is available */
72   unsigned int disable_err; /* disable link automatically when link error is detected */
73   unsigned int link_err_irq; /* generate an interrupt when link error occurs */
74   rtems_id event_id; /* task id that should receive link err irq event */
75   
76   unsigned int is_rmap;
77   unsigned int is_rxunaligned;
78   unsigned int is_rmapcrc;
79} spw_config;
80
81#define SPACEWIRE_IOCTRL_SET_NODEADDR        1
82#define SPACEWIRE_IOCTRL_SET_RXBLOCK         2
83#define SPACEWIRE_IOCTRL_SET_DESTKEY         4
84#define SPACEWIRE_IOCTRL_SET_CLKDIV          5
85#define SPACEWIRE_IOCTRL_SET_TIMER           6
86#define SPACEWIRE_IOCTRL_SET_DISCONNECT      7
87#define SPACEWIRE_IOCTRL_SET_PROMISCUOUS     8
88#define SPACEWIRE_IOCTRL_SET_RMAPEN          9
89#define SPACEWIRE_IOCTRL_SET_RMAPBUFDIS      10
90#define SPACEWIRE_IOCTRL_SET_CHECK_RMAP      11
91#define SPACEWIRE_IOCTRL_SET_RM_PROT_ID      12
92#define SPACEWIRE_IOCTRL_SET_TXBLOCK         14
93#define SPACEWIRE_IOCTRL_SET_DISABLE_ERR     15
94#define SPACEWIRE_IOCTRL_SET_LINK_ERR_IRQ    16
95#define SPACEWIRE_IOCTRL_SET_EVENT_ID        17
96#define SPACEWIRE_IOCTRL_SET_PACKETSIZE      20
97#define SPACEWIRE_IOCTRL_GET_LINK_STATUS     23
98#define SPACEWIRE_IOCTRL_GET_CONFIG          25
99#define SPACEWIRE_IOCTRL_GET_STATISTICS      26
100#define SPACEWIRE_IOCTRL_CLR_STATISTICS      27
101#define SPACEWIRE_IOCTRL_SEND                28
102#define SPACEWIRE_IOCTRL_LINKDISABLE         29
103#define SPACEWIRE_IOCTRL_LINKSTART           30
104#define SPACEWIRE_IOCTRL_SET_TXBLOCK_ON_FULL 31
105#define SPACEWIRE_IOCTRL_SET_COREFREQ        32
106
107#define SPACEWIRE_IOCTRL_START               64
108#define SPACEWIRE_IOCTRL_STOP                65
109
110int grspw_register(amba_confarea_type *bus);
111
112
113#if 0
114struct grspw_buf;
115
116struct grspw_buf {
117  grspw_buf *next;            /* next packet in chain */
118
119        /* Always used */
120        unsigned int dlen;          /* data length of '*data' */
121        unsigned int max_dlen;      /* allocated length of '*data' */
122        void *data;                 /* pointer to beginning of cargo data */
123 
124        /* Only used when transmitting */
125        unsigned int hlen;          /* length of header '*header' */
126        unsigned int max_hlen;      /* allocated length of '*header' */
127        void *header;               /* pointer to beginning of header data */
128};
129#endif
130
131#ifdef __cplusplus
132}
133#endif
134
135#endif /* __GRSPW_H__ */
Note: See TracBrowser for help on using the repository browser.