STRUCT MARVELL_HW_ECC_LAYOUT(9)

๐Ÿ“ฆ version 7.3.1, in nixpkgs unstable

๐Ÿ’… struct marvell_hw_ecc_layout(9) โ€” the Kernel API Manual, bestie edition ๐ŸŽ€

okay so you opened the Kernel API Manual and landed on this page, and honestly? it's kind of a baddie. this is struct marvell_hw_ecc_layout โ€” the literal layout of Marvell ECC. it's giving blueprint energy. let's get into it ๐Ÿ’–


โœจ NAME โœจ

struct marvell_hw_ecc_layout โ€” layout of Marvell ECC. that's it, that's the whole vibe check.


๐ŸŒธ SYNOPSIS ๐ŸŒธ

struct marvell_hw_ecc_layout {
    int writesize;
    int chunk;
    int strength;
    int nchunks;
    int full_chunk_cnt;
    int data_bytes;
    int spare_bytes;
    int ecc_bytes;
    int last_data_bytes;
    int last_spare_bytes;
    int last_ecc_bytes;
 };

look at her. eleven ints and not a single one out of place. main character struct fr fr ๐Ÿ‘‘


๐Ÿฆ‹ Members ๐Ÿฆ‹

bestie these are the fields, and every single one is iconic in her own way:

  • writesize โ€” the full page size that this layout applies to โœจ
  • chunk โ€” the ECC chunk size you want, and the layout applies to that. lowkey the size of one chunk, conceptually ๐ŸŽ€
  • strength โ€” the ECC strength you want, measured per chunk size bytes, and again โ€” the layout applies to that ๐Ÿ’ช
  • nchunks โ€” total number of chunks, no cap ๐Ÿงฎ
  • full_chunk_cnt โ€” the number of full-sized chunks. which is literally the number of times this pattern repeats: (data_bytes + spare_bytes + ecc_bytes). she's a counter of repetitions, she's doing great ๐Ÿ’…
  • data_bytes โ€” how many data bytes per chunk ๐Ÿ“
  • spare_bytes โ€” how many spare bytes per chunk ๐ŸŒˆ
  • ecc_bytes โ€” how many ecc bytes per chunk โญ
  • last_data_bytes โ€” how many data bytes are in that last chunk (yes, the last chunk is special, we'll get there) ๐Ÿ™ˆ
  • last_spare_bytes โ€” how many spare bytes are in the last chunk ๐Ÿ’œ
  • last_ecc_bytes โ€” how many ecc bytes are in the last chunk ๐Ÿ”ฅ

๐Ÿ’€ Description ๐Ÿ’€

so here's the tea. the Marvell ECC engine works differently than all the others โ€” not better, not worse, just different, periodt.

why? to limit the size of the IP, the hardware engineers chose to set a fixed strength at 16 bits per subpage. that's the hardware's whole personality, she's fixed at it.

then, depending on the desired strength that the NAND chip actually needs, a particular layout gets defined โ€” one that mixes data / spare / ecc โ€” and that layout may possibly have a last chunk smaller than the others. that's the plot twist ๐Ÿซถ

ngl that last chunk being tinier than her sisters is the detail everyone forgets. don't be the one who forgets ๐Ÿ’€

๐Ÿ”ฅ SEE ALSO ๐Ÿ”ฅ

go read these next, bestie, they're all in the same friend group:

  • the kernel file ./drivers/mtd/nand/raw/marvell_nand.c โ€” the source material ๐Ÿงš
  • struct marvell_nand_chip_sel(9)
  • struct marvell_nand_chip(9)
  • struct marvell_nfc_caps(9)
  • struct marvell_nfc(9)
  • struct marvell_nfc_timings(9)
  • TO_CYCLES(9)
  • struct marvell_nfc_op(9)

โœจ mwah โœจ that's the page. she lives at ./drivers/mtd/nand/raw, she's dated October 2026, and she signs off as struct marve...w_ecc_layout(9) โ€” truncated name and all, and honestly? iconic. go ship it, bestie ๐Ÿ’–๐ŸŽ€๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from