From patchwork Tue Jun 26 09:25:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10488467 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 6B500602D8 for ; Tue, 26 Jun 2018 09:27:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 66E422884E for ; Tue, 26 Jun 2018 09:27:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5B99428857; Tue, 26 Jun 2018 09:27:34 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0A72C2884E for ; Tue, 26 Jun 2018 09:27:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933997AbeFZJ01 (ORCPT ); Tue, 26 Jun 2018 05:26:27 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:39711 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934164AbeFZJZy (ORCPT ); Tue, 26 Jun 2018 05:25:54 -0400 Received: by mail-wr0-f195.google.com with SMTP id b8-v6so11029974wro.6 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=S9ORA0MqH8v2+x20Z4JkqnITrKYmBTQQrsE9t81laIlmdio99ldqYXAI1S21AlbHHW BdHtpe1034B4EANAV/IrntKuSIsVMJwYi3aqJ+bsV6R3M//aVhVv4immRiBT9zTQGx3r eVg9BKcx3VDUM/nk4uxYSr55Tz9fYA7XBKs2KBqSVoM9tvr6fexJ/E4wEI1UVrzS0h5z Sbkk9hv4FB91KVtaLcQkZ8hlNW857udZmMmWTOgW/Czt8IzHuAUoQCFW5eSFWQp0i9gZ ARvtJeAQD3DrFyylUsq3V6XBiCFQL8MgCMUBfRHC1h7Gx1/P0pMSFToY7vhgroHd4sK6 qEyw== X-Gm-Message-State: APt69E2OLm6zRiZh3odSB8AR5hYhOxRfwConUOwefYLyPMDd0uj3cWfV 21Emon0Kt1VYVQu80ZGbYQoDfQ== X-Google-Smtp-Source: AAOMgpc367oVAjiYXtIjo/GVNimVUQHcQFbT+8roSZ6PKnwJh0a30wwTuc8wPhf9FzcJdbyvGubQaA== 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-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.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 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); }