Ravi kumar has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/58545 )
Change subject: sc7280: Add Modem region in memlayout to avoid modem cleanup in Secboot reboot. ......................................................................
sc7280: Add Modem region in memlayout to avoid modem cleanup in Secboot reboot.
modem region to be handled in QC_SEC
Signed-off-by: Ravi Kumar Bokka rbokka@codeaurora.org Change-Id: I56bfb210606b08893ff71dd1b6679f1ec102ec95 --- M src/soc/qualcomm/common/include/soc/symbols_common.h M src/soc/qualcomm/sc7280/Makefile.inc A src/soc/qualcomm/sc7280/carve_out.c M src/soc/qualcomm/sc7280/memlayout.ld M src/soc/qualcomm/sc7280/soc.c 5 files changed, 40 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/45/58545/1
diff --git a/src/soc/qualcomm/common/include/soc/symbols_common.h b/src/soc/qualcomm/common/include/soc/symbols_common.h index 7f3cfbb..7560266 100644 --- a/src/soc/qualcomm/common/include/soc/symbols_common.h +++ b/src/soc/qualcomm/common/include/soc/symbols_common.h @@ -25,5 +25,6 @@ DECLARE_REGION(dram_wpss) DECLARE_REGION(shrm) DECLARE_REGION(dram_cpucp) +DECLARE_REGION(dram_modem)
#endif // _SOC_QUALCOMM_SYMBOLS_COMMON_H_ diff --git a/src/soc/qualcomm/sc7280/Makefile.inc b/src/soc/qualcomm/sc7280/Makefile.inc index 858f4fb..773acc1 100644 --- a/src/soc/qualcomm/sc7280/Makefile.inc +++ b/src/soc/qualcomm/sc7280/Makefile.inc @@ -31,10 +31,12 @@ romstage-y += ../common/mmu.c romstage-y += mmu.c romstage-y += ../common/usb/usb.c +romstage-y += carve_out.c romstage-$(CONFIG_DRIVERS_UART) += ../common/qupv3_uart.c
################################################################################ ramstage-y += soc.c +ramstage-y += carve_out.c ramstage-y += cbmem.c ramstage-$(CONFIG_DRIVERS_UART) += ../common/qupv3_uart.c ramstage-y += ../common/usb/usb.c diff --git a/src/soc/qualcomm/sc7280/carve_out.c b/src/soc/qualcomm/sc7280/carve_out.c new file mode 100644 index 0000000..9cc5213 --- /dev/null +++ b/src/soc/qualcomm/sc7280/carve_out.c @@ -0,0 +1,26 @@ +/* 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> +#include <console/console.h> + +#define MODEM_ONLY 0x146A5D00U + +bool soc_modem_carve_out(void **start, void **end) +{ + uint32_t modem_id = read32(_modem_id); + + printk(BIOS_DEBUG, " RAVI: %s : START : %p\n",__func__, _dram_modem); + printk(BIOS_DEBUG, " RAVI: %s : END : %p\n",__func__, _edram_modem); + + switch (modem_id) { + case MODEM_ONLY: + *start = _dram_modem; + *end = _edram_modem; + return true; + default: + return false; + } +} diff --git a/src/soc/qualcomm/sc7280/memlayout.ld b/src/soc/qualcomm/sc7280/memlayout.ld index 57cdb59..1677dc4 100644 --- a/src/soc/qualcomm/sc7280/memlayout.ld +++ b/src/soc/qualcomm/sc7280/memlayout.ld @@ -56,6 +56,7 @@ REGION(dram_soc, 0x80900000, 0x200000, 0x1000) REGION(dram_cpucp,0x80B00000, 0x100000, 0x1000) REGION(dram_wlan, 0x80C00000, 0xC00000, 0x1000) + REGION(dram_modem, 0x8B800000, 0xF600000, 0x1000) REGION(dram_wpss, 0x9AE00000, 0x1900000, 0x1000) POSTRAM_CBFS_CACHE(0x9F800000, 16M) RAMSTAGE(0xA0800000, 16M) diff --git a/src/soc/qualcomm/sc7280/soc.c b/src/soc/qualcomm/sc7280/soc.c index 8d27a46..173c63d 100644 --- a/src/soc/qualcomm/sc7280/soc.c +++ b/src/soc/qualcomm/sc7280/soc.c @@ -6,9 +6,12 @@ #include <soc/symbols_common.h> #include <soc/aop_common.h> #include <soc/cpucp.h> - +#include <console/console.h> static void soc_read_resources(struct device *dev) { + void *start = NULL; + void *end = NULL; + ram_resource(dev, 0, (uintptr_t)ddr_region->offset / KiB, ddr_region->size / KiB); reserved_ram_resource(dev, 1, (uintptr_t)_dram_soc / KiB, @@ -21,6 +24,12 @@ REGION_SIZE(dram_aop) / KiB); reserved_ram_resource(dev, 5, (uintptr_t)_dram_cpucp / KiB, REGION_SIZE(dram_cpucp) / KiB); + if (soc_modem_carve_out(&start, &end)) + { + printk(BIOS_DEBUG, " RAVI: %s : START : %p\n",__func__, start); + printk(BIOS_DEBUG, " RAVI: %s : END : %p\n",__func__, end); + reserved_ram_resource(dev, 6, (uintptr_t)start / KiB, (end - start) / KiB); + } }
static void soc_init(struct device *dev)