diff options
author | Tom Rini <trini@konsulko.com> | 2021-10-04 11:27:55 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-10-04 11:28:16 -0400 |
commit | 50c84208ad50a27382c64af911abba4510a8b608 (patch) | |
tree | 1b79a2e167ca4094d4adc80ab1195f42e792e309 /lib/crc32.c | |
parent | d80bb749fab53da72c4a0e09b8c2d2aaa3103c91 (diff) | |
parent | e17cbdd050f7127737988997f4a01583b34f7c96 (diff) | |
download | u-boot-WIP/04Oct2021.zip u-boot-WIP/04Oct2021.tar.gz u-boot-WIP/04Oct2021.tar.bz2 |
Merge branch 'next'WIP/04Oct2021
Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'lib/crc32.c')
-rw-r--r-- | lib/crc32.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/crc32.c b/lib/crc32.c index f2acc10..5a3127e 100644 --- a/lib/crc32.c +++ b/lib/crc32.c @@ -84,7 +84,7 @@ static void __efi_runtime make_crc_table(void) } crc_table_empty = 0; } -#else +#elif !defined(CONFIG_ARM64_CRC32) /* ======================================================================== * Table of CRC-32's of all single-byte values (made by make_crc_table) */ @@ -184,6 +184,12 @@ const uint32_t * ZEXPORT get_crc_table() */ uint32_t __efi_runtime crc32_no_comp(uint32_t crc, const Bytef *buf, uInt len) { +#ifdef CONFIG_ARM64_CRC32 + crc = cpu_to_le32(crc); + while (len--) + crc = __builtin_aarch64_crc32b(crc, *buf++); + return le32_to_cpu(crc); +#else const uint32_t *tab = crc_table; const uint32_t *b =(const uint32_t *)buf; size_t rem_len; @@ -221,6 +227,7 @@ uint32_t __efi_runtime crc32_no_comp(uint32_t crc, const Bytef *buf, uInt len) } return le32_to_cpu(crc); +#endif } #undef DO_CRC |