From patchwork Thu Jun 28 09:57:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10493485 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AA096601BE for ; Thu, 28 Jun 2018 10:05:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 906332998D for ; Thu, 28 Jun 2018 10:05:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8358729995; Thu, 28 Jun 2018 10:05:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DC2222998D for ; Thu, 28 Jun 2018 10:05:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Ajwi84nBmtn6A4e6J2aZzYD5ilQOE27dsC+Jjynz5AQ=; b=Neh73bUtyuK63VobYbvg3n1uL3 VKqiOHajJMnI8ZscqAOSmC+N3lgEGpEIc5opJenblKdHowVMgCDz8w6adEwc/pcBrTCVf3PLsFLJJ z9Ebrg6/Ubf0/0W7qlt3mc6Y2xy4VywPRhvfucgdsrIZSM/Labx+AjPM0e+oDCcWnVFWrcqaC2LrM JRdp+3eGHMB4aZlTtZiMtI7fArqFahORruFaMCnpZklZbTiu/dXksYaIId9Wl7uetcRkr2lnU+rXt 415VTOc/FhydLqxXzoDT8DzWi0ARsfaL+cvz9lnREdQ28XeYvzu/derVE9z9UGulUEw+TgtUaMxBX 2j5xTiGA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fYTnK-00026d-01; Thu, 28 Jun 2018 10:04:54 +0000 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fYTgx-00055y-0P for linux-arm-kernel@lists.infradead.org; Thu, 28 Jun 2018 09:58:28 +0000 Received: by mail-wm0-x242.google.com with SMTP id v16-v6so8956823wmv.5 for ; Thu, 28 Jun 2018 02:58:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=MJvgkDiHW4gPWvPNjt08VsbgJnWIDweim6LTyj60Vb4=; b=dg74wn+NYJwlK0qg6jZc6uAt8PlAUshd0nWRa82aP4wfk/Erb6D7ABaPlGmO/+U44U QCBoZQOZSxfvIVQCyOIQZcivCFsqFDW3s3gpM+7Xux6hLBO09z8NdeEse+D3OFoWT3FZ Sxz+Fm1x1cdnJ5wL82x7zFLwXszDkrW9HW2a+lU3GAHPy4/+Wye6LM/JNGYTQUSIysXQ 5dTqMjcTYqJblgfDFhHo7qxXLb5MgznHX6EixTIyNMpa81z50FcIOuSQRIjdSDIVX3z2 KITHLNor6QJjMNNw7iea4uFvsfr4GcKjeVI9eJ90GXTEXNwgaAkmbmLi+Xg37w63OimF uhIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=MJvgkDiHW4gPWvPNjt08VsbgJnWIDweim6LTyj60Vb4=; b=LKaXtX85hfKUFKvnTjoJrtPpWP/k9Wpxr3yufohNBMYNM237oOfEXTSBEstd0yOOLi j8sZd3wGCWZUY4ZK2rjIYU9MZgzHVq+yCFQvbUk5K+g72uEoxNcdTWNvVPeGnuEvc4+A BZC1WQNOzWWjTPn/6JmbhuF5JNZ5Luh7yWJooo4NsLLga4d9Q6lsC9FNTsOFcwumt6+S CVs8NpY2D/ppnMDKpxM0GYlFlEiMLMP9d2vH8S3xyNr7uY8H5sOPCSzLdpRm7ZdSZ/J9 K9KHihdS5ItmwNG5AJ6mbVzCJpAP5nyv5i7fx4i/IGYuRZHmBPrrHiMdL32mDFg7CXlf xy/w== X-Gm-Message-State: APt69E0Z4R1ekVhvR2Dy2AHd6DY4DhSAodVyxAn+dGOYDAaDcVSEOxDp VdslZyhhHlvpek3dfys9nOX9bw== X-Google-Smtp-Source: AAOMgpdrhUx/3sDXLQ4A/KxVsu6QSWli8bxrV50V2+Kqn4AaEaCYTiOhhc6G/8XnRWD3Sb5EB064jA== X-Received: by 2002:a1c:8893:: with SMTP id k141-v6mr7697396wmd.133.1530179887651; Thu, 28 Jun 2018 02:58:07 -0700 (PDT) Received: from brgl-bgdev.baylibre.local (AStLambert-681-1-87-41.w90-86.abo.wanadoo.fr. [90.86.29.41]) by smtp.gmail.com with ESMTPSA id s8-v6sm1550352wrm.84.2018.06.28.02.58.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jun 2018 02:58:07 -0700 (PDT) From: Bartosz Golaszewski To: Sekhar Nori , Kevin Hilman , Russell King , David Lechner , Michael Turquette , Stephen Boyd Subject: [PATCH v3 11/13] ARM: davinci: dm646x-evm: use aemif platform driver Date: Thu, 28 Jun 2018 11:57:46 +0200 Message-Id: <20180628095748.4462-12-brgl@bgdev.pl> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180628095748.4462-1-brgl@bgdev.pl> References: <20180628095748.4462-1-brgl@bgdev.pl> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180628_025819_586528_C577D4C0 X-CRM114-Status: GOOD ( 15.78 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bartosz Golaszewski , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Bartosz Golaszewski We now support board files in the aemif driver. Register a platform device instead of using the handcrafted API in dm646x-evm. Signed-off-by: Bartosz Golaszewski --- arch/arm/mach-davinci/board-dm646x-evm.c | 52 +++++++++++++++++++----- 1 file changed, 41 insertions(+), 11 deletions(-) diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c index 867ab2fa6cfd..3e5ee09ee717 100644 --- a/arch/arm/mach-davinci/board-dm646x-evm.c +++ b/arch/arm/mach-davinci/board-dm646x-evm.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -106,16 +107,47 @@ static struct resource davinci_nand_resources[] = { }, }; -static struct platform_device davinci_nand_device = { - .name = "davinci_nand", - .id = 0, +static struct platform_device davinci_aemif_devices[] = { + { + .name = "davinci_nand", + .id = 0, + .num_resources = ARRAY_SIZE(davinci_nand_resources), + .resource = davinci_nand_resources, + .dev = { + .platform_data = &davinci_nand_data, + }, + }, +}; + +static struct resource davinci_aemif_resources[] = { + { + .start = DM646X_ASYNC_EMIF_CONTROL_BASE, + .end = DM646X_ASYNC_EMIF_CONTROL_BASE + SZ_4K - 1, + .flags = IORESOURCE_MEM, + }, +}; - .num_resources = ARRAY_SIZE(davinci_nand_resources), - .resource = davinci_nand_resources, +static struct aemif_abus_data davinci_aemif_abus_data[] = { + { + .cs = 1, + }, +}; - .dev = { - .platform_data = &davinci_nand_data, +static struct aemif_platform_data davinci_aemif_pdata = { + .abus_data = davinci_aemif_abus_data, + .num_abus_data = ARRAY_SIZE(davinci_aemif_abus_data), + .sub_devices = davinci_aemif_devices, + .num_sub_devices = ARRAY_SIZE(davinci_aemif_devices), +}; + +static struct platform_device davinci_aemif_device = { + .name = "ti-aemif", + .id = -1, + .dev = { + .platform_data = &davinci_aemif_pdata, }, + .resource = davinci_aemif_resources, + .num_resources = ARRAY_SIZE(davinci_aemif_resources), }; #define HAS_ATA (IS_ENABLED(CONFIG_BLK_DEV_PALMCHIP_BK3710) || \ @@ -793,10 +825,8 @@ static __init void evm_init(void) if (machine_is_davinci_dm6467tevm()) davinci_nand_data.timing = &dm6467tevm_nandflash_timing; - platform_device_register(&davinci_nand_device); - - if (davinci_aemif_setup(&davinci_nand_device)) - pr_warn("%s: Cannot configure AEMIF.\n", __func__); + if (platform_device_register(&davinci_aemif_device)) + pr_warn("%s: Cannot register AEMIF device.\n", __func__); dm646x_init_edma(dm646x_edma_rsv);