soc/qualcomm/common: Add support for loading APDP image
This patch introduces a new Kconfig option, QC_APDP_ENABLE, to control Application Processor Debug Policy (APDP) image loading. When this option is enabled, the APDP image is loaded during the qclib_load_and_run() sequence. It also adds a new CBFS file entry and table entry definition for apdp_meta, along with a memory region symbol apdp_ramdump_meta for metadata storage. TEST=Create an image.serial.bin and ensure it boots on X1P42100. Change-Id: I8d0847c99a1129359f2c758b7a07b9c022f1c8c8 Signed-off-by: Venkateshwar S <vens@qualcomm.corp-partner.google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/90303 Reviewed-by: Kapil Porwal <kapilporwal@google.com> Reviewed-by: Subrata Banik <subratabanik@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
fc9f828ac0
commit
1d70286d4e
4 changed files with 35 additions and 0 deletions
|
|
@ -25,4 +25,12 @@ config QC_SDI_ENABLE
|
|||
default n
|
||||
prompt "Debug Build: enable SDI"
|
||||
|
||||
config QC_APDP_ENABLE
|
||||
bool
|
||||
default n
|
||||
prompt "Debug Build: enable APDP"
|
||||
help
|
||||
Application Processor Debug Policy (APDP) is a configuration image
|
||||
to define and enforce debugging capabilities and restrictions for APPS.
|
||||
|
||||
endif
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
#define QCLIB_TE_SHRM_META_SETTINGS "shrm_metadata"
|
||||
#define QCLIB_TE_AOP_META_SETTINGS "aop_metadata"
|
||||
#define QCLIB_TE_AOP_DEVCFG_META_SETTINGS "aop_cfg_metadata"
|
||||
#define QCLIB_TE_APDP_META_SETTINGS "apdp_metadata"
|
||||
|
||||
/* BA_BMASK_VALUES (blob_attributes bit mask values) */
|
||||
#define QCLIB_BA_SAVE_TO_STORAGE 0x00000001
|
||||
|
|
@ -42,6 +43,7 @@ enum qclib_cbfs_file {
|
|||
QCLIB_CBFS_SHRM_META,
|
||||
QCLIB_CBFS_AOP_META,
|
||||
QCLIB_CBFS_AOP_DEVCFG_META,
|
||||
QCLIB_CBFS_APDP_META,
|
||||
QCLIB_CBFS_MAX
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ DECLARE_REGION(dtb)
|
|||
DECLARE_REGION(cpr_settings)
|
||||
DECLARE_REGION(qc_blob_meta)
|
||||
DECLARE_REGION(aop_blob_meta)
|
||||
DECLARE_REGION(apdp_ramdump_meta)
|
||||
DECLARE_OPTIONAL_REGION(pmic)
|
||||
DECLARE_REGION(limits_cfg)
|
||||
DECLARE_REGION(aop)
|
||||
|
|
|
|||
|
|
@ -94,6 +94,8 @@ const char *qclib_file_default(enum qclib_cbfs_file file)
|
|||
return CONFIG_CBFS_PREFIX "/aop_meta";
|
||||
case QCLIB_CBFS_AOP_DEVCFG_META:
|
||||
return CONFIG_CBFS_PREFIX "/aop_devcfg_meta";
|
||||
case QCLIB_CBFS_APDP_META:
|
||||
return CONFIG_CBFS_PREFIX "/apdp_meta";
|
||||
default:
|
||||
die("unknown QcLib file %d", file);
|
||||
}
|
||||
|
|
@ -314,6 +316,28 @@ void qclib_load_and_run(void)
|
|||
goto fail;
|
||||
}
|
||||
|
||||
/* Load APDP image */
|
||||
if (CONFIG(QC_APDP_ENABLE)) {
|
||||
struct prog apdp_prog =
|
||||
PROG_INIT(PROG_PAYLOAD, CONFIG_CBFS_PREFIX "/apdp");
|
||||
|
||||
if (!selfload(&apdp_prog))
|
||||
die("SOC image: APDP load failed");
|
||||
|
||||
/* Attempt to load apdp_meta Blob. */
|
||||
data_size = cbfs_load(qclib_file(QCLIB_CBFS_APDP_META),
|
||||
_apdp_ramdump_meta, REGION_SIZE(apdp_ramdump_meta));
|
||||
if (!data_size) {
|
||||
printk(BIOS_ERR,
|
||||
"[%s] /apdp_meta not loaded\n"
|
||||
"apdp_meta is mandatory for APDP authentication; failure is fatal\n"
|
||||
, __func__);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
qclib_add_if_table_entry(QCLIB_TE_APDP_META_SETTINGS, _apdp_ramdump_meta, data_size, 0);
|
||||
}
|
||||
|
||||
/* Attempt to load QCLib elf */
|
||||
qclib = (struct prog)
|
||||
PROG_INIT(PROG_REFCODE, qclib_file(QCLIB_CBFS_QCLIB));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue