STRUCT SPEAR_SMI(9)
π 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 isSMI_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:
struct spear_snor_flash(9)spear_smi_read_sr(9)spear_smi_wait_till_ready(9)spear_smi_int_handler(9)spear_smi_hw_init(9)get_flash_index(9)spear_smi_write_enable(9)spear_smi_erase_sector(9)spear_mtd_erase(9)spear_mtd_read(9)spear_mtd_write(9)spear_smi_probe_flash(9)spear_smi_probe(9)spear_smi_remove(9)
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
- 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