Commit Graph

645 Commits

Author SHA1 Message Date
Vadim Yanitskiy 3187c8e68d target/fake_trx: initial release of virtual transceiver
This is a set of tools for creating a virtual Um-interface between
OsmocomBB and OsmoBTS. It may be extremely useful for testing and
development of GSM stack, including both sides (MS and BTS). This
software implements OsmoTRX (Osmocom's fork of OpenBTS transceiver)
style clock (CLCK), control (CTRL) and data interfaces. So, OsmoBTS
source code doesn't require any modifications, while for OsmocomBB
you will need to use a new application - trxcon, which can be found
in the 'fixeria/sdr_phy' branch until one is merged to master.

Brief description of available applications:

  - fake_trx.py - main application, that allows to connect both
    OsmocomBB and OsmoBTS without actual RF hardware. Currently
    only a single MS may work with a single BTS.

  - clck_gen.py - a peripheral tool aimed to emulate TDMA frame
    clock generator. Could be used for testing and clock
    synchronization of multiple applications. It should be noted,
    that one relays on generic system timer (via Python), so
    a random clock jitter takes place.

  - ctrl_cmd.py - another peripheral tool, which could be used
    for sending CTRL commands directly in manual mode, and also
    for application fuzzing.

Change-Id: Ib1fb80682002ac85a72fa6abef459a4c44f4ab97
2017-11-19 17:35:07 +07:00
Harald Welte b29c24bcb7 Revert "trf6151: Fix setting of uplink ARFCN"
This reverts commit 1724003737.

For some reason the "obviously broken" code is working, but the fixed
version is not.  Let's go back to step 1 and analyze this in more
detail, but meanwhile make the code work again.
2017-01-15 20:45:45 +01:00
Harald Welte a1830440fc define 'fprintf(stderr,' as a wrapper around printf(
This is in preparation to work with a more recent version of
libosmocore, which wants to print to stderr in some cases.
2017-01-15 19:18:38 +01:00
Harald Welte 0fa403b51b Add an endian.h file as one step to build against later libosmocore 2017-01-15 19:18:38 +01:00
Harald Welte 2d7321bbde Add libosmocore/build-target/include to include path
Some header files are auto-generated and are thus in the build
directory, not in the source directory.  A cleaner way to handle this is
most likely to install libosmocore to some directory, but I don't want
to change the entire build process now.
2017-01-15 19:18:38 +01:00
Harald Welte 95b10c62ca fix various other compiler warnings 2017-01-15 19:18:38 +01:00
Harald Welte 9004de39ab cfi_flash.c: Fix various format string compiler warnings 2017-01-15 19:18:38 +01:00
Harald Welte 1724003737 trf6151: Fix setting of uplink ARFCN
Somebody (me?) wrote exclamation marks instead of pipe symbols.

Found by a modern gcc:

rf/trf6151.c: In function 'trf6151_set_arfcn':
rf/trf6151.c:439:8: warning: comparison is always true due to limited
range of data type [-Wtype-limits]
  arfcn != ~ARFCN_UPLINK;
        ^
rf/trf6151.c:439:2: warning: statement with no effect [-Wunused-value]
  arfcn != ~ARFCN_UPLINK;
  ^
2017-01-15 19:18:38 +01:00
Harald Welte 2400386c25 Avoid redefining __{packed,aligned,unused,section}
It seems modern version of newlib define those themselves, so we should
avoid re-defining them.  Removes tons of compiler warnings when
compiling against libnewlib 2.4.0
2017-01-15 19:18:38 +01:00
Steve Markgraf ce3c88e075 fw: fix SPCA552 write timing
With GCC 4.9.3 the timing was broken and initializing
the SPCA552 on the Pirelli DP-L10 did not work.
Add a small delay which fixes that.

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2016-01-20 01:41:47 +01:00
Max 1a35cc801d cleanup some compile warnings 2015-12-31 14:06:03 +01:00
Felix Domke 8a2e935cdb layer1: fix chan_nr2mf_task_mask for TCH/H channel
"multiframe", the frame layout (used to compute neighbor
cell monitoring pattern) was uninitialized in TCH/H case.

This, in combination with gcc optimizing the
"switch(multiframe)"-statement into a LUT without bounds-
checking (since using an uninitialized value is undefined
behavior) caused neigh_task to be filled with an out-of-
bounds value, eventually crashing the TDMA scheduler.

Written-by: Felix Domke <tmbinc@elitedvb.net>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-07-21 13:19:16 +02:00
Steve Markgraf a903b3c1ee fw: tell linker to add init_array to ctor section
Starting with version 4.8, gcc places functions
with __attribute__ ((constructor)) in .init_array
instead of .ctors by default.

This broke firmware images built with gcc >= 4.8.

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2013-12-29 20:33:26 +01:00
Sylvain Munaut bf83e024a6 Fix wrong msgb_pull usage
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-09-26 18:46:36 +02:00
Steve Markgraf 62d48c29da fw: remove deprecated chainload app
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2013-04-07 11:36:00 +02:00
Steve Markgraf ee7fbbda22 fw: pirelli_dpl10: initialize address line 22 for flash access
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2013-01-05 18:41:18 +01:00
Steve Markgraf 37a0543e26 fw: apps/loader: initialize framebuffer and show something
Since we now initialize the display for all apps, it
otherwise just shows the last content of the display
ram, which is weird.

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2013-01-05 18:41:11 +01:00
Steve Markgraf 0da82b96b7 fw: keypad driver overhaul, support for different keymaps
Now the Pirelli DP-L10 keymap is supported.

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2013-01-05 18:40:39 +01:00
Steve Markgraf 21bc3b8db0 fw: introduce per-board uart mapping
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2013-01-05 18:38:42 +01:00
Steve Markgraf e340681c5b fw: introduce with_irq parameter for board_init()
So far the loader-app used to do the init on its
own, which brought a lot of problems for board-
specific initialization.

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2013-01-05 18:37:49 +01:00
Sylvain Munaut 1ccc9f8822 target: Add support for IQ swap when required
Operation in GSM850 band requires IQ swap because of the offset PLL
used in the TRF causing spectrum reversal.

Thanks to Dieter Spaar for noticing the issue and the original patch

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-01-02 20:44:11 +01:00
Sylvain Munaut f853f92e47 fw: Fix link scripts to represent reality more accurately
Previously they were hacks to allow build ...
Not needed now.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-01-02 20:44:11 +01:00
Sylvain Munaut adfc622cc1 fw/build: Allow applications to filter environments
We use an external python script to solve which env to build, to
mix board and app env list

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-01-02 20:44:11 +01:00
Sylvain Munaut 3ee1beb8bf fw/build: Add ENV_ APP_ BOARD_ prefix to variables to cleanup namespace
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-01-02 20:44:11 +01:00
Sylvain Munaut d9f6921c02 fw/build: Group env / boards / applications
No functional changes, just moving things around

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-01-02 20:44:11 +01:00
Sylvain Munaut 09447f3bff fw/build: The app/board/env combo macro need to be last
The app template will create the list of app specific objs so that
needs to be before

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-01-02 20:44:10 +01:00
Sylvain Munaut 4aab780f20 fw/build: Include app / board / env specific objs during build
Just put the env with the rest and not manifest and also allow
app additional files

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-01-02 20:44:10 +01:00
Sylvain Munaut 0bfedc439f fw/build: Add a silent rule for the 'size' call as well
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-01-02 20:44:10 +01:00
Harald Welte 73a809e57b Tell L1CTL_FBSB_REQ the expected received signal level
As Dieter points out, this drastically improves the resiliance to high
receive levels on the C155.  We cannot blindly assume a received signal
level of -85 dBm if the BTS is 2m away and we actually receive -40 dBm.

This patch extends the L1CTL_FBSB_REQ data structure in layer 1 with the
respective field, as well as the l1ctl_tx_fbsb_req() API function called
from the various layer23 apps.

"mobile" and "bcch_scan" already did a PM request and thus know the
expected signal power.  "ccch_scan" and "cbch_sniff" apparently don't
do, so the -85 dBm constant is now hardcoded into the host-side source
code there, and should probably be fixed in a follow-up patch.
2012-11-20 10:13:44 +01:00
Steve Markgraf 63cb795d22 fw/comm: remove unused, outdated copy of msgb.h
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2012-11-14 19:01:44 +01:00
Harald Welte 6ce46e7a86 use msgb_pull() to get bytes from start of message, not msgb_get()
msgb_get() is for getting bytes from the end of a message, but it
was broken in libosmocore for a long time (until it was fixed today).
2012-09-08 22:45:30 +02:00
Harald Welte 1362a21df4 Properly name firmware images OsmocomBB not just OSMOCOM ! 2012-06-25 15:12:30 +02:00
Christian Inci 4f0acac4c1 Adding the manufacturer id of STMicroelectronics
For supporting the flash on a Motorola C118.

Note:
Flashing rssi on it worked fine.

Signed-off-by: Christian Inci <chris.pcguy.inci@gmail.com>
2012-05-07 10:46:44 +02:00
Andreas Eversberg 757ba862e9 firmware/rssi: Adding symbols to display battery and RX level 2012-04-28 09:41:12 +02:00
Andreas Eversberg ed9d1a7414 firmware: Adding new font with symbols for battery and RX level 2012-04-28 09:41:12 +02:00
Christian Vogel 5b87e3e4bd Further work on C123 charging. 2012-04-28 09:38:46 +02:00
Christian Vogel 071747aea8 Add battery info to hello world. 2012-04-28 09:38:45 +02:00
Christian Vogel 76527fd1e3 Charging: Add to Compal_E88, dummy for others. 2012-04-28 09:38:45 +02:00
Christian Vogel d53b55016a Battery charging for C123. 2012-04-28 09:38:44 +02:00
Christian Vogel e3f9698366 Add MADC/battery related bit definitions in twl3025.h 2012-04-28 09:38:44 +02:00
Sylvain Munaut 143abe661a fw/prim_tch: Fix regression introduced in f04f53d3b7
Thanks to Andreas for spotting this.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2012-03-29 21:43:25 +02:00
Andreas Eversberg e7997163b2 Fixed neighbour cell measurement task for SDCCH/8 multiframes
Only on BCCH's multiframe we are allowed to measure on frames 0, 10, 20,
30, 40. On SDCCH/8 multiframe, measurements are performed on frame 50
only.
2012-03-29 09:07:57 +02:00
Steve Markgraf 978ec28b71 firmware: add missing includes
This fixes all 'implicit-function-declaration'-warnings.

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2012-02-12 23:43:05 +01:00
Steve Markgraf 05e9b142c3 firmware/fb: add framebuffer driver for the Pirelli DP-L10 display
This commit adds a combined driver for the Sunplus SPCA-552E
Multimedia Controller and the Samsung S6B33B1X LCD controller.

I have to thank Stephan Meier, who helped me to reverse-engineer
this beast during 28c3.

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2012-02-12 21:54:37 +01:00
Andreas Eversberg 79db3c72e5 firmware/rssi: Fixed offset of power bars in sync mode 2012-02-07 20:03:03 +01:00
Andreas Eversberg f201f06e5f firmware: Turn off FIQ, when waiting for power button to be released 2012-02-07 20:03:02 +01:00
Andreas Eversberg d0985a7ff2 firmware/monitor: Added channel request to measure distance from cell
When synced, press the green button to request channel from cell.
The result, timing advance, distance and response delay is printed
on the display. It only works, if TX is enabled and SI 3 has been
received.
2012-02-07 20:03:02 +01:00
Andreas Eversberg 0cb791a125 firmware/framebuffer: Cleanups of compiler warnings and debugging output 2012-02-07 20:03:02 +01:00
Andreas Eversberg 565840008b firmware/timer: Added HZ as global defintion for jiffies per second 2012-02-07 20:03:02 +01:00
Andreas Eversberg 284cf9a34c firmware/monitor: Improvements and sync support
By pressing the green button, the sync mode is entered. The screen
show some informations about the cell. The beep indicates, if the
received BCCH was valid or not.

By pressing the Down button, the list of channels of the serving cell
and neighbour cells can be viewed and scrolled through.

By pressing the Up button, the levels (downlink or uplink) of the serving
cell can be viewed. Also it is possible to select one of the serving
cell's frequencies by pressing the Left/Right button.
2012-02-04 00:04:58 +01:00
Andreas Eversberg 0fd73c5e0f firmware: Increased data size for for ram linker scripts.
This is required, since monitor app requires a litte more than 64k.
2012-02-04 00:04:58 +01:00
Andreas Eversberg 7cc4a4b324 Improvement of neighbour cell power measurement task.
5 measurements are now performed during a 51 multiframe. They are performed
at one of the 5 FCCH.

Additionally a timeslot offset can be given for each measurement. This way
it is possible to measure each timeslot seperately. The given ARFCN must be in
sync with the serving cell.
2012-02-04 00:04:58 +01:00
Harald Welte b7c4b9b6f5 rename 'monitor' to 'rssi'
Sooner or later we might have a much more comprehensive monitor, so it's
good to name the current implementation just RSSI as that's all it does.
2012-02-04 00:04:58 +01:00
Andreas Eversberg 97d731de34 layer1/monitor: Adding spectrum analyzer to monitor app
By pressing '*', the analyzer is turned on or off.
Each beep indicated a new measurement result.
Right and left button can be used to scroll. By holding the button, the input
is repeated.
2012-02-04 00:04:58 +01:00
Andreas Eversberg c338fc3343 Adding "monitor" application to firmware
This app is used to measure receive level of given channels.

By pressing digits, the channel can be selected.
By pressing left or right button, the frequency is increased/decreased.
By pressing the menu button, the maximum received level is shown until
pressing menu button again. (usefull for hopping)
By pressing up or down button, the volume of a tone is changed, that
indicates rx level.
The left soft button is used to toggle PCS/DCS on shared channel numbers.
The right soft button is used to toggle uplink and downlink.
2012-02-04 00:04:58 +01:00
Steve Markgraf 99a4af4260 firmware/apps: remove l1test-application
This application had already been removed a while ago, but
was added again with one of the initial framebuffer commits.

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2012-02-03 23:59:36 +01:00
Steve Markgraf 7ff649a6a7 firmware/apps: print application name on the display
Now we're printing the application name on all apps
that initialize the display (again).

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2012-02-03 23:59:36 +01:00
Steve Markgraf d37d04dfdc firmware: remove deprecated display drivers and fonts
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2012-02-03 23:59:36 +01:00
Steve Markgraf 0f95771e62 firmware: remove deprecated function calls of old display API, cosmetic changes
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2012-02-03 23:59:36 +01:00
Steve Markgraf 533d5e6dc4 firmware/fb: add framebuffer driver for J100i display
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2012-02-03 23:59:36 +01:00
Steve Markgraf 4284a90a2a firmware/fb: add framebuffer driver for TD014 display (C139/C140)
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2012-02-03 23:59:36 +01:00
Christian Vogel 12d7ca237f Calypso FB: RGB332 to RGB565 conversion function. 2012-02-03 23:59:35 +01:00
Andreas Eversberg cf5ba98c10 firmware/fb: Fixed color component shift 2012-02-03 23:59:35 +01:00
Andreas Eversberg fc49eccb0c firmware/fb: Adding transparent background color for fonts 2012-02-03 23:59:35 +01:00
Steve Markgraf 4a5e3404f9 [PATCH] fw/fb/ssd1783: fix the RGB332 color palette
We revert the initialization of the palette to the behaviour of the
old non-fb driver.

Signed-off-by: Steve Markgraf <steve@steve-m.de>
Signed-off-by: Andreas Eversberg <jolly@eversberg.eu>
2012-02-03 23:59:35 +01:00
Andreas Eversberg 593d905f0f firmare/framebuffer: Option to center text
This is usefull, because actual width of proportional font text and display
width may not be known to application.
2012-02-03 23:59:35 +01:00
Andreas Eversberg 30dd87115c firmware/framebuffer: Adding fixed with font with 8x8 pixles 2012-02-03 23:59:35 +01:00
Christian Vogel de8bb97ed5 Calypso FB: Makefile, "dummy" driver, Hello World 2012-02-03 23:59:35 +01:00
Christian Vogel df4218c8fd Calypso FB: C155 / SSD1783 Color Support 2012-02-03 23:59:35 +01:00
Christian Vogel 080124619d Calypso FB: C123 / ST7558 Black and White Support 2012-02-03 23:59:35 +01:00
Christian Vogel ec097f532e Calypso FB: Main framebuffer header file. 2012-02-03 23:59:35 +01:00
Christian Vogel 45d88fa052 Calypso FB: 8 Fonts, header file and utility functions.
I only activate two fonts, Helvetica Regular 8pt and bold
14pt because the others bloat the binary too much.
2012-02-03 23:59:35 +01:00
Christian Vogel 41eed0ee31 Removing all traces of the old display drivers. 2012-02-03 23:59:34 +01:00
Harald Welte 0eecdf24f3 timers: comply with timer rename in libosmocore
libosmocore has prefixed the timer functions with omso_* already
in May 2011 (0b21c1c885), and we follow
suit here for API consistency reasons.
2012-01-29 09:41:45 +01:00
Andreas Eversberg 40fc521088 layer1: Fixed power measurement, adding ARFCN wrapping
Power measurement returned the first measurement result twice, now it is
returned only once.

Wrapping of ARFCN allows to measure the E-band en block. After measuring the
ARFCN 1023, the ARFCN wraps to 0. Special flags like ARFCN_UPLINK or
ARFCN_PCS are preserved while wrapping.
2012-01-28 13:16:14 +01:00
Andreas Eversberg a6c98a79b2 Hold function for power button to turn off the phone
In order to allow applications to use the power button, the keypad handler
will wait half a second if the key is pressed and hold, until the power
is turned off. This way the application does not need to handle it.

The power off function will then wait until the button is released, so the
phone will not start again while the button is still pressed.
2012-01-28 13:15:48 +01:00
Sylvain Munaut f04f53d3b7 target/rf: Make the trf6151_set_arfcn use ARFCN_UPLINK flag to select UL/DL
This way we can independentely control what frequency we want and
wheter we want to TX or RX. This allow TX on DL band and RX on UL band.

This also means all call to tx_window setup now need to properly set the
ARFCN_UPLINK flag !

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2012-01-28 13:15:18 +01:00
Andreas Eversberg 6ab18bedb1 firmware/layer1: Using queue to process received l23 frames in main loop
Instead of processing the frames out of the interrupt context, they are
queued until serial interrupt returns and main loop is processed.
2012-01-28 13:14:45 +01:00
Andreas Eversberg c4701d4204 Added callback function to forward L1CTL packets to rather than SERCOM
This is experimental, maybe there should be a better way to do that.
2012-01-28 13:13:38 +01:00
Alan Carvalho de Assis 83d9dcc017 i2c: fix maximum address an I2C chip can assign
I2C bus support up to 128 devices (mask 0x7F), but current calypso driver
is masked it to 64 (0x3F). I discover it because Motorola W220 has an I/O
expander PCA9537 at address 0x49 which could be reached.

Signed-off-by: Alan Carvalho de Assis <acassis@gmail.com>
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2011-11-27 14:35:36 +01:00
Steve Markgraf 126653e17c fw/rf/mt6139: Dereference pointer
Found and patched by Alexander Huemer

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2011-11-21 00:51:02 +01:00
Steve Markgraf 24a7d31d71 fw/i2c: Fix two printd-related typos
Thanks to Stefan Mandl for pointing those out.

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2011-11-15 17:41:40 +01:00
Sylvain Munaut de4f00d931 target/fw/sim: SIM Layer 1 driver
Originally written by dexter and then Andreas did a lot of cleanup
work to bring it into shape for inclusion in master

Written-by: Philipp Maier <zero-kelvin@gmx.de>
Written-by: Andreas Eversberg <jolly@eversberg.eu>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-13 20:25:19 +01:00
Sylvain Munaut 4789b4a662 fw/calypso: Fix backlight bl_mode_pwl method (typo)
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-09 20:03:57 +01:00
Steve Markgraf 2a64b42111 fw: Add SE J100i-specific board init code and build images for it
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2011-09-18 02:15:24 +02:00
Steve Markgraf a6ae8a3b7a fw/display: Add and build SSD1963 display driver for the SE J100i
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2011-09-18 02:12:23 +02:00
Steve Markgraf 1501bc24fa fw/compal/rffe: Add correct RFFE-configuration for Compal E86
The Compal E86 (C139/C140) has a different RFFE-configuration
than the other Compal phones. The Motorola C139 schematics
on this part look exactly the same, but in fact the board is missing
a transistor (U16), and it uses TSPACT2 adittionally.

This fixes the long-known problem with the C139/C140 phones
of the rx-level being over -20dBm worse as compared to the
E88/E89 phones, as well as the band selection on the
antenna switch in TX-mode (which was completely wrong,
but sort of worked anyway).

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2011-09-17 21:41:30 +02:00
Steve Markgraf 2b2209ebb5 fw/layer1/tpu_window: Open and close RFFE tx_window at the right point of time
So far, the PA-enable signal has been enabled way to early and
also has been disabled much too late.
We're now setting the RFFE to TX-mode after opening the ABB
window, and setting the RFFE to RX-mode again after TX. This
yields to an almost perfectly timed TX-window, just like with the
stock firmware of the phone.

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2011-09-16 21:24:05 +02:00
Steve Markgraf d7410b752f fw/comm/msgb: fix length parameter in memset-call
Found by clang:
warning: argument to 'sizeof' in 'memset' call is the same expression
as the destination; did you mean to remove the addressof?

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2011-08-31 22:07:18 +02:00
Steve Markgraf ff82113350 fw/layer1/fbsb: fix newline in a printf()-call
Found by clang:
warning: unknown escape sequence '\m'

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2011-08-31 21:55:01 +02:00
Steve Markgraf 3087fd5030 fw/display/font: add proper 8x8 font for the st7558 display driver
It was obtained by rotating font_r8x8_horiz.c.
Also refer to the last git commit for more details.

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2011-08-31 04:01:49 +02:00
Steve Markgraf 6379629a3a fw/display/font: remove old 8x8 font used by the st7558 display driver
This file was handled as a binary(!) file by git (thus the git rm).
Also, it missed the uppermost line of pixels in each character.
It will be replaced with a correct font in the next commit.

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2011-08-31 04:00:58 +02:00
Steve Markgraf 4f0825a352 fw/abb/twl3025: handle interrupt on powerbutton press
Since the powerbutton on the Pirelli DP-L10 doesn't seem to be
connected to the keypad scan matrix at all, we're using Iota's
PWON interrupt to determine if the powerbutton has been pressed,
and power off the phone after it has been released again.

This also affects the Compal phones, since the interrupt happens
quite some time before the keypad driver notices the keypress.

The code in the keypad driver that has been used so far to power
off the phone will remain as a backup when running without
interrupts at all (e.g. the loader application).

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2011-08-30 21:34:36 +02:00
Sylvain Munaut 178992a232 fw/calypso/dsp: Fix wrong hardcoded boot code constant
No functional impact tough.

Thanks to Job <baseband@hackwerk.org> on the ML for pointing this out

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-08-03 11:39:49 +02:00
Sylvain Munaut e042cbb297 fw/prim_tch: Add support for sending frame from l23 (TRAFFIC_REQ/CONF)
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-07-28 21:30:50 +02:00
Sylvain Munaut 5e10b74d0b fw/prim_tch: Add support for sending traffic frames to l23 (TRAFFIC_IND)
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-07-28 21:30:50 +02:00
Sylvain Munaut e809248b66 fw/layer1/l23_api: Add processing of the new audio_mode
This currently just stores it into the l1 sync state struct

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-07-28 21:30:50 +02:00
Sylvain Munaut 643aad2ef4 fw/l1: Add a queue for traffic frame to send to network (TRAFFIC_REQ)
Also hard limit to maximum 4 pending frames (should not happen !), the
upstream is supposed to do its own flow control.

Written-by: Andreas Eversberg <jolly@eversberg.eu>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-07-28 21:30:50 +02:00
Sylvain Munaut c7d20dfc41 l1ctl: Add definition for TRAFFIC_{REQ,CONF,IND}
Also adapt packet creation length in L1

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-07-28 21:30:50 +02:00
Sylvain Munaut 2908849908 fw/apps: Remove manual gain control with keyboard
- It's broken by the use of compute_gain
 - Since there is now an AGC loop, manually setting the register
   as no effect.

If someone needs manual gain control for testing, he'll have to
re-implement a proper AGC override.


Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-07-17 12:05:07 +02:00
Andreas Eversberg 74e7535ea2 [layer1] Adding neighbour cell measurement code to layer1.
When listening to BCCH, layer1 may measure the power level of neighbour
cells. A list of neighbour cell frequencies need to be sent to layer1.
After the measurement is done, the results are indicated to layer23.
2011-07-17 09:41:19 +02:00
Andreas Eversberg 065b6e35a3 [rf] Adding rffe_set_gain() and rffe_get_gain() to get/set computed gain
rffe_compute_gain() is the new name for rffe_set_gain(). I needed to change
this, to solve the name collision with the rffe_set_gain() function, which
actually sets the absolute gain.

rffe_get_gain() will now read the absolute gain which has been computed by
rffe_compute_gain() or set by rffe_set_gain().
2011-07-17 09:27:35 +02:00
Harald Welte d5c9c73622 tpu_window: Fix int16_t overflow in tpu_window calculation
First we add 55500 to an int16_t, then later we subtract it again.
The bug only didn't become apparent as we wrap twice, once adding
then subtracting.

Discovered by Smatch:
firmware/layer1/tpu_window.c +127 l1s_rx_win_ctrl(24) warn: value 55000 can't fit into 32767 'stop'
2011-07-16 18:01:48 +02:00
Harald Welte c9297d28e0 calypso/uart.c: Fix array bounds checking
Found by Smatch:
calypso/uart.c +433 uart_baudrate(7) error: buffer overflow 'divider' 7 <= 7
2011-07-16 17:48:20 +02:00
Harald Welte 5339425de9 calypso/irq: Fix array bounds checking
Found by Smatch:
calypso/irq.c +200 irq_register_handler(5) error: buffer overflow 'irq_handlers' 32 <= 32
2011-07-16 17:46:54 +02:00
Andreas Eversberg bd3629e4e6 fw/l1a: Add a message to safely count the length of a txqueue
(that is by locking)

Written-by: Andreas Eversberg <jolly@eversberg.eu>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-06-25 22:46:24 +02:00
Sylvain Munaut 402634a0cf fw/sercomm: Additional locking needed in drv_pull
Credits to Andreas Eversberg for finding this bug after countless
hours of debug and providing initial patch :)

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-06-25 22:42:38 +02:00
Sylvain Munaut 301eb4753a fw/sercomm: Fix up the locking using an 'abstraction' layer
Not _that_ abstract but a long is enough to store a ptr if need
be :p

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-06-25 22:38:20 +02:00
Sylvain Munaut 5907bfd39a fw/comm/msgb: Protect allocation routine with proper locking
Credits to Andreas Eversberg for finding this bug after countless
hours of debug :)

