aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorShiraz Hashim <shiraz.hashim@st.com>2012-01-12 08:38:57 -0500
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-03-26 19:14:16 -0400
commitf18dbbb1bfe06ea3995b55c2f533057da9e9294a (patch)
tree03977f824b653bdaff5638429b6f6bd84577da4e /include
parent661a08327d11bcc4cf649c5ae4bdf2db0a87b320 (diff)
mtd: ST SPEAr: Add SMI driver for serial NOR flash
SPEAr platforms (spear3xx/spear6xx/spear13xx) provide SMI (Serial Memory Interface) controller to access serial NOR flash. SMI provides a simple interface for SPI/serial NOR flashes and has certain inbuilt commands and features to support these flashes easily. It also makes it possible to map an address range in order to directly access (read/write) the SNOR over address bus. This patch intends to provide serial nor driver support for spear platforms which are accessed through SMI. Signed-off-by: Shiraz Hashim <shiraz.hashim@st.com> Signed-off-by: Viresh Kumar <viresh.kumar@st.com> Signed-off-by: Stefan Roese <sr@denx.de> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mtd/spear_smi.h60
1 files changed, 60 insertions, 0 deletions
diff --git a/include/linux/mtd/spear_smi.h b/include/linux/mtd/spear_smi.h
new file mode 100644
index 00000000000..4e26b4e38da
--- /dev/null
+++ b/include/linux/mtd/spear_smi.h
@@ -0,0 +1,60 @@
1/*
2 * Copyright © 2010 ST Microelectronics
3 * Shiraz Hashim <shiraz.hashim@st.com>
4 *
5 * This file is licensed under the terms of the GNU General Public
6 * License version 2. This program is licensed "as is" without any
7 * warranty of any kind, whether express or implied.
8 */
9
10#ifndef __MTD_SPEAR_SMI_H
11#define __MTD_SPEAR_SMI_H
12
13#include <linux/types.h>
14#include <linux/mtd/mtd.h>
15#include <linux/mtd/partitions.h>
16#include <linux/platform_device.h>
17
18/* macro to define partitions for flash devices */
19#define DEFINE_PARTS(n, of, s) \
20{ \
21 .name = n, \
22 .offset = of, \
23 .size = s, \
24}
25
26/**
27 * struct spear_smi_flash_info - platform structure for passing flash
28 * information
29 *
30 * name: name of the serial nor flash for identification
31 * mem_base: the memory base on which the flash is mapped
32 * size: size of the flash in bytes
33 * partitions: parition details
34 * nr_partitions: number of partitions
35 * fast_mode: whether flash supports fast mode
36 */
37
38struct spear_smi_flash_info {
39 char *name;
40 unsigned long mem_base;
41 unsigned long size;
42 struct mtd_partition *partitions;
43 int nr_partitions;
44 u8 fast_mode;
45};
46
47/**
48 * struct spear_smi_plat_data - platform structure for configuring smi
49 *
50 * clk_rate: clk rate at which SMI must operate
51 * num_flashes: number of flashes present on board
52 * board_flash_info: specific details of each flash present on board
53 */
54struct spear_smi_plat_data {
55 unsigned long clk_rate;
56 int num_flashes;
57 struct spear_smi_flash_info *board_flash_info;
58};
59
60#endif /* __MTD_SPEAR_SMI_H */