comparison gsm-fw/serial/init.c @ 143:afceeeb2cba1

Our nuc-fw is destined to become gsm-fw, so I went ahead and did the big hg mv
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Tue, 12 Nov 2013 05:35:48 +0000
parents nuc-fw/serial/init.c@789a9a95533f
children
comparison
equal deleted inserted replaced
142:15d5977390c2 143:afceeeb2cba1
1 #include "../include/config.h"
2 #include "../include/sys_types.h"
3
4 #include "serialswitch.h"
5
6 #include <string.h>
7
8 /*
9 * Serial Configuration set up.
10 */
11
12 /*
13 ** One config is:
14 ** {XXX_BT_HCI, // Bluetooth HCI
15 ** XXX_FAX_DATA, // Fax/Data AT-Cmd
16 ** XXX_TRACE, // L1/Riviera Trace Mux
17 ** XXX_TRACE}, // Trace PS
18 **
19 ** with XXX being DUMMY, UART_IRDA or UART_MODEM
20 */
21
22 const T_AppliSerialInfo appli_ser_cfg_info = {
23 /*
24 * Default configuration: set it to the "standard"
25 * 0x0168, unless the RVTMUX serial channel has been
26 * moved to the MODEM UART.
27 */
28 #if CONFIG_RVTMUX_ON_MODEM
29 {DUMMY_BT_HCI,
30 DUMMY_FAX_DATA,
31 UART_MODEM_TRACE,
32 DUMMY_TRACE}, // 0x0248
33 #else
34 {DUMMY_BT_HCI,
35 UART_MODEM_FAX_DATA,
36 UART_IRDA_TRACE,
37 DUMMY_TRACE}, // default config = 0x0168
38 #endif
39 /* number of possible configs */
40 #ifdef BTEMOBILE
41 12, // 12 serial config allowed
42 #else // BTEMOBILE
43 9, // 9 serial config allowed
44 #endif
45 {
46 // Configs with Condat Panel only
47 {DUMMY_BT_HCI,
48 DUMMY_FAX_DATA,
49 DUMMY_TRACE,
50 UART_IRDA_TRACE}, // 0x1048
51 {DUMMY_BT_HCI,
52 DUMMY_FAX_DATA,
53 DUMMY_TRACE,
54 UART_MODEM_TRACE}, // 0x2048
55 // Configs with L1/Riviera Trace only
56 {DUMMY_BT_HCI,
57 DUMMY_FAX_DATA,
58 UART_IRDA_TRACE,
59 DUMMY_TRACE}, // 0x0148
60 {DUMMY_BT_HCI,
61 DUMMY_FAX_DATA,
62 UART_MODEM_TRACE,
63 DUMMY_TRACE}, // 0x0248
64 // Configs with AT-Cmd only
65 {DUMMY_BT_HCI,
66 UART_MODEM_FAX_DATA,
67 DUMMY_TRACE,
68 DUMMY_TRACE}, // 0x0068
69 // Configs with Condat Panel and L1/Riviera Trace
70 {DUMMY_BT_HCI,
71 DUMMY_FAX_DATA,
72 UART_MODEM_TRACE,
73 UART_IRDA_TRACE}, // 0x1248
74 {DUMMY_BT_HCI,
75 DUMMY_FAX_DATA,
76 UART_IRDA_TRACE,
77 UART_MODEM_TRACE}, // 0x2148
78 // Configs with Condat Panel and AT-Cmd
79 {DUMMY_BT_HCI,
80 UART_MODEM_FAX_DATA,
81 DUMMY_TRACE,
82 UART_IRDA_TRACE}, // 0x1068
83 #ifdef BTEMOBILE
84 // Configs with L1/Riviera Trace and Bluetooth HCI
85 {UART_IRDA_BT_HCI,
86 DUMMY_FAX_DATA,
87 UART_MODEM_TRACE,
88 DUMMY_TRACE}, // 0x0249
89 {UART_MODEM_BT_HCI,
90 DUMMY_FAX_DATA,
91 UART_IRDA_TRACE,
92 DUMMY_TRACE}, // 0x014A
93 // Configs with AT-Cmd and Bluetooth HCI
94 {UART_IRDA_BT_HCI,
95 UART_MODEM_FAX_DATA,
96 DUMMY_TRACE,
97 DUMMY_TRACE}, // 0x0069
98 #endif // BTEMOBILE
99 // Configs with L1/Riviera Trace and AT-Cmd
100 {DUMMY_BT_HCI,
101 UART_MODEM_FAX_DATA,
102 UART_IRDA_TRACE,
103 DUMMY_TRACE} // 0x0168
104 }
105 };
106
107 /*
108 * Init_Serial_Flows
109 *
110 * Performs Serialswitch + related serial data flows initialization.
111 */
112
113 void Init_Serial_Flows (void)
114 {
115 #if 1 //(OP_L1_STANDALONE == 0)
116
117 /*
118 * Initialize Serial Switch module.
119 */
120 #if ((BOARD==35) || (BOARD == 46))
121 SER_InitSerialConfig (GC_GetSerialConfig());
122 #else
123 SER_InitSerialConfig (&appli_ser_cfg_info);
124 #endif
125 /*
126 * Then Initialize the Serial Data Flows and the associated UARTs:
127 * - G2-3 Trace if GSM/GPRS Protocol Stack
128 * - AT-Cmd/Fax & Data Flow
129 *
130 * Layer1/Riviera Trace Flow and Bluetooth HCI Flow are initialized
131 * by the appropriate SW Entities.
132 *
133 * G2-3 Trace => No more Used
134 */
135 SER_tr_Init(SER_PROTOCOL_STACK, TR_BAUD_38400, NULL);
136
137 /*
138 * Fax & Data / AT-Command Interpreter Serial Data Flow Initialization
139 */
140
141 #if ((BOARD != 35) && (BOARD != 46))
142 (void) SER_fd_Initialize ();
143 #endif
144 #else /* OP_L1_STANDALONE */
145
146 #if (TESTMODE || (TRACE_TYPE==1) || (TRACE_TYPE==2) || (TRACE_TYPE==3) || (TRACE_TYPE==6) || (TRACE_TYPE==7))
147 #if ((BOARD == 35) || (BOARD == 46))
148 ser_cfg_info[UA_UART_0] = '0';
149 #else
150 ser_cfg_info[UA_UART_0] = 'G';
151 #endif
152 #if (CHIPSET !=15)
153 ser_cfg_info[UA_UART_1] = 'R'; // Riviear Demux on UART MODEM
154 #else
155 ser_cfg_info[UA_UART_0] = 'R'; // Riviear Demux on UART MODEM
156 #endif
157
158 /* init Uart Modem */
159 SER_InitSerialConfig (&appli_ser_cfg_info);
160
161 #if TESTMODE || (TRACE_TYPE == 1) || (TRACE_TYPE == 7)
162 SER_tr_Init (SER_LAYER_1, TR_BAUD_115200, rvt_activate_RX_HISR);
163
164 rvt_register_id("OTHER",&trace_id,(RVT_CALLBACK_FUNC)NULL);
165 #else
166 SER_tr_Init (SER_LAYER_1, TR_BAUD_38400, NULL);
167 #endif
168
169 L1_trace_string(" \n\r");
170
171 #endif /* TRACE_TYPE */
172
173 #endif /* OP_L1_STANDALONE */
174 }