l4t: Add L4T loader for T210 and T210B01
This commit is contained in:
1213
bootloader/l4t/l4t.c
Normal file
1213
bootloader/l4t/l4t.c
Normal file
File diff suppressed because it is too large
Load Diff
24
bootloader/l4t/l4t.h
Normal file
24
bootloader/l4t/l4t.h
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* L4T Loader for Tegra X1
|
||||
*
|
||||
* Copyright (c) 2020-2022 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,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _L4T_H_
|
||||
#define _L4T_H_
|
||||
|
||||
void launch_l4t(const ini_sec_t *ini_sec, int entry_idx, int is_list, bool t210b01);
|
||||
|
||||
#endif
|
||||
36
bootloader/l4t/l4t_config.inl
Normal file
36
bootloader/l4t/l4t_config.inl
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* L4T Loader for Tegra X1
|
||||
*
|
||||
* Copyright (c) 2020-2022 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,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// Set to 1 to enable early boot debugging.
|
||||
#define DEBUG_LOG_ATF 0
|
||||
#define DEBUG_LOG_BPMPFW 0 // Do not enable if UART setup is hindered during early boot.
|
||||
|
||||
// Set to 1 to lock PMC registers that contain LP0 parameters.
|
||||
#define LOCK_PMC_REGISTERS 0
|
||||
|
||||
// Configurable carveout enable config. Only one can be enabled at a time.
|
||||
#define CARVEOUT_NVDEC_TSEC_ENABLE 0 // Enable for NVDEC bl/prod and full TOS/DRM.
|
||||
#define CARVEOUT_SECFW_ENABLE 1 // SECFW is always allocated even if carveout is disabled.
|
||||
|
||||
/*
|
||||
* WPR Carveout size config.
|
||||
*
|
||||
* L4T: 2MB or 13MB. On non SecureOS env, only 0x100 bytes are used, probably also on full TOS.
|
||||
* On 4GB+ systems, it's normally placed at BANK1_TOP - SIZE;
|
||||
*/
|
||||
#define CARVEOUT_GPUWPR_SIZE_CFG (SZ_8M + SZ_4M + SZ_1M) // Mandatory when CARVEOUT_NVDEC_TSEC_ENABLE is 1.
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "gfx/tui.h"
|
||||
#include "hos/hos.h"
|
||||
#include "hos/secmon_exo.h"
|
||||
#include "l4t/l4t.h"
|
||||
#include <ianos/ianos.h>
|
||||
#include <libs/compr/blz.h>
|
||||
#include <libs/fatfs/ff.h>
|
||||
@@ -458,6 +459,19 @@ parse_failed:
|
||||
// Try to launch Payload or L4T.
|
||||
if (special_path != (char *)-1)
|
||||
_launch_payload(special_path, false, true);
|
||||
else
|
||||
{
|
||||
u32 entry_idx = 0;
|
||||
for (u32 i = 0; i < sec_idx; i++)
|
||||
{
|
||||
if (ments[i].data == cfg_sec)
|
||||
{
|
||||
entry_idx = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
launch_l4t(cfg_sec, entry_idx, 1, h_cfg.t210b01);
|
||||
}
|
||||
}
|
||||
else if (!hos_launch(cfg_sec))
|
||||
{
|
||||
@@ -590,6 +604,19 @@ parse_failed:
|
||||
// Try to launch Payload or L4T.
|
||||
if (special_path != (char *)-1)
|
||||
_launch_payload(special_path, false, true);
|
||||
else
|
||||
{
|
||||
u32 entry_idx = 0;
|
||||
for (u32 i = 0; i < sec_idx; i++)
|
||||
{
|
||||
if (ments[i].data == cfg_sec)
|
||||
{
|
||||
entry_idx = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
launch_l4t(cfg_sec, entry_idx, 0, h_cfg.t210b01);
|
||||
}
|
||||
}
|
||||
else if (!hos_launch(cfg_sec))
|
||||
{
|
||||
@@ -904,7 +931,8 @@ skip_list:
|
||||
// Check if entry is payload or l4t special case.
|
||||
char *special_path = ini_check_special_section(cfg_sec);
|
||||
|
||||
if (!(b_cfg.boot_cfg & BOOT_CFG_FROM_LAUNCH) && h_cfg.bootwait)
|
||||
if ((!(b_cfg.boot_cfg & BOOT_CFG_FROM_LAUNCH) && h_cfg.bootwait) || // Conditional for HOS/Payload.
|
||||
(special_path && special_path == (char *)-1)) // Always show for L4T.
|
||||
{
|
||||
u32 fsize;
|
||||
u8 *logo_buf = NULL;
|
||||
@@ -987,6 +1015,8 @@ skip_list:
|
||||
// Try to launch Payload or L4T.
|
||||
if (special_path != (char *)-1)
|
||||
_launch_payload(special_path, false, false);
|
||||
else
|
||||
launch_l4t(cfg_sec, h_cfg.autoboot, h_cfg.autoboot_list, h_cfg.t210b01);
|
||||
goto error;
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user