Change in osmocom-bb[master]: firmware: calibration: proper support for gtm900b target

2020-10-07 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/20326 )

Change subject: firmware: calibration: proper support for gtm900b target
..

firmware: calibration: proper support for gtm900b target

GTM900-B can share almost all calibration tables with GTA0x and FCDEV3B,
only the VCXO is significantly different.

Related: OS#3582
Change-Id: I52b63b1d086452139b1efd308d47a4183eace745
---
M src/target/firmware/Makefile
A src/target/firmware/board/gtm900b/afcparams.c
D src/target/firmware/board/gtm900b/rf_tables.c
3 files changed, 49 insertions(+), 596 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 6eacb33..104ddac 100644
--- a/src/target/firmware/Makefile
+++ b/src/target/firmware/Makefile
@@ -50,7 +50,8 @@

 # Huawei GTM900-B
 BOARD_gtm900b_OBJS=$(calypso_COMMON_OBJS) board/gtm900b/init.o \
-   board/gtm900b/rffe_gtm900b.o board/gtm900b/rf_tables.o \
+   board/gtm900b/rffe_gtm900b.o board/gta0x/rf_tables.o \
+   board/gtm900b/afcparams.o \
board/common/readcal_tiffs.o battery/dummy.o $(FB_dummy_OBJS)
 BOARD_gtm900b_ENVIRONMENTS=highram

