mirror of
https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016.git
synced 2025-12-10 07:44:53 +01:00
ipq9574: Pass HLOS partition info to TZ
Include SCM call to inform TZ whether HLOS boots from primary or secondary partition Change-Id: Ib1fa2b3c12762d1deed5b99f025c83870c142fa6 Signed-off-by: Vandhiadevan Karunamoorthy <vkarunam@codeaurora.org>
This commit is contained in:
parent
e4e85fedc2
commit
f1fc6e4c71
4 changed files with 50 additions and 1 deletions
|
|
@ -470,6 +470,28 @@ int qca_scm_fuseipq(u32 svc_id, u32 cmd_id, void *buf, size_t len)
|
|||
return ret;
|
||||
}
|
||||
|
||||
int qca_scm_part_info(void *cmd_buf,
|
||||
size_t cmd_len)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (is_scm_armv8())
|
||||
{
|
||||
struct qca_scm_desc desc = {0};
|
||||
desc.arginfo = QCA_SCM_ARGS(1, SCM_VAL);
|
||||
/* args[0] has the part info id */
|
||||
desc.args[0] = * ((unsigned int *)cmd_buf);
|
||||
ret = scm_call_64(SCM_SVC_BOOT, PART_INFO_CMD, &desc);
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = scm_call(SCM_SVC_BOOT, PART_INFO_CMD, cmd_buf, cmd_len,
|
||||
NULL, 0);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int qca_scm_auth_kernel(void *cmd_buf,
|
||||
size_t cmd_len)
|
||||
{
|
||||
|
|
@ -638,6 +660,10 @@ int qca_scm_fuseipq(u32 svc_id, u32 cmd_id, void *buf, size_t len)
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
int qca_scm_part_info(void *cmd_buf, size_t cmd_len)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
int qca_scm_auth_kernel(void *cmd_buf,
|
||||
size_t cmd_len)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
#define SCM_FLAG_COLDBOOT_CPU1 0x1
|
||||
#define SCM_SVC_ID_SHIFT 0xA
|
||||
#define IS_CALL_AVAIL_CMD 0x1
|
||||
#define PART_INFO_CMD 0x22
|
||||
|
||||
#ifdef CONFIG_IPQ_BT_SUPPORT
|
||||
#define SCM_PAS_INIT_IMAGE_CMD 0x1
|
||||
|
|
@ -130,6 +131,7 @@ int qca_scm_dload(u32);
|
|||
int qca_scm_fuseipq(u32, u32, void *, size_t);
|
||||
bool is_scm_armv8(void);
|
||||
int qca_scm_secure_authenticate(void *cmd_buf, size_t cmd_len);
|
||||
int qca_scm_part_info(void *cmd_buf, size_t cmd_len);
|
||||
s32 qca_scm_call_atomic_ver2_32(u32 svc, u32 cmd, u32 arg1, u32 arg2);
|
||||
int qca_scm_auth_kernel(void *cmd_buf, size_t cmd_len);
|
||||
int is_scm_sec_auth_available(u32 svc_id, u32 cmd_id);
|
||||
|
|
|
|||
|
|
@ -35,6 +35,11 @@
|
|||
#define ELF_HDR_PLUS_PHDR_SIZE sizeof(Elf32_Ehdr) + \
|
||||
(NO_OF_PROGRAM_HDRS * sizeof(Elf32_Phdr))
|
||||
|
||||
#define PRIMARY_PARTITION 1
|
||||
#define SECONDARY_PARTITION 2
|
||||
|
||||
extern int qca_scm_part_info(void *cmd_buf, size_t cmd_len);
|
||||
|
||||
unsigned long __stack_chk_guard = 0x000a0dff;
|
||||
static int debug = 0;
|
||||
static char mtdids[256];
|
||||
|
|
@ -444,6 +449,9 @@ static int do_boot_signedimg(cmd_tbl_t *cmdtp, int flag, int argc, char *const a
|
|||
char runcmd[256];
|
||||
int ret;
|
||||
unsigned int request;
|
||||
#ifdef CONFIG_VERSION_ROLLBACK_PARTITION_INFO
|
||||
int part = PRIMARY_PARTITION;
|
||||
#endif
|
||||
#ifdef CONFIG_QCA_MMC
|
||||
block_dev_desc_t *blk_dev;
|
||||
disk_partition_t disk_info;
|
||||
|
|
@ -485,6 +493,19 @@ static int do_boot_signedimg(cmd_tbl_t *cmdtp, int flag, int argc, char *const a
|
|||
request = CONFIG_SYS_LOAD_ADDR;
|
||||
kernel_img_info.kernel_load_addr = request;
|
||||
|
||||
#ifdef CONFIG_VERSION_ROLLBACK_PARTITION_INFO
|
||||
if (smem_bootconfig_info() == 0){
|
||||
ret = get_rootfs_active_partition();
|
||||
if (ret){
|
||||
part = SECONDARY_PARTITION;
|
||||
}
|
||||
}
|
||||
ret = qca_scm_part_info(&part, sizeof(part));
|
||||
if (ret) {
|
||||
printf(" Partition info authentication failed \n");
|
||||
BUG();
|
||||
}
|
||||
#endif
|
||||
if (ipq_fs_on_nand) {
|
||||
#ifdef CONFIG_CMD_UBI
|
||||
/*
|
||||
|
|
@ -628,7 +649,6 @@ static int do_boot_signedimg(cmd_tbl_t *cmdtp, int flag, int argc, char *const a
|
|||
|
||||
ret = qca_scm_auth_kernel(&kernel_img_info,
|
||||
sizeof(kernel_img_info));
|
||||
|
||||
if (ret) {
|
||||
printf("Kernel image authentication failed \n");
|
||||
BUG();
|
||||
|
|
|
|||
|
|
@ -373,4 +373,5 @@ extern loff_t board_env_size;
|
|||
#define CONFIG_IPQ_TZT
|
||||
#define CONFIG_IPQ_FDT_FIXUP
|
||||
#define CONFIG_ARMV7_PSCI
|
||||
#define CONFIG_VERSION_ROLLBACK_PARTITION_INFO
|
||||
#endif /* _IPQ9574_H */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue