RTEMS  5.0.0
bsp.h
Go to the documentation of this file.
1 
9 /*
10  * Copyright (c) 2010, 2017 embedded brains GmbH. All rights reserved.
11  *
12  * embedded brains GmbH
13  * Dornierstr. 4
14  * 82178 Puchheim
15  * Germany
16  * <rtems@embedded-brains.de>
17  *
18  * The license and distribution terms for this file may be
19  * found in the file LICENSE in this distribution or at
20  * http://www.rtems.org/license/LICENSE.
21  */
22 
23 #ifndef LIBBSP_POWERPC_QORIQ_BSP_H
24 #define LIBBSP_POWERPC_QORIQ_BSP_H
25 
36 #include <bspopts.h>
37 
38 #ifdef QORIQ_IS_HYPERVISOR_GUEST
39 #define QORIQ_THREAD_COUNT 1
40 #else
41 #define QORIQ_THREAD_COUNT QORIQ_PHYSICAL_THREAD_COUNT
42 #endif
43 
44 #ifndef ASM
45 
46 #include <rtems.h>
47 
49 
50 #ifdef __cplusplus
51 extern "C" {
52 #endif /* __cplusplus */
53 
54 #define BSP_FEATURE_IRQ_EXTENSION
55 
56 #define BSP_FDT_IS_SUPPORTED
57 
58 #define QORIQ_CHIP(alpha, num) ((alpha) * 10000 + (num))
59 
60 #define QORIQ_CHIP_P1020 QORIQ_CHIP('P', 1020)
61 
62 #define QORIQ_CHIP_T2080 QORIQ_CHIP('T', 2080)
63 
64 #define QORIQ_CHIP_T4240 QORIQ_CHIP('T', 4240)
65 
66 #define QORIQ_CHIP_VARIANT QORIQ_CHIP(QORIQ_CHIP_SERIES, QORIQ_CHIP_NUMBER)
67 
68 #define QORIQ_CHIP_IS_T_VARIANT(variant) ((variant) / 10000 == 'T')
69 
70 extern unsigned BSP_bus_frequency;
71 
72 struct rtems_bsdnet_ifconfig;
73 
74 int BSP_tsec_attach(
75  struct rtems_bsdnet_ifconfig *config,
76  int attaching
77 );
78 
79 int qoriq_if_intercom_attach_detach(
80  struct rtems_bsdnet_ifconfig *config,
81  int attaching
82 );
83 
84 #if defined(HAS_UBOOT)
85  /* Routine to obtain U-Boot environment variables */
86  const char *bsp_uboot_getenv(
87  const char *name
88  );
89 #endif
90 
91 void bsp_restart(void *addr) RTEMS_NO_RETURN;
92 
93 void *bsp_idle_thread( uintptr_t ignored );
94 #define BSP_IDLE_TASK_BODY bsp_idle_thread
95 
96 #define RTEMS_BSP_NETWORK_DRIVER_ATTACH BSP_tsec_attach
97 #define RTEMS_BSP_NETWORK_DRIVER_ATTACH4 qoriq_if_intercom_attach_detach
98 
99 #define RTEMS_BSP_NETWORK_DRIVER_NAME "tsec1"
100 #define RTEMS_BSP_NETWORK_DRIVER_NAME2 "tsec2"
101 #define RTEMS_BSP_NETWORK_DRIVER_NAME3 "tsec3"
102 #define RTEMS_BSP_NETWORK_DRIVER_NAME4 "intercom1"
103 
104 /* Internal data and functions */
105 
106 typedef struct {
107  uint64_t addr;
108  uint64_t r3;
109  uint32_t reserved_0;
110  uint32_t pir;
111  uint64_t r6;
112  uint32_t reserved_1[8];
114 
115 extern qoriq_start_spin_table *
116 qoriq_start_spin_table_addr[QORIQ_CPU_COUNT / QORIQ_THREAD_COUNT];
117 
118 struct Per_CPU_Control;
119 
120 void qoriq_start_thread(struct Per_CPU_Control *);
121 
122 void qoriq_restart_secondary_processor(
123  const qoriq_start_spin_table *spin_table
125 
126 void qoriq_initialize_exceptions(void *interrupt_stack_begin);
127 
128 void qoriq_decrementer_dispatch(void);
129 
130 extern uint32_t bsp_time_base_frequency;
131 
132 extern uint32_t qoriq_clock_frequency;
133 
134 #ifdef __cplusplus
135 }
136 #endif /* __cplusplus */
137 
138 #endif /* ASM */
139 
142 #endif /* LIBBSP_POWERPC_QORIQ_BSP_H */
Definition: deflate.c:115
DEFAULT_INITIAL_EXTENSION Support.
Per CPU Core Structure.
Definition: percpu.h:290
Definition: bsp.h:106
#define RTEMS_NO_RETURN
Definition: basedefs.h:101
void * bsp_idle_thread(uintptr_t ignored)
Optimized idle task.
Definition: bspidle.c:26
void bsp_restart(const void *addr)
Restarts the bsp with "addr" address.
Definition: restart.c:25