Skip to contentSkip to conversation

Move omap GPMC to live in drivers/memory

PATCH New Tony Lindgren 3 participants 11 messages Nov 21, 2014 – Nov 26, 2014

Subsystems (6)
lore
Share & tools
lore

Tony Lindgren

author maintainer
#0 lore raw

v2 cover Move omap GPMC to live in drivers/memory

Hi,

Here's version 2 of the patches to move omap GPMC (General Purpose Memory Controller) to live under drivers for further clean-up work.

Changes from the first version are:

- Few randconfig fixes for the first patch in the series

- Don't include mach-omap2/gpmc.h any longer in any files we touch in this patch series, just keep it around for legacy reasons

- Move GPMC to drivers/memory instead of drivers/bus

Regards,

Tony

Tony Lindgren (3):
ARM: OMAP2+: Prepare to move GPMC to drivers by platform data header
ARM: OMAP2+: Move GPMC initcall to devices.c
memory: gpmc: Move omap gpmc code to live under drivers

 MAINTAINERS                                        |   8 +
 arch/arm/mach-omap2/Kconfig                        |   2 +
 arch/arm/mach-omap2/Makefile                       |   2 +-
 arch/arm/mach-omap2/board-am3517crane.c            |   1 +
 arch/arm/mach-omap2/board-cm-t35.c                 |   3 +-
 arch/arm/mach-omap2/board-cm-t3517.c               |   3 +-
 arch/arm/mach-omap2/board-flash.c                  |   4 +-
 arch/arm/mach-omap2/board-flash.h                  |   1 -
 arch/arm/mach-omap2/board-n8x0.c                   |   2 -
 arch/arm/mach-omap2/board-omap3pandora.c           |   2 +-
 arch/arm/mach-omap2/board-rx51-peripherals.c       |   3 +-
 arch/arm/mach-omap2/devices.c                      |  26 +++
 arch/arm/mach-omap2/gpmc-nand.c                    |   3 +-
 arch/arm/mach-omap2/gpmc-onenand.c                 |   3 +-
 arch/arm/mach-omap2/gpmc-onenand.h                 |  24 ---
 arch/arm/mach-omap2/gpmc.h                         | 228 +--------------------
 arch/arm/mach-omap2/pm34xx.c                       |   2 +-
 drivers/memory/Kconfig                             |   8 +
 drivers/memory/Makefile                            |   1 +
 .../gpmc.c => drivers/memory/omap-gpmc.c           |  91 +++++---
 .../gpmc-nand.h => include/linux/omap-gpmc.h       |  18 +-
 include/linux/platform_data/omap-gpmc.h            | 177 ++++++++++++++++
 22 files changed, 310 insertions(+), 302 deletions(-)
 delete mode 100644 arch/arm/mach-omap2/gpmc-onenand.h
 rename arch/arm/mach-omap2/gpmc.c => drivers/memory/omap-gpmc.c (95%)
 rename arch/arm/mach-omap2/gpmc-nand.h => include/linux/omap-gpmc.h (54%)
 create mode 100644 include/linux/platform_data/omap-gpmc.h
Signature · 1 line
2.1.3
author maintainer
#1 lore raw

PATCH v2 1/3 ARM: OMAP2+: Prepare to move GPMC to drivers by platform data header

We still need to support platform data for omap3 until it's booting in device tree only mode. So let's add platform_data/omap-gpmc.h for that, and a minimal linux/omap-gpmc.h for the save and restore used by the PM code.

Let's also keep a minimal mach-omap2/gpmc.h still around to avoid churn on the board-*.c files. Once omap3 boots in device tree only mode, we can drop mach-omap2/gpmc.h and we can make the data structures in platform_data/omap-gpmc.h private to the GPMC driver.

Note that we can now also remove gpmc-nand.h and gpmc-onenand.h.

Cc Arnd Bergmann <[email protected]>
Cc Roger Quadros <[email protected]>
---
 arch/arm/mach-omap2/board-am3517crane.c            |   1 +
 arch/arm/mach-omap2/board-cm-t35.c                 |   3 +-
 arch/arm/mach-omap2/board-cm-t3517.c               |   3 +-
 arch/arm/mach-omap2/board-flash.c                  |   4 +-
 arch/arm/mach-omap2/board-flash.h                  |   1 -
 arch/arm/mach-omap2/board-n8x0.c                   |   2 -
 arch/arm/mach-omap2/board-omap3pandora.c           |   2 +-
 arch/arm/mach-omap2/board-rx51-peripherals.c       |   3 +-
 arch/arm/mach-omap2/gpmc-nand.c                    |   3 +-
 arch/arm/mach-omap2/gpmc-onenand.c                 |   3 +-
 arch/arm/mach-omap2/gpmc-onenand.h                 |  24 ---
 arch/arm/mach-omap2/gpmc.c                         |  64 +++++-
 arch/arm/mach-omap2/gpmc.h                         | 228 +--------------------
 arch/arm/mach-omap2/pm34xx.c                       |   2 +-
 .../gpmc-nand.h => include/linux/omap-gpmc.h       |  18 +-
 include/linux/platform_data/omap-gpmc.h            | 177 ++++++++++++++++
 16 files changed, 265 insertions(+), 273 deletions(-)
 delete mode 100644 arch/arm/mach-omap2/gpmc-onenand.h
 rename arch/arm/mach-omap2/gpmc-nand.h => include/linux/omap-gpmc.h (54%)
 create mode 100644 include/linux/platform_data/omap-gpmc.h
