| /rk3399_rockchip-uboot/drivers/mtd/ubi/ |
| H A D | crc32.c | 61 u32 crc32_le(u32 crc, unsigned char const *p, size_t len); 69 u32 crc32_le(u32 crc, unsigned char const *p, size_t len) in crc32_le() argument 73 crc ^= *p++; in crc32_le() 75 crc = (crc >> 1) ^ ((crc & 1) ? CRCPOLY_LE : 0); in crc32_le() 77 return crc; in crc32_le() 81 u32 crc32_le(u32 crc, unsigned char const *p, size_t len) in crc32_le() argument 88 # define DO_CRC(x) crc = tab[ (crc ^ (x)) & 255 ] ^ (crc>>8) in crc32_le() 90 # define DO_CRC(x) crc = tab[ ((crc >> 24) ^ (x)) & 255] ^ (crc<<8) in crc32_le() 93 crc = __cpu_to_le32(crc); in crc32_le() 108 crc ^= *++b; in crc32_le() [all …]
|
| /rk3399_rockchip-uboot/common/ |
| H A D | zm.c | 331 register unsigned short crc; in zsbhdr() local 344 xsendline(ZBIN); zsendline(type); crc = updcrc(type, 0); in zsbhdr() 348 crc = updcrc((0377& *hdr), crc); in zsbhdr() 350 crc = updcrc(0,updcrc(0,crc)); in zsbhdr() 351 zsendline(crc>>8); in zsbhdr() 352 zsendline(crc); in zsbhdr() 364 register unsigned long crc; in zsbh32() local 367 crc = 0xFFFFFFFFL; crc = UPDC32(type, crc); in zsbh32() 370 crc = UPDC32((0377 & *hdr), crc); in zsbh32() 373 crc = ~crc; in zsbh32() [all …]
|
| H A D | ddr_spd.c | 72 int crc, i; in crc16() local 74 crc = 0; in crc16() 76 crc = crc ^ (int)*ptr++ << 8; in crc16() 78 if (crc & 0x8000) in crc16() 79 crc = crc << 1 ^ 0x1021; in crc16() 81 crc = crc << 1; in crc16() 83 return crc & 0xffff; in crc16() 107 if (spd->crc[0] == crc_lsb && spd->crc[1] == crc_msb) { in ddr3_spd_check() 113 spd->crc[0], crc_lsb, spd->crc[1], crc_msb); in ddr3_spd_check() 132 if (spd->crc[0] != crc_lsb || spd->crc[1] != crc_msb) { in ddr4_spd_check() [all …]
|
| /rk3399_rockchip-uboot/lib/ |
| H A D | crc32.c | 169 # define DO_CRC(x) crc = tab[(crc ^ (x)) & 255] ^ (crc >> 8) 171 # define DO_CRC(x) crc = tab[((crc >> 24) ^ (x)) & 255] ^ (crc << 8) 179 uint32_t ZEXPORT crc32_no_comp(uint32_t crc, const Bytef *buf, uInt len) in crc32_no_comp() argument 188 crc = cpu_to_le32(crc); in crc32_no_comp() 202 crc ^= *++b; /* use pre increment for speed */ in crc32_no_comp() 217 return le32_to_cpu(crc); in crc32_no_comp() 221 uint32_t ZEXPORT crc32 (uint32_t crc, const Bytef *p, uInt len) in crc32() argument 223 return crc32_no_comp(crc ^ 0xffffffffL, p, len) ^ 0xffffffffL; in crc32() 230 uint32_t ZEXPORT crc32_wd (uint32_t crc, in crc32_wd() argument 244 crc = crc32 (crc, curr, chunk); in crc32_wd() [all …]
|
| H A D | crc32c.c | 16 uint32_t crc32c_cal(uint32_t crc, const char *data, int length, in crc32c_cal() argument 20 crc = crc32c_table[(u8)(crc ^ *data++)] ^ (crc >> 8); in crc32c_cal() 22 return crc; in crc32c_cal()
|
| H A D | crc7.c | 57 u8 crc7(u8 crc, const u8 *buffer, size_t len) in crc7() argument 60 crc = crc7_byte(crc, *buffer++); in crc7() 61 return crc; in crc7()
|
| H A D | crc8.c | 24 unsigned int crc8(unsigned int crc, const unsigned char *vptr, int len) in crc8() argument 29 crc = _crc8((crc ^ vptr[i]) << 8); in crc8() 31 return crc; in crc8()
|
| /rk3399_rockchip-uboot/lib/avb/libavb/ |
| H A D | avb_crc32.c | 104 uint32_t crc; in iavb_crc32() local 106 crc = crc_in ^ ~0U; in iavb_crc32() 108 crc = iavb_crc32_tab[(crc ^ *p++) & 0xFF] ^ (crc >> 8); in iavb_crc32() 109 return crc ^ ~0U; in iavb_crc32()
|
| /rk3399_rockchip-uboot/fs/ext4/ |
| H A D | crc16.c | 53 unsigned int ext2fs_crc16(unsigned int crc, in ext2fs_crc16() argument 59 crc = (((crc >> 8) & 0xffU) ^ in ext2fs_crc16() 60 crc16_table[(crc ^ *cp++) & 0xffU]) & 0x0000ffffU; in ext2fs_crc16() 61 return crc; in ext2fs_crc16()
|
| /rk3399_rockchip-uboot/net/ |
| H A D | eth_legacy.c | 322 u32 crc; in ether_crc() local 323 crc = ~0; in ether_crc() 325 crc ^= *p++; in ether_crc() 327 crc = (crc >> 1) ^ ((crc & 1) ? CRCPOLY_LE : 0); in ether_crc() 330 crc = (crc >> 16) | (crc << 16); in ether_crc() 331 crc = (crc >> 8 & 0x00ff00ff) | (crc << 8 & 0xff00ff00); in ether_crc() 332 crc = (crc >> 4 & 0x0f0f0f0f) | (crc << 4 & 0xf0f0f0f0); in ether_crc() 333 crc = (crc >> 2 & 0x33333333) | (crc << 2 & 0xcccccccc); in ether_crc() 334 crc = (crc >> 1 & 0x55555555) | (crc << 1 & 0xaaaaaaaa); in ether_crc() 335 return crc; in ether_crc()
|
| /rk3399_rockchip-uboot/board/keymile/common/ |
| H A D | ivm.c | 23 unsigned short crc = 0; /* final result */ in ivm_calc_crc() local 33 r1 = crc_tab[crc & 0xF]; in ivm_calc_crc() 34 crc = ((crc) >> 4) & 0x0FFF; in ivm_calc_crc() 35 crc = crc ^ r1 ^ crc_tab[byte & 0xF]; in ivm_calc_crc() 38 r1 = crc_tab[crc & 0xF]; in ivm_calc_crc() 39 crc = (crc >> 4) & 0x0FFF; in ivm_calc_crc() 40 crc = crc ^ r1 ^ crc_tab[(byte >> 4) & 0xF]; in ivm_calc_crc() 42 return crc; in ivm_calc_crc() 175 unsigned long crc; in ivm_check_crc() local 178 crc = ivm_calc_crc(buf, CONFIG_SYS_IVM_EEPROM_PAGE_LEN - 2); in ivm_check_crc() [all …]
|
| /rk3399_rockchip-uboot/board/varisys/common/ |
| H A D | sys_eeprom.c | 47 u32 crc; /* x+1 CRC32 checksum */ member 80 unsigned int crc; in show_eeprom() local 111 crc = crc32(0, (void *)&e, sizeof(e) - 4); in show_eeprom() 113 if (crc == be32_to_cpu(e.crc)) in show_eeprom() 114 printf("CRC: %08x\n", be32_to_cpu(e.crc)); in show_eeprom() 117 be32_to_cpu(e.crc), crc); in show_eeprom() 176 u32 crc, crc_offset = offsetof(struct eeprom, crc); in update_crc() local 178 crc = crc32(0, (void *)&e, crc_offset); in update_crc() 179 e.crc = cpu_to_be32(crc); in update_crc() 440 u32 crc, crc_offset = offsetof(struct eeprom, crc); in mac_read_from_eeprom_common() local [all …]
|
| /rk3399_rockchip-uboot/board/corscience/tricorder/ |
| H A D | tricorder-eeprom.c | 30 uint32_t crc; in handle_eeprom_v0() local 42 crc = crc32(0L, (unsigned char *)&eepromv0, in handle_eeprom_v0() 44 if (be32_to_cpu(eepromv0.crc32) != crc) { in handle_eeprom_v0() 46 crc); in handle_eeprom_v0() 53 crc = crc32(0L, (unsigned char *)eeprom, TRICORDER_EEPROM_CRC_SIZE); in handle_eeprom_v0() 54 eeprom->crc32 = cpu_to_be32(crc); in handle_eeprom_v0() 61 uint32_t crc; in handle_eeprom_v1() local 69 crc = crc32(0L, (unsigned char *)eeprom, TRICORDER_EEPROM_CRC_SIZE); in handle_eeprom_v1() 70 if (be32_to_cpu(eeprom->crc32) != crc) { in handle_eeprom_v1() 71 warn_wrong_value("CRC", be32_to_cpu(eeprom->crc32), crc); in handle_eeprom_v1() [all …]
|
| /rk3399_rockchip-uboot/board/freescale/common/ |
| H A D | sys_eeprom.c | 46 u32 crc; /* 0x72 CRC32 checksum */ member 63 u32 crc; /* 0xfc - 0xff CRC32 checksum */ member 88 unsigned int crc; in show_eeprom() local 125 crc = crc32(0, (void *)&e, sizeof(e) - 4); in show_eeprom() 127 if (crc == be32_to_cpu(e.crc)) in show_eeprom() 128 printf("CRC: %08x\n", be32_to_cpu(e.crc)); in show_eeprom() 131 be32_to_cpu(e.crc), crc); in show_eeprom() 187 u32 crc; in update_crc() local 189 crc = crc32(0, (void *)&e, sizeof(e) - 4); in update_crc() 190 e.crc = cpu_to_be32(crc); in update_crc() [all …]
|
| /rk3399_rockchip-uboot/fs/ubifs/ |
| H A D | crc16.c | 55 u16 crc16(u16 crc, u8 const *buffer, size_t len) in crc16() argument 58 crc = crc16_byte(crc, *buffer++); in crc16() 59 return crc; in crc16()
|
| H A D | crc16.h | 22 extern u16 crc16(u16 crc, const u8 *buffer, size_t len); 24 static inline u16 crc16_byte(u16 crc, const u8 data) in crc16_byte() argument 26 return (crc >> 8) ^ crc16_table[(crc ^ data) & 0xff]; in crc16_byte()
|
| /rk3399_rockchip-uboot/test/fs/ |
| H A D | fat-noncontig-test.sh | 122 crc=0x`crc32 ${mnttestfn}` 129 crc=`printf %02x%02x%02x%02x \ 130 $((${crc} & 0xff)) \ 131 $(((${crc} >> 8) & 0xff)) \ 132 $(((${crc} >> 16) & 0xff)) \ 133 $((${crc} >> 24))` 139 if itest.l *${crcaddr} != ${crc}; then echo FAILURE; else echo PASS; fi
|
| /rk3399_rockchip-uboot/include/linux/ |
| H A D | crc7.h | 7 static inline u8 crc7_byte(u8 crc, u8 data) in crc7_byte() argument 9 return crc7_syndrome_table[(crc << 1) ^ data]; in crc7_byte() 12 extern u8 crc7(u8 crc, const u8 *buffer, size_t len);
|
| /rk3399_rockchip-uboot/arch/arm/mach-rockchip/ |
| H A D | vendor_misc.c | 28 u32 crc, len; in vendor_handle_hdcp() local 35 crc = crc32(0, hdcp->data, hdcp->length); in vendor_handle_hdcp() 36 if (crc != hdcp->crc32) { in vendor_handle_hdcp() 38 __func__, crc, hdcp->crc32); in vendor_handle_hdcp()
|
| /rk3399_rockchip-uboot/env/ |
| H A D | eeprom.c | 85 ulong len, crc[2], crc_tmp; in env_eeprom_load() local 98 off_env[i] + offsetof(env_t, crc), in env_eeprom_load() 99 (uchar *)&crc[i], sizeof(ulong)); in env_eeprom_load() 119 if (crc_tmp == crc[i]) in env_eeprom_load() 145 ulong crc, len, new; in env_eeprom_load() local 152 CONFIG_ENV_OFFSET + offsetof(env_t, crc), in env_eeprom_load() 153 (uchar *)&crc, sizeof(ulong)); in env_eeprom_load() 168 if (crc == new) { in env_eeprom_load()
|
| H A D | nvram.c | 94 ulong crc; local 97 nvram_read(&crc, CONFIG_ENV_ADDR, sizeof(ulong)); 100 if (crc32(0, data, ENV_SIZE) == crc) { 103 if (crc32(0, env_ptr->data, ENV_SIZE) == env_ptr->crc) {
|
| /rk3399_rockchip-uboot/tools/ |
| H A D | envcrc.c | 74 uint32_t crc; in main() local 98 crc = crc32 (0, dataptr, datasize); in main() 115 printf("%c", (crc & (0xFF << (i * 8))) >> (i * 8)); in main() 122 crc); in main() 125 printf ("0x%08X\n", crc); in main()
|
| /rk3399_rockchip-uboot/fs/jffs2/ |
| H A D | jffs2_private.h | 45 u32 crc = crc32_no_comp(0, (unsigned char *)node, sizeof(struct jffs2_unknown_node) - 4); in hdr_crc() local 48 u32 crc = crc32_no_comp(~0, (unsigned char *)node, sizeof(struct jffs2_unknown_node) - 4); in hdr_crc() 50 crc ^= ~0; in hdr_crc() 52 if (node->hdr_crc != crc) { in hdr_crc()
|
| H A D | jffs2_nand_private.h | 57 u32 crc = crc32_no_comp(0, (unsigned char *)node, sizeof(struct jffs2_unknown_node) - 4); in hdr_crc() local 60 u32 crc = crc32_no_comp(~0, (unsigned char *)node, sizeof(struct jffs2_unknown_node) - 4); in hdr_crc() 62 crc ^= ~0; in hdr_crc() 64 if (node->hdr_crc != crc) { in hdr_crc()
|
| /rk3399_rockchip-uboot/tools/rockchip/ |
| H A D | crc32_rk.c | 90 #define DO_CRC(x) crc = tab[((crc >> 24) ^ (x)) & 255] ^ (crc << 8) 91 uint32_t crc32_rk(uint32_t crc, const unsigned char *s, uint32_t len) in crc32_rk() argument 95 crc = cpu_to_le32(crc); in crc32_rk() 99 return le32_to_cpu(crc); in crc32_rk()
|