Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp4025967imm; Mon, 25 Jun 2018 08:31:14 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLEwTWI1FYqkUSrcDFeh3UiApICtNzBewwGxdrN5rPTZ4dSzU+WigkWkDUo+8hS/Gs6Zk+R X-Received: by 2002:a62:c1c5:: with SMTP id i188-v6mr9322466pfg.155.1529940674687; Mon, 25 Jun 2018 08:31:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529940674; cv=none; d=google.com; s=arc-20160816; b=xMNzhqxyL5Q5+qdR0CVJnDdg+F/IhQRJUJf5jvzj++8mUUkncC5LBwish7DzQ+IttV n7qPa7k27c1NNBnoE0m4ZrpXKHm82jpWawju7iSskj7Ma3BxPslsdYyWISij8YqVyDw8 G/JTg760iROJbHKOTPtUG9ktDlpHBKrD2bf8JbLwAEnX/KOwFFd0VvozH77oFLDwt8Yg nErVtU2qLaZU3wL8kj9qKdFnZRJmU2fK8Y0zRkveU9p/KkqBuWgQyjCqv+lfImJtK3Ot PvaN0X9DhHWWYnbOE9aunQU3d4rIs9QgrJVQljEFPlt/oTTnmCJMpaIUHBl0H+JwQbQr j5iA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=4HAy4CFX12smc0TnD2wG3IULi/54eoKnvvMUZ/d29ys=; b=aPpKoDKOP3rpDst9V5dioEQkIA4LSUu8kt8JBCoZbewPJKigljp/TnmmrwX3HLnumZ sxpvTPaf7vjNgcpWJ1iUdV71iQqB80cdRDuRCyflAX6Hxi+kyKdh7aUiWLTlUX3dn3Sm 4JGdZvshma0HwBcH7Yj24Z+1bJO62FbpLoHAAMwc6TMngWOx+OQjEfSaUU5Ztsgv8yLz vtHvx1lhvh5pAjM6a4Vf45ENbLvd80q3fBhHx8m90T3VhvMvwlO3ozRrz+9Fsbz6TOwO ELJSmwixRNvv1LxNPkgYZY0jjKyl3/F27dPsiYB3hsKTkcXHTWagsUpB2kQqJh3HSz43 vrEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=yy90DSrT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r7-v6si12365517pgn.326.2018.06.25.08.30.59; Mon, 25 Jun 2018 08:31:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=yy90DSrT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752978AbeFYPaF (ORCPT + 99 others); Mon, 25 Jun 2018 11:30:05 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:52000 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752305AbeFYP36 (ORCPT ); Mon, 25 Jun 2018 11:29:58 -0400 Received: by mail-wm0-f65.google.com with SMTP id w137-v6so4449914wmw.1 for ; Mon, 25 Jun 2018 08:29:58 -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=4HAy4CFX12smc0TnD2wG3IULi/54eoKnvvMUZ/d29ys=; b=yy90DSrTj2fc+se71/phGT+Bi0iqLgeH+47AgNXRMDFRo5nlsZlI6V8D2BglJlPof0 ZmR6LNIyizmB3QB5s88o1EFfLY76gtgqr1TXU0r3PTmAtsdRnH0Mie39TjiSB5AWuLUk gEdza/vO0zlxoOt2baADuQMKbxtnBhwRG8iM2YwnrqsRQwpDSXmBfqmnRgU3HfTgtq5G twfziKYa6rPaoVJ3BUwW4wnvyICn+9ag8d4nSuYzLZ600o7eYomLzidHnSNw89yAAOtq /jJjrObJUlmw+unZ8LtfhDA2ue3A6hfz0rFMXEW/izzPlU8rwxnfUhIX8vOj5znMvRqu 0Rxg== 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=4HAy4CFX12smc0TnD2wG3IULi/54eoKnvvMUZ/d29ys=; b=J58/KNNTlIPYUmfpIzt/Mg9fzbni+/4jBpOV9k+9DmfCHdl9d7yKkGxqQqs3eWxG5B C17FyKcxvcn3mrwI2dGKeChDIRdEolI+zrcZfLvYBpzDesx5w4DxFF5cNGmpdRUJ6wX0 Y9oGMMweEfDLZPyay70HysFQild7YxqrD8dVTwTJh8zlv0FmnOyxN+wmFZhVmoY7FSxH LJbKKGnaccqXaG/ofe0Ha1KsERlh8jUcT78WDxzgTIqM+RS5z3Js+fH52VwDVnV8Ojgd WZ/IE7ZZcl2AIqNyjtwi6rx6Lx9A7O4lX5MV45VGyR4PNw32XXn5nxrfv8YlRfTrhB9D 82WA== X-Gm-Message-State: APt69E3+EnYEcuLDY6+o8JUU7B+OX81IV3h2eLjqdG24wGOkauJtdJzx TyRyIaIVVmfVAHS8HJt8V19GUnwu3Pw= X-Received: by 2002:a1c:ea4a:: with SMTP id i71-v6mr1302968wmh.158.1529940597620; Mon, 25 Jun 2018 08:29:57 -0700 (PDT) Received: from brgl-bgdev.home ([2a01:cb1d:af:5b00:e837:b8d5:48c1:571b]) by smtp.gmail.com with ESMTPSA id l15-v6sm18829174wrs.95.2018.06.25.08.29.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 08:29:57 -0700 (PDT) From: Bartosz Golaszewski To: Sekhar Nori , Kevin Hilman , Russell King , David Lechner , Michael Turquette , Stephen Boyd Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 7/9] ARM: davinci: dm646x-evm: use aemif platform driver Date: Mon, 25 Jun 2018 17:29:18 +0200 Message-Id: <20180625152920.11549-8-brgl@bgdev.pl> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180625152920.11549-1-brgl@bgdev.pl> References: <20180625152920.11549-1-brgl@bgdev.pl> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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..99297e0612ba 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", + .dev = { + .platform_data = &davinci_aemif_pdata, }, + .resource = davinci_aemif_resources, + .num_resources = ARRAY_SIZE(davinci_aemif_resources), + .id = -1, }; #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); -- 2.17.1