diff options
author | Shiraz Hashim <shiraz.hashim@st.com> | 2012-01-12 14:38:57 +0100 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-03-27 01:14:16 +0200 |
commit | f18dbbb1bfe06ea3995b55c2f533057da9e9294a (patch) | |
tree | 03977f824b653bdaff5638429b6f6bd84577da4e /include | |
parent | mtd: nand: correct comment on nand_chip badblockbits (diff) | |
download | linux-f18dbbb1bfe06ea3995b55c2f533057da9e9294a.tar.xz linux-f18dbbb1bfe06ea3995b55c2f533057da9e9294a.zip |
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.h | 60 |
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 000000000000..4e26b4e38da3 --- /dev/null +++ b/include/linux/mtd/spear_smi.h @@ -0,0 +1,60 @@ +/* + * Copyright © 2010 ST Microelectronics + * Shiraz Hashim <shiraz.hashim@st.com> + * + * This file is licensed under the terms of the GNU General Public + * License version 2. This program is licensed "as is" without any + * warranty of any kind, whether express or implied. + */ + +#ifndef __MTD_SPEAR_SMI_H +#define __MTD_SPEAR_SMI_H + +#include <linux/types.h> +#include <linux/mtd/mtd.h> +#include <linux/mtd/partitions.h> +#include <linux/platform_device.h> + +/* macro to define partitions for flash devices */ +#define DEFINE_PARTS(n, of, s) \ +{ \ + .name = n, \ + .offset = of, \ + .size = s, \ +} + +/** + * struct spear_smi_flash_info - platform structure for passing flash + * information + * + * name: name of the serial nor flash for identification + * mem_base: the memory base on which the flash is mapped + * size: size of the flash in bytes + * partitions: parition details + * nr_partitions: number of partitions + * fast_mode: whether flash supports fast mode + */ + +struct spear_smi_flash_info { + char *name; + unsigned long mem_base; + unsigned long size; + struct mtd_partition *partitions; + int nr_partitions; + u8 fast_mode; +}; + +/** + * struct spear_smi_plat_data - platform structure for configuring smi + * + * clk_rate: clk rate at which SMI must operate + * num_flashes: number of flashes present on board + * board_flash_info: specific details of each flash present on board + */ +struct spear_smi_plat_data { + unsigned long clk_rate; + int num_flashes; + struct spear_smi_flash_info *board_flash_info; +}; + +#endif /* __MTD_SPEAR_SMI_H */ |