# HG changeset patch # User Mychaela Falconia # Date 1590296548 0 # Node ID 8cd8fd15a095c8dd05c5f2ed5825b9cc6f6afa0d # Parent ba45f6514fb16922f64fbf53a401055ce901055d SIM speed enhancement re-enabled and made configurable TI's original code supported SIM speed enhancement, but Openmoko had it disabled, and OM's disabling of speed enhancement somehow caused certain SIM cards to start working which didn't work before (OM's bug #666). Because our FC community is much smaller in year 2020 than OM's community was in their day, we are not able to find one of those #666-affected SIMs, thus the real issue they had encountered remains elusive. Thus our solution is to re-enable SIM speed enhancement and simply wait for if and when someone runs into a #666-affected SIM once again. We provide a SIM_allow_speed_enhancement global variable that allows SIM speed enhancement to be enabled or disabled per session, and an /etc/SIM_spenh file in FFS that allows it to enabled or disabled on a non-volatile basis. SIM speed enhancement is now enabled by default. diff -r ba45f6514fb1 -r 8cd8fd15a095 src/cs/drivers/drv_app/sim/sim.c --- a/src/cs/drivers/drv_app/sim/sim.c Wed May 20 22:54:29 2020 +0000 +++ b/src/cs/drivers/drv_app/sim/sim.c Sun May 24 05:02:28 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)) {