STRUCT SPEAR_SMI(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct spear_smi(9) β€” the Kernel API Manual tea πŸŽ€

okay so bestie, welcome to the Kernel API Manual, page struct spear_smi(9). this is the structure that holds literally everything the SMI (that's the Serial Memory Interface, iykyk) needs to keep track of itself. think of it as the main character struct β€” every other spear function is lowkey just orbiting it ✨


🌸 NAME 🌸

struct spear_smi β€” the structure for the SMI device, no cap πŸ’œ


πŸ¦‹ SYNOPSIS πŸ¦‹

here's the whole vibe, exactly as it lives in the kernel:

struct spear_smi {
    struct clk *clk;
    u32 status;
    unsigned long clk_rate;
    struct mutex lock;
    void __iomem *io_base;
    struct platform_device *pdev;
    wait_queue_head_t cmd_complete;
    u32 num_flashes;
    struct spear_snor_flash *flash[MAX_NUM_FLASH_CHIP];
 };

look at her. iconic. 🫢


πŸ‘‘ Members πŸ‘‘

okay so each field, one by one, no skipping, we don't do that here πŸ’…

  • clk β€” the functional clock. the literal heartbeat, girlie is keeping time ⏰
  • status β€” the current status register of the SMI. it's giving "how are we doing right now" πŸ’€
  • clk_rate β€” the functional clock rate of the SMI. default is SMI_MAX_CLOCK_FREQ, so that's the number you get unless someone changes it πŸƒβ€β™€οΈ
  • lock β€” the lock that prevents parallel access of the SMI. one at a time, bestie, we take turns πŸ™ˆ
  • io_base β€” base address for the registers of the SMI. the address of the address-y stuff πŸ“
  • pdev β€” the platform device. the actual device she belongs to πŸŽ€
  • cmd_complete β€” the queue you wait on for command completion of the NOR-flash. it's literally "wait here until the flash is done" energy ⏳
  • num_flashes β€” the number of flashes actually present on the board. not the theoretical max, the real ones 🌈
  • flash β€” separate structure for each Serial NOR-flash attached to the SMI. yes it's an array: struct spear_snor_flash *flash[MAX_NUM_FLASH_CHIP], one slot per chip πŸ“

⭐ SEE ALSO ⭐

go read the kernel file ./drivers/mtd/devices/spear_smi.c (that's the source of truth, fr fr), plus these sibling pages β€” collect them all like pokΓ©mon:

ngl, that's a lot of friends. hydrate before you start clicking through them πŸ’§

okay that's the whole page, you ate that 🍽️ this little beauty comes from ./drivers/mtd/devices, dated October 2026 β€” and yes the manual name up top was Kernel API Manual, told you at the start, i promised and i delivered πŸ«‘πŸ’– go read the real source and slay βœ¨πŸ§šβ€β™€οΈ

πŸ“¦ where this page comes from