source: rtems/c/src/lib/libbsp/powerpc/ep1a/console/rsPMCQ1.h @ cc7c922

4.115
Last change on this file since cc7c922 was cc7c922, checked in by Joel Sherrill <joel.sherrill@…>, on 10/09/14 at 18:38:59

powerpc/ep1a: Fix multiple warnings

  • Property mode set to 100644
File size: 4.7 KB
Line 
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.org/license/LICENSE.
21 *
22 */
23
24#include <libcpu/io.h>
25#include <bsp/irq.h>
26
27/*
28   modification history
29   --------------------
30   01a,20Dec00,jpb         created
31 */
32
33#ifndef __INCPMCQ1H
34#define __INCPMCQ1H
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 *) ((unsigned32)_base + _reg)) )
100#define PMCQ1_Write_EPLD( _base, _reg, _data ) *((unsigned long *) ((unsigned32)_base + _reg)) = _data
101*/
102uint32_t PMCQ1_Read_EPLD( uint32_t base, uint32_t reg );
103void     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
111typedef void (*FUNCTION_PTR) (int);
112
113#define PCI_ID(v, d) ((d << 16) | v)
114
115
116#define PCI_VEN_ID_RADSTONE             0x11b5
117#define PCI_DEV_ID_PMC1553              0x0001
118#define PCI_DEV_ID_PMCF1                0x0002
119#define PCI_DEV_ID_PMCMMA               0x0003
120#define PCI_DEV_ID_PMCQ1                0x0007
121#define PCI_DEV_ID_PMCQ2                0x0008
122#define PCI_DEV_ID_PMCF1V2              0x0012
123
124
125
126typedef struct _PMCQ1BoardData
127{
128    struct _PMCQ1BoardData              *pNext;
129    unsigned long                       busNo;
130    unsigned long                       slotNo;
131    unsigned long                       funcNo;
132    unsigned long                       baseaddr;
133    unsigned long                       bridgeaddr;
134    FUNCTION_PTR                        quiccInt;
135    uintptr_t                           quiccArg;
136    FUNCTION_PTR                        maInt;
137    uintptr_t                           maArg;
138} PMCQ1BoardData, *PPMCQ1BoardData;
139
140extern PPMCQ1BoardData  pmcq1BoardData;
141
142/*
143 * Function declarations
144 */
145extern unsigned int rsPMCQ1QuiccIntConnect(
146  unsigned long         busNo,
147  unsigned long         slotNo,
148  unsigned long         funcNo,
149  FUNCTION_PTR          routine,
150  uintptr_t             arg
151);
152
153unsigned int rsPMCQ1Init(void);
154
155unsigned int rsPMCQ1MaIntConnect (
156    unsigned long       busNo,  /* Pci Bus number of PMCQ1 */
157    unsigned long       slotNo, /* Pci Slot number of PMCQ1 */
158    unsigned long       funcNo, /* Pci Function number of PMCQ1 */
159    FUNCTION_PTR        routine,/* interrupt routine */
160    uintptr_t           arg     /* argument to pass to interrupt routine */
161);
162
163#endif                          /* __INCPMCQ1H */
Note: See TracBrowser for help on using the repository browser.