Skip to contentSkip to conversation

driver/memory:Move Freescale IFC driver to a common driver

PATCH Superseded Prabhakar Kushwaha 2 participants 4 messages Jan 28, 2014 – Jan 31, 2014

Subsystems (6)

v7 of 8 Superseded Latest is v8 →

lore
Share & tools
lore
#0 lore raw

PATCH v7 1/2 driver/memory:Move Freescale IFC driver to a common driver

Freescale IFC controller has been used for mpc8xxx. It will be used for ARM-based SoC as well. This patch moves the driver to driver/memory and fix the header file includes.

Also remove module_platform_driver() and instead call platform_driver_register() from subsys_initcall() to make sure this module has been loaded before MTD partition parsing starts.

---
Based upon git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc.git
Branch next

Changes for v2:
- Move fsl_ifc in driver/memory

Changes for v3:
- move device tree bindings to memory

Changes for v4: Rebased to
git://git.kernel.org/pub/scm/linux/kernel/git/scottwood/linux.git

Changes for v5:
- Moved powerpc/Kconfig option to driver/memory

Changes for v6:
- Update Kconfig details

Changes for v7:
- Update Kconfig

 .../{powerpc => memory-controllers}/fsl/ifc.txt    |    0
 arch/powerpc/Kconfig                               |    4 ----
 arch/powerpc/sysdev/Makefile                       |    1 -
 drivers/memory/Kconfig                             |    8 ++++++++
 drivers/memory/Makefile                            |    1 +
 {arch/powerpc/sysdev => drivers/memory}/fsl_ifc.c  |    8 ++++++--
 drivers/mtd/nand/fsl_ifc_nand.c                    |    2 +-
 .../include/asm => include/linux}/fsl_ifc.h        |    0
 8 files changed, 16 insertions(+), 8 deletions(-)
 rename Documentation/devicetree/bindings/{powerpc => memory-controllers}/fsl/ifc.txt (100%)
 rename {arch/powerpc/sysdev => drivers/memory}/fsl_ifc.c (98%)
 rename {arch/powerpc/include/asm => include/linux}/fsl_ifc.h (100%)
Documentation/devicetree/bindings/memory-controllers/fsl/ifc.txt renamed from Documentation/devicetree/bindings/powerpc/fsl/ifc.txt +0 -0
similarity index 100%
rename from Documentation/devicetree/bindings/powerpc/fsl/ifc.txt
rename to Documentation/devicetree/bindings/memory-controllers/fsl/ifc.txt
arch/powerpc/Kconfig +0 -4
index 6ca5d5c..3f868f5 100644
@@ -728,10 +728,6 @@ config FSL_LBC
 	  controller.  Also contains some common code used by
 	  drivers for specific local bus peripherals.
 
-config FSL_IFC
-	bool
-        depends on FSL_SOC
-
 config FSL_GTM
 	bool
 	depends on PPC_83xx || QUICC_ENGINE || CPM2
arch/powerpc/sysdev/Makefile +0 -1
index f67ac90..afbcc37 100644
@@ -21,7 +21,6 @@ obj-$(CONFIG_FSL_SOC)		+= fsl_soc.o fsl_mpic_err.o
 obj-$(CONFIG_FSL_PCI)		+= fsl_pci.o $(fsl-msi-obj-y)
 obj-$(CONFIG_FSL_PMC)		+= fsl_pmc.o
 obj-$(CONFIG_FSL_LBC)		+= fsl_lbc.o
-obj-$(CONFIG_FSL_IFC)		+= fsl_ifc.o
 obj-$(CONFIG_FSL_GTM)		+= fsl_gtm.o
 obj-$(CONFIG_FSL_85XX_CACHE_SRAM)	+= fsl_85xx_l2ctlr.o fsl_85xx_cache_sram.o
 obj-$(CONFIG_SIMPLE_GPIO)	+= simple_gpio.o
drivers/memory/Kconfig +8 -0
index 29a11db..3176866 100644
@@ -50,4 +50,12 @@ config TEGRA30_MC
 	  analysis, especially for IOMMU/SMMU(System Memory Management
 	  Unit) module.
 
