From patchwork Thu Jun 28 09:57:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10493441 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 80C97601BE for ; Thu, 28 Jun 2018 09:59:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6B321298BB for ; Thu, 28 Jun 2018 09:59:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5CDDE29903; Thu, 28 Jun 2018 09:59:41 +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 E3872298BB for ; Thu, 28 Jun 2018 09:59:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935293AbeF1J7N (ORCPT ); Thu, 28 Jun 2018 05:59:13 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:44446 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935259AbeF1J6H (ORCPT ); Thu, 28 Jun 2018 05:58:07 -0400 Received: by mail-wr0-f195.google.com with SMTP id p12-v6so4848724wrn.11 for ; Thu, 28 Jun 2018 02:58:07 -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=KAUxG9nVhpwOE6npDohIvKeIU9uaX0YQAD3Qnbf9S7LrKUyum7JrLlpZAbZ0FJZBqG LhZEj+cBnLqtFw/byt7jUHcxCcDzY/t8iUDz/Ffkj/GiNTGhEM48CvNwJDHwFi08j/5I /Ujg81yIV8PytUVHyCQ2lnCYRO169vkpHBmF+21fjOv1xJLdECciK0m/fjM75xBC30nX UPlRL1992Oy9BQ6wMoNfqjxjBjGQO68l7SrwMCoe30/RSqaRwdzs3MTbn//AeMnXlZfX SmGvNpN5HH73pW69nMewkqCnKNGj38YiYqjzKexO3VmZwrzRnLAD1Ms0VfQuhqY5Ssch Nbvg== 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=uiphs4LpAuiOI3LwjJbeNj3p0uXxDak2uFVi5OEmtfhp7CSzOdnxUua3GZUtmcDjEi xNDr1alnBI0GQHnAuPjOzarstN7GL0b3C2aLwyj1vbCulb0V5nPzdGjLbbM3i6PJyRUP 1EGqZ+6kvdK/EZoo79vF4AaUmqhnIU1+7xj72tCdZZxum/WUm5Z7LuZfFFP9vPALlNd1 DjoOLxZymPPAJADd93YyfzRjZF0UV9OtIYJooMK1z19b+4slvc7nhGFojzdwiiG5ta5M W5TeRgFoUeOiItcaxGdckGL74ZPXFbGS48sO3AXSw5xivaMYORFip4tk/TXKTv3kdbBy 7GOQ== X-Gm-Message-State: APt69E1jg/rjgw+RuMPig9EZ+NIo/23cA96JczrDX0EFw6vXDEu+fNmx Flo2WI83VNBMaFoojPwo6T4SVA== X-Google-Smtp-Source: AAOMgpd2pe1jtkeStc12SwIE/7ciHo/tbzukxLuHCKk/R+rKXoaTwaFMie3NzFgJfIqMlS/T0dYFnA== X-Received: by 2002:adf:a14a:: with SMTP id r10-v6mr7952775wrr.104.1530179886538; Thu, 28 Jun 2018 02:58:06 -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.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jun 2018 02:58:06 -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 v3 10/13] ARM: davinci: da830-evm: use aemif platform driver Date: Thu, 28 Jun 2018 11:57:45 +0200 Message-Id: <20180628095748.4462-11-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> 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); }