From patchwork Sat Jan 18 06:21:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prabhakar Kushwaha X-Patchwork-Id: 312265 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id ABE2E2C0319 for ; Sat, 18 Jan 2014 17:22:29 +1100 (EST) Received: from db9outboundpool.messaging.microsoft.com (mail-db9lp0249.outbound.messaging.microsoft.com [213.199.154.249]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id E80942C008F for ; Sat, 18 Jan 2014 17:21:58 +1100 (EST) Received: from mail195-db9-R.bigfish.com (10.174.16.227) by DB9EHSOBE013.bigfish.com (10.174.14.76) with Microsoft SMTP Server id 14.1.225.22; Sat, 18 Jan 2014 06:21:52 +0000 Received: from mail195-db9 (localhost [127.0.0.1]) by mail195-db9-R.bigfish.com (Postfix) with ESMTP id 81CC12000C7; Sat, 18 Jan 2014 06:21:52 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 0 X-BigFish: VS0(zze0eahzz1f42h2148h208ch1ee6h1de0h1fdah2073h2146h1202h1e76h2189h1d1ah1d2ah21bch1fc6hzz1de098h8275bh8275dh1de097hz2dh2a8h839hd24he5bhf0ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1ad9h1b0ah1b2fh2222h224fh1fb3h1d0ch1d2eh1d3fh1dc1h1dfeh1dffh1e23h1fe8h1ff5h2218h2216h226dh22d0h24afh2327h2336h2438h2461h2487h1155h) Received: from mail195-db9 (localhost.localdomain [127.0.0.1]) by mail195-db9 (MessageSwitch) id 1390026110257513_32221; Sat, 18 Jan 2014 06:21:50 +0000 (UTC) Received: from DB9EHSMHS003.bigfish.com (unknown [10.174.16.225]) by mail195-db9.bigfish.com (Postfix) with ESMTP id 2F1B34004D; Sat, 18 Jan 2014 06:21:50 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by DB9EHSMHS003.bigfish.com (10.174.14.13) with Microsoft SMTP Server (TLS) id 14.16.227.3; Sat, 18 Jan 2014 06:21:50 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-005.039d.mgd.msft.net (10.84.1.17) with Microsoft SMTP Server (TLS) id 14.3.158.2; Sat, 18 Jan 2014 06:21:47 +0000 Received: from b32579-VirtualBox.ap.freescale.net (B32579-02-010232132126.ap.freescale.net [10.232.132.126]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id s0I6LdJj015212; Fri, 17 Jan 2014 23:21:45 -0700 From: Prabhakar Kushwaha To: Subject: [PATCH 1/2][v5] driver/memory:Move Freescale IFC driver to a common driver Date: Sat, 18 Jan 2014 11:51:31 +0530 Message-ID: <1390026091-25111-1-git-send-email-prabhakar@freescale.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-FOPE-CONNECTOR: Id%0$Dn%*$RO%0$TLS%0$FQDN%$TlsDn% X-FOPE-CONNECTOR: Id%0$Dn%FREESCALE.MAIL.ONMICROSOFT.COM$RO%1$TLS%0$FQDN%$TlsDn% Cc: scottwood@freescale.com, linux-kernel@vger.kernel.org, Prabhakar Kushwaha X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Freescale IFC controller has been used for mpc8xxx. It will be used for ARM-based SoC as well. This patch moves the driver to driver/memory and fix the header file includes. Also remove module_platform_driver() and instead call platform_driver_register() from subsys_initcall() to make sure this module has been loaded before MTD partition parsing starts. Signed-off-by: Prabhakar Kushwaha Acked-by: Arnd Bergmann --- Changes for v2: - Move fsl_ifc in driver/memory Changes for v3: - move device tree bindings to memory Changes for v4: Rebased to git://git.kernel.org/pub/scm/linux/kernel/git/scottwood/linux.git Changes for v5: - Moved powerpc/Kconfig option to driver/memory .../{powerpc => memory-controllers}/fsl/ifc.txt | 0 arch/powerpc/Kconfig | 4 ---- arch/powerpc/sysdev/Makefile | 1 - drivers/memory/Kconfig | 4 ++++ drivers/memory/Makefile | 1 + {arch/powerpc/sysdev => drivers/memory}/fsl_ifc.c | 8 ++++++-- drivers/mtd/nand/fsl_ifc_nand.c | 2 +- .../include/asm => include/linux}/fsl_ifc.h | 0 8 files changed, 12 insertions(+), 8 deletions(-) rename Documentation/devicetree/bindings/{powerpc => memory-controllers}/fsl/ifc.txt (100%) rename {arch/powerpc/sysdev => drivers/memory}/fsl_ifc.c (98%) rename {arch/powerpc/include/asm => include/linux}/fsl_ifc.h (100%) diff --git a/Documentation/devicetree/bindings/powerpc/fsl/ifc.txt b/Documentation/devicetree/bindings/memory-controllers/fsl/ifc.txt similarity index 100% rename from Documentation/devicetree/bindings/powerpc/fsl/ifc.txt rename to Documentation/devicetree/bindings/memory-controllers/fsl/ifc.txt diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index b44b52c..83fb8b3 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -725,10 +725,6 @@ config FSL_LBC controller. Also contains some common code used by drivers for specific local bus peripherals. -config FSL_IFC - bool - depends on FSL_SOC - config FSL_GTM bool depends on PPC_83xx || QUICC_ENGINE || CPM2 diff --git a/arch/powerpc/sysdev/Makefile b/arch/powerpc/sysdev/Makefile index f67ac90..afbcc37 100644 --- a/arch/powerpc/sysdev/Makefile +++ b/arch/powerpc/sysdev/Makefile @@ -21,7 +21,6 @@ obj-$(CONFIG_FSL_SOC) += fsl_soc.o fsl_mpic_err.o obj-$(CONFIG_FSL_PCI) += fsl_pci.o $(fsl-msi-obj-y) obj-$(CONFIG_FSL_PMC) += fsl_pmc.o obj-$(CONFIG_FSL_LBC) += fsl_lbc.o -obj-$(CONFIG_FSL_IFC) += fsl_ifc.o obj-$(CONFIG_FSL_GTM) += fsl_gtm.o obj-$(CONFIG_FSL_85XX_CACHE_SRAM) += fsl_85xx_l2ctlr.o fsl_85xx_cache_sram.o obj-$(CONFIG_SIMPLE_GPIO) += simple_gpio.o diff --git a/drivers/memory/Kconfig b/drivers/memory/Kconfig index 29a11db..b33bb0e 100644 --- a/drivers/memory/Kconfig +++ b/drivers/memory/Kconfig @@ -50,4 +50,8 @@ config TEGRA30_MC analysis, especially for IOMMU/SMMU(System Memory Management Unit) module. +config FSL_IFC + bool + depends on FSL_SOC + endif diff --git a/drivers/memory/Makefile b/drivers/memory/Makefile index 969d923..f2bf25c 100644 --- a/drivers/memory/Makefile +++ b/drivers/memory/Makefile @@ -6,6 +6,7 @@ ifeq ($(CONFIG_DDR),y) obj-$(CONFIG_OF) += of_memory.o endif obj-$(CONFIG_TI_EMIF) += emif.o +obj-$(CONFIG_FSL_IFC) += fsl_ifc.o obj-$(CONFIG_MVEBU_DEVBUS) += mvebu-devbus.o obj-$(CONFIG_TEGRA20_MC) += tegra20-mc.o obj-$(CONFIG_TEGRA30_MC) += tegra30-mc.o diff --git a/arch/powerpc/sysdev/fsl_ifc.c b/drivers/memory/fsl_ifc.c similarity index 98% rename from arch/powerpc/sysdev/fsl_ifc.c rename to drivers/memory/fsl_ifc.c index d7fc722..135a950 100644 --- a/arch/powerpc/sysdev/fsl_ifc.c +++ b/drivers/memory/fsl_ifc.c @@ -30,8 +30,8 @@ #include #include #include +#include #include -#include struct fsl_ifc_ctrl *fsl_ifc_ctrl_dev; EXPORT_SYMBOL(fsl_ifc_ctrl_dev); @@ -299,7 +299,11 @@ static struct platform_driver fsl_ifc_ctrl_driver = { .remove = fsl_ifc_ctrl_remove, }; -module_platform_driver(fsl_ifc_ctrl_driver); +static int __init fsl_ifc_init(void) +{ + return platform_driver_register(&fsl_ifc_ctrl_driver); +} +subsys_initcall(fsl_ifc_init); MODULE_LICENSE("GPL"); MODULE_AUTHOR("Freescale Semiconductor"); diff --git a/drivers/mtd/nand/fsl_ifc_nand.c b/drivers/mtd/nand/fsl_ifc_nand.c index 4335577..865b323 100644 --- a/drivers/mtd/nand/fsl_ifc_nand.c +++ b/drivers/mtd/nand/fsl_ifc_nand.c @@ -30,7 +30,7 @@ #include #include #include -#include +#include #define FSL_IFC_V1_1_0 0x01010000 #define ERR_BYTE 0xFF /* Value returned for read diff --git a/arch/powerpc/include/asm/fsl_ifc.h b/include/linux/fsl_ifc.h similarity index 100% rename from arch/powerpc/include/asm/fsl_ifc.h rename to include/linux/fsl_ifc.h