fs: btrfs: Add more checksum algorithms

This mostly crossports crypto/hash.[ch] from btrfs-progs.

The differences are:
- No blake2 support
  No blake2 related library in U-Boot yet.

- Use uboot xxhash/sha256 directly
  No need to implement the code as U-Boot has already provided the
  interface.

This adds the support for the following csums:
- SHA256
- XXHASH

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Marek BehĂșn <marek.behun@nic.cz>
diff --git a/fs/btrfs/disk-io.h b/fs/btrfs/disk-io.h
new file mode 100644
index 0000000..efb7158
--- /dev/null
+++ b/fs/btrfs/disk-io.h
@@ -0,0 +1,20 @@
+// SPDX-License-Identifier: GPL-2.0+
+#ifndef __BTRFS_DISK_IO_H__
+#define __BTRFS_DISK_IO_H__
+
+#include "crypto/hash.h"
+#include "ctree.h"
+#include "disk-io.h"
+
+static inline u64 btrfs_name_hash(const char *name, int len)
+{
+	u32 crc;
+
+	crc = crc32c((u32)~1, (unsigned char *)name, len);
+
+	return (u64)crc;
+}
+
+int btrfs_csum_data(u16 csum_type, const u8 *data, u8 *out, size_t len);
+
+#endif