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 * 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
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
62
63#ifdef __cplusplus
64extern "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
83extern unsigned BSP_bus_frequency;
84
85struct rtems_bsdnet_ifconfig;
86
87int BSP_tsec_attach(
88 struct rtems_bsdnet_ifconfig *config,
89 int attaching
90);
91
92int 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
104RTEMS_NO_RETURN void bsp_restart(void *addr);
105
106void *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
119typedef 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];
127
129qoriq_start_spin_table_addr[QORIQ_CPU_COUNT / QORIQ_THREAD_COUNT];
130
131struct Per_CPU_Control;
132
133void qoriq_start_thread(struct Per_CPU_Control *);
134
135RTEMS_NO_RETURN void qoriq_restart_secondary_processor(
136 const qoriq_start_spin_table *spin_table
137);
138
139void qoriq_initialize_exceptions(void *interrupt_stack_begin);
140
141void qoriq_decrementer_dispatch(void);
142
143extern uint32_t bsp_time_base_frequency;
144
145extern uint32_t qoriq_clock_frequency;
146
147#ifdef __cplusplus
148}
149#endif /* __cplusplus */
150
151#endif /* ASM */
152
155#endif /* LIBBSP_POWERPC_QORIQ_BSP_H */
This header file provides the default definition of BSP_INITIAL_EXTENSION.
#define RTEMS_NO_RETURN
Tells the compiler in a function declaration that this function does not return.
Definition: basedefs.h:386
void * bsp_idle_thread(uintptr_t ignored)
Optimized idle task.
Definition: bspidle.c:39
This header file defines the RTEMS Classic API.
Per CPU Core Structure.
Definition: percpu.h:384
Definition: deflate.c:114
Definition: bsp.h:119