STRUCT SPI_NOR_ERASE_TYPE(9)
π struct spi_nor_erase_type β the whole kernel-API-manual moment, but make it make sense
okay so bestie, welcome to struct spi_nor_erase_type(9) from the Kernel API Manual β¨ this is the little struct that describes a SPI NOR erase type β like, it's the glow-up card that tells you how a chunk of flash gets wiped. no cap, it's giving "small struct, big responsibility" energy.
β¨ SYNOPSIS β¨
here's the whole thing, literally character for character, so you can screenshot it and study π
struct spi_nor_erase_type {
u32 size;
u32 size_shift;
u32 size_mask;
u8 opcode;
u8 idx;
};
πΈ MEMBERS πΈ
okay so let's go through every single field one by one, because we do not skip members in this house π
sizeβ the size of the sector/block that this erase type erases. and heads up bestie, JEDEC JESD216B imposes erase sizes to be a power of 2 β that's not a suggestion, that's the rule πsize_shiftβ sincesizeis a power of 2, the shift is what gets stored insize_shift. cute little compression moment, we love to see it π«Άsize_maskβ the size mask, and it's based onsize_shift. it's giving "derived value, main character energy" β¨opcodeβ the SPI command op code used to erase the sector/block. this is the actual "do the thing" button π₯idxβ the Erase Type index, as sorted in the Basic Flash Parameter Table. it gets used to synchronize the supported Erase Types with the ones identified in the SFDP optional tables. honestly? teamwork ππ¦
real talk: every one of these fields matters, and none of them are vibes-only. they're all load-bearing π
π SEE ALSO π
go read these next, iykyk β they're all in the kernel file ./drivers/mtd/spi-nor/core.h:
struct spi_nor_erase_command(9)struct spi_nor_erase_region(9)struct spi_nor_erase_map(9)struct spi_nor_locking_ops(9)struct spi_nor_otp_organization(9)struct spi_nor_otp_ops(9)struct spi_nor_otp(9)struct spi_nor_flash_parameter(9)struct spi_nor_fixups(9)struct spi_nor_id(9)struct flash_info(9)struct spi_nor_manufacturer(9)struct sfdp(9)spi_nor_needs_sfdp(9)
and that's the page, bestie π this came straight out of ./drivers/mtd/spi-nor, dated October 2026, and it lives under the name struct spi_nor_erase_type(9) in the Kernel API Manual. periodt π
π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms