File indexing completed on 2025-05-11 08:23:57
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036 #ifndef LIBBSP_POWERPC_QORIQ_BSP_H
0037 #define LIBBSP_POWERPC_QORIQ_BSP_H
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049 #include <bspopts.h>
0050
0051 #ifdef QORIQ_IS_HYPERVISOR_GUEST
0052 #define QORIQ_THREAD_COUNT 1
0053 #else
0054 #define QORIQ_THREAD_COUNT QORIQ_PHYSICAL_THREAD_COUNT
0055 #endif
0056
0057 #ifndef ASM
0058
0059 #include <rtems.h>
0060
0061 #include <bsp/default-initial-extension.h>
0062
0063 #ifdef __cplusplus
0064 extern "C" {
0065 #endif
0066
0067 #define BSP_FEATURE_IRQ_EXTENSION
0068
0069 #define BSP_FDT_IS_SUPPORTED
0070
0071 #define QORIQ_CHIP(alpha, num) ((alpha) * 10000 + (num))
0072
0073 #define QORIQ_CHIP_P1020 QORIQ_CHIP('P', 1020)
0074
0075 #define QORIQ_CHIP_T2080 QORIQ_CHIP('T', 2080)
0076
0077 #define QORIQ_CHIP_T4240 QORIQ_CHIP('T', 4240)
0078
0079 #define QORIQ_CHIP_VARIANT QORIQ_CHIP(QORIQ_CHIP_SERIES, QORIQ_CHIP_NUMBER)
0080
0081 #define QORIQ_CHIP_IS_T_VARIANT(variant) ((variant) / 10000 == 'T')
0082
0083 extern unsigned BSP_bus_frequency;
0084
0085 struct rtems_bsdnet_ifconfig;
0086
0087 int BSP_tsec_attach(
0088 struct rtems_bsdnet_ifconfig *config,
0089 int attaching
0090 );
0091
0092 int qoriq_if_intercom_attach_detach(
0093 struct rtems_bsdnet_ifconfig *config,
0094 int attaching
0095 );
0096
0097 #if defined(HAS_UBOOT)
0098
0099 const char *bsp_uboot_getenv(
0100 const char *name
0101 );
0102 #endif
0103
0104 RTEMS_NO_RETURN void bsp_restart(void *addr);
0105
0106 void *bsp_idle_thread( uintptr_t ignored );
0107 #define BSP_IDLE_TASK_BODY bsp_idle_thread
0108
0109 #define RTEMS_BSP_NETWORK_DRIVER_ATTACH BSP_tsec_attach
0110 #define RTEMS_BSP_NETWORK_DRIVER_ATTACH4 qoriq_if_intercom_attach_detach
0111
0112 #define RTEMS_BSP_NETWORK_DRIVER_NAME "tsec1"
0113 #define RTEMS_BSP_NETWORK_DRIVER_NAME2 "tsec2"
0114 #define RTEMS_BSP_NETWORK_DRIVER_NAME3 "tsec3"
0115 #define RTEMS_BSP_NETWORK_DRIVER_NAME4 "intercom1"
0116
0117
0118
0119 typedef struct {
0120 uint64_t addr;
0121 uint64_t r3;
0122 uint32_t reserved_0;
0123 uint32_t pir;
0124 uint64_t r6;
0125 uint32_t reserved_1[8];
0126 } qoriq_start_spin_table;
0127
0128 extern qoriq_start_spin_table *
0129 qoriq_start_spin_table_addr[QORIQ_CPU_COUNT / QORIQ_THREAD_COUNT];
0130
0131 struct Per_CPU_Control;
0132
0133 void qoriq_start_thread(struct Per_CPU_Control *);
0134
0135 RTEMS_NO_RETURN void qoriq_restart_secondary_processor(
0136 const qoriq_start_spin_table *spin_table
0137 );
0138
0139 void qoriq_initialize_exceptions(void *interrupt_stack_begin);
0140
0141 void qoriq_decrementer_dispatch(void);
0142
0143 extern uint32_t bsp_time_base_frequency;
0144
0145 extern uint32_t qoriq_clock_frequency;
0146
0147 #ifdef __cplusplus
0148 }
0149 #endif
0150
0151 #endif
0152
0153
0154
0155 #endif