Skip to content
This repository has been archived by the owner on May 27, 2020. It is now read-only.

Update #727

Open
wants to merge 103 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
89f4238
Add support for bitmain devices
xlc1985 Sep 4, 2013
295a81f
Add support for bitmain devices
xlc1985 Sep 4, 2013
dd7738e
Merge branch 'master' of https://github.com/bitmaintech/cgminer.git
xlc1985 Sep 4, 2013
bf45312
Add support for Bitmain Multi Chain and Single Chain
Dec 10, 2013
8b011c7
Add support for Bitmain Multi Chain and Single Chain and optimize the
Dec 10, 2013
127c2cf
Merge branch 'master' of https://github.com/bitmaintech/cgminer.git
Dec 10, 2013
3ec10e4
Add support for Bitmain Multi Chain and Single Chain and optimize the
Dec 10, 2013
2a356c7
Add support for Bitmain Multi Chain and Single Chain and optimize the
Dec 10, 2013
93ce880
Merge branch 'master' of https://github.com/bitmaintech/cgminer.git
Dec 10, 2013
db687a4
Support for BitMain Single Chain and update code version to 3.8.5
Dec 22, 2013
047abd2
Support for BitMain Single Chain and update code version to 3.8.5
Dec 22, 2013
2f0ea49
Merge branch 'master' of https://github.com/bitmaintech/cgminer.git
Dec 22, 2013
15cbfd9
Merge branch 'master' of https://github.com/bitmaintech/cgminer.git
Dec 22, 2013
c4f862e
Merge branch 'master' of https://github.com/bitmaintech/cgminer.git
Dec 22, 2013
2c699bf
Merge branch 'master' of https://github.com/bitmaintech/cgminer.git
Dec 22, 2013
83ebae2
Merge branch 'master' of https://github.com/bitmaintech/cgminer.git
Dec 22, 2013
f26b544
Merge branch 'master' of https://github.com/bitmaintech/cgminer.git
Dec 22, 2013
6ad7a30
Merge branch 'master' of https://github.com/bitmaintech/cgminer.git
Dec 22, 2013
e54fb64
Merge branch 'master' of https://github.com/bitmaintech/cgminer.git
Dec 22, 2013
97645c9
Merge branch 'master' of https://github.com/bitmaintech/cgminer.git
Dec 22, 2013
e5dc1a9
Perfect function of BitMain Multi Chain
Dec 31, 2013
c91b196
Test
Fazio Aug 18, 2014
2cb8884
Revert "Test"
Fazio Aug 18, 2014
916414a
Support USB3.0 devices
Fazio Aug 18, 2014
8377030
Merge branch 'master' of https://github.com/bitmaintech/cgminer.git
Aug 18, 2014
269aa2c
Support USB3.0 devices
Aug 18, 2014
4c5bc75
Support USB3.0 devices
Aug 18, 2014
3d55fcc
Merge branch 'master' of https://github.com/bitmaintech/cgminer.git
Aug 18, 2014
ad05543
Support USB3.0 devices
Aug 18, 2014
2d66eab
Merge branch 'master' of https://github.com/bitmaintech/cgminer.git
Aug 18, 2014
9f57061
Update to 4.5.0 version and support AntMiner Devices
Aug 31, 2014
5eec63b
Update to 4.5.0 version and support AntMiner Devices
Aug 31, 2014
ff7c85e
Merge branch 'master' of https://github.com/bitmaintech/cgminer.git
Aug 31, 2014
4d89a7e
increase minion max chip NO.
Sep 1, 2014
960c129
updae to version 4.6.0
Sep 7, 2014
a569bc7
Add custom strcasestr and use custom gnu type functions in bflsc
Sep 9, 2014
c670831
update to version 4.6.0
Sep 9, 2014
b979e3c
update to version 4.6.0
Sep 9, 2014
c2eb493
api-example unlimited socket works
Sep 13, 2014
ecf7fd7
support S4 and U3
Sep 21, 2014
53451e9
update version to 4.6.1
Sep 26, 2014
daa5129
Perfect S2 and S3 function
Sep 26, 2014
562da17
update to version 4.6.1
Sep 26, 2014
ad05c5c
Implement support for mining.suggest_difficulty
Oct 8, 2014
c7a253b
Avalon Nano: Add support Avalon Nano usb miner
Oct 8, 2014
0ab4d09
Allow arbitrary clamping of lower device diffs for slow controllers by
Oct 8, 2014
29bbdd3
Implement support for mining.suggest_difficulty
Oct 8, 2014
fc63f4d
Avalon Nano: Add support Avalon Nano usb miner
Oct 8, 2014
2e4cb0f
The 2nd read never gets anything on ava2 so remove it entirely and just
Oct 8, 2014
435f2f9
Don't set default fan to max on hashratio
Oct 8, 2014
e654df9
Avalon Nano: Add support Avalon Nano usb miner
Oct 8, 2014
52e0bab
Set min_diff to 1
Oct 8, 2014
80d0c34
update news
Oct 10, 2014
ba942c1
API.java - remove lowercase of all data sent
Oct 10, 2014
c4bb6a0
Set min_diff to 1
Oct 10, 2014
634eed7
change variable type
Oct 10, 2014
03610f1
update bflsc.h
Oct 10, 2014
1b90f44
remove unused info.
Oct 10, 2014
c2cc546
change variable type
Oct 10, 2014
df72650
update inc_work_stats
Oct 11, 2014
ad6098c
Added support for extranonce switching
Oct 14, 2014
3965332
update bitmain_get_results
Oct 14, 2014
f718e8e
fix warnings
Oct 16, 2014
fc11717
Add text in README for Tube/Prisma
Oct 16, 2014
6d96d15
Update API documentation
Oct 16, 2014
28ba87d
update ASIC document
Oct 17, 2014
ef2cd84
Add BlockErupter Driver
Oct 17, 2014
67eb11b
Fix bulk of remaining style in blockerupter.c
Oct 17, 2014
1c28116
Tidy style in blockerupter.h
Oct 17, 2014
5e7e0d9
update driver-bitmain.h
Oct 17, 2014
5bad637
Add BlockErupter Driver
Oct 20, 2014
57c4538
more NEWS
Oct 20, 2014
ce20b4b
Fix off by one calculation error in sp30 leading zeroes
Oct 20, 2014
6fc5e3d
update to 4.7.0
Oct 20, 2014
0015995
Implement generic inet_pton for windows
Oct 21, 2014
771f3d2
Set driver max diff to large value if unset
Oct 21, 2014
d8111af
Enable building libusb without udev
Oct 21, 2014
73b8386
correct suggest_difficulty json rpc call
Oct 21, 2014
d6f62d8
Implement generic inet_pton for windows
Oct 21, 2014
6260ad6
Implement blacklisting of attempting to match known products from ones
Oct 21, 2014
e487991
Add more usb3 hub identifiers for windows
Oct 21, 2014
66b843d
two back temps spondoolies
Oct 22, 2014
a5a3861
update hashmeter
Oct 22, 2014
163a6f2
remove unused info.
xjl2000 Oct 22, 2014
886caba
Revert "Roll back to original .gitignore"
Oct 28, 2014
a9e2383
Reset ipv6 flag to false in every api-allow loop
Oct 28, 2014
3089e31
update driver-bitmain.c
Oct 28, 2014
cb78b7c
remove unused INFO
Oct 31, 2014
0ab8b85
exlarge max diff on sp30 to 1024
Oct 31, 2014
078e90f
Hashfast voltage support
Nov 3, 2014
0d7c21c
Set the correct flag for close on exec for sockets
Nov 3, 2014
1a82adb
Fix segfault when writing config with hashratio built in
Nov 3, 2014
4a9937d
Set hashfast voltage settings only when really needed
Nov 3, 2014
71c2f0d
Send hfa generic frame only if voltage was specified on the command line
Nov 3, 2014
6a6e33d
roll back max_diff
Nov 3, 2014
5d87636
update to 4.7.1
Nov 14, 2014
ddfa080
Bump version to 3.8.0
Dec 4, 2014
aa71238
support S5
Dec 5, 2014
82c9643
add get_blk_num and support extranonce
Dec 19, 2014
745c562
bump version to 4.9.0
Dec 31, 2014
01dc705
send special work to check chips' status at the begining
Jan 10, 2015
4ecf893
add fan mode controlling
Jan 10, 2015
93db9b5
reduce cpu occupancy rate
Jan 30, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,41 @@
nbproject
ccan/opt/.dirstamp
compat/jansson-2.6/jansson.pc
compat/jansson-2.6/libtool
compat/jansson-2.6/ltmain.sh
compat/jansson-2.6/m4/libtool.m4
compat/jansson-2.6/m4/ltoptions.m4
compat/jansson-2.6/m4/ltsugar.m4
compat/jansson-2.6/m4/ltversion.m4
compat/jansson-2.6/m4/lt~obsolete.m4
compat/jansson-2.6/src/.libs/
compat/jansson-2.6/src/dump.lo
compat/jansson-2.6/src/error.lo
compat/jansson-2.6/src/hashtable.lo
compat/jansson-2.6/src/jansson_config.h
compat/jansson-2.6/src/libjansson.la
compat/jansson-2.6/src/load.lo
compat/jansson-2.6/src/memory.lo
compat/jansson-2.6/src/pack_unpack.lo
compat/jansson-2.6/src/strbuffer.lo
compat/jansson-2.6/src/strconv.lo
compat/jansson-2.6/src/utf.lo
compat/jansson-2.6/src/value.lo
compat/libusb-1.0/libtool
compat/libusb-1.0/libusb-1.0.pc
compat/libusb-1.0/libusb/.libs/
compat/libusb-1.0/libusb/os/.dirstamp
compat/libusb-1.0/ltmain.sh
libtool
ltmain.sh
m4/libtool.m4
m4/ltoptions.m4
m4/ltsugar.m4
m4/ltversion.m4
m4/lt~obsolete.m4



cgminer
cgminer.exe
minerd
Expand Down Expand Up @@ -32,6 +70,7 @@ ext_deps
config.h.in
config.h


ccan/libccan.a
lib/arg-nonnull.h
lib/c++defs.h
Expand Down
48 changes: 40 additions & 8 deletions 01-cgminer.rules
Original file line number Diff line number Diff line change
@@ -1,20 +1,52 @@
# Butterfly Labs FPGA and ASIC devices
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6014", SUBSYSTEMS=="usb", ACTION=="add", MODE="0666", GROUP="plugdev"
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6014", SUBSYSTEM=="usb", ACTION=="add", MODE="0666", GROUP="plugdev"

# ModMinerQuad
ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="0003", SUBSYSTEMS=="usb", ACTION=="add", MODE="0666", GROUP="plugdev"
ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="0003", SUBSYSTEM=="usb", ACTION=="add", MODE="0666", GROUP="plugdev"

# Lancelot and Avalon
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", SUBSYSTEMS=="usb", ACTION=="add", MODE="0666", GROUP="plugdev"
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", SUBSYSTEM=="usb", ACTION=="add", MODE="0666", GROUP="plugdev"

# Icarus
ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", SUBSYSTEMS=="usb", ACTION=="add", MODE="0666", GROUP="plugdev"
ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", SUBSYSTEM=="usb", ACTION=="add", MODE="0666", GROUP="plugdev"
ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="0083", SUBSYSTEM=="usb", ACTION=="add", MODE="0666", GROUP="plugdev"

