Browse Source

Merge branch 'redfury'

nfactor-troky
Con Kolivas 11 years ago
parent
commit
d120b9c5b7
  1. 9
      driver-bitfury.c
  2. 2
      usbutils.h

9
driver-bitfury.c

@ -28,7 +28,16 @@ static void bitfury_empty_buffer(struct cgpu_info *bitfury) @@ -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)

2
usbutils.h

@ -328,7 +328,9 @@ struct cg_usb_info { @@ -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") \

Loading…
Cancel
Save