bdk: hw init: do not touch audio clocks on t210b01

This commit is contained in:
CTCaer 2023-02-11 23:13:41 +02:00
parent ec8c04db8a
commit 114abba815

View file

@ -413,8 +413,7 @@ void hw_init()
void hw_reinit_workaround(bool coreboot, u32 bl_magic) void hw_reinit_workaround(bool coreboot, u32 bl_magic)
{ {
// Disable BPMP max clock. bool tegra_t210 = hw_get_chip_id() == GP_HIDREV_MAJOR_T210;
bpmp_clk_rate_set(BPMP_CLK_NORMAL);
#ifdef BDK_HW_EXTRA_DEINIT #ifdef BDK_HW_EXTRA_DEINIT
// Disable temperature sensor, touchscreen, 5V regulators, Joy-Con and VIC. // Disable temperature sensor, touchscreen, 5V regulators, Joy-Con and VIC.
@ -426,14 +425,20 @@ void hw_reinit_workaround(bool coreboot, u32 bl_magic)
regulator_5v_disable(REGULATOR_5V_ALL); regulator_5v_disable(REGULATOR_5V_ALL);
#endif #endif
// Flush/disable MMU cache and set DRAM clock to 204MHz. // set DRAM clock to 204MHz.
bpmp_mmu_disable();
minerva_change_freq(FREQ_204); minerva_change_freq(FREQ_204);
nyx_str->mtc_cfg.init_done = 0; nyx_str->mtc_cfg.init_done = 0;
// Flush/disable MMU cache and scale down BPMP clock also.
bpmp_mmu_disable();
bpmp_clk_rate_set(BPMP_CLK_NORMAL);
// Re-enable clocks to Audio Processing Engine as a workaround to hanging. // Re-enable clocks to Audio Processing Engine as a workaround to hanging.
CLOCK(CLK_RST_CONTROLLER_CLK_OUT_ENB_V) |= BIT(CLK_V_AHUB); if (tegra_t210)
CLOCK(CLK_RST_CONTROLLER_CLK_OUT_ENB_Y) |= BIT(CLK_Y_APE); {
CLOCK(CLK_RST_CONTROLLER_CLK_OUT_ENB_V) |= BIT(CLK_V_AHUB);
CLOCK(CLK_RST_CONTROLLER_CLK_OUT_ENB_Y) |= BIT(CLK_Y_APE);
}
// Do coreboot mitigations. // Do coreboot mitigations.
if (coreboot) if (coreboot)
@ -461,7 +466,7 @@ void hw_reinit_workaround(bool coreboot, u32 bl_magic)
display_backlight_brightness(brightness, 0); display_backlight_brightness(brightness, 0);
break; break;
case BL_MAGIC_L4TLDR_SLD: case BL_MAGIC_L4TLDR_SLD:
// Do not disable backlight at all. // Do not disable display or backlight at all.
break; break;
default: default:
display_end(); display_end();