aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>2018-11-25 19:22:18 +0100
committerTom Rini <trini@konsulko.com>2018-12-08 20:18:32 -0500
commita740ee913ec8ba04cc53100440f94841648324e2 (patch)
tree5e7ce4280365bce24a5747118d1c857a560faeeb
parentc49aff3e66b930aa06936afee401cf5e19377958 (diff)
downloadu-boot-a740ee913ec8ba04cc53100440f94841648324e2.zip
u-boot-a740ee913ec8ba04cc53100440f94841648324e2.tar.gz
u-boot-a740ee913ec8ba04cc53100440f94841648324e2.tar.bz2
lib: merge CRC16-CCITT into u-boot/crc.h
This merges the CRC16-CCITT headers into u-boot/crc.h to prepare for rolling CRC16 into the hash infrastructure. Given that CRC8, CRC32 and CRC32-C already have their prototypes in a single header file, it seems a good idea to also include CRC16-CCITT in the same. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
-rw-r--r--board/8dtech/eco5pk/eco5pk.c2
-rw-r--r--board/armadeus/apf27/apf27.c2
-rw-r--r--board/sunxi/board.c2
-rw-r--r--common/xyzModem.c2
-rw-r--r--drivers/mmc/mmc_spi.c2
-rw-r--r--drivers/net/phy/aquantia.c2
-rw-r--r--include/crc.h43
-rw-r--r--include/u-boot/crc.h3
-rw-r--r--lib/crc16.c2
9 files changed, 10 insertions, 50 deletions
diff --git a/board/8dtech/eco5pk/eco5pk.c b/board/8dtech/eco5pk/eco5pk.c
index e05928f..dcbd483 100644
--- a/board/8dtech/eco5pk/eco5pk.c
+++ b/board/8dtech/eco5pk/eco5pk.c
@@ -16,7 +16,7 @@
#include <asm/arch/emac_defs.h>
#include <asm/gpio.h>
#include <i2c.h>
-#include <crc.h>
+#include <u-boot/crc.h>
#include <asm/mach-types.h>
#include "eco5pk.h"
diff --git a/board/armadeus/apf27/apf27.c b/board/armadeus/apf27/apf27.c
index 0f0c8a4..bf2586d 100644
--- a/board/armadeus/apf27/apf27.c
+++ b/board/armadeus/apf27/apf27.c
@@ -16,8 +16,8 @@
#include <asm/arch/gpio.h>
#include <asm/gpio.h>
#include <linux/errno.h>
+#include <u-boot/crc.h>
#include "apf27.h"
-#include "crc.h"
#include "fpga.h"
DECLARE_GLOBAL_DATA_PTR;
diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index 26284db..8e20dc7 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -28,7 +28,7 @@
#endif
#include <asm/gpio.h>
#include <asm/io.h>
-#include <crc.h>
+#include <u-boot/crc.h>
#include <environment.h>
#include <linux/libfdt.h>
#include <nand.h>
diff --git a/common/xyzModem.c b/common/xyzModem.c
index 830fca8..e5c65b4 100644
--- a/common/xyzModem.c
+++ b/common/xyzModem.c
@@ -24,7 +24,7 @@
#include <common.h>
#include <xyzModem.h>
#include <stdarg.h>
-#include <crc.h>
+#include <u-boot/crc.h>
/* Assumption - run xyzModem protocol over the console port */
diff --git a/drivers/mmc/mmc_spi.c b/drivers/mmc/mmc_spi.c
index a9d95fb..4f57990 100644
--- a/drivers/mmc/mmc_spi.c
+++ b/drivers/mmc/mmc_spi.c
@@ -10,7 +10,7 @@
#include <part.h>
#include <mmc.h>
#include <spi.h>
-#include <crc.h>
+#include <u-boot/crc.h>
#include <linux/crc7.h>
#include <asm/byteorder.h>
diff --git a/drivers/net/phy/aquantia.c b/drivers/net/phy/aquantia.c
index 37749e0..a0abb23 100644
--- a/drivers/net/phy/aquantia.c
+++ b/drivers/net/phy/aquantia.c
@@ -8,7 +8,7 @@
#include <common.h>
#include <dm.h>
#include <phy.h>
-#include <crc.h>
+#include <u-boot/crc.h>
#include <malloc.h>
#include <asm/byteorder.h>
#include <fs.h>
diff --git a/include/crc.h b/include/crc.h
deleted file mode 100644
index 2a00af5..0000000
--- a/include/crc.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* SPDX-License-Identifier: eCos-2.0 */
-/*
- *==========================================================================
- *
- * crc.h
- *
- * Interface for the CRC algorithms.
- *
- *==========================================================================
- *==========================================================================
- *#####DESCRIPTIONBEGIN####
- *
- * Author(s): Andrew Lunn
- * Contributors: Andrew Lunn
- * Date: 2002-08-06
- * Purpose:
- * Description:
- *
- * This code is part of eCos (tm).
- *
- *####DESCRIPTIONEND####
- *
- *==========================================================================
- */
-
-#ifndef _SERVICES_CRC_CRC_H_
-#define _SERVICES_CRC_CRC_H_
-
-#include <linux/types.h>
-
-#ifndef __externC
-# ifdef __cplusplus
-# define __externC extern "C"
-# else
-# define __externC extern
-# endif
-#endif
-
-/* 16 bit CRC with polynomial x^16+x^12+x^5+1 (CRC-CCITT) */
-
-uint16_t crc16_ccitt(uint16_t crc_start, unsigned char *s, int len);
-
-#endif /* _SERVICES_CRC_CRC_H_ */
diff --git a/include/u-boot/crc.h b/include/u-boot/crc.h
index e98cb46..111b22c 100644
--- a/include/u-boot/crc.h
+++ b/include/u-boot/crc.h
@@ -11,6 +11,9 @@
/* lib/crc8.c */
unsigned int crc8(unsigned int crc_start, const unsigned char *vptr, int len);
+/* lib/crc16.c - 16 bit CRC with polynomial x^16+x^12+x^5+1 (CRC-CCITT) */
+uint16_t crc16_ccitt(uint16_t crc_start, const unsigned char *s, int len);
+
/* lib/crc32.c */
uint32_t crc32 (uint32_t, const unsigned char *, uint);
uint32_t crc32_wd (uint32_t, const unsigned char *, uint, uint);
diff --git a/lib/crc16.c b/lib/crc16.c
index 763ae33..25bdfd8 100644
--- a/lib/crc16.c
+++ b/lib/crc16.c
@@ -22,7 +22,7 @@
*==========================================================================
*/
-#include "crc.h"
+#include <u-boot/crc.h>
/* Table of CRC constants - implements x^16+x^12+x^5+1 */
static const uint16_t crc16_tab[] = {