History log of /u-boot/lib/crc16.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 1a47e6d4 12-Apr-2022 Pali Rohár <pali@kernel.org>

crc16: Move standard CRC-16 implementation from ubifs to lib

This implementation provides standard CRC-16 algorithm with polynomial
x^16 + x^15 + x^2 + 1.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>

# bb3d71b7 12-Apr-2022 Pali Rohár <pali@kernel.org>

crc16-ccitt: Rename file with CRC-16-CCITT implementation to crc16-ccitt.c

U-Boot CRC-16 implementation uses polynomial x^16 + x^12 + x^5 + 1 which is
not standard CRC-16 algorithm, but it is known as CRC-16-CCITT. Rename file
crc16.c to crc16-ccitt.c to reduce confusion.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>

# 51c2345b 25-Nov-2018 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Roll CRC16-CCITT into the hash infrastructure

The CRC16-CCITT checksum function is useful for space-constrained
applications (such as obtaining a checksum across a 2KBit or 4KBit
EEPROM) in boot applications. It has not been accessible from boot
scripts until now (due to not having a dedicated command and not being
supported by the hash infrstructure) limiting its applicability
outside of custom commands.

This adds the CRC16-CCITT (poly 0x1021, init 0x0) algorithm to the
list of available hashes and adds a new crc16_ccitt_wd_buf() to make
this possible.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
[trini: Fix building crc16.o for SPL/TPL]
Signed-off-by: Tom Rini <trini@konsulko.com>

# a740ee91 25-Nov-2018 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

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>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini <trini@konsulko.com>

# ecb57f69 03-Mar-2016 Stefan Roese <sr@denx.de>

lib/crc16.c: Rename cyg_crc16() to crc16_ccitt() and add crc start value

The original name of this function is unclear. This patch renames this
CRC16 function to crc16_ccitt() matching its name with its
implementation.

To make the usage of this function more flexible, lets add the CRC start
value as parameter to this function. This way it can be used by other
functions requiring different start values than 0 as well.

Signed-off-by: Stefan Roese <sr@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 7109157f 03-Mar-2016 Stefan Roese <sr@denx.de>

lib/crc16.c: Coding-style cleanup

lib/crc16.c is changed to match the common U-Boot coding-style.

Signed-off-by: Stefan Roese <sr@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>

# e85427fd 07-Jul-2013 Wolfgang Denk <wd@denx.de>

Add eCos-2.0 SPDX-License-Identifier to source files

Signed-off-by: Wolfgang Denk <wd@denx.de>

# 78acc472 12-Apr-2010 Peter Tyser <ptyser@xes-inc.com>

Rename lib_generic/ to lib/

Now that the other architecture-specific lib directories have been
moved out of the top-level directory there's not much reason to have the
'_generic' suffix on the common lib directory.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>

# 51c2345b 25-Nov-2018 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Roll CRC16-CCITT into the hash infrastructure

The CRC16-CCITT checksum function is useful for space-constrained
applications (such as obtaining a checksum across a 2KBit or 4KBit
EEPROM) in boot applications. It has not been accessible from boot
scripts until now (due to not having a dedicated command and not being
supported by the hash infrstructure) limiting its applicability
outside of custom commands.

This adds the CRC16-CCITT (poly 0x1021, init 0x0) algorithm to the
list of available hashes and adds a new crc16_ccitt_wd_buf() to make
this possible.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
[trini: Fix building crc16.o for SPL/TPL]
Signed-off-by: Tom Rini <trini@konsulko.com>

# a740ee91 25-Nov-2018 Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

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>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini <trini@konsulko.com>

# ecb57f69 03-Mar-2016 Stefan Roese <sr@denx.de>

lib/crc16.c: Rename cyg_crc16() to crc16_ccitt() and add crc start value

The original name of this function is unclear. This patch renames this
CRC16 function to crc16_ccitt() matching its name with its
implementation.

To make the usage of this function more flexible, lets add the CRC start
value as parameter to this function. This way it can be used by other
functions requiring different start values than 0 as well.

Signed-off-by: Stefan Roese <sr@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 7109157f 03-Mar-2016 Stefan Roese <sr@denx.de>

lib/crc16.c: Coding-style cleanup

lib/crc16.c is changed to match the common U-Boot coding-style.

Signed-off-by: Stefan Roese <sr@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>

# e85427fd 07-Jul-2013 Wolfgang Denk <wd@denx.de>

Add eCos-2.0 SPDX-License-Identifier to source files

Signed-off-by: Wolfgang Denk <wd@denx.de>

# 78acc472 12-Apr-2010 Peter Tyser <ptyser@xes-inc.com>

Rename lib_generic/ to lib/

Now that the other architecture-specific lib directories have been
moved out of the top-level directory there's not much reason to have the
'_generic' suffix on the common lib directory.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>

# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini <trini@konsulko.com>


# ecb57f69 03-Mar-2016 Stefan Roese <sr@denx.de>

lib/crc16.c: Rename cyg_crc16() to crc16_ccitt() and add crc start value

The original name of this function is unclear. This patch renames this
CRC16 function to crc16_ccitt() matching its name with its
implementation.

To make the usage of this function more flexible, lets add the CRC start
value as parameter to this function. This way it can be used by other
functions requiring different start values than 0 as well.

Signed-off-by: Stefan Roese <sr@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 7109157f 03-Mar-2016 Stefan Roese <sr@denx.de>

lib/crc16.c: Coding-style cleanup

lib/crc16.c is changed to match the common U-Boot coding-style.

Signed-off-by: Stefan Roese <sr@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>


# e85427fd 07-Jul-2013 Wolfgang Denk <wd@denx.de>

Add eCos-2.0 SPDX-License-Identifier to source files

Signed-off-by: Wolfgang Denk <wd@denx.de>


# 78acc472 12-Apr-2010 Peter Tyser <ptyser@xes-inc.com>

Rename lib_generic/ to lib/

Now that the other architecture-specific lib directories have been
moved out of the top-level directory there's not much reason to have the
'_generic' suffix on the common lib directory.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>