STRUCT INTEL_SPI(9)
π struct intel_spi(9)
okay so bestie, welcome to the struct intel_spi page β this is the kernel API manual, and it's literally the driver's own private little data stash. yes, driver private data, that's the whole vibe. it's not public-facing, it's not for you to poke at from userspace, it's just the intel SPI driver keeping its stuff together π
β¨ NAME β¨
struct intel_spi β driver private data. that's it, that's the whole thing. it holds the driver's own bookkeeping so nobody else has to π
πΈ SYNOPSIS πΈ
here's the whole struct, exactly as it lives, no cap:
struct intel_spi {
struct device *dev;
const struct intel_spi_boardinfo *info;
void __iomem *base;
void __iomem *pregs;
void __iomem *sregs;
struct spi_controller *host;
size_t nregions;
size_t pr_num;
size_t chip0_size;
bool locked;
bool protected;
bool bios_locked;
bool swseq_reg;
bool swseq_erase;
u8 atomic_preopcode;
u8 opcodes[8];
const struct intel_spi_mem_op *mem_ops;
};
like, look at her. organised. iconic. π«Ά
π Members π
okay let's go through every single one, because we do not skip members in this house π
devβ the device pointer. your classic "which device am i" situation, honestly every struct has one.infoβ pointer to the board specific info. every board's a little different, bestie, this is where that lives π¦baseβ the beginning of MMIO space. like the front door of the memory-mapped neighborhood.pregsβ start of the protection registers. yes, the boring-but-important ones.sregsβ start of the software sequencer registers. sequencer girlies rise β¨hostβ pointer to the SPI controller structure. she's the main character of the show, fr fr.nregionsβ maximum number of regions. maximum, key word.pr_numβ maximum number of protected range registers. more maximums, we love a limit πΈchip0_sizeβ size of the first flash chip, in bytes. bytes!! not kilobytes, not vibes. bytes πlockedβ is the SPI setting locked. simple bool, big consequences.protectedβ whether the regions are write protected. as in, can't touch, don't even try πbios_lockedβ is the BIOS region locked. yes, that BIOS. the one you should not be messing with.swseq_regβ use the SW sequencer in register reads/writes. (SW = software, for the uninitiated π§)swseq_eraseβ use the SW sequencer in the erase operation. same energy, different operation.atomic_preopcodeβ holds the preopcode when an atomic sequence is requested. it's au8, it's little, it's crucial βopcodesβ the opcodes which are supported. and listen: these are programmed by BIOS before it locks down the controller. read that again if you need to, because it's important β BIOS sets these up, then locks everything, and after that it's hands off π₯mem_opsβ pointer to the SPI MEM ops supported by the controller. the controller's lil menu of what it can do, basically.
real talk though β this struct is driver private data. it's the driver's own internal business, so don't go treating it like a public API and building your whole life around the layout, okay? π
π SEE ALSO π
go look at these if you want the full picture:
- Kernel file
./drivers/spi/spi-intel.c intel_spi_probe(9)
both of those are where the actual lore lives, iykyk π
aaaand that's the page!! stay slay, stay read-only when the region is write protected, and remember: this blessed manual came from the ./drivers/spi source, dated October 2026. mwah πβ¨
π¦ 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