crc32: Use the crc.h header for crc functions
Drop inclusion of crc.h in common.h and use the correct header directly
instead.
With this we can drop the conflicting definition in fw_env.h and rely on
the crc.h header, which is already included.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
diff --git a/tools/default_image.c b/tools/default_image.c
index f7990e2..e164c0c 100644
--- a/tools/default_image.c
+++ b/tools/default_image.c
@@ -15,6 +15,7 @@
#include "imagetool.h"
#include "mkimage.h"
+#include <u-boot/crc.h>
#include <image.h>
#include <tee/optee.h>
diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index e2801f5..30b5a19 100644
--- a/tools/env/fw_env.c
+++ b/tools/env/fw_env.c
@@ -25,6 +25,7 @@
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
+#include <u-boot/crc.h>
#include <unistd.h>
#include <dirent.h>
diff --git a/tools/env/fw_env.h b/tools/env/fw_env.h
index 3d2b457..b60fbfc 100644
--- a/tools/env/fw_env.h
+++ b/tools/env/fw_env.h
@@ -160,5 +160,3 @@
* version string of the library
*/
char *fw_env_version(void);
-
-unsigned long crc32(unsigned long, const unsigned char *, unsigned);
diff --git a/tools/envcrc.c b/tools/envcrc.c
index 6e43608..bce7790 100644
--- a/tools/envcrc.c
+++ b/tools/envcrc.c
@@ -9,6 +9,7 @@
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
+#include <u-boot/crc.h>
#include <unistd.h>
#include <linux/kconfig.h>
diff --git a/tools/mkenvimage.c b/tools/mkenvimage.c
index a8eebab..b05f834 100644
--- a/tools/mkenvimage.c
+++ b/tools/mkenvimage.c
@@ -14,6 +14,7 @@
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
+#include <u-boot/crc.h>
#include <unistd.h>
#include <libgen.h>
#include <sys/types.h>
diff --git a/tools/mxsimage.c b/tools/mxsimage.c
index 0bb5c6a..002f4b5 100644
--- a/tools/mxsimage.c
+++ b/tools/mxsimage.c
@@ -11,6 +11,7 @@
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
+#include <u-boot/crc.h>
#include <unistd.h>
#include <limits.h>
diff --git a/tools/pbl_crc32.c b/tools/pbl_crc32.c
index 06da1d9..9b1ca55 100644
--- a/tools/pbl_crc32.c
+++ b/tools/pbl_crc32.c
@@ -5,6 +5,7 @@
* Cleaned up and refactored by Charles Manning.
*/
#include "pblimage.h"
+#include <u-boot/crc.h>
static uint32_t crc_table[256];
static int crc_table_valid;
diff --git a/tools/pblimage.c b/tools/pblimage.c
index d11f9af..3c823e9 100644
--- a/tools/pblimage.c
+++ b/tools/pblimage.c
@@ -6,6 +6,7 @@
#include <image.h>
#include "pblimage.h"
#include "pbl_crc32.h"
+#include <u-boot/crc.h>
#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
#define PBL_ACS_CONT_CMD 0x81000000
diff --git a/tools/socfpgaimage.c b/tools/socfpgaimage.c
index 72d8b96..8fa0983 100644
--- a/tools/socfpgaimage.c
+++ b/tools/socfpgaimage.c
@@ -55,6 +55,7 @@
#include "pbl_crc32.h"
#include "imagetool.h"
#include "mkimage.h"
+#include <u-boot/crc.h>
#include <image.h>