Commit f18dbbb1 authored by Shiraz Hashim's avatar Shiraz Hashim Committed by David Woodhouse

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: default avatarShiraz Hashim <shiraz.hashim@st.com>
Signed-off-by: default avatarViresh Kumar <viresh.kumar@st.com>
Signed-off-by: default avatarStefan Roese <sr@denx.de>
Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent 661a0832
......@@ -102,6 +102,13 @@ config M25PXX_USE_FAST_READ
help
This option enables FAST_READ access supported by ST M25Pxx.
config MTD_SPEAR_SMI
tristate "SPEAR MTD NOR Support through SMI controller"
depends on PLAT_SPEAR
default y
help
This enable SNOR support on SPEAR platforms using SMI controller
config MTD_SST25L
tristate "Support SST25L (non JEDEC) SPI Flash chips"
depends on SPI_MASTER
......
......@@ -17,6 +17,7 @@ obj-$(CONFIG_MTD_LART) += lart.o
obj-$(CONFIG_MTD_BLOCK2MTD) += block2mtd.o
obj-$(CONFIG_MTD_DATAFLASH) += mtd_dataflash.o
obj-$(CONFIG_MTD_M25P80) += m25p80.o
obj-$(CONFIG_MTD_SPEAR_SMI) += spear_smi.o
obj-$(CONFIG_MTD_SST25L) += sst25l.o
CFLAGS_docg3.o += -I$(src)
\ No newline at end of file
This diff is collapsed.
/*
* 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 */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment