spi_nor_set_...gs_from_bfpt(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… spi_nor_set_erase_settings_from_bfpt(9)

okay so this is a page from the Kernel API Manual, and honestly? it's a little function that does one very specific little thing and does it beautifully. let's get into it πŸŽ€


✨ NAME ✨

spi_nor_set_erase_settings_from_bfpt β€” bestie, it sets the erase type settings straight from the BFPT. that's the whole job. no cap. πŸ’–


🌸 SYNOPSIS 🌸

void spi_nor_set_erase_settings_from_bfpt (struct spi_nor_erase_type
*erase , u32 size , u8 opcode , u8 i );

like, it returns nothing (void), it takes four things, and it's literally just here to hand you the vibe of an erase type. iconic behavior honestly ✨


πŸ¦‹ ARGUMENTS πŸ¦‹

  • erase β€” a pointer to a structure that describes a SPI NOR erase type. it's giving "here's the blank canvas, go fill it in" 🎨
  • size β€” the size of the sector/block that this erase type erases. big block energy or tiny block energy, you decide πŸ’«
  • opcode β€” the SPI command op code used to erase that sector/block. the literal instruction, the main character of the operation πŸ‘‘
  • i β€” the erase type index as sorted in the Basic Flash Parameter Table. remember this one, it comes back later (see below, iykyk) πŸ”₯

πŸ’œ DESCRIPTION πŸ’œ

so here's the tea, bestie 🍡 β€” the supported Erase Types get sorted at init in ascending order, and the smallest Erase Type size ends up as the first member in the erase_type array of the spi_nor_erase_map structure. so like, smallest first, always, that's the rule πŸ’…

what this function does is save the Erase Type index as sorted in the Basic Flash Parameter Table, and the reason it bothers is genuinely important: that index gets used later on to synchronize with the supported Erase Types defined in SFDP optional tables. so don't lose it, okay? it's load-bearing 🫢


🌈 SEE ALSO 🌈

kernel file ./drivers/mtd/spi-nor/sfdp.c β€” go read it, it's right there πŸ’–

and the whole friend group:


okay that's the whole page, go forth and sort your erase types ascendingly, mwah πŸ’‹

sign-off time πŸŽ€ this little masterpiece lives in ./drivers/mtd/spi-nor, it's dated October 2026, and it's from the Kernel API Manual (version: the kernel's own, bestie, it's a kernel doc). slay, bye πŸ‘‹βœ¨

πŸ“¦ where this page comes from