|
@@ -81,7 +81,6 @@ enum knc_i2c_core_status {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
BFG_REGISTER_DRIVER(knc_drv)
|
|
BFG_REGISTER_DRIVER(knc_drv)
|
|
|
-static const struct bfg_set_device_definition knc_set_device_funcs[];
|
|
|
|
|
|
|
|
|
|
struct knc_device {
|
|
struct knc_device {
|
|
|
int i2c;
|
|
int i2c;
|
|
@@ -101,7 +100,6 @@ struct knc_core {
|
|
|
int asicno;
|
|
int asicno;
|
|
|
int coreno;
|
|
int coreno;
|
|
|
|
|
|
|
|
- bool use_dcdc;
|
|
|
|
|
float volt;
|
|
float volt;
|
|
|
float current;
|
|
float current;
|
|
|
|
|
|
|
@@ -159,7 +157,6 @@ bool knc_detect_one(const char *devpath)
|
|
|
*cgpu = (struct cgpu_info){
|
|
*cgpu = (struct cgpu_info){
|
|
|
.drv = &knc_drv,
|
|
.drv = &knc_drv,
|
|
|
.device_path = strdup(devpath),
|
|
.device_path = strdup(devpath),
|
|
|
- .set_device_funcs = knc_set_device_funcs,
|
|
|
|
|
.deven = DEV_ENABLED,
|
|
.deven = DEV_ENABLED,
|
|
|
.procs = KNC_CORES_PER_CHIP,
|
|
.procs = KNC_CORES_PER_CHIP,
|
|
|
.threads = prev_cgpu ? 0 : 1,
|
|
.threads = prev_cgpu ? 0 : 1,
|
|
@@ -295,7 +292,6 @@ bool knc_init(struct thr_info * const thr)
|
|
|
.coreno = i + j,
|
|
.coreno = i + j,
|
|
|
.hwerr_in_row = 0,
|
|
.hwerr_in_row = 0,
|
|
|
.hwerr_disable_time = KNC_HWERR_DISABLE_SECS,
|
|
.hwerr_disable_time = KNC_HWERR_DISABLE_SECS,
|
|
|
- .use_dcdc = true,
|
|
|
|
|
};
|
|
};
|
|
|
timer_set_now(&knccore->enable_at);
|
|
timer_set_now(&knccore->enable_at);
|
|
|
proc->device_data = knc;
|
|
proc->device_data = knc;
|
|
@@ -338,8 +334,6 @@ nomorecores: ;
|
|
|
spi->mode = KNC_SPI_MODE;
|
|
spi->mode = KNC_SPI_MODE;
|
|
|
spi->bits = KNC_SPI_BITS;
|
|
spi->bits = KNC_SPI_BITS;
|
|
|
|
|
|
|
|
- cgpu_set_defaults(cgpu);
|
|
|
|
|
-
|
|
|
|
|
if (!knc_spi_open(cgpu->dev_repr, spi))
|
|
if (!knc_spi_open(cgpu->dev_repr, spi))
|
|
|
return false;
|
|
return false;
|
|
|
|
|
|
|
@@ -749,7 +743,7 @@ bool knc_get_stats(struct cgpu_info * const cgpu)
|
|
|
knccore = thr->cgpu_data;
|
|
knccore = thr->cgpu_data;
|
|
|
die = i / KNC_CORES_PER_DIE;
|
|
die = i / KNC_CORES_PER_DIE;
|
|
|
|
|
|
|
|
- if (0 == i % KNC_CORES_PER_DIE && knccore->use_dcdc)
|
|
|
|
|
|
|
+ if (0 == i % KNC_CORES_PER_DIE)
|
|
|
{
|
|
{
|
|
|
if (ioctl(i2c, I2C_SLAVE, i2cslave_dcdc[die]))
|
|
if (ioctl(i2c, I2C_SLAVE, i2cslave_dcdc[die]))
|
|
|
{
|
|
{
|
|
@@ -798,11 +792,8 @@ struct api_data *knc_api_extra_device_status(struct cgpu_info * const cgpu)
|
|
|
struct thr_info * const thr = cgpu->thr[0];
|
|
struct thr_info * const thr = cgpu->thr[0];
|
|
|
struct knc_core * const knccore = thr->cgpu_data;
|
|
struct knc_core * const knccore = thr->cgpu_data;
|
|
|
|
|
|
|
|
- if (knccore->use_dcdc)
|
|
|
|
|
- {
|
|
|
|
|
- root = api_add_volts(root, "Voltage", &knccore->volt, false);
|
|
|
|
|
- root = api_add_volts(root, "DCDC Current", &knccore->current, false);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ root = api_add_volts(root, "Voltage", &knccore->volt, false);
|
|
|
|
|
+ root = api_add_volts(root, "DCDC Current", &knccore->current, false);
|
|
|
|
|
|
|
|
return root;
|
|
return root;
|
|
|
}
|
|
}
|
|
@@ -814,65 +805,11 @@ void knc_wlogprint_status(struct cgpu_info * const cgpu)
|
|
|
struct thr_info * const thr = cgpu->thr[0];
|
|
struct thr_info * const thr = cgpu->thr[0];
|
|
|
struct knc_core * const knccore = thr->cgpu_data;
|
|
struct knc_core * const knccore = thr->cgpu_data;
|
|
|
|
|
|
|
|
- if (knccore->use_dcdc)
|
|
|
|
|
- wlogprint("Voltage: %.3f DCDC Current: %.3f\n",
|
|
|
|
|
- knccore->volt, knccore->current);
|
|
|
|
|
|
|
+ wlogprint("Voltage: %.3f DCDC Current: %.3f\n",
|
|
|
|
|
+ knccore->volt, knccore->current);
|
|
|
}
|
|
}
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
-static
|
|
|
|
|
-const char *knc_set_use_dcdc(struct cgpu_info *proc, const char * const optname, const char * const newvalue, char * const replybuf, enum bfg_set_device_replytype * const out_success)
|
|
|
|
|
-{
|
|
|
|
|
- int core_index_on_die = proc->proc_id % KNC_CORES_PER_DIE;
|
|
|
|
|
- bool nv;
|
|
|
|
|
-
|
|
|
|
|
- if (!(strcasecmp(newvalue, "no") && strcasecmp(newvalue, "false") && strcasecmp(newvalue, "0") && strcasecmp(newvalue, "off") && strcasecmp(newvalue, "disable")))
|
|
|
|
|
- nv = false;
|
|
|
|
|
- else
|
|
|
|
|
- if (!(strcasecmp(newvalue, "yes") && strcasecmp(newvalue, "true") && strcasecmp(newvalue, "on") && strcasecmp(newvalue, "enable")))
|
|
|
|
|
- nv = true;
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- char *p;
|
|
|
|
|
- strtol(newvalue, &p, 0);
|
|
|
|
|
- if (newvalue[0] && !p[0])
|
|
|
|
|
- nv = true;
|
|
|
|
|
- else
|
|
|
|
|
- return "Usage: use_dcdc=yes/no";
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (core_index_on_die)
|
|
|
|
|
- {
|
|
|
|
|
- const int seek = (proc->proc_id / KNC_CORES_PER_DIE) * KNC_CORES_PER_DIE;
|
|
|
|
|
- proc = proc->device;
|
|
|
|
|
- for (int i = 0; i < seek; ++i)
|
|
|
|
|
- proc = proc->next_proc;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- {
|
|
|
|
|
- struct thr_info * const mythr = proc->thr[0];
|
|
|
|
|
- struct knc_core * const knccore = mythr->cgpu_data;
|
|
|
|
|
-
|
|
|
|
|
- if (knccore->use_dcdc == nv)
|
|
|
|
|
- return NULL;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- for (int i = 0; i < KNC_CORES_PER_DIE; (proc = proc->next_proc), ++i)
|
|
|
|
|
- {
|
|
|
|
|
- struct thr_info * const mythr = proc->thr[0];
|
|
|
|
|
- struct knc_core * const knccore = mythr->cgpu_data;
|
|
|
|
|
-
|
|
|
|
|
- knccore->use_dcdc = nv;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- return NULL;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-static const struct bfg_set_device_definition knc_set_device_funcs[] = {
|
|
|
|
|
- {"use_dcdc", knc_set_use_dcdc, "whether to access DCDC module for voltage/current information"},
|
|
|
|
|
- {NULL}
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
struct device_drv knc_drv = {
|
|
struct device_drv knc_drv = {
|
|
|
.dname = "knc",
|
|
.dname = "knc",
|
|
|
.name = "KNC",
|
|
.name = "KNC",
|