Written-by: Andreas Eversberg <jolly@eversberg.eu>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-06-25 22:29:09 +02:00
Sylvain Munaut fc16cbb578 fw/comm/msgb: Really panic (i.e. lockup) if we run out of msgb
Ideally we should only panic in interrupt context. In user
context, we could wait ...

We could also return NULL and let the calling code deal with it
but it's not ready for that yet.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-06-25 22:29:06 +02:00
Sylvain Munaut 6eba3fe6a5 fw/comm: Remove useless include from msgb.c
Left over from the backlight debug code

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-06-25 22:28:57 +02:00
Wolfram Sang 5bbea93772 board: mtk: increase RAM sizes in linker script
gcc3 (and some gcc4) produce code which does not fit into the
0x5000-sized RAM sections. Extend them to 0x6000 for now, so it will
build correctly again. The created binary (gcc3) has been successfully
tested on my G2.

Signed-off-by: Wolfram Sang <wolfram@the-dreams.de>
2011-05-30 21:51:58 +02:00
Wolfram Sang fc0a28f524 mtk: uart: remove forgotten calypso-include
Dunno how that survived...

Signed-off-by: Wolfram Sang <wolfram@the-dreams.de>
2011-05-30 21:51:58 +02:00
Sylvain Munaut 16ec2358a0 fw/rffe/compal: Add support for 850 band
The HW switch supports it.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-05-29 19:51:54 +02:00
Sylvain Munaut 706c3b0db7 fw/trf6151: Use a #define to enable/disable out-of-spec warnings
We also disable them by default because:
 - It can operate fine out of spec
 - Some phone will actually do it (like using the DCS port for PCS)
 - It's verbose for nothing for most people anyway

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-05-29 19:51:54 +02:00
Sylvain Munaut 4684c75a66 fw/trf6151: Better PLL settings routines
* We actually support TX 850/1900 now
 * We try to find the better settings for a given frequency,
   no matter if it's in spec or not ...
   (for e.g. TXin in DCS downlink is better done with PCS config)

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-05-29 19:51:54 +02:00
Sylvain Munaut a78316c831 fw/rffe: Add function to query RF wiring
Depending on the chipset and the HW, not all ports are connected
and we need to know what we can use when we have the choice ...

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-05-29 19:51:54 +02:00
Pablo Neira Ayuso 63cca6660f src: use namespace prefix osmo_* for crc16 functions
Summary of changes:

