summaryrefslogtreecommitdiffstats
path: root/include/spi
diff options
context:
space:
mode:
authorFranck Jullien <franck.jullien@gmail.com>2011-08-24 12:19:24 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2011-08-24 18:44:31 +0200
commite705ccd13095c3a6c4245921c2adea6818c6337d (patch)
tree835dbfa84bdc7ae43f3cebe0b45e32580836533c /include/spi
parentd7bb45559cf6e77ec9d05a5dd9c45c902d11705e (diff)
downloadbarebox-e705ccd13095c3a6c4245921c2adea6818c6337d.tar.gz
barebox-e705ccd13095c3a6c4245921c2adea6818c6337d.tar.xz
nor: Add SPI flash driver
This patch adds the m25p80 driver. It has been ported from Linux. MTD code has been removed. It has been tested with a m25p40 chip and the Altera SPI master driver. Signed-off-by: Franck Jullien <franck.jullien@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/spi')
-rw-r--r--include/spi/flash.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/include/spi/flash.h b/include/spi/flash.h
new file mode 100644
index 0000000000..fe8d09b41c
--- /dev/null
+++ b/include/spi/flash.h
@@ -0,0 +1,30 @@
+#ifndef LINUX_SPI_FLASH_H
+#define LINUX_SPI_FLASH_H
+
+struct mtd_partition;
+
+/**
+ * struct flash_platform_data: board-specific flash data
+ * @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 partitoning
+ * @type: optional flash device type (e.g. m25p80 vs m25p64), for use
+ * with chips that can't be queried for JEDEC or other IDs
+ *
+ * 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.
+ */
+struct flash_platform_data {
+ const char *name;
+ struct mtd_partition *parts;
+ unsigned int nr_parts;
+ char *type;
+
+ /* we'll likely add more ... use JEDEC IDs, etc */
+};
+
+#endif