Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about NFCv2 BCH Algorithm. #25

Open
jclab-joseph opened this issue Jul 1, 2023 · 0 comments
Open

Question about NFCv2 BCH Algorithm. #25

jclab-joseph opened this issue Jul 1, 2023 · 0 comments

Comments

@jclab-joseph
Copy link

jclab-joseph commented Jul 1, 2023

I would like to know about the implementation of BCH ECC algorithm in NFCv2.

The m=15,t=16 parameter in the general BCH algorithm does not generate the same value as the ECC created by armada.
I want to simulate armada nand on PC.

https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/tree/u-boot-2013.01-15t1/tools/marvell/BCH/Linux/EccTool

I found the link above, but this is the same as the default BCH algorithm, which produces a different value than armada's ECC.

NFCv2 Layout:

  ------------------------------------------------------------------------------
  | 2048B data | 32B spare | 30B ECC || 2048B data | 32B spare | 30B ECC | ... |
  ------------------------------------------------------------------------------

Ref: https://lwn.net/Articles/571062/

Sample Data:

00000000  55 42 49 23 01 00 00 00  00 00 00 00 00 00 00 01  |UBI#............|
00000010  00 00 08 00 00 00 10 00  00 00 00 00 00 00 00 00  |................|
00000020  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000030  00 00 00 00 00 00 00 00  00 00 00 00 7f 58 53 19  |.............XS.|
00000040  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00000800  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
*
00000820  3a 49 59 22 43 64 b8 35  8e 8d af f4 d4 02 7e d1  |:IY"Cd.5......~.|
00000830  74 0b a3 ec aa 31 0c 8b  0a 2f 1b 1b 4b c8 ff ff  |t....1.../..K...|
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant