  				applog(LOG_ERR, "%d: enumeration: %d <-> %d",
 -				       bid, a1->num_chips, n);
 +				       cid, a1->num_chips, n);
->>>>>>> Stashed changes
  				if (n != 0)
  					a1->num_chips = n;
  			}
  			applog(LOG_WARNING, "%d: detected %d chips",
-<<<<<<< Updated upstream
--			       cid, a1->num_chips);
-+			       bid, a1->num_chips);
- 			return a1->num_chips;
- 		}
- 		bool s = spi_transfer(a1->spi_ctx, NULL, a1->spi_rx, 2);
-@@ -463,7 +550,7 @@ static int chain_detect(struct A1_chain *a1)
- 		if (!s)
- 			return 0;
- 	}
--	applog(LOG_WARNING, "%d: no A1 chip-chain detected", cid);
-+	applog(LOG_WARNING, "%d: no A1 chip-chain detected", bid);
- 	return 0;
- }
- 
-@@ -486,13 +573,13 @@ static void disable_chip(struct A1_chain *a1, uint8_t chip_id)
- {
- 	flush_spi(a1);
- 	struct A1_chip *chip = &a1->chips[chip_id - 1];
--	int cid = a1->chain_id;
-+	int bid = a1->board_id;
- 	if (is_chip_disabled(a1, chip_id)) {
- 		applog(LOG_WARNING, "%d: chip %d already disabled",
--		       cid, chip_id);
-+		       bid, chip_id);
- 		return;
- 	}
--	applog(LOG_WARNING, "%d: temporary disabling chip %d", cid, chip_id);
-+	applog(LOG_WARNING, "%d: temporary disabling chip %d", bid, chip_id);
- 	chip->cooldown_begin = get_current_ms();
- }
- 
-@@ -500,7 +587,7 @@ static void disable_chip(struct A1_chain *a1, uint8_t chip_id)
- void check_disabled_chips(struct A1_chain *a1)
- {
- 	int i;
--	int cid = a1->chain_id;
-+	int bid = a1->board_id;
- 	for (i = 0; i < a1->num_active_chips; i++) {
- 		int chip_id = i + 1;
- 		struct A1_chip *chip = &a1->chips[i];
-@@ -514,11 +601,11 @@ void check_disabled_chips(struct A1_chain *a1)
- 		if (!cmd_READ_REG(a1, chip_id)) {
- 			chip->fail_count++;
- 			applog(LOG_WARNING, "%d: chip %d not yet working - %d",
--			       cid, chip_id, chip->fail_count);
-+			       bid, chip_id, chip->fail_count);
- 			if (chip->fail_count > DISABLE_CHIP_FAIL_THRESHOLD) {
- 				applog(LOG_WARNING,
- 				       "%d: completely disabling chip %d at %d",
--				       cid, chip_id, chip->fail_count);
-+				       bid, chip_id, chip->fail_count);
- 				chip->disabled = true;
- 				a1->num_cores -= chip->num_cores;
- 				continue;
-@@ -528,7 +615,7 @@ void check_disabled_chips(struct A1_chain *a1)
- 			continue;
- 		}
- 		applog(LOG_WARNING, "%d: chip %d is working again",
--		       cid, chip_id);
-+		       bid, chip_id);
- 		chip->cooldown_begin = 0;
- 		chip->fail_count = 0;
- 	}
-@@ -585,9 +672,7 @@ static uint8_t *create_job(uint8_t chip_id, uint8_t job_id, struct work *work)
- 	p1[0] = bswap_32(p2[0]);
- 	p1[1] = bswap_32(p2[1]);
- 	p1[2] = bswap_32(p2[2]);
--#ifdef USE_REAL_DIFF
- 	p1[4] = get_diff(work->sdiff);
--#endif
- 	return job;
- }
- 
-@@ -595,17 +680,17 @@ static uint8_t *create_job(uint8_t chip_id, uint8_t job_id, struct work *work)
- static bool set_work(struct A1_chain *a1, uint8_t chip_id, struct work *work,
- 		     uint8_t queue_states)
- {
--	int cid = a1->chain_id;
-+	int bid = a1->board_id;
-=======
 -			       bid, a1->num_chips);
 +			       cid, a1->num_chips);
  			return a1->num_chips;

 
-	bool retval = spi_transfer(a1->spi_ctx, a1->spi_tx, a1->spi_rx, tx_len);
+	assert(spi_transfer(a1->spi_ctx, a1->spi_tx, a1->spi_rx, tx_len));
>>>>>>> Stashed changes
 	hexdump("send: TX", a1->spi_tx, tx_len);
 	hexdump("send: RX", a1->spi_rx, tx_len);
 
 	int poll_len = resp_len;
 	if (chip_id == 0) {
 		if (a1->num_chips == 0) {
<<<<<<< Updated upstream
-			applog(LOG_ERR, "%d: unknown chips in chain, "
-			       "assuming 8", a1->chain_id);
+			applog(LOG_ERR, "%d: unknown chips in chain, assuming 8",
+			       a1->board_id);
 			poll_len += 32;
 		}
 		poll_len += 4 * a1->num_chips;
@@ -177,7 +254,7 @@ static uint8_t *cmd_BIST_FIX_BCAST(struct A1_chain *a1)
 {
 	uint8_t *ret = exec_cmd(a1, A1_BIST_FIX, 0x00, NULL, 0, 0);
 	if (ret == NULL || ret[0] != A1_BIST_FIX) {
-		applog(LOG_ERR, "%d: cmd_BIST_FIX_BCAST failed", a1->chain_id);
+		applog(LOG_ERR, "%d: cmd_BIST_FIX_BCAST failed", a1->board_id);
 		return NULL;
 	}
 	return ret;
@@ -190,7 +267,7 @@ static uint8_t *cmd_RESET_BCAST(struct A1_chain *a1, uint8_t strategy)
 	s[1] = strategy;
 	uint8_t *ret = exec_cmd(a1, A1_RESET, 0x00, s, 2, 0);
 	if (ret == NULL || (ret[0] != A1_RESET && a1->num_chips != 0)) {
-		applog(LOG_ERR, "%d: cmd_RESET_BCAST failed", a1->chain_id);
+		applog(LOG_ERR, "%d: cmd_RESET_BCAST failed", a1->board_id);
 		return NULL;
 	}
 	return ret;
@@ -202,21 +279,22 @@ static uint8_t *cmd_READ_RESULT_BCAST(struct A1_chain *a1)
 	memset(a1->spi_tx, 0, tx_len);
 	a1->spi_tx[0] = A1_READ_RESULT;
 
-	assert(spi_transfer(a1->spi_ctx, a1->spi_tx, a1->spi_rx, tx_len));
+	bool retval = spi_transfer(a1->spi_ctx, a1->spi_tx, a1->spi_rx, tx_len);
=======
-			applog(LOG_ERR, "%d: unknown chips in chain, assuming 8",
-			       a1->board_id);
+			applog(LOG_ERR, "%d: unknown chips in chain, "

+- driver-avalon2: this functions used on detect, which don't have thr setup yet
+
+
 Version 4.3.0 - 18th April 2014
 
 - Put sleep in spond hash instead of queue full function
diff --git a/README b/README
index 7cd8478..c3eb8d6 100644
--- a/README
+++ b/README
