diff --git a/driver-bitfury.c b/driver-bitfury.c index 6bb4e8c3..8069a1d2 100644 --- a/driver-bitfury.c +++ b/driver-bitfury.c @@ -28,7 +28,16 @@ static void bitfury_empty_buffer(struct cgpu_info *bitfury) static void bitfury_open(struct cgpu_info *bitfury) { + uint32_t buf[2]; + bitfury_empty_buffer(bitfury); + /* Magic sequence to reset device only really needed for windows but + * harmless on linux. */ + buf[0] = 0x80250000; + buf[1] = 0x00000800; + usb_transfer(bitfury, 0, 9, 1, 0, C_BF1_RESET); + usb_transfer(bitfury, 0x21, 0x22, 0, 0, C_BF1_OPEN); + usb_transfer_data(bitfury, 0x21, 0x20, 0x0000, 0, buf, 7, C_BF1_INIT); } static void bitfury_close(struct cgpu_info *bitfury) diff --git a/usbutils.h b/usbutils.h index 8274c76b..457381d0 100644 --- a/usbutils.h +++ b/usbutils.h @@ -328,7 +328,9 @@ struct cg_usb_info { USB_ADD_COMMAND(C_ENABLE_UART, "EnableUART") \ USB_ADD_COMMAND(C_BB_SET_VOLTAGE, "SetCoreVoltage") \ USB_ADD_COMMAND(C_BB_GET_VOLTAGE, "GetCoreVoltage") \ + USB_ADD_COMMAND(C_BF1_RESET, "BF1Reset") \ USB_ADD_COMMAND(C_BF1_OPEN, "BF1Open") \ + USB_ADD_COMMAND(C_BF1_INIT, "BF1Init") \ USB_ADD_COMMAND(C_BF1_CLOSE, "BF1Close") \ USB_ADD_COMMAND(C_BF1_REQINFO, "BF1RequestInfo") \ USB_ADD_COMMAND(C_BF1_GETINFO, "BF1GetInfo") \