changeset 195:2863e5e4af4f

sim.c: speed enhancement change from Magnetite
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 24 May 2020 19:34:29 +0000
parents a18bf8df5fab
children 5f3544fc0308
files src/cs/drivers/drv_app/sim/sim.c
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/cs/drivers/drv_app/sim/sim.c	Sat May 23 07:21:43 2020 +0000
+++ b/src/cs/drivers/drv_app/sim/sim.c	Sun May 24 19:34:29 2020 +0000
@@ -36,11 +36,15 @@
 #include "armio/armio.h"
 #include "ind_os.h"
 #include "abb/abb.h"                     //controls level shifter of ABB
+#include "ffs/ffs_api.h"		 /* FreeCalypso addition */
 
 
 //current voltage mode 3V or 5V, or 1.8V
 SYS_UWORD8            CurrentVolt;
 
+/* FreeCalypso addition */
+SYS_UWORD8 SIM_allow_speed_enhancement = 1;
+
 
 
 #ifdef SIM_DEBUG_TRACE
@@ -915,6 +919,9 @@
     SIM_PORT *p;
     volatile SYS_UWORD32 dum;
 
+    /* FreeCalypso addition */
+    ffs_file_read("/etc/SIM_spenh", &SIM_allow_speed_enhancement, 1);
+
     // Initialize registers 
     p = &(Sim[0]);
     p->c = (SIM_CONTROLLER *) SIM_CMD;
@@ -2440,8 +2447,7 @@
         return (0);
     }
 
-#if 0 // Dmitriy: removed by TI patch
-    if (TA1 >= 0x94)        //speed enhancement
+    if (TA1 >= 0x94 && SIM_allow_speed_enhancement)
     {
 // JYT 26/9/2003 to check correct behavior of the SIM Driver vs the PPS.
 //#ifdef NOTTOLOADBECAUSENOTTESTED
@@ -2456,7 +2462,6 @@
         }
 //#endif
     }
-#endif
 
     if ((TA1 == 0x11) || (TA1 == 0x01))
     {