RTEMS 7.0-rc1
Loading...
Searching...
No Matches
bsp.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: GPL-2.0+-with-RTEMS-exception */
2
11/*
12 * Copyright (c) 2005 Eric Norum <eric@norum.ca>
13 *
14 * COPYRIGHT (c) 2005.
15 * On-Line Applications Research Corporation (OAR).
16 *
17 * The license and distribution terms for this file may be
18 * found in the file LICENSE in this distribution or at
19 * http://www.rtems.org/license/LICENSE.
20 */
21
22#ifndef LIBBSP_M68K_UC5282_BSP_H
23#define LIBBSP_M68K_UC5282_BSP_H
24
35#include <bspopts.h>
37
38#include <rtems.h>
39#include <rtems/bspIo.h>
40
41#ifdef __cplusplus
42extern "C" {
43#endif
44
45/***************************************************************************/
47/*
48 * Uncomment to use instruction/data cache
49 * Leave commented to use instruction-only cache
50 */
51#define RTEMS_MCF5282_BSP_ENABLE_DATA_CACHE
52
53/***************************************************************************/
55#include <mcf5282/mcf5282.h> /* internal MCF5282 modules */
56
57/***************************************************************************/
59struct rtems_bsdnet_ifconfig;
60extern int rtems_fec_driver_attach (struct rtems_bsdnet_ifconfig *config, int attaching );
61#define RTEMS_BSP_NETWORK_DRIVER_NAME "fs1"
62#define RTEMS_BSP_NETWORK_DRIVER_ATTACH rtems_fec_driver_attach
63
64/***************************************************************************/
67/* define which port the console should use - all other ports are then defined as general purpose */
68#define CONSOLE_PORT 0
69
70/* functions */
71
72typedef struct {
73 unsigned int l;
74 void *v;
76
77#define RTEMS_BSP_PGM_ERASE_FIRST 0x1
78#define RTEMS_BSP_PGM_RESET_AFTER 0x2
79#define RTEMS_BSP_PGM_EXEC_AFTER 0x4
80#define RTEMS_BSP_PGM_HALT_AFTER 0x8
81
82uint32_t bsp_get_CPU_clock_speed(void);
83rtems_status_code bsp_allocate_interrupt(int level, int priority);
84int bsp_sysReset(int flags);
85int bsp_program(bsp_mnode_t *chain, int flags);
86unsigned const char *bsp_gethwaddr(int a);
87const char *bsp_getbenv(const char *a);
88int bsp_flash_erase_range(volatile unsigned short *flashptr, int start, int end);
89int bsp_flash_write_range(volatile unsigned short *flashptr, bsp_mnode_t *chain, int offset);
90
91/*
92 * Interrupt assignments
93 * Highest-priority listed first
94 */
95#define FEC_IRQ_LEVEL 4
96#define FEC_IRQ_RX_PRIORITY 7
97#define FEC_IRQ_TX_PRIORITY 6
98
99#define PIT3_IRQ_LEVEL 4
100#define PIT3_IRQ_PRIORITY 0
101
102#define UART0_IRQ_LEVEL 3
103#define UART0_IRQ_PRIORITY 7
104#define UART1_IRQ_LEVEL 3
105#define UART1_IRQ_PRIORITY 6
106#define UART2_IRQ_LEVEL 3
107#define UART2_IRQ_PRIORITY 5
108
109/*
110 * Fake VME support
111 * This makes it easier to use EPICS driver support on this BSP.
112 */
113#define VME_AM_STD_SUP_ASCENDING 0x3f
114#define VME_AM_STD_SUP_PGM 0x3e
115#define VME_AM_STD_USR_ASCENDING 0x3b
116#define VME_AM_STD_USR_PGM 0x3a
117#define VME_AM_STD_SUP_DATA 0x3d
118#define VME_AM_STD_USR_DATA 0x39
119#define VME_AM_EXT_SUP_ASCENDING 0x0f
120#define VME_AM_EXT_SUP_PGM 0x0e
121#define VME_AM_EXT_USR_ASCENDING 0x0b
122#define VME_AM_EXT_USR_PGM 0x0a
123#define VME_AM_EXT_SUP_DATA 0x0d
124#define VME_AM_EXT_USR_DATA 0x09
125#define VME_AM_SUP_SHORT_IO 0x2d
126#define VME_AM_USR_SHORT_IO 0x29
127
128/*
129 * 'Extended' BSP support
130 */
131rtems_status_code bspExtInit(void);
132typedef void (*BSP_VME_ISR_t)(void *usrArg, unsigned long vector);
133BSP_VME_ISR_t BSP_getVME_isr(unsigned long vector, void **parg);
134int BSP_installVME_isr(unsigned long vector, BSP_VME_ISR_t handler, void *usrArg);
135int BSP_removeVME_isr(unsigned long vector, BSP_VME_ISR_t handler, void *usrArg);
136int BSP_enableVME_int_lvl(unsigned int level);
137int BSP_disableVME_int_lvl(unsigned int level);
138int BSP_vme2local_adrs(unsigned am, unsigned long vmeaddr, unsigned long *plocaladdr);
139
140/*
141 * This BSP provides its own IDLE task to override the RTEMS one.
142 * So we prototype it and define the constant confdefs.h expects
143 * to configure a BSP specific one.
144 */
145void *bsp_idle_thread( uintptr_t ignored );
146#define BSP_IDLE_TASK_BODY bsp_idle_thread
147
148/*
149 * The custom IDLE task keeps some idle statistics.
150 */
151int bsp_cpu_load_percentage(void);
152
153/*
154 * This is a helper method to determine the cause of a reset.
155 */
156void bsp_reset_cause(char *buf, size_t capacity);
157
158/*
159 * SRAM. The BSP uses SRAM for maintaining some clock-driver data
160 * and for ethernet descriptors (and the initial stack during
161 * early boot).
162 */
163
165 volatile uint16_t status;
166 uint16_t length;
167 volatile void *buffer;
169
170extern struct {
171 uint32_t idle_counter;
172 uint32_t filtered_idle;
173 uint32_t max_idle_count;
174 uint32_t pitc_per_tick;
175 uint32_t nsec_per_pitc;
176 uint32_t pad[3]; /* align to 16-bytes for descriptors */
177 mcf5282BufferDescriptor_t fec_descriptors[];
178 /* buffer descriptors are allocated from here */
179
180 /* initial stack is at top of SRAM (start.S) */
181} __SRAMBASE;
182
183#ifdef __cplusplus
184}
185#endif
186
189#endif
This header file provides the kernel character input/output support 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
This header file defines the RTEMS Classic API.
Definition: bsp.h:72
Definition: bsp.h:164