# AsicminerUSB
ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", SUBSYSTEMS=="usb", ACTION=="add", MODE="0666", GROUP="plugdev"
# AsicminerUSB and Antminer U1
ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", SUBSYSTEM=="usb", ACTION=="add", MODE="0666", GROUP="plugdev"

# Cairnsmore1
ATTRS{idVendor}=="067b", ATTRS{idProduct}=="0230", SUBSYSTEMS=="usb", ACTION=="add", MODE="0666", GROUP="plugdev"
ATTRS{idVendor}=="067b", ATTRS{idProduct}=="0230", SUBSYSTEM=="usb", ACTION=="add", MODE="0666", GROUP="plugdev"

# Cairnsmore1-2
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="8350", SUBSYSTEM=="usb", ACTION=="add", MODE="0666", GROUP="plugdev"

# Ztex
ATTRS{idVendor}=="221a", ATTRS{idProduct}=="0100", SUBSYSTEMS=="usb", ACTION=="add", MODE="0666", GROUP="plugdev"
ATTRS{idVendor}=="221a", ATTRS{idProduct}=="0100", SUBSYSTEM=="usb", ACTION=="add", MODE="0666", GROUP="plugdev"

# BF1
ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="204b", SUBSYSTEM=="usb", ACTION=="add", MODE="0666", GROUP="plugdev"

# Klondike
ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="f60a", SUBSYSTEM=="usb", ACTION=="add", MODE="0666", GROUP="plugdev"

