1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @ingroup RTEMSBSPsPowerPCTQM8XX |
---|
5 | * |
---|
6 | * @brief Global BSP definitions. |
---|
7 | */ |
---|
8 | |
---|
9 | /* |
---|
10 | * RTEMS TQM8xx BSP |
---|
11 | * This include file contains all board IO definitions. |
---|
12 | */ |
---|
13 | |
---|
14 | /* |
---|
15 | * COPYRIGHT (c) 1989-2008. |
---|
16 | * On-Line Applications Research Corporation (OAR). |
---|
17 | * |
---|
18 | * Copyright (c) 2008 Thomas Doerfler, embedded brains GmbH. |
---|
19 | * All rights reserved. |
---|
20 | * |
---|
21 | * The license and distribution terms for this file may be |
---|
22 | * found in the file LICENSE in this distribution or at |
---|
23 | * http://www.rtems.org/license/LICENSE. |
---|
24 | */ |
---|
25 | |
---|
26 | #ifndef LIBBSP_POWERPC_TQM8XX_BSP_H |
---|
27 | #define LIBBSP_POWERPC_TQM8XX_BSP_H |
---|
28 | |
---|
29 | /** |
---|
30 | * @defgroup RTEMSBSPsPowerPCTQM8XX TQM8XX |
---|
31 | * |
---|
32 | * @ingroup RTEMSBSPsPowerPC |
---|
33 | * |
---|
34 | * @brief TQM8XX Board Support Package. |
---|
35 | * |
---|
36 | * @{ |
---|
37 | */ |
---|
38 | |
---|
39 | /* |
---|
40 | * indicate, that BSP is booted via TQMMon |
---|
41 | */ |
---|
42 | #define BSP_HAS_TQMMON |
---|
43 | |
---|
44 | #include <libcpu/powerpc-utility.h> |
---|
45 | |
---|
46 | LINKER_SYMBOL(TopRamReserved); |
---|
47 | |
---|
48 | LINKER_SYMBOL( bsp_ram_start); |
---|
49 | LINKER_SYMBOL( bsp_ram_end); |
---|
50 | LINKER_SYMBOL( bsp_ram_size); |
---|
51 | |
---|
52 | LINKER_SYMBOL( bsp_rom_start); |
---|
53 | LINKER_SYMBOL( bsp_rom_end); |
---|
54 | LINKER_SYMBOL( bsp_rom_size); |
---|
55 | |
---|
56 | LINKER_SYMBOL( bsp_section_text_start); |
---|
57 | LINKER_SYMBOL( bsp_section_text_end); |
---|
58 | LINKER_SYMBOL( bsp_section_text_size); |
---|
59 | |
---|
60 | LINKER_SYMBOL( bsp_section_data_start); |
---|
61 | LINKER_SYMBOL( bsp_section_data_end); |
---|
62 | LINKER_SYMBOL( bsp_section_data_size); |
---|
63 | |
---|
64 | LINKER_SYMBOL( bsp_section_bss_start); |
---|
65 | LINKER_SYMBOL( bsp_section_bss_end); |
---|
66 | LINKER_SYMBOL( bsp_section_bss_size); |
---|
67 | |
---|
68 | LINKER_SYMBOL( bsp_work_area_start); |
---|
69 | |
---|
70 | #ifndef ASM |
---|
71 | |
---|
72 | #include <bspopts.h> |
---|
73 | |
---|
74 | #include <rtems.h> |
---|
75 | #include <rtems/irq.h> |
---|
76 | #include <mpc8xx.h> |
---|
77 | #include <mpc8xx/cpm.h> |
---|
78 | #include <mpc8xx/mmu.h> |
---|
79 | #include <mpc8xx/console.h> |
---|
80 | #include <bsp/vectors.h> |
---|
81 | #include <bsp/tqm.h> |
---|
82 | #include <libcpu/powerpc-utility.h> |
---|
83 | #include <bsp/default-initial-extension.h> |
---|
84 | |
---|
85 | #ifdef __cplusplus |
---|
86 | extern "C" { |
---|
87 | #endif |
---|
88 | |
---|
89 | /* |
---|
90 | * Network driver configuration |
---|
91 | */ |
---|
92 | struct rtems_bsdnet_ifconfig; |
---|
93 | |
---|
94 | #if BSP_USE_NETWORK_FEC |
---|
95 | extern int rtems_fec_enet_driver_attach (struct rtems_bsdnet_ifconfig *config, |
---|
96 | int attaching); |
---|
97 | #define RTEMS_BSP_FEC_NETWORK_DRIVER_NAME "fec1" |
---|
98 | #define RTEMS_BSP_FEC_NETWORK_DRIVER_ATTACH rtems_fec_enet_driver_attach |
---|
99 | #endif |
---|
100 | |
---|
101 | #if BSP_USE_NETWORK_SCC |
---|
102 | extern int rtems_scc_enet_driver_attach (struct rtems_bsdnet_ifconfig *config, |
---|
103 | int attaching); |
---|
104 | #define RTEMS_BSP_SCC_NETWORK_DRIVER_NAME "scc1" |
---|
105 | #define RTEMS_BSP_SCC_NETWORK_DRIVER_ATTACH rtems_scc_enet_driver_attach |
---|
106 | #endif |
---|
107 | |
---|
108 | #if BSP_USE_NETWORK_FEC |
---|
109 | #define RTEMS_BSP_NETWORK_DRIVER_NAME RTEMS_BSP_FEC_NETWORK_DRIVER_NAME |
---|
110 | #define RTEMS_BSP_NETWORK_DRIVER_ATTACH RTEMS_BSP_FEC_NETWORK_DRIVER_ATTACH |
---|
111 | #elif BSP_USE_NETWORK_SCC |
---|
112 | #define RTEMS_BSP_NETWORK_DRIVER_NAME RTEMS_BSP_SCC_NETWORK_DRIVER_NAME |
---|
113 | #define RTEMS_BSP_NETWORK_DRIVER_ATTACH RTEMS_BSP_SCC_NETWORK_DRIVER_ATTACH |
---|
114 | #endif |
---|
115 | /* |
---|
116 | * We need to decide how much memory will be non-cacheable. This |
---|
117 | * will mainly be memory that will be used in DMA (network and serial |
---|
118 | * buffers). |
---|
119 | */ |
---|
120 | #define NOCACHE_MEM_SIZE 512*1024 |
---|
121 | |
---|
122 | /* |
---|
123 | * indicate, that BSP has IDE driver |
---|
124 | */ |
---|
125 | #undef RTEMS_BSP_HAS_IDE_DRIVER |
---|
126 | |
---|
127 | /* |
---|
128 | * SPI driver configuration |
---|
129 | */ |
---|
130 | |
---|
131 | /* select values for SPI addressing */ |
---|
132 | #define PGHPLUS_SPI_ADDR_EEPROM 0 |
---|
133 | #define PGHPLUS_SPI_ADDR_DISP4 1 |
---|
134 | /* NOTE: DISP4 occupies two consecutive addresses for data and control port */ |
---|
135 | #define PGHPLUS_SPI_ADDR_DISP4_DATA (PGHPLUS_SPI_ADDR_DISP4) |
---|
136 | #define PGHPLUS_SPI_ADDR_DISP4_CTRL (PGHPLUS_SPI_ADDR_DISP4_DATA+1) |
---|
137 | |
---|
138 | /* bit masks for Port B lines */ |
---|
139 | #define PGHPLUS_PB_SPI_EEP_CE_MSK (1<< 0) |
---|
140 | #define PGHPLUS_PB_SPI_DISP4_RS_MSK (1<<15) |
---|
141 | #define PGHPLUS_PB_SPI_DISP4_CE_MSK (1<<14) |
---|
142 | |
---|
143 | /* |
---|
144 | * our (internal) bus frequency |
---|
145 | */ |
---|
146 | extern uint32_t BSP_bus_frequency; |
---|
147 | |
---|
148 | /* |
---|
149 | * Interfaces to required Clock Driver support methods |
---|
150 | */ |
---|
151 | int BSP_disconnect_clock_handler(void); |
---|
152 | int BSP_connect_clock_handler (rtems_irq_hdl); |
---|
153 | |
---|
154 | extern uint32_t bsp_clock_speed; |
---|
155 | |
---|
156 | char serial_getc(void); |
---|
157 | |
---|
158 | int serial_tstc(void); |
---|
159 | |
---|
160 | void serial_init(void); |
---|
161 | |
---|
162 | int mbx8xx_console_get_configuration(void); |
---|
163 | |
---|
164 | void _InitTQM8xx (void); |
---|
165 | |
---|
166 | rtems_status_code bsp_register_spi(void); |
---|
167 | |
---|
168 | void *bsp_idle_thread( uintptr_t ignored ); |
---|
169 | |
---|
170 | void cpu_init(void); |
---|
171 | |
---|
172 | #ifdef __cplusplus |
---|
173 | } |
---|
174 | #endif |
---|
175 | |
---|
176 | #endif |
---|
177 | |
---|
178 | /** @} */ |
---|
179 | |
---|
180 | #endif |
---|