s/crc16_table/osmo_crc16_table/g
s/crc16/osmo_crc16/g
s/crc16_byte/osmo_crc16_byte/g
2011-05-15 17:33:28 +02:00
Pablo Neira Ayuso d3ba2f6037 src: use namespace prefix osmo_timer*
Summary of changes:

s/struct timer_list/struct osmo_timer_list/g
s/bsc_add_timer/osmo_timer_add/g
s/bsc_schedule_timer/osmo_timer_schedule/g
s/bsc_del_timer/osmo_timer_del/g
s/bsc_timer_pending/osmo_timer_pending/g
s/bsc_nearest_timer/osmo_timers_nearest/g
s/bsc_prepare_timers/osmo_timers_prepare/g
s/bsc_update_timers/osmo_timers_update/g
s/bsc_timer_check/osmo_timers_check/g
2011-05-15 14:39:30 +02:00
Wolfram Sang a5611f9555 target/boards: add infrastructure for loaders for Mediatek platforms
We are just interested in the loaders here, no other applications needed.
Split it from the compal-based phones. Add mt62xx as first user.

Based on a patch by steve-m, but cleaned up and seperated from compal/calypso.

Signed-off-by: Steve Markgraf <steve@steve-m.de>
Signed-off-by: Wolfram Sang <wolfram@the-dreams.de>
2011-05-05 09:52:47 +02:00
Wolfram Sang 07589649b1 uart.h: move header out of calypso-directory
Everything defined is a pretty generic interface and can be used by
mediatek, too.

Signed-off-by: Wolfram Sang <wolfram@the-dreams.de>
2011-05-05 09:52:47 +02:00
Wolfram Sang 832b8b275b cfi_flash: delete unused defines
Signed-off-by: Wolfram Sang <wolfram@the-dreams.de>
2011-05-05 09:52:46 +02:00
Wolfram Sang 6b36f7856f lib: move delay.c from calypso to lib
Nothing calypso-related in there and needed for Mediatek, too.

Signed-off-by: Wolfram Sang <wolfram@the-dreams.de>
2011-05-05 09:52:46 +02:00
Wolfram Sang a2566d0514 comm: msgb: don't set backlight on error
Removes the dependency to calypso and makes place for a generic board_panic to
be added later.

Signed-off-by: Wolfram Sang <wolfram@the-dreams.de>
2011-05-05 09:52:46 +02:00
Wolfram Sang b17fe4d0a1 target/firmware: make build less verbose like the rest of the tree
As usual V=1 will give the full output.

Signed-off-by: Wolfram Sang <wolfram@the-dreams.de>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-04-28 10:58:12 +02:00
Pablo Neira Ayuso ade79a0083 src: use new libosmogsm and include/osmocom/[gsm|core] path to headers
This patch changes include paths to get osmocom-bb working with
the current libosmocore tree.

