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_INTERCOM_H
0037 #define LIBBSP_POWERPC_QORIQ_INTERCOM_H
0038
0039 #include <rtems.h>
0040 #include <rtems/chain.h>
0041
0042 #ifdef __cplusplus
0043 extern "C" {
0044 #endif
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056 uint32_t qoriq_spin_lock(uint32_t *lock);
0057
0058 void qoriq_spin_unlock(uint32_t *lock, uint32_t msr);
0059
0060 #define INTERCOM_CORE_COUNT 2
0061
0062 #define INTERCOM_SERVICE_COUNT 8
0063
0064 typedef enum {
0065 INTERCOM_TYPE_MPCI,
0066 INTERCOM_TYPE_UART_0,
0067 INTERCOM_TYPE_UART_1,
0068 INTERCOM_TYPE_NETWORK,
0069 INTERCOM_TYPE_CUSTOM_0,
0070 INTERCOM_TYPE_CUSTOM_1,
0071 INTERCOM_TYPE_CUSTOM_2,
0072 INTERCOM_TYPE_CUSTOM_3,
0073 INTERCOM_TYPE_CUSTOM_4
0074 } intercom_type;
0075
0076 typedef enum {
0077 INTERCOM_SIZE_64 = 0,
0078 INTERCOM_SIZE_512,
0079 INTERCOM_SIZE_2K,
0080 INTERCOM_SIZE_4K
0081 } intercom_size;
0082
0083 typedef struct intercom_packet {
0084 union {
0085 struct intercom_packet *next;
0086 rtems_chain_node node;
0087 } glue;
0088 intercom_type type_index;
0089 intercom_size size_index;
0090 uint32_t flags;
0091 size_t size;
0092 uint32_t cache_line_alignment [2];
0093 char data [];
0094 } intercom_packet;
0095
0096 typedef void (*intercom_service)(intercom_packet *packet, void *arg);
0097
0098 void qoriq_intercom_init(void);
0099
0100 void qoriq_intercom_start(void);
0101
0102 void qoriq_intercom_service_install(intercom_type type, intercom_service service, void *arg);
0103
0104 void qoriq_intercom_service_remove(intercom_type type);
0105
0106 intercom_packet *qoriq_intercom_allocate_packet(intercom_type type, intercom_size size);
0107
0108 void qoriq_intercom_send_packets(int destination_core, intercom_packet *first, intercom_packet *last);
0109
0110 static inline void qoriq_intercom_send_packet(int destination_core, intercom_packet *packet)
0111 {
0112 qoriq_intercom_send_packets(destination_core, packet, packet);
0113 }
0114
0115 void qoriq_intercom_broadcast_packets(intercom_packet *first, intercom_packet *last);
0116
0117 static inline void qoriq_intercom_broadcast_packet(intercom_packet *packet)
0118 {
0119 qoriq_intercom_broadcast_packets(packet, packet);
0120 }
0121
0122 void qoriq_intercom_send(int destination_core, intercom_type type, intercom_size size, const void *buf, size_t n);
0123
0124 void qoriq_intercom_free_packet(intercom_packet *packet);
0125
0126 intercom_packet *qoriq_intercom_clone_packet(const intercom_packet *packet);
0127
0128 #ifdef RTEMS_MULTIPROCESSING
0129 extern rtems_mpci_table qoriq_intercom_mpci;
0130 #endif
0131
0132
0133
0134 #ifdef __cplusplus
0135 }
0136 #endif
0137
0138 #endif