crc.h 797 Bytes
Newer Older
1 2 3 4 5
/*
 * (C) Copyright 2009
 * Marvell Semiconductor <www.marvell.com>
 * Written-by: Prafulla Wadaskar <prafulla@marvell.com>
 *
6
 * SPDX-License-Identifier:	GPL-2.0+
7 8 9 10 11
 */

#ifndef _UBOOT_CRC_H
#define _UBOOT_CRC_H

12
/* lib/crc32.c */
13 14 15 16
uint32_t crc32 (uint32_t, const unsigned char *, uint);
uint32_t crc32_wd (uint32_t, const unsigned char *, uint, uint);
uint32_t crc32_no_comp (uint32_t, const unsigned char *, uint);

17 18 19 20 21 22 23 24 25 26 27
/**
 * crc32_wd_buf - Perform CRC32 on a buffer and return result in buffer
 *
 * @input:	Input buffer
 * @ilen:	Input buffer length
 * @output:	Place to put checksum result (4 bytes)
 * @chunk_sz:	Trigger watchdog after processing this many bytes
 */
void crc32_wd_buf(const unsigned char *input, uint ilen,
		    unsigned char *output, uint chunk_sz);

28
#endif /* _UBOOT_CRC_H */