mirror of
https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016.git
synced 2026-03-06 01:11:47 +01:00
Merge "ipq9574: Add support for DPR feature"
This commit is contained in:
commit
73fddb8d51
3 changed files with 75 additions and 0 deletions
|
|
@ -492,6 +492,28 @@ int qca_scm_part_info(void *cmd_buf,
|
|||
return ret;
|
||||
}
|
||||
|
||||
int qca_scm_dpr(u32 svc_id, u32 cmd_id, void *buf, size_t len)
|
||||
{
|
||||
int ret = 0;
|
||||
uint32_t *status;
|
||||
if (is_scm_armv8())
|
||||
{
|
||||
struct qca_scm_desc desc = {0};
|
||||
desc.arginfo = QCA_SCM_ARGS(1, SCM_VAL);
|
||||
desc.args[0] = *((unsigned int *)buf);
|
||||
|
||||
ret = scm_call_64(svc_id, cmd_id, &desc);
|
||||
|
||||
status = (uint32_t *)(*(((uint32_t *)buf) + 1));
|
||||
*status = desc.ret[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = scm_call(svc_id, cmd_id, buf, len, NULL, 0);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int qca_scm_auth_kernel(void *cmd_buf,
|
||||
size_t cmd_len)
|
||||
{
|
||||
|
|
@ -664,6 +686,10 @@ int qca_scm_part_info(void *cmd_buf, size_t cmd_len)
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
int qca_scm_dpr(u32 svc_id, u32 cmd_id, void *buf, size_t len)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
int qca_scm_auth_kernel(void *cmd_buf,
|
||||
size_t cmd_len)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -40,6 +40,8 @@ extern int ipq_spi_init(u16);
|
|||
unsigned int qpic_frequency = 0, qpic_phase = 0;
|
||||
extern unsigned int qpic_training_offset;
|
||||
|
||||
extern int qca_scm_dpr(u32, u32, void *, size_t);
|
||||
|
||||
void qca_serial_init(struct ipq_serial_platdata *plat)
|
||||
{
|
||||
int ret;
|
||||
|
|
@ -1448,3 +1450,49 @@ void ipq_uboot_fdt_fixup(void)
|
|||
}
|
||||
return;
|
||||
}
|
||||
|
||||
int do_dpr(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
|
||||
{
|
||||
int ret;
|
||||
char *loadaddr;
|
||||
uint32_t dpr_status = 0;
|
||||
struct dpr {
|
||||
uint32_t address;
|
||||
uint32_t status;
|
||||
} dpr;
|
||||
|
||||
if (argc > 2) {
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
|
||||
if (argc == 2){
|
||||
dpr.address = simple_strtoul(argv[1], NULL, 16);
|
||||
} else {
|
||||
loadaddr = getenv("fileaddr");
|
||||
|
||||
if (loadaddr == NULL) {
|
||||
printf("No Arguments provided\n");
|
||||
printf("Command format: dpr_execute <address>\n");
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
if (loadaddr != NULL)
|
||||
dpr.address = simple_strtoul(loadaddr, NULL, 16);
|
||||
}
|
||||
|
||||
dpr.status = (uint32_t)&dpr_status;
|
||||
|
||||
ret = qca_scm_dpr(SCM_SVC_FUSE, TME_DPR_PROCESSING,
|
||||
&dpr, sizeof(dpr));
|
||||
|
||||
if (ret || dpr_status){
|
||||
printf("%s: Error in DPR Processing (%d, %d)\n",
|
||||
__func__, ret, dpr_status);
|
||||
} else {
|
||||
printf("DPR Process sucessful\n");
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
U_BOOT_CMD(dpr_execute, 2, 0, do_dpr,
|
||||
"Debug Policy Request processing\n",
|
||||
"dpr_execute [address] - Processing dpr\n");
|
||||
|
|
|
|||
|
|
@ -108,6 +108,7 @@
|
|||
|
||||
#define KERNEL_AUTH_CMD 0x1E
|
||||
#define SCM_CMD_SEC_AUTH 0x1F
|
||||
#define TME_DPR_PROCESSING 0x21
|
||||
|
||||
#ifdef CONFIG_SMEM_VERSION_C
|
||||
#define RAM_PART_NAME_LENGTH 16
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue