blob: 6764d58babac8197dbe8f593fdf70658c4419414 [file] [log] [blame]
Prafulla Wadaskar4d4d67d2009-08-16 05:28:19 +05301/*
2 * (C) Copyright 2009
3 * Marvell Semiconductor <www.marvell.com>
4 * Written-by: Prafulla Wadaskar <prafulla@marvell.com>
5 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02006 * SPDX-License-Identifier: GPL-2.0+
Prafulla Wadaskar4d4d67d2009-08-16 05:28:19 +05307 */
8
9#ifndef _UBOOT_CRC_H
10#define _UBOOT_CRC_H
11
oliver@schinagl.nl3255e9f2016-11-25 16:30:31 +010012/* lib/crc8.c */
13unsigned int crc8(unsigned int crc_start, const unsigned char *vptr, int len);
14
Peter Tyser685b7f52010-04-12 22:28:05 -050015/* lib/crc32.c */
Prafulla Wadaskar4d4d67d2009-08-16 05:28:19 +053016uint32_t crc32 (uint32_t, const unsigned char *, uint);
17uint32_t crc32_wd (uint32_t, const unsigned char *, uint, uint);
18uint32_t crc32_no_comp (uint32_t, const unsigned char *, uint);
19
Simon Glass0bbd76f2013-02-24 20:30:22 +000020/**
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 */
28void crc32_wd_buf(const unsigned char *input, uint ilen,
29 unsigned char *output, uint chunk_sz);
30
Prafulla Wadaskar4d4d67d2009-08-16 05:28:19 +053031#endif /* _UBOOT_CRC_H */