STRUCT FLASH_PLATFORM_DATA(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ struct_flash_platform_data(9) πŸŽ€

okay so welcome to the Kernel API Manual, bestie β€” today’s main character is struct flash_platform_data, and it is literally the board-specific flash data struct. πŸ’…βœ¨


✨ NAME ✨

struct flash_platform_data β€” board-specific flash data πŸ¦‹

πŸŽ€ SYNOPSIS πŸŽ€

struct flash_platform_data {
    char *name;
    struct mtd_partition *parts;
    unsigned int    nr_parts;
    char *type;
 };

🧩 Members 🧩

  • name β€” optional flash device name (eg, as used with mtdparts=) πŸ‘€
  • parts β€” optional array of mtd_partitions for static partitioning 🧩
  • nr_parts β€” number of mtd_partitions for static partitioning πŸ”’
  • type β€” optional flash device type (e.g. m25p80 vs m25p64), for use with chips that can't be queried for JEDEC or other IDs 🫢

🌸 Description 🌸

Board init code (in arch/.../mach-xxx/board-yyy.c files) can provide information about SPI flash parts (such as DataFlash) to help set up the device and its appropriate default partitioning. πŸŽ€

🚨 Note that for DataFlash, sizes for pages, blocks, and sectors are rarely powers of two; and partitions should be sector-aligned. 😭

πŸ”— SEE ALSO πŸ”—

  • Kernel file ./include/linux/spi/flash.h πŸ“

mwah πŸ’‹ β€” source/version: ./include/linux/spi; date: October 2026. periodt. πŸ‘‘

πŸ“¦ where this page comes from