summaryrefslogtreecommitdiffstats
path: root/src/target/firmware/apps/layer1/main.c
diff options
context:
space:
mode:
authorMychaela Falconia <mychaela.falconia@gmail.com>2020-09-27 12:38:31 +0200
committerHarald Welte <laforge@osmocom.org>2020-10-01 01:48:37 +0200
commit905c602373d92ace5a08832a6e18462cd1e3426b (patch)
treeff975a3c7966972f23d29d090588f4b1a52b4ca0 /src/target/firmware/apps/layer1/main.c
parentd5ff117066f136a2843d380b607afe901a2313a9 (diff)
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
Diffstat (limited to 'src/target/firmware/apps/layer1/main.c')
-rw-r--r--src/target/firmware/apps/layer1/main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/target/firmware/apps/layer1/main.c b/src/target/firmware/apps/layer1/main.c
index 59ffe972..b2e66e2c 100644
--- a/src/target/firmware/apps/layer1/main.c
+++ b/src/target/firmware/apps/layer1/main.c
@@ -33,6 +33,7 @@
#include <abb/twl3025.h>
#include <rf/trf6151.h>
+#include <rf/readcal.h>
#include <comm/sercomm.h>
#include <comm/timer.h>
@@ -106,6 +107,7 @@ int main(void)
memset(atr,0,sizeof(atr));
atrLength = calypso_sim_powerup(atr);
+ read_factory_rf_calibration();
layer1_init();
tpu_frame_irq_en(1, 1);