Skip to content

RFC "NAND on UPM" and related patches

Anton Vorontsov linuxppc-dev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest7 patches 26 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7Implement GPIO API embryoarch/powerpc/Kconfig arch/powerpc/kernel/prom_parse.c include/asm-powerpc/gpio.h +1 more+128 -02 replies
2/7QE: implement GPIO APIarch/powerpc/platforms/Kconfig arch/powerpc/sysdev/qe_lib/qe_io.c+92 -20 replies
3/7CPM2: implement GPIO APIarch/powerpc/platforms/Kconfig arch/powerpc/sysdev/cpm2_common.c+143 -03 replies
4/7Let drivers link if they support GPIO API as an additioninclude/asm-generic/gpio.h+47 -04 replies
5/7FSL UPM: routines to manage FSL UPMsarch/powerpc/Kconfig arch/powerpc/sysdev/Makefile arch/powerpc/sysdev/fsl_upm.c +1 more+184 -00 replies
6/7FSL UPM NAND driverdrivers/mtd/nand/Kconfig drivers/mtd/nand/Makefile drivers/mtd/nand/fsl_upm.c+318 -00 replies
7/7MPC8360E-RDK: add support for NAND on UPMarch/powerpc/boot/dts/mpc836x_rdk.dts arch/powerpc/platforms/83xx/Kconfig arch/powerpc/platforms/83xx/mpc836x_rdk.c+26 -13 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH RFC 0/7] "NAND on UPM" and related patches

Hi all,

Here are patches to support NAND on UPM. That driver is generic for all processors with FSL UPMs. And because of that, few more patches are needed -- GPIO API and generic FSL UPM functions.

This is early RFC, all patches are in single thread, so everyone could make up overall picture of what is going on. I'll split the thread by topics after that RFC.

Ok, the patches and what they are for:

1,2,3,4. GPIO API:
------------------
Usually NAND chips exports RNB (Ready-Not-Busy) pin, so drivers could read it and get a hint when chip is ready.

Often, WP (write protect) pin is also connected to GPIO. So, GPIO API is mandatory for generic drivers.

OF device tree GPIOs bindings are similar to IRQs:

node {
	gpios = <bank pin bank pin bank pin>;
	gpio-parent = <&par_io_controller>;
};

"bank pin" scheme is controller specific, so controllers that want to implement flat mappings or any other could do so.

So far I implemented GPIO API for QE and CPM2 chips.

QE GPIO API tested to work with FSL UPM NAND driver and MPC8360E-RDK (STMicro NAND512W3A2BN6E).

CPM2 GPIO API tested to work with MPC8555E+Samsung HY27UF081G6 (LP).

GPIO API is described in Documentation/gpio.txt, and these patches are tend to support most of it.

As an additional bonus, PowerPC now gets access to few pleasing drivers:

- drivers/leds/leds-gpio.c (we could use it to play with on-board LEDs);
- drivers/i2c/busses/i2c-gpio.c (generic I2C bit-banging driver);
- drivers/input/keyboard/gpio_keys.c - gpio keys (requires gpio_to_irq, so far not implemented);
- Could be more (I named the ones I knew about).

Also, in the upcoming kernels, there will be GPIOLIB[1] addition to the generic GPIO API, to support off-chip GPIO expanders (like MFDs on I2C/LBC).

[1] http://www.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.24-rc4/2.6.24-rc4-mm1/broken-out/generic-gpio-gpio_chip-support.patch

But so far we support on-chip GPIOs only.

5 - FSL UPM infrastructure:
---------------------------
UPM address register is shared among UPMs, so we have to do proper locking. On the other hand, if we know that specific board using only one UPM we could bypass locking, and gain some performance win.

6. FSL UPM NAND driver:
-----------------------
It's using FSL UPM functions and GPIO API. It does not implement device tree partitions parsing. That issue is completely other matter, that is, I have to factor out parsing functions from physmap_of.c. This desires separate patch on top of the whole series. If anyone currently working on this, let me know.

7. Example of usage.
--------------------
MPC8360E-RDK as an example.

I would appreciate any comments and suggestions, thanks!

Signature · 4 lines
Anton Vorontsov
email: [email protected]
backup email: [email protected]
irc://irc.freenode.net/bd2