Skip to contentSkip to conversation

mtd: add OF2PDEV convertor for the NDFC driver

RFC In review Sebastian Siewior 5 participants 6 messages Aug 20, 2008 – Aug 21, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

RFC 1/1 mtd: add OF2PDEV convertor for the NDFC driver

I didn't convert the NDFC driver to support OF because there are non-OF-aware platforms with the ndfc chip.
All settings are mandatory except the oob layout.

---
 drivers/mtd/nand/Kconfig   |    7 ++
 drivers/mtd/nand/Makefile  |    1 +
 drivers/mtd/nand/ndfc_of.c |  253 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 261 insertions(+), 0 deletions(-)
 create mode 100644 drivers/mtd/nand/ndfc_of.c
drivers/mtd/nand/Kconfig +7 -0
index ab0d77e..5bf0a25 100644
@@ -170,6 +170,13 @@ config MTD_NAND_NDFC
 	help
 	 NDFC Nand Flash Controllers are integrated in IBM/AMCC's 4xx SoCs
 
+config MTD_NAND_NDFC_OF
+	tristate "OF support for NDFC"
+	depends on MTD_NAND_NDFC && PPC_OF
+	help
+	  This setting allows to read the NanD configuration from OF instead
+	  of a Platform device.
+
 config MTD_NAND_S3C2410_CLKSTOP
 	bool "S3C2410 NAND IDLE clock stop"
 	depends on MTD_NAND_S3C2410
drivers/mtd/nand/Makefile +1 -0
index b786c5d..5a9da0f 100644
@@ -23,6 +23,7 @@ obj-$(CONFIG_MTD_NAND_TS7250)		+= ts7250.o
 obj-$(CONFIG_MTD_NAND_NANDSIM)		+= nandsim.o
 obj-$(CONFIG_MTD_NAND_CS553X)		+= cs553x_nand.o
 obj-$(CONFIG_MTD_NAND_NDFC)		+= ndfc.o
+obj-$(CONFIG_MTD_NAND_NDFC_OF)		+= ndfc_of.o
 obj-$(CONFIG_MTD_NAND_ATMEL)		+= atmel_nand.o
 obj-$(CONFIG_MTD_NAND_CM_X270)		+= cmx270_nand.o
 obj-$(CONFIG_MTD_NAND_BASLER_EXCITE)	+= excite_nandflash.o
drivers/mtd/nand/ndfc_of.c new file +253 -0

253 lines not on this page · raw message

Signature · 1 line
1.5.5.2
#1 lore raw
Quoted 3 lines · Sebastian Siewior

I didn't convert the NDFC driver to support OF because there are non-OF-aware platforms with the ndfc chip.
All settings are mandatory except the oob layout.

Are you aware of Sean's patch from
http://patchwork.ozlabs.org/linuxppc/patch?id=20183 ?

What are the other platforms using it?

	Arnd <><
#2 lore raw
Quoted 7 lines · On Thu, 21 Aug 2008 00:40:58 +0200 Arnd Bergmann <[email protected]> wrote:
Quoted 3 lines · Sebastian Siewior

I didn't convert the NDFC driver to support OF because there are non-OF-aware platforms with the ndfc chip.
All settings are mandatory except the oob layout.

Are you aware of Sean's patch from
http://patchwork.ozlabs.org/linuxppc/patch?id=20183 ?

I need to look at that hard for .28 still.

Quoted 1 line

What are the other platforms using it?

There should be none. It was an arch/ppc driver originally, and arch/ppc is dead. Since it's only found on 4xx SoCs, there's no reason that I'm aware of to keep it as a platform driver.

Other than the fact that the whole of_platform thing might be replaced with shims to convert them to platform devices. There was talk of that at one time and it made sense to me.

josh

#3 lore raw
Quoted 4 lines · On Wed, 20 Aug 2008 20:37:19 -0400 "Josh Boyer" <[email protected]>…
Quoted 1 line · On Thu, 21 Aug 2008 00:40:58 +0200 Arnd Bergmann <[email protected]> wrote:

On Wednesday 20 August 2008, Sebastian Siewior wrote:

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

I didn't convert the NDFC driver to support OF because there are non-OF-aware platforms with the ndfc chip.
All settings are mandatory except the oob layout.

Are you aware of Sean's patch from
http://patchwork.ozlabs.org/linuxppc/patch?id=20183 ?

I need to look at that hard for .28 still.

Please do, I know it works, but I am not sure it is correct.

I haven't had a chance to really look at the new driver from Sebastian, but it is more complete than mine. It has to be decided if that is a good thing. I modeled my driver after the existing nand of drivers. They also limit, even more than mine, what can be configured.

My gut feel is that it is better to let the upper level nand drivers default correctly based on the chip. For example, on the warp we need to let the ecc layout default since then it can handle the differences between 64M and 256M nand chips without a fixup at boot time. (I believe Sebastian's driver *does* allow this)

I also believe that some fields are now obsolete when going to an of platform driver. For example, chip select is part of the reg entry.

So my goal was to configure as little as possible and then add as needed.

Cheers,
Sean

#4 lore raw
In reply to Arnd Bergmann
Quoted 7 lines · * Arnd Bergmann | 2008-08-21 00:40:58 [+0200]:
Quoted 3 lines · Sebastian Siewior

I didn't convert the NDFC driver to support OF because there are non-OF-aware platforms with the ndfc chip.
All settings are mandatory except the oob layout.

Are you aware of Sean's patch from
http://patchwork.ozlabs.org/linuxppc/patch?id=20183 ?

Yes, I heard of it. tglx told me that the IP-Core might show up in non-IBM HW and it would be better not to drop the platform support.

Quoted 1 line
	Arnd <><

Sebastian

#5 lore raw
Quoted 2 lines · Sebastian Siewior

Yes, I heard of it. tglx told me that the IP-Core might show up in non-IBM HW and it would be better not to drop the platform support.

Thomas, any example of that? I would guess that all powerpc and microblaze systems would use the of_platform drivers now, so is there any other architecture that might get an ndfc?

	Arnd <><