Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp4900802imm; Tue, 26 Jun 2018 02:28:40 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKrZc6wA+f/nkbfx7ZgdZzjHClzpg9BBx+0WPEphyrwsEsSCf1u1C4PbS96g0tRIn8D3V4d X-Received: by 2002:a17:902:d688:: with SMTP id v8-v6mr804295ply.59.1530005320852; Tue, 26 Jun 2018 02:28:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530005320; cv=none; d=google.com; s=arc-20160816; b=F86IdylXuvoqXsLXl5VUVFwR1hWwcBHiKwm6wD8oaobyG8MKN0xa50cavSd31fVnr2 WsIrJCXu0SMo5qZtX3uKSgrNMuD1Oac7zCv0R7Uf8ouELsR/bjyUIqo1saYOTetH43m3 bI8V5fgFBdDT4yFSEB2bfRTtesnZo9pRpvcf8Sg4UXvZhPG4B8hBCU0uQfchorLmPqQ/ WeppofC2WVXEvmyC4Ukt2bRGO2QDBL8/Q8ZImDkuOSNnoUmL7ehH8+YEmHydOJtgTZng gtqHBhMEBG1V7m1hvvkZ60MzVXZV6fmch5hUDnLTkO3wbuCOKBwIi36cvqcnXEnlgy3R l9BQ== 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=DD+tegRkL77MXGQNOF6Vh7wMcrPvGgbRls6E01LtcQY=; b=WIzTNwTAKfA9nSMc8Nv67wGPfXq9beR/ktcId5jb4bWynpq3b8ZBdvaeqv6g6rQjoD h8Zr5uhydB9dhZOiXk2kw14MYTho62IdRXXGupzAZv1cWxisirnWokpGUuKOJ8QaOfor ZSyZui57iAtQLnAHPEkQLYq8TOeZqN4n9JG26Wbk7i3GQcG1PspMyF2JNfsLCbNfBdKc Pz/Zt2pVgA8zG58ItA4I0tSFJs5q10Jude3utvsrHKjQgh7vP0GdhoQrGyUKC6Ht/RVl f0EuOSXPDCdN7SORAWWpkSdRl+NXyj8WFf5dpRj0L635bhOZ6DedaXajrVMkkwwwpl2c 1Etg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=OZpcw8s3; 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 b15-v6si1202748pls.425.2018.06.26.02.28.26; Tue, 26 Jun 2018 02:28:40 -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=OZpcw8s3; 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 S934581AbeFZJ0a (ORCPT + 99 others); Tue, 26 Jun 2018 05:26:30 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:36995 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934152AbeFZJZy (ORCPT ); Tue, 26 Jun 2018 05:25:54 -0400 Received: by mail-wr0-f193.google.com with SMTP id k6-v6so16470688wrp.4 for ; Tue, 26 Jun 2018 02:25:53 -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=DD+tegRkL77MXGQNOF6Vh7wMcrPvGgbRls6E01LtcQY=; b=OZpcw8s3WOhiEnQDlGrRMjFedTDuF/I8JHmSFf12/YTSclsoZwVJmJZviSX83HTKWX 37I61rzi72H5Kcx9nIX9RddKy36LbJWxtCFgKEXksHtutSDKUGa/dzz2/g9YKWzQl33B tW3UmO+Og5OnxPD+6zOdfkKgEhGOOXssjaIKOmeDRtBoAv5mVtVM9+Y8/Xv8yHACeaBe dj9/ATb6dLe6SUJDcHUrsjL7A4BsTKwm3/NJODagXR0+qa66qeeKE0W4M0xgqBNvZZmr Oh56gC1vPX+zI6lk39go3l+wvVMQFbrB7iUIde3ivTToye3T1r0noGDGx13K7AzxMTz2 92Ig== 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=DD+tegRkL77MXGQNOF6Vh7wMcrPvGgbRls6E01LtcQY=; b=NvaXfrIsDw+ABB2/L41oHdQK5VsAgEDEqVtLcVBcVNSgNykkB1oHGIp2SUHa1PPAXP +2YedIiLWUaTbGc+JnuN/ZKCI8dO2eyQHiWYUQGMuYeIP9ln9/Q98QZmm21X8gYhgAXH aBuRVKJuI0MY6fICsAcOpiqN2f8bWCaA7lfQ0whzfR1mrCmMQBxXY3iNzyeVrveKxGkz F8b4Ctd5/4rIoXXX4H55zAud+Uu3a44WY4UpkTIa09yFrDQrwrboqyjAXhft9zWN8EVO YGu/D/CzdRiJG1uUpG9qeiPcvtO+w3ugMduUrfzD9eeOwigBscXZb9mA9vZh1pnr5Hkr wbHw== X-Gm-Message-State: APt69E0Yx8SSzbBpgHmEUu2lR95ab5Kkwqks2doSuhf9eEEI24QXCLHH L/GzCM0jZg2MzUi+vN4hfp5XzA== X-Received: by 2002:adf:fe46:: with SMTP id m6-v6mr719675wrs.171.1530005152907; Tue, 26 Jun 2018 02:25:52 -0700 (PDT) Received: from brgl-bgdev.lan (LFbn-NIC-1-55-10.w2-15.abo.wanadoo.fr. [2.15.147.10]) by smtp.gmail.com with ESMTPSA id a8-v6sm1528791wrn.50.2018.06.26.02.25.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Jun 2018 02:25:52 -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 v2 10/13] ARM: davinci: da830-evm: use aemif platform driver Date: Tue, 26 Jun 2018 11:25:34 +0200 Message-Id: <20180626092537.6737-11-brgl@bgdev.pl> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180626092537.6737-1-brgl@bgdev.pl> References: <20180626092537.6737-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 da830-evm. Signed-off-by: Bartosz Golaszewski --- arch/arm/mach-davinci/board-da830-evm.c | 56 +++++++++++++++++++------ 1 file changed, 44 insertions(+), 12 deletions(-) diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c index b2470141dba3..7d8ab36ff83d 100644 --- a/arch/arm/mach-davinci/board-da830-evm.c +++ b/arch/arm/mach-davinci/board-da830-evm.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -333,14 +334,48 @@ 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_aemif_devices[] = { + { + .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 resource da830_evm_aemif_resource[] = { + { + .start = DA8XX_AEMIF_CTL_BASE, + .end = DA8XX_AEMIF_CTL_BASE + SZ_32K - 1, + .flags = IORESOURCE_MEM, + }, +}; + +static struct aemif_abus_data da830_evm_aemif_abus_data[] = { + { + .cs = 3, }, - .num_resources = ARRAY_SIZE(da830_evm_nand_resources), - .resource = da830_evm_nand_resources, +}; + +static struct aemif_platform_data da830_evm_aemif_pdata = { + .abus_data = da830_evm_aemif_abus_data, + .num_abus_data = ARRAY_SIZE(da830_evm_aemif_abus_data), + .sub_devices = da830_evm_aemif_devices, + .num_sub_devices = ARRAY_SIZE(da830_evm_aemif_devices), + .cs_offset = 2, +}; + +static struct platform_device da830_evm_aemif_device = { + .name = "ti-aemif", + .id = -1, + .dev = { + .platform_data = &da830_evm_aemif_pdata, + }, + .resource = da830_evm_aemif_resource, + .num_resources = ARRAY_SIZE(da830_evm_aemif_resource), }; /* @@ -371,12 +406,9 @@ static inline void da830_evm_init_nand(int mux_mode) if (ret) pr_warn("%s: emif25 mux setup failed: %d\n", __func__, ret); - ret = platform_device_register(&da830_evm_nand_device); + ret = platform_device_register(&da830_evm_aemif_device); if (ret) - pr_warn("%s: NAND device not registered\n", __func__); - - if (davinci_aemif_setup(&da830_evm_nand_device)) - pr_warn("%s: Cannot configure AEMIF\n", __func__); + pr_warn("%s: AEMIF device not registered\n", __func__); gpio_direction_output(mux_mode, 1); } -- 2.17.1