Commit Graph

795 Commits

Author SHA1 Message Date
Vadim Yanitskiy 697e259dc4 firmware: fix shebang in solve_envs.py: s/python/python3/
This patch fixes [currently missing] Jenkins build verification.
Currently it's just skipping the firmware due to errors:

make -C target/firmware CROSS_COMPILE=arm-none-eabi-
make[1]: Entering directory '/build/src/target/firmware'
/usr/bin/env: 'python': No such file or directory
/usr/bin/env: 'python': No such file or directory
/usr/bin/env: 'python': No such file or directory
/usr/bin/env: 'python': No such file or directory
/usr/bin/env: 'python': No such file or directory
/usr/bin/env: 'python': No such file or directory
...

Change-Id: Ibfcc17ca2736da82d60db3b0e350b74e788031b0
2024-01-10 23:01:56 +07:00
Harald Welte 818133cd23 firmware: -nostartfiles -nodefaultlibs are not flags of LD but flags of GCC
It seems that those flags have always been gcc flags, and not ld flags.

After decades of tolerating this, binutils 2.36.x no longer tolerates
those flags but prints an error:

arm-none-eabi-ld: Error: unable to disambiguate: -nostartfiles (did you mean --nostartfiles ?)

See also https://github.com/apache/nuttx/issues/3826 and the related
https://github.com/apache/nuttx/pull/3836 how this was solved in another
project - I adopted that solution here 1:1

Change-Id: Id199e4d03d5aae07a347c98f47791f42c12008c6
2023-11-22 14:12:26 +01:00
Vadim Yanitskiy 7c60c5d6d9 firmware/layer1: avoid 'for' loop initial declarations
As was reported by roox, osmocom-bb currently fails to build on OBS:

https://build.opensuse.org/build/home:mnhauke:osmocom:nightly/openSUSE_Tumbleweed/x86_64/osmocom-bb/_log

[   24s] layer1/prim_tch.c: In function 'l1s_tch_meas_avg':
[   24s] layer1/prim_tch.c:183:2: error: 'for' loop initial declarations are only allowed in C99 mode
[   24s] layer1/prim_tch.c:183:2: note: use option -std=c99 or -std=gnu99 to compile your code

We don't specify the C standard explicitly, so let's move the variable
declaration out of the for-loop in l1s_tch_meas_avg().

Change-Id: I6c65fbead4e612c81728e9c6601d5f2107616ee6
Fixes: 7286560a3 "firmware/layer1: fill-in DL info for L1CTL TRAFFIC.ind"
2023-11-21 17:04:10 +07:00
Vadim Yanitskiy 069b627abe firmware/layer1: handle CSD related channel modes
Change-Id: Ib73210b273826ded56d42c41ffeb835eef96dd2b
Related: OS#4396
2023-10-16 14:10:21 +07:00
Vadim Yanitskiy a6d0a3e170 firmware/layer1: emit TRAFFIC.ind even if B_BFI is set
Even if the DSP marks a traffic frame as bad (B_BFI), we still want
to deliver something to the upper layers, just like we do for FACCH.

Change-Id: I559793a3506089b1c1758ee7022cceb7753afb30
Related: OS#4396
2023-10-16 14:10:21 +07:00
Vadim Yanitskiy 7286560a33 firmware/layer1: fill-in DL info for L1CTL TRAFFIC.ind
Change-Id: I1c9727b183214f3d1a4f9a48489479f8435a4c5a
Related: OS#4396
2023-10-16 14:10:21 +07:00
Vadim Yanitskiy 5523c0084d firmware/layer1: fix l1s_tch_resp(): use the right A_DD header
Change-Id: Idd48438e47ac3ef1172621e77688d094cdcdbf34
Related: OS#4396
2023-10-16 14:10:21 +07:00
Vadim Yanitskiy f492a99d36 firmware/layer1: clean up l1s_tch_resp()
* Reset both A_DD_0 and A_DD_1 headers, like in the case of FACCH.
* Reduce nesting, fix minor coding style issues.
* Add a FIXME for proper B_BFI checking.

Change-Id: Ie4faf386f54720888e73171bee26f93dfa0562d5
Related: OS#4396
2023-10-16 14:10:19 +07:00
Vadim Yanitskiy c6c392aafd firmware/layer1: cosmetic: labels should not be indented
Change-Id: Ie32501df19cc2eedd1042c9917583d7386a665bc
Related: OS#4396
2023-10-16 14:06:56 +07:00
Vadim Yanitskiy 8a2422db1f firmware/layer1: clean up l1s_tch_cmd(): reduce nesting
Change-Id: If4f0bb37cb3e12e09078027461cd5040524e43b2
Related: OS#4396
2023-10-16 12:21:40 +07:00
Vadim Yanitskiy 79baca14d4 firmware/layer1: mute UL/DL vocodec if it's not needed
The upper layers usually request either of the two configurations:

* (AUDIO_TX_MICROPHONE | AUDIO_RX_SPEAKER) - in this configuration
  the phone (PHY) is both the origin and the destination of the TCH
  frames.  DL frames are played via the built-in speaker; UL frames
  recorded using the built-in microphone.

* (AUDIO_TX_TRAFFIC_REQ | AUDIO_RX_TRAFFIC_IND) - in this case
  the upper layers (host side) become the origin and the destination
  of the TCH frames.  The built-in speaker and microphone are
  expected to be disabled.

However, when using the second configuration, one can still hear
DL TCH frames being played by the built-in speaker.  The built-in
microphone does not seem to be causing any issues, but still we
definitely don't want the vocoder to interfere with the host.

Change-Id: I390db1889f079dea8112794c3e039a9136b897df
Related: OS#4396
2023-10-16 12:21:40 +07:00
Andreas Eversberg 23d46f003f ASCI: Add UIC support to random access burst
A different identity code can be used on uplink access bursts on voice
group channel. This is optional for the network, but mandatory for the
MS side. If the network does not define a UIC, the BSIC is used instead.
BSIC is used for RACH channel and handover.

Related: OS#5364
Change-Id: I4039734676949aefa5be4b5298764b8ba7e1b8ed
2023-09-28 10:42:38 +02:00
Andreas Eversberg d95c8f4fa6 Transmit access bursts on DCCH of TCH channels
This is required to access a TCH during handover or to access the uplink
of a VGCS channel.

The patch is taken from the handover branch.

Change-Id: I1a972d9bac5749c67c1b139825400854f7cf1490
2023-09-27 14:02:41 +00:00
Andreas Eversberg 28d9a4880c ASCI: Add a flag to turn transmitter off or on
This flag can be used to turn transmitter off for "group receive mode"
or for handover procedure. The flag is stored in the channel description
of the mobile application. It is sent to layer 1 when switching to
dedicated channel or when changing TCH mode.

At the layer 1 the transmitter is turned off while the receiver is still
active. This is done by:

 * scheduling a TX dummy task for TCH bursts
 * scheduling no TX task for SACCH bursts
 * not enabling the transmit window

Related: OS#5364
Change-Id: I20133523adc3b204cd2181bfe664fe66020a10e3
2023-09-27 14:02:41 +00:00
Mychaela N. Falconia 59e649dbf1 firmware: board: add support for TR-800 target
iWOW TR-800 is a packaged GSM modem module based on Calypso+Iota+Rita
chipset; it is fully quadband, and reverse engineering of its PCB
confirms that this module is nothing but a mass-produced version of
the core of TI's legendary Leonardo+ reference platform.  The same
module is also known as FreeCalypso Tango - a rebranded version of
the same hardware module with different firmware and a different
Responsible Party for official support.

FreeCalypso HQ is contributing OsmocomBB support for this Calypso
modem module for two reasons:

1) Harm reduction - sooner or later someone in Osmocom universe is
   going to run OBB firmware on TR-800 once they lay their hands on
   this hardware, and the resulting operation will be less harmful /
   closer to correct if we provide the basic board support patch.

2) There exists a large surplus of FreeCalypso Caramel2 development
   boards that are based around FC Tango modules.  Having this hw
   supported by both firmwares will hopefully increase the chances
   that these boards will find loving homes, as opposed to continuing
   to gather dust in a cardboard box.

Legal and ethical disclaimer: OsmocomBB firmware running on ANY
Calypso+Iota+Rita target is *known*, through confirmed observations
with a measuring instrument (R&S CMU200), to put out radio transmissions
that are *severely out of spec*, and this defect does NOT go away
with the present patch which merely adds support for a different C+I+R
board target.  The present patch has been produced as a harm reduction
measure, to reduce (but not to zero) the harm that will be caused
by parties who run OsmocomBB firmware on C+I+R hardware despite having
been advised not to.  As the party seeking to reduce rather than cause
that harm, Mother Mychaela and her related business entities explicitly
disclaim all liability for damage that will be caused by parties who
continue running OsmocomBB firmware despite having been repeatedly
advised to switch to manufacturer-approved published-source firmware
instead.

Change-Id: I84d564f052f12a25ea3bfb9c78860e9dc6262be8
2023-09-04 20:19:12 +00:00
Vadim Yanitskiy f5959f78cd fake_trx.py: remove SETSLOT based burst filtering
For the sake of simplicity and due to some performance limitations,
fake_trx.py does not generate TRXD NOPE indications for osmo-bts-trx
on its own.  It's actually trxcon sending NOPE.req (empty Tx PDUs)
when it has nothing to send, and fake_trx.py simply converting them.

In a follow-up change [1] we remove trxcon's internal clock module,
making the Uplink burst scheduling being driven by Downlink bursts
with the respective TDMA Fn/Tn values.  Given that fake_trx.py is
currently dropping bursts received for inactive timeslots, we would
get NOPE.req only for a single timeslot, the one being currently
active.  This would break several testcases in ttcn3-bts-test.

Remove SETSLOT based burst filtering, so that trxcon would still be
able to generate NOPE.req for all, active and inactive timeslots.
Downlink bursts for inactive timeslots are discarded anyway.

Change-Id: Ia42550d5c2d8b49efbdf8ef0ce46b26afd1c464e
Related: [1] Ic8a5b6277c6b16392026e0557376257d71c9d230
Related: OS#5500
2023-06-11 19:25:31 +00:00
Oliver Smith f6c1cec3b5 Cosmetic: fix encoding of ui-experiment/font.h
Remove characters 0x80 - 0xff from comments in this source file, as
they can't be parsed as UTF-8. This causes struct_endianness.py to
error on the file, git and gerrit can't display a proper diff and treat
it as binary file, etc.

Related: OS#5884
Change-Id: I0daebccf819595ee64fb4c9713a4f0ce219c58be
2023-02-20 11:11:03 +01:00
Steve Markgraf aeb19ea3ef fw: Add display driver for K200i/K220i
Change-Id: I90fbe583983de34f39ec402d5a35712dfe57222b
2022-12-09 20:25:01 +07:00
Steve Markgraf c7b7b20ac6 fw: fix TIFFS geometry for Sony Ericsson K220i phones
Change-Id: Ic426c9bc01733ff923f33cafe8012f9068b709ef
2022-12-09 20:24:31 +07:00
Steve Markgraf d78f88c25a fw: Add initial support for Sony Ericsson K200i/K220i phones
Includes RF frontend configuration, TIFFS config, keymap.

Currently still using the rf_tables and afcparams from gta0x.
No display driver yet.

Make sure to run osmocon with -m romload -i 10

Change-Id: I711702862b1cec5a8089dac071f8a171ca026003
2022-12-09 12:30:55 +00:00
Vadim Yanitskiy 10eeb3cac9 firmware: remove TCH/F specific bit re-ordering
This is a partial revert of d49a748cbb.

The GAPK based audio I/O implementation of the mobile app is now capable
of handling TI's specific TCH frame format, which can be configured via
the VTY interface ('io-tch-format ti').  Thus there is no need to have
the conversion logic in the firmware anymore.

This patch also fixes the layer1 firmware, so it does not hang on
receipt of Uplink TCH frames anymore when compiled with recent
arm-none-eabi toolchain (v12.2.0 on my machine).

Change-Id: I5afd4e4ddd9c06d32768d01bc1e3e18d476706fb
Related: OS#3400
2022-12-06 06:28:56 +07:00
Vadim Yanitskiy edc12b2a5c fixup: firmware/layer1: introduce experimental PDCH support
This regression was introduced with the experimental PDCH support
back in 2020.  In particular, I made a mistake in the l1s_nb_resp()
resetting rxnb.dl->link_id to 0x00 if MF_F_PTCCH is not set, which
is of course not set for non-PDCH channels.

Change-Id: I8593f9b001e669e7cd10cc42c05221a6037e8ae1
Fixes: 67c49ba664
Fixes: OS#5791, OS#5133
2022-11-25 19:04:41 +07:00
Pau Espin a53e93fe9c trxcon: Initial support for forwarding AMR
This allows TTCN3 L1CTL module (used in BTS_Tests) to transmit and
receive AMR payloads towards osmo-bts-trx.

Related: SYS#5987
Change-Id: Ia20bc96e39726a919a556c83c8be48cb31af7331
2022-09-07 00:01:53 +07:00
Vadim Yanitskiy 15247989f5 trx_toolkit: do not auto power on/off child MS Transceivers
By default, powering on/off a parent transceiver (child_idx=0) will
automatically power on/off its child transceivers (if any).  This
behavior is desirable for the BTS, but not for the MS Transceivers.

Additional MS Transceivers are going to be used by ttcn3-bts-test
for spawning multiple DCCH components in parallel.  We don't want
situations when one component powers off transceivers of the other
DCCH components - they must be independent.

Change-Id: I0cd6bac616273bed0e246ad48edc44fff484c589
2022-07-26 23:48:19 +07:00
Vadim Yanitskiy f6aada5f5f trx_toolkit: use **kwargs in Transceiver.__init__()
Change-Id: I65e85a2dc99e81e96d1b31b6bda5010b044b041d
2022-07-26 23:48:19 +07:00
Vadim Yanitskiy 8144470129 trx_toolkit: simplify Transceiver.power_event_handler()
Change-Id: I283f7ced0309bf823ad78c90e8006b9e9474dee7
2022-07-26 23:48:19 +07:00
Vadim Yanitskiy 4c0c88b40d firmware/layer1: clarify L1CTL_DM_EST_REQ related logging
Change-Id: I7a7fb32eab0ab20672a47861c3b66da92bd83015
2022-05-13 23:16:39 +03:00
Vadim Yanitskiy 627e4c4f6c firmware/battery: fix -Wunused-variable in battery_compal_e88_timer_cb()
Change-Id: I3e9bbc21aec57dea84034d233a2ba1902602bdb2
2022-04-25 16:18:04 +03:00
Vadim Yanitskiy 5ef597a7e1 firmware/apps/hello_world: remove unused test[] buffer
Change-Id: I20d41111d6f611202dcefada8091ccda0cc51dad
2022-04-25 16:17:28 +03:00
Vadim Yanitskiy 569ea1e9d2 firmware/apps/layer1: remove unused 'atrLength' in main()
Change-Id: I4bb1dae28c07218e8b801bc162b82d03fd083bad
2022-04-25 16:17:28 +03:00
Vadim Yanitskiy 17d6073e72 firmware/apps/rssi: remove redundant block in handle_pm()
Below in the common path for both true and false branches we do
have a conditional block setting ARFCN_UPLINK if uplink is true.

Change-Id: If3adc5d1f11d3f43cb4c17bdb355b160ab61dc56
2022-04-25 16:17:28 +03:00
Vadim Yanitskiy 8ecc266d8d firmware/apps/rssi: fix -Wmaybe-uninitialized in handle_pm()
In this function we have the following condition:

  if (pm_mode == PM_IDLE && (mode == MODE_MAIN || mode == MODE_SPECTRUM))

so the 'mode' can be either MODE_MAIN or MODE_SPECTRUM.  Still,
GCC throws false-positive warnings that 'a' and 'e' may be used
uninitialized in handle_pm().

Let's eliminate these warnings by using 'if-else' statement.

Change-Id: I86d241c41d4de135f4cd79f56f7fdd18696b7890
2022-04-25 16:14:35 +03:00
Vadim Yanitskiy 3f49d7a0fa firmware/layer1: fix unused variable 'l1h' [-Wunused-variable]
Change-Id: If8c3da3908c1dab7a93e69daee13426f9bdbccad
2022-04-25 16:14:21 +03:00
Vadim Yanitskiy 80ef655d00 firmware/layer1: fix 'MFNONE' not handled in switch [-Wswitch]
Change-Id: I4c38599b29de73e26e9b603564f63b88e65e16b9
2022-04-21 15:03:11 +03:00
Vadim Yanitskiy a6fad425db firmware/layer1: fix -Wtype-limits in chan_nr2mf_task_mask()
arm-none-eabi-gcc versions 11.2.0 shows the following warning:

  layer1/l23_api.c: In function 'chan_nr2mf_task_mask':
  layer1/l23_api.c:123:25: warning: comparison is always true due to
                                    limited range of data type [-Wtype-limits]
    123 |         if (second_task >= 0) /* optional */

Let's get rid of {master,second}_task by using a macro.

Change-Id: I00bd3e11a14f10b78fd91f0e6915ca4fc0817d6a
2022-04-21 15:03:11 +03:00
Vadim Yanitskiy 859485c681 firmware/abb: fix missing 'break' in twl3025_unit_enable()
Change-Id: I8224f8c2dba6891ef3fffcb6eed6572d35132d2e
2022-04-21 15:03:11 +03:00
Oliver Smith 1741372556 treewide: remove FSF address
Remove the paragraph about writing to the Free Software Foundation's
mailing address. The FSF has changed addresses in the past, and may do
so again. In 2021 this is not useful, let's rather have a bit less
boilerplate at the start of source files.

