From b7521465eec3366742c8781c0b452750f26bf57e Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Sun, 5 Sep 2021 12:44:52 -0700 Subject: [PATCH] fusee: tactically don't trash PLLA1, fixes audio corruption on boot --- fusee/program/source/sein/fusee_secure_initialize.cpp | 4 ++++ libraries/libvapours/include/vapours/tegra/tegra_clkrst.hpp | 3 ++- stratosphere/fatal/source/fatal_task_screen.cpp | 1 - 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/fusee/program/source/sein/fusee_secure_initialize.cpp b/fusee/program/source/sein/fusee_secure_initialize.cpp index d615d8b7c..6afe6b7fb 100644 --- a/fusee/program/source/sein/fusee_secure_initialize.cpp +++ b/fusee/program/source/sein/fusee_secure_initialize.cpp @@ -59,6 +59,10 @@ namespace ams::nxboot { } void DoMbistWorkaround() { + /* Enable AHUB/APE clock prior to I2S accesses. */ + reg::ReadWrite(CLKRST + CLK_RST_CONTROLLER_CLK_OUT_ENB_V, CLK_RST_REG_BITS_ENUM(CLK_ENB_V_CLK_ENB_AHUB, ENABLE)); + reg::ReadWrite(CLKRST + CLK_RST_CONTROLLER_CLK_OUT_ENB_Y, CLK_RST_REG_BITS_ENUM(CLK_ENB_Y_CLK_ENB_APE, ENABLE)); + /* Configure CLK_RST_CONTROLLER_CLK_SOURCE_SOR1. */ reg::ReadWrite(CLKRST + CLK_RST_CONTROLLER_CLK_SOURCE_SOR1, CLK_RST_REG_BITS_ENUM(CLK_SOURCE_SOR1_SOR1_CLK_SEL0, MUX), CLK_RST_REG_BITS_ENUM(CLK_SOURCE_SOR1_SOR1_CLK_SEL1, SOR1_CLOCK_SWITCH)); diff --git a/libraries/libvapours/include/vapours/tegra/tegra_clkrst.hpp b/libraries/libvapours/include/vapours/tegra/tegra_clkrst.hpp index d8992d918..717629bd1 100644 --- a/libraries/libvapours/include/vapours/tegra/tegra_clkrst.hpp +++ b/libraries/libvapours/include/vapours/tegra/tegra_clkrst.hpp @@ -230,7 +230,7 @@ DEFINE_CLK_RST_REG_BIT_ENUM(PLLMB_BASE_PLLMB_ENABLE, 30, DISABLE, ENABLE); #define CLK_RST_CONTROLLER_CLK_SOURCE_EMC_DLL (0x664) #define CLK_RST_CONTROLLER_CLK_SOURCE_UART_FST_MIPI_CAL (0x66C) #define CLK_RST_CONTROLLER_CLK_SOURCE_SDMMC_LEGACY_TM (0x694) -#define CLK_RST_CONTROLLER_CLK_SOURCE_NVENC (0x6A4) +#define CLK_RST_CONTROLLER_CLK_SOURCE_NVENC (0x6A0) #define CLK_RST_CONTROLLER_CLK_SOURCE_EMC_SAFE (0x724) /* RST_DEV_*_SET */ @@ -451,6 +451,7 @@ DEFINE_CLK_RST_REG_BIT_ENUM(RST_CPUG_CMPLX_CLR_CLR_PRESETDBG, 30, DISABLE, ENA HANDLER(U, CRAM2, 2, 24) \ HANDLER(V, CPUG, 3, 0) \ HANDLER(V, MSELECT, 3, 3) \ + HANDLER(V, AHUB, 3, 10) \ HANDLER(V, APB2APE, 3, 11) \ HANDLER(V, SPDIF_DOUBLER, 3, 22) \ HANDLER(V, ACTMON, 3, 23) \ diff --git a/stratosphere/fatal/source/fatal_task_screen.cpp b/stratosphere/fatal/source/fatal_task_screen.cpp index bed408f2a..a9e53f7c9 100644 --- a/stratosphere/fatal/source/fatal_task_screen.cpp +++ b/stratosphere/fatal/source/fatal_task_screen.cpp @@ -234,7 +234,6 @@ namespace ams::fatal::srv { font::PrintFormatLine( "Program: %016lX", static_cast(this->context->program_id)); font::AddSpacingLines(0.5f); - /* TODO: Remove Mesosphere identifier in 1.0.0. */ font::PrintFormatLine("Firmware: %s (Atmosphère %u.%u.%u-%s)", config.GetFirmwareVersion().display_version, ATMOSPHERE_RELEASE_VERSION, ams::GetGitRevision()); font::AddSpacingLines(1.5f); if (!exosphere::ResultVersionMismatch::Includes(this->context->result)) {