RTEMS
6.3
Toggle main menu visibility
Loading...
Searching...
No Matches
bsps
powerpc
qoriq
include
bsp.h
Go to the documentation of this file.
1
/* SPDX-License-Identifier: BSD-2-Clause */
2
10
11
/*
12
* Copyright (C) 2010, 2017 embedded brains GmbH & Co. KG
13
*
14
* Redistribution and use in source and binary forms, with or without
15
* modification, are permitted provided that the following conditions
16
* are met:
17
* 1. Redistributions of source code must retain the above copyright
18
* notice, this list of conditions and the following disclaimer.
19
* 2. Redistributions in binary form must reproduce the above copyright
20
* notice, this list of conditions and the following disclaimer in the
21
* documentation and/or other materials provided with the distribution.
22
*
23
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
27
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33
* POSSIBILITY OF SUCH DAMAGE.
34
*/
35
36
#ifndef LIBBSP_POWERPC_QORIQ_BSP_H
37
#define LIBBSP_POWERPC_QORIQ_BSP_H
38
48
49
#include <bspopts.h>
50
51
#ifdef QORIQ_IS_HYPERVISOR_GUEST
52
#define QORIQ_THREAD_COUNT 1
53
#else
54
#define QORIQ_THREAD_COUNT QORIQ_PHYSICAL_THREAD_COUNT
55
#endif
56
57
#ifndef ASM
58
59
#include <
rtems.h
>
60
61
#include <
bsp/default-initial-extension.h
>
62
63
#ifdef __cplusplus
64
extern
"C"
{
65
#endif
/* __cplusplus */
66
67
#define BSP_FEATURE_IRQ_EXTENSION
68
69
#define BSP_FDT_IS_SUPPORTED
70
71
#define QORIQ_CHIP(alpha, num) ((alpha) * 10000 + (num))
72
73
#define QORIQ_CHIP_P1020 QORIQ_CHIP('P', 1020)
74
75
#define QORIQ_CHIP_T2080 QORIQ_CHIP('T', 2080)
76
77
#define QORIQ_CHIP_T4240 QORIQ_CHIP('T', 4240)
78
79
#define QORIQ_CHIP_VARIANT QORIQ_CHIP(QORIQ_CHIP_SERIES, QORIQ_CHIP_NUMBER)
80
81
#define QORIQ_CHIP_IS_T_VARIANT(variant) ((variant) / 10000 == 'T')
82
83
extern
unsigned
BSP_bus_frequency;
84
85
struct
rtems_bsdnet_ifconfig;
86
87
int
BSP_tsec_attach(
88
struct
rtems_bsdnet_ifconfig *config,
89
int
attaching
90
);
91
92
int
qoriq_if_intercom_attach_detach(
93
struct
rtems_bsdnet_ifconfig *config,
94
int
attaching
95
);
96
97
#if defined(HAS_UBOOT)
98
/* Routine to obtain U-Boot environment variables */
99
const
char
*bsp_uboot_getenv(
100
const
char
*name
101
);
102
#endif
103
104
RTEMS_NO_RETURN
void
bsp_restart(
void
*addr);
105
106
void
*
bsp_idle_thread
( uintptr_t ignored );
107
#define BSP_IDLE_TASK_BODY bsp_idle_thread
108
109
#define RTEMS_BSP_NETWORK_DRIVER_ATTACH BSP_tsec_attach
110
#define RTEMS_BSP_NETWORK_DRIVER_ATTACH4 qoriq_if_intercom_attach_detach
111
112
#define RTEMS_BSP_NETWORK_DRIVER_NAME "tsec1"
113
#define RTEMS_BSP_NETWORK_DRIVER_NAME2 "tsec2"
114
#define RTEMS_BSP_NETWORK_DRIVER_NAME3 "tsec3"
115
#define RTEMS_BSP_NETWORK_DRIVER_NAME4 "intercom1"
116
117
/* Internal data and functions */
118
119
typedef
struct
{
120
uint64_t addr;
121
uint64_t r3;
122
uint32_t reserved_0;
123
uint32_t pir;
124
uint64_t r6;
125
uint32_t reserved_1[8];
126
}
qoriq_start_spin_table
;
127
128
extern
qoriq_start_spin_table
*
129
qoriq_start_spin_table_addr[QORIQ_CPU_COUNT / QORIQ_THREAD_COUNT];
130
131
struct
Per_CPU_Control
;
132
133
void
qoriq_start_thread(
struct
Per_CPU_Control
*);
134
135
RTEMS_NO_RETURN
void
qoriq_restart_secondary_processor(
136
const
qoriq_start_spin_table
*spin_table
137
);
138
139
void
qoriq_initialize_exceptions(
void
*interrupt_stack_begin);
140
141
void
qoriq_decrementer_dispatch(
void
);
142
143
extern
uint32_t bsp_time_base_frequency;
144
145
extern
uint32_t qoriq_clock_frequency;
146
147
#ifdef __cplusplus
148
}
149
#endif
/* __cplusplus */
150
151
#endif
/* ASM */
152
154
155
#endif
/* LIBBSP_POWERPC_QORIQ_BSP_H */
default-initial-extension.h
This header file provides the default definition of BSP_INITIAL_EXTENSION.
RTEMS_NO_RETURN
#define RTEMS_NO_RETURN
Tells the compiler in a function declaration that this function does not return.
Definition
basedefs.h:386
bsp_idle_thread
void * bsp_idle_thread(uintptr_t ignored)
Optimized idle task.
Definition
bspidle.c:39
rtems.h
This header file defines the RTEMS Classic API.
Per_CPU_Control
Per CPU Core Structure.
Definition
percpu.h:384
qoriq_start_spin_table
Definition
bsp.h:119
Generated by
1.18.0