diff --git a/src/target/firmware/board/gtm900b/afcparams.c 
b/src/target/firmware/board/gtm900b/afcparams.c
new file mode 100644
index 000..ca8908d
--- /dev/null
+++ b/src/target/firmware/board/gtm900b/afcparams.c
@@ -0,0 +1,47 @@
+/*
+ * This code was written by Mychaela Falconia 
+ * who refuses to claim copyright on it and has released it as public domain
+ * instead. NO rights reserved, all rights relinquished.
+ *
+ * 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 
+#include 
+
+/*
+ * Here is a representative set of AFC Psi parameters that has been
+ * calibrated by Huawei on a GTM900-B MGC2GSMT module, as recorded
+ * in the /gsm/rf/afcparams file:
+ *
+ * Psi_sta_inv: 13626
+ * Psi_st: 4
+ * Psi_st_32: 252168
+ * Psi_st_inv: 17032
+ *
+ * The following AFC slope number is the closest OsmocomBB-style afc_slope
+ * integer corresponding to these Psi numbers; the true value is somewhere
+ * between 115 and 116.
+ */
+int16_t afc_slope = 115;
+
+/*
+ * 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/gtm900b/rf_tables.c 
b/src/target/firmware/board/gtm900b/rf_tables.c
deleted file mode 100644
index 7f5b0fd..000
--- a/src/target/firmware/board/gtm900b/rf_tables.c
+++ /dev/null
@@ -1,595 +0,0 @@
-/*
- * This code was written by Mychaela Falconia 
- * 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 
- *
- * 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 
-#include 
-#include 
-
-/* FIXME those are from the Compal phones, do measurements with the GTM900-B */
-
-/*
- * The following AFC initial DAC value and AFC slope settings are unchanged
- * from the old OsmocomBB code in which they were hard-coded in layer1/afc.c.
- * This AFC slope setting corresponds very closely to the original Leonardo
- * Psi values which are used by Motorola's official fw at least on the C139,
- * 

Change in osmocom-bb[master]: firmware: calibration: proper support for gtm900b target

2020-10-07 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/20326 )

Change subject: firmware: calibration: proper support for gtm900b target
..


Patch Set 2: Code-Review+2


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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I52b63b1d086452139b1efd308d47a4183eace745
Gerrit-Change-Number: 20326
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Wed, 07 Oct 2020 17:36:41 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmocom-bb[master]: firmware: calibration: proper support for gtm900b target

2020-09-30 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/20326 )

Change subject: firmware: calibration: proper support for gtm900b target
..


Patch Set 2: Code-Review+1


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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I52b63b1d086452139b1efd308d47a4183eace745
Gerrit-Change-Number: 20326
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Thu, 01 Oct 2020 00:02:55 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmocom-bb[master]: firmware: calibration: proper support for gtm900b target

2020-09-30 Thread laforge
Hello Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmocom-bb/+/20326

to look at the new patch set (#2).

Change subject: firmware: calibration: proper support for gtm900b target
..

firmware: calibration: proper support for gtm900b target

GTM900-B can share almost all calibration tables with GTA0x and FCDEV3B,
only the VCXO is significantly different.

Related: OS#3582
Change-Id: I52b63b1d086452139b1efd308d47a4183eace745
---
M src/target/firmware/Makefile
A src/target/firmware/board/gtm900b/afcparams.c
D src/target/firmware/board/gtm900b/rf_tables.c
3 files changed, 49 insertions(+), 596 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/26/20326/2
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/20326
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I52b63b1d086452139b1efd308d47a4183eace745
Gerrit-Change-Number: 20326
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newpatchset


Change in osmocom-bb[master]: firmware: calibration: proper support for gtm900b target

2020-09-30 Thread laforge
laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/20326 )


Change subject: firmware: calibration: proper support for gtm900b target
..

firmware: calibration: proper support for gtm900b target

GTM900-B can share almost all calibration tables with GTA0x and FCDEV3B,
only the VCXO is significantly different.

Related: OS#3582
Change-Id: I52b63b1d086452139b1efd308d47a4183eace745
---
M src/target/firmware/Makefile
A src/target/firmware/board/gtm900b/afcparams.c
D src/target/firmware/board/gtm900b/rf_tables.c
3 files changed, 49 insertions(+), 596 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/26/20326/1

diff --git a/src/target/firmware/Makefile b/src/target/firmware/Makefile
index 6eacb33..104ddac 100644
--- a/src/target/firmware/Makefile
+++ b/src/target/firmware/Makefile
@@ -50,7 +50,8 @@

 # Huawei GTM900-B
 BOARD_gtm900b_OBJS=$(calypso_COMMON_OBJS) board/gtm900b/init.o \
-   board/gtm900b/rffe_gtm900b.o board/gtm900b/rf_tables.o \
+   board/gtm900b/rffe_gtm900b.o board/gta0x/rf_tables.o \
+   board/gtm900b/afcparams.o \
board/common/readcal_tiffs.o battery/dummy.o $(FB_dummy_OBJS)
 BOARD_gtm900b_ENVIRONMENTS=highram

diff --git a/src/target/firmware/board/gtm900b/afcparams.c 
b/src/target/firmware/board/gtm900b/afcparams.c
new file mode 100644
index 000..ca8908d
--- /dev/null
+++ b/src/target/firmware/board/gtm900b/afcparams.c
@@ -0,0 +1,47 @@
+/*
+ * This code was written by Mychaela Falconia 
+ * who refuses to claim copyright on it and has released it as public domain
+ * instead. NO rights reserved, all rights relinquished.
+ *
+ * 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 
+#include 
+
+/*
+ * Here is a representative set of AFC Psi parameters that has been
+ * calibrated by Huawei on a GTM900-B MGC2GSMT module, as recorded
+ * in the /gsm/rf/afcparams file:
+ *
+ * Psi_sta_inv: 13626
+ * Psi_st: 4
+ * Psi_st_32: 252168
+ * Psi_st_inv: 17032
+ *
+ * The following AFC slope number is the closest OsmocomBB-style afc_slope
+ * integer corresponding to these Psi numbers; the true value is somewhere
+ * between 115 and 116.
+ */
+int16_t afc_slope = 115;
+
+/*
+ * 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/gtm900b/rf_tables.c 
b/src/target/firmware/board/gtm900b/rf_tables.c
deleted file mode 100644
index 7f5b0fd..000
--- a/src/target/firmware/board/gtm900b/rf_tables.c
+++ /dev/null
@@ -1,595 +0,0 @@
-/*
- * This code was written by Mychaela Falconia 
- * 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 
- *
- * 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 
-#include 
-#include 
-
-/* FIXME those are from the Compal phones, do measurements with the GTM900-B */
-
-/*
- * The following AFC initial DAC value and AFC slope settings are unchanged
- * from the old OsmocomBB code in which they were hard-coded in layer1/afc.c.
- * This AFC slope setting corresponds very closely to the original Leonardo
- * Psi values which are used by Motorola's official fw at least on the C139,
- * hence I have good reason to believe that they are indeed