arch/arm/mach-omap2/board-am3517crane.c +1 -0
index 212c316..fd16b76f 100644
@@ -24,6 +24,7 @@
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/nand.h>
 #include <linux/mtd/partitions.h>
+#include <linux/platform_data/omap-gpmc.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
arch/arm/mach-omap2/board-cm-t35.c +1 -2
index c6df8ee..91738a1 100644
@@ -25,6 +25,7 @@
 #include <linux/input/matrix_keypad.h>
 #include <linux/delay.h>
 #include <linux/gpio.h>
+#include <linux/omap-gpmc.h>
 #include <linux/platform_data/gpio-omap.h>
 
 #include <linux/platform_data/at24.h>
@@ -51,8 +52,6 @@
 #include "sdram-micron-mt46h32m32lf-6.h"
 #include "hsmmc.h"
 #include "common-board-devices.h"
-#include "gpmc.h"
-#include "gpmc-nand.h"
 
 #define CM_T35_GPIO_PENDOWN		57
 #define SB_T35_USB_HUB_RESET_GPIO	167
arch/arm/mach-omap2/board-cm-t3517.c +1 -2
index 8a2c167..794756d 100644
@@ -28,6 +28,7 @@
 #include <linux/delay.h>
 #include <linux/gpio.h>
 #include <linux/leds.h>
+#include <linux/omap-gpmc.h>
 #include <linux/rtc-v3020.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/nand.h>
@@ -41,7 +42,6 @@
 
 #include "common.h"
 #include <linux/platform_data/mtd-nand-omap2.h>
-#include "gpmc.h"
 
 #include "am35xx.h"
 
@@ -50,7 +50,6 @@
 #include "hsmmc.h"
 #include "common-board-devices.h"
 #include "am35xx-emac.h"
-#include "gpmc-nand.h"
 
 #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
 static struct gpio_led cm_t3517_leds[] = {
arch/arm/mach-omap2/board-flash.c +2 -2
index 2d245c2..b536b5a6 100644
@@ -13,18 +13,18 @@
  */
 
 #include <linux/kernel.h>
+#include <linux/omap-gpmc.h>
 #include <linux/platform_device.h>
 #include <linux/mtd/physmap.h>
 #include <linux/io.h>
 
+#include <linux/platform_data/omap-gpmc.h>
 #include <linux/platform_data/mtd-nand-omap2.h>
 #include <linux/platform_data/mtd-onenand-omap2.h>
 
 #include "soc.h"
 #include "common.h"
 #include "board-flash.h"
-#include "gpmc-onenand.h"
-#include "gpmc-nand.h"
 
 #define REG_FPGA_REV			0x10
 #define REG_FPGA_DIP_SWITCH_INPUT2	0x60
arch/arm/mach-omap2/board-flash.h +0 -1
index 2fb5d41..ea9aaeb 100644
@@ -12,7 +12,6 @@
  */
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
-#include "gpmc.h"
 
 #define PDC_NOR		1
 #define PDC_NAND	2
arch/arm/mach-omap2/board-n8x0.c +0 -2
index 97767a2..49c3c25 100644
@@ -22,7 +22,6 @@
 #include <linux/spi/spi.h>
 #include <linux/usb/musb.h>
 #include <linux/platform_data/spi-omap2-mcspi.h>
-#include <linux/platform_data/mtd-onenand-omap2.h>
 #include <linux/mfd/menelaus.h>
 #include <sound/tlv320aic3x.h>
 
@@ -32,7 +31,6 @@
 #include "common.h"
 #include "mmc.h"
 #include "soc.h"
-#include "gpmc-onenand.h"
 #include "common-board-devices.h"
 
 #define TUSB6010_ASYNC_CS	1
arch/arm/mach-omap2/board-omap3pandora.c +1 -1
index f322016..7f17087 100644
@@ -24,6 +24,7 @@
 #include <linux/spi/spi.h>
 #include <linux/regulator/machine.h>
 #include <linux/i2c/twl.h>
+#include <linux/omap-gpmc.h>
 #include <linux/wl12xx.h>
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/nand.h>
@@ -51,7 +52,6 @@
 #include "sdram-micron-mt46h32m32lf-6.h"
 #include "hsmmc.h"
 #include "common-board-devices.h"
-#include "gpmc-nand.h"
 
 #define PANDORA_WIFI_IRQ_GPIO		21
 #define PANDORA_WIFI_NRESET_GPIO	23
arch/arm/mach-omap2/board-rx51-peripherals.c +1 -2
index 30e7d4c..e2ad48b 100644
@@ -23,6 +23,7 @@
 #include <linux/regulator/machine.h>
 #include <linux/gpio.h>
 #include <linux/gpio_keys.h>
+#include <linux/omap-gpmc.h>
 #include <linux/mmc/host.h>
 #include <linux/power/isp1704_charger.h>
 #include <linux/platform_data/spi-omap2-mcspi.h>
@@ -54,8 +55,6 @@
 #include "omap-pm.h"
 #include "hsmmc.h"
 #include "common-board-devices.h"
-#include "gpmc.h"
-#include "gpmc-onenand.h"
 #include "soc.h"
 #include "omap-secure.h"
 
arch/arm/mach-omap2/gpmc-nand.c +1 -2
index cb776431..8f1773e 100644
@@ -13,13 +13,12 @@
 #include <linux/platform_device.h>
 #include <linux/io.h>
 #include <linux/mtd/nand.h>
+#include <linux/platform_data/omap-gpmc.h>
 #include <linux/platform_data/mtd-nand-omap2.h>
 
 #include <asm/mach/flash.h>
 
-#include "gpmc.h"
 #include "soc.h"
-#include "gpmc-nand.h"
 
 /* minimum size for IO mapping */
 #define	NAND_IO_SIZE	4
arch/arm/mach-omap2/gpmc-onenand.c +1 -2
index 8b6876c..7433279 100644
@@ -16,13 +16,12 @@
 #include <linux/mtd/onenand_regs.h>
 #include <linux/io.h>
 #include <linux/platform_data/mtd-onenand-omap2.h>
+#include <linux/platform_data/omap-gpmc.h>
 #include <linux/err.h>
 
 #include <asm/mach/flash.h>
 
-#include "gpmc.h"
 #include "soc.h"
-#include "gpmc-onenand.h"
 
 #define	ONENAND_IO_SIZE	SZ_128K
 
arch/arm/mach-omap2/gpmc-onenand.h deleted +0 -24
deleted file mode 100644
index 216f23a..0000000
@@ -1,24 +0,0 @@
-/*
- *  arch/arm/mach-omap2/gpmc-onenand.h
- *
- *  This program is free software; you can redistribute  it and/or modify it
- *  under  the terms of  the GNU General  Public License as published by the
- *  Free Software Foundation;  either version 2 of the  License, or (at your
- *  option) any later version.
- */
-
-#ifndef	__OMAP2_GPMC_ONENAND_H
-#define	__OMAP2_GPMC_ONENAND_H
-
-#include <linux/platform_data/mtd-onenand-omap2.h>
-
-#if IS_ENABLED(CONFIG_MTD_ONENAND_OMAP2)
-extern void gpmc_onenand_init(struct omap_onenand_platform_data *d);
-#else
-#define board_onenand_data	NULL
-static inline void gpmc_onenand_init(struct omap_onenand_platform_data *d)
-{
-}
-#endif
-
-#endif
arch/arm/mach-omap2/gpmc.c +59 -5

83 lines not on this page · raw message

arch/arm/mach-omap2/gpmc.h +6 -222

232 lines not on this page · raw message

arch/arm/mach-omap2/pm34xx.c +1 -1
index 175564c..88721df 100644
@@ -29,6 +29,7 @@
 #include <linux/delay.h>
 #include <linux/slab.h>
 #include <linux/omap-dma.h>
+#include <linux/omap-gpmc.h>
 #include <linux/platform_data/gpio-omap.h>
 
 #include <trace/events/power.h>
@@ -43,7 +44,6 @@
 #include "common.h"
 #include "cm3xxx.h"
 #include "cm-regbits-34xx.h"
-#include "gpmc.h"
 #include "prm-regbits-34xx.h"
 #include "prm3xxx.h"
 #include "pm.h"
include/linux/omap-gpmc.h renamed from arch/arm/mach-omap2/gpmc-nand.h +13 -5
similarity index 54%
rename from arch/arm/mach-omap2/gpmc-nand.h
rename to include/linux/omap-gpmc.h
index d59e128..375caaa 100644
@@ -1,5 +1,5 @@
 /*
- *  arch/arm/mach-omap2/gpmc-nand.h
+ *  OMAP GPMC (General Purpose Memory Controller) defines
  *
  *  This program is free software; you can redistribute  it and/or modify it
  *  under  the terms of  the GNU General  Public License as published by the
@@ -7,11 +7,12 @@
  *  option) any later version.
  */
 
-#ifndef	__OMAP2_GPMC_NAND_H
-#define	__OMAP2_GPMC_NAND_H
+extern void omap3_gpmc_save_context(void);
+extern void omap3_gpmc_restore_context(void);
 
-#include "gpmc.h"
-#include <linux/platform_data/mtd-nand-omap2.h>
+struct gpmc_timings;
+struct omap_nand_platform_data;
+struct omap_onenand_platform_data;
 
 #if IS_ENABLED(CONFIG_MTD_NAND_OMAP2)
 extern int gpmc_nand_init(struct omap_nand_platform_data *d,
@@ -24,4 +25,11 @@ static inline int gpmc_nand_init(struct omap_nand_platform_data *d,
 }
 #endif
 
+#if IS_ENABLED(CONFIG_MTD_ONENAND_OMAP2)
+extern void gpmc_onenand_init(struct omap_onenand_platform_data *d);
+#else
+#define board_onenand_data	NULL
+static inline void gpmc_onenand_init(struct omap_onenand_platform_data *d)
+{
+}
 #endif
include/linux/platform_data/omap-gpmc.h new file +177 -0

177 lines not on this page · raw message

Signature · 1 line
2.1.3
#2 lore raw

PATCH 1/3 ARM: OMAP2+: Prepare to move GPMC to drivers by platform data header

Quoted 10 lines · Tony Lindgren

We still need to support platform data for omap3 until it's booting in device tree only mode. So let's add platform_data/omap-gpmc.h for that, and a minimal linux/omap-gpmc.h for the save and restore used by the PM code.

Let's also keep a minimal mach-omap2/gpmc.h still around to avoid churn on the board-*.c files. Once omap3 boots in device tree only mode, we can drop mach-omap2/gpmc.h and we can make the data structures in platform_data/omap-gpmc.h private to the GPMC driver.

Quoted 5 lines

Note that we can now also remove gpmc-nand.h and gpmc-onenand.h.

Cc Arnd Bergmann <[email protected]>
Cc Roger Quadros <[email protected]>

cheers,
-roger

author maintainer
#3 lore raw

PATCH v2 2/3 ARM: OMAP2+: Move GPMC initcall to devices.c

In reply to Tony Lindgren

This will us allow to just move gpmc.c to live under drivers in the next patch.

Note that we now also remove the omap specific check for the initcall. That's OK as gpmc_probe() checks for the pdata and bails out for other platforms compiled in.

Also the postcore_initcall() maybe possible to change to just regular module_init(), but let's do that in separate patch after the move to drivers is done.

---
 arch/arm/mach-omap2/devices.c | 26 ++++++++++++++++++++++++++
 arch/arm/mach-omap2/gpmc.c    | 31 +------------------------------
 2 files changed, 27 insertions(+), 30 deletions(-)
arch/arm/mach-omap2/devices.c +26 -0
index 324f02b..110256a 100644
@@ -445,3 +445,29 @@ static int __init omap2_init_devices(void)
 	return 0;
 }
 omap_arch_initcall(omap2_init_devices);
+
+static int __init omap_gpmc_init(void)
+{
+	struct omap_hwmod *oh;
+	struct platform_device *pdev;
+	char *oh_name = "gpmc";
+
+	/*
+	 * if the board boots up with a populated DT, do not
+	 * manually add the device from this initcall
+	 */
+	if (of_have_populated_dt())
+		return -ENODEV;
+
+	oh = omap_hwmod_lookup(oh_name);
+	if (!oh) {
+		pr_err("Could not look up %s\n", oh_name);
+		return -ENODEV;
+	}
+
+	pdev = omap_device_build("omap-gpmc", -1, oh, NULL, 0);
+	WARN(IS_ERR(pdev), "could not build omap_device for %s\n", oh_name);
+
+	return PTR_RET(pdev);
+}
+omap_postcore_initcall(omap_gpmc_init);
arch/arm/mach-omap2/gpmc.c +1 -30
index bc14f25..80dfb17 100644
@@ -37,9 +37,6 @@
 #include <linux/platform_data/mtd-nand-omap2.h>
 #include <linux/platform_data/mtd-onenand-omap2.h>
 
-#include "soc.h"
-#include "omap_device.h"
-
 #include <asm/mach-types.h>
 
 #define	DEVICE_NAME		"omap-gpmc"
@@ -2010,35 +2007,9 @@ static __exit void gpmc_exit(void)
 
 }
 
-omap_postcore_initcall(gpmc_init);
+postcore_initcall(gpmc_init);
 module_exit(gpmc_exit);
 
-static int __init omap_gpmc_init(void)
-{
-	struct omap_hwmod *oh;
-	struct platform_device *pdev;
-	char *oh_name = "gpmc";
-
-	/*
-	 * if the board boots up with a populated DT, do not
-	 * manually add the device from this initcall
-	 */
-	if (of_have_populated_dt())
-		return -ENODEV;
-
-	oh = omap_hwmod_lookup(oh_name);
-	if (!oh) {
-		pr_err("Could not look up %s\n", oh_name);
-		return -ENODEV;
-	}
-
-	pdev = omap_device_build(DEVICE_NAME, -1, oh, NULL, 0);
-	WARN(IS_ERR(pdev), "could not build omap_device for %s\n", oh_name);
-
-	return PTR_RET(pdev);
-}
-omap_postcore_initcall(omap_gpmc_init);
-
 static irqreturn_t gpmc_handle_irq(int irq, void *dev)
 {
 	int i;
Signature · 1 line
2.1.3
author maintainer
#4 lore raw

PATCH v2 3/3 memory: gpmc: Move omap gpmc code to live under drivers

In reply to Tony Lindgren

Just move to drivers as further clean-up can now happen there finally.

Let's also add Roger and me to the MAINTAINERS so we get notified for any patches related to GPMC.

Cc Arnd Bergmann <[email protected]>
Cc Roger Quadros <[email protected]>
---
 MAINTAINERS                                              | 8 ++++++++
 arch/arm/mach-omap2/Kconfig                              | 2 ++
 arch/arm/mach-omap2/Makefile                             | 2 +-
 drivers/memory/Kconfig                                   | 8 ++++++++
 drivers/memory/Makefile                                  | 1 +
 arch/arm/mach-omap2/gpmc.c => drivers/memory/omap-gpmc.c | 0
 6 files changed, 20 insertions(+), 1 deletion(-)
 rename arch/arm/mach-omap2/gpmc.c => drivers/memory/omap-gpmc.c (100%)
MAINTAINERS +8 -0
index dab92a7..78cc059 100644
@@ -6629,6 +6629,14 @@ L:	linux-omap at vger.kernel.org
 S:	Maintained
 F:	sound/soc/omap/
 
+OMAP GENERAL PURPOSE MEMORY CONTROLLER SUPPORT
+M:	Roger Quadros <[email protected]>
+M:	Tony Lindgren <[email protected]>
+L:	linux-omap at vger.kernel.org
+S:	Maintained
+F:	drivers/memory/omap-gpmc.c
+F:	arch/arm/mach-omap2/*gpmc*
+
 OMAP FRAMEBUFFER SUPPORT
 M:	Tomi Valkeinen <[email protected]>
 L:	linux-fbdev at vger.kernel.org
arch/arm/mach-omap2/Kconfig +2 -0
index f4d06ae..0ea218e 100644
@@ -79,7 +79,9 @@ config ARCH_OMAP2PLUS
 	select CLKSRC_MMIO
 	select GENERIC_IRQ_CHIP
 	select MACH_OMAP_GENERIC
+	select MEMORY
 	select OMAP_DM_TIMER
+	select OMAP_GPMC
 	select PINCTRL
 	select SOC_BUS
 	select TI_PRIV_EDMA
arch/arm/mach-omap2/Makefile +1 -1
index 3e824f8..bd85741 100644
@@ -6,7 +6,7 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include \
 	-I$(srctree)/arch/arm/plat-omap/include
 
 # Common support
-obj-y := id.o io.o control.o mux.o devices.o fb.o serial.o gpmc.o timer.o pm.o \
+obj-y := id.o io.o control.o mux.o devices.o fb.o serial.o timer.o pm.o \
 	 common.o gpio.o dma.o wd_timer.o display.o i2c.o hdq1w.o omap_hwmod.o \
 	 omap_device.o sram.o drm.o
 
drivers/memory/Kconfig +8 -0
index 6d91c27..6759de7 100644
@@ -41,6 +41,14 @@ config TI_EMIF
 	  parameters and other settings during frequency, voltage and
 	  temperature changes
 
+config OMAP_GPMC
+	bool
+	help
+	  This driver is for the General Purpose Memory Controller (GPMC)
+	  present on Texas Instruments SoCs (e.g. OMAP2+). GPMC allows
+	  interfacing to a variety of asynchronous as well as synchronous
+	  memory drives like NOR, NAND, OneNAND, SRAM.
+
 config MVEBU_DEVBUS
 	bool "Marvell EBU Device Bus Controller"
 	default y
drivers/memory/Makefile +1 -0
index c32d319..a7d410f 100644
@@ -8,6 +8,7 @@ endif
 obj-$(CONFIG_ATMEL_SDRAMC)	+= atmel-sdramc.o
 obj-$(CONFIG_TI_AEMIF)		+= ti-aemif.o
 obj-$(CONFIG_TI_EMIF)		+= emif.o
+obj-$(CONFIG_OMAP_GPMC)		+= omap-gpmc.o
 obj-$(CONFIG_FSL_CORENET_CF)	+= fsl-corenet-cf.o
 obj-$(CONFIG_FSL_IFC)		+= fsl_ifc.o
 obj-$(CONFIG_MVEBU_DEVBUS)	+= mvebu-devbus.o
drivers/memory/omap-gpmc.c renamed from arch/arm/mach-omap2/gpmc.c +0 -0
similarity index 100%
rename from arch/arm/mach-omap2/gpmc.c
rename to drivers/memory/omap-gpmc.c
Signature · 1 line
2.1.3
#5 lore raw

PATCH 3/3 memory: gpmc: Move omap gpmc code to live under drivers

Quoted 70 lines · Tony Lindgren

Just move to drivers as further clean-up can now happen there finally.

Let's also add Roger and me to the MAINTAINERS so we get notified for any patches related to GPMC.

Cc Arnd Bergmann <[email protected]>
Cc Roger Quadros <[email protected]>
---
 MAINTAINERS                                              | 8 ++++++++
 arch/arm/mach-omap2/Kconfig                              | 2 ++
 arch/arm/mach-omap2/Makefile                             | 2 +-
 drivers/memory/Kconfig                                   | 8 ++++++++
 drivers/memory/Makefile                                  | 1 +
 arch/arm/mach-omap2/gpmc.c => drivers/memory/omap-gpmc.c | 0
 6 files changed, 20 insertions(+), 1 deletion(-)
 rename arch/arm/mach-omap2/gpmc.c => drivers/memory/omap-gpmc.c (100%)
MAINTAINERS +8 -0
index dab92a7..78cc059 100644
@@ -6629,6 +6629,14 @@ L:	linux-omap at vger.kernel.org
 S:	Maintained
 F:	sound/soc/omap/
 
+OMAP GENERAL PURPOSE MEMORY CONTROLLER SUPPORT
+M:	Roger Quadros <[email protected]>
+M:	Tony Lindgren <[email protected]>
+L:	linux-omap at vger.kernel.org
+S:	Maintained
+F:	drivers/memory/omap-gpmc.c
+F:	arch/arm/mach-omap2/*gpmc*
+
 OMAP FRAMEBUFFER SUPPORT
 M:	Tomi Valkeinen <[email protected]>
 L:	linux-fbdev at vger.kernel.org
arch/arm/mach-omap2/Kconfig +2 -0
index f4d06ae..0ea218e 100644
@@ -79,7 +79,9 @@ config ARCH_OMAP2PLUS
 	select CLKSRC_MMIO
 	select GENERIC_IRQ_CHIP
 	select MACH_OMAP_GENERIC
+	select MEMORY
 	select OMAP_DM_TIMER
+	select OMAP_GPMC
 	select PINCTRL
 	select SOC_BUS
 	select TI_PRIV_EDMA
arch/arm/mach-omap2/Makefile +1 -1
index 3e824f8..bd85741 100644
@@ -6,7 +6,7 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include \
 	-I$(srctree)/arch/arm/plat-omap/include
 
 # Common support
-obj-y := id.o io.o control.o mux.o devices.o fb.o serial.o gpmc.o timer.o pm.o \
+obj-y := id.o io.o control.o mux.o devices.o fb.o serial.o timer.o pm.o \
 	 common.o gpio.o dma.o wd_timer.o display.o i2c.o hdq1w.o omap_hwmod.o \
 	 omap_device.o sram.o drm.o
 
drivers/memory/Kconfig +0 -0
index 6d91c27..6759de7 100644

drivers/memory/Kconfig config TI_EMIF · line 45

Quoted 5 lines
drivers/memory/Kconfig +2 -0
@@ -41,6 +41,14 @@ config TI_EMIF
 	  parameters and other settings during frequency, voltage and
 	  temperature changes
 
+config OMAP_GPMC
+	bool

shouldn't you make this selectable ? I might want to build a kernel without GPMC support because my board just doesn't use GPMC :-)

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141121/ea451d7f/attachment.sig>
author maintainer
#6 lore raw

PATCH v2 3/3 memory: gpmc: Move omap gpmc code to live under drivers

Quoted 7 lines · Felipe Balbi
Quoted 6 lines · Tony Lindgren
drivers/memory/Kconfig +0 -0
@@ -41,6 +41,14 @@ config TI_EMIF
 	  parameters and other settings during frequency, voltage and
 	  temperature changes
 
Quoted 5 lines

drivers/memory/Kconfig config TI_EMIF · line 45

Quoted 2 lines
drivers/memory/Kconfig +2 -0
+config OMAP_GPMC
+	bool

shouldn't you make this selectable ? I might want to build a kernel without GPMC support because my board just doesn't use GPMC :-)

Eventually yes, but let's keep it separate from this move. We'd have to do something like this:

- Make omap MTD drivers depend on OMAP_GPMC

- Make tusb6010 depend on OMAP_GPMC

- Make smc911x depend on OMAP_GPMC

- Build arch/arm/mach-omap2/*gpmc*.c conditionally depending on OMAP_GPMC

Adding stubs for omap-gpmc probably does not make sense as these devices really depend on GPMC.

Regards,

Tony

#7 lore raw

PATCH 3/3 memory: gpmc: Move omap gpmc code to live under drivers

In reply to Tony Lindgren

Tony,

Quoted 70 lines · Tony Lindgren

Just move to drivers as further clean-up can now happen there finally.

Let's also add Roger and me to the MAINTAINERS so we get notified for any patches related to GPMC.

Cc Arnd Bergmann <[email protected]>
Cc Roger Quadros <[email protected]>
---
 MAINTAINERS                                              | 8 ++++++++
 arch/arm/mach-omap2/Kconfig                              | 2 ++
 arch/arm/mach-omap2/Makefile                             | 2 +-
 drivers/memory/Kconfig                                   | 8 ++++++++
 drivers/memory/Makefile                                  | 1 +
 arch/arm/mach-omap2/gpmc.c => drivers/memory/omap-gpmc.c | 0
 6 files changed, 20 insertions(+), 1 deletion(-)
 rename arch/arm/mach-omap2/gpmc.c => drivers/memory/omap-gpmc.c (100%)
MAINTAINERS +8 -0
index dab92a7..78cc059 100644
@@ -6629,6 +6629,14 @@ L:	linux-omap at vger.kernel.org
 S:	Maintained
 F:	sound/soc/omap/
 
+OMAP GENERAL PURPOSE MEMORY CONTROLLER SUPPORT
+M:	Roger Quadros <[email protected]>
+M:	Tony Lindgren <[email protected]>
+L:	linux-omap at vger.kernel.org
+S:	Maintained
+F:	drivers/memory/omap-gpmc.c
+F:	arch/arm/mach-omap2/*gpmc*
+
 OMAP FRAMEBUFFER SUPPORT
 M:	Tomi Valkeinen <[email protected]>
 L:	linux-fbdev at vger.kernel.org
arch/arm/mach-omap2/Kconfig +2 -0
index f4d06ae..0ea218e 100644
@@ -79,7 +79,9 @@ config ARCH_OMAP2PLUS
 	select CLKSRC_MMIO
 	select GENERIC_IRQ_CHIP
 	select MACH_OMAP_GENERIC
+	select MEMORY
 	select OMAP_DM_TIMER
+	select OMAP_GPMC
 	select PINCTRL
 	select SOC_BUS
 	select TI_PRIV_EDMA
arch/arm/mach-omap2/Makefile +1 -1
index 3e824f8..bd85741 100644
@@ -6,7 +6,7 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include \
 	-I$(srctree)/arch/arm/plat-omap/include
 
 # Common support
-obj-y := id.o io.o control.o mux.o devices.o fb.o serial.o gpmc.o timer.o pm.o \
+obj-y := id.o io.o control.o mux.o devices.o fb.o serial.o timer.o pm.o \
 	 common.o gpio.o dma.o wd_timer.o display.o i2c.o hdq1w.o omap_hwmod.o \
 	 omap_device.o sram.o drm.o
 
drivers/memory/Kconfig +0 -0
index 6d91c27..6759de7 100644

drivers/memory/Kconfig config TI_EMIF · line 45

Quoted 5 lines
drivers/memory/Kconfig +2 -0
@@ -41,6 +41,14 @@ config TI_EMIF
 	  parameters and other settings during frequency, voltage and
 	  temperature changes
 
+config OMAP_GPMC
+	bool

We should depend on ARCH_OMAP2PLUS. Other platforms won't benefit anything from this driver.

drivers/memory/omap-gpmc.c

Quoted 26 lines
drivers/memory/Kconfig +6 -0
+	help
+	  This driver is for the General Purpose Memory Controller (GPMC)
+	  present on Texas Instruments SoCs (e.g. OMAP2+). GPMC allows
+	  interfacing to a variety of asynchronous as well as synchronous
+	  memory drives like NOR, NAND, OneNAND, SRAM.
+
 config MVEBU_DEVBUS
 	bool "Marvell EBU Device Bus Controller"
 	default y
drivers/memory/Makefile +1 -0
index c32d319..a7d410f 100644
@@ -8,6 +8,7 @@ endif
 obj-$(CONFIG_ATMEL_SDRAMC)	+= atmel-sdramc.o
 obj-$(CONFIG_TI_AEMIF)		+= ti-aemif.o
 obj-$(CONFIG_TI_EMIF)		+= emif.o
+obj-$(CONFIG_OMAP_GPMC)		+= omap-gpmc.o
 obj-$(CONFIG_FSL_CORENET_CF)	+= fsl-corenet-cf.o
 obj-$(CONFIG_FSL_IFC)		+= fsl_ifc.o
 obj-$(CONFIG_MVEBU_DEVBUS)	+= mvebu-devbus.o
drivers/memory/omap-gpmc.c renamed from arch/arm/mach-omap2/gpmc.c +0 -0
similarity index 100%
rename from arch/arm/mach-omap2/gpmc.c
rename to drivers/memory/omap-gpmc.c

cheers,
-roger

author maintainer
#8 lore raw

PATCH v2 3/3 memory: gpmc: Move omap gpmc code to live under drivers

Quoted 7 lines · Roger Quadros
Quoted 6 lines · Tony Lindgren
drivers/memory/Kconfig +0 -0
@@ -41,6 +41,14 @@ config TI_EMIF
 	  parameters and other settings during frequency, voltage and
 	  temperature changes
 
Quoted 5 lines

drivers/memory/Kconfig config TI_EMIF · line 45

Quoted 2 lines
drivers/memory/Kconfig +2 -0
+config OMAP_GPMC
+	bool

We should depend on ARCH_OMAP2PLUS. Other platforms won't benefit anything from this driver.

We can't do that yet until we have sorted out the remaining platform data issues with arch/arm/mach-omap2/*gpmc*.c files.

So OMAP_GPMC is currently a silent Kconfig option that does not show up as the description after the bool is not there, we select OMAP_GPMC automatically based on ARCH_OMAP2PLUS.

Once we have the remaining legacy code issues sorted out, we can make this into just a regular device driver.

Regards,

Tony

#9 lore raw

PATCH 3/3 memory: gpmc: Move omap gpmc code to live under drivers

Quoted 17 lines · Tony Lindgren
Quoted 7 lines · Roger Quadros
Quoted 6 lines · Tony Lindgren
drivers/memory/Kconfig +0 -0
@@ -41,6 +41,14 @@ config TI_EMIF
 	  parameters and other settings during frequency, voltage and
 	  temperature changes
 
Quoted 5 lines

drivers/memory/Kconfig config TI_EMIF · line 45

Quoted 2 lines
drivers/memory/Kconfig +2 -0
+config OMAP_GPMC
+	bool

We should depend on ARCH_OMAP2PLUS. Other platforms won't benefit anything from this driver.

We can't do that yet until we have sorted out the remaining platform data issues with arch/arm/mach-omap2/*gpmc*.c files.

Quoted 6 lines

So OMAP_GPMC is currently a silent Kconfig option that does not show up as the description after the bool is not there, we select OMAP_GPMC automatically based on ARCH_OMAP2PLUS.

Once we have the remaining legacy code issues sorted out, we can make this into just a regular device driver.

OK. In that case,

cheers,
-roger

author maintainer
#10 lore raw

PATCH v2 3/3 memory: gpmc: Move omap gpmc code to live under drivers

Quoted 22 lines · Roger Quadros
Quoted 21 lines · Tony Lindgren
Quoted 7 lines · Roger Quadros
Quoted 6 lines · Tony Lindgren
drivers/memory/Kconfig +0 -0
@@ -41,6 +41,14 @@ config TI_EMIF
 	  parameters and other settings during frequency, voltage and
 	  temperature changes
 
Quoted 5 lines

drivers/memory/Kconfig config TI_EMIF · line 45

Quoted 2 lines
drivers/memory/Kconfig +2 -0
+config OMAP_GPMC
+	bool

We should depend on ARCH_OMAP2PLUS. Other platforms won't benefit anything from this driver.

We can't do that yet until we have sorted out the remaining platform data issues with arch/arm/mach-omap2/*gpmc*.c files.

So OMAP_GPMC is currently a silent Kconfig option that does not show up as the description after the bool is not there, we select OMAP_GPMC automatically based on ARCH_OMAP2PLUS.

Quoted 6 lines
Quoted 2 lines

Once we have the remaining legacy code issues sorted out, we can make this into just a regular device driver.

OK. In that case,

Thanks. FYI I did the move now based on what Arnd and I discussed on #armlinux as we were trying to figure out if the earlier gpmc changes should be merged to drivers branch.

Arnd, to prettify the diffstats for the arm-soc drivers branch, I've just sent a pull request for these as:

"[GIT PULL] move omap gpmc to drivers finally".

Regards,

Tony