Commit Graph

414 Commits

Author SHA1 Message Date
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