18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci#ifndef LINUX_SPI_FLASH_H
38c2ecf20Sopenharmony_ci#define LINUX_SPI_FLASH_H
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_cistruct mtd_partition;
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ci/**
88c2ecf20Sopenharmony_ci * struct flash_platform_data: board-specific flash data
98c2ecf20Sopenharmony_ci * @name: optional flash device name (eg, as used with mtdparts=)
108c2ecf20Sopenharmony_ci * @parts: optional array of mtd_partitions for static partitioning
118c2ecf20Sopenharmony_ci * @nr_parts: number of mtd_partitions for static partitioning
128c2ecf20Sopenharmony_ci * @type: optional flash device type (e.g. m25p80 vs m25p64), for use
138c2ecf20Sopenharmony_ci *	with chips that can't be queried for JEDEC or other IDs
148c2ecf20Sopenharmony_ci *
158c2ecf20Sopenharmony_ci * Board init code (in arch/.../mach-xxx/board-yyy.c files) can
168c2ecf20Sopenharmony_ci * provide information about SPI flash parts (such as DataFlash) to
178c2ecf20Sopenharmony_ci * help set up the device and its appropriate default partitioning.
188c2ecf20Sopenharmony_ci *
198c2ecf20Sopenharmony_ci * Note that for DataFlash, sizes for pages, blocks, and sectors are
208c2ecf20Sopenharmony_ci * rarely powers of two; and partitions should be sector-aligned.
218c2ecf20Sopenharmony_ci */
228c2ecf20Sopenharmony_cistruct flash_platform_data {
238c2ecf20Sopenharmony_ci	char		*name;
248c2ecf20Sopenharmony_ci	struct mtd_partition *parts;
258c2ecf20Sopenharmony_ci	unsigned int	nr_parts;
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ci	char		*type;
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ci	/* we'll likely add more ... use JEDEC IDs, etc */
308c2ecf20Sopenharmony_ci};
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci#endif
33