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