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 MPC83xx BSP
13 *
14 * This file contains board specific definitions.
15 */
16
17/*
18 * Copyright (c) 2007 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_GEN83XX_BSP_H
43#define LIBBSP_POWERPC_GEN83XX_BSP_H
44
55#define BSP_FEATURE_IRQ_EXTENSION
56
57#include <bspopts.h>
58
60
61#include <bsp/hwreg_vals.h>
62
63/*
64 * Some symbols defined in the linker command file.
65 */
66
67LINKER_SYMBOL(bsp_ram_start);
68LINKER_SYMBOL(bsp_ram_end);
69LINKER_SYMBOL(bsp_ram_size);
70
71LINKER_SYMBOL(bsp_rom_start);
72LINKER_SYMBOL(bsp_rom_end);
73LINKER_SYMBOL(bsp_rom_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(IMMRBAR);
90
91#ifndef ASM
92
93#include <rtems.h>
94#include <bsp/vectors.h>
95#include <bsp/irq.h>
97
98#ifdef __cplusplus
99extern "C" {
100#endif
101
102/*
103 * indicate, that BSP has no IDE driver
104 */
105#undef RTEMS_BSP_HAS_IDE_DRIVER
106
107/* misc macros */
108#define BSP_ARRAY_CNT(arr) (sizeof(arr)/sizeof(arr[0]))
109
110void *bsp_idle_thread( uintptr_t ignored );
111#define BSP_IDLE_TASK_BODY bsp_idle_thread
112
113/* functions */
114rtems_status_code bsp_register_i2c(void);
115rtems_status_code bsp_register_spi(void);
116
117/*
118 * Network driver configuration
119 */
120struct rtems_bsdnet_ifconfig;
121extern int BSP_tsec_attach(struct rtems_bsdnet_ifconfig *config,int attaching);
122#define RTEMS_BSP_NETWORK_DRIVER_ATTACH BSP_tsec_attach
123
124#ifdef MPC83XX_BOARD_MPC8313ERDB
125 #define RTEMS_BSP_NETWORK_DRIVER_NAME "tsec2"
126 #define RTEMS_BSP_NETWORK_DRIVER_NAME2 "tsec1"
127#else
128 #define RTEMS_BSP_NETWORK_DRIVER_NAME "tsec1"
129 #define RTEMS_BSP_NETWORK_DRIVER_NAME2 "tsec2"
130#endif
131
132#if defined(MPC83XX_BOARD_MPC8349EAMDS)
133/*
134 * i2c EEPROM device name
135 */
136#define RTEMS_BSP_I2C_EEPROM_DEVICE_NAME "eeprom"
137#define RTEMS_BSP_I2C_EEPROM_DEVICE_PATH "/dev/i2c1.eeprom"
138
139/*
140 * SPI Flash device name
141 */
142#define RTEMS_BSP_SPI_FLASH_DEVICE_NAME "flash"
143#define RTEMS_BSP_SPI_FLASH_DEVICE_PATH "/dev/spi.flash"
144#endif /* defined(MPC83XX_BOARD_MPC8349EAMDS) */
145
146#if defined(MPC83XX_BOARD_HSC_CM01)
147/*
148 * i2c EEPROM device name
149 */
150#define RTEMS_BSP_I2C_EEPROM_DEVICE_NAME "eeprom"
151#define RTEMS_BSP_I2C_EEPROM_DEVICE_PATH "/dev/i2c1.eeprom"
152
153/*
154 * SPI FRAM device name
155 */
156#define RTEMS_BSP_SPI_FRAM_DEVICE_NAME "fram"
157#define RTEMS_BSP_SPI_FRAM_DEVICE_PATH "/dev/spi.fram"
158#endif /* defined(MPC83XX_BOARD_HSC_CM01) */
159
160extern unsigned int BSP_bus_frequency;
161
162extern uint32_t bsp_clicks_per_usec;
163
164/*
165 * Convert decrementer value to tenths of microseconds (used by shared timer
166 * driver).
167 */
168#define BSP_Convert_decrementer( _value ) \
169 ((int) (((_value) * 10) / bsp_clicks_per_usec))
170
171void mpc83xx_zero_4( void *dest, size_t n);
172
173void cpu_init( void);
174
175void bsp_restart(void *addr);
176
177#if defined(HAS_UBOOT)
178 /* Routine to obtain U-Boot environment variables */
179 const char *bsp_uboot_getenv(
180 const char *name
181 );
182#endif
183
184#ifdef __cplusplus
185}
186#endif
187
188#endif /* ASM */
189
192#endif /* GEN83xx */
PowerPC Exceptions API.
This header file provides the default definition of BSP_INITIAL_EXTENSION.
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
Definition: status.h:85
void * bsp_idle_thread(uintptr_t ignored)
Optimized idle task.
Definition: bspidle.c:39
uint32_t bsp_clicks_per_usec
Time base clicks per micro second.
Definition: bspstart.c:99
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