+config FSL_IFC
+	bool "Freescale Integrated Flash Controller"
+	depends on FSL_SOC
+	help
+	  This driver is for the Integrated Flash Controller Controller(IFC)
+	  module available in Freescale SoCs. This controller allows to handle flash
+	  devices such as NOR, NAND, FPGA and ASIC etc
+
 endif
drivers/memory/Makefile +1 -0
index 969d923..f2bf25c 100644
@@ -6,6 +6,7 @@ ifeq ($(CONFIG_DDR),y)
 obj-$(CONFIG_OF)		+= of_memory.o
 endif
 obj-$(CONFIG_TI_EMIF)		+= emif.o
+obj-$(CONFIG_FSL_IFC)		+= fsl_ifc.o
 obj-$(CONFIG_MVEBU_DEVBUS)	+= mvebu-devbus.o
 obj-$(CONFIG_TEGRA20_MC)	+= tegra20-mc.o
 obj-$(CONFIG_TEGRA30_MC)	+= tegra30-mc.o
drivers/memory/fsl_ifc.c renamed from arch/powerpc/sysdev/fsl_ifc.c +6 -2
similarity index 98%
rename from arch/powerpc/sysdev/fsl_ifc.c
rename to drivers/memory/fsl_ifc.c
index fbc885b..3d5d792 100644
@@ -29,8 +29,8 @@
 #include <linux/of.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
+#include <linux/fsl_ifc.h>
 #include <asm/prom.h>
-#include <asm/fsl_ifc.h>
 
 struct fsl_ifc_ctrl *fsl_ifc_ctrl_dev;
 EXPORT_SYMBOL(fsl_ifc_ctrl_dev);
@@ -298,7 +298,11 @@ static struct platform_driver fsl_ifc_ctrl_driver = {
 	.remove      = fsl_ifc_ctrl_remove,
 };
 
-module_platform_driver(fsl_ifc_ctrl_driver);
+static int __init fsl_ifc_init(void)
+{
+	return platform_driver_register(&fsl_ifc_ctrl_driver);
+}
+subsys_initcall(fsl_ifc_init);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Freescale Semiconductor");
drivers/mtd/nand/fsl_ifc_nand.c +1 -1
index 4335577..865b323 100644
@@ -30,7 +30,7 @@
 #include <linux/mtd/nand.h>
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/nand_ecc.h>
-#include <asm/fsl_ifc.h>
+#include <linux/fsl_ifc.h>
 
 #define FSL_IFC_V1_1_0	0x01010000
 #define ERR_BYTE		0xFF /* Value returned for read
include/linux/fsl_ifc.h renamed from arch/powerpc/include/asm/fsl_ifc.h +0 -0
similarity index 100%
rename from arch/powerpc/include/asm/fsl_ifc.h
rename to include/linux/fsl_ifc.h
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 10 lines · Prabhakar Kushwaha

Freescale IFC controller has been used for mpc8xxx. It will be used for ARM-based SoC as well. This patch moves the driver to driver/memory and fix the header file includes.

Also remove module_platform_driver() and instead call platform_driver_register() from subsys_initcall() to make sure this module has been loaded before MTD partition parsing starts.

When did Arnd ack this? Especially in v7 form... and I don't see him on CC.

drivers/memory/Kconfig config TEGRA30_MC · line 57

Quoted 5 lines
drivers/memory/Kconfig +5 -0
+config FSL_IFC
+	bool "Freescale Integrated Flash Controller"
+	depends on FSL_SOC
+	help
+	  This driver is for the Integrated Flash Controller Controller(IFC)

Controller Controller?

drivers/memory/Kconfig config TEGRA30_MC · line 59

Quoted 2 lines
drivers/memory/Kconfig +2 -0
+	  module available in Freescale SoCs. This controller allows to handle flash
+	  devices such as NOR, NAND, FPGA and ASIC etc

FPGA and ASIC are not (necessarily) flash devices.

-Scott

#2 lore raw

DQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogV29vZCBTY290dC1CMDc0 MjENCj4gU2VudDogRnJpZGF5LCBKYW51YXJ5IDMxLCAyMDE0IDM6MDEgQU0NCj4gVG86IEt1c2h3 YWhhIFByYWJoYWthci1CMzI1NzkNCj4gQ2M6IGxpbnV4cHBjLWRldkBsaXN0cy5vemxhYnMub3Jn DQo+IFN1YmplY3Q6IFJlOiBbUEFUQ0ggMS8yXVt2N10gZHJpdmVyL21lbW9yeTpNb3ZlIEZyZWVz Y2FsZSBJRkMgZHJpdmVyIHRvIGEgY29tbW9uDQo+IGRyaXZlcg0KPiANCj4gT24gVHVlLCAyMDE0 LTAxLTI4IGF0IDEwOjU5ICswNTMwLCBQcmFiaGFrYXIgS3VzaHdhaGEgd3JvdGU6DQo+ID4gIEZy ZWVzY2FsZSBJRkMgY29udHJvbGxlciBoYXMgYmVlbiB1c2VkIGZvciBtcGM4eHh4LiBJdCB3aWxs IGJlIHVzZWQNCj4gPiBmb3IgQVJNLWJhc2VkIFNvQyBhcyB3ZWxsLiBUaGlzIHBhdGNoIG1vdmVz IHRoZSBkcml2ZXIgdG8NCj4gPiBkcml2ZXIvbWVtb3J5ICBhbmQgZml4IHRoZSBoZWFkZXIgZmls ZSBpbmNsdWRlcy4NCj4gPg0KPiA+ICBBbHNvIHJlbW92ZSBtb2R1bGVfcGxhdGZvcm1fZHJpdmVy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x5KSBmbGFzaCBkZXZp Y2VzLg0KPiANCg0KWWVzIGl0IHRydWUuIA0KSSBhbSBub3Qgc3VyZSB0aGlzIGZvbGRlciBpcyBv bmx5IGZvciBmbGFzaCBjb250cm9sbGVyLg0KSSBjYW4gc2VlIHJlZmVyZW5jZXMgb2YgRlBHQSwg U1JBTSBpbiBzYW1lIEtjb25maWdzLiANCg0KUmVnYXJkcywNClByYWJoYWthcg0K

#3 lore raw
Quoted 36 lines · On Thu, 2014-01-30 at 21:23 -0600, Kushwaha Prabhakar-B32579 wrote:
Quoted 23 lines

-----Original Message-----
From: Wood Scott-B07421
Sent: Friday, January 31, 2014 3:01 AM
To: Kushwaha Prabhakar-B32579
Cc: [email protected]
Subject: Re: [PATCH 1/2][v7] driver/memory:Move Freescale IFC driver to a common driver

Quoted 10 lines · Prabhakar Kushwaha

Freescale IFC controller has been used for mpc8xxx. It will be used
for ARM-based SoC as well. This patch moves the driver to driver/memory and fix the header file includes.

Also remove module_platform_driver() and instead call platform_driver_register() from subsys_initcall() to make sure this
module has been loaded before MTD partition parsing starts.

When did Arnd ack this? Especially in v7 form... and I don't see him on CC.

Quoted 7 lines

drivers/memory/Kconfig config TEGRA30_MC · line 57

Quoted 5 lines
drivers/memory/Kconfig +5 -0
+config FSL_IFC
+	bool "Freescale Integrated Flash Controller"
+	depends on FSL_SOC
+	help
+	  This driver is for the Integrated Flash Controller Controller(IFC)

Controller Controller?

I will fix it

Quoted 3 lines

Review

Quoted 2 lines
(quoted diff) +1 -0
+	  module available in Freescale SoCs. This controller allows to handle

flash

Quoted 8 lines
Quoted 4 lines

drivers/memory/Kconfig config TEGRA30_MC · line 59

Quoted 1 line
drivers/memory/Kconfig +1 -0
+	  devices such as NOR, NAND, FPGA and ASIC etc

FPGA and ASIC are not (necessarily) flash devices.

Yes it true.
I am not sure this folder is only for flash controller. I can see references of FPGA, SRAM in same Kconfigs.

Right, just fix the help text.
s/handle flash devices/handle devices/

-Scott