Attention is currently required from: Martin Roth, Julius Werner. Ravi kumar has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/49767 )
Change subject: sc7280: aop blob loading changes ......................................................................
sc7280: aop blob loading changes
Change-Id: I90b0f48e15df390970e027bff2065b7a89b14cec Signed-off-by: Ravi Kumar Bokka rbokka@codeaurora.org --- M src/soc/qualcomm/sc7280/Makefile.inc A src/soc/qualcomm/sc7280/aop_load_reset.c A src/soc/qualcomm/sc7280/include/soc/aop.h M src/soc/qualcomm/sc7280/include/soc/symbols.h M src/soc/qualcomm/sc7280/memlayout.ld M src/soc/qualcomm/sc7280/mmu.c M src/soc/qualcomm/sc7280/soc.c 7 files changed, 68 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/67/49767/1
diff --git a/src/soc/qualcomm/sc7280/Makefile.inc b/src/soc/qualcomm/sc7280/Makefile.inc index 70127b1..9e1c777 100644 --- a/src/soc/qualcomm/sc7280/Makefile.inc +++ b/src/soc/qualcomm/sc7280/Makefile.inc @@ -54,6 +54,7 @@ ramstage-$(CONFIG_DRIVERS_UART) += qupv3_uart.c ramstage-y += qupv3_config.c ramstage-y += qcom_qup_se.c +ramstage-y += aop_load_reset.c
################################################################################
@@ -74,6 +75,22 @@ $(objcbfs)/bootblock.bin
################################################################################ +BL31_FILE := $(SC7280_BLOB)/qtiseclib/bl31.elf +BL31_CBFS := $(CONFIG_CBFS_PREFIX)/bl31 +$(BL31_CBFS)-file := $(BL31_FILE) +$(BL31_CBFS)-type := payload +$(BL31_CBFS)-compression := none +cbfs-files-y += $(BL31_CBFS) + +################################################################################ +AOP_FILE := $(SC7280_BLOB)/aop/aop.mbn +AOP_CBFS := $(CONFIG_CBFS_PREFIX)/aop +$(AOP_CBFS)-file := $(AOP_FILE) +$(AOP_CBFS)-type := payload +$(AOP_CBFS)-compression := $(CBFS_COMPRESS_FLAG) +cbfs-files-y += $(AOP_CBFS) + +################################################################################ UART_FW_FILE := $(SC7280_BLOB)/qup_fw/uart_fw.bin UART_FW_CBFS := $(CONFIG_CBFS_PREFIX)/uart_fw $(UART_FW_CBFS)-file := $(UART_FW_FILE) diff --git a/src/soc/qualcomm/sc7280/aop_load_reset.c b/src/soc/qualcomm/sc7280/aop_load_reset.c new file mode 100644 index 0000000..dafde90 --- /dev/null +++ b/src/soc/qualcomm/sc7280/aop_load_reset.c @@ -0,0 +1,26 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <cbfs.h> +#include <console/console.h> +#include <soc/mmu.h> +#include <soc/aop.h> +#include <soc/clock.h> + +void aop_fw_load_reset(void) +{ + bool aop_fw_entry; + + struct prog aop_fw_prog = + PROG_INIT(PROG_PAYLOAD, CONFIG_CBFS_PREFIX "/aop"); + + if (prog_locate(&aop_fw_prog)) + die("SOC image: AOP_FW not found"); + + aop_fw_entry = selfload(&aop_fw_prog); + if (!aop_fw_entry) + die("SOC image: AOP load failed"); + + clock_reset_aop(); + + printk(BIOS_DEBUG, "\nSOC:AOP brought out of reset.\n"); +} diff --git a/src/soc/qualcomm/sc7280/include/soc/aop.h b/src/soc/qualcomm/sc7280/include/soc/aop.h new file mode 100644 index 0000000..826c413 --- /dev/null +++ b/src/soc/qualcomm/sc7280/include/soc/aop.h @@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef _SOC_QUALCOMM_SC7280_AOP_H__ +#define _SOC_QUALCOMM_SC7280_AOP_H__ + +void aop_fw_load_reset(void); + +#endif // _SOC_QUALCOMM_SC7280_AOP_H__ + diff --git a/src/soc/qualcomm/sc7280/include/soc/symbols.h b/src/soc/qualcomm/sc7280/include/soc/symbols.h index 16847f6..8ccd183 100644 --- a/src/soc/qualcomm/sc7280/include/soc/symbols.h +++ b/src/soc/qualcomm/sc7280/include/soc/symbols.h @@ -14,5 +14,7 @@ DECLARE_REGION(limits_cfg) DECLARE_REGION(aop) DECLARE_REGION(shrm) +DECLARE_REGION(aop_code_ram) +DECLARE_REGION(aop_data_ram)
#endif /* _SOC_QUALCOMM_SC7280_SYMBOLS_H_ */ diff --git a/src/soc/qualcomm/sc7280/memlayout.ld b/src/soc/qualcomm/sc7280/memlayout.ld index 60be6975..1a68307 100644 --- a/src/soc/qualcomm/sc7280/memlayout.ld +++ b/src/soc/qualcomm/sc7280/memlayout.ld @@ -20,7 +20,8 @@ REGION(shrm, 0x09060000, 64K , 4K)
AOPSRAM_START(0x0B000000) - REGION(aop, 0x0B000000, 0x100000, 4096) + REGION(aop_code_ram, 0x0B000000, 0x80000, 4096) + REGION(aop_data_ram, 0x0B0E0000, 0x20000, 4096) AOPSRAM_END(0x0B100000)
SSRAM_START(0x14680000) @@ -51,7 +52,7 @@
DRAM_START(0x80000000) /* Various hardware/software subsystems make use of this area */ - REGION(dram_aop, 0x80800000, 0x040000, 0x1000) + REGION(dram_aop, 0x80800000, 0x080000, 0x1000) REGION(dram_soc, 0x80900000, 0x200000, 0x1000) POSTRAM_CBFS_CACHE(0x9F800000, 16M) RAMSTAGE(0xA0800000, 16M) diff --git a/src/soc/qualcomm/sc7280/mmu.c b/src/soc/qualcomm/sc7280/mmu.c index 9905c29..abe9828 100644 --- a/src/soc/qualcomm/sc7280/mmu.c +++ b/src/soc/qualcomm/sc7280/mmu.c @@ -19,3 +19,9 @@
mmu_enable(); } + +void soc_mmu_dram_config_post_dram_init(void) +{ + mmu_config_range((void *)_aop_code_ram, REGION_SIZE(aop_code_ram), CACHED_RAM); + mmu_config_range((void *)_aop_data_ram, REGION_SIZE(aop_data_ram), CACHED_RAM); +} diff --git a/src/soc/qualcomm/sc7280/soc.c b/src/soc/qualcomm/sc7280/soc.c index 7233d38..40308b9 100644 --- a/src/soc/qualcomm/sc7280/soc.c +++ b/src/soc/qualcomm/sc7280/soc.c @@ -5,17 +5,21 @@ #include <soc/mmu.h> #include <soc/mmu_common.h> #include <soc/symbols.h> +#include <soc/aop.h>
static void soc_read_resources(struct device *dev) { ram_resource(dev, 0, (uintptr_t)ddr_region->offset / KiB, ddr_region->size / KiB); - reserved_ram_resource(dev, 1, (uintptr_t)_dram_soc / KiB, + reserved_ram_resource(dev, 1, (uintptr_t)_dram_aop / KiB, + REGION_SIZE(dram_aop) / KiB); + reserved_ram_resource(dev, 2, (uintptr_t)_dram_soc / KiB, REGION_SIZE(dram_soc) / KiB); }
static void soc_init(struct device *dev) { + aop_fw_load_reset(); }
static struct device_operations soc_ops = {