1 | /* rsPMCQ1.h - Radstone PMCQ1 private header |
---|
2 | * |
---|
3 | * Copyright 2000 Radstone Technology |
---|
4 | * |
---|
5 | * THIS FILE IS PROVIDED TO YOU, THE USER, "AS IS", WITHOUT WARRANTY OF ANY |
---|
6 | * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE |
---|
7 | * IMPLIED WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK |
---|
8 | * AS TO THE QUALITY AND PERFORMANCE OF ALL CODE IN THIS FILE IS WITH YOU. |
---|
9 | * |
---|
10 | * You are hereby granted permission to use, copy, modify, and distribute |
---|
11 | * this file, provided that this notice, plus the above copyright notice |
---|
12 | * and disclaimer, appears in all copies. Radstone Technology will provide |
---|
13 | * no support for this code. |
---|
14 | * |
---|
15 | * COPYRIGHT (c) 2005. |
---|
16 | * On-Line Applications Research Corporation (OAR). |
---|
17 | * |
---|
18 | * The license and distribution terms for this file may be |
---|
19 | * found in the file LICENSE in this distribution or at |
---|
20 | * http://www.rtems.com/license/LICENSE. |
---|
21 | * |
---|
22 | */ |
---|
23 | |
---|
24 | /* |
---|
25 | modification history |
---|
26 | -------------------- |
---|
27 | 01a,20Dec00,jpb created |
---|
28 | */ |
---|
29 | |
---|
30 | #ifndef __INCPMCQ1H |
---|
31 | #define __INCPMCQ1H |
---|
32 | |
---|
33 | #include <libcpu/io.h> |
---|
34 | #include <bsp/irq.h> |
---|
35 | |
---|
36 | /* |
---|
37 | * PMCQ1 definitions |
---|
38 | */ |
---|
39 | |
---|
40 | /* |
---|
41 | * 360 definitions |
---|
42 | */ |
---|
43 | |
---|
44 | #define Q1_360_MBAR 0x0003ff00 /* master base address register */ |
---|
45 | |
---|
46 | #define REG_B_OFFSET 0x1000 /* offset to the internal registers */ |
---|
47 | |
---|
48 | #define Q1_360_SIM_MCR (REG_B_OFFSET+0x00) |
---|
49 | #define Q1_360_SIM_PEPAR (REG_B_OFFSET+0x16) |
---|
50 | #define Q1_360_SIM_SYPCR (REG_B_OFFSET+0x22) |
---|
51 | #define Q1_360_SIM_PICR (REG_B_OFFSET+0x26) |
---|
52 | #define Q1_360_SIM_PITR (REG_B_OFFSET+0x2A) |
---|
53 | #define Q1_360_SIM_GMR (REG_B_OFFSET+0x40) |
---|
54 | #define Q1_360_SIM_BR0 (REG_B_OFFSET+0x50) |
---|
55 | #define Q1_360_SIM_OR0 (REG_B_OFFSET+0x54) |
---|
56 | #define Q1_360_SIM_BR1 (REG_B_OFFSET+0x60) |
---|
57 | #define Q1_360_SIM_OR1 (REG_B_OFFSET+0x64) |
---|
58 | |
---|
59 | #define Q1_360_CPM_ICCR (REG_B_OFFSET+0x500) |
---|
60 | #define Q1_360_CPM_SDCR (REG_B_OFFSET+0x51E) |
---|
61 | #define Q1_360_CPM_CICR (REG_B_OFFSET+0x540) |
---|
62 | |
---|
63 | /* |
---|
64 | * EPLD offsets |
---|
65 | * |
---|
66 | * Only top 4 data bits are used |
---|
67 | */ |
---|
68 | #define PMCQ1_CODE_VERSION 0x00040000 /* Code Version */ |
---|
69 | |
---|
70 | #define PMCQ1_BOARD_REVISION 0x00040004 /* Board Revision */ |
---|
71 | |
---|
72 | #define PMCQ1_BUILD_OPTION 0x00040008 /* Build Option */ |
---|
73 | #define PMCQ1_ACE_FITTED 0x80000000 |
---|
74 | #define PMCQ1_QUICC_FITTED 0x40000000 |
---|
75 | #define PMCQ1_SRAM_SIZE 0x30000000 /* 01 - 1MB */ |
---|
76 | #define PMCQ1_SRAM_FITTED 0x20000000 |
---|
77 | |
---|
78 | #define PMCQ1_INT_STATUS 0x0004000c /* Interrupt Status */ |
---|
79 | #define PMCQ1_INT_STATUS_MA 0x20000000 |
---|
80 | #define PMCQ1_INT_STATUS_QUICC 0x10000000 |
---|
81 | |
---|
82 | #define PMCQ1_INT_MASK 0x00040010 /* Interrupt Mask */ |
---|
83 | #define PMCQ1_INT_MASK_QUICC 0x20000000 |
---|
84 | #define PMCQ1_INT_MASK_MA 0x10000000 |
---|
85 | |
---|
86 | #define PMCQ1_RT_ADDRESS 0x00040014 /* RT Address Latch */ |
---|
87 | |
---|
88 | #define PMCQ1_DRIVER_ENABLE 0x0004001c /* Channel Drive Enable */ |
---|
89 | #define PMCQ1_DRIVER_ENABLE_3 0x80000000 |
---|
90 | #define PMCQ1_DRIVER_ENABLE_2 0x40000000 |
---|
91 | #define PMCQ1_DRIVER_ENABLE_1 0x20000000 |
---|
92 | #define PMCQ1_DRIVER_ENABLE_0 0x10000000 |
---|
93 | |
---|
94 | #define PMCQ1_MINIACE_REGS 0x000c0000 |
---|
95 | #define PMCQ1_MINIACE_MEM 0x00100000 |
---|
96 | #define PMCQ1_RAM 0x00200000 |
---|
97 | |
---|
98 | /* |
---|
99 | #define PMCQ1_Read_EPLD( _base, _reg ) ( *((unsigned long *) ((uint32_t)_base + _reg)) ) |
---|
100 | #define PMCQ1_Write_EPLD( _base, _reg, _data ) *((unsigned long *) ((uint32_t)_base + _reg)) = _data |
---|
101 | */ |
---|
102 | uint32_t PMCQ1_Read_EPLD( uint32_t base, uint32_t reg ); |
---|
103 | void PMCQ1_Write_EPLD( uint32_t base, uint32_t reg, uint32_t data ); |
---|
104 | |
---|
105 | /* |
---|
106 | * QSPAN-II register offsets |
---|
107 | */ |
---|
108 | |
---|
109 | #define QSPAN2_INT_STATUS 0x00000600 |
---|
110 | |
---|
111 | |
---|
112 | #define PCI_ID(v, d) ((d << 16) | v) |
---|
113 | |
---|
114 | |
---|
115 | #define PCI_VEN_ID_RADSTONE 0x11b5 |
---|
116 | #define PCI_DEV_ID_PMC1553 0x0001 |
---|
117 | #define PCI_DEV_ID_PMCF1 0x0002 |
---|
118 | #define PCI_DEV_ID_PMCMMA 0x0003 |
---|
119 | #define PCI_DEV_ID_PMCQ1 0x0007 |
---|
120 | #define PCI_DEV_ID_PMCQ2 0x0008 |
---|
121 | #define PCI_DEV_ID_PMCF1V2 0x0012 |
---|
122 | |
---|
123 | |
---|
124 | |
---|
125 | typedef struct _PMCQ1BoardData |
---|
126 | { |
---|
127 | struct _PMCQ1BoardData *pNext; |
---|
128 | unsigned long busNo; |
---|
129 | unsigned long slotNo; |
---|
130 | unsigned long funcNo; |
---|
131 | unsigned long baseaddr; |
---|
132 | unsigned long bridgeaddr; |
---|
133 | rtems_irq_hdl quiccInt; |
---|
134 | rtems_irq_hdl_param quiccArg; |
---|
135 | rtems_irq_hdl maInt; |
---|
136 | rtems_irq_hdl_param maArg; |
---|
137 | } PMCQ1BoardData, *PPMCQ1BoardData; |
---|
138 | |
---|
139 | extern PPMCQ1BoardData pmcq1BoardData; |
---|
140 | |
---|
141 | /* |
---|
142 | * Function declarations |
---|
143 | */ |
---|
144 | extern unsigned int rsPMCQ1QuiccIntConnect( |
---|
145 | unsigned long busNo, unsigned long slotNo,unsigned long funcNo, rtems_irq_hdl routine,rtems_irq_hdl_param arg ); |
---|
146 | unsigned int rsPMCQ1Init(); |
---|
147 | |
---|
148 | #endif /* __INCPMCQ1H */ |
---|