Among all these renames, you can notice several tweaks that I
added on purpose, and that require some explanation, they are:

* hexdump() in osmocon.c and osmoload.c has been renamed to avoid
clashing with hexdump() defined in libosmocore.

* gsmmap now depends on libosmogsm. Actually I had to cleanup
Makefile.am because I was experiencing weird linking problems,
probably due to a bug in the autotools. With the change included
in this patch, I got it compiled and linked here correctly.

This patch has been tested with the phone Motorola C123 and the
following images files:

* firmware/board/compal_e88/hello_world.compalram.bin
* firmware/board/compal_e88/layer1.compalram.bin

Using the osmocon, bcch_scan and mobile tools.

Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
2011-04-26 02:55:30 +02:00
Sylvain Munaut d9639bb010 fw/calypso: Add a new driver for the buzzer control
Written-by: Jose Luis Pereira <onaips@gmail.com>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-04-24 19:38:22 +02:00
Andreas Eversberg 937023be6e fw/layer1: Adding TAO loop to correct TPU window offset
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-03-20 14:59:16 +01:00
Steve Markgraf 331641d568 target/fw/dsp: add delay as workaround for dsp_dump
Without the delay we would fill the sercomm buffer faster than its
content can be sent, and the phone would end up in a panic and hang.

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2011-03-19 02:56:25 +01:00
Steve Markgraf df566b6e4a target/fw: correct IO_CNTL_REG name and small cosmetic fixes
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2011-02-06 17:33:59 +01:00
Steve Markgraf 78345a75d3 firmware: Add support for the Pirelli DP-L10 triband GSM/Wifi phone
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2011-01-24 16:59:04 +01:00
Steve Markgraf 524de77ac4 fw/app/layer1: unset the inverted attribute of the display after layer1_init()
This attribute is toggled with the RTC interrupt, which is disabled
in layer1_init(). If an interrupt between rtc_init() and layer1_init()
occured, the display of the E88 phones remained inverted

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2011-01-24 16:55:11 +01:00
Steve Markgraf e83f3a9308 fw/board/gta0x: move rffe configuration to board/gta0x
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2011-01-24 16:54:52 +01:00
Steve Markgraf 8f618a5c49 fw/makefile: enable generation of Compal E86 images (Motorola C139/C140)
This target now has its own init.c which correctly initializes the display
and the keypad backlight

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2011-01-24 16:54:33 +01:00
Steve Markgraf 0b4155ca19 fw/board/gta0x: remove unused define in RFFE configuration
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2011-01-24 16:53:47 +01:00
Steve Markgraf f1ac298ff7 fw/board/gta0x: implement TX support for gta0x devices
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2011-01-24 16:50:21 +01:00
Steve Markgraf cb8b198375 target/fw: set the TRF6151 tsp IDs from the rffe initialization
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2011-01-24 16:48:56 +01:00
Steve Markgraf b5abcb6970 target/loader: disable bootrom mapping
This is for being able to read the whole flash on devices that use the bootrom,
and also fixes flash detection on the C139/C140/J100i

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2011-01-12 19:09:16 +01:00
Sylvain Munaut 9627afc8bb fw/calypso/dsp: Add comment about meaning of bit 11 of ndb->d_tch_mode
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-01-12 15:39:25 +01:00
Steve Markgraf cd918a20aa target/simtest: remove delay functions
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2011-01-11 20:03:35 +01:00
Thomas Waldmann be9ea273b3 fixed typos in comments
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2011-01-11 19:53:56 +01:00
Andreas Oberritter 0e130bf467 Fix flash chip detection by using a volatile pointer
* This might be a workaround for a compiler bug
  (gcc 4.5.2, binutils 2.21)

