blob: e98cb46c90d781060ffc25578f4a3c0831a332bc [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Prafulla Wadaskar4d4d67d2009-08-16 05:28:19 +05302/*
3 * (C) Copyright 2009
4 * Marvell Semiconductor <www.marvell.com>
5 * Written-by: Prafulla Wadaskar <prafulla@marvell.com>
Prafulla Wadaskar4d4d67d2009-08-16 05:28:19 +05306 */
7
8#ifndef _UBOOT_CRC_H
9#define _UBOOT_CRC_H
10
oliver@schinagl.nl3255e9f2016-11-25 16:30:31 +010011/* lib/crc8.c */
12unsigned int crc8(unsigned int crc_start, const unsigned char *vptr, int len);
13
Peter Tyser685b7f52010-04-12 22:28:05 -050014/* lib/crc32.c */
Prafulla Wadaskar4d4d67d2009-08-16 05:28:19 +053015uint32_t crc32 (uint32_t, const unsigned char *, uint);
16uint32_t crc32_wd (uint32_t, const unsigned char *, uint, uint);
17uint32_t crc32_no_comp (uint32_t, const unsigned char *, uint);
18
Simon Glass0bbd76f2013-02-24 20:30:22 +000019/**
20 * crc32_wd_buf - Perform CRC32 on a buffer and return result in buffer
21 *
22 * @input: Input buffer
23 * @ilen: Input buffer length
24 * @output: Place to put checksum result (4 bytes)
25 * @chunk_sz: Trigger watchdog after processing this many bytes
26 */
27void crc32_wd_buf(const unsigned char *input, uint ilen,
28 unsigned char *output, uint chunk_sz);
29
Marek BehĂșncdccc032017-09-03 17:00:23 +020030/* lib/crc32c.c */
31void crc32c_init(uint32_t *, uint32_t);
32uint32_t crc32c_cal(uint32_t, const char *, int, uint32_t *);
33
Prafulla Wadaskar4d4d67d2009-08-16 05:28:19 +053034#endif /* _UBOOT_CRC_H */