STRUCT SPI_NOR_FIXUPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

Bestie, welcome to the struct spi_nor_fixups page from the Kernel API Manual πŸ’… this one is literally about SPI NOR fixup hooks β€” the little hook squad that swoops in when the flash config needs a glow-up.

✨ SYNOPSIS ✨

Here’s the struct, exactly as it shows up, no edits, no cap:

struct spi_nor_fixups {
    void (*default_init)(struct spi_nor *nor);
    int (*post_bfpt)(struct spi_nor *nor, const struct
sfdp_parameter_header *bfpt_header, const struct sfdp_bfpt *bfpt);
    void (*smpt_read_dummy)(const struct spi_nor *nor, u8 *read_dummy);
    void (*smpt_map_id)(const struct spi_nor *nor, u8 *map_id);
    int (*post_sfdp)(struct spi_nor *nor);
    int (*late_init)(struct spi_nor *nor);
 };

🌸 Members 🌸

  • default_init β€” called after default flash parameters init. It’s your little tweak moment for flash parameters when the info from the flash_info table is incomplete or wrong. lowkey essential when the table didn’t get the memo 🫠
  • post_bfpt β€” called after the BFPT table has been parsed. That’s it, that’s the job, and it ate πŸ’…
  • smpt_read_dummy β€” called while the SMPT table is being parsed. It’s there to fix the number of dummy cycles in read register ops. tiny detail, big main character energy ✨
  • smpt_map_id β€” called after the map ID in the SMPT table has been determined, specifically for when that map ID is wrong and needs to be fixed. not me fixing the ID at the function afterparty 😭
  • post_sfdp β€” called after SFDP has been parsed. Important little caveat: it is not called for SPI NORs that do not support RDSFDP. Typically used to tweak various parameters that could not be extracted by other means (i.e. when information provided by the SFDP/flash_info tables are incomplete or wrong). This is the β€œbestie, the table lied” hook πŸŽ€
  • late_init β€” used to initialize flash parameters that are not declared in the JESD216 SFDP standard, or where SFDP tables not defined at all. It will replace the default_init hook. so it’s giving β€œnew hook, same lane, upgraded fit” πŸ‘‘

πŸ¦‹ Description πŸ¦‹

Those hooks can be used to tweak the SPI NOR configuration when the SFDP table is broken or not available. Basically: when the flash situation is a mess, these are the designated fixers on call πŸ”₯

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./drivers/mtd/spi-nor/core.h β€” and the whole supporting cast, iykyk:

  • struct spi_nor_erase_type(9)
  • 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_id(9)
  • struct flash_info(9)
  • struct spi_nor_manufacturer(9)
  • struct sfdp(9)
  • spi_nor_needs_sfdp(9)

Okay bestie, that’s the whole page πŸ’– it lives in ./drivers/mtd/spi-nor, dated October 2026, and its manual identity is struct spi_nor_fixups(9) πŸ«ΆπŸŽ€βœ¨

πŸ“¦ where this page comes from