Change in osmocom-bb[master]: firmware: calibration: split afcparams.c from rf_tables.c for gta0x

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Thu Oct 8 06:59:06 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/20325 )

Change subject: firmware: calibration: split afcparams.c from rf_tables.c for gta0x
......................................................................

firmware: calibration: split afcparams.c from rf_tables.c for gta0x

We have new hardware targets that have appeared since the original
OS#3582 patch was created, namely Huawei GTM900-B and the upcoming
FreeCalypso Caramel2 board.  These new targets need the same APC
offset as gta0x and fcdev3b (TI's original Leonardo value), they
have proper calibration records in their FFS (meaning that all
compiled-in numbers become no-effect placeholders), and their PA
tracts are similar enough to Openmoko/FCDEV3B to where even in the
absence of calibration OM/FC numbers are close enough.  Thus most
of the tables in board/gta0x/rf_tables.c should be reusable by
these new targets.

However, these new targets have quite different VCXOs from Openmoko
and FCDEV3B, thus they need different AFC parameters.  Thus we split
board/gta0x/afcparams.c from board/gta0x/rf_tables.c, making the
latter more reusable.

Related: OS#3582
Change-Id: I92e245843253f279dd6d61bd5098766694c5215f
---
M src/target/firmware/Makefile
A src/target/firmware/board/gta0x/afcparams.c
M src/target/firmware/board/gta0x/rf_tables.c
3 files changed, 55 insertions(+), 29 deletions(-)

Approvals:
  laforge: Looks good to me, but someone else must approve
  Vadim Yanitskiy: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/target/firmware/Makefile b/src/target/firmware/Makefile
index 6e51107..6eacb33 100644
--- a/src/target/firmware/Makefile
+++ b/src/target/firmware/Makefile
@@ -44,6 +44,7 @@
 # OpenMoko GTA0x
 BOARD_gta0x_OBJS=$(calypso_COMMON_OBJS) board/gta0x/init.o \
 	board/gta0x/rffe_gta0x_triband.o board/gta0x/rf_tables.o \
+	board/gta0x/afcparams.o \
 	board/common/readcal_tiffs.o battery/dummy.o $(FB_dummy_OBJS)
 BOARD_gta0x_ENVIRONMENTS=highram
 
@@ -56,6 +57,7 @@
 # FreeCalypso FCDEV3B
 BOARD_fcdev3b_OBJS=$(calypso_COMMON_OBJS) board/fcdev3b/init.o \
 	board/gta0x/rffe_gta0x_triband.o board/gta0x/rf_tables.o \
+	board/gta0x/afcparams.o \
 	board/common/readcal_tiffs.o battery/dummy.o $(FB_dummy_OBJS)
 BOARD_fcdev3b_ENVIRONMENTS=highram
 
diff --git a/src/target/firmware/board/gta0x/afcparams.c b/src/target/firmware/board/gta0x/afcparams.c
new file mode 100644
index 0000000..ba48360
--- /dev/null
+++ b/src/target/firmware/board/gta0x/afcparams.c
@@ -0,0 +1,53 @@
+/*
+ * This code was written by Mychaela Falconia <falcon at freecalypso.org>
+ * who refuses to claim copyright on it and has released it as public domain
+ * instead. NO rights reserved, all rights relinquished.
+ *
+ * Tweaked (coding style changes) by Vadim Yanitskiy <axilirator at gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ */
+
+#include <stdint.h>
+#include <rf/vcxocal.h>
+
+/*
+ * Here is a typical set of AFC Psi parameters for an FCDEV3B modem board,
+ * computed by FreeCalypso fc-rfcal-vcxo calibration tool from frequency
+ * offset measurements made with a CMU200 RF tester:
+ *
+ * Psi_sta_inv: 3462
+ * Psi_st: 15
+ * Psi_st_32: 992326
+ * Psi_st_inv: 4328
+ *
+ * The following AFC slope number is the closest OsmocomBB-style afc_slope
+ * integer corresponding to these Psi numbers; the true value is somewhere
+ * between 454 and 455.
+ *
+ * This AFC slope setting is expected to be correct for both Openmoko and
+ * FreeCalypso hardware as we use the same VCXO components as were used
+ * by Openmoko.
+ */
+int16_t afc_slope = 454;
+
+/*
+ * The compiled-in AFC initial DAC value below is the same as was used by
+ * the old OsmocomBB code written for Mot C1xx phones, but it will normally
+ * be overridden by the per-unit factory calibration value read from the
+ * /gsm/rf/afcdac file in FFS.
+ */
+int16_t afc_initial_dac_value = -700;
diff --git a/src/target/firmware/board/gta0x/rf_tables.c b/src/target/firmware/board/gta0x/rf_tables.c
index fd33b16..9a08b3c 100644
--- a/src/target/firmware/board/gta0x/rf_tables.c
+++ b/src/target/firmware/board/gta0x/rf_tables.c
@@ -23,35 +23,6 @@
 
 #include <stdint.h>
 #include <rf/txcal.h>
-#include <rf/vcxocal.h>
-
-/*
- * Here is a typical set of AFC Psi parameters for an FCDEV3B modem board,
- * computed by FreeCalypso fc-rfcal-vcxo calibration tool from frequency
- * offset measurements made with a CMU200 RF tester:
- *
- * Psi_sta_inv: 3462
- * Psi_st: 15
- * Psi_st_32: 992326
- * Psi_st_inv: 4328
- *
- * The following AFC slope number is the closest OsmocomBB-style afc_slope
- * integer corresponding to these Psi numbers; the true value is somewhere
- * between 454 and 455.
- *
- * This AFC slope setting is expected to be correct for both Openmoko and
- * FreeCalypso hardware as we use the same VCXO components as were used
- * by Openmoko.
- */
-int16_t afc_slope = 454;
-
-/*
- * The compiled-in AFC initial DAC value below is the same as was used by
- * the old OsmocomBB code written for Mot C1xx phones, but it will normally
- * be overridden by the per-unit factory calibration value read from the
- * /gsm/rf/afcdac file in FFS.
- */
-int16_t afc_initial_dac_value = -700;
 
 /* APC offset (comes from the official firmware) for TI-classic targets */
 uint8_t apc_offset = 48;

-- 
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/20325
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I92e245843253f279dd6d61bd5098766694c5215f
Gerrit-Change-Number: 20325
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201008/d0dbc767/attachment.htm>


More information about the gerrit-log mailing list