Skip to contentSkip to conversation

arm:davinci: prepare to move aemif driver to drivers/mfd

PATCH Superseded Manjunathappa, Prakash 2 participants 7 messages Jan 25, 2012 – Jan 31, 2012

Subsystems (6)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/3 arm:davinci: prepare to move aemif driver to drivers/mfd

Patch moves emif header file appropriately as a part preparation to move emif driver from arch/arm/mach-davinci/ to drivers/mfd folder.
There by it isolates modifications in emif interface depicting as platform code change.

Patch series are based on the discussion and concerns expressed in davinci-linux-open-source community. Here is the link for the same:
http://davinci-linux-open-source.1494791.n2.nabble.com/PATCH-arm-davinci-configure-davinci-aemif-chipselects-through-OF-tt7059739.html#none

---
Since v1:
Patch is generated using -M option.

 arch/arm/mach-davinci/aemif.c                      |    2 +-
 arch/arm/mach-davinci/board-da830-evm.c            |    2 +-
 arch/arm/mach-davinci/board-da850-evm.c            |    2 +-
 drivers/mtd/nand/davinci_nand.c                    |    2 +-
 .../aemif.h => include/linux/mfd/davinci_aemif.h   |    0
 5 files changed, 4 insertions(+), 4 deletions(-)
 rename arch/arm/mach-davinci/include/mach/aemif.h => include/linux/mfd/davinci_aemif.h (100%)
arch/arm/mach-davinci/aemif.c +1 -1
index 1ce70a9..b67c115 100644
@@ -15,7 +15,7 @@
 #include <linux/module.h>
 #include <linux/time.h>
 
-#include <mach/aemif.h>
+#include <linux/mfd/davinci_aemif.h>
 
 /* Timing value configuration */
 
arch/arm/mach-davinci/board-da830-evm.c +1 -1
index dc1afe5..0b43554 100644
@@ -31,7 +31,7 @@
 #include <mach/nand.h>
 #include <mach/da8xx.h>
 #include <mach/usb.h>
-#include <mach/aemif.h>
+#include <linux/mfd/davinci_aemif.h>
 #include <mach/spi.h>
 
 #define DA830_EVM_PHY_ID		""
arch/arm/mach-davinci/board-da850-evm.c +1 -1
index 6b22b54..6dda013 100644
@@ -41,7 +41,7 @@
 #include <mach/da8xx.h>
 #include <mach/nand.h>
 #include <mach/mux.h>
-#include <mach/aemif.h>
+#include <linux/mfd/davinci_aemif.h>
 #include <mach/spi.h>
 
 #define DA850_EVM_PHY_ID		"0:00"
drivers/mtd/nand/davinci_nand.c +1 -1
index 6e56615..f19151b 100644
@@ -35,7 +35,7 @@
 #include <linux/slab.h>
 
 #include <mach/nand.h>
-#include <mach/aemif.h>
+#include <linux/mfd/davinci_aemif.h>
 
 /*
  * This is a device driver for the NAND flash controller found on the
include/linux/mfd/davinci_aemif.h renamed from arch/arm/mach-davinci/include/mach/aemif.h +0 -0
similarity index 100%
rename from arch/arm/mach-davinci/include/mach/aemif.h
rename to include/linux/mfd/davinci_aemif.h
Signature · 1 line
1.7.1
#1 lore raw

PATCH v2 2/3 arm:davinci: Move emif driver to drivers/mfd from mach-davinci folder

Move aemif kernel module from arch/arm/amch-davinci/ to multi functional devices frame work.

---
Since v1:
Patch is generated using -M option.

 arch/arm/Kconfig                  |    1 +
 arch/arm/mach-davinci/Makefile    |    4 +-
 arch/arm/mach-davinci/aemif.c     |  133 ---------------------
 drivers/mfd/Makefile              |    1 +
 drivers/mfd/davinci_aemif.c       |  238 +++++++++++++++++++++++++++++++++++++
 include/linux/mfd/davinci_aemif.h |   14 ++
 6 files changed, 256 insertions(+), 135 deletions(-)
 delete mode 100644 arch/arm/mach-davinci/aemif.c
 create mode 100644 drivers/mfd/davinci_aemif.c
arch/arm/Kconfig +1 -0
index 24626b0..5b717cf 100644
@@ -936,6 +936,7 @@ config ARCH_DAVINCI
 	select GENERIC_ALLOCATOR
 	select GENERIC_IRQ_CHIP
 	select ARCH_HAS_HOLES_MEMORYMODEL
+	select MFD_CORE
 	help
 	  Support for TI's DaVinci platform.
 
arch/arm/mach-davinci/Makefile +2 -2
index 2db78bd..e25a459 100644
@@ -4,8 +4,8 @@
 #
 
 # Common objects
-obj-y 			:= time.o clock.o serial.o psc.o \
-			   dma.o usb.o common.o sram.o aemif.o
+obj-y 			:= time.o clock.o serial.o io.o psc.o \
+			   dma.o usb.o common.o sram.o
 
 obj-$(CONFIG_DAVINCI_MUX)		+= mux.o
 
arch/arm/mach-davinci/aemif.c deleted +0 -133

133 lines not on this page · raw message

drivers/mfd/Makefile +1 -0
index b953bab..54fc267 100644
@@ -11,6 +11,7 @@ obj-$(CONFIG_HTC_EGPIO)		+= htc-egpio.o
 obj-$(CONFIG_HTC_PASIC3)	+= htc-pasic3.o
 obj-$(CONFIG_HTC_I2CPLD)	+= htc-i2cpld.o
 
+obj-${CONFIG_ARCH_DAVINCI}	+= davinci_aemif.o
 obj-$(CONFIG_MFD_DAVINCI_VOICECODEC)	+= davinci_voicecodec.o
 obj-$(CONFIG_MFD_DM355EVM_MSP)	+= dm355evm_msp.o
 obj-$(CONFIG_MFD_TI_SSP)	+= ti-ssp.o
drivers/mfd/davinci_aemif.c new file +238 -0

238 lines not on this page · raw message

include/linux/mfd/davinci_aemif.h +14 -0
index 05b2934..18650c3 100644
@@ -10,6 +10,10 @@
 #ifndef _MACH_DAVINCI_AEMIF_H
 #define _MACH_DAVINCI_AEMIF_H
 
+#include <linux/kernel.h>
+#include <linux/platform_device.h>
+#include <linux/mfd/core.h>
+
 #define NRCSR_OFFSET		0x00
 #define AWCCR_OFFSET		0x04
 #define A1CR_OFFSET		0x10
@@ -18,6 +22,16 @@
 #define ACR_EW_MASK		BIT(30)
 #define ACR_SS_MASK		BIT(31)
 
+enum davinci_emif_cells {
+	DAVINCI_NAND_DEVICE_CELL,
+	DAVINCI_NOR_FLASH_CELL,
+};
+
+struct davinci_aemif_devices {
+	struct platform_device *devices;
+	unsigned int num_devices;
+};
+
 /* All timings in nanoseconds */
 struct davinci_aemif_timing {
 	u8	wsetup;
Signature · 1 line
1.7.1
#2 lore raw

PATCH v2 3/3 arm: da830: move NAND and NOR devices as aemif MFD slaves

In reply to Manjunathappa, Prakash

NAND and NOR device are made as aemif devices slave, hence device registration achieved via aemif MFD driver.

---
Since v1:
Patch is generated using -M option.

 arch/arm/mach-davinci/board-da830-evm.c |   31 +++++++++++++++++++++++--------
 1 files changed, 23 insertions(+), 8 deletions(-)
arch/arm/mach-davinci/board-da830-evm.c +23 -8
index 0b43554..0ad3662 100644
@@ -396,14 +396,29 @@ static struct resource da830_evm_nand_resources[] = {
 	},
 };
 
-static struct platform_device da830_evm_nand_device = {
-	.name		= "davinci_nand",
-	.id		= 1,
-	.dev		= {
-		.platform_data	= &da830_evm_nand_pdata,
+static struct platform_device da830_evm_devices[] __initdata = {
+	{
+		.name		= "davinci_nand",
+		.id		= 1,
+		.dev		= {
+			.platform_data	= &da830_evm_nand_pdata,
+		},
+		.num_resources	= ARRAY_SIZE(da830_evm_nand_resources),
+		.resource	= da830_evm_nand_resources,
+	},
+};
+
+static struct davinci_aemif_devices da830_emif_devices = {
+	.devices	= da830_evm_devices,
+	.num_devices	= ARRAY_SIZE(da830_evm_devices),
+};
+
+static struct platform_device davinci_emif_device = {
+	.name	= "davinci_aemif",
+	.id	= -1,
+	.dev	= {
+		.platform_data	= &da830_emif_devices,
 	},
-	.num_resources	= ARRAY_SIZE(da830_evm_nand_resources),
-	.resource	= da830_evm_nand_resources,
 };
 
 static inline void da830_evm_init_nand(int mux_mode)
@@ -422,7 +437,7 @@ static inline void da830_evm_init_nand(int mux_mode)
 		pr_warning("da830_evm_init: emif25 mux setup failed: %d\n",
 				ret);
 
-	ret = platform_device_register(&da830_evm_nand_device);
+	ret = platform_device_register(&davinci_emif_device);
 	if (ret)
 		pr_warning("da830_evm_init: NAND device not registered.\n");
 
Signature · 1 line
1.7.1
#3 lore raw

Re: [PATCH v2 3/3] arm: da830: move NAND and NOR devices as aemif MFD slaves

Hello.

Quoted 10 lines · Prakash

NAND and NOR device are made as aemif devices slave, hence device registration achieved via aemif MFD driver.

---
Since v1:
Patch is generated using -M option.

  arch/arm/mach-davinci/board-da830-evm.c |   31 +++++++++++++++++++++++--------
  1 files changed, 23 insertions(+), 8 deletions(-)

Why only this file? Don't other board files have NAND/NOR devices?

WBR, Sergei

#4 lore raw

RE: [PATCH v2 3/3] arm: da830: move NAND and NOR devices as aemif MFD slaves

Hi Sergei,

Quoted 12 lines · Sergei Shtylyov

Hello.

Quoted 7 lines · Prakash

NAND and NOR device are made as aemif devices slave, hence device registration achieved via aemif MFD driver.

---
Since v1:
Patch is generated using -M option.

Quoted 4 lines
Quoted 2 lines
  arch/arm/mach-davinci/board-da830-evm.c |   31 +++++++++++++++++++++++--------
  1 files changed, 23 insertions(+), 8 deletions(-)

Why only this file? Don't other board files have NAND/NOR devices?

Yes I thought of sending board-da850 changes in separate patch. Should I have to send those changes also in this patch?

Thanks,
Prakash

Quoted 3 lines

WBR, Sergei

#5 lore raw

Re: [PATCH v2 3/3] arm: da830: move NAND and NOR devices as aemif MFD slaves

Hello.

Quoted 8 lines · Prakash
Quoted 7 lines
Quoted 7 lines

NAND and NOR device are made as aemif devices slave, hence device registration achieved via aemif MFD driver.

---
Since v1:
Patch is generated using -M option.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
   arch/arm/mach-davinci/board-da830-evm.c |   31 +++++++++++++++++++++++--------
   1 files changed, 23 insertions(+), 8 deletions(-)

Why only this file? Don't other board files have NAND/NOR devices?

Yes I thought of sending board-da850 changes in separate patch. Should I have to send those changes also in this patch?

There's also board-dm*.c files. I'd done them all in the same patch.

Quoted 2 lines

Thanks,
Prakash

WBR, Sergei

#6 lore raw

RE: [PATCH v2 3/3] arm: da830: move NAND and NOR devices as aemif MFD slaves

Hi Sergei,

Quoted 12 lines · Sergei Shtylyov

Hello.

Quoted 7 lines · Prakash
Quoted 7 lines
Quoted 7 lines

NAND and NOR device are made as aemif devices slave, hence device registration achieved via aemif MFD driver.

---
Since v1:
Patch is generated using -M option.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
   arch/arm/mach-davinci/board-da830-evm.c |   31 +++++++++++++++++++++++--------
   1 files changed, 23 insertions(+), 8 deletions(-)

Why only this file? Don't other board files have NAND/NOR devices?

Yes I thought of sending board-da850 changes in separate patch. Should I have to send those changes also in this patch?

There's also board-dm*.c files. I'd done them all in the same patch.

ok, I will consider all davinci board changes in next version of patch.

Thanks,
Prakash

Quoted 3 lines

WBR, Sergei