Guest User

Untitled

a guest
Jun 19th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.19 KB | None | 0 0
  1. Index: apps/plugins/SOURCES
  2. ===================================================================
  3. --- apps/plugins/SOURCES (revision 21087)
  4. +++ apps/plugins/SOURCES (working copy)
  5. @@ -1,4 +1,9 @@
  6. /* plugins common to all models */
  7. +
  8. +test_codec.c
  9. +test_disk.c
  10. +test_fps.c
  11. +
  12. chessclock.c
  13. credits.c
  14. cube.c
  15. Index: firmware/target/arm/as3525/debug-as3525.c
  16. ===================================================================
  17. --- firmware/target/arm/as3525/debug-as3525.c (revision 21087)
  18. +++ firmware/target/arm/as3525/debug-as3525.c (working copy)
  19. @@ -28,6 +28,7 @@
  20. #include "sprintf.h"
  21. #include "cpu.h"
  22. #include "pl180.h"
  23. +#include "sd.h"
  24.  
  25. #define _DEBUG_PRINTF(a,varargs...) \
  26. snprintf(buf, sizeof(buf), (a), ##varargs); lcd_puts(0,line++,buf)
  27. @@ -339,10 +340,11 @@
  28. {
  29. char buf[50];
  30. int line;
  31. + char buf2[512*2];
  32.  
  33. lcd_clear_display();
  34. lcd_setfont(FONT_SYSFIXED);
  35. -
  36. + sd_read_sectors(0, 0x7A7800 - 1, 2, buf2);
  37. while(1)
  38. {
  39. line = 0;
  40. @@ -359,6 +361,7 @@
  41. line++;
  42. _DEBUG_PRINTF("[CP15]");
  43. _DEBUG_PRINTF("CP15: 0x%8x", read_cp15());
  44. + _DEBUG_PRINTF("DIR0: %x DIR4: %x", *(buf2+512), *(buf2+512+4));
  45. lcd_update();
  46. if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL))
  47. break;
  48. Index: firmware/target/arm/as3525/ata_sd_as3525.c
  49. ===================================================================
  50. --- firmware/target/arm/as3525/ata_sd_as3525.c (revision 21087)
  51. +++ firmware/target/arm/as3525/ata_sd_as3525.c (working copy)
  52. @@ -142,8 +142,8 @@
  53. GPIOA_IC = (1<<2);
  54. timeout_register(&sd1_oneshot, sd1_oneshot_callback, (3*HZ/10), 0);
  55. }
  56. -#endif
  57. -#endif
  58. +#endif /* defined(SANSA_E200V2) || defined(SANSA_FUZE) */
  59. +#endif /* HAVE_HOTSWAP */
  60.  
  61. void INT_NAND(void)
  62. {
  63. @@ -211,7 +211,7 @@
  64. { /* resp received */
  65. if(flags & MCI_LONG_RESP)
  66. {
  67. - /* store the response in little endian order for the words */
  68. + /* store the response in reverse words order */
  69. response[0] = MCI_RESP3(drive);
  70. response[1] = MCI_RESP2(drive);
  71. response[2] = MCI_RESP1(drive);
  72. @@ -322,7 +322,7 @@
  73.  
  74. card_info[drive].initialized = 1;
  75.  
  76. - MCI_CLOCK(drive) |= MCI_CLOCK_BYPASS; /* full speed */
  77. + MCI_CLOCK(drive) |= MCI_CLOCK_BYPASS; /* full speed for controller clock */
  78. mci_delay();
  79.  
  80. /*
  81. @@ -627,7 +627,6 @@
  82. const int drive = 0;
  83. #endif
  84. int ret = 0;
  85. - int bank;
  86. bool unaligned_transfer = (int)buf & 3;
  87.  
  88. /* skip SanDisk OF */
  89. @@ -648,29 +647,10 @@
  90.  
  91. last_disk_activity = current_tick;
  92.  
  93. - /* Only switch banks for internal storage */
  94. - if(drive == INTERNAL_AS3525)
  95. - {
  96. - bank = start / BLOCKS_PER_BANK;
  97. -
  98. - if(card_info[INTERNAL_AS3525].current_bank != bank)
  99. - {
  100. - ret = sd_select_bank(bank);
  101. - if (ret < 0)
  102. - {
  103. - ret -= 20;
  104. - goto sd_transfer_error;
  105. - }
  106. - }
  107. -
  108. - start -= bank * BLOCKS_PER_BANK;
  109. - }
  110. -
  111. -
  112. ret = sd_wait_for_state(drive, SD_TRAN);
  113. if (ret < 0)
  114. {
  115. - ret -= 2*20;
  116. + ret -= 20;
  117. goto sd_transfer_error;
  118. }
  119.  
  120. @@ -684,13 +664,35 @@
  121. void *dma_buf;
  122. const int cmd =
  123. write ? SD_WRITE_MULTIPLE_BLOCK : SD_READ_MULTIPLE_BLOCK;
  124. - int arg = start;
  125. - if(!(card_info[drive].ocr & (1<<30))) /* not SDHC */
  126. - arg *= BLOCK_SIZE;
  127. + unsigned long bank_start = start;
  128.  
  129. /* Interrupt handler might set this to true during transfer */
  130. retry = false;
  131.  
  132. + /* Only switch banks for internal storage */
  133. + if(drive == INTERNAL_AS3525)
  134. + {
  135. + int bank = start / BLOCKS_PER_BANK; /* Current bank */
  136. +
  137. + /* Switch bank if needed */
  138. + if(card_info[INTERNAL_AS3525].current_bank != bank)
  139. + {
  140. + ret = sd_select_bank(bank);
  141. + if (ret < 0)
  142. + {
  143. + ret -= 2*20;
  144. + goto sd_transfer_error;
  145. + }
  146. + }
  147. +
  148. + /* Adjust start block in current bank */
  149. + bank_start -= bank * BLOCKS_PER_BANK;
  150. +
  151. + /* Do not cross a bank boundary in a single transfer loop */
  152. + if((transfer + bank_start) >= BLOCKS_PER_BANK)
  153. + transfer = BLOCKS_PER_BANK - bank_start;
  154. + }
  155. +
  156. if(unaligned_transfer)
  157. {
  158. dma_buf = aligned_buffer;
  159. @@ -699,10 +701,14 @@
  160. if(write)
  161. memcpy(aligned_buffer, buf, transfer * SECTOR_SIZE);
  162. }
  163. - else
  164. + else /* Aligned transfers are faster : no memcpy */
  165. dma_buf = buf;
  166.  
  167. - if(!send_cmd(drive, cmd, arg, MCI_ARG, NULL))
  168. + /* Set bank_start to the correct unit (blocks or bytes) */
  169. + if(!(card_info[drive].ocr & (1<<30))) /* not SDHC */
  170. + bank_start *= BLOCK_SIZE;
  171. +
  172. + if(!send_cmd(drive, cmd, bank_start, MCI_ARG, NULL))
  173. {
  174. ret -= 3*20;
  175. goto sd_transfer_error;
Add Comment
Please, Sign In to add comment