# HashFast
ATTRS{idVendor}=="297c", ATTRS{idProduct}=="0001", SUBSYSTEM=="usb", ACTION=="add", MODE="0666", GROUP="plugdev"
ATTRS{idVendor}=="297c", ATTRS{idProduct}=="8001", SUBSYSTEM=="usb", ACTION=="add", MODE="0666", GROUP="plugdev"

# BXF
ATTRS{idVendor}=="198c", ATTRS{idProduct}=="b1f1", SUBSYSTEM=="usb", ACTION=="add", MODE="0666", GROUP="plugdev"

# NF1
ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="00de", SUBSYSTEM=="usb", ACTION=="add", MODE="0666", GROUP="plugdev"

# ANT_S1
ATTRS{idVendor}=="4254", ATTRS{idProduct}=="4153", SUBSYSTEM=="usb", ACTION=="add", MODE="0666", GROUP="plugdev"

# Cointerra
ATTRS{idVendor}=="1cbe", ATTRS{idProduct}=="0003", SUBSYSTEM=="usb", ACTION=="add", MODE="0666", GROUP="plugdev"

# Drillbit Thumb
ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2404", SUBSYSTEM=="usb", ACTION=="add", MODE="0666", GROUP="plugdev"

# Avalon4
ATTRS{idVendor}=="29f1", ATTRS{idProduct}=="33f2", SUBSYSTEM=="usb", ACTION=="add", MODE="0666", GROUP="plugdev"
117 changes: 117 additions & 0 deletions A1-board-selector-CCD.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
/*
* board selector support for TCA9535 used in Bitmine's CoinCraft Desk
*
* Copyright 2014 Zefir Kurtisi <[email protected]>
*
* 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 the Free
* Software Foundation; either version 3 of the License, or (at your option)
* any later version. See COPYING for more details.
*/


#include <sys/ioctl.h>
#include <errno.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <linux/i2c.h>
#include <linux/i2c-dev.h>

#include <stdint.h>
#include <stdbool.h>
#include <fcntl.h>

#include "miner.h"

#include "A1-board-selector.h"
#include "i2c-context.h"

static struct board_selector ccd_selector;

struct i2c_ctx *U1_tca9535;
uint8_t chain_mask = 0xff;
uint8_t active_chain = 255;
pthread_mutex_t lock;


#define UNUSED_BITS 0xe0

static void ccd_unlock(void)
{
mutex_unlock(&lock);
}

static void ccd_exit(void)
{
if (U1_tca9535 != NULL)
U1_tca9535->exit(U1_tca9535);
}
uint8_t retval = 0;

extern struct board_selector *ccd_board_selector_init(void)
{
mutex_init(&lock);
U1_tca9535 = i2c_slave_open(I2C_BUS, 0x27);
if (U1_tca9535 == NULL)
return NULL;
bool retval = U1_tca9535->write(U1_tca9535, 0x06, 0xe0) &&
U1_tca9535->write(U1_tca9535, 0x07, 0xe0) &&
U1_tca9535->write(U1_tca9535, 0x02, 0x1f) &&
U1_tca9535->write(U1_tca9535, 0x03, 0x00);
if (retval)
return &ccd_selector;
ccd_exit();
return NULL;
}

static bool ccd_select(uint8_t chain)
{
if (chain >= CCD_MAX_CHAINS)
return false;

mutex_lock(&lock);
if (active_chain == chain)
return true;

active_chain = chain;
chain_mask = 1 << active_chain;
return U1_tca9535->write(U1_tca9535, 0x02, ~chain_mask);
}

static bool __ccd_board_selector_reset(uint8_t mask)
{
if (!U1_tca9535->write(U1_tca9535, 0x03, mask))
return false;
cgsleep_ms(RESET_LOW_TIME_MS);
if (!U1_tca9535->write(U1_tca9535, 0x03, 0x00))
return false;
cgsleep_ms(RESET_HI_TIME_MS);
return true;
}
// we assume we are already holding the mutex
static bool ccd_reset(void)
{
return __ccd_board_selector_reset(chain_mask);
}

static bool ccd_reset_all(void)
{
mutex_lock(&lock);
bool retval = __ccd_board_selector_reset(0xff & ~UNUSED_BITS);
mutex_unlock(&lock);
return retval;
}


static struct board_selector ccd_selector = {
.select = ccd_select,
.release = ccd_unlock,
.exit = ccd_exit,
.reset = ccd_reset,
.reset_all = ccd_reset_all,
/* don't have a temp sensor dedicated to chain */
.get_temp = dummy_get_temp,
};

Loading