aboutsummaryrefslogtreecommitdiff
path: root/src/soc/qualcomm/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/qualcomm/common')
-rw-r--r--src/soc/qualcomm/common/include/soc/mmu_common.h1
-rw-r--r--src/soc/qualcomm/common/mmu.c11
2 files changed, 11 insertions, 1 deletions
diff --git a/src/soc/qualcomm/common/include/soc/mmu_common.h b/src/soc/qualcomm/common/include/soc/mmu_common.h
index a38196fada..b6c8aabf4f 100644
--- a/src/soc/qualcomm/common/include/soc/mmu_common.h
+++ b/src/soc/qualcomm/common/include/soc/mmu_common.h
@@ -14,5 +14,6 @@ static struct region * const ddr_region = (struct region *)_ddr_information;
void soc_mmu_dram_config_post_dram_init(void);
void qc_mmu_dram_config_post_dram_init(void *ddr_base, size_t ddr_size);
+bool soc_modem_carve_out(void **start, void **end);
#endif /* _SOC_QUALCOMM_MMU_COMMON_H_ */
diff --git a/src/soc/qualcomm/common/mmu.c b/src/soc/qualcomm/common/mmu.c
index 4f606be3e0..ba1173edf9 100644
--- a/src/soc/qualcomm/common/mmu.c
+++ b/src/soc/qualcomm/common/mmu.c
@@ -4,10 +4,19 @@
#include <soc/mmu.h>
#include <soc/mmu_common.h>
+__weak bool soc_modem_carve_out(void **start, void **end) { return false; }
__weak void soc_mmu_dram_config_post_dram_init(void) { /* no-op */ }
void qc_mmu_dram_config_post_dram_init(void *ddr_base, size_t ddr_size)
{
- mmu_config_range((void *)ddr_base, ddr_size, CACHED_RAM);
+ void *start = NULL;
+ void *end = NULL;
+
+ if (!soc_modem_carve_out(&start, &end)) {
+ mmu_config_range((void *)ddr_base, ddr_size, CACHED_RAM);
+ } else {
+ mmu_config_range(ddr_base, start - ddr_base, CACHED_RAM);
+ mmu_config_range(end, ddr_base + ddr_size - end, CACHED_RAM);
+ }
soc_mmu_dram_config_post_dram_init();
}