bdk: hwinit: remove coreboot support

Everything external is finally updated and beyond parity with old things that needed it.
This commit is contained in:
CTCaer
2026-01-12 03:57:39 +02:00
parent bf5a7b1a12
commit 8ab6f04243
4 changed files with 7 additions and 35 deletions

View File

@@ -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 * 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,
@@ -112,6 +112,5 @@
// #define EXT_PAYLOAD_ADDR 0xC0000000 // #define EXT_PAYLOAD_ADDR 0xC0000000
// #define RCM_PAYLOAD_ADDR (EXT_PAYLOAD_ADDR + ALIGN(PATCHED_RELOC_SZ, 0x10)) // #define RCM_PAYLOAD_ADDR (EXT_PAYLOAD_ADDR + ALIGN(PATCHED_RELOC_SZ, 0x10))
// #define COREBOOT_ADDR (0xD0000000 - rom_size)
#endif #endif

View File

@@ -1,6 +1,6 @@
/* /*
* Copyright (c) 2018 naehrwert * 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 * 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,
@@ -468,7 +468,7 @@ void hw_init()
#endif #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; 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); 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. // 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(); display_end();
clock_disable_host1x(); clock_disable_host1x();
} }

View File

@@ -1,6 +1,6 @@
/* /*
* Copyright (c) 2018 naehrwert * 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 * 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,
@@ -20,14 +20,11 @@
#include <utils/types.h> #include <utils/types.h>
#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_status;
extern u32 hw_rst_reason; extern u32 hw_rst_reason;
void hw_init(); void hw_init();
void hw_deinit(bool coreboot, u32 magic); void hw_deinit(bool keep_display);
void hw_config_arbiter(bool reset); void hw_config_arbiter(bool reset);
u32 hw_get_chip_id(); u32 hw_get_chip_id();

View File

@@ -276,7 +276,7 @@ void power_set_state(power_state_t state)
sd_end(); sd_end();
// De-initialize and power down various hardware. // De-initialize and power down various hardware.
hw_deinit(false, 0); hw_deinit(false);
// Set power state. // Set power state.
switch (state) switch (state)