2014-01-13 05:24:50

by Prabhakar Kushwaha

[permalink] [raw]
Subject: [PATCH] Driver/IFC: 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/misc
and fix the header file includes.

Signed-off-by: Prabhakar Kushwaha <[email protected]>
---
arch/powerpc/sysdev/Makefile | 1 -
drivers/misc/Makefile | 1 +
{arch/powerpc/sysdev => drivers/misc}/fsl_ifc.c | 2 +-
drivers/mtd/nand/fsl_ifc_nand.c | 2 +-
.../include/asm => include/linux}/fsl_ifc.h | 0
5 files changed, 3 insertions(+), 3 deletions(-)
rename {arch/powerpc/sysdev => drivers/misc}/fsl_ifc.c (99%)
rename {arch/powerpc/include/asm => include/linux}/fsl_ifc.h (100%)

diff --git a/arch/powerpc/sysdev/Makefile b/arch/powerpc/sysdev/Makefile
index f67ac90..afbcc37 100644
--- a/arch/powerpc/sysdev/Makefile
+++ b/arch/powerpc/sysdev/Makefile
@@ -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
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
index f45473e..61c6271 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -15,6 +15,7 @@ obj-$(CONFIG_BMP085_I2C) += bmp085-i2c.o
obj-$(CONFIG_BMP085_SPI) += bmp085-spi.o
obj-$(CONFIG_DUMMY_IRQ) += dummy-irq.o
obj-$(CONFIG_ICS932S401) += ics932s401.o
+obj-$(CONFIG_FSL_IFC) += fsl_ifc.o
obj-$(CONFIG_LKDTM) += lkdtm.o
obj-$(CONFIG_TIFM_CORE) += tifm_core.o
obj-$(CONFIG_TIFM_7XX1) += tifm_7xx1.o
diff --git a/arch/powerpc/sysdev/fsl_ifc.c b/drivers/misc/fsl_ifc.c
similarity index 99%
rename from arch/powerpc/sysdev/fsl_ifc.c
rename to drivers/misc/fsl_ifc.c
index d7fc722..d4ae878 100644
--- a/arch/powerpc/sysdev/fsl_ifc.c
+++ b/drivers/misc/fsl_ifc.c
@@ -30,8 +30,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);
diff --git a/drivers/mtd/nand/fsl_ifc_nand.c b/drivers/mtd/nand/fsl_ifc_nand.c
index 4335577..865b323 100644
--- a/drivers/mtd/nand/fsl_ifc_nand.c
+++ b/drivers/mtd/nand/fsl_ifc_nand.c
@@ -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
diff --git a/arch/powerpc/include/asm/fsl_ifc.h b/include/linux/fsl_ifc.h
similarity index 100%
rename from arch/powerpc/include/asm/fsl_ifc.h
rename to include/linux/fsl_ifc.h
--
1.7.9.5



2014-01-13 13:32:44

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH] Driver/IFC: Move Freescale IFC driver to a common driver

On Monday 13 January 2014, Prabhakar Kushwaha wrote:
> 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/misc
> and fix the header file includes.
>
> Signed-off-by: Prabhakar Kushwaha <[email protected]>

No objections to the driver, but drivers/misc doesn't seem like the
right place. Why not drivers/mfd or drivers/memory?

You should also find a new place for the binding file, which is
currently in Documentation/devicetree/bindings/powerpc/fsl/ifc.txt.

Arnd

2014-01-13 18:47:40

by Scott Wood

[permalink] [raw]
Subject: Re: [PATCH] Driver/IFC: Move Freescale IFC driver to a common driver

On Mon, 2014-01-13 at 14:32 +0100, Arnd Bergmann wrote:
> On Monday 13 January 2014, Prabhakar Kushwaha wrote:
> > 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/misc
> > and fix the header file includes.
> >
> > Signed-off-by: Prabhakar Kushwaha <[email protected]>
>
> No objections to the driver, but drivers/misc doesn't seem like the
> right place. Why not drivers/mfd or drivers/memory?

It's not a memory controller in the sense that I think most people would
interpret the phrase, but I guess it's similar in function to
mvebu-devbus. If drivers/memory is broad enough to cover such things,
and doesn't have a memory controller subsystem that drivers are supposed
to register with, then that could work.

Are things in drivers/mfd expected to interact with mfd-core.c? It's
not clear to me what that does or how it would be useful to the IFC
code.

-Scott

2014-01-13 19:45:59

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH] Driver/IFC: Move Freescale IFC driver to a common driver

On Monday 13 January 2014, Scott Wood wrote:
> On Mon, 2014-01-13 at 14:32 +0100, Arnd Bergmann wrote:
> > On Monday 13 January 2014, Prabhakar Kushwaha wrote:
> > > 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/misc
> > > and fix the header file includes.
> > >
> > > Signed-off-by: Prabhakar Kushwaha <[email protected]>
> >
> > No objections to the driver, but drivers/misc doesn't seem like the
> > right place. Why not drivers/mfd or drivers/memory?
>
> It's not a memory controller in the sense that I think most people would
> interpret the phrase, but I guess it's similar in function to
> mvebu-devbus. If drivers/memory is broad enough to cover such things,
> and doesn't have a memory controller subsystem that drivers are supposed
> to register with, then that could work.
>
> Are things in drivers/mfd expected to interact with mfd-core.c? It's
> not clear to me what that does or how it would be useful to the IFC
> code.

Sorry, I meant mtd not mfd. mtd would make sense if the only devices
behind it are things like flash or sram memory.

Arnd

2014-01-13 20:10:38

