Merge changes I509b7bc5,Ibd36ea5c into integration

* changes:
  fix(fconf): boot fails using ARM_ARCH_MINOR=8
  fix(libc): add memcpy_s source file to libc_asm mk
This commit is contained in:
Olivier Deprez 2024-01-30 17:29:35 +01:00 committed by TrustedFirmware Code Review
commit 7a277aa83d
4 changed files with 65 additions and 83 deletions

View file

@ -1,42 +1,8 @@
#
# Copyright (c) 2016-2021, Arm Limited and Contributors. All rights reserved.
# Copyright (c) 2016-2024, Arm Limited and Contributors. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
#
LIBC_SRCS := $(addprefix lib/libc/, \
abort.c \
assert.c \
exit.c \
memchr.c \
memcmp.c \
memcpy.c \
memcpy_s.c \
memmove.c \
memrchr.c \
memset.c \
printf.c \
putchar.c \
puts.c \
snprintf.c \
strchr.c \
strcmp.c \
strlcat.c \
strlcpy.c \
strlen.c \
strncmp.c \
strnlen.c \
strrchr.c \
strtok.c \
strtoul.c \
strtoll.c \
strtoull.c \
strtol.c)
ifeq (${ARCH},aarch64)
LIBC_SRCS += $(addprefix lib/libc/aarch64/, \
setjmp.S)
endif
INCLUDES += -Iinclude/lib/libc \
-Iinclude/lib/libc/$(ARCH) \
include lib/libc/libc_common.mk

View file

@ -1,44 +1,15 @@
#
# Copyright (c) 2020-2021, Arm Limited. All rights reserved.
# Copyright (c) 2020-2024, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
LIBC_SRCS := $(addprefix lib/libc/, \
abort.c \
assert.c \
exit.c \
memchr.c \
memcmp.c \
memcpy.c \
memmove.c \
memrchr.c \
printf.c \
putchar.c \
puts.c \
snprintf.c \
strchr.c \
strcmp.c \
strlcat.c \
strlcpy.c \
strlen.c \
strncmp.c \
strnlen.c \
strrchr.c \
strtok.c \
strtoul.c \
strtoll.c \
strtoull.c \
strtol.c)
include lib/libc/libc_common.mk
ifeq (${ARCH},aarch64)
LIBC_SRCS += $(addprefix lib/libc/aarch64/, \
memset.S \
setjmp.S)
memset.S)
else
LIBC_SRCS += $(addprefix lib/libc/aarch32/, \
memset.S)
endif
INCLUDES += -Iinclude/lib/libc \
-Iinclude/lib/libc/$(ARCH) \

43
lib/libc/libc_common.mk Normal file
View file

@ -0,0 +1,43 @@
#
# Copyright (c) 2024, Arm Limited and Contributors. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
LIBC_SRCS := $(addprefix lib/libc/, \
abort.c \
assert.c \
exit.c \
memchr.c \
memcmp.c \
memcpy.c \
memcpy_s.c \
memmove.c \
memrchr.c \
memset.c \
printf.c \
putchar.c \
puts.c \
snprintf.c \
strchr.c \
strcmp.c \
strlcat.c \
strlcpy.c \
strlen.c \
strncmp.c \
strnlen.c \
strrchr.c \
strtok.c \
strtoul.c \
strtoll.c \
strtoull.c \
strtol.c)
ifeq (${ARCH},aarch64)
LIBC_SRCS += $(addprefix lib/libc/aarch64/, \
setjmp.S)
endif
INCLUDES += -Iinclude/lib/libc \
-Iinclude/lib/libc/$(ARCH) \

View file

@ -1,10 +1,11 @@
/*
* Copyright (c) 2020-2022, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2020-2024, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <assert.h>
#include <string.h>
#include <common/debug.h>
#include <common/desc_image_load.h>
@ -27,7 +28,7 @@ struct arm_sp_t arm_sp;
int fconf_populate_arm_sp(uintptr_t config)
{
int sp_node, node, err;
union uuid_helper_t uuid_helper;
struct uuid uuid;
unsigned int index = 0;
uint32_t val32;
const unsigned int sip_start = SP_PKG1_ID;
@ -68,13 +69,14 @@ int fconf_populate_arm_sp(uintptr_t config)
/* Read UUID */
err = fdtw_read_uuid(dtb, sp_node, "uuid", 16,
(uint8_t *)&uuid_helper);
(uint8_t *)&uuid);
if (err < 0) {
ERROR("FCONF: cannot read SP uuid\n");
return -1;
}
arm_sp.uuids[index] = uuid_helper;
memcpy_s(&arm_sp.uuids[index].uuid_struct, sizeof(struct uuid),
&uuid, sizeof(struct uuid));
/* Read Load address */
err = fdt_read_uint32(dtb, sp_node, "load-address", &val32);
@ -88,16 +90,16 @@ int fconf_populate_arm_sp(uintptr_t config)
" %02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x"
" load_addr=%lx\n",
__func__,
uuid_helper.uuid_struct.time_low[0], uuid_helper.uuid_struct.time_low[1],
uuid_helper.uuid_struct.time_low[2], uuid_helper.uuid_struct.time_low[3],
uuid_helper.uuid_struct.time_mid[0], uuid_helper.uuid_struct.time_mid[1],
uuid_helper.uuid_struct.time_hi_and_version[0],
uuid_helper.uuid_struct.time_hi_and_version[1],
uuid_helper.uuid_struct.clock_seq_hi_and_reserved,
uuid_helper.uuid_struct.clock_seq_low,
uuid_helper.uuid_struct.node[0], uuid_helper.uuid_struct.node[1],
uuid_helper.uuid_struct.node[2], uuid_helper.uuid_struct.node[3],
uuid_helper.uuid_struct.node[4], uuid_helper.uuid_struct.node[5],
uuid.time_low[0], uuid.time_low[1],
uuid.time_low[2], uuid.time_low[3],
uuid.time_mid[0], uuid.time_mid[1],
uuid.time_hi_and_version[0],
uuid.time_hi_and_version[1],
uuid.clock_seq_hi_and_reserved,
uuid.clock_seq_low,
uuid.node[0], uuid.node[1],
uuid.node[2], uuid.node[3],
uuid.node[4], uuid.node[5],
arm_sp.load_addr[index]);
/* Read owner field only for dualroot CoT */