firmware: implement reading of factory RF calibration values
commit905c602373d92ace5a08832a6e18462cd1e3426b
authorMychaela Falconia <mychaela.falconia@gmail.com>
Sun, 27 Sep 2020 10:38:31 +0000 (27 12:38 +0200)
committerHarald Welte <laforge@osmocom.org>
Wed, 30 Sep 2020 23:48:37 +0000 (1 01:48 +0200)
treeff975a3c7966972f23d29d090588f4b1a52b4ca0
parentd5ff117066f136a2843d380b607afe901a2313a9
firmware: implement reading of factory RF calibration values

Since If6e212baeb10953129fb0d5253d263567f5e12d6, we can read the TIFFS
file-system, thus we can read and use the factory RF calibration values.

  * Implement parsing of factory RF calibration values for Motorola C1xx,
    Openmoko GTA0x, Pirelli DP-L10, and upcoming FCDEV3B targets.

  * Remove the old Tx power level control code and tables, and replace
    them with new logic that exactly matches what the official chipset
    firmware (TI/FreeCalypso) does, using tables in TI/FreeCalypso
    format. Compiled-in tables serve as a fallback and match each
    target's respective original firmware.

  * Use individual AFC slope values for different targets. The original
    value was/is only correct for the Mot C1xx family, whereas
    GTA0x/FCDEV3B and Pirelli DP-L10 need different values because
    Openmoko's VCXO (copied on the FCDEV3B) and Pirelli's VCTCXO
    are different from what Motorola used.

  * Take the initial AFC DAC value for the FB search from factory
    calibration records on those targets on which it has been
    calibrated per unit at the factory.

  * Use individual APC offset for different targets instead of
    the hard-coded value. The Mot/Compal's and Pirelli's firmwares
    (both heavily modified relative to TI) use different APC offset
    settings: 32 for Compal and 0 for Pirelli, while Openmoko and
    FreeCalypso devices use 48.

Change-Id: Icf2693b751d86ec1d2563412d606c13d4c91a806
Related: OS#3582
29 files changed:
src/target/firmware/Makefile
src/target/firmware/apps/layer1/main.c
src/target/firmware/apps/rssi/main.c
src/target/firmware/board/common/readcal_tiffs.c [new file with mode: 0644]
src/target/firmware/board/common/tx_calchan.c [new file with mode: 0644]
src/target/firmware/board/compal/readcal_common.c [new file with mode: 0644]
src/target/firmware/board/compal/readcal_small.c [new file with mode: 0644]
src/target/firmware/board/compal/rf_power.c [deleted file]
src/target/firmware/board/compal/rf_tables.c [new file with mode: 0644]
src/target/firmware/board/compal_e86/tx_ramps.c [new file with mode: 0644]
src/target/firmware/board/compal_e88/tx_ramps.c [new file with mode: 0644]
src/target/firmware/board/compal_e99/readcal.c [new file with mode: 0644]
src/target/firmware/board/gta0x/rf_power.c [deleted file]
src/target/firmware/board/gta0x/rf_tables.c [new file with mode: 0644]
src/target/firmware/board/gta0x/rffe_gta0x_triband.c
src/target/firmware/board/gtm900b/rf_power.c [deleted file]
src/target/firmware/board/gtm900b/rf_tables.c [new file with mode: 0644]
src/target/firmware/board/pirelli_dpl10/readcal.c [new file with mode: 0644]
src/target/firmware/board/pirelli_dpl10/rf_power.c [deleted file]
src/target/firmware/board/pirelli_dpl10/rf_tables.c [new file with mode: 0644]
src/target/firmware/board/se_j100/tx_ramps.c [new file with mode: 0644]
src/target/firmware/include/layer1/apc.h [deleted file]
src/target/firmware/include/rf/readcal.h [new file with mode: 0644]
src/target/firmware/include/rf/txcal.h [new file with mode: 0644]
src/target/firmware/include/rf/vcxocal.h [new file with mode: 0644]
src/target/firmware/layer1/Makefile
src/target/firmware/layer1/afc.c
src/target/firmware/layer1/apc.c [deleted file]
src/target/firmware/layer1/sync.c