source: rtems/c/src/lib/libbsp/sparc/shared/include/grspw_router.h @ 3bb4122

4.115
Last change on this file since 3bb4122 was 3bb4122, checked in by Daniel Hellstrom <daniel@…>, on 02/23/15 at 12:02:39

LEON: added new drivers to the LEON2/LEON3 BSPs

Most drivers use the Driver Manager for device probing, they
work on AMBA-over-PCI systems if PCI is big-endian.

New APIs:

  • GPIO Library, interfaced to GRGPIO
  • GENIRQ, Generic interrupt service implementation helper

New GRLIB Drivers:

  • ACTEL 1553 RT, user interface is similar to 1553 BRM driver
  • GR1553 (1553 BC, RT and BM core)
  • AHBSTAT (AHB error status core)
  • GRADCDAC (Core interfacing to ADC/DAC hardware)
  • GRGPIO (GPIO port accessed from GPIO Library)
  • MCTRL (Memory controller settings configuration)
  • GRETH (10/100/1000 Ethernet driver using Driver manager)
  • GRPWM (Pulse Width Modulation core)
  • SPICTRL (SPI master interface)
  • GRSPW_ROUTER (SpaceWire? Router AMBA configuration interface)
  • GRCTM (SpaceCraft? on-board Time Management core)
  • SPWCUC (Time distribution over SpaceWire?)
  • GRTC (SpaceCraft? up-link Tele core)
  • GRTM (SpaceCraft? down-link Tele Metry core)

GR712RC ASIC specific interfaces:

  • GRASCS
  • CANMUX (select between OCCAN and SATCAN)
  • SATCAN
  • SLINK
  • Property mode set to 100644
File size: 2.8 KB
Line 
1/*
2 * GRSPW ROUTER APB-Register Driver.
3 *
4 * COPYRIGHT (c) 2010.
5 * Cobham Gaisler AB.
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_ROUTER_H__
13#define __GRSPW_ROUTER_H__
14
15/* Hardware Information */
16struct router_hw_info {
17        unsigned char nports_spw;
18        unsigned char nports_amba;
19        unsigned char nports_fifo;
20        char timers_avail;
21        char pnp_avail;
22        unsigned char ver_major;
23        unsigned char ver_minor;
24        unsigned char ver_patch;
25        unsigned char iid;
26};
27
28#define ROUTER_FLG_CFG          0x01
29#define ROUTER_FLG_IID          0x02
30#define ROUTER_FLG_IDIV         0x04
31#define ROUTER_FLG_TPRES        0x08
32#define ROUTER_FLG_TRLD         0x10
33#define ROUTER_FLG_ALL          0x1f    /* All Above Flags */
34
35struct router_config {
36        unsigned int flags; /* Determine what configuration should be updated */
37
38        /* Router Configuration Register */
39        unsigned int config;
40
41        /* Set Instance ID */
42        unsigned char iid;
43
44        /* SpaceWire Link Initialization Clock Divisor */
45        unsigned char idiv;
46
47        /* Timer Prescaler and Reload */
48        unsigned int timer_prescaler;
49        unsigned int timer_reload[32];
50};
51
52/* Logical routing table */
53struct router_routes {
54        unsigned int route[224];
55};
56
57/* Port Setup, see register definitions for "Port setup register" */
58struct router_ps {
59        unsigned int ps[31]; /* Port Setup for ports 1-31 */
60        unsigned int ps_logical[224]; /* Port setup for locgical addresses 32-255 */
61};
62
63/* Set/Get Port Control/Status */
64#define ROUTER_PORTFLG_SET_CTRL 0x01
65#define ROUTER_PORTFLG_GET_CTRL 0x02
66#define ROUTER_PORTFLG_SET_STS  0x04
67#define ROUTER_PORTFLG_GET_STS  0x08
68struct router_port {
69        unsigned int flag;
70        int port;
71        unsigned int ctrl;
72        unsigned int sts;
73};
74
75/* Get Hardware support/information available */
76#define GRSPWR_IOCTL_HWINFO     0x01    /* OUT:    struct router_hw_info */
77
78/* Router Configuration */
79#define GRSPWR_IOCTL_CFG_SET    0x02    /* IN:     struct router_config */
80#define GRSPWR_IOCTL_CFG_GET    0x03    /* OUT:    struct router_config */
81
82/* Routes */
83#define GRSPWR_IOCTL_ROUTES_SET 0x04    /* IN:     struct router_routes */
84#define GRSPWR_IOCTL_ROUTES_GET 0x05    /* OUT:    struct router_routes */
85
86/* Port Setup */
87#define GRSPWR_IOCTL_PS_SET     0x06    /* IN:     struct router_ps */
88#define GRSPWR_IOCTL_PS_GET     0x07    /* OUT:    struct router_ps */
89
90/* Set configuration write enable */
91#define GRSPWR_IOCTL_WE_SET     0x08    /* INT:    int */
92
93/* Set/Get Port Control/Status */
94#define GRSPWR_IOCTL_PORT       0x09    /* IN/OUT: struct router_port */
95
96/* Set Router Configuration/Status Register */
97#define GRSPWR_IOCTL_CFGSTS_SET 0x0a    /* IN:     unsigned int */
98/* Get Router Configuration/Status Register */
99#define GRSPWR_IOCTL_CFGSTS_GET 0x0b    /* OUT:    unsigned int */
100
101/* Get Current Time-Code Register */
102#define GRSPWR_IOCTL_TC_GET     0x0c    /* OUT:    unsigned int */
103
104#endif
Note: See TracBrowser for help on using the repository browser.