mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-18 02:24:18 +00:00
Merge "fix(intel): update ssbl naming conventions" into integration
This commit is contained in:
commit
ddcce3b134
2 changed files with 15 additions and 8 deletions
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2024, Intel Corporation. All rights reserved.
|
||||
* Copyright (c) 2025, Altera Corporation. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
@ -40,8 +41,8 @@
|
|||
#define SPT_MIN_PARTITIONS (9U)
|
||||
|
||||
#define FACTORY_IMAGE "FACTORY_IMAGE"
|
||||
#define FACTORY_SSBL "FACTORY_IM.SSBL"
|
||||
#define SSBL_SUFFIX ".SSBL"
|
||||
#define FACTORY_SSBL "SSBL.FACTORY_IM"
|
||||
#define SSBL_PREFIX "SSBL."
|
||||
|
||||
typedef struct {
|
||||
const uint32_t magic_number;
|
||||
|
@ -55,7 +56,7 @@ typedef struct {
|
|||
const uint32_t length;
|
||||
const uint32_t flags;
|
||||
} partition[SPT_MAX_PARTITIONS];
|
||||
} __packed spt_table_t;
|
||||
} __packed __aligned(4) spt_table_t;
|
||||
|
||||
uint32_t ros_qspi_get_ssbl_offset(unsigned long *offset);
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2024, Intel Corporation. All rights reserved.
|
||||
* Copyright (c) 2025, Altera Corporation. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
@ -20,6 +21,8 @@
|
|||
|
||||
#include <socfpga_ros.h>
|
||||
|
||||
#define WORD_SIZE (sizeof(uint32_t))
|
||||
|
||||
static void swap_bits(char *const data, uint32_t len)
|
||||
{
|
||||
uint32_t x, y;
|
||||
|
@ -99,7 +102,8 @@ static uint32_t load_and_check_spt(spt_table_t *spt_ptr, size_t offset)
|
|||
return ROS_IMAGE_PARTNUM_OVFL;
|
||||
}
|
||||
|
||||
memcpy_s(&spt_data, SPT_SIZE, spt_ptr, SPT_SIZE);
|
||||
memcpy_s(&spt_data, (sizeof(spt_table_t) / WORD_SIZE),
|
||||
spt_ptr, (SPT_SIZE / WORD_SIZE));
|
||||
spt_data.checksum = 0U;
|
||||
swap_bits((char *)&spt_data, SPT_SIZE);
|
||||
|
||||
|
@ -153,6 +157,7 @@ uint32_t ros_qspi_get_ssbl_offset(unsigned long *offset)
|
|||
}
|
||||
|
||||
uint32_t ret, img_index;
|
||||
size_t len;
|
||||
char ssbl_name[SPT_PARTITION_NAME_LENGTH];
|
||||
static spt_table_t spt;
|
||||
|
||||
|
@ -168,11 +173,12 @@ uint32_t ros_qspi_get_ssbl_offset(unsigned long *offset)
|
|||
|
||||
if (strncmp(spt.partition[img_index].name, FACTORY_IMAGE,
|
||||
SPT_PARTITION_NAME_LENGTH) == 0U) {
|
||||
strlcpy(ssbl_name, FACTORY_SSBL, SPT_PARTITION_NAME_LENGTH);
|
||||
strcpy_secure(ssbl_name, SPT_PARTITION_NAME_LENGTH, FACTORY_SSBL);
|
||||
} else {
|
||||
strlcpy(ssbl_name, spt.partition[img_index].name,
|
||||
SPT_PARTITION_NAME_LENGTH);
|
||||
strlcat(ssbl_name, SSBL_SUFFIX, SPT_PARTITION_NAME_LENGTH);
|
||||
strcpy_secure(ssbl_name, SPT_PARTITION_NAME_LENGTH, SSBL_PREFIX);
|
||||
len = strnlen_secure(ssbl_name, SPT_PARTITION_NAME_LENGTH);
|
||||
strcpy_secure(ssbl_name + len, SPT_PARTITION_NAME_LENGTH - len,
|
||||
spt.partition[img_index].name);
|
||||
}
|
||||
|
||||
for (uint32_t index = 0U; index < spt.partitions; index++) {
|
||||
|
|
Loading…
Add table
Reference in a new issue