All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amit Virdi <amit.virdi@st.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 01/11] st_smi: Add support for SPEAr SMI driver
Date: Fri, 24 Feb 2012 17:53:04 +0530	[thread overview]
Message-ID: <1330086194-21762-2-git-send-email-amit.virdi@st.com> (raw)
In-Reply-To: <1330086194-21762-1-git-send-email-amit.virdi@st.com>

From: Vipin KUMAR <vipin.kumar@st.com>

SMI is the serial memory interface controller provided by ST.

Earlier, a driver exists in the u-boot source code for the SMI IP. However, it
was specific to spear platforms. This commit converts the same driver to a more
generic driver. As a result, the driver files are renamed to st_smi.c and
st_smi.h and moved into drivers/mtd folder for reusability by other platforms
using smi controller peripheral.

Signed-off-by: Vipin Kumar <vipin.kumar@st.com>
Signed-off-by: Amit Virdi <amit.virdi@st.com>
---
 drivers/mtd/Makefile                               |    2 +-
 drivers/mtd/{spr_smi.c => st_smi.c}                |    5 +++--
 include/configs/spear-common.h                     |    6 +++---
 .../spr_smi.h => include/linux/mtd/st_smi.h        |    6 ++++--
 4 files changed, 11 insertions(+), 8 deletions(-)
 rename drivers/mtd/{spr_smi.c => st_smi.c} (99%)
 rename arch/arm/include/asm/arch-spear/spr_smi.h => include/linux/mtd/st_smi.h (98%)

diff --git a/drivers/mtd/Makefile b/drivers/mtd/Makefile
index 5a5ecdf..543c845 100644
--- a/drivers/mtd/Makefile
+++ b/drivers/mtd/Makefile
@@ -35,7 +35,7 @@ COBJS-$(CONFIG_HAS_DATAFLASH) += dataflash.o
 COBJS-$(CONFIG_FTSMC020) += ftsmc020.o
 COBJS-$(CONFIG_FLASH_CFI_LEGACY) += jedec_flash.o
 COBJS-$(CONFIG_MW_EEPROM) += mw_eeprom.o
-COBJS-$(CONFIG_SPEARSMI) += spr_smi.o
+COBJS-$(CONFIG_ST_SMI) += st_smi.o
 
 COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
diff --git a/drivers/mtd/spr_smi.c b/drivers/mtd/st_smi.c
similarity index 99%
rename from drivers/mtd/spr_smi.c
rename to drivers/mtd/st_smi.c
index 9a70a19..b514046 100644
--- a/drivers/mtd/spr_smi.c
+++ b/drivers/mtd/st_smi.c
@@ -24,10 +24,10 @@
 #include <common.h>
 #include <flash.h>
 #include <linux/err.h>
+#include <linux/mtd/st_smi.h>
 
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
-#include <asm/arch/spr_smi.h>
 
 #if !defined(CONFIG_SYS_NO_FLASH)
 
@@ -82,6 +82,7 @@ static unsigned int smi_read_id(flash_info_t *info, int banknum)
 	writel(READ_ID, &smicntl->smi_tr);
 	writel((banknum << BANKSEL_SHIFT) | SEND | TX_LEN_1 | RX_LEN_3,
 	       &smicntl->smi_cr2);
+
 	smi_wait_xfer_finish(XFER_FINISH_TOUT);
 
 	value = (readl(&smicntl->smi_rr) & 0x00FFFFFF);
@@ -232,7 +233,7 @@ static int smi_write_enable(int bank)
  *
  * SMI initialization routine. Sets SMI control register1.
  */
-static void smi_init(void)
+void smi_init(void)
 {
 	/* Setting the fast mode values. SMI working at 166/4 = 41.5 MHz */
 	writel(HOLD1 | FAST_MODE | BANK_EN | DSEL_TIME | PRESCAL4,
diff --git a/include/configs/spear-common.h b/include/configs/spear-common.h
index 3947fd5..5a582e8 100644
--- a/include/configs/spear-common.h
+++ b/include/configs/spear-common.h
@@ -55,10 +55,10 @@
 #if defined(CONFIG_FLASH_PNOR)
 #define CONFIG_SPEAR_EMI
 #else
-#define CONFIG_SPEARSMI
+#define CONFIG_ST_SMI
 #endif
 
-#if defined(CONFIG_SPEARSMI)
+#if defined(CONFIG_ST_SMI)
 
 #define CONFIG_SYS_MAX_FLASH_BANKS		2
 #define CONFIG_SYS_FLASH_BASE			0xF8000000
@@ -124,7 +124,7 @@
  * U-Boot Environment placing definitions.
  */
 #if defined(CONFIG_ENV_IS_IN_FLASH)
-#ifdef CONFIG_SPEARSMI
+#ifdef CONFIG_ST_SMI
 /*
  * Environment is in serial NOR flash
  */
diff --git a/arch/arm/include/asm/arch-spear/spr_smi.h b/include/linux/mtd/st_smi.h
similarity index 98%
rename from arch/arm/include/asm/arch-spear/spr_smi.h
rename to include/linux/mtd/st_smi.h
index 06df745..b7a78ac 100644
--- a/arch/arm/include/asm/arch-spear/spr_smi.h
+++ b/include/linux/mtd/st_smi.h
@@ -21,8 +21,8 @@
  * MA 02111-1307 USA
  */
 
-#ifndef SPR_SMI_H
-#define SPR_SMI_H
+#ifndef ST_SMI_H
+#define ST_SMI_H
 
 /* 0xF800.0000 . 0xFBFF.FFFF	64MB	SMI (Serial Flash Mem) */
 /* 0xFC00.0000 . 0xFC1F.FFFF	2MB	SMI (Serial Flash Reg.) */
@@ -112,4 +112,6 @@ struct flash_dev {
 #define XFER_FINISH_TOUT	2	/* xfer finish timeout */
 #define WMODE_TOUT		2	/* write enable timeout */
 
+extern void smi_init(void);
+
 #endif
-- 
1.7.2.2

  reply	other threads:[~2012-02-24 12:23 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-24 12:23 [U-Boot] [PATCH 00/11] mtd/SMI: Add support for ST SMI controller Amit Virdi
2012-02-24 12:23 ` Amit Virdi [this message]
2012-04-20  7:47   ` [U-Boot] [PATCH 01/11] st_smi: Add support for SPEAr SMI driver Stefan Roese
2012-02-24 12:23 ` [U-Boot] [PATCH 02/11] st_smi: Remove compilation warning Amit Virdi
2012-02-24 12:23 ` [U-Boot] [PATCH 03/11] st_smi: Return error in case TFF is not set Amit Virdi
2012-02-27 10:26   ` Stefan Roese
2012-02-29  9:10     ` Amit Virdi
2012-03-02 13:32       ` Stefan Roese
2012-02-24 12:23 ` [U-Boot] [PATCH 04/11] st_smi: Change SMI timeout values Amit Virdi
2012-02-24 12:23 ` [U-Boot] [PATCH 05/11] st_smi: Enhance the error handling Amit Virdi
2012-02-24 12:23 ` [U-Boot] [PATCH 06/11] st_smi: Read status until timeout happens Amit Virdi
2012-02-24 12:23 ` [U-Boot] [PATCH 07/11] st_smi: Move status register read before modifying ctrl register Amit Virdi
2012-02-24 12:23 ` [U-Boot] [PATCH 08/11] st_smi: Fix smi read status Amit Virdi
2012-02-24 12:23 ` [U-Boot] [PATCH 09/11] st_smi: Removed no needed dependency on ST_M25Pxx_ID Amit Virdi
2012-02-24 12:23 ` [U-Boot] [PATCH 10/11] st_smi: Change the flash probing method Amit Virdi
2012-02-24 12:23 ` [U-Boot] [PATCH 11/11] st_smi: Fix bug in flash_print_info() Amit Virdi
2012-03-07 10:02 ` [U-Boot] [PATCH 00/11] mtd/SMI: Add support for ST SMI controller Amit Virdi
2012-03-07 11:27   ` Stefan Roese
2012-03-07 11:46     ` Amit Virdi
2012-03-07 11:49       ` Stefan Roese
2012-03-30  6:12 ` [U-Boot] [PATCH] st_smi: Fixed page size for Winbond W25Q128FV flash Amit Virdi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1330086194-21762-2-git-send-email-amit.virdi@st.com \
    --to=amit.virdi@st.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.