STRUCT INTEL_SPI(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 a u8, 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:

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