by Scott Wood

[permalink] [raw]
Subject: Re: [PATCH] Driver/IFC: Move Freescale IFC driver to a common driver

On Mon, 2014-01-13 at 20:45 +0100, Arnd Bergmann wrote:
> On Monday 13 January 2014, Scott Wood wrote:
> > On Mon, 2014-01-13 at 14:32 +0100, Arnd Bergmann wrote:
> > > On Monday 13 January 2014, Prabhakar Kushwaha wrote:
> > > > 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/misc
> > > > and fix the header file includes.
> > > >
> > > > Signed-off-by: Prabhakar Kushwaha <[email protected]>
> > >
> > > No objections to the driver, but drivers/misc doesn't seem like the
> > > right place. Why not drivers/mfd or drivers/memory?
> >
> > It's not a memory controller in the sense that I think most people would
> > interpret the phrase, but I guess it's similar in function to
> > mvebu-devbus. If drivers/memory is broad enough to cover such things,
> > and doesn't have a memory controller subsystem that drivers are supposed
> > to register with, then that could work.
> >
> > Are things in drivers/mfd expected to interact with mfd-core.c? It's
> > not clear to me what that does or how it would be useful to the IFC
> > code.
>
> Sorry, I meant mtd not mfd. mtd would make sense if the only devices
> behind it are things like flash or sram memory.

Some of the things behind it are flash, but those portions of the driver
are already in drivers/mtd. This is just the common code.

-Scott

2014-01-13 21:22:21

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH] Driver/IFC: Move Freescale IFC driver to a common driver

On Monday 13 January 2014, Scott Wood wrote:
> On Mon, 2014-01-13 at 20:45 +0100, Arnd Bergmann wrote:
> > On Monday 13 January 2014, Scott Wood wrote:
> > > On Mon, 2014-01-13 at 14:32 +0100, Arnd Bergmann wrote:
> > > > On Monday 13 January 2014, Prabhakar Kushwaha wrote:
> > > > > 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/misc
> > > > > and fix the header file includes.
> > > > >
> > > > > Signed-off-by: Prabhakar Kushwaha <[email protected]>
> > > >
> > > > No objections to the driver, but drivers/misc doesn't seem like the
> > > > right place. Why not drivers/mfd or drivers/memory?
> > >
> > > It's not a memory controller in the sense that I think most people would
> > > interpret the phrase, but I guess it's similar in function to
> > > mvebu-devbus. If drivers/memory is broad enough to cover such things,
> > > and doesn't have a memory controller subsystem that drivers are supposed
> > > to register with, then that could work.
> > >
> > > Are things in drivers/mfd expected to interact with mfd-core.c? It's
> > > not clear to me what that does or how it would be useful to the IFC
> > > code.
> >
> > Sorry, I meant mtd not mfd. mtd would make sense if the only devices
> > behind it are things like flash or sram memory.
>
> Some of the things behind it are flash, but those portions of the driver
> are already in drivers/mtd. This is just the common code.
>

What are the things that are not flash then?

Arnd

2014-01-13 21:24:34

by Scott Wood

[permalink] [raw]
Subject: Re: [PATCH] Driver/IFC: Move Freescale IFC driver to a common driver

On Mon, 2014-01-13 at 22:22 +0100, Arnd Bergmann wrote:
> On Monday 13 January 2014, Scott Wood wrote:
> > On Mon, 2014-01-13 at 20:45 +0100, Arnd Bergmann wrote:
> > > On Monday 13 January 2014, Scott Wood wrote:
> > > > On Mon, 2014-01-13 at 14:32 +0100, Arnd Bergmann wrote:
> > > > > On Monday 13 January 2014, Prabhakar Kushwaha wrote:
> > > > > > 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/misc
> > > > > > and fix the header file includes.
> > > > > >
> > > > > > Signed-off-by: Prabhakar Kushwaha <[email protected]>
> > > > >
> > > > > No objections to the driver, but drivers/misc doesn't seem like the
> > > > > right place. Why not drivers/mfd or drivers/memory?
> > > >
> > > > It's not a memory controller in the sense that I think most people would
> > > > interpret the phrase, but I guess it's similar in function to
> > > > mvebu-devbus. If drivers/memory is broad enough to cover such things,
> > > > and doesn't have a memory controller subsystem that drivers are supposed
> > > > to register with, then that could work.
> > > >
> > > > Are things in drivers/mfd expected to interact with mfd-core.c? It's
> > > > not clear to me what that does or how it would be useful to the IFC
> > > > code.
> > >
> > > Sorry, I meant mtd not mfd. mtd would make sense if the only devices
> > > behind it are things like flash or sram memory.
> >
> > Some of the things behind it are flash, but those portions of the driver
> > are already in drivers/mtd. This is just the common code.
> >
>
> What are the things that are not flash then?

FPGAs or any other random things that might get connected to it on a
custom board.

-Scott

2014-01-13 22:18:02

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH] Driver/IFC: Move Freescale IFC driver to a common driver

On Monday 13 January 2014, Scott Wood wrote:
> On Mon, 2014-01-13 at 22:22 +0100, Arnd Bergmann wrote:
> > On Monday 13 January 2014, Scott Wood wrote:
> > >
> > > Some of the things behind it are flash, but those portions of the driver
> > > are already in drivers/mtd. This is just the common code.
> > >
> >
> > What are the things that are not flash then?
>
> FPGAs or any other random things that might get connected to it on a
> custom board.

Ok, that is similar to a number of other external buses then, like the
mvebu-devbus.c. I'd suggest you put it in drivers/memory.

Arnd