comparison src/cs/drivers/drv_app/sim/sim.c @ 662:8cd8fd15a095

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.
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 24 May 2020 05:02:28 +0000
parents 945cf7f506b2
children
comparison
equal deleted inserted replaced
661:ba45f6514fb1 662:8cd8fd15a095
34 #include "sim.h" 34 #include "sim.h"
35 #include <string.h> 35 #include <string.h>
36 #include "armio/armio.h" 36 #include "armio/armio.h"
37 #include "ind_os.h" 37 #include "ind_os.h"
38 #include "abb/abb.h" //controls level shifter of ABB 38 #include "abb/abb.h" //controls level shifter of ABB
39 #include "ffs/ffs_api.h" /* FreeCalypso addition */
39 40
40 41
41 //current voltage mode 3V or 5V, or 1.8V 42 //current voltage mode 3V or 5V, or 1.8V
42 SYS_UWORD8 CurrentVolt; 43 SYS_UWORD8 CurrentVolt;
44
45 /* FreeCalypso addition */
46 SYS_UWORD8 SIM_allow_speed_enhancement = 1;
43 47
44 48
45 49
46 #ifdef SIM_DEBUG_TRACE 50 #ifdef SIM_DEBUG_TRACE
47 51
913 { 917 {
914 int n; 918 int n;
915 SIM_PORT *p; 919 SIM_PORT *p;
916 volatile SYS_UWORD32 dum; 920 volatile SYS_UWORD32 dum;
917 921
922 /* FreeCalypso addition */
923 ffs_file_read("/etc/SIM_spenh", &SIM_allow_speed_enhancement, 1);
924
918 // Initialize registers 925 // Initialize registers
919 p = &(Sim[0]); 926 p = &(Sim[0]);
920 p->c = (SIM_CONTROLLER *) SIM_CMD; 927 p->c = (SIM_CONTROLLER *) SIM_CMD;
921 928
922 p->errorSIM = 0; 929 p->errorSIM = 0;
2438 { 2445 {
2439 SIM_Calcetu (p); 2446 SIM_Calcetu (p);
2440 return (0); 2447 return (0);
2441 } 2448 }
2442 2449
2443 #if 0 // Dmitriy: removed by TI patch 2450 if (TA1 >= 0x94 && SIM_allow_speed_enhancement)
2444 if (TA1 >= 0x94) //speed enhancement
2445 { 2451 {
2446 // JYT 26/9/2003 to check correct behavior of the SIM Driver vs the PPS. 2452 // JYT 26/9/2003 to check correct behavior of the SIM Driver vs the PPS.
2447 //#ifdef NOTTOLOADBECAUSENOTTESTED 2453 //#ifdef NOTTOLOADBECAUSENOTTESTED
2448 // SIM_Calcetu (p); 2454 // SIM_Calcetu (p);
2449 // return (0); //temporary disabling of speed enhancement feature 2455 // return (0); //temporary disabling of speed enhancement feature
2454 p->xbuf[1] = 0x10; 2460 p->xbuf[1] = 0x10;
2455 p->xbuf[2] = 0x94; // if speed enhancement, then at least (and at most) F = 512 and D = 8 is supported 2461 p->xbuf[2] = 0x94; // if speed enhancement, then at least (and at most) F = 512 and D = 8 is supported
2456 } 2462 }
2457 //#endif 2463 //#endif
2458 } 2464 }
2459 #endif
2460 2465
2461 if ((TA1 == 0x11) || (TA1 == 0x01)) 2466 if ((TA1 == 0x11) || (TA1 == 0x01))
2462 { 2467 {
2463 SIM_Calcetu (p); 2468 SIM_Calcetu (p);
2464 return (0); 2469 return (0);