source: rtems/c/src/lib/libbsp/powerpc/ep1a/include/bsp.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: 6.6 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2008.
3 *  On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
7 *  http://www.rtems.com/license/LICENSE.
8 */
9
10#ifndef _BSP_H
11#define _BSP_H
12
13#include <bspopts.h>
14
15#include <rtems.h>
16#include <rtems/console.h>
17#include <libcpu/io.h>
18#include <rtems/clockdrv.h>
19#include <bsp/vectors.h>
20
21/* fundamental addresses for BSP (CHRPxxx and PREPxxx are from libcpu/io.h) */
22#define _IO_BASE                CHRP_ISA_IO_BASE
23#define _ISA_MEM_BASE           CHRP_ISA_MEM_BASE
24/* address of our ram on the PCI bus   */
25#define PCI_DRAM_OFFSET         CHRP_PCI_DRAM_OFFSET
26#define PCI_MEM_BASE            0x80000000
27#define PCI_MEM_BASE_ADJUSTMENT 0
28/* address of our ram on the PCI bus   */
29#define PCI_DRAM_OFFSET         CHRP_PCI_DRAM_OFFSET
30
31/* offset of pci memory as seen from the CPU */
32#undef  PCI_MEM_BASE
33#define PCI_MEM_BASE            0x00000000
34
35/* Override the default values for the following     DEFAULT */
36#define PCI_CONFIG_ADDR                 0xfec00000  /* 0xcf8 */
37#define PCI_CONFIG_DATA                 0xfee00000  /* 0xcfc */
38
39/*
40 * EP1A configuration Registers.
41 * Note:  All addresses assume flash boot.
42 */
43
44#define EQUIPMENT_PRESENT_REGISTER1     ((volatile unsigned char *)0xffa00000)
45#define EQUIPMENT_PRESENT_REGISTER2     ((volatile unsigned char *)0xffa00008)
46#define BOARD_REVISION_REGISTER1        ((volatile unsigned char *)0xffa00010)
47#define BOARD_REVISION_REGISTER2        ((volatile unsigned char *)0xffa00018)
48#define GENERAL_REGISTER1               ((volatile unsigned char *)0xffa00020)
49#define GENERAL_REGISTER2               ((volatile unsigned char *)0xffa00028)
50#define WATCHDOG_TRIGGER                ((volatile unsigned char *)0xffa00030)
51
52/* EQUIPMENT_PRESENT_REGISTER1 */
53#define BANK_MEMORY_SIZE_128MB          0x20
54#define BANK_MEMORY_SIZE_64MB           0x10
55#define ECC_ENABLED                     0x04
56
57/* EQUIPMENT-PRESENT_REGISTER2 */
58#define PLL_CFG_MASK                     0xf8
59#define MHZ_33_66_200                    0x70   /* PCI MEM CPU Frequency */
60#define MHZ_33_100_200                   0x80   /* PCI MEM CPU Frequency */
61#define MHZ_33_66_266                    0xb0   /* PCI MEM CPU Frequency */
62#define MHZ_33_66_333                    0x50   /* PCI MEM CPU Frequency */
63#define MHZ_33_100_333                   0x08   /* PCI MEM CPU Frequency */
64#define MHZ_33_100_350                   0x78   /* PCI MEM CPU Frequency */
65
66#define PMC_SLOT1_PRESENT                0x02
67#define PMC_SLOT2_PRESENT                0x01
68
69/* BOARD_REVISION_REGISTER1 */
70#define ARTWORK_REVISION_MASK            0xf0
71#define BUILD_REVISION_MASK              0x0f
72
73/* BOARD_REVISION_REGISTER2 */
74#define HARDWARE_ID_MASK                 0xe0
75#define HARDWARE_ID_PPC5_EP1A            0xe0
76#define HARDWARE_ID_EP1B                 0xc0
77
78/* GENERAL_REGISTER1 */
79#define DISABLE_WATCHDOG                  0x80
80#define DISABLE_RESET_SWITCH              0x40
81#define DISABLE_USER_FLASH                0x20
82#define DISABLE_BOOT_FLASH                0x10
83#define LED4_OFF                          0x08
84#define LED3_OFF                          0x04
85#define LED2_OFF                          0x02
86#define LED1_OFF                          0x01
87
88
89/* GENERAL_REGISTER2 */
90#define BSP_FLASH_VPP_ENABLE              0x01
91#define BSP_FLASH_PAGE_MASK               0x38
92#define BSP_FLASH_PAGE_SHIFT              0x03
93#define BSP_BIT_SLOWSTART                 0x04
94#define BSP_OFFLINE                       0x02
95#define BSP_SYSFAIL                       0x01
96
97/* WATCHDOG_TRIGGER */
98#define BSP_FLASH_BASE                   0xff000000
99#define BSP_VME_A16_BASE                 0x9fff0000
100#define BSP_VME_A24_BASE                 0x9f000000
101
102/*
103 *  address definitions for several devices
104 *
105 */
106#define UART_OFFSET_1_8245 (0x04500)
107#define UART_OFFSET_2_8245 (0x04600)
108#define UART_BASE_COM1     0xff800000
109#define UART_BASE_COM2     0xff800040
110
111#include <bsp/openpic.h>
112
113/* Note docs list 0x41000 but OpenPIC has a 0x1000 pad at the start
114 * assume that open pic specifies this pad but not mentioned in
115 * 8245 docs.
116 * This is an offset from EUMBBAR
117 */
118#define BSP_OPEN_PIC_BASE_OFFSET     0x40000
119
120/* BSP_PIC_DO_EOI is optionally used by the 'vmeUniverse' driver
121 * to implement VME IRQ priorities in software.
122 * Note that this requires support by the interrupt controller
123 * driver (cf. libbsp/shared/powerpc/irq/openpic_i8259_irq.c)
124 * and the BSP-specific universe initialization/configuration
125 * (cf. libbsp/shared/powerpc/vme/VMEConfig.h vme_universe.c)
126 *
127 * ********* IMPORTANT NOTE ********
128 * When deriving from this file (new BSPs)
129 * DO NOT define "BSP_PIC_DO_EOI" if you don't know what
130 * you are doing i.e., w/o implementing the required pieces
131 * mentioned above.
132 * ********* IMPORTANT NOTE ********
133 */
134#define BSP_PIC_DO_EOI openpic_eoi(0)
135
136
137#ifndef ASM
138#define outport_byte(port,value) outb(value,port)
139#define outport_word(port,value) outw(value,port)
140#define outport_long(port,value) outl(value,port)
141
142#define inport_byte(port,value) (value = inb(port))
143#define inport_word(port,value) (value = inw(port))
144#define inport_long(port,value) (value = inl(port))
145
146/*
147 * EUMMBAR
148 */
149extern unsigned int EUMBBAR;
150
151/*
152 * Total memory
153 */
154extern unsigned int BSP_mem_size;
155
156/*
157 * PCI Bus Frequency
158 */
159extern unsigned int BSP_bus_frequency;
160
161/*
162 * processor clock frequency
163 */
164extern unsigned int BSP_processor_frequency;
165
166/*
167 * Time base divisior (how many tick for 1 second).
168 */
169extern unsigned int BSP_time_base_divisor;
170
171#define BSP_Convert_decrementer( _value ) \
172  ((unsigned long long) ((((unsigned long long)BSP_time_base_divisor) * 1000000ULL) /((unsigned long long) BSP_bus_frequency)) * ((unsigned long long) (_value)))
173
174#define Processor_Synchronize() \
175  __asm__ (" eieio ")
176
177extern void BSP_panic(char *s);
178extern int BSP_disconnect_clock_handler (void);
179extern int BSP_connect_clock_handler (void);
180
181/*
182 * FLASH
183 */
184int BSP_FLASH_Enable_writes( uint32_t area );
185int BSP_FLASH_Disable_writes(  uint32_t area );
186void BSP_FLASH_set_page( uint8_t  page );
187
188#define BSP_FLASH_ENABLE_WRITES( _area) BSP_FLASH_Enable_writes( _area )
189#define BSP_FLASH_DISABLE_WRITES(_area) BSP_FLASH_Disable_writes( _area )
190#define BSP_FLASH_SET_PAGE(_page)       BSP_FLASH_set_page( _page )
191
192/* clear hostbridge errors
193 *
194 * enableMCP: whether to enable MCP checkstop / machine check interrupts
195 *            on the hostbridge and in HID0.
196 *
197 *            NOTE: HID0 and MEREN are left alone if this flag is 0
198 *
199 * quiet    : be silent
200 *
201 * RETURNS  : raven MERST register contents (lowermost 16 bits), 0 if
202 *            there were no errors
203 */
204extern unsigned long _BSP_clear_hostbridge_errors(int enableMCP, int quiet);
205
206#endif
207
208#endif
Note: See TracBrowser for help on using the repository browser.