Files
Tianling Shen 8f5285bfba atf-20240117-bacca82a8: import new atf (#119)
* atf-20240117-bacca82a8: import new atf

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>

* atf-20240117-bacca82a8: remove Werror

* atf-20240117-bacca82a8: call bromimage-x86_64 for aarch64 host

* atf-20240117-bacca82a8: export ram boot uart option

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>

* atf-20240117-bacca82a8: apply openwrt patches

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>

* atf-20240117-bacca82a8: port board configs

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>

* build.sh: switch to use atf-20240117-bacca82a8

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>

* build.sh: support new menuconfig

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>

* build.sh: pass u-boot path by variable

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>

* atf-20231013-0ea67d76a: drop

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>

---------

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Co-authored-by: hanwckf <hanwckf@vip.qq.com>
2025-08-19 16:26:53 +08:00

46 lines
1.0 KiB
C

/*
* Copyright (c) 2021, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <stdarg.h>
#include <assert.h>
#include <arm_acle.h>
#include <common/debug.h>
#include <common/tf_crc32.h>
/* compute CRC using Arm intrinsic function
*
* This function is useful for the platforms with the CPU ARMv8.0
* (with CRC instructions supported), and onwards.
* Platforms with CPU ARMv8.0 should make sure to add a compile switch
* '-march=armv8-a+crc" for successful compilation of this file.
*
* @crc: previous accumulated CRC
* @buf: buffer base address
* @size: the size of the buffer
*
* Return calculated CRC value
*/
uint32_t tf_crc32(uint32_t crc, const unsigned char *buf, size_t size)
{
assert(buf != NULL);
uint32_t calc_crc = ~crc;
const unsigned char *local_buf = buf;
size_t local_size = size;
/*
* calculate CRC over byte data
*/
while (local_size != 0UL) {
calc_crc = __crc32b(calc_crc, *local_buf);
local_buf++;
local_size--;
}
return ~calc_crc;
}