* [PATCH v2 1/3] arm:davinci: prepare to move aemif driver to drivers/mfd @ 2012-01-25 10:25 ` Manjunathappa, Prakash 0 siblings, 0 replies; 21+ messages in thread From: Manjunathappa, Prakash @ 2012-01-25 10:25 UTC (permalink / raw) To: linux-arm-kernel, linux-mtd, linux-kernel Cc: davinci-linux-open-source, Russell King, Samuel Ortiz, Sekhar Nori, Manjunathappa, Prakash, David Woodhouse 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 Signed-off-by: Manjunathappa, Prakash <prakash.pm@ti.com> --- 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%) diff --git a/arch/arm/mach-davinci/aemif.c b/arch/arm/mach-davinci/aemif.c index 1ce70a9..b67c115 100644 --- a/arch/arm/mach-davinci/aemif.c +++ b/arch/arm/mach-davinci/aemif.c @@ -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 */ diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c index dc1afe5..0b43554 100644 --- a/arch/arm/mach-davinci/board-da830-evm.c +++ b/arch/arm/mach-davinci/board-da830-evm.c @@ -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 "" diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index 6b22b54..6dda013 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c @@ -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" diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c index 6e56615..f19151b 100644 --- a/drivers/mtd/nand/davinci_nand.c +++ b/drivers/mtd/nand/davinci_nand.c @@ -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 diff --git a/arch/arm/mach-davinci/include/mach/aemif.h b/include/linux/mfd/davinci_aemif.h similarity index 100% rename from arch/arm/mach-davinci/include/mach/aemif.h rename to include/linux/mfd/davinci_aemif.h -- 1.7.1 ^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v2 1/3] arm:davinci: prepare to move aemif driver to drivers/mfd @ 2012-01-25 10:25 ` Manjunathappa, Prakash 0 siblings, 0 replies; 21+ messages in thread From: Manjunathappa, Prakash @ 2012-01-25 10:25 UTC (permalink / raw) To: linux-arm-kernel, linux-mtd, linux-kernel Cc: Sekhar Nori, davinci-linux-open-source, Russell King, David Woodhouse, Samuel Ortiz, Manjunathappa, Prakash 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 Signed-off-by: Manjunathappa, Prakash <prakash.pm@ti.com> --- 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%) diff --git a/arch/arm/mach-davinci/aemif.c b/arch/arm/mach-davinci/aemif.c index 1ce70a9..b67c115 100644 --- a/arch/arm/mach-davinci/aemif.c +++ b/arch/arm/mach-davinci/aemif.c @@ -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 */ diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c index dc1afe5..0b43554 100644 --- a/arch/arm/mach-davinci/board-da830-evm.c +++ b/arch/arm/mach-davinci/board-da830-evm.c @@ -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 "" diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index 6b22b54..6dda013 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c @@ -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" diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c index 6e56615..f19151b 100644 --- a/drivers/mtd/nand/davinci_nand.c +++ b/drivers/mtd/nand/davinci_nand.c @@ -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 diff --git a/arch/arm/mach-davinci/include/mach/aemif.h b/include/linux/mfd/davinci_aemif.h similarity index 100% rename from arch/arm/mach-davinci/include/mach/aemif.h rename to include/linux/mfd/davinci_aemif.h -- 1.7.1 ^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v2 1/3] arm:davinci: prepare to move aemif driver to drivers/mfd @ 2012-01-25 10:25 ` Manjunathappa, Prakash 0 siblings, 0 replies; 21+ messages in thread From: Manjunathappa, Prakash @ 2012-01-25 10:25 UTC (permalink / raw) To: linux-arm-kernel 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 Signed-off-by: Manjunathappa, Prakash <prakash.pm@ti.com> --- 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%) diff --git a/arch/arm/mach-davinci/aemif.c b/arch/arm/mach-davinci/aemif.c index 1ce70a9..b67c115 100644 --- a/arch/arm/mach-davinci/aemif.c +++ b/arch/arm/mach-davinci/aemif.c @@ -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 */ diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c index dc1afe5..0b43554 100644 --- a/arch/arm/mach-davinci/board-da830-evm.c +++ b/arch/arm/mach-davinci/board-da830-evm.c @@ -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 "" diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index 6b22b54..6dda013 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c @@ -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" diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c index 6e56615..f19151b 100644 --- a/drivers/mtd/nand/davinci_nand.c +++ b/drivers/mtd/nand/davinci_nand.c @@ -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 diff --git a/arch/arm/mach-davinci/include/mach/aemif.h b/include/linux/mfd/davinci_aemif.h similarity index 100% rename from arch/arm/mach-davinci/include/mach/aemif.h rename to include/linux/mfd/davinci_aemif.h -- 1.7.1 ^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v2 2/3] arm:davinci: Move emif driver to drivers/mfd from mach-davinci folder 2012-01-25 10:25 ` Manjunathappa, Prakash (?) @ 2012-01-25 10:25 ` Manjunathappa, Prakash -1 siblings, 0 replies; 21+ messages in thread From: Manjunathappa, Prakash @ 2012-01-25 10:25 UTC (permalink / raw) To: linux-arm-kernel, linux-mtd, linux-kernel Cc: davinci-linux-open-source, Russell King, Samuel Ortiz, Sekhar Nori, Manjunathappa, Prakash, David Woodhouse Move aemif kernel module from arch/arm/amch-davinci/ to multi functional devices frame work. Signed-off-by: Manjunathappa, Prakash <prakash.pm@ti.com> --- 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 diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 24626b0..5b717cf 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -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. diff --git a/arch/arm/mach-davinci/Makefile b/arch/arm/mach-davinci/Makefile index 2db78bd..e25a459 100644 --- a/arch/arm/mach-davinci/Makefile +++ b/arch/arm/mach-davinci/Makefile @@ -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 diff --git a/arch/arm/mach-davinci/aemif.c b/arch/arm/mach-davinci/aemif.c deleted file mode 100644 index b67c115..0000000 --- a/arch/arm/mach-davinci/aemif.c +++ /dev/null @@ -1,133 +0,0 @@ -/* - * AEMIF support for DaVinci SoCs - * - * Copyright (C) 2010 Texas Instruments Incorporated. http://www.ti.com/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include <linux/kernel.h> -#include <linux/io.h> -#include <linux/err.h> -#include <linux/clk.h> -#include <linux/module.h> -#include <linux/time.h> - -#include <linux/mfd/davinci_aemif.h> - -/* Timing value configuration */ - -#define TA(x) ((x) << 2) -#define RHOLD(x) ((x) << 4) -#define RSTROBE(x) ((x) << 7) -#define RSETUP(x) ((x) << 13) -#define WHOLD(x) ((x) << 17) -#define WSTROBE(x) ((x) << 20) -#define WSETUP(x) ((x) << 26) - -#define TA_MAX 0x3 -#define RHOLD_MAX 0x7 -#define RSTROBE_MAX 0x3f -#define RSETUP_MAX 0xf -#define WHOLD_MAX 0x7 -#define WSTROBE_MAX 0x3f -#define WSETUP_MAX 0xf - -#define TIMING_MASK (TA(TA_MAX) | \ - RHOLD(RHOLD_MAX) | \ - RSTROBE(RSTROBE_MAX) | \ - RSETUP(RSETUP_MAX) | \ - WHOLD(WHOLD_MAX) | \ - WSTROBE(WSTROBE_MAX) | \ - WSETUP(WSETUP_MAX)) - -/* - * aemif_calc_rate - calculate timing data. - * @wanted: The cycle time needed in nanoseconds. - * @clk: The input clock rate in kHz. - * @max: The maximum divider value that can be programmed. - * - * On success, returns the calculated timing value minus 1 for easy - * programming into AEMIF timing registers, else negative errno. - */ -static int aemif_calc_rate(int wanted, unsigned long clk, int max) -{ - int result; - - result = DIV_ROUND_UP((wanted * clk), NSEC_PER_MSEC) - 1; - - pr_debug("%s: result %d from %ld, %d\n", __func__, result, clk, wanted); - - /* It is generally OK to have a more relaxed timing than requested... */ - if (result < 0) - result = 0; - - /* ... But configuring tighter timings is not an option. */ - else if (result > max) - result = -EINVAL; - - return result; -} - -/** - * davinci_aemif_setup_timing - setup timing values for a given AEMIF interface - * @t: timing values to be progammed - * @base: The virtual base address of the AEMIF interface - * @cs: chip-select to program the timing values for - * - * This function programs the given timing values (in real clock) into the - * AEMIF registers taking the AEMIF clock into account. - * - * This function does not use any locking while programming the AEMIF - * because it is expected that there is only one user of a given - * chip-select. - * - * Returns 0 on success, else negative errno. - */ -int davinci_aemif_setup_timing(struct davinci_aemif_timing *t, - void __iomem *base, unsigned cs) -{ - unsigned set, val; - int ta, rhold, rstrobe, rsetup, whold, wstrobe, wsetup; - unsigned offset = A1CR_OFFSET + cs * 4; - struct clk *aemif_clk; - unsigned long clkrate; - - if (!t) - return 0; /* Nothing to do */ - - aemif_clk = clk_get(NULL, "aemif"); - if (IS_ERR(aemif_clk)) - return PTR_ERR(aemif_clk); - - clkrate = clk_get_rate(aemif_clk); - - clkrate /= 1000; /* turn clock into kHz for ease of use */ - - ta = aemif_calc_rate(t->ta, clkrate, TA_MAX); - rhold = aemif_calc_rate(t->rhold, clkrate, RHOLD_MAX); - rstrobe = aemif_calc_rate(t->rstrobe, clkrate, RSTROBE_MAX); - rsetup = aemif_calc_rate(t->rsetup, clkrate, RSETUP_MAX); - whold = aemif_calc_rate(t->whold, clkrate, WHOLD_MAX); - wstrobe = aemif_calc_rate(t->wstrobe, clkrate, WSTROBE_MAX); - wsetup = aemif_calc_rate(t->wsetup, clkrate, WSETUP_MAX); - - if (ta < 0 || rhold < 0 || rstrobe < 0 || rsetup < 0 || - whold < 0 || wstrobe < 0 || wsetup < 0) { - pr_err("%s: cannot get suitable timings\n", __func__); - return -EINVAL; - } - - set = TA(ta) | RHOLD(rhold) | RSTROBE(rstrobe) | RSETUP(rsetup) | - WHOLD(whold) | WSTROBE(wstrobe) | WSETUP(wsetup); - - val = __raw_readl(base + offset); - val &= ~TIMING_MASK; - val |= set; - __raw_writel(val, base + offset); - - return 0; -} -EXPORT_SYMBOL(davinci_aemif_setup_timing); diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile index b953bab..54fc267 100644 --- a/drivers/mfd/Makefile +++ b/drivers/mfd/Makefile @@ -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 diff --git a/drivers/mfd/davinci_aemif.c b/drivers/mfd/davinci_aemif.c new file mode 100644 index 0000000..ab3292c --- /dev/null +++ b/drivers/mfd/davinci_aemif.c @@ -0,0 +1,238 @@ +/* + * AEMIF support for DaVinci SoCs + * + * Copyright (C) 2010 Texas Instruments Incorporated. http://www.ti.com/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include <linux/kernel.h> +#include <linux/io.h> +#include <linux/err.h> +#include <linux/clk.h> +#include <linux/module.h> +#include <linux/time.h> +#include <linux/mfd/davinci_aemif.h> +#include <linux/mtd/physmap.h> +#include <mach/nand.h> + +static struct mfd_cell davinci_emifs[] = { + { + .name = "davinci_nand", + }, + { + .name = "physmap-flash", + }, +}; + +/* Timing value configuration */ + +#define TA(x) ((x) << 2) +#define RHOLD(x) ((x) << 4) +#define RSTROBE(x) ((x) << 7) +#define RSETUP(x) ((x) << 13) +#define WHOLD(x) ((x) << 17) +#define WSTROBE(x) ((x) << 20) +#define WSETUP(x) ((x) << 26) + +#define TA_MAX 0x3 +#define RHOLD_MAX 0x7 +#define RSTROBE_MAX 0x3f +#define RSETUP_MAX 0xf +#define WHOLD_MAX 0x7 +#define WSTROBE_MAX 0x3f +#define WSETUP_MAX 0xf + +#define TIMING_MASK (TA(TA_MAX) | \ + RHOLD(RHOLD_MAX) | \ + RSTROBE(RSTROBE_MAX) | \ + RSETUP(RSETUP_MAX) | \ + WHOLD(WHOLD_MAX) | \ + WSTROBE(WSTROBE_MAX) | \ + WSETUP(WSETUP_MAX)) + +/* + * aemif_calc_rate - calculate timing data. + * @wanted: The cycle time needed in nanoseconds. + * @clk: The input clock rate in kHz. + * @max: The maximum divider value that can be programmed. + * + * On success, returns the calculated timing value minus 1 for easy + * programming into AEMIF timing registers, else negative errno. + */ +static int aemif_calc_rate(int wanted, unsigned long clk, int max) +{ + int result; + + result = DIV_ROUND_UP((wanted * clk), NSEC_PER_MSEC) - 1; + + pr_debug("%s: result %d from %ld, %d\n", __func__, result, clk, wanted); + + /* It is generally OK to have a more relaxed timing than requested... */ + if (result < 0) + result = 0; + + /* ... But configuring tighter timings is not an option. */ + else if (result > max) + result = -EINVAL; + + return result; +} + +/** + * davinci_aemif_setup_timing - setup timing values for a given AEMIF interface + * @t: timing values to be progammed + * @base: The virtual base address of the AEMIF interface + * @cs: chip-select to program the timing values for + * + * This function programs the given timing values (in real clock) into the + * AEMIF registers taking the AEMIF clock into account. + * + * This function does not use any locking while programming the AEMIF + * because it is expected that there is only one user of a given + * chip-select. + * + * Returns 0 on success, else negative errno. + */ +int davinci_aemif_setup_timing(struct davinci_aemif_timing *t, + void __iomem *base, unsigned cs) +{ + unsigned set, val; + int ta, rhold, rstrobe, rsetup, whold, wstrobe, wsetup; + unsigned offset = A1CR_OFFSET + cs * 4; + struct clk *aemif_clk; + unsigned long clkrate; + + if (!t) + return 0; /* Nothing to do */ + + aemif_clk = clk_get(NULL, "aemif"); + if (IS_ERR(aemif_clk)) + return PTR_ERR(aemif_clk); + + clkrate = clk_get_rate(aemif_clk); + + clkrate /= 1000; /* turn clock into kHz for ease of use */ + + ta = aemif_calc_rate(t->ta, clkrate, TA_MAX); + rhold = aemif_calc_rate(t->rhold, clkrate, RHOLD_MAX); + rstrobe = aemif_calc_rate(t->rstrobe, clkrate, RSTROBE_MAX); + rsetup = aemif_calc_rate(t->rsetup, clkrate, RSETUP_MAX); + whold = aemif_calc_rate(t->whold, clkrate, WHOLD_MAX); + wstrobe = aemif_calc_rate(t->wstrobe, clkrate, WSTROBE_MAX); + wsetup = aemif_calc_rate(t->wsetup, clkrate, WSETUP_MAX); + + if (ta < 0 || rhold < 0 || rstrobe < 0 || rsetup < 0 || + whold < 0 || wstrobe < 0 || wsetup < 0) { + pr_err("%s: cannot get suitable timings\n", __func__); + return -EINVAL; + } + + set = TA(ta) | RHOLD(rhold) | RSTROBE(rstrobe) | RSETUP(rsetup) | + WHOLD(whold) | WSTROBE(wstrobe) | WSETUP(wsetup); + + val = __raw_readl(base + offset); + val &= ~TIMING_MASK; + val |= set; + __raw_writel(val, base + offset); + + return 0; +} +EXPORT_SYMBOL(davinci_aemif_setup_timing); + +static int __init davinci_aemif_probe(struct platform_device *pdev) +{ + struct davinci_aemif_devices *davinci_aemif_devices = + pdev->dev.platform_data; + struct platform_device *devices; + struct mfd_cell *cells; + int i, ret; + + devices = davinci_aemif_devices->devices; + cells = davinci_emifs; + + /* DaVinci NAND device client */ + for (i = 0; i < davinci_aemif_devices->num_devices; i++) { + if (!strcmp(devices[i].name, + cells[DAVINCI_NAND_DEVICE_CELL].name)) + break; + + } + if (i > davinci_aemif_devices->num_devices) { + dev_err(&pdev->dev, "No NAND device found by DaVinci EMIF" + "MFD\n"); + cells[DAVINCI_NAND_DEVICE_CELL].name = NULL; + } else { + cells[DAVINCI_NAND_DEVICE_CELL].platform_data = + devices[i].dev.platform_data; + cells[DAVINCI_NAND_DEVICE_CELL].pdata_size = + sizeof(struct davinci_nand_pdata); + cells[DAVINCI_NAND_DEVICE_CELL].id = devices[i].id; + cells[DAVINCI_NAND_DEVICE_CELL].resources = + devices[i].resource; + cells[DAVINCI_NAND_DEVICE_CELL].num_resources = + devices[i].num_resources; + } + + /* DaVinci NOR device client */ + for (i = 0; i < davinci_aemif_devices->num_devices; i++) { + if (!strcmp(devices[i].name, + cells[DAVINCI_NOR_FLASH_CELL].name)) + break; + } + + if (i > davinci_aemif_devices->num_devices) { + dev_err(&pdev->dev, "No NOR device found by DaVinci EMIF" + "MFD\n"); + cells[DAVINCI_NOR_FLASH_CELL].name = NULL; + } else { + cells[DAVINCI_NOR_FLASH_CELL].platform_data = + devices[i].dev.platform_data; + cells[DAVINCI_NOR_FLASH_CELL].pdata_size = + sizeof(struct physmap_flash_data); + cells[DAVINCI_NOR_FLASH_CELL].id = devices[i].id; + cells[DAVINCI_NOR_FLASH_CELL].resources = devices[i].resource; + cells[DAVINCI_NOR_FLASH_CELL].num_resources = + devices[i].num_resources; + } + + ret = mfd_add_devices(&pdev->dev, pdev->id, cells, + davinci_aemif_devices->num_devices, NULL, 0); + if (ret != 0) + dev_err(&pdev->dev, "fail to register client devices\n"); + + return 0; +} + +static int __devexit davinci_aemif_remove(struct platform_device *pdev) +{ + mfd_remove_devices(&pdev->dev); + return 0; +} + +static struct platform_driver davinci_aemif_driver = { + .driver = { + .name = "davinci_aemif", + .owner = THIS_MODULE, + }, + .remove = __devexit_p(davinci_aemif_remove), +}; + +static int __init davinci_aemif_init(void) +{ + return platform_driver_probe(&davinci_aemif_driver, + davinci_aemif_probe); +} +module_init(davinci_aemif_init); + +static void __exit davinci_aemif_exit(void) +{ + platform_driver_unregister(&davinci_aemif_driver); +} +module_exit(davinci_aemif_exit); + +MODULE_AUTHOR("Prakash Manjunathappa"); +MODULE_DESCRIPTION("Texas Instruments AEMIF Interface"); +MODULE_LICENSE("GPL"); diff --git a/include/linux/mfd/davinci_aemif.h b/include/linux/mfd/davinci_aemif.h index 05b2934..18650c3 100644 --- a/include/linux/mfd/davinci_aemif.h +++ b/include/linux/mfd/davinci_aemif.h @@ -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; -- 1.7.1 ^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v2 2/3] arm:davinci: Move emif driver to drivers/mfd from mach-davinci folder @ 2012-01-25 10:25 ` Manjunathappa, Prakash 0 siblings, 0 replies; 21+ messages in thread From: Manjunathappa, Prakash @ 2012-01-25 10:25 UTC (permalink / raw) To: linux-arm-kernel, linux-mtd, linux-kernel Cc: Sekhar Nori, davinci-linux-open-source, Russell King, David Woodhouse, Samuel Ortiz, Manjunathappa, Prakash Move aemif kernel module from arch/arm/amch-davinci/ to multi functional devices frame work. Signed-off-by: Manjunathappa, Prakash <prakash.pm@ti.com> --- 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 diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 24626b0..5b717cf 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -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. diff --git a/arch/arm/mach-davinci/Makefile b/arch/arm/mach-davinci/Makefile index 2db78bd..e25a459 100644 --- a/arch/arm/mach-davinci/Makefile +++ b/arch/arm/mach-davinci/Makefile @@ -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 diff --git a/arch/arm/mach-davinci/aemif.c b/arch/arm/mach-davinci/aemif.c deleted file mode 100644 index b67c115..0000000 --- a/arch/arm/mach-davinci/aemif.c +++ /dev/null @@ -1,133 +0,0 @@ -/* - * AEMIF support for DaVinci SoCs - * - * Copyright (C) 2010 Texas Instruments Incorporated. http://www.ti.com/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include <linux/kernel.h> -#include <linux/io.h> -#include <linux/err.h> -#include <linux/clk.h> -#include <linux/module.h> -#include <linux/time.h> - -#include <linux/mfd/davinci_aemif.h> - -/* Timing value configuration */ - -#define TA(x) ((x) << 2) -#define RHOLD(x) ((x) << 4) -#define RSTROBE(x) ((x) << 7) -#define RSETUP(x) ((x) << 13) -#define WHOLD(x) ((x) << 17) -#define WSTROBE(x) ((x) << 20) -#define WSETUP(x) ((x) << 26) - -#define TA_MAX 0x3 -#define RHOLD_MAX 0x7 -#define RSTROBE_MAX 0x3f -#define RSETUP_MAX 0xf -#define WHOLD_MAX 0x7 -#define WSTROBE_MAX 0x3f -#define WSETUP_MAX 0xf - -#define TIMING_MASK (TA(TA_MAX) | \ - RHOLD(RHOLD_MAX) | \ - RSTROBE(RSTROBE_MAX) | \ - RSETUP(RSETUP_MAX) | \ - WHOLD(WHOLD_MAX) | \ - WSTROBE(WSTROBE_MAX) | \ - WSETUP(WSETUP_MAX)) - -/* - * aemif_calc_rate - calculate timing data. - * @wanted: The cycle time needed in nanoseconds. - * @clk: The input clock rate in kHz. - * @max: The maximum divider value that can be programmed. - * - * On success, returns the calculated timing value minus 1 for easy - * programming into AEMIF timing registers, else negative errno. - */ -static int aemif_calc_rate(int wanted, unsigned long clk, int max) -{ - int result; - - result = DIV_ROUND_UP((wanted * clk), NSEC_PER_MSEC) - 1; - - pr_debug("%s: result %d from %ld, %d\n", __func__, result, clk, wanted); - - /* It is generally OK to have a more relaxed timing than requested... */ - if (result < 0) - result = 0; - - /* ... But configuring tighter timings is not an option. */ - else if (result > max) - result = -EINVAL; - - return result; -} - -/** - * davinci_aemif_setup_timing - setup timing values for a given AEMIF interface - * @t: timing values to be progammed - * @base: The virtual base address of the AEMIF interface - * @cs: chip-select to program the timing values for - * - * This function programs the given timing values (in real clock) into the - * AEMIF registers taking the AEMIF clock into account. - * - * This function does not use any locking while programming the AEMIF - * because it is expected that there is only one user of a given - * chip-select. - * - * Returns 0 on success, else negative errno. - */ -int davinci_aemif_setup_timing(struct davinci_aemif_timing *t, - void __iomem *base, unsigned cs) -{ - unsigned set, val; - int ta, rhold, rstrobe, rsetup, whold, wstrobe, wsetup; - unsigned offset = A1CR_OFFSET + cs * 4; - struct clk *aemif_clk; - unsigned long clkrate; - - if (!t) - return 0; /* Nothing to do */ - - aemif_clk = clk_get(NULL, "aemif"); - if (IS_ERR(aemif_clk)) - return PTR_ERR(aemif_clk); - - clkrate = clk_get_rate(aemif_clk); - - clkrate /= 1000; /* turn clock into kHz for ease of use */ - - ta = aemif_calc_rate(t->ta, clkrate, TA_MAX); - rhold = aemif_calc_rate(t->rhold, clkrate, RHOLD_MAX); - rstrobe = aemif_calc_rate(t->rstrobe, clkrate, RSTROBE_MAX); - rsetup = aemif_calc_rate(t->rsetup, clkrate, RSETUP_MAX); - whold = aemif_calc_rate(t->whold, clkrate, WHOLD_MAX); - wstrobe = aemif_calc_rate(t->wstrobe, clkrate, WSTROBE_MAX); - wsetup = aemif_calc_rate(t->wsetup, clkrate, WSETUP_MAX); - - if (ta < 0 || rhold < 0 || rstrobe < 0 || rsetup < 0 || - whold < 0 || wstrobe < 0 || wsetup < 0) { - pr_err("%s: cannot get suitable timings\n", __func__); - return -EINVAL; - } - - set = TA(ta) | RHOLD(rhold) | RSTROBE(rstrobe) | RSETUP(rsetup) | - WHOLD(whold) | WSTROBE(wstrobe) | WSETUP(wsetup); - - val = __raw_readl(base + offset); - val &= ~TIMING_MASK; - val |= set; - __raw_writel(val, base + offset); - - return 0; -} -EXPORT_SYMBOL(davinci_aemif_setup_timing); diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile index b953bab..54fc267 100644 --- a/drivers/mfd/Makefile +++ b/drivers/mfd/Makefile @@ -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 diff --git a/drivers/mfd/davinci_aemif.c b/drivers/mfd/davinci_aemif.c new file mode 100644 index 0000000..ab3292c --- /dev/null +++ b/drivers/mfd/davinci_aemif.c @@ -0,0 +1,238 @@ +/* + * AEMIF support for DaVinci SoCs + * + * Copyright (C) 2010 Texas Instruments Incorporated. http://www.ti.com/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include <linux/kernel.h> +#include <linux/io.h> +#include <linux/err.h> +#include <linux/clk.h> +#include <linux/module.h> +#include <linux/time.h> +#include <linux/mfd/davinci_aemif.h> +#include <linux/mtd/physmap.h> +#include <mach/nand.h> + +static struct mfd_cell davinci_emifs[] = { + { + .name = "davinci_nand", + }, + { + .name = "physmap-flash", + }, +}; + +/* Timing value configuration */ + +#define TA(x) ((x) << 2) +#define RHOLD(x) ((x) << 4) +#define RSTROBE(x) ((x) << 7) +#define RSETUP(x) ((x) << 13) +#define WHOLD(x) ((x) << 17) +#define WSTROBE(x) ((x) << 20) +#define WSETUP(x) ((x) << 26) + +#define TA_MAX 0x3 +#define RHOLD_MAX 0x7 +#define RSTROBE_MAX 0x3f +#define RSETUP_MAX 0xf +#define WHOLD_MAX 0x7 +#define WSTROBE_MAX 0x3f +#define WSETUP_MAX 0xf + +#define TIMING_MASK (TA(TA_MAX) | \ + RHOLD(RHOLD_MAX) | \ + RSTROBE(RSTROBE_MAX) | \ + RSETUP(RSETUP_MAX) | \ + WHOLD(WHOLD_MAX) | \ + WSTROBE(WSTROBE_MAX) | \ + WSETUP(WSETUP_MAX)) + +/* + * aemif_calc_rate - calculate timing data. + * @wanted: The cycle time needed in nanoseconds. + * @clk: The input clock rate in kHz. + * @max: The maximum divider value that can be programmed. + * + * On success, returns the calculated timing value minus 1 for easy + * programming into AEMIF timing registers, else negative errno. + */ +static int aemif_calc_rate(int wanted, unsigned long clk, int max) +{ + int result; + + result = DIV_ROUND_UP((wanted * clk), NSEC_PER_MSEC) - 1; + + pr_debug("%s: result %d from %ld, %d\n", __func__, result, clk, wanted); + + /* It is generally OK to have a more relaxed timing than requested... */ + if (result < 0) + result = 0; + + /* ... But configuring tighter timings is not an option. */ + else if (result > max) + result = -EINVAL; + + return result; +} + +/** + * davinci_aemif_setup_timing - setup timing values for a given AEMIF interface + * @t: timing values to be progammed + * @base: The virtual base address of the AEMIF interface + * @cs: chip-select to program the timing values for + * + * This function programs the given timing values (in real clock) into the + * AEMIF registers taking the AEMIF clock into account. + * + * This function does not use any locking while programming the AEMIF + * because it is expected that there is only one user of a given + * chip-select. + * + * Returns 0 on success, else negative errno. + */ +int davinci_aemif_setup_timing(struct davinci_aemif_timing *t, + void __iomem *base, unsigned cs) +{ + unsigned set, val; + int ta, rhold, rstrobe, rsetup, whold, wstrobe, wsetup; + unsigned offset = A1CR_OFFSET + cs * 4; + struct clk *aemif_clk; + unsigned long clkrate; + + if (!t) + return 0; /* Nothing to do */ + + aemif_clk = clk_get(NULL, "aemif"); + if (IS_ERR(aemif_clk)) + return PTR_ERR(aemif_clk); + + clkrate = clk_get_rate(aemif_clk); + + clkrate /= 1000; /* turn clock into kHz for ease of use */ + + ta = aemif_calc_rate(t->ta, clkrate, TA_MAX); + rhold = aemif_calc_rate(t->rhold, clkrate, RHOLD_MAX); + rstrobe = aemif_calc_rate(t->rstrobe, clkrate, RSTROBE_MAX); + rsetup = aemif_calc_rate(t->rsetup, clkrate, RSETUP_MAX); + whold = aemif_calc_rate(t->whold, clkrate, WHOLD_MAX); + wstrobe = aemif_calc_rate(t->wstrobe, clkrate, WSTROBE_MAX); + wsetup = aemif_calc_rate(t->wsetup, clkrate, WSETUP_MAX); + + if (ta < 0 || rhold < 0 || rstrobe < 0 || rsetup < 0 || + whold < 0 || wstrobe < 0 || wsetup < 0) { + pr_err("%s: cannot get suitable timings\n", __func__); + return -EINVAL; + } + + set = TA(ta) | RHOLD(rhold) | RSTROBE(rstrobe) | RSETUP(rsetup) | + WHOLD(whold) | WSTROBE(wstrobe) | WSETUP(wsetup); + + val = __raw_readl(base + offset); + val &= ~TIMING_MASK; + val |= set; + __raw_writel(val, base + offset); + + return 0; +} +EXPORT_SYMBOL(davinci_aemif_setup_timing); + +static int __init davinci_aemif_probe(struct platform_device *pdev) +{ + struct davinci_aemif_devices *davinci_aemif_devices = + pdev->dev.platform_data; + struct platform_device *devices; + struct mfd_cell *cells; + int i, ret; + + devices = davinci_aemif_devices->devices; + cells = davinci_emifs; + + /* DaVinci NAND device client */ + for (i = 0; i < davinci_aemif_devices->num_devices; i++) { + if (!strcmp(devices[i].name, + cells[DAVINCI_NAND_DEVICE_CELL].name)) + break; + + } + if (i > davinci_aemif_devices->num_devices) { + dev_err(&pdev->dev, "No NAND device found by DaVinci EMIF" + "MFD\n"); + cells[DAVINCI_NAND_DEVICE_CELL].name = NULL; + } else { + cells[DAVINCI_NAND_DEVICE_CELL].platform_data = + devices[i].dev.platform_data; + cells[DAVINCI_NAND_DEVICE_CELL].pdata_size = + sizeof(struct davinci_nand_pdata); + cells[DAVINCI_NAND_DEVICE_CELL].id = devices[i].id; + cells[DAVINCI_NAND_DEVICE_CELL].resources = + devices[i].resource; + cells[DAVINCI_NAND_DEVICE_CELL].num_resources = + devices[i].num_resources; + } + + /* DaVinci NOR device client */ + for (i = 0; i < davinci_aemif_devices->num_devices; i++) { + if (!strcmp(devices[i].name, + cells[DAVINCI_NOR_FLASH_CELL].name)) + break; + } + + if (i > davinci_aemif_devices->num_devices) { + dev_err(&pdev->dev, "No NOR device found by DaVinci EMIF" + "MFD\n"); + cells[DAVINCI_NOR_FLASH_CELL].name = NULL; + } else { + cells[DAVINCI_NOR_FLASH_CELL].platform_data = + devices[i].dev.platform_data; + cells[DAVINCI_NOR_FLASH_CELL].pdata_size = + sizeof(struct physmap_flash_data); + cells[DAVINCI_NOR_FLASH_CELL].id = devices[i].id; + cells[DAVINCI_NOR_FLASH_CELL].resources = devices[i].resource; + cells[DAVINCI_NOR_FLASH_CELL].num_resources = + devices[i].num_resources; + } + + ret = mfd_add_devices(&pdev->dev, pdev->id, cells, + davinci_aemif_devices->num_devices, NULL, 0); + if (ret != 0) + dev_err(&pdev->dev, "fail to register client devices\n"); + + return 0; +} + +static int __devexit davinci_aemif_remove(struct platform_device *pdev) +{ + mfd_remove_devices(&pdev->dev); + return 0; +} + +static struct platform_driver davinci_aemif_driver = { + .driver = { + .name = "davinci_aemif", + .owner = THIS_MODULE, + }, + .remove = __devexit_p(davinci_aemif_remove), +}; + +static int __init davinci_aemif_init(void) +{ + return platform_driver_probe(&davinci_aemif_driver, + davinci_aemif_probe); +} +module_init(davinci_aemif_init); + +static void __exit davinci_aemif_exit(void) +{ + platform_driver_unregister(&davinci_aemif_driver); +} +module_exit(davinci_aemif_exit); + +MODULE_AUTHOR("Prakash Manjunathappa"); +MODULE_DESCRIPTION("Texas Instruments AEMIF Interface"); +MODULE_LICENSE("GPL"); diff --git a/include/linux/mfd/davinci_aemif.h b/include/linux/mfd/davinci_aemif.h index 05b2934..18650c3 100644 --- a/include/linux/mfd/davinci_aemif.h +++ b/include/linux/mfd/davinci_aemif.h @@ -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; -- 1.7.1 ^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v2 2/3] arm:davinci: Move emif driver to drivers/mfd from mach-davinci folder @ 2012-01-25 10:25 ` Manjunathappa, Prakash 0 siblings, 0 replies; 21+ messages in thread From: Manjunathappa, Prakash @ 2012-01-25 10:25 UTC (permalink / raw) To: linux-arm-kernel Move aemif kernel module from arch/arm/amch-davinci/ to multi functional devices frame work. Signed-off-by: Manjunathappa, Prakash <prakash.pm@ti.com> --- 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 diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 24626b0..5b717cf 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -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. diff --git a/arch/arm/mach-davinci/Makefile b/arch/arm/mach-davinci/Makefile index 2db78bd..e25a459 100644 --- a/arch/arm/mach-davinci/Makefile +++ b/arch/arm/mach-davinci/Makefile @@ -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 diff --git a/arch/arm/mach-davinci/aemif.c b/arch/arm/mach-davinci/aemif.c deleted file mode 100644 index b67c115..0000000 --- a/arch/arm/mach-davinci/aemif.c +++ /dev/null @@ -1,133 +0,0 @@ -/* - * AEMIF support for DaVinci SoCs - * - * Copyright (C) 2010 Texas Instruments Incorporated. http://www.ti.com/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include <linux/kernel.h> -#include <linux/io.h> -#include <linux/err.h> -#include <linux/clk.h> -#include <linux/module.h> -#include <linux/time.h> - -#include <linux/mfd/davinci_aemif.h> - -/* Timing value configuration */ - -#define TA(x) ((x) << 2) -#define RHOLD(x) ((x) << 4) -#define RSTROBE(x) ((x) << 7) -#define RSETUP(x) ((x) << 13) -#define WHOLD(x) ((x) << 17) -#define WSTROBE(x) ((x) << 20) -#define WSETUP(x) ((x) << 26) - -#define TA_MAX 0x3 -#define RHOLD_MAX 0x7 -#define RSTROBE_MAX 0x3f -#define RSETUP_MAX 0xf -#define WHOLD_MAX 0x7 -#define WSTROBE_MAX 0x3f -#define WSETUP_MAX 0xf - -#define TIMING_MASK (TA(TA_MAX) | \ - RHOLD(RHOLD_MAX) | \ - RSTROBE(RSTROBE_MAX) | \ - RSETUP(RSETUP_MAX) | \ - WHOLD(WHOLD_MAX) | \ - WSTROBE(WSTROBE_MAX) | \ - WSETUP(WSETUP_MAX)) - -/* - * aemif_calc_rate - calculate timing data. - * @wanted: The cycle time needed in nanoseconds. - * @clk: The input clock rate in kHz. - * @max: The maximum divider value that can be programmed. - * - * On success, returns the calculated timing value minus 1 for easy - * programming into AEMIF timing registers, else negative errno. - */ -static int aemif_calc_rate(int wanted, unsigned long clk, int max) -{ - int result; - - result = DIV_ROUND_UP((wanted * clk), NSEC_PER_MSEC) - 1; - - pr_debug("%s: result %d from %ld, %d\n", __func__, result, clk, wanted); - - /* It is generally OK to have a more relaxed timing than requested... */ - if (result < 0) - result = 0; - - /* ... But configuring tighter timings is not an option. */ - else if (result > max) - result = -EINVAL; - - return result; -} - -/** - * davinci_aemif_setup_timing - setup timing values for a given AEMIF interface - * @t: timing values to be progammed - * @base: The virtual base address of the AEMIF interface - * @cs: chip-select to program the timing values for - * - * This function programs the given timing values (in real clock) into the - * AEMIF registers taking the AEMIF clock into account. - * - * This function does not use any locking while programming the AEMIF - * because it is expected that there is only one user of a given - * chip-select. - * - * Returns 0 on success, else negative errno. - */ -int davinci_aemif_setup_timing(struct davinci_aemif_timing *t, - void __iomem *base, unsigned cs) -{ - unsigned set, val; - int ta, rhold, rstrobe, rsetup, whold, wstrobe, wsetup; - unsigned offset = A1CR_OFFSET + cs * 4; - struct clk *aemif_clk; - unsigned long clkrate; - - if (!t) - return 0; /* Nothing to do */ - - aemif_clk = clk_get(NULL, "aemif"); - if (IS_ERR(aemif_clk)) - return PTR_ERR(aemif_clk); - - clkrate = clk_get_rate(aemif_clk); - - clkrate /= 1000; /* turn clock into kHz for ease of use */ - - ta = aemif_calc_rate(t->ta, clkrate, TA_MAX); - rhold = aemif_calc_rate(t->rhold, clkrate, RHOLD_MAX); - rstrobe = aemif_calc_rate(t->rstrobe, clkrate, RSTROBE_MAX); - rsetup = aemif_calc_rate(t->rsetup, clkrate, RSETUP_MAX); - whold = aemif_calc_rate(t->whold, clkrate, WHOLD_MAX); - wstrobe = aemif_calc_rate(t->wstrobe, clkrate, WSTROBE_MAX); - wsetup = aemif_calc_rate(t->wsetup, clkrate, WSETUP_MAX); - - if (ta < 0 || rhold < 0 || rstrobe < 0 || rsetup < 0 || - whold < 0 || wstrobe < 0 || wsetup < 0) { - pr_err("%s: cannot get suitable timings\n", __func__); - return -EINVAL; - } - - set = TA(ta) | RHOLD(rhold) | RSTROBE(rstrobe) | RSETUP(rsetup) | - WHOLD(whold) | WSTROBE(wstrobe) | WSETUP(wsetup); - - val = __raw_readl(base + offset); - val &= ~TIMING_MASK; - val |= set; - __raw_writel(val, base + offset); - - return 0; -} -EXPORT_SYMBOL(davinci_aemif_setup_timing); diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile index b953bab..54fc267 100644 --- a/drivers/mfd/Makefile +++ b/drivers/mfd/Makefile @@ -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 diff --git a/drivers/mfd/davinci_aemif.c b/drivers/mfd/davinci_aemif.c new file mode 100644 index 0000000..ab3292c --- /dev/null +++ b/drivers/mfd/davinci_aemif.c @@ -0,0 +1,238 @@ +/* + * AEMIF support for DaVinci SoCs + * + * Copyright (C) 2010 Texas Instruments Incorporated. http://www.ti.com/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include <linux/kernel.h> +#include <linux/io.h> +#include <linux/err.h> +#include <linux/clk.h> +#include <linux/module.h> +#include <linux/time.h> +#include <linux/mfd/davinci_aemif.h> +#include <linux/mtd/physmap.h> +#include <mach/nand.h> + +static struct mfd_cell davinci_emifs[] = { + { + .name = "davinci_nand", + }, + { + .name = "physmap-flash", + }, +}; + +/* Timing value configuration */ + +#define TA(x) ((x) << 2) +#define RHOLD(x) ((x) << 4) +#define RSTROBE(x) ((x) << 7) +#define RSETUP(x) ((x) << 13) +#define WHOLD(x) ((x) << 17) +#define WSTROBE(x) ((x) << 20) +#define WSETUP(x) ((x) << 26) + +#define TA_MAX 0x3 +#define RHOLD_MAX 0x7 +#define RSTROBE_MAX 0x3f +#define RSETUP_MAX 0xf +#define WHOLD_MAX 0x7 +#define WSTROBE_MAX 0x3f +#define WSETUP_MAX 0xf + +#define TIMING_MASK (TA(TA_MAX) | \ + RHOLD(RHOLD_MAX) | \ + RSTROBE(RSTROBE_MAX) | \ + RSETUP(RSETUP_MAX) | \ + WHOLD(WHOLD_MAX) | \ + WSTROBE(WSTROBE_MAX) | \ + WSETUP(WSETUP_MAX)) + +/* + * aemif_calc_rate - calculate timing data. + * @wanted: The cycle time needed in nanoseconds. + * @clk: The input clock rate in kHz. + * @max: The maximum divider value that can be programmed. + * + * On success, returns the calculated timing value minus 1 for easy + * programming into AEMIF timing registers, else negative errno. + */ +static int aemif_calc_rate(int wanted, unsigned long clk, int max) +{ + int result; + + result = DIV_ROUND_UP((wanted * clk), NSEC_PER_MSEC) - 1; + + pr_debug("%s: result %d from %ld, %d\n", __func__, result, clk, wanted); + + /* It is generally OK to have a more relaxed timing than requested... */ + if (result < 0) + result = 0; + + /* ... But configuring tighter timings is not an option. */ + else if (result > max) + result = -EINVAL; + + return result; +} + +/** + * davinci_aemif_setup_timing - setup timing values for a given AEMIF interface + * @t: timing values to be progammed + * @base: The virtual base address of the AEMIF interface + * @cs: chip-select to program the timing values for + * + * This function programs the given timing values (in real clock) into the + * AEMIF registers taking the AEMIF clock into account. + * + * This function does not use any locking while programming the AEMIF + * because it is expected that there is only one user of a given + * chip-select. + * + * Returns 0 on success, else negative errno. + */ +int davinci_aemif_setup_timing(struct davinci_aemif_timing *t, + void __iomem *base, unsigned cs) +{ + unsigned set, val; + int ta, rhold, rstrobe, rsetup, whold, wstrobe, wsetup; + unsigned offset = A1CR_OFFSET + cs * 4; + struct clk *aemif_clk; + unsigned long clkrate; + + if (!t) + return 0; /* Nothing to do */ + + aemif_clk = clk_get(NULL, "aemif"); + if (IS_ERR(aemif_clk)) + return PTR_ERR(aemif_clk); + + clkrate = clk_get_rate(aemif_clk); + + clkrate /= 1000; /* turn clock into kHz for ease of use */ + + ta = aemif_calc_rate(t->ta, clkrate, TA_MAX); + rhold = aemif_calc_rate(t->rhold, clkrate, RHOLD_MAX); + rstrobe = aemif_calc_rate(t->rstrobe, clkrate, RSTROBE_MAX); + rsetup = aemif_calc_rate(t->rsetup, clkrate, RSETUP_MAX); + whold = aemif_calc_rate(t->whold, clkrate, WHOLD_MAX); + wstrobe = aemif_calc_rate(t->wstrobe, clkrate, WSTROBE_MAX); + wsetup = aemif_calc_rate(t->wsetup, clkrate, WSETUP_MAX); + + if (ta < 0 || rhold < 0 || rstrobe < 0 || rsetup < 0 || + whold < 0 || wstrobe < 0 || wsetup < 0) { + pr_err("%s: cannot get suitable timings\n", __func__); + return -EINVAL; + } + + set = TA(ta) | RHOLD(rhold) | RSTROBE(rstrobe) | RSETUP(rsetup) | + WHOLD(whold) | WSTROBE(wstrobe) | WSETUP(wsetup); + + val = __raw_readl(base + offset); + val &= ~TIMING_MASK; + val |= set; + __raw_writel(val, base + offset); + + return 0; +} +EXPORT_SYMBOL(davinci_aemif_setup_timing); + +static int __init davinci_aemif_probe(struct platform_device *pdev) +{ + struct davinci_aemif_devices *davinci_aemif_devices = + pdev->dev.platform_data; + struct platform_device *devices; + struct mfd_cell *cells; + int i, ret; + + devices = davinci_aemif_devices->devices; + cells = davinci_emifs; + + /* DaVinci NAND device client */ + for (i = 0; i < davinci_aemif_devices->num_devices; i++) { + if (!strcmp(devices[i].name, + cells[DAVINCI_NAND_DEVICE_CELL].name)) + break; + + } + if (i > davinci_aemif_devices->num_devices) { + dev_err(&pdev->dev, "No NAND device found by DaVinci EMIF" + "MFD\n"); + cells[DAVINCI_NAND_DEVICE_CELL].name = NULL; + } else { + cells[DAVINCI_NAND_DEVICE_CELL].platform_data = + devices[i].dev.platform_data; + cells[DAVINCI_NAND_DEVICE_CELL].pdata_size = + sizeof(struct davinci_nand_pdata); + cells[DAVINCI_NAND_DEVICE_CELL].id = devices[i].id; + cells[DAVINCI_NAND_DEVICE_CELL].resources = + devices[i].resource; + cells[DAVINCI_NAND_DEVICE_CELL].num_resources = + devices[i].num_resources; + } + + /* DaVinci NOR device client */ + for (i = 0; i < davinci_aemif_devices->num_devices; i++) { + if (!strcmp(devices[i].name, + cells[DAVINCI_NOR_FLASH_CELL].name)) + break; + } + + if (i > davinci_aemif_devices->num_devices) { + dev_err(&pdev->dev, "No NOR device found by DaVinci EMIF" + "MFD\n"); + cells[DAVINCI_NOR_FLASH_CELL].name = NULL; + } else { + cells[DAVINCI_NOR_FLASH_CELL].platform_data = + devices[i].dev.platform_data; + cells[DAVINCI_NOR_FLASH_CELL].pdata_size = + sizeof(struct physmap_flash_data); + cells[DAVINCI_NOR_FLASH_CELL].id = devices[i].id; + cells[DAVINCI_NOR_FLASH_CELL].resources = devices[i].resource; + cells[DAVINCI_NOR_FLASH_CELL].num_resources = + devices[i].num_resources; + } + + ret = mfd_add_devices(&pdev->dev, pdev->id, cells, + davinci_aemif_devices->num_devices, NULL, 0); + if (ret != 0) + dev_err(&pdev->dev, "fail to register client devices\n"); + + return 0; +} + +static int __devexit davinci_aemif_remove(struct platform_device *pdev) +{ + mfd_remove_devices(&pdev->dev); + return 0; +} + +static struct platform_driver davinci_aemif_driver = { + .driver = { + .name = "davinci_aemif", + .owner = THIS_MODULE, + }, + .remove = __devexit_p(davinci_aemif_remove), +}; + +static int __init davinci_aemif_init(void) +{ + return platform_driver_probe(&davinci_aemif_driver, + davinci_aemif_probe); +} +module_init(davinci_aemif_init); + +static void __exit davinci_aemif_exit(void) +{ + platform_driver_unregister(&davinci_aemif_driver); +} +module_exit(davinci_aemif_exit); + +MODULE_AUTHOR("Prakash Manjunathappa"); +MODULE_DESCRIPTION("Texas Instruments AEMIF Interface"); +MODULE_LICENSE("GPL"); diff --git a/include/linux/mfd/davinci_aemif.h b/include/linux/mfd/davinci_aemif.h index 05b2934..18650c3 100644 --- a/include/linux/mfd/davinci_aemif.h +++ b/include/linux/mfd/davinci_aemif.h @@ -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; -- 1.7.1 ^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v2 3/3] arm: da830: move NAND and NOR devices as aemif MFD slaves 2012-01-25 10:25 ` Manjunathappa, Prakash (?) @ 2012-01-25 10:25 ` Manjunathappa, Prakash -1 siblings, 0 replies; 21+ messages in thread From: Manjunathappa, Prakash @ 2012-01-25 10:25 UTC (permalink / raw) To: linux-arm-kernel, linux-mtd, linux-kernel Cc: davinci-linux-open-source, Russell King, Samuel Ortiz, Sekhar Nori, Manjunathappa, Prakash, David Woodhouse NAND and NOR device are made as aemif devices slave, hence device registration achieved via aemif MFD driver. Signed-off-by: Manjunathappa, Prakash <prakash.pm@ti.com> --- Since v1: Patch is generated using -M option. arch/arm/mach-davinci/board-da830-evm.c | 31 +++++++++++++++++++++++-------- 1 files changed, 23 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c index 0b43554..0ad3662 100644 --- a/arch/arm/mach-davinci/board-da830-evm.c +++ b/arch/arm/mach-davinci/board-da830-evm.c @@ -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"); -- 1.7.1 ^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v2 3/3] arm: da830: move NAND and NOR devices as aemif MFD slaves @ 2012-01-25 10:25 ` Manjunathappa, Prakash 0 siblings, 0 replies; 21+ messages in thread From: Manjunathappa, Prakash @ 2012-01-25 10:25 UTC (permalink / raw) To: linux-arm-kernel, linux-mtd, linux-kernel Cc: Sekhar Nori, davinci-linux-open-source, Russell King, David Woodhouse, Samuel Ortiz, Manjunathappa, Prakash NAND and NOR device are made as aemif devices slave, hence device registration achieved via aemif MFD driver. Signed-off-by: Manjunathappa, Prakash <prakash.pm@ti.com> --- Since v1: Patch is generated using -M option. arch/arm/mach-davinci/board-da830-evm.c | 31 +++++++++++++++++++++++-------- 1 files changed, 23 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c index 0b43554..0ad3662 100644 --- a/arch/arm/mach-davinci/board-da830-evm.c +++ b/arch/arm/mach-davinci/board-da830-evm.c @@ -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"); -- 1.7.1 ^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v2 3/3] arm: da830: move NAND and NOR devices as aemif MFD slaves @ 2012-01-25 10:25 ` Manjunathappa, Prakash 0 siblings, 0 replies; 21+ messages in thread From: Manjunathappa, Prakash @ 2012-01-25 10:25 UTC (permalink / raw) To: linux-arm-kernel NAND and NOR device are made as aemif devices slave, hence device registration achieved via aemif MFD driver. Signed-off-by: Manjunathappa, Prakash <prakash.pm@ti.com> --- Since v1: Patch is generated using -M option. arch/arm/mach-davinci/board-da830-evm.c | 31 +++++++++++++++++++++++-------- 1 files changed, 23 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c index 0b43554..0ad3662 100644 --- a/arch/arm/mach-davinci/board-da830-evm.c +++ b/arch/arm/mach-davinci/board-da830-evm.c @@ -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"); -- 1.7.1 ^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [PATCH v2 3/3] arm: da830: move NAND and NOR devices as aemif MFD slaves 2012-01-25 10:25 ` Manjunathappa, Prakash (?) @ 2012-01-25 14:51 ` Sergei Shtylyov -1 siblings, 0 replies; 21+ messages in thread From: Sergei Shtylyov @ 2012-01-25 14:51 UTC (permalink / raw) To: Manjunathappa, Prakash Cc: davinci-linux-open-source, Russell King, Samuel Ortiz, linux-kernel, linux-mtd, David Woodhouse, linux-arm-kernel Hello. On 01/25/2012 01:25 PM, Manjunathappa, Prakash wrote: > NAND and NOR device are made as aemif devices slave, hence device > registration achieved via aemif MFD driver. > Signed-off-by: Manjunathappa, Prakash<prakash.pm@ti.com> > --- > 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 ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 3/3] arm: da830: move NAND and NOR devices as aemif MFD slaves @ 2012-01-25 14:51 ` Sergei Shtylyov 0 siblings, 0 replies; 21+ messages in thread From: Sergei Shtylyov @ 2012-01-25 14:51 UTC (permalink / raw) To: Manjunathappa, Prakash Cc: linux-arm-kernel, linux-mtd, linux-kernel, davinci-linux-open-source, Russell King, Samuel Ortiz, David Woodhouse Hello. On 01/25/2012 01:25 PM, Manjunathappa, Prakash wrote: > NAND and NOR device are made as aemif devices slave, hence device > registration achieved via aemif MFD driver. > Signed-off-by: Manjunathappa, Prakash<prakash.pm@ti.com> > --- > 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 ^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH v2 3/3] arm: da830: move NAND and NOR devices as aemif MFD slaves @ 2012-01-25 14:51 ` Sergei Shtylyov 0 siblings, 0 replies; 21+ messages in thread From: Sergei Shtylyov @ 2012-01-25 14:51 UTC (permalink / raw) To: linux-arm-kernel Hello. On 01/25/2012 01:25 PM, Manjunathappa, Prakash wrote: > NAND and NOR device are made as aemif devices slave, hence device > registration achieved via aemif MFD driver. > Signed-off-by: Manjunathappa, Prakash<prakash.pm@ti.com> > --- > 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 ^ permalink raw reply [flat|nested] 21+ messages in thread
* RE: [PATCH v2 3/3] arm: da830: move NAND and NOR devices as aemif MFD slaves 2012-01-25 14:51 ` Sergei Shtylyov (?) @ 2012-01-30 6:58 ` Manjunathappa, Prakash -1 siblings, 0 replies; 21+ messages in thread From: Manjunathappa, Prakash @ 2012-01-30 6:58 UTC (permalink / raw) To: Sergei Shtylyov Cc: davinci-linux-open-source@linux.davincidsp.com, Russell King, Samuel Ortiz, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, David Woodhouse, linux-arm-kernel@lists.infradead.org Hi Sergei, On Wed, Jan 25, 2012 at 20:21:32, Sergei Shtylyov wrote: > Hello. > > On 01/25/2012 01:25 PM, Manjunathappa, Prakash wrote: > > > NAND and NOR device are made as aemif devices slave, hence device > > registration achieved via aemif MFD driver. > > > Signed-off-by: Manjunathappa, Prakash<prakash.pm@ti.com> > > --- > > 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? Yes I thought of sending board-da850 changes in separate patch. Should I have to send those changes also in this patch? Thanks, Prakash > > WBR, Sergei > ^ permalink raw reply [flat|nested] 21+ messages in thread
* RE: [PATCH v2 3/3] arm: da830: move NAND and NOR devices as aemif MFD slaves @ 2012-01-30 6:58 ` Manjunathappa, Prakash 0 siblings, 0 replies; 21+ messages in thread From: Manjunathappa, Prakash @ 2012-01-30 6:58 UTC (permalink / raw) To: Sergei Shtylyov Cc: linux-arm-kernel@lists.infradead.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, davinci-linux-open-source@linux.davincidsp.com, Russell King, Samuel Ortiz, David Woodhouse Hi Sergei, On Wed, Jan 25, 2012 at 20:21:32, Sergei Shtylyov wrote: > Hello. > > On 01/25/2012 01:25 PM, Manjunathappa, Prakash wrote: > > > NAND and NOR device are made as aemif devices slave, hence device > > registration achieved via aemif MFD driver. > > > Signed-off-by: Manjunathappa, Prakash<prakash.pm@ti.com> > > --- > > 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? Yes I thought of sending board-da850 changes in separate patch. Should I have to send those changes also in this patch? Thanks, Prakash > > WBR, Sergei > ^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH v2 3/3] arm: da830: move NAND and NOR devices as aemif MFD slaves @ 2012-01-30 6:58 ` Manjunathappa, Prakash 0 siblings, 0 replies; 21+ messages in thread From: Manjunathappa, Prakash @ 2012-01-30 6:58 UTC (permalink / raw) To: linux-arm-kernel Hi Sergei, On Wed, Jan 25, 2012 at 20:21:32, Sergei Shtylyov wrote: > Hello. > > On 01/25/2012 01:25 PM, Manjunathappa, Prakash wrote: > > > NAND and NOR device are made as aemif devices slave, hence device > > registration achieved via aemif MFD driver. > > > Signed-off-by: Manjunathappa, Prakash<prakash.pm@ti.com> > > --- > > 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? Yes I thought of sending board-da850 changes in separate patch. Should I have to send those changes also in this patch? Thanks, Prakash > > WBR, Sergei > ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 3/3] arm: da830: move NAND and NOR devices as aemif MFD slaves 2012-01-30 6:58 ` Manjunathappa, Prakash (?) @ 2012-01-30 10:40 ` Sergei Shtylyov -1 siblings, 0 replies; 21+ messages in thread From: Sergei Shtylyov @ 2012-01-30 10:40 UTC (permalink / raw) To: Manjunathappa, Prakash Cc: davinci-linux-open-source@linux.davincidsp.com, Russell King, Samuel Ortiz, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, David Woodhouse, linux-arm-kernel@lists.infradead.org Hello. On 30-01-2012 10:58, Manjunathappa, Prakash wrote: >>> NAND and NOR device are made as aemif devices slave, hence device >>> registration achieved via aemif MFD driver. >>> Signed-off-by: Manjunathappa, Prakash<prakash.pm@ti.com> >>> --- >>> 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? > 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. > Thanks, > Prakash WBR, Sergei ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 3/3] arm: da830: move NAND and NOR devices as aemif MFD slaves @ 2012-01-30 10:40 ` Sergei Shtylyov 0 siblings, 0 replies; 21+ messages in thread From: Sergei Shtylyov @ 2012-01-30 10:40 UTC (permalink / raw) To: Manjunathappa, Prakash Cc: linux-arm-kernel@lists.infradead.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, davinci-linux-open-source@linux.davincidsp.com, Russell King, Samuel Ortiz, David Woodhouse Hello. On 30-01-2012 10:58, Manjunathappa, Prakash wrote: >>> NAND and NOR device are made as aemif devices slave, hence device >>> registration achieved via aemif MFD driver. >>> Signed-off-by: Manjunathappa, Prakash<prakash.pm@ti.com> >>> --- >>> 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? > 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. > Thanks, > Prakash WBR, Sergei ^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH v2 3/3] arm: da830: move NAND and NOR devices as aemif MFD slaves @ 2012-01-30 10:40 ` Sergei Shtylyov 0 siblings, 0 replies; 21+ messages in thread From: Sergei Shtylyov @ 2012-01-30 10:40 UTC (permalink / raw) To: linux-arm-kernel Hello. On 30-01-2012 10:58, Manjunathappa, Prakash wrote: >>> NAND and NOR device are made as aemif devices slave, hence device >>> registration achieved via aemif MFD driver. >>> Signed-off-by: Manjunathappa, Prakash<prakash.pm@ti.com> >>> --- >>> 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? > 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. > Thanks, > Prakash WBR, Sergei ^ permalink raw reply [flat|nested] 21+ messages in thread
* RE: [PATCH v2 3/3] arm: da830: move NAND and NOR devices as aemif MFD slaves 2012-01-30 10:40 ` Sergei Shtylyov (?) @ 2012-01-31 7:11 ` Manjunathappa, Prakash -1 siblings, 0 replies; 21+ messages in thread From: Manjunathappa, Prakash @ 2012-01-31 7:11 UTC (permalink / raw) To: Sergei Shtylyov Cc: davinci-linux-open-source@linux.davincidsp.com, Russell King, Samuel Ortiz, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, David Woodhouse, linux-arm-kernel@lists.infradead.org Hi Sergei, On Mon, Jan 30, 2012 at 16:10:31, Sergei Shtylyov wrote: > Hello. > > On 30-01-2012 10:58, Manjunathappa, Prakash wrote: > > >>> NAND and NOR device are made as aemif devices slave, hence device > >>> registration achieved via aemif MFD driver. > > >>> Signed-off-by: Manjunathappa, Prakash<prakash.pm@ti.com> > >>> --- > >>> 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? > > > 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 > > WBR, Sergei > ^ permalink raw reply [flat|nested] 21+ messages in thread
* RE: [PATCH v2 3/3] arm: da830: move NAND and NOR devices as aemif MFD slaves @ 2012-01-31 7:11 ` Manjunathappa, Prakash 0 siblings, 0 replies; 21+ messages in thread From: Manjunathappa, Prakash @ 2012-01-31 7:11 UTC (permalink / raw) To: Sergei Shtylyov Cc: linux-arm-kernel@lists.infradead.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, davinci-linux-open-source@linux.davincidsp.com, Russell King, Samuel Ortiz, David Woodhouse Hi Sergei, On Mon, Jan 30, 2012 at 16:10:31, Sergei Shtylyov wrote: > Hello. > > On 30-01-2012 10:58, Manjunathappa, Prakash wrote: > > >>> NAND and NOR device are made as aemif devices slave, hence device > >>> registration achieved via aemif MFD driver. > > >>> Signed-off-by: Manjunathappa, Prakash<prakash.pm@ti.com> > >>> --- > >>> 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? > > > 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 > > WBR, Sergei > ^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH v2 3/3] arm: da830: move NAND and NOR devices as aemif MFD slaves @ 2012-01-31 7:11 ` Manjunathappa, Prakash 0 siblings, 0 replies; 21+ messages in thread From: Manjunathappa, Prakash @ 2012-01-31 7:11 UTC (permalink / raw) To: linux-arm-kernel Hi Sergei, On Mon, Jan 30, 2012 at 16:10:31, Sergei Shtylyov wrote: > Hello. > > On 30-01-2012 10:58, Manjunathappa, Prakash wrote: > > >>> NAND and NOR device are made as aemif devices slave, hence device > >>> registration achieved via aemif MFD driver. > > >>> Signed-off-by: Manjunathappa, Prakash<prakash.pm@ti.com> > >>> --- > >>> 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? > > > 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 > > WBR, Sergei > ^ permalink raw reply [flat|nested] 21+ messages in thread
end of thread, other threads:[~2012-01-31 7:12 UTC | newest] Thread overview: 21+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-01-25 10:25 [PATCH v2 1/3] arm:davinci: prepare to move aemif driver to drivers/mfd Manjunathappa, Prakash 2012-01-25 10:25 ` Manjunathappa, Prakash 2012-01-25 10:25 ` Manjunathappa, Prakash 2012-01-25 10:25 ` [PATCH v2 2/3] arm:davinci: Move emif driver to drivers/mfd from mach-davinci folder Manjunathappa, Prakash 2012-01-25 10:25 ` Manjunathappa, Prakash 2012-01-25 10:25 ` Manjunathappa, Prakash 2012-01-25 10:25 ` [PATCH v2 3/3] arm: da830: move NAND and NOR devices as aemif MFD slaves Manjunathappa, Prakash 2012-01-25 10:25 ` Manjunathappa, Prakash 2012-01-25 10:25 ` Manjunathappa, Prakash 2012-01-25 14:51 ` Sergei Shtylyov 2012-01-25 14:51 ` Sergei Shtylyov 2012-01-25 14:51 ` Sergei Shtylyov 2012-01-30 6:58 ` Manjunathappa, Prakash 2012-01-30 6:58 ` Manjunathappa, Prakash 2012-01-30 6:58 ` Manjunathappa, Prakash 2012-01-30 10:40 ` Sergei Shtylyov 2012-01-30 10:40 ` Sergei Shtylyov 2012-01-30 10:40 ` Sergei Shtylyov 2012-01-31 7:11 ` Manjunathappa, Prakash 2012-01-31 7:11 ` Manjunathappa, Prakash 2012-01-31 7:11 ` Manjunathappa, Prakash
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.