diff --git a/bdk/memory_map.h b/bdk/memory_map.h index 1facf54b..b5159464 100644 --- a/bdk/memory_map.h +++ b/bdk/memory_map.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2025 CTCaer + * Copyright (c) 2019-2026 CTCaer * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -112,6 +112,5 @@ // #define EXT_PAYLOAD_ADDR 0xC0000000 // #define RCM_PAYLOAD_ADDR (EXT_PAYLOAD_ADDR + ALIGN(PATCHED_RELOC_SZ, 0x10)) -// #define COREBOOT_ADDR (0xD0000000 - rom_size) #endif diff --git a/bdk/soc/hw_init.c b/bdk/soc/hw_init.c index 52598186..15687a34 100644 --- a/bdk/soc/hw_init.c +++ b/bdk/soc/hw_init.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2018 naehrwert - * Copyright (c) 2018-2025 CTCaer + * Copyright (c) 2018-2026 CTCaer * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -468,7 +468,7 @@ void hw_init() #endif } -void hw_deinit(bool coreboot, u32 bl_magic) +void hw_deinit(bool keep_display) { bool tegra_t210 = hw_get_chip_id() == GP_HIDREV_MAJOR_T210; @@ -501,33 +501,9 @@ void hw_deinit(bool coreboot, u32 bl_magic) CLOCK(CLK_RST_CONTROLLER_CLK_ENB_Y_SET) = BIT(CLK_Y_APE); } - // Do coreboot mitigations. - if (coreboot) - { - msleep(10); - - clock_disable_cl_dvfs(); - - // Disable Joy-con detect in order to restore UART TX. - gpio_config(GPIO_PORT_G, GPIO_PIN_0, GPIO_MODE_SPIO); - gpio_config(GPIO_PORT_D, GPIO_PIN_1, GPIO_MODE_SPIO); - - // Reinstate SD controller power. - PMC(APBDEV_PMC_NO_IOPOWER) &= ~PMC_NO_IOPOWER_SDMMC1; - } - // Seamless display or display power off. - switch (bl_magic) + if (!keep_display) { - case BL_MAGIC_CRBOOT_SLD:; - // Set pwm to 0% and switch to gpio mode. - display_backlight_brightness(0, 1000); - gpio_config(GPIO_PORT_V, GPIO_PIN_0, GPIO_MODE_GPIO); - break; - case BL_MAGIC_L4TLDR_SLD: - // Do not disable display or backlight at all. - break; - default: display_end(); clock_disable_host1x(); } diff --git a/bdk/soc/hw_init.h b/bdk/soc/hw_init.h index fcd8d100..377ce70a 100644 --- a/bdk/soc/hw_init.h +++ b/bdk/soc/hw_init.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2018 naehrwert - * Copyright (c) 2018-2024 CTCaer + * Copyright (c) 2018-2026 CTCaer * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -20,14 +20,11 @@ #include -#define BL_MAGIC_CRBOOT_SLD 0x30444C53 // SLD0, seamless display type 0. -#define BL_MAGIC_L4TLDR_SLD 0x31444C53 // SLD1, seamless display type 1. - extern u32 hw_rst_status; extern u32 hw_rst_reason; void hw_init(); -void hw_deinit(bool coreboot, u32 magic); +void hw_deinit(bool keep_display); void hw_config_arbiter(bool reset); u32 hw_get_chip_id(); diff --git a/bdk/utils/util.c b/bdk/utils/util.c index a9cd0c26..d393c5e7 100644 --- a/bdk/utils/util.c +++ b/bdk/utils/util.c @@ -276,7 +276,7 @@ void power_set_state(power_state_t state) sd_end(); // De-initialize and power down various hardware. - hw_deinit(false, 0); + hw_deinit(false); // Set power state. switch (state)