1*b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */ 21d6432feSDavid Brownell #ifndef LINUX_SPI_FLASH_H 31d6432feSDavid Brownell #define LINUX_SPI_FLASH_H 41d6432feSDavid Brownell 51d6432feSDavid Brownell struct mtd_partition; 61d6432feSDavid Brownell 71d6432feSDavid Brownell /** 81d6432feSDavid Brownell * struct flash_platform_data: board-specific flash data 91d6432feSDavid Brownell * @name: optional flash device name (eg, as used with mtdparts=) 101d6432feSDavid Brownell * @parts: optional array of mtd_partitions for static partitioning 118ab102d6SMasahiro Yamada * @nr_parts: number of mtd_partitions for static partitioning 122f9f7628SMike Lavender * @type: optional flash device type (e.g. m25p80 vs m25p64), for use 132f9f7628SMike Lavender * with chips that can't be queried for JEDEC or other IDs 141d6432feSDavid Brownell * 151d6432feSDavid Brownell * Board init code (in arch/.../mach-xxx/board-yyy.c files) can 161d6432feSDavid Brownell * provide information about SPI flash parts (such as DataFlash) to 171d6432feSDavid Brownell * help set up the device and its appropriate default partitioning. 181d6432feSDavid Brownell * 191d6432feSDavid Brownell * Note that for DataFlash, sizes for pages, blocks, and sectors are 201d6432feSDavid Brownell * rarely powers of two; and partitions should be sector-aligned. 211d6432feSDavid Brownell */ 221d6432feSDavid Brownell struct flash_platform_data { 231d6432feSDavid Brownell char *name; 241d6432feSDavid Brownell struct mtd_partition *parts; 251d6432feSDavid Brownell unsigned int nr_parts; 261d6432feSDavid Brownell 272f9f7628SMike Lavender char *type; 282f9f7628SMike Lavender 291d6432feSDavid Brownell /* we'll likely add more ... use JEDEC IDs, etc */ 301d6432feSDavid Brownell }; 311d6432feSDavid Brownell 321d6432feSDavid Brownell #endif 33