summaryrefslogtreecommitdiff
path: root/src/soc/qualcomm/common
diff options
context:
space:
mode:
authormkurumel <mkurumel@codeaurora.org>2020-09-14 23:28:53 +0530
committerJulius Werner <jwerner@chromium.org>2020-11-02 21:58:52 +0000
commita9d225b3e89d6ec061169d5b472095fb9e8ffbc7 (patch)
treebf1b27a48c44af3bd3cd2d9f25884d3737c90884 /src/soc/qualcomm/common
parent82689d2ac8057afcdb6f77b9ecb6e53120edbf61 (diff)
sc7180: Add Modem region in memlayout to avoid modem cleanup in Secboot reboot.
two different modem regions wifi and lte to be handled in QC_SEC and modem Change-Id: Ib4592ca66d3d0db4c4768be4cd27422fe9f786b8 Signed-off-by: Ravi Kumar Bokka <rbokka@codeaurora.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/46661 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
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();
}