SHARE
TWEET

lewurm

a guest Aug 21st, 2009 317 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. on arm (mini:main.c):
  2.        
  3.         /* ... mini code */
  4.         gecko_printf("Going into IPC mainloop...\n");
  5.  
  6.         u32 time = read32(HW_TIMER);
  7.         u8 iii=10;
  8.         while(iii--) {
  9.                 write32(HW_TIMER, 0);
  10.                 s32 ii;
  11.                 for(ii=0; ii<60000; ii++){
  12.                         (void) read32(0xd050018); //ohci hcca
  13.                 }
  14.                 u32 tmp1 = read32(HW_TIMER);
  15.                 gecko_printf("timer read(@arm): 0x%08X\n", tmp1);
  16.         }
  17.         iii=10;
  18.         while(iii--) {
  19.                 write32(HW_TIMER, 0);
  20.                 s32 ii;
  21.                 for(ii=0; ii<60000; ii++){
  22.                         //(void) write32(AES_CMD, 0); //aes
  23.                         (void) write32(0xd050018, ii); //ohci hcca
  24.                 }
  25.                 u32 tmp1 = read32(HW_TIMER);
  26.                 gecko_printf("timer write(@arm): 0x%08X\n", tmp1);
  27.         }
  28.  
  29.         //don't confuse gecko_timer -> restore HW_TIMER
  30.         write32(HW_TIMER, time);
  31.  
  32.  
  33.        
  34.         vector = ipc_process_slow();
  35.         /* mini code ... */
  36.  
  37.  
  38. usbgecko output this:
  39. timer read(@arm): 0x0000B96B
  40. timer read(@arm): 0x0000B965
  41. timer read(@arm): 0x0000B965
  42. timer read(@arm): 0x0000B965
  43. timer read(@arm): 0x0000B964
  44. timer read(@arm): 0x0000B965
  45. timer read(@arm): 0x0000B965
  46. timer read(@arm): 0x0000B964
  47. timer read(@arm): 0x0000B965
  48. timer read(@arm): 0x0000B965
  49. timer write(@arm): 0x0000B965
  50. timer write(@arm): 0x0000B965
  51. timer write(@arm): 0x0000B965
  52. timer write(@arm): 0x0000B965
  53. timer write(@arm): 0x0000B965
  54. timer write(@arm): 0x0000B965
  55. timer write(@arm): 0x0000B965
  56. timer write(@arm): 0x0000B965
  57. timer write(@arm): 0x0000B965
  58. timer write(@arm): 0x0000B965
  59.  
  60.  
  61.  
  62.  
  63. on ppc (ppcskel:main.c):
  64. #define HW_TIMER (0xd800000 + 0x010)
  65.         u32 time = read32(HW_TIMER);
  66.  
  67.         u8 iii=10;
  68.         while(iii--) {
  69.                 write32(HW_TIMER, 0);
  70.                 s32 ii;
  71.                 for(ii=0; ii<60000; ii++){
  72.                         (void) read32(0xd050018); //ohci hcca
  73.                 }
  74.                 u32 tmp1 = read32(HW_TIMER);
  75.                 printf("timer read(@ppc): 0x%08X\n", tmp1);
  76.         }
  77.  
  78.         iii=10;
  79.         while(iii--) {
  80.                 write32(HW_TIMER, 0);
  81.                 s32 ii;
  82.                 for(ii=0; ii<60000; ii++){
  83.                         (void) write32(0xd050018, ii); //ohci hcca
  84.                 }
  85.                 u32 tmp1 = read32(HW_TIMER);
  86.                 printf("timer write(@ppc): 0x%08X\n", tmp1);
  87.         }
  88.  
  89.         //don't confuse gecko_timer -> restore HW_TIMER
  90.         write32(0xd800000 + 0x010, time);
  91.  
  92.  
  93.  
  94. usbgecko output this:
  95. timer read(@ppc): 0x0000B965
  96. timer read(@ppc): 0x0000B965
  97. timer read(@ppc): 0x0000B964
  98. timer read(@ppc): 0x0000B965
  99. timer read(@ppc): 0x0000B965
  100. timer read(@ppc): 0x0000B965
  101. timer read(@ppc): 0x0000B965
  102. timer read(@ppc): 0x0000B964
  103. timer read(@ppc): 0x0000B965
  104. timer read(@ppc): 0x0000B965
  105. timer write(@ppc): 0x0000B965
  106. timer write(@ppc): 0x0000B965
  107. timer write(@ppc): 0x0000B965
  108. timer write(@ppc): 0x0000B965
  109. timer write(@ppc): 0x0000B964
  110. timer write(@ppc): 0x0000B964
  111. timer write(@ppc): 0x0000B964
  112. timer write(@ppc): 0x0000B964
  113. timer write(@ppc): 0x0000B964
  114. timer write(@ppc): 0x0000B964
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top