X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=arch%2Farm%2Fmach-tegra%2Fboard2.c;h=12257a42b51b645da544dd5f1b9fc458ccde7681;hb=f6c6df7ebc12fdaab252c5869732cef6fa48d864;hp=5ecadf705e7ebaffa35a2c97f1a2df4532a0b3eb;hpb=406fd7e207d3593f150079514a371dccdc651ce7;p=oweals%2Fu-boot.git diff --git a/arch/arm/mach-tegra/board2.c b/arch/arm/mach-tegra/board2.c index 5ecadf705e..12257a42b5 100644 --- a/arch/arm/mach-tegra/board2.c +++ b/arch/arm/mach-tegra/board2.c @@ -6,6 +6,7 @@ #include #include +#include #include #include #include @@ -210,6 +211,19 @@ int board_early_init_f(void) int board_late_init(void) { +#if CONFIG_IS_ENABLED(EFI_LOADER) + if (gd->bd->bi_dram[1].start) { + /* + * Only bank 0 is below board_get_usable_ram_top(), so all of + * bank 1 is not mapped by the U-Boot MMU configuration, and so + * we must prevent EFI from using it. + */ + efi_add_memory_map(gd->bd->bi_dram[1].start, + gd->bd->bi_dram[1].size >> EFI_PAGE_SHIFT, + EFI_BOOT_SERVICES_DATA, false); + } +#endif + #if defined(CONFIG_TEGRA_SUPPORT_NON_SECURE) if (tegra_cpu_is_non_secure()) { printf("CPU is in NS mode\n"); @@ -252,7 +266,7 @@ static ulong carveout_size(void) #elif defined(CONFIG_ARMV7_SECURE_RESERVE_SIZE) // BASE+SIZE might not == 4GB. If so, we want the carveout to cover // from BASE to 4GB, not BASE to BASE+SIZE. - return (0 - CONFIG_ARMV7_SECURE_BASE); + return (0 - CONFIG_ARMV7_SECURE_BASE) & ~(SZ_2M - 1); #else return 0; #endif