soc/qualcomm: Commonize AOP firmware support
Move AOP firmware support from qualcomm/sc7180 into qualcomm/common
BUG=b:182963902
TEST=Validated on qualcomm sc7180 development board
Change-Id: I90b0f48e15df390970e027bff2065b7a89b14cec
Signed-off-by: Ravi Kumar Bokka <rbokka@codeaurora.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/49767
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Shelley Chen <shchen@google.com>
diff --git a/src/soc/qualcomm/sc7180/Makefile.inc b/src/soc/qualcomm/sc7180/Makefile.inc
index 7c393b3..df565b4 100644
--- a/src/soc/qualcomm/sc7180/Makefile.inc
+++ b/src/soc/qualcomm/sc7180/Makefile.inc
@@ -36,7 +36,7 @@
################################################################################
ramstage-y += soc.c
ramstage-y += carve_out.c
-ramstage-y += aop_load_reset.c
+ramstage-y += ../common/aop_load_reset.c
ramstage-y += usb.c
ramstage-$(CONFIG_DRIVERS_UART) += ../common/qupv3_uart.c
ramstage-$(CONFIG_MAINBOARD_DO_NATIVE_VGA_INIT) += display/dsi_phy_pll.c
diff --git a/src/soc/qualcomm/sc7180/aop_load_reset.c b/src/soc/qualcomm/sc7180/aop_load_reset.c
deleted file mode 100644
index d48a422..0000000
--- a/src/soc/qualcomm/sc7180/aop_load_reset.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-
-#include <console/console.h>
-#include <program_loading.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");
-
- 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/sc7180/include/soc/aop.h b/src/soc/qualcomm/sc7180/include/soc/aop.h
deleted file mode 100644
index bdf3f83..0000000
--- a/src/soc/qualcomm/sc7180/include/soc/aop.h
+++ /dev/null
@@ -1,8 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-
-#ifndef _SOC_QUALCOMM_SC7180_AOP_H__
-#define _SOC_QUALCOMM_SC7180_AOP_H__
-
-void aop_fw_load_reset(void);
-
-#endif // _SOC_QUALCOMM_SC7180_AOP_H__
diff --git a/src/soc/qualcomm/sc7180/mmu.c b/src/soc/qualcomm/sc7180/mmu.c
index 03e62e5..6aff9a9 100644
--- a/src/soc/qualcomm/sc7180/mmu.c
+++ b/src/soc/qualcomm/sc7180/mmu.c
@@ -19,9 +19,3 @@
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/sc7180/soc.c b/src/soc/qualcomm/sc7180/soc.c
index e7efff4..af274d2 100644
--- a/src/soc/qualcomm/sc7180/soc.c
+++ b/src/soc/qualcomm/sc7180/soc.c
@@ -5,7 +5,7 @@
#include <soc/mmu.h>
#include <soc/mmu_common.h>
#include <soc/symbols_common.h>
-#include <soc/aop.h>
+#include <soc/aop_common.h>
static void soc_read_resources(struct device *dev)
{