spi_nor_read_raw(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… spi_nor_read_raw(9) β€” the Kernel API Manual, but make it make sense

okay so this is spi_nor_read_raw(9), straight out of the Kernel API Manual, and it's literally the raw read of serial flash memory. bestie, before you even think about calling this, know that read_opcode, addr_nbytes and read_dummy β€” all three of those members of the struct spi_nor β€” should be previously set. like, set them first. πŸ™ˆ


✨ NAME ✨

spi_nor_read_raw β€” raw read of serial flash memory. read_opcode, addr_nbytes and read_dummy members of the struct spi_nor should be previously set.

πŸŽ€ SYNOPSIS πŸŽ€

int spi_nor_read_raw (struct spi_nor *nor , u32 addr , size_t len , u8
*buf );

🌸 ARGUMENTS 🌸

  • nor β€” pointer to a 'struct spi_nor' πŸ¦‹
  • addr β€” offset in the serial flash memory
  • len β€” number of bytes to read
  • buf β€” buffer where the data is copied into (dma-safe memory, no cap, keep it dma-safe or it's giving chaos πŸ’€)

⭐ RETURN ⭐

0 on success, -errno otherwise. that's it, that's the whole vibe check. 🫢

ngl, if you get anything other than 0 back it's a -errno situation, so go read the errno and be nice to yourself about it. πŸ’–

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./drivers/mtd/spi-nor/sfdp.c and honestly the whole friend group:


okay that's the whole page, mwah πŸ’…βœ¨ this iconic little entry lives in ./drivers/mtd/spi-nor and it's dated October 2026 β€” periodt. πŸŽ€πŸ”₯

πŸ“¦ where this page comes from