mirror of
				https://xff.cz/git/u-boot/
				synced 2025-10-31 10:26:10 +01:00 
			
		
		
		
	common: Drop linux/crc8.h
We have an existing U-Boot header for the one function that this defines. Use that instead of the linux/ one. Move over the nice comment. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
		| @@ -14,11 +14,11 @@ | |||||||
| #include <asm/io.h> | #include <asm/io.h> | ||||||
| #include <asm/arch/cpu.h> | #include <asm/arch/cpu.h> | ||||||
| #include <asm/arch/soc.h> | #include <asm/arch/soc.h> | ||||||
| #include <linux/crc8.h> |  | ||||||
| #include <linux/mbus.h> | #include <linux/mbus.h> | ||||||
| #ifdef CONFIG_NET | #ifdef CONFIG_NET | ||||||
| #include <netdev.h> | #include <netdev.h> | ||||||
| #endif | #endif | ||||||
|  | #include <u-boot/crc.h> | ||||||
| #include "theadorable.h" | #include "theadorable.h" | ||||||
|  |  | ||||||
| #include "../drivers/ddr/marvell/axp/ddr3_hw_training.h" | #include "../drivers/ddr/marvell/axp/ddr3_hw_training.h" | ||||||
|   | |||||||
| @@ -9,7 +9,7 @@ | |||||||
| #include <tpm-v2.h> | #include <tpm-v2.h> | ||||||
| #include <asm/state.h> | #include <asm/state.h> | ||||||
| #include <asm/unaligned.h> | #include <asm/unaligned.h> | ||||||
| #include <linux/crc8.h> | #include <u-boot/crc.h> | ||||||
|  |  | ||||||
| /* Hierarchies */ | /* Hierarchies */ | ||||||
| enum tpm2_hierarchy { | enum tpm2_hierarchy { | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
| #include <tpm-v1.h> | #include <tpm-v1.h> | ||||||
| #include <asm/state.h> | #include <asm/state.h> | ||||||
| #include <asm/unaligned.h> | #include <asm/unaligned.h> | ||||||
| #include <linux/crc8.h> | #include <u-boot/crc.h> | ||||||
|  |  | ||||||
| /* TPM NVRAM location indices. */ | /* TPM NVRAM location indices. */ | ||||||
| #define FIRMWARE_NV_INDEX		0x1007 | #define FIRMWARE_NV_INDEX		0x1007 | ||||||
|   | |||||||
| @@ -1,23 +0,0 @@ | |||||||
| /* SPDX-License-Identifier: GPL-2.0+ */ |  | ||||||
| /* |  | ||||||
|  * Copyright (c) 2013 Google, Inc |  | ||||||
|  */ |  | ||||||
|  |  | ||||||
|  |  | ||||||
| #ifndef __linux_crc8_h |  | ||||||
| #define __linux_crc8_h |  | ||||||
|  |  | ||||||
| /** |  | ||||||
|  * crc8() - Calculate and return CRC-8 of the data |  | ||||||
|  * |  | ||||||
|  * This uses an x^8 + x^2 + x + 1 polynomial.  A table-based algorithm would |  | ||||||
|  * be faster, but for only a few bytes it isn't worth the code size |  | ||||||
|  * |  | ||||||
|  * @crc_start: CRC8 start value |  | ||||||
|  * @vptr: Buffer to checksum |  | ||||||
|  * @len: Length of buffer in bytes |  | ||||||
|  * @return CRC8 checksum |  | ||||||
|  */ |  | ||||||
| unsigned int crc8(unsigned int crc_start, const unsigned char *vptr, int len); |  | ||||||
|  |  | ||||||
| #endif |  | ||||||
| @@ -8,7 +8,19 @@ | |||||||
| #ifndef _UBOOT_CRC_H | #ifndef _UBOOT_CRC_H | ||||||
| #define _UBOOT_CRC_H | #define _UBOOT_CRC_H | ||||||
|  |  | ||||||
| /* lib/crc8.c */ | /** | ||||||
|  |  * crc8() - Calculate and return CRC-8 of the data | ||||||
|  |  * | ||||||
|  |  * This uses an x^8 + x^2 + x + 1 polynomial.  A table-based algorithm would | ||||||
|  |  * be faster, but for only a few bytes it isn't worth the code size | ||||||
|  |  * | ||||||
|  |  * lib/crc8.c | ||||||
|  |  * | ||||||
|  |  * @crc_start: CRC8 start value | ||||||
|  |  * @vptr: Buffer to checksum | ||||||
|  |  * @len: Length of buffer in bytes | ||||||
|  |  * @return CRC8 checksum | ||||||
|  |  */ | ||||||
| unsigned int crc8(unsigned int crc_start, const unsigned char *vptr, int len); | 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) */ | /* lib/crc16.c - 16 bit CRC with polynomial x^16+x^12+x^5+1 (CRC-CCITT) */ | ||||||
|   | |||||||
| @@ -3,7 +3,12 @@ | |||||||
|  * Copyright (c) 2013 Google, Inc |  * Copyright (c) 2013 Google, Inc | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
| #include "linux/crc8.h" | #ifdef USE_HOSTCC | ||||||
|  | #include <arpa/inet.h> | ||||||
|  | #else | ||||||
|  | #include <common.h> | ||||||
|  | #endif | ||||||
|  | #include <u-boot/crc.h> | ||||||
|  |  | ||||||
| #define POLY	(0x1070U << 3) | #define POLY	(0x1070U << 3) | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user