Skip to content

Commit

Permalink
Merge pull request #16 from hestiia-engineering/dev
Browse files Browse the repository at this point in the history
Update master to v5.2.0
  • Loading branch information
PixmaHestiia authored Dec 11, 2023
2 parents 918a995 + 39ae010 commit b13be79
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 22 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -34,6 +37,7 @@ jobs:
- name: Build the project
run: |
source ./sdk/environment-setup-cortexa8hf-neon-poky-linux-gnueabi
./update_configure_ac_version.sh
mkdir -p ./build_yocto && cd build_yocto
../autogen.sh
CFLAGS="-O2 -Wall -fcommon" ../configure ${CONFIGURE_FLAGS} --enable-bm1397
Expand All @@ -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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)


Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
26 changes: 14 additions & 12 deletions driver-bm1397.c
Original file line number Diff line number Diff line change
Expand Up @@ -1194,16 +1194,16 @@ 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);
hashboard_send(cgpu_bm1397, baudrate, sizeof(baudrate), 8 * sizeof(baudrate) - 8, "baud");
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);
Expand Down Expand Up @@ -1417,16 +1417,18 @@ 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)",
cgpu_bm1397->cgminer_id, cgpu_bm1397->drv->name, cgpu_bm1397->device_id, nonce, job_id,
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,
Expand All @@ -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;
Expand All @@ -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);
Expand Down Expand Up @@ -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)
{
Expand All @@ -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));
}
Expand Down
8 changes: 4 additions & 4 deletions update_configure_ac_version.sh
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.1.2
5.2.0

0 comments on commit b13be79

Please sign in to comment.