From: Frank Mori Hess Date: Sat, 31 Jan 2004 21:57:02 +0000 (+0000) Subject: update for usbdux driver form Bernd Porr who says: X-Git-Tag: r0_7_22~79 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4d08248fdaab09cd9f53b06692d218430660d95c;p=comedilib.git update for usbdux driver form Bernd Porr who says: Had to change the USB 2.0 transfer protocol from IRQ transfer to ISO transfer. Reason: IRQ transfer is still not stable (2.4/2.6). However, ISO transfer has been rewritten in the kernel and works (just now in 2.6 but will be backported sooner or later)! I supply new firmware and a new version of the driver which now uses ISO transfer throughout (1.1 / 2.0). --- diff --git a/etc/hotplug/usb/usbdux/usbdux_firmware.asm b/etc/hotplug/usb/usbdux/usbdux_firmware.asm index ea5a896..c977254 100644 --- a/etc/hotplug/usb/usbdux/usbdux_firmware.asm +++ b/etc/hotplug/usb/usbdux/usbdux_firmware.asm @@ -1,5 +1,5 @@ ; usbdux_firmware.asm -; Copyright (C) 2003 Bernd Porr, Bernd.Porr@cn.stir.ac.uk +; Copyright (C) 2004 Bernd Porr, Bernd.Porr@cn.stir.ac.uk ; ; This program is free software; you can redistribute it and/or modify ; it under the terms of the GNU General Public License as published by @@ -20,7 +20,7 @@ ; Description: University of Stirling USB DAQ & INCITE Technology Limited ; Devices: [ITL] USB-DUX (usbdux.o) ; Author: Bernd Porr -; Updated: Thu Oct 16 +; Updated: 25 Jan 2004 ; Status: testing ; ;;; @@ -160,7 +160,7 @@ ep8isoerr_isr: ;;; then engages in an endless loop main: mov DPTR,#CPUCS ; CPU control register - mov a,#000010100b ; 48MHz clock + mov a,#000100100b ; 48MHz clock movx @DPTR,a ; do it mov dptr,#INTSETUP ; IRQ setup register @@ -169,16 +169,7 @@ main: lcall initAD ; init the ports to the converters - mov dptr,#USBCS ; USB status - movx a,@dptr ; get it - anl a,#80H ; mask out high speed - - jnz inihi ; high speed - lcall inieplo ; init the isochronous data-transfer - sjmp mloop2 -inihi: - lcall iniephi ; init the irq transfer mloop2: nop @@ -408,72 +399,6 @@ inieplo: ret -;;; initilise the IRQ transfer -iniephi: - mov dptr,#FIFORESET - mov a,#0fh - movx @dptr,a ; reset all fifos - mov a,#00h - movx @dptr,a ; normal operat - - mov DPTR,#EP2CFG - mov a,#10110010b ; valid, out, double buff, irq - movx @DPTR,a - - mov dptr,#EP2FIFOCFG - mov a,#00000000b ; manual - movx @dptr,a - - mov dptr,#EP2BCL ; "arm" it - mov a,#80h - movx @DPTR,a ; can receive data - movx @DPTR,a ; can receive data - movx @DPTR,a ; can receive data - - mov DPTR,#EP4CFG - mov a,#10100000b ; valid - movx @dptr,a - - mov dptr,#EP4FIFOCFG - mov a,#00000000b ; manual - movx @dptr,a - - mov dptr,#EP4BCL ; "arm" it - mov a,#80h - movx @DPTR,a ; can receive data - movx @dptr,a ; make shure its really empty - - mov DPTR,#EP6CFG ; IRQ data from here to the host - mov a,#11110010b ; Valid - movx @DPTR,a ; IRQ transfer, double buffering - - mov DPTR,#EP8CFG ; EP8 - mov a,#11100000b ; BULK data from here to the host - movx @DPTR,a ; - - mov dptr,#EPIE ; interrupt enable - mov a,#11110000b ; enable irq for ep2,ep4,ep6,ep8 - movx @dptr,a ; do it - - mov dptr,#EPIRQ - mov a,#11110000b ; clear irq bits - movx @dptr,a - - ;; enable interrups - mov DPTR,#USBIE ; USB int enables register - mov a,#0 ; disables SOF (1ms/125ms interrupt) - movx @DPTR,a ; - - mov EIE,#00000001b ; enable INT2 in the 8051's SFR - mov IE,#80h ; IE, enable all interrupts - - lcall ep8_arm ; put dummy data into ep8 - lcall ep6_arm ; put dummy data into ep6 - - ret - - - ;;; interrupt-routine for SOF ;;; is for full speed sof_isr: @@ -493,12 +418,6 @@ sof_isr: push 06h ; R6 push 07h ; R7 - mov dptr,#USBCS ; USB status - movx a,@dptr ; get it - anl a,#80H ; mask out high speed - - jnz hispeed ; do nothing here - mov a,EP2468STAT anl a,#20H ; full? jnz epfull ; EP6-buffer is full @@ -527,7 +446,6 @@ epfull: movx @DPTR,a ; can receive data movx @dptr,a -hispeed: epempty: ;; clear INT2 mov a,EXIF ; FIRST clear the USB (INT2) interrupt request @@ -751,6 +669,7 @@ ep6_arm: ;;; get all 8 channels in the high speed mode +;;; not used just now ep6_isr: push dps push dpl @@ -917,6 +836,7 @@ ep8_isr: ;;; high speed mode, IRQ mode. Asynchronous transmission. +;;; not used just now ep2_isr: push dps push dpl diff --git a/etc/hotplug/usb/usbdux/usbdux_firmware.hex b/etc/hotplug/usb/usbdux/usbdux_firmware.hex index e1dc621..2c7e548 100644 --- a/etc/hotplug/usb/usbdux/usbdux_firmware.hex +++ b/etc/hotplug/usb/usbdux/usbdux_firmware.hex @@ -1,80 +1,73 @@ :030000000201A258 :03004300020100B7 -:1001000002017F0002033C0002017F0002017F0028 +:1001000002017F000202D40002017F0002017F0091 :1001100002017F0002017F0002017F0002017F00D7 :1001200002017F0002017F0002017F0002017F00C7 -:10013000020577000203B50002049B0002052B00B4 +:10013000020507000203450002042B000204BB0075 :1001400002017F0002017F0002017F0002017F00A7 :1001500002017F0002017F0002017F0002017F0097 :1001600002017F0002017F0002017F0002017F0087 :1001700002017F0002017F0002017F0002017FC0B7 :1001800086C082C083C084C085C0E0C0D0E591C273 :10019000E4F591D0D0D0E0D085D084D083D082D087 -:1001A000863290E6007414F090E6687408F012014C -:1001B000C490E680E0548070051202898003120228 -:1001C000E10080FD75B22775802222547C4481C2F3 -:1001D000817A0830E704D2828002C282D280C28053 -:1001E00023DAF0C2827A05D280C280DAFA7C007A01 -:1001F000047D08D280C280E58030E403EC4DFCED44 -:1002000003FDDAEF7B007A087D80D280C280E58032 -:1002100030E403EB4DFBED03FDDAEFD28122759A5A -:10022000F8759B0075AF077880E61201CBEB90E67E -:100230007BF0ECF008E61201CBEB90E67BF0ECF003 -:1002400008E61201CBEB90E67BF0ECF008E6120139 -:10025000CBEB90E67BF0ECF008E61201CBEB90E6FE -:100260007BF0ECF008E61201CBEB90E67BF0ECF0D3 -:1002700008E61201CBEB90E67BF0ECF008E6120109 -:10028000CBEB90E67BF0ECF02290E604740FF07478 -:1002900000F090E6127492F090E6187400F090E688 -:1002A000917480F0F0F090E61374A0F090E6197469 -:1002B00000F090E6957480F0F090E61474D2F0901F -:1002C000E61574E0F090E65E74A0F090E65F74A02E -:1002D000F090E65C7402F075E80175A88012051EC6 -:1002E0002290E604740FF07400F090E61274B2F0FD -:1002F00090E6187400F090E6917480F0F0F090E6CB -:100300001374A0F090E6197400F090E6957480F0F4 -:10031000F090E61474F2F090E61574E0F090E65E6A -:1003200074F0F090E65F74F0F090E65C7400F075A5 -:10033000E80175A88012051E12048B22C086C082B7 -:10034000C083C084C085C0E0C0D0C000C001C0026E -:10035000C003C004C005C006C00790E680E054801A -:100360007028E5AA5420700F12021E90E6987400BF -:10037000F090E6997410F0E5AA5401700D90F00029 -:1003800012044B90E6917480F0F0E591C2E4F5918F -:1003900090E65D7402F0D007D006D005D004D003FB -:1003A000D002D001D000D0D0D0E0D085D084D0838E -:1003B000D082D08632C086C082C083C084C085C04F -:1003C000E0C0D0C000C001C002C003C004C005C06E -:1003D00006C00790F400E09003DC237380068017CA -:1003E000801D802378807A0890F401E0F6A308DA73 -:1003F000FAE47890F6802190F40112044B80199071 -:10040000F401E0F5B3801190F401E0F5B3A3E0F559 -:100410009074FF7890F6800090E6957480F0F0F08C -:10042000E591C2E4F59190E65F7420F0D007D00624 -:10043000D005D004D003D002D001D000D0D0D0E07D -:10044000D085D084D083D082D08632E0A3F8E0FB80 -:10045000A3E0FCA3E0A312045CD8F32254C0443010 -:100460004CC2857A0830E704D2828002C282D280F0 -:10047000C28023DAF0EB7A0830E704D2828002C22D -:1004800082D280C28023DAF0D2852212021E90E648 -:10049000987400F090E6997410F022C086C082C073 -:1004A00083C084C085C0E0C0D0C000C001C002C00D -:1004B00003C004C005C006C00712021E90E698746F -:1004C00000F090E6997410F0E591C2E4F59190E6A1 -:1004D0005F7440F0D007D006D005D004D003D0021E -:1004E000D001D000D0D0D0E0D085D084D083D082CD -:1004F000D086327890E670107880E61201CB90FCBE -:1005000000EBF0A3ECF0800990FC00E590F0A3E490 -:10051000F090E69C7400F090E69D7410F02290E656 -:100520009C7400F090E69D7401F022C086C082C0E9 -:1005300083C084C085C0E0C0D0C000C001C002C07C -:1005400003C004C005C006C0071204F3E591C2E46D -:10055000F59190E65F7480F0D007D006D005D00406 -:10056000D003D002D001D000D0D0D0E0D085D0844C -:10057000D083D082D08632C086C082C083C084C07F -:1005800085C0E0C0D0C000C001C002C003C004C02C -:1005900005C006C00790F00012044B90E6917480ED -:1005A000F0F0E591C2E4F59190E65F7410F0D007A9 -:1005B000D006D005D004D003D002D001D000D0D0D6 -:0D05C000D0E0D085D084D083D082D08632A8 +:1001A000863290E6007424F090E6687408F012013C +:1001B000B712027C0080FD75B22775802222547C24 +:1001C0004481C2817A0830E704D2828002C282D29E +:1001D00080C28023DAF0C2827A05D280C280DAFA45 +:1001E0007C007A047D08D280C280E58030E403EC94 +:1001F0004DFCED03FDDAEF7B007A087D80D280C2F2 +:1002000080E58030E403EB4DFBED03FDDAEFD281B6 +:1002100022759AF8759B0075AF077880E61201BECB +:10022000EB90E67BF0ECF008E61201BEEB90E67B8B +:10023000F0ECF008E61201BEEB90E67BF0ECF00883 +:10024000E61201BEEB90E67BF0ECF008E61201BE90 +:10025000EB90E67BF0ECF008E61201BEEB90E67B5B +:10026000F0ECF008E61201BEEB90E67BF0ECF00853 +:10027000E61201BEEB90E67BF0ECF02290E604740F +:100280000FF07400F090E6127492F090E61874008B +:10029000F090E6917480F0F0F090E61374A0F09086 +:1002A000E6197400F090E6957480F0F090E614740E +:1002B000D2F090E61574E0F090E65E74A0F090E65F +:1002C0005F74A0F090E65C7402F075E80175A88098 +:1002D0001204AE22C086C082C083C084C085C0E044 +:1002E000C0D0C000C001C002C003C004C005C00629 +:1002F000C007E5AA5420700F12021190E69874000E +:10030000F090E6997410F0E5AA5401700D90F00099 +:100310001203DB90E6917480F0F0E591C2E4F59170 +:1003200090E65D7402F0D007D006D005D004D0036B +:10033000D002D001D000D0D0D0E0D085D084D083FE +:10034000D082D08632C086C082C083C084C085C0BF +:10035000E0C0D0C000C001C002C003C004C005C0DE +:1003600006C00790F400E090036C237380068017AA +:10037000801D802378807A0890F401E0F6A308DAE3 +:10038000FAE47890F6802190F4011203DB80199052 +:10039000F401E0F5B3801190F401E0F5B3A3E0F5CA +:1003A0009074FF7890F6800090E6957480F0F0F0FD +:1003B000E591C2E4F59190E65F7420F0D007D00695 +:1003C000D005D004D003D002D001D000D0D0D0E0EE +:1003D000D085D084D083D082D08632E0A3F8E0FBF1 +:1003E000A3E0FCA3E0A31203ECD8F32254C04430F2 +:1003F0004CC2857A0830E704D2828002C282D28061 +:10040000C28023DAF0EB7A0830E704D2828002C29D +:1004100082D280C28023DAF0D2852212021190E6C5 +:10042000987400F090E6997410F022C086C082C0E3 +:1004300083C084C085C0E0C0D0C000C001C002C07D +:1004400003C004C005C006C00712021190E69874EC +:1004500000F090E6997410F0E591C2E4F59190E611 +:100460005F7440F0D007D006D005D004D003D0028E +:10047000D001D000D0D0D0E0D085D084D083D0823D +:10048000D086327890E670107880E61201BE90FC3B +:1004900000EBF0A3ECF0800990FC00E590F0A3E401 +:1004A000F090E69C7400F090E69D7410F02290E6C7 +:1004B0009C7400F090E69D7401F022C086C082C05A +:1004C00083C084C085C0E0C0D0C000C001C002C0ED +:1004D00003C004C005C006C007120483E591C2E44E +:1004E000F59190E65F7480F0D007D006D005D00477 +:1004F000D003D002D001D000D0D0D0E0D085D084BD +:10050000D083D082D08632C086C082C083C084C0EF +:1005100085C0E0C0D0C000C001C002C003C004C09C +:1005200005C006C00790F0001203DB90E6917480CE +:10053000F0F0E591C2E4F59190E65F7410F0D00719 +:10054000D006D005D004D003D002D001D000D0D046 +:0D055000D0E0D085D084D083D082D0863218 :00000001FF