Prafulla Wadaskar | 4d4d67d | 2009-08-16 05:28:19 +0530 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2009 |
| 3 | * Marvell Semiconductor <www.marvell.com> |
| 4 | * Written-by: Prafulla Wadaskar <prafulla@marvell.com> |
| 5 | * |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 6 | * SPDX-License-Identifier: GPL-2.0+ |
Prafulla Wadaskar | 4d4d67d | 2009-08-16 05:28:19 +0530 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | #ifndef _UBOOT_CRC_H |
| 10 | #define _UBOOT_CRC_H |
| 11 | |
oliver@schinagl.nl | 3255e9f | 2016-11-25 16:30:31 +0100 | [diff] [blame] | 12 | /* lib/crc8.c */ |
| 13 | unsigned int crc8(unsigned int crc_start, const unsigned char *vptr, int len); |
| 14 | |
Peter Tyser | 685b7f5 | 2010-04-12 22:28:05 -0500 | [diff] [blame] | 15 | /* lib/crc32.c */ |
Prafulla Wadaskar | 4d4d67d | 2009-08-16 05:28:19 +0530 | [diff] [blame] | 16 | uint32_t crc32 (uint32_t, const unsigned char *, uint); |
| 17 | uint32_t crc32_wd (uint32_t, const unsigned char *, uint, uint); |
| 18 | uint32_t crc32_no_comp (uint32_t, const unsigned char *, uint); |
| 19 | |
Simon Glass | 0bbd76f | 2013-02-24 20:30:22 +0000 | [diff] [blame] | 20 | /** |
| 21 | * crc32_wd_buf - Perform CRC32 on a buffer and return result in buffer |
| 22 | * |
| 23 | * @input: Input buffer |
| 24 | * @ilen: Input buffer length |
| 25 | * @output: Place to put checksum result (4 bytes) |
| 26 | * @chunk_sz: Trigger watchdog after processing this many bytes |
| 27 | */ |
| 28 | void crc32_wd_buf(const unsigned char *input, uint ilen, |
| 29 | unsigned char *output, uint chunk_sz); |
| 30 | |
Marek BehĂșn | cdccc03 | 2017-09-03 17:00:23 +0200 | [diff] [blame] | 31 | /* lib/crc32c.c */ |
| 32 | void crc32c_init(uint32_t *, uint32_t); |
| 33 | uint32_t crc32c_cal(uint32_t, const char *, int, uint32_t *); |
| 34 | |
Prafulla Wadaskar | 4d4d67d | 2009-08-16 05:28:19 +0530 | [diff] [blame] | 35 | #endif /* _UBOOT_CRC_H */ |