bdl: minerva: add deinit function

Removes dependency to Nyx storage for hw init too.
This commit is contained in:
CTCaer
2025-11-27 11:25:08 +02:00
parent 1fc92cfa33
commit 727d37c991
3 changed files with 13 additions and 7 deletions

View File

@@ -141,6 +141,15 @@ void minerva_change_freq(minerva_freq_t freq)
} }
} }
void minerva_deinit()
{
if (!mtc_cfg)
return;
minerva_change_freq(FREQ_204);
mtc_cfg->init_done = 0;
}
void minerva_sdmmc_la_program(void *table, bool t210b01) void minerva_sdmmc_la_program(void *table, bool t210b01)
{ {
u32 freq = *(u32 *)(table + TABLE_FREQ_KHZ_OFFSET); u32 freq = *(u32 *)(table + TABLE_FREQ_KHZ_OFFSET);

View File

@@ -67,6 +67,7 @@ typedef enum
extern void (*minerva_cfg)(mtc_config_t *mtc_cfg, void *); extern void (*minerva_cfg)(mtc_config_t *mtc_cfg, void *);
u32 minerva_init(minerva_str_t *mtc_str); u32 minerva_init(minerva_str_t *mtc_str);
void minerva_deinit();
void minerva_change_freq(minerva_freq_t freq); void minerva_change_freq(minerva_freq_t freq);
void minerva_sdmmc_la_program(void *table, bool t210b01); void minerva_sdmmc_la_program(void *table, bool t210b01);
void minerva_prep_boot_freq(); void minerva_prep_boot_freq();

View File

@@ -1,6 +1,6 @@
/* /*
* Copyright (c) 2018 naehrwert * Copyright (c) 2018 naehrwert
* Copyright (c) 2018-2024 CTCaer * Copyright (c) 2018-2025 CTCaer
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License, * under the terms and conditions of the GNU General Public License,
@@ -47,9 +47,6 @@
#include <thermal/tmp451.h> #include <thermal/tmp451.h>
#include <utils/util.h> #include <utils/util.h>
extern boot_cfg_t b_cfg;
extern volatile nyx_storage_t *nyx_str;
u32 hw_rst_status; u32 hw_rst_status;
u32 hw_rst_reason; u32 hw_rst_reason;
@@ -488,9 +485,8 @@ void hw_deinit(bool coreboot, u32 bl_magic)
regulator_5v_disable(REGULATOR_5V_ALL); regulator_5v_disable(REGULATOR_5V_ALL);
#endif #endif
// set DRAM clock to 204MHz. // Set DRAM clock to 204MHz.
minerva_change_freq(FREQ_204); minerva_deinit();
nyx_str->mtc_cfg.init_done = 0;
// Flush/disable MMU cache. // Flush/disable MMU cache.
bpmp_mmu_disable(); bpmp_mmu_disable();