1 /* OsmocomBB Layer1 initialization */
3 /* (C) 2010 by Harald Welte <laforge@gnumonks.org>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
28 #include <rf/trf6151.h>
29 #include <abb/twl3025.h>
30 #include <calypso/tpu.h>
31 #include <calypso/tsp.h>
32 #include <calypso/dsp.h>
33 #include <calypso/irq.h>
35 #include <layer1/sync.h>
36 #include <layer1/async.h>
37 #include <layer1/l23_api.h>
39 void layer1_init(void)
42 struct l1ctl_reset *res;
44 #ifndef CONFIG_TX_ENABLE
45 printf("\n\nTHIS FIRMWARE WAS COMPILED WITHOUT TX SUPPORT!!!\n\n");
48 /* initialize asynchronous part of L1 */
50 /* initialize TDMA Frame IRQ driven synchronous L1 */
52 /* power up the DSP */
55 /* Initialize TPU, TSP and TRF drivers */
62 #if 0 /* only if RX TPU window is disabled! */
63 /* Put TWL3025 in downlink mode (includes calibration) */
64 twl3025_downlink(1, 1000);
67 /* issue the TRF and TWL initialization sequence */
72 /* Disable RTC interrupt as it causes lost TDMA frames */
73 irq_disable(IRQ_RTC_TIMER);
75 /* inform l2 and upwards that we are ready for orders */
76 msg = l1_create_l2_msg(L1CTL_RESET_IND, 0, 0, 0);
77 res = msgb_put(msg, sizeof(*res));
78 res->type = L1CTL_RES_T_BOOT;