changeset 20:a1d085f6d7e9

ati_bas.c: same MokoFFS hack as implemented in FreeCalypso Citrine
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 23 Sep 2016 16:52:05 +0000
parents 340f85ab71c1
children 0f832c4c3db8
files g23m/condat/ms/src/aci/ati_bas.c
diffstat 1 files changed, 17 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/g23m/condat/ms/src/aci/ati_bas.c	Fri Sep 23 06:16:09 2016 +0000
+++ b/g23m/condat/ms/src/aci/ati_bas.c	Fri Sep 23 16:52:05 2016 +0000
@@ -73,6 +73,8 @@
 
 #endif /*FF_ATI_BAT*/
 
+#include "fc-target.cfg"
+
 LOCAL T_ATI_RSLT aciPrcsPlusCG (UBYTE srcId, CHAR* cl, CHAR* ef);
 LOCAL T_ATI_RSLT setaciPrcsVolLevel ( CHAR* cl, UBYTE device );
 LOCAL T_ATI_RSLT tesaciPrcsVolLevel ( UBYTE srcId, CHAR* cl, UBYTE device );
@@ -2182,6 +2184,7 @@
 {
   pcm_FileInfo_Type fileInfo;
   USHORT i;
+  char *cp;
 
   TRACE_FUNCTION("aciPrcsPlusCG()");
 
@@ -2203,6 +2206,20 @@
     i++;
   g_sa[i] = '\0';
 
+#if CONFIG_MOKOFFS
+  /*
+   * Openmoko's FFS has a /pcm/CGMR file programmed like this:
+   *
+   *   GTA02BV4/Moko5
+   *
+   * When queried for +CGMR, we would like to report the hardware revision
+   * from FFS, but also tell the user that we are FreeCalypso and not Moko5.
+   * Hence the following hack.
+   */
+  if ((cp = strchr(g_sa, '/')) && !strncmp(cp + 1, "Moko", 4))
+    strcpy(cp + 1, "FreeCalypso");
+#endif
+
   io_sendMessage (srcId, g_sa, ATI_NORMAL_OUTPUT );
 
   return ATI_CMPL;