summaryrefslogtreecommitdiff
path: root/src/soc/qualcomm/sc7280/carve_out.c
diff options
context:
space:
mode:
authorT Michael Turney <quic_mturney@quicinc.com>2022-01-19 18:27:47 -0800
committerShelley Chen <shchen@google.com>2022-01-28 23:58:15 +0000
commit730107e6c1251e43aa96f7a98bc39f31ef963aec (patch)
tree7ec9c51aace7e1e681ab454389330df7ecb7e322 /src/soc/qualcomm/sc7280/carve_out.c
parentbfdc1324367bff60a8fd46518d1937a5b7accd39 (diff)
sc7280: Add Modem region to avoid modem cleanup in Secboot reboot
Modem uses different memory regions based on LTE/WiFi. This adds correct carve-out to prevent region being disturbed. BUG=b:182963902 TEST=Validated on qualcomm sc7280 developement board Signed-off-by: T Michael Turney <quic_mturney@quicinc.com> Change-Id: I56bfb210606b08893ff71dd1b6679f1ec102ec95 Reviewed-on: https://review.coreboot.org/c/coreboot/+/58545 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Shelley Chen <shchen@google.com>
Diffstat (limited to 'src/soc/qualcomm/sc7280/carve_out.c')
-rw-r--r--src/soc/qualcomm/sc7280/carve_out.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/soc/qualcomm/sc7280/carve_out.c b/src/soc/qualcomm/sc7280/carve_out.c
new file mode 100644
index 0000000000..d548235922
--- /dev/null
+++ b/src/soc/qualcomm/sc7280/carve_out.c
@@ -0,0 +1,22 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <arch/stages.h>
+#include <soc/mmu_common.h>
+#include <soc/symbols_common.h>
+#include <device/mmio.h>
+
+#define MODEM_ONLY 0x004c5445
+
+bool soc_modem_carve_out(void **start, void **end)
+{
+ uint32_t modem_id = read32(_modem_id);
+
+ switch (modem_id) {
+ case MODEM_ONLY:
+ *start = _dram_modem;
+ *end = _edram_modem;
+ return true;
+ default:
+ return false;
+ }
+}