// SPDX-License-Identifier: GPL-2.0-only OR MIT

//! Hardware configuration for t8103 platforms (M1).

use crate::f32;

use super::*;

pub(crate) const HWCONFIG: super::HwConfig = HwConfig {
    chip_id: 0x8103,
    gpu_gen: GpuGen::G13,
    gpu_variant: GpuVariant::G,
    gpu_core: GpuCore::G13G,

    base_clock_hz: 24_000_000,
    num_dies: 1,

    da: HwConfigA {
        unk_87c: -220,
        unk_8cc: 9880,
        unk_e24: 112,
    },
    db: HwConfigB {
        unk_454: 1,
        unk_4e0: 0,
        unk_534: 0,
        unk_ab8: 0x48,
        unk_abc: 0x8,
        unk_b30: 0,
    },
    shared1_tab: &[
        -1, 0x7282, 0x50ea, 0x370a, 0x25be, 0x1c1f, 0x16fb, -1, -1, -1, -1, -1, -1, -1, -1, -1,
    ],
    shared1_a4: 0xffff,
    shared2_tab: &[0x800, 0x1555, -1, -1, -1, -1, -1, -1, 0, 0],
    shared2_unk_508: 0xc00007,
    shared2_curves: None,
    shared3_unk: 0,
    shared3_tab: &[],
    idle_off_standby_timer_default: 0,
    unk_hws2_4: None,
    unk_hws2_24: 0,
    global_unk_54: 0xffff,
    sram_k: f32!(1.02),
    unk_coef_a: &[],
    unk_coef_b: &[],
    global_tab: None,
    has_csafr: false,
    fast_sensor_mask: [0x12, 0],
    fast_sensor_mask_alt: [0x12, 0],
    fast_die0_sensor_present: 0x01,

    power_zones: &[PowerZone {
        target: 30000,
        target_offset: 100,
        filter_tc: 6875,
    }],
    min_sram_microvolt: 850000,
    avg_power_filter_tc_ms: 1000,
    avg_power_ki_only: f32!(7.5),
    avg_power_kp: f32!(4.0),
    avg_power_min_duty_cycle: 40,
    avg_power_target_filter_tc: 125,
    fast_die0_integral_gain: f32!(200.0),
    fast_die0_proportional_gain: f32!(5.0),
    fast_die0_prop_tgt_delta: 0,
    fast_die0_release_temp: 80,
    fender_idle_off_delay_ms: 40,
    fw_early_wake_timeout_ms: 5,
    idle_off_delay_ms: 2,
    perf_boost_ce_step: 25,
    perf_boost_min_util: 100,
    perf_filter_drop_threshold: 0,
    perf_filter_time_constant: 5,
    perf_filter_time_constant2: 50,
    perf_integral_gain: f32!(7.8956833),
    perf_integral_gain2: f32!(0.197392),
    perf_integral_min_clamp: 0,
    perf_proportional_gain: f32!(14.707963),
    perf_proportional_gain2: f32!(6.853981),
    perf_reset_iters: 6,
    perf_tgt_utilization: 85,
    power_sample_period: 8,
    ppm_filter_time_constant_ms: 100,
    ppm_ki: f32!(91.5),
    ppm_kp: f32!(6.9),
    pwr_filter_time_constant: 313,
    pwr_integral_gain: f32!(0.0202129),
    pwr_integral_min_clamp: 0,
    pwr_min_duty_cycle: 40,
    pwr_proportional_gain: f32!(5.2831855),
    pwr_sample_period_aic_clks: None,
    se_engagement_criteria: -1,
    se_filter_time_constant: 9,
    se_filter_time_constant_1: 3,
    se_inactive_threshold: 2500,
    se_ki: f32!(-50.0),
    se_ki_1: f32!(-100.0),
    se_kp: f32!(-5.0),
    se_kp_1: f32!(-10.0),
    se_reset_criteria: 50,
    csafr_min_sram_microvolt: 0,

    num_clusters: 1,
};
