RTEMS 6.1-rc7
Loading...
Searching...
No Matches
bsp.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
11/*
12 * RTEMS generic MPC5200 BSP
13 *
14 * This file contains board specific definitions.
15 */
16
17/*
18 * Copyright (c) 2005 embedded brains GmbH & Co. KG
19 *
20 * Redistribution and use in source and binary forms, with or without
21 * modification, are permitted provided that the following conditions
22 * are met:
23 * 1. Redistributions of source code must retain the above copyright
24 * notice, this list of conditions and the following disclaimer.
25 * 2. Redistributions in binary form must reproduce the above copyright
26 * notice, this list of conditions and the following disclaimer in the
27 * documentation and/or other materials provided with the distribution.
28 *
29 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
30 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
31 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
32 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
33 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
34 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
35 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
36 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
37 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
38 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
39 * POSSIBILITY OF SUCH DAMAGE.
40 */
41
42#ifndef LIBBSP_POWERPC_GEN5200_BSP_H
43#define LIBBSP_POWERPC_GEN5200_BSP_H
44
55#include <bspopts.h>
56
58
59/*
60 * Some symbols defined in the linker command file.
61 */
62
63LINKER_SYMBOL(bsp_ram_start);
64LINKER_SYMBOL(bsp_ram_end);
65LINKER_SYMBOL(bsp_ram_size);
66
67LINKER_SYMBOL(bsp_rom_start);
68LINKER_SYMBOL(bsp_rom_end);
69LINKER_SYMBOL(bsp_rom_size);
70
71LINKER_SYMBOL(bsp_dpram_start);
72LINKER_SYMBOL(bsp_dpram_end);
73LINKER_SYMBOL(bsp_dpram_size);
74
75LINKER_SYMBOL(bsp_section_text_start);
76LINKER_SYMBOL(bsp_section_text_end);
77LINKER_SYMBOL(bsp_section_text_size);
78
79LINKER_SYMBOL(bsp_section_data_start);
80LINKER_SYMBOL(bsp_section_data_end);
81LINKER_SYMBOL(bsp_section_data_size);
82
83LINKER_SYMBOL(bsp_section_bss_start);
84LINKER_SYMBOL(bsp_section_bss_end);
85LINKER_SYMBOL(bsp_section_bss_size);
86
87LINKER_SYMBOL(bsp_work_area_start);
88
89LINKER_SYMBOL(MBAR);
90
91/* Provide legacy defines */
92
93#ifdef MPC5200_BOARD_PM520_ZE30
94#define PM520_ZE30
95#endif
96
97#ifdef MPC5200_BOARD_PM520_CR825
98#define PM520_CR825
99#endif
100
101#ifdef MPC5200_BOARD_ICECUBE
102#define icecube
103#endif
104
105#ifdef MPC5200_BOARD_BRS5L
106#define BRS5L
107#endif
108
109/*
110 * distinguish board characteristics
111 */
112/*
113 * for PM520 mdule on a ZE30 carrier
114 */
115#if defined(MPC5200_BOARD_PM520_ZE30)
116#define PM520
117#endif
118/*
119 * for PM520 mdule on a CR825 carrier
120 */
121#if defined(MPC5200_BOARD_PM520_CR825)
122#define PM520
123#endif
124
125#if !defined(HAS_UBOOT)
126 /* we need the low level initialization in start.S*/
127 #define NEED_LOW_LEVEL_INIT
128#endif
129
130#if defined(MPC5200_BOARD_BRS5L)
131/*
132 * IMD Custom Board BRS5L
133 */
134
135#define HAS_NVRAM_93CXX
136
137#elif defined(MPC5200_BOARD_BRS6L)
138 #define MPC5200_BRS6L_FPGA_BEGIN 0x800000
139 #define MPC5200_BRS6L_FPGA_SIZE (64 * 1024)
140 #define MPC5200_BRS6L_FPGA_END \
141 (MPC5200_BRS6L_FPGA_BEGIN + MPC5200_BRS6L_FPGA_SIZE)
142
143 #define MPC5200_BRS6L_MRAM_BEGIN 0xff000000
144 #define MPC5200_BRS6L_MRAM_SIZE (4 * 1024 * 1024)
145 #define MPC5200_BRS6L_MRAM_END \
146 (MPC5200_BRS6L_MRAM_BEGIN + MPC5200_BRS6L_MRAM_SIZE)
147#elif defined (PM520)
148
149/* Nothing special */
150
151#elif defined (MPC5200_BOARD_ICECUBE)
152/*
153 * Codename: IceCube
154 * Compatible Boards:
155 * Freescape MPC5200LITE
156 * Embedded Planet EP5200
157 */
158
159#elif defined (MPC5200_BOARD_DP2)
160
161/* Nothing special */
162
163#else
164#error "board type not defined"
165#endif
166
167#ifndef ASM
168
169#include <rtems.h>
170#include <bsp/i2cdrv.h>
171#include <bsp/irq.h>
172#include <bsp/vectors.h>
173#include <bsp/u-boot.h>
175
176#ifdef __cplusplus
177extern "C" {
178#endif
179
180/*
181 * Network driver configuration
182 */
183struct rtems_bsdnet_ifconfig;
184extern int rtems_mpc5200_fec_driver_attach_detach (struct rtems_bsdnet_ifconfig *config, int attaching);
185#define RTEMS_BSP_NETWORK_DRIVER_NAME "eth1"
186#define RTEMS_BSP_NETWORK_DRIVER_ATTACH rtems_mpc5200_fec_driver_attach_detach
187
188/* miscellaneous stuff assumed to exist */
189
190/*
191 * We need to decide how much memory will be non-cacheable. This
192 * will mainly be memory that will be used in DMA (network and serial
193 * buffers).
194 */
195/*
196#define NOCACHE_MEM_SIZE 512*1024
197*/
198
199/*
200 * Device Driver Table Entries
201 */
202
203#ifdef HAS_NVRAM_93CXX
204#define NVRAM_DRIVER_TABLE_ENTRY \
205 { nvram_driver_initialize, nvram_driver_open, nvram_driver_close, \
206 nvram_driver_read, nvram_driver_write, NULL }
207#endif
208
209/*
210 * indicate, that BSP has IDE driver
211 */
212#define RTEMS_BSP_HAS_IDE_DRIVER
213
214/* functions */
215
216/* #define SHOW_MORE_INIT_SETTINGS 1 */
217
218/* ata modes */
219/* #undef ATA_USE_INT */
220#define ATA_USE_INT
221
222/* clock settings */
223#if defined(HAS_UBOOT)
224#define IPB_CLOCK (bsp_uboot_board_info.bi_ipbfreq)
225#define XLB_CLOCK (bsp_uboot_board_info.bi_busfreq)
226#define G2_CLOCK (bsp_uboot_board_info.bi_intfreq)
227#elif defined(MPC5200_BOARD_BRS5L) || defined(MPC5200_BOARD_BRS6L)
228#define IPB_CLOCK 66000000 /* 66 MHz */
229#define XLB_CLOCK 132000000 /* 132 MHz */
230#define G2_CLOCK 396000000 /* 396 MHz */
231#else
232#define IPB_CLOCK 33000000 /* 33 MHz */
233#define XLB_CLOCK 66000000 /* 66 MHz */
234#define G2_CLOCK 231000000 /* 231 MHz */
235#endif
236
237#if defined(HAS_UBOOT)
238#define GEN5200_CONSOLE_BAUD (bsp_uboot_board_info.bi_baudrate)
239#else
240#define GEN5200_CONSOLE_BAUD 115200
241#endif
242
243/*
244 * Convert decrement value to tenths of microsecnds (used by
245 * shared timer driver).
246 *
247 * + CPU has a XLB_CLOCK bus,
248 * + There are 4 bus cycles per click
249 * + We return value in 1/10 microsecond units.
250 * Modified following equation to integer equation to remove
251 * floating point math.
252 * (int) ((float)(_value) / ((XLB_CLOCK/1000000 * 0.1) / 4.0))
253 */
254
255#define BSP_Convert_decrementer( _value ) \
256 (int) (((_value) * 4000) / (XLB_CLOCK/10000))
257
258/* slicetimer settings */
259#define USE_SLICETIMER_0 TRUE
260#define USE_SLICETIMER_1 FALSE
261
262void *bsp_idle_thread( uintptr_t ignored );
263#define BSP_IDLE_TASK_BODY bsp_idle_thread
264
265/* BSP specific IRQ Benchmarking support */
266void BSP_IRQ_Benchmarking_Reset(void);
267void BSP_IRQ_Benchmarking_Report(void);
268
269#if defined(HAS_UBOOT)
270 /* Routine to obtain U-Boot environment variables */
271 const char *bsp_uboot_getenv(
272 const char *name
273 );
274#endif
275
276void cpu_init(void);
277
278int mpc5200_eth_mii_read(
279 int phyAddr,
280 void *arg,
281 unsigned regAddr,
282 uint32_t *retVal
283);
284
285#ifdef __cplusplus
286}
287#endif
288
289#endif /* ASM */
290
293#endif /* GEN5200 */
PowerPC Exceptions API.
This header file provides the default definition of BSP_INITIAL_EXTENSION.
void * bsp_idle_thread(uintptr_t ignored)
Optimized idle task.
Definition: bspidle.c:39
General purpose assembler macros, linker command file support and some inline functions for direct re...
This header file defines the RTEMS Classic API.
Definition: deflate.c:114
U_BOOT Support.