bab report V2 banks/boards during initialisation
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
diff --git a/driver-bab.c b/driver-bab.c
index 401b246..1e7aee2 100644
--- a/driver-bab.c
+++ b/driver-bab.c
@@ -285,6 +285,7 @@ struct bab_info {
int spifd;
int chips;
+ int boards;
uint32_t chip_spis[BAB_MAXCHIPS+1];
cgsem_t scan_work;
@@ -1004,7 +1005,7 @@ bad_out:
static void bab_init_chips(struct cgpu_info *babcgpu, struct bab_info *babinfo)
{
- int chip, chipoff, bank;
+ int chip, chipoff, bank, chips, new_chips, boards;
applog(LOG_WARNING, "%s V1 first test for %d chips ...",
babcgpu->drv->dname, BAB_V1_CHIP_TEST);
@@ -1022,6 +1023,7 @@ static void bab_init_chips(struct cgpu_info *babcgpu, struct bab_info *babinfo)
applog(LOG_WARNING, "%s V2 test %d banks %d chips ...",
babcgpu->drv->dname, BAB_MAXBANKS, BAB_MAXCHIPS);
+ chips = 0;
for (bank = 1; bank <= BAB_MAXBANKS; bank++) {
for (chipoff = 0; chipoff < BAB_BANKCHIPS; chipoff++) {
chip = babinfo->chips + chipoff;
@@ -1029,6 +1031,16 @@ static void bab_init_chips(struct cgpu_info *babcgpu, struct bab_info *babinfo)
}
bab_reset(bank, 64);
bab_detect_chips(babcgpu, babinfo, bank, babinfo->chips, babinfo->chips + BAB_BANKCHIPS);
+ new_chips = babinfo->chips - chips;
+ chips = babinfo->chips;
+ if (new_chips == 0)
+ boards = 0;
+ else
+ boards = (int)((float)(new_chips - 1) / BAB_BOARDCHIPS) + 1;
+ applog(LOG_WARNING, "%s V2 bank %d: %d chips %d board%s",
+ babcgpu->drv->dname, bank, new_chips,
+ boards, (boards == 1) ? "" : "s");
+ babinfo->boards += boards;
}
bab_reset(0, 8);
}
@@ -1074,7 +1086,15 @@ static void bab_detect(bool hotplug)
bab_init_chips(babcgpu, babinfo);
- applog(LOG_WARNING, "%s found %d chips", babcgpu->drv->dname, babinfo->chips);
+ if (babinfo->boards) {
+ applog(LOG_WARNING, "%s found %d chips %d board%s",
+ babcgpu->drv->dname, babinfo->chips,
+ babinfo->boards,
+ (babinfo->boards == 1) ? "" : "s");
+ } else {
+ applog(LOG_WARNING, "%s found %d chips",
+ babcgpu->drv->dname, babinfo->chips);
+ }
if (babinfo->chips == 0)
goto cleanup;