Hardware calculation of IP and TCP checksum on BF-518

Hi,

I am using EMAC unit on BF-518 and using hardware based IP and TCP checksum by setting RXCKS and RXDWA bits in EMAC_SYSCTL register.

I received the IP header and payload checksum but having difficulties to validate the checksum.

My question is how the hardware compute the checksum (using 32-bit or 16-bit big-endian or little-endian) and at what bytes i have to consider to validate calculated checksum?

Is there any example available to explain this?

Regards,

MZ