public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* CRC32 endianess
@ 2021-10-20 12:40 Wouter Joris
  2021-10-21  6:39 ` Michal Simek
  0 siblings, 1 reply; 2+ messages in thread
From: Wouter Joris @ 2021-10-20 12:40 UTC (permalink / raw)
  To: u-boot


[-- Attachment #1.1: Type: text/plain, Size: 1250 bytes --]

Dear U-boot maintainers,

I'm working on an Xilinx Zynqmp project ( Checkout tag xilinx-v2019.1 
<https://github.com/Xilinx/u-boot-xlnx/tree/xilinx-v2019.1> ) (ARM 
Cortex A53 ) and I'm facing an endianess mix-up. I'm no C-code guru, so 
I hope you'll stick here with me for a while.

In this example I'm performing a random crc check, the result was placed 
into memory.

  * ZynqMP> crc32 0x8000 0x8002 0x7999
  * crc32 0x8000 0x8002
  * crc32 for 00008000 ... 00010001 ==> 0c9cf37c

This is the result of the CRC read-back:

  * ZynqMP> md 7999 1
  * 00007999: 7cf39c0c

Also the itest confirms something is wrong with the result.

  * ZynqMP> if itest *7999 == 7cf39c0c; then echo true; else echo false; fi
  * true

  * ZynqMP> if itest *7999 == 0c9cf37c; then echo true; else echo false; fi
  * false

I know there was an historic bug 
<https://patchwork.ozlabs.org/project/uboot/patch/1365203470-9099-1-git-send-email-sjg@chromium.org/> 
about the crc endianess describing this exact problem but this issue 
seems to be addressed in later releases, as far as I know.

Uboot Xilinx crc32.c L172 
<https://github.com/Xilinx/u-boot-xlnx/blob/xilinx-v2019.1/lib/crc32.c#L172>


Can you give any advice how to proceed?

Kind regards,

Wouter Joris

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 3705 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-21  6:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-20 12:40 CRC32 endianess Wouter Joris
2021-10-21  6:39 ` Michal Simek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox