From d74f7219330cc03bdfe38bc395909416a8259c0a Mon Sep 17 00:00:00 2001 From: Maxime Pointet Date: Mon, 11 Dec 2023 23:05:53 +0100 Subject: [PATCH 1/3] feat: Set Baudrate to 3Mb/s for all uarts --- .github/workflows/main.yml | 12 ++++++++---- configure.ac | 2 +- driver-bm1397.c | 26 ++++++++++++++------------ update_configure_ac_version.sh | 8 ++++---- 4 files changed, 27 insertions(+), 21 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 00044b3425..e075c313e0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,9 +20,12 @@ jobs: # deps for menuconfig commands sudo apt-get -y install tmux libncurses-dev bison flex sudo - - name: Download SDK - run: | - curl -L -H "Accept: application/octet-stream" -H "Authorization: Bearer ${{ secrets.GIT_TOKEN }}" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/hestiia-engineering/yocto-cooker-myeko/releases/assets/133811840 -o sdk.sh + - uses: dsaltares/fetch-gh-release-asset@master + with: + repo: 'hestiia-engineering/yocto-cooker-myeko' + file: 'poky-glibc-x86_64-myeko-image-dev-cortexa8hf-neon-myeko-board-toolchain-4.0.12.sh ' + target: 'sdk.sh' + token: ${{ secrets.GIT_TOKEN }} - name: Extract Yocto SDK run: | chmod +x sdk.sh @@ -34,6 +37,7 @@ jobs: - name: Build the project run: | source ./sdk/environment-setup-cortexa8hf-neon-poky-linux-gnueabi + ./update_configure_ac.sh mkdir -p ./build_yocto && cd build_yocto ../autogen.sh CFLAGS="-O2 -Wall -fcommon" ../configure ${CONFIGURE_FLAGS} --enable-bm1397 @@ -55,4 +59,4 @@ jobs: run: | RELEASE_TAG=$GITHUB_REF_NAME # Upload artifacts, potentially overwriting existing files (--clobber) - gh release upload $RELEASE_TAG ./build_yocto/cgminer --clobber + gh release upload $RELEASE_TAG ./build_yocto/cgminer#cgminer_$RELEASE_TAG_armv7_yocto --clobber diff --git a/configure.ac b/configure.ac index 152ed1cbaa..83edd2c6bd 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--## m4_define([v_maj], [5]) m4_define([v_min], [1]) -m4_define([v_mic], [1]) +m4_define([v_mic], [2]) ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--## m4_define([v_ver], [v_maj.v_min.v_mic]) m4_define([lt_rev], m4_eval(v_maj + v_min)) diff --git a/driver-bm1397.c b/driver-bm1397.c index df0f48db55..305a6bb5d8 100644 --- a/driver-bm1397.c +++ b/driver-bm1397.c @@ -1194,8 +1194,8 @@ static void hashboard_send_chain_inactive(struct cgpu_info *cgpu_bm1397) * [3-2] 00 -> unused * [1-0] 01 -> Hashrate TWS */ - unsigned char baudrate[] = { BM1397_CHAIN_WRITE_REG, 0x09, BM1397_DEFAULT_CHIP_ADDR, BM1397_MISC_CONTROL, 0x00, 0x00, 0x61, 0x31, BM1397_CRC5_PLACEHOLDER }; // lo 1.51M - s_bm1397_info->bauddiv = 1; // 1.5M // bauddiv is BT8D value + unsigned char baudrate[] = { BM1397_CHAIN_WRITE_REG, 0x09, BM1397_DEFAULT_CHIP_ADDR, BM1397_MISC_CONTROL, 0x00, 0x00, 0x60, 0x31, BM1397_CRC5_PLACEHOLDER }; // lo 1.51M + s_bm1397_info->bauddiv = 0; // 3Mbt // bauddiv is BT8D value applog(LOG_ERR, "%d: %s %d - setting bauddiv : %02x %02x (ftdi/%d)", cgpu_bm1397->cgminer_id, cgpu_bm1397->drv->name, cgpu_bm1397->device_id, baudrate[5], baudrate[6], s_bm1397_info->bauddiv + 1); @@ -1203,7 +1203,7 @@ static void hashboard_send_chain_inactive(struct cgpu_info *cgpu_bm1397) hashboard_usleep(s_bm1397_info, MS2US(10)); //TODO change baudrate here, don't work for now - uart_set_speed(s_uart_device, B1500000); + uart_set_speed(s_uart_device, B3000000); hashboard_usleep(s_bm1397_info, MS2US(10)); calc_bm1397_freq(cgpu_bm1397, s_bm1397_info->frequency, -1); @@ -1417,6 +1417,8 @@ static void hashboard_bm1397_nonce(struct cgpu_info *cgpu_bm1397, K_ITEM *item) else asic_id = floor((double)(tu8_rx_buffer[4]) / ((double)0x100 / (double)(s_bm1397_info->chips))); + applog(LOG_ERR, "%d: %s %d - nonce %08x @ %02x tu8_rx_buffer[4] %02x by asic_id %d", + cgpu_bm1397->cgminer_id, cgpu_bm1397->drv->name, cgpu_bm1397->device_id, nonce, job_id, tu8_rx_buffer[4], asic_id); if (asic_id >= (int)(s_bm1397_info->chips)) { applog(LOG_ERR, "%d: %s %d - nonce %08x @ %02x tu8_rx_buffer[4] %02x invalid asic_id (0..%d)", @@ -1424,9 +1426,9 @@ static void hashboard_bm1397_nonce(struct cgpu_info *cgpu_bm1397, K_ITEM *item) tu8_rx_buffer[4], (int)(s_bm1397_info->chips)-1); asic_id = (s_bm1397_info->chips - 1); } - struct S_ASIC_INFO *i32_asic = &s_bm1397_info->asics[asic_id]; + struct S_ASIC_INFO *s_asic_info = &s_bm1397_info->asics[asic_id]; - if (nonce == i32_asic->u32_last_found_nonce) + if (nonce == s_asic_info->u32_last_found_nonce) { applog(LOG_ERR, "%d: %s %d - Duplicate Nonce : %08x @ %02x [%02x %02x %02x %02x %02x %02x %02x]", cgpu_bm1397->cgminer_id, cgpu_bm1397->drv->name, cgpu_bm1397->device_id, nonce, job_id, @@ -1436,8 +1438,8 @@ static void hashboard_bm1397_nonce(struct cgpu_info *cgpu_bm1397, K_ITEM *item) s_bm1397_info->dups++; s_bm1397_info->dupsall++; s_bm1397_info->dupsreset++; - i32_asic->u32_duplicate_nonce_countr++; - i32_asic->u32_total_duplicate_nonce_counter++; + s_asic_info->u32_duplicate_nonce_countr++; + s_asic_info->u32_total_duplicate_nonce_counter++; cgtime(&s_bm1397_info->last_dup_time); if (s_bm1397_info->dups == 1) s_bm1397_info->mining_state = MINER_MINING_DUPS; @@ -1448,7 +1450,7 @@ static void hashboard_bm1397_nonce(struct cgpu_info *cgpu_bm1397, K_ITEM *item) mutex_lock(&s_bm1397_info->lock); s_bm1397_info->prev_nonce = nonce; - i32_asic->u32_last_found_nonce = nonce; + s_asic_info->u32_last_found_nonce = nonce; applog(LOG_ERR, "%d: %s %d - Device reported nonce: %08x @ %02x (%d)", cgpu_bm1397->cgminer_id, cgpu_bm1397->drv->name, cgpu_bm1397->device_id, nonce, job_id, s_bm1397_info->tracker); @@ -1638,10 +1640,10 @@ static void hashboard_bm1397_nonce(struct cgpu_info *cgpu_bm1397, K_ITEM *item) mutex_lock(&s_bm1397_info->lock); cgtime(&s_bm1397_info->s_tv_last_nonce); - cgtime(&i32_asic->s_tv_last_nonce); + cgtime(&s_asic_info->s_tv_last_nonce); // count of valid nonces - i32_asic->i32_nonces++; // info only + s_asic_info->i32_nonces++; // info only if (midnum > 0) { @@ -1656,11 +1658,11 @@ static void hashboard_bm1397_nonce(struct cgpu_info *cgpu_bm1397, K_ITEM *item) s_bm1397_info->accepted++; s_bm1397_info->failing = false; s_bm1397_info->dups = 0; - i32_asic->u32_duplicate_nonce_countr = 0; + s_asic_info->u32_duplicate_nonce_countr = 0; mutex_unlock(&s_bm1397_info->lock); if (s_bm1397_info->nb2c_setup) - add_gekko_nonce(s_bm1397_info, i32_asic, &(DATA_NONCE(item)->s_tv_when)); + add_gekko_nonce(s_bm1397_info, s_asic_info, &(DATA_NONCE(item)->s_tv_when)); else add_gekko_nonce(s_bm1397_info, NULL, &(DATA_NONCE(item)->s_tv_when)); } diff --git a/update_configure_ac_version.sh b/update_configure_ac_version.sh index 9ee81834d9..a25ef43a11 100755 --- a/update_configure_ac_version.sh +++ b/update_configure_ac_version.sh @@ -1,14 +1,14 @@ #!/bin/bash # Read version -version=$(cat ../version.txt) +version=$(cat version.txt) maj=$(echo $version | cut -d. -f1) min=$(echo $version | cut -d. -f2) mic=$(echo $version | cut -d. -f3) # Update configure.ac -sed -i "s/m4_define(\[v_maj\], \[[0-9]*\])/m4_define([v_maj], [$maj])/g" ../configure.ac -sed -i "s/m4_define(\[v_min\], \[[0-9]*\])/m4_define([v_min], [$min])/g" ../configure.ac -sed -i "s/m4_define(\[v_mic\], \[[0-9]*\])/m4_define([v_mic], [$mic])/g" ../configure.ac +sed -i "s/m4_define(\[v_maj\], \[[0-9]*\])/m4_define([v_maj], [$maj])/g" configure.ac +sed -i "s/m4_define(\[v_min\], \[[0-9]*\])/m4_define([v_min], [$min])/g" configure.ac +sed -i "s/m4_define(\[v_mic\], \[[0-9]*\])/m4_define([v_mic], [$mic])/g" configure.ac echo "configure.ac updated with version $version" From 2514fde49361d8984adf8ee22e95653f19b33f5c Mon Sep 17 00:00:00 2001 From: Pixma <137048454+PixmaHestiia@users.noreply.github.com> Date: Mon, 11 Dec 2023 23:06:23 +0100 Subject: [PATCH 2/3] chore(dev): release 5.2.0 --- CHANGELOG.md | 7 +++++++ version.txt | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7566f6b2ac..36df84ea17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [5.2.0](https://github.com/hestiia-engineering/cgminer-hestiia-edition/compare/v5.1.2...v5.2.0) (2023-12-11) + + +### Features + +* Set Baudrate to 3Mb/s for all uarts ([d74f721](https://github.com/hestiia-engineering/cgminer-hestiia-edition/commit/d74f7219330cc03bdfe38bc395909416a8259c0a)) + ## [5.1.2](https://github.com/hestiia-engineering/cgminer-hestiia-edition/compare/v5.1.1...v5.1.2) (2023-11-06) diff --git a/version.txt b/version.txt index 61fcc87350..91ff57278e 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -5.1.2 +5.2.0 From 39ae0105cd7cf10e879b8dba781d8ef835aff1a7 Mon Sep 17 00:00:00 2001 From: Maxime Pointet Date: Mon, 11 Dec 2023 23:11:07 +0100 Subject: [PATCH 3/3] fix: update version for CI build --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e075c313e0..19aa34051f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -37,7 +37,7 @@ jobs: - name: Build the project run: | source ./sdk/environment-setup-cortexa8hf-neon-poky-linux-gnueabi - ./update_configure_ac.sh + ./update_configure_ac_version.sh mkdir -p ./build_yocto && cd build_yocto ../autogen.sh CFLAGS="-O2 -Wall -fcommon" ../configure ${CONFIGURE_FLAGS} --enable-bm1397