source: rtems/c/src/lib/libcpu/powerpc/ppc403/include/ppc405ex.h @ 9b4422a2

4.115
Last change on this file since 9b4422a2 was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/12 at 15:09:24

Remove All CVS Id Strings Possible Using a Script

Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines

next to each other after Id string line removed.

+ remove entire comment blocks which only exited to

contain CVS Ids

+ If the processing left a blank line at the top of

a file, it was removed.

  • Property mode set to 100644
File size: 3.1 KB
Line 
1/*
2
3Constants for manipulating system registers of PPC 405EX in C
4
5Michael Hamel ADInstruments May 2008
6
7*/
8
9#include <libcpu/powerpc-utility.h>
10/* Indirect access to Clocking/Power-On registers */
11#define CPR0_DCR_BASE   0x0C
12#define cprcfga         (CPR0_DCR_BASE+0x0)
13#define cprcfgd         (CPR0_DCR_BASE+0x1)
14
15#define mtcpr(reg, d)                                   \
16  do {                                                  \
17    PPC_SET_DEVICE_CONTROL_REGISTER(cprcfga,reg);       \
18    PPC_SET_DEVICE_CONTROL_REGISTER(cprcfgd,d);         \
19  } while (0)
20
21#define mfcpr(reg, d)                                   \
22  do {                                                  \
23    PPC_SET_DEVICE_CONTROL_REGISTER(cprcfga,reg);       \
24    d = PPC_DEVICE_CONTROL_REGISTER(cprcfgd);           \
25  } while (0)
26
27
28/* Indirect access to System registers */
29#define SDR_DCR_BASE    0x0E
30#define sdrcfga         (SDR_DCR_BASE+0x0)
31#define sdrcfgd         (SDR_DCR_BASE+0x1)
32
33#define mtsdr(reg, d)                                   \
34  do {                                                  \
35    PPC_SET_DEVICE_CONTROL_REGISTER(sdrcfga,reg);       \
36    PPC_SET_DEVICE_CONTROL_REGISTER(sdrcfgd,d);         \
37  } while (0)
38
39#define mfsdr(reg, d)                                   \
40    do {                                                \
41      PPC_SET_DEVICE_CONTROL_REGISTER(sdrcfga,reg);     \
42      d = PPC_DEVICE_CONTROL_REGISTER(sdrcfgd);         \
43    } while (0)
44
45/* Indirect access to EBC registers */
46#define EBC_DCR_BASE    0x12
47#define ebccfga         (EBC_DCR_BASE+0x0)
48#define ebccfgd         (EBC_DCR_BASE+0x1)
49
50#define mtebc(reg, d)                                   \
51  do {                                                  \
52    PPC_SET_DEVICE_CONTROL_REGISTER(ebccfga,reg);       \
53    PPC_SET_DEVICE_CONTROL_REGISTER(ebccfgd,d);         \
54  } while (0)
55
56#define mfebc(reg, d)                                   \
57  do {                                                  \
58    PPC_SET_DEVICE_CONTROL_REGISTER(ebccfga,reg);       \
59    d = PPC_DEVICE_CONTROL_REGISTER(ebccfgd);           \
60  } while (0)
61
62/* EBC DCRs */
63enum {
64        /*
65        EBC0_B0CR       =       0,
66        EBC0_B1CR       =       1,
67        EBC0_B2CR       =       2,
68        EBC0_B3CR       =       3,
69        EBC0_B0AP       =       0x10,
70        EBC0_B1AP       =       0x11,
71        EBC0_B2AP       =       0x12,
72        EBC0_B3AP       =       0x13,
73        EBC0_BEAR       =       0x20,
74        EBC0_BESR       =       0x21,
75        EBC0_CFG        =       0x23,
76        */
77        EBC0_CID        =       0x24
78};
79
80enum {
81        SDR0_UART0      = 0x120,
82        SDR0_UART1  = 0x121,
83        SDR0_C405       = 0x180,
84        SDR0_MALTBL = 0x280,
85        SDR0_MALRBL = 0x2A0,
86        SDR0_MALTBS = 0x2C0,
87        SDR0_MALRBS = 0x2E0
88};
89
90
91/* Memory-mapped registers */
92
93
94/*======================= Ethernet =================== */
95
96
97typedef struct EthernetRegisters_EX {
98        uint32_t mode0;
99        uint32_t mode1;
100        uint32_t xmtMode0;
101        uint32_t xmtMode1;
102        uint32_t rcvMode;
103        uint32_t intStatus;
104        uint32_t intEnable;
105        uint32_t addrHi;
106        uint32_t addrLo;
107        uint32_t VLANTPID;
108        uint32_t VLANTCI;
109        uint32_t pauseTimer;
110        uint32_t multicastAddr[2];
111        uint32_t multicastMask[2];
112        uint32_t unused[4];
113        uint32_t lastSrcLo;
114        uint32_t lastSrcHi;
115        uint32_t IPGap;
116        uint32_t STAcontrol;
117        uint32_t xmtReqThreshold;
118        uint32_t rcvWatermark;
119        uint32_t bytesXmtd;
120        uint32_t bytesRcvd;
121        uint32_t unused2;
122        uint32_t revID;
123        uint32_t unused3[2];
124        uint32_t indivHash[8];
125        uint32_t groupHash[8];
126        uint32_t xmtPause;
127} EthernetRegisters_EX;
128
129enum {
130        EMAC0Address = 0xEF600900,
131        EMAC1Address = 0xEF600A00
132};
133
134
135typedef struct GPIORegisters {
136        uint32_t OR;
137        uint32_t GPIO_TCR;              /* Note that TCR is defined as a DCR name */
138        uint32_t OSRL;
139        uint32_t OSRH;
140        uint32_t TSRL;
141        uint32_t TSRH;
142        uint32_t ODR;
143        uint32_t IR;
144        uint32_t RR1;
145        uint32_t RR2;
146        uint32_t RR3;
147        uint32_t unknown;
148        uint32_t ISR1L;
149        uint32_t ISR1H;
150        uint32_t ISR2L;
151        uint32_t ISR2H;
152        uint32_t ISR3L;
153        uint32_t ISR3H;
154} GPIORegisters;
155
156enum { GPIOAddress = 0xEF600800 };
157
Note: See TracBrowser for help on using the repository browser.