Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,16 @@ running.

That HB2 config now targets the corrected native mapping for hashboard 2:
`/dev/ttyS1` with reset GPIO `456`, detect GPIO `441`, TMP75 addresses
`0x4C/0x48`, and EEPROM address `0x50`.
`0x4E/0x4A` on `/dev/i2c-1`, and EEPROM address `0x52` on `/dev/i2c-1`.

The Amlogic configs also support a `startup.fan_control` PID loop. The current
S19j Pro profiles enable it with a `60C` target and duty-cycle clamps so the
board can regulate fan speed from the TMP75 readings instead of staying fixed
at the startup PWM percentage.

`/home/root/start.sh` now sources `/home/root/mujina.env` first when present,
so pool credentials, API bind address, and log level can be adjusted without
editing the wrapper itself. A template lives at [`mujina.env.example`](mujina.env.example).

### GT Touch USB Display

Expand Down
18 changes: 14 additions & 4 deletions mujina-hb2.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ psu_settle_ms = 2000
reset_assert_ms = 100
reset_release_ms = 2000

[hardware.amlogic_control_board.startup.fan_control]
enabled = true
target_temp_c = 60.0
min_percent = 35
max_percent = 100
kp = 3.0
ki = 0.15
kd = 8.0
integral_limit = 200.0

[hardware.amlogic_control_board.startup.health_gate]
read_eeprom_before_mining = true
read_temperatures_before_mining = true
Expand Down Expand Up @@ -65,8 +75,8 @@ model = "s19j_pro"
serial_path = "/dev/ttyS1"
reset_gpio = 456
detect_gpio = 441
temp_i2c_device = "/dev/i2c-0"
temp_sensor_addresses = [76, 72]
eeprom_i2c_device = "/dev/i2c-0"
eeprom_address = 80
temp_i2c_device = "/dev/i2c-1"
temp_sensor_addresses = [78, 74]
eeprom_i2c_device = "/dev/i2c-1"
eeprom_address = 82
required = true
23 changes: 21 additions & 2 deletions mujina-miner/src/asic/bm13xx/thread_v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,25 @@ fn min_viable_chip_count(expected: usize) -> usize {
expected / 2
}

fn configured_target_frequency() -> protocol::Frequency {
const DEFAULT_TARGET_FREQ_MHZ: f32 = 500.0;

match std::env::var("MUJINA_TARGET_FREQ_MHZ") {
Ok(raw) => match raw.parse::<f32>() {
Ok(mhz) if mhz.is_finite() && mhz > 0.0 => protocol::Frequency::from_mhz(mhz),
Ok(_) | Err(_) => {
warn!(
value = %raw,
default_mhz = DEFAULT_TARGET_FREQ_MHZ,
"Invalid MUJINA_TARGET_FREQ_MHZ; using default"
);
protocol::Frequency::from_mhz(DEFAULT_TARGET_FREQ_MHZ)
}
},
Err(_) => protocol::Frequency::from_mhz(DEFAULT_TARGET_FREQ_MHZ),
}
}

/// [`HashThread`] implementation for BM13xx ASIC chains.
///
/// The scheduler uses this to dispatch mining work to BM13xx chips.
Expand Down Expand Up @@ -663,8 +682,8 @@ where
self.execute_reg_config_perchip().await?;

// 7. Ramp frequency to target (flat voltage throughout)
self.execute_frequency_ramp(protocol::Frequency::from_mhz(500.0))
.await?;
let target_frequency = configured_target_frequency();
self.execute_frequency_ramp(target_frequency).await?;

self.chip_state = ChipState::Initialized;
let status = self.update_status(|status| {
Expand Down
Loading