diff --git a/bdk/mem/mc.c b/bdk/mem/mc.c
index c695987..d577bd7 100644
--- a/bdk/mem/mc.c
+++ b/bdk/mem/mc.c
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2018 naehrwert
- * Copyright (c) 2018-2020 CTCaer
+ * Copyright (c) 2018-2021 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,
@@ -15,6 +15,7 @@
* along with this program. If not, see .
*/
+#include
#include
#include
#include
@@ -124,13 +125,13 @@ void mc_config_carveout()
MC(MC_SECURITY_CARVEOUT5_CFG0) = 0x8F;
}
-void mc_enable_ahb_redirect()
+void mc_enable_ahb_redirect(bool full_aperture)
{
// Enable ARC_CLK_OVR_ON.
CLOCK(CLK_RST_CONTROLLER_LVL2_CLK_GATE_OVRD) = (CLOCK(CLK_RST_CONTROLLER_LVL2_CLK_GATE_OVRD) & 0xFFF7FFFF) | 0x80000;
//MC(MC_IRAM_REG_CTRL) &= 0xFFFFFFFE;
MC(MC_IRAM_BOM) = 0x40000000;
- MC(MC_IRAM_TOM) = 0x4003F000;
+ MC(MC_IRAM_TOM) = full_aperture ? DRAM_START : 0x4003F000;
}
void mc_disable_ahb_redirect()
diff --git a/bdk/mem/mc.h b/bdk/mem/mc.h
index 1a9bc83..d873c7d 100644
--- a/bdk/mem/mc.h
+++ b/bdk/mem/mc.h
@@ -23,7 +23,7 @@
void mc_config_tsec_carveout(u32 bom, u32 size1mb, bool lock);
void mc_config_carveout();
void mc_config_carveout_finalize();
-void mc_enable_ahb_redirect();
+void mc_enable_ahb_redirect(bool full_aperture);
void mc_disable_ahb_redirect();
void mc_enable();