Change-Id: I73be012c01c0108fb6951dbff91d50eb19b40c51
2021-12-14 12:52:04 +00:00
Vadim Yanitskiy 00b70983a5 trx_toolkit: support setting artificial delay for TRXC
Change-Id: Idb1ef445bc14a6312f08a83ecacc3a938b0e1d70
Related: OS#5245
2021-10-03 14:13:51 +06:00
Vadim Yanitskiy e4d5bbccf9 trx_toolkit/transceiver.py: allow NOPE.ind on inactive timeslots
Change-Id: I27a3c8897cb82f6c264d34702c4ec64561bb9809
Related: SYS#5313, OS#1569
2021-06-16 15:05:40 +02:00
Vadim Yanitskiy c3c57d888e trx_toolkit: add primary/shadow indicator for TRXDv2 PDUs
Change-Id: I0a3ad4f0bda56b93e0ab8bf82b6b3758831edf60
Related: SYS#4895, OS#4941, OS#4006
2021-06-02 04:48:50 +02:00
Vadim Yanitskiy 1b7b4ec7a4 trx_toolkit: use RxMsg/TxMsg instead of TRX2L1/L12TRX
I intentionally do not use 'Downlink' and 'Uplink' terms in this project
because both MS and BTS transmit and receive on the opposite directions.
A burst coming from demodulator may be a Downlink or an Uplink burst
depending on the context, so we definitely need more precise terms.

Back then when I started to work on TRX toolkit, I decided to use the
'TRX2L1' and 'L12TRX' for receive and transmit directions respectively.
Now I find them hard to read, so let's replace them with 'Rx' and 'Tx'.

Change-Id: I688f24a3c09dd7e1cc00b5530ec26c8e8cfd8f7c
Related: OS#4006, SYS#4895
2021-05-03 20:39:10 +02:00
Vadim Yanitskiy b2349bc359 trx_toolkit/data_msg.py: remove obsolete documentation
We do have TRXC/TRXD documentation in osmo-gsm-manuals repository.
These big comments are out of sync with what we have in the manuals,
so let's better remove them to avoid maintaining docs in several places.

Change-Id: I47786cf3039f712efadc85bc4e1c3ae89e79ff25
Related: OS#4006, SYS#4895
2021-05-03 20:39:10 +02:00
Vadim Yanitskiy 87c5f2c92d trx_toolkit/data_msg.py: update entries in enum Modulation
Change-Id: Ia96b263bbb162b6c40f2cf81616118cc297299a5
Related: OS#4006, SYS#4895
2021-05-03 20:39:05 +02:00
Vadim Yanitskiy a4127f272a trx_toolkit/test_codec.py: add missing sub-test with key=0x88
Change-Id: If8e2ebedc48fecc4c54c71e40cadb0f3273602c5
2021-05-03 20:35:46 +02:00
Vadim Yanitskiy eac05ae644 trx_toolkit/ctrl_if_trx.py: fix undefined variable 'trx'
Change-Id: I5c06fa5183b4d04cbc0c68327a062b320477344c
2021-05-03 20:35:46 +02:00
Vadim Yanitskiy b988408166 trx_toolkit/fake_trx.py: use raw string notation for regex
This way there is no need to escape backslashes in regex.

Change-Id: I1b2b6675851275bd5285ffc287410535b22055ae
2021-05-03 20:35:46 +02:00
Vadim Yanitskiy bd73f0920d trx_toolkit/gsm_shared.py: s/GSM_BURST_LEN/GMSK_BURST_LEN/g
Change-Id: I7268196eb9fd822f0e7b65899e4c83c48a20ba5b
2021-04-30 22:31:40 +02:00
Vadim Yanitskiy a2618b789a trx_toolkit/trxd_proto.py: fix missing field name for codec.Spare
Change-Id: I110dbcebf86cf978f2de7275a91c48b999fade32
Fixes: I482f72fd9305c51f43a0339d03904fb693d90ac9
Related: OS#4006, SYS#4895
2021-04-30 22:31:40 +02:00
Vadim Yanitskiy 8fc13352aa trx_toolkit/trxd_proto.py: fix encoding of TRXDv0 Tx PDUs
Change-Id: I9da59f7e7c47dd1cac833839165ba05de6b18144
Related: OS#4006, SYS#4895
2021-04-30 22:31:40 +02:00
Vadim Yanitskiy 393158ac08 trx_toolkit: change coding of 'PWR' and 'SCPIR' fields
During an internal discussion, it was decided to keep field 'PWR'
as-is and move 'SCPIR' into a separate octet.  This is easier to
parse, less confusing, and would save us some CPU cycles.

Change-Id: I482f72fd9305c51f43a0339d03904fb693d90ac9
Related: OS#4006, SYS#4895
2021-04-15 21:51:11 +02:00