Signed-off-by: Andreas Oberritter <obi@saftware.de>
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2011-01-07 23:58:30 +01:00
Steve Markgraf 34bbb12b7a display/st7558: remove delays, since the bug in the i2c driver is fixed
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2011-01-02 16:54:54 +01:00
Christian Vogel 65b078fa20 Testing for the idle i2c bus was done backwards, we have
to wait for the bit to become 0, not 1.
2011-01-02 16:43:25 +01:00
Steve Markgraf 897b41a90c display/td014: add short delay after initializing uwire
This should fix the initialization of the C139/C140 display

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2011-01-02 01:36:04 +01:00
Sylvain Munaut 45890fe657 fw/layer1: Resync TCH primitive on mode changes
This is needed for audio to work properly in VEA mode

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-27 16:07:30 +01:00
Holger Hans Peter Freyther b09aaa1e6d stdint.h: Next attempt at making this work with various compilers
Newer GCC with GNU LIBC do not like our minimalistic version of
stdint.h and will have conflicts. Older GCC with older C Libs do
not have a stdint.h yet and the #include_next trick is failing. To
make matters worse NEWLIB does not export its version via the
pre-processor.

We will have to guess once more about the compiler. This code now
assumes that if we have a GCC < 4 that it does not have a stdint.h
and we will not try to include the next stdint.h file.
2010-12-20 21:01:22 +01:00
Harald Welte 9f30c97e4a [mtk] Add initial / unfinished MT6139 driver 2010-12-12 09:47:21 +01:00
Sylvain Munaut e3d7f499e3 fw/layer1: Fix reset of dedicated channel state
Thanks to Alex Badea <vamposdecampos@gmail.com> for pointing
this out.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-11-28 14:40:08 +01:00
Sylvain Munaut 9c7c75a1c7 fw/layer1: Fix missing include in prim_pm.c
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-11-24 09:43:11 +01:00
Alex Badea d45476dad9 target uart: remove REG_OFFS() macro side-effect
Don't assign to the variable given as argument.  This prevents
clobbering the local 'reg' variables in uart_reg_{read,write}(),
which would in turn prevent the latch bits from being restored
correctly.

Signed-off-by: Alex Badea <vamposdecampos@gmail.com>
2010-11-17 23:39:46 +01:00
Alex Badea 4ad8b730a0 target uart: fix preservation of LCR
Store old_lcr only when switching to LCR == 0xBF.  We don't want
to clobber old_lcr when switching back, otherwise we can't restore
the previous LCR value.

Signed-off-by: Alex Badea <vamposdecampos@gmail.com>
2010-11-17 23:39:46 +01:00
Sylvain Munaut e801cee46b fw/l1/mframe_sched: Fix the TCH_A entries to include the MF_F_SACCH flag
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-11-14 17:09:54 +01:00
Sylvain Munaut 87b44798ef fw/layer1: Use dbm2rxlev instead of just '+110' so that overflows are handled
Without this, we would sometime get +143 dBm reported ... which is obviously
false.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-11-14 17:09:54 +01:00
Harald Welte 7a81d8777a add definitions for sciphone G2 2010-11-09 19:17:48 +01:00
Harald Welte fed69cd4a0 add some header files about MTK GSM related peripherals 2010-11-09 18:19:06 +01:00
Sylvain Munaut 59bc439886 target/fw/dsp: Implement section loading with bootloader
This works for both the default ROM bootloader and for our
custom one.

This will allow to implement easy patch loading.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-11-07 21:36:32 +01:00
Sylvain Munaut 379608d218 target/fw/dsp: Create a common function to start running code
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-11-07 21:36:17 +01:00
Sylvain Munaut 00ffd1336e target/fw/l1: Fix TCH/H1 by properly loading the TCH mode during TCH_A task
Altough quite counterintuitive, the TCH_A task does some voice coding
work ... at least during TCH/H subchannel 1 ...

Go figure ...

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-11-07 10:34:10 +01:00
Sylvain Munaut 375f41a9dd target/fw/l1: Fix TCH/H by properly scheduling the TCHD task during 'off' slots
Apparently the DSP needs to be run even during the slots without
actual bursts exchange.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-11-07 10:34:09 +01:00
Andreas.Eversberg 072d7dd4bf target/fw/layer1: Change L1CTL RACH req to properly use all slots
Written-by: Andreas Eversberg <jolly@eversberg.eu>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-10-30 17:31:09 +02:00
Steve Markgraf 18dba362c0 target/fw/layer1: correctly initialize afc_retries
Otherwise, when it reached AFC_RETRY_COUNT, no new FB0 tasks
were scheduled, and you needed to restart the phone in order to
successfully sync to a cell

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2010-10-25 20:59:24 +02:00
Sylvain Munaut 8c9b8f446f target/fw/l23_api: Enable/Disable audio path appropriately
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-10-25 20:58:32 +02:00
Sylvain Munaut 69c84c45e5 target/fw/l23_api: Properly sync tch in DM EST REQ
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-10-25 20:58:32 +02:00
Sylvain Munaut f1d942b8f4 target/fw/layer1: Add support for the various TCH multi frame tasks
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-10-25 20:58:32 +02:00
Sylvain Munaut 76bfbc8193 target/fw/layer1: Add initial version of TCH primitives
The initial bringup is mainly Dieter Spaar's work. I took the
logic and rewrote it, adapting to later scheduler changes and
adding support for several other things (tch_mode, initial HR
support, various cleanup, ...).

Initially-Written-by: Dieter Spaar <spaar@mirider.augusta.de>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-10-25 20:58:32 +02:00
Sylvain Munaut ba1cef1d23 target/fw/calypso: Fix dsp_load_tch_param to set fn_report for TCH/H
The previous code was only valid for TCH/F ...

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-10-25 20:58:31 +02:00
Sylvain Munaut aab5419af0 target/fw/layer1: Store the GSM48 constants in l1s.tch_mode instead of DSP cste
At this point in the code, we don't know if we're TCH/H or TCH/F, so
just store the speech mode and we'll figure out what to tell the DSP
in the task code itself.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-10-25 20:58:31 +02:00
Sylvain Munaut e35089a6c1 target/fw/layer1: Fix msgb leak when prim_rx is half executed
If the task interrupted because of a reset, an allocated msgb
will be present and we need to free it instead of just loosing
the reference to it.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-10-25 20:58:31 +02:00
Sylvain Munaut 91d0f4a2eb target/fw/include: Fix missing apc helper declaration
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-10-25 20:58:31 +02:00
Sylvain Munaut f3d1f64e4e target/fw/layer1: Use common DSP API memcpy instead of repeating code
Also get rid of some early debug print that aren't needed now.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-10-25 20:58:31 +02:00
Sylvain Munaut e972e1c6b7 target/fw/dsp: Add utility function to memcpy to/from the API
Copying to/from the DSP API shared memory must be done using
16 bits word only. Using those method, we avoid the hassle of
repeating the code when we copy buffer back and forth.

API address must be 16 bits aligned but for our purpose, it's
good enough.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-10-25 20:58:31 +02:00
Holger Hans Peter Freyther b504f5c8b8 sercomm.c: Avoid unused variable compiler warning
For the host build the local_irq_save/_restore is a NOOP
and the compiler warns about the unused flags variable. Cast
it to void to avoid compiler warning.
2010-10-03 02:09:35 +08:00
Dieter Spaar 78704ca3fe target/dsp: Add dsp audio initialization
Written-by: Dieter Spaar <spaar@mirider.augusta.de>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-28 08:04:19 +02:00
Dieter Spaar f4bbb30f66 target/dsp: Adjust dsp parameters for TCH FR Codec
Written-by: Dieter Spaar <spaar@mirider.augusta.de>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-28 08:04:19 +02:00
Sylvain Munaut 61fdec01f5 fw/layer1: Process the tch_mode and store it for later use
Currently unused since no TCH support ...
Will be used by future commits.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-28 08:04:19 +02:00
Sylvain Munaut d227b37f12 fw/layer1: Add support for proper meas. report (and use in prim_tx_nb)
Rewritten based on an original patch by Andreas.Eversberg.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-28 08:04:18 +02:00
Andreas.Eversberg 732f102cc2 fw/layer1: Add support for measurement messages from layer2/3
Written-by: Andreas.Eversberg <jolly@eversberg.eu>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-28 08:04:18 +02:00
Sylvain Munaut 1b6c2593eb fw/layer1: Introduce prim_utils.c for shared helper betwee primitives
Currently only share the idle frame pattern.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-28 08:04:18 +02:00
Sylvain Munaut aef1e05d9a fw/layer1: Introduce prim.h for all primitive related things
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-28 08:04:18 +02:00
Sylvain Munaut f8d372d7e4 fw/layer1: Fix type of p3 in tdma window setup/cleanup sched items
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-28 08:04:18 +02:00
Sylvain Munaut 6c6b073f54 Remove the various checks for high TS as those should now work
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-26 20:05:23 +02:00
Sylvain Munaut 48d3a7ab4c fw/layer1: New TPU window sync method
This is Dieter's sync method adapted to the new TPU stuff.
Not perfect, but should work for TS[0:7] as long as you
leave a free frame between each TS changes ...

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-26 20:05:23 +02:00
Sylvain Munaut 2400d60d0d fw/layer1: Fix RX TPU window - no TA dependency
Cut & paste errror ... the TA has nothing to do in RX

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-26 20:05:23 +02:00
Sylvain Munaut daa8630468 target/layer1: Implement host-driven Tx power control
It's up to L23 to change the parameters using the appropriate
L1CTL call.

This is a mix between Harald's version and Dieter's version of
the TX control code.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-26 20:05:22 +02:00
Sylvain Munaut 1ca0ce1a5c fw/layer1: Display diff in hwtimer value when lost interrupt is detected
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-26 20:05:22 +02:00
Sylvain Munaut 3cdabae2cf fw/l23_api: Fix cut&paste typo in comment
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-17 20:52:41 +02:00
Sylvain Munaut df0f386cdb fw/layer1: Properly set/reset ciphering parameters when needed
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-17 20:52:41 +02:00
Sylvain Munaut 664fa9ae0b fw/dsp: Add function to load dsp ciphering parameters
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-17 20:52:41 +02:00
Sylvain Munaut 3d5274ed61 fw/layer1: Properly load the tch dsp param (including various fn) in RX
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-17 20:52:41 +02:00
Sylvain Munaut 890e55e9f7 fw: Update dsl_load_tch_params to set the fn_sid, fn_report and fn_a5
Mix between Dieter's version in tch branch and how the TSM30 does it.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-17 20:52:41 +02:00
Sylvain Munaut 4f53e169a2 fw: Move channel type/mode definitions in common header
We'll need them later elsewhere than the tx prim

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-17 20:52:41 +02:00
Sylvain Munaut 54b77bc07e fw & layer23: Remove limitation about the SDCCH subchannel 4..8
This is now supported :)

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-17 20:52:41 +02:00
Sylvain Munaut f0873b81fe fw/layer1: Increase tdma_sched bucket size
We can now have a bunch more stuff scheduled !

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-17 20:52:40 +02:00
Sylvain Munaut 78fc76cc8f fw/layer1: Add common TPU win setup/cleanup code
Instead of each primitive doing it independently, if there is a TPU
scenario in one of the item, we do a common setup with the base tn
returned by rfch_get_params.

Then each rx / tx window setup is relative to that 'base tn'. For
TX window, you have to explicitely request an offset of 3. (this
would allow for some test code to TX on ts=0 for eg.)

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-17 20:52:40 +02:00
Sylvain Munaut 68c40addf7 fw/layer1: Convert primitives to use common DSP/TPU scenario ending
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-17 20:52:40 +02:00
Sylvain Munaut e041d5b7d7 fw/layer1: Add some sched items flags to signal DSP & TPU scenarios
If those flags are set in one of the item of the current frame,
we end the tpu & dsp scenario in common code.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-17 20:52:40 +02:00
Sylvain Munaut 1ba04eb47b fw/layer1: Add a 'flags' field to sched_items and the infra to use it
This is only preparation

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-17 20:52:40 +02:00
Sylvain Munaut f06d54ed6f fw/layer1: Add a priority field for sched_item
Each item has a priority associated to it. The standard is :
-4    -> Responses processing
-3    -> L1S parameters changes
-2    -> [Reserved for TPU window setup]
-1    -> (anything)
 0..7 -> Commands relative to time slot n
         (relative to current l1s main timeslot)
 8    -> (anything)
 9    -> [Reserved for TPU window cleanup]
10    -> (anthing)

Note that with this modification, an item scheduled for the
current frame from within a call back won't have its priority
respected !

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-17 20:52:40 +02:00
Sylvain Munaut d7ba30c2a0 layer1: Make rfch_get_params tolerate NULL ptr for unwanted params
If the caller doesn't need some params, just don't give them !

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-14 21:21:43 +02:00