comparison src/cs/drivers/drv_app/sim/sim.c @ 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 b6a5e36de839
children
comparison
equal deleted inserted replaced
194:a18bf8df5fab 195:2863e5e4af4f
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);