Changeset 110 for sandbox/JamPlayerUSB/jbijtag.c
- Timestamp:
- Feb 6, 2011, 10:48:27 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/JamPlayerUSB/jbijtag.c
r109 r110 518 518 for (i = 0; i < 5; ++i) 519 519 { 520 jbi_jtag_io(TMS_HIGH, TDI_LOW, IGNORE_TDO , 0);520 jbi_jtag_io(TMS_HIGH, TDI_LOW, IGNORE_TDO); 521 521 } 522 522 … … 524 524 * Now step to Run Test / Idle 525 525 */ 526 jbi_jtag_io(TMS_LOW, TDI_LOW, IGNORE_TDO , 0);526 jbi_jtag_io(TMS_LOW, TDI_LOW, IGNORE_TDO); 527 527 528 528 jbi_jtag_state = IDLE; … … 562 562 (state == IRPAUSE)) 563 563 { 564 jbi_jtag_io(TMS_LOW, TDI_LOW, IGNORE_TDO , 0);564 jbi_jtag_io(TMS_LOW, TDI_LOW, IGNORE_TDO); 565 565 } 566 566 else if (state == RESET) 567 567 { 568 jbi_jtag_io(TMS_HIGH, TDI_LOW, IGNORE_TDO , 0);568 jbi_jtag_io(TMS_HIGH, TDI_LOW, IGNORE_TDO); 569 569 } 570 570 } … … 582 582 * Take a step 583 583 */ 584 jbi_jtag_io(tms, TDI_LOW, IGNORE_TDO , 0);584 jbi_jtag_io(tms, TDI_LOW, IGNORE_TDO); 585 585 586 586 if (tms) … … 641 641 tms = (wait_state == RESET) ? TMS_HIGH : TMS_LOW; 642 642 643 flag = (cycles % 8 != 0 || tms) ? 0 : 1; 644 645 for (count = 0L; count < cycles; count++) 646 { 647 jbi_jtag_io(tms, TDI_LOW, IGNORE_TDO, flag); 648 } 643 usb_blaster_wait(cycles, tms); 649 644 } 650 645 … … 778 773 { 779 774 case 0: /* IDLE */ 780 jbi_jtag_io(1, 0, 0 , 0); /* DRSELECT */781 jbi_jtag_io(0, 0, 0 , 0); /* DRCAPTURE */782 jbi_jtag_io(0, 0, 0 , 0); /* DRSHIFT */783 break; 784 785 case 1: 786 jbi_jtag_io(1, 0, 0 , 0); /* DREXIT2 */787 jbi_jtag_io(1, 0, 0 , 0); /* DRUPDATE */788 jbi_jtag_io(1, 0, 0 , 0); /* DRSELECT */789 jbi_jtag_io(0, 0, 0 , 0); /* DRCAPTURE */790 jbi_jtag_io(0, 0, 0 , 0); /* DRSHIFT */791 break; 792 793 case 2: 794 jbi_jtag_io(1, 0, 0 , 0); /* IREXIT2 */795 jbi_jtag_io(1, 0, 0 , 0); /* IRUPDATE */796 jbi_jtag_io(1, 0, 0 , 0); /* DRSELECT */797 jbi_jtag_io(0, 0, 0 , 0); /* DRCAPTURE */798 jbi_jtag_io(0, 0, 0 , 0); /* DRSHIFT */775 jbi_jtag_io(1, 0, 0); /* DRSELECT */ 776 jbi_jtag_io(0, 0, 0); /* DRCAPTURE */ 777 jbi_jtag_io(0, 0, 0); /* DRSHIFT */ 778 break; 779 780 case 1: /* DRPAUSE */ 781 jbi_jtag_io(1, 0, 0); /* DREXIT2 */ 782 jbi_jtag_io(1, 0, 0); /* DRUPDATE */ 783 jbi_jtag_io(1, 0, 0); /* DRSELECT */ 784 jbi_jtag_io(0, 0, 0); /* DRCAPTURE */ 785 jbi_jtag_io(0, 0, 0); /* DRSHIFT */ 786 break; 787 788 case 2: /* IRPAUSE */ 789 jbi_jtag_io(1, 0, 0); /* IREXIT2 */ 790 jbi_jtag_io(1, 0, 0); /* IRUPDATE */ 791 jbi_jtag_io(1, 0, 0); /* DRSELECT */ 792 jbi_jtag_io(0, 0, 0); /* DRCAPTURE */ 793 jbi_jtag_io(0, 0, 0); /* DRSHIFT */ 799 794 break; 800 795 … … 806 801 { 807 802 /* loop in the SHIFT-DR state */ 808 for (i = 0; i < count; i++) 809 { 810 tdo_bit = jbi_jtag_io( 811 (i == count - 1), 812 tdi[i >> 3] & (1 << (i & 7)), 813 (tdo != NULL), 1); 814 815 if (tdo != NULL) 816 { 817 if (tdo_bit) 818 { 819 tdo[i >> 3] |= (1 << (i & 7)); 820 } 821 else 822 { 823 tdo[i >> 3] &= ~(unsigned int) (1 << (i & 7)); 824 } 825 } 826 } 827 828 jbi_jtag_io(0, 0, 0, 0); /* DRPAUSE */ 803 usb_blaster_scan(count, tdi, tdo); 804 805 jbi_jtag_io(0, 0, 0); /* DRPAUSE */ 829 806 } 830 807 … … 850 827 { 851 828 case 0: /* IDLE */ 852 jbi_jtag_io(1, 0, 0 , 0); /* DRSELECT */853 jbi_jtag_io(1, 0, 0 , 0); /* IRSELECT */854 jbi_jtag_io(0, 0, 0 , 0); /* IRCAPTURE */855 jbi_jtag_io(0, 0, 0 , 0); /* IRSHIFT */856 break; 857 858 case 1: 859 jbi_jtag_io(1, 0, 0 , 0); /* DREXIT2 */860 jbi_jtag_io(1, 0, 0 , 0); /* DRUPDATE */861 jbi_jtag_io(1, 0, 0 , 0); /* DRSELECT */862 jbi_jtag_io(1, 0, 0 , 0); /* IRSELECT */863 jbi_jtag_io(0, 0, 0 , 0); /* IRCAPTURE */864 jbi_jtag_io(0, 0, 0 , 0); /* IRSHIFT */865 break; 866 867 case 2: 868 jbi_jtag_io(1, 0, 0 , 0); /* IREXIT2 */869 jbi_jtag_io(1, 0, 0 , 0); /* IRUPDATE */870 jbi_jtag_io(1, 0, 0 , 0); /* DRSELECT */871 jbi_jtag_io(1, 0, 0 , 0); /* IRSELECT */872 jbi_jtag_io(0, 0, 0 , 0); /* IRCAPTURE */873 jbi_jtag_io(0, 0, 0 , 0); /* IRSHIFT */829 jbi_jtag_io(1, 0, 0); /* DRSELECT */ 830 jbi_jtag_io(1, 0, 0); /* IRSELECT */ 831 jbi_jtag_io(0, 0, 0); /* IRCAPTURE */ 832 jbi_jtag_io(0, 0, 0); /* IRSHIFT */ 833 break; 834 835 case 1: /* DRPAUSE */ 836 jbi_jtag_io(1, 0, 0); /* DREXIT2 */ 837 jbi_jtag_io(1, 0, 0); /* DRUPDATE */ 838 jbi_jtag_io(1, 0, 0); /* DRSELECT */ 839 jbi_jtag_io(1, 0, 0); /* IRSELECT */ 840 jbi_jtag_io(0, 0, 0); /* IRCAPTURE */ 841 jbi_jtag_io(0, 0, 0); /* IRSHIFT */ 842 break; 843 844 case 2: /* IRPAUSE */ 845 jbi_jtag_io(1, 0, 0); /* IREXIT2 */ 846 jbi_jtag_io(1, 0, 0); /* IRUPDATE */ 847 jbi_jtag_io(1, 0, 0); /* DRSELECT */ 848 jbi_jtag_io(1, 0, 0); /* IRSELECT */ 849 jbi_jtag_io(0, 0, 0); /* IRCAPTURE */ 850 jbi_jtag_io(0, 0, 0); /* IRSHIFT */ 874 851 break; 875 852 … … 881 858 { 882 859 /* loop in the SHIFT-IR state */ 883 for (i = 0; i < count; i++) 884 { 885 tdo_bit = jbi_jtag_io( 886 (i == count - 1), 887 tdi[i >> 3] & (1 << (i & 7)), 888 (tdo != NULL), 0); 889 890 if (tdo != NULL) 891 { 892 if (tdo_bit) 893 { 894 tdo[i >> 3] |= (1 << (i & 7)); 895 } 896 else 897 { 898 tdo[i >> 3] &= ~(unsigned int) (1 << (i & 7)); 899 } 900 } 901 } 902 903 jbi_jtag_io(0, 0, 0, 0); /* IRPAUSE */ 860 usb_blaster_scan(count, tdi, tdo); 861 862 jbi_jtag_io(0, 0, 0); /* IRPAUSE */ 904 863 } 905 864
Note:
See TracChangeset
for help on using the changeset viewer.