From patchwork Mon Jun 25 15:29:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10486751 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 A9EA76023A for ; Mon, 25 Jun 2018 15:31:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A0F1285C7 for ; Mon, 25 Jun 2018 15:31:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8E6342861E; Mon, 25 Jun 2018 15:31:08 +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 3BD10285C7 for ; Mon, 25 Jun 2018 15:31:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934759AbeFYPbA (ORCPT ); Mon, 25 Jun 2018 11:31:00 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:40828 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752330AbeFYP37 (ORCPT ); Mon, 25 Jun 2018 11:29:59 -0400 Received: by mail-wm0-f68.google.com with SMTP id z13-v6so4325346wma.5 for ; Mon, 25 Jun 2018 08:29:59 -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=4zQ2Ecsff57oPNK/oQrXQHYveS2kALMPGI+zghtR8Pw=; b=zUmgjcRZvqcPFNpp4BJcwAFIjsWwhbpmhtSFeb5M8WjiV2X6s+35GUgBfOu4+PSdr7 f2ffh1+wmSwGns3u5k2ISkTZpqnjpdFoEeN15aMuUopHx8yj1ICS2kf2cJpFZXwENMp2 SKvNu7AzEj1p8Xz6raQ5Ef8S8htP+V+5b2wM6t5fm3CjOLHIZle7GFPkj3JpPFyV3rXB y+KuFCZkLOgHtXQvyDJql3/W1YJiFKfBX4GJ7YMQMmPTxcJQk+arNrNNl8k48zt4WkWc dxjSCQZMdXhKyOBP1YDJhvfiUwFTrOXvjkFHDojdqd30wAWMZh+Iv8JyHm09A9ZBcL0w FM2g== 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=4zQ2Ecsff57oPNK/oQrXQHYveS2kALMPGI+zghtR8Pw=; b=i7uQamZZsaQPqYCiT11wGlpgFObqFcWhIiw1955v/XEG/PGfayCt4xhBy8i4ABWNjc fcES1JR2O3GWguN63DQBAlfoOgCYdqFs0YcwwiHf8Mit4QYn1i475nlqnnW+vOXNvz61 nM7lC5ercronE4NCAzDLc6pXkqAQDSCG2eKuClbd8kSmw+IMUx2Ty1vX9c2ZIBPQ96nf UO+mbJzGb2BX0w8nvfH8dtsvUKpox6rhz8asOOM3YJ9rGsTw5kQ8ILLXlv2JDeit65Mq ZNm709Gfk8VrpmAbbIoQc8JYrjg5WfFnMPzqJfDguGgGlzdDNrju64Q5ok9++rgVBv1M Eduw== X-Gm-Message-State: APt69E3hqYLj1CvWGg29x2u4/NTTs9PnYHup76aVnRhoAIS7j89b+8ES DjqAweCIDqkVSka7pNMYmoIQxQ== X-Google-Smtp-Source: ADUXVKK5D/ENQktU4dDz70Z1/i+qAGe85q9+vWCApdlx+dylR6iWTTiBf9QNwwsaIbE9urwCfIwHJw== X-Received: by 2002:a1c:4203:: with SMTP id p3-v6mr1473002wma.111.1529940598679; Mon, 25 Jun 2018 08:29:58 -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.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 08:29:58 -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 8/9] ARM: davinci: mityomapl138: use aemif platform driver Date: Mon, 25 Jun 2018 17:29:19 +0200 Message-Id: <20180625152920.11549-9-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-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 mityomapl138. Signed-off-by: Bartosz Golaszewski --- arch/arm/mach-davinci/board-mityomapl138.c | 55 ++++++++++++++++------ 1 file changed, 41 insertions(+), 14 deletions(-) diff --git a/arch/arm/mach-davinci/board-mityomapl138.c b/arch/arm/mach-davinci/board-mityomapl138.c index 2cce0d7d2f2a..b0fdea355d96 100644 --- a/arch/arm/mach-davinci/board-mityomapl138.c +++ b/arch/arm/mach-davinci/board-mityomapl138.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -422,27 +423,53 @@ static struct resource mityomapl138_nandflash_resource[] = { }, }; -static struct platform_device mityomapl138_nandflash_device = { - .name = "davinci_nand", - .id = 1, - .dev = { - .platform_data = &mityomapl138_nandflash_data, +static struct platform_device mityomapl138_aemif_devices[] = { + { + .name = "davinci_nand", + .id = 1, + .dev = { + .platform_data = &mityomapl138_nandflash_data, + }, + .num_resources = ARRAY_SIZE(mityomapl138_nandflash_resource), + .resource = mityomapl138_nandflash_resource, }, - .num_resources = ARRAY_SIZE(mityomapl138_nandflash_resource), - .resource = mityomapl138_nandflash_resource, }; -static struct platform_device *mityomapl138_devices[] __initdata = { - &mityomapl138_nandflash_device, +static struct resource mityomapl138_aemif_resources[] = { + { + .start = DA8XX_AEMIF_CTL_BASE, + .end = DA8XX_AEMIF_CTL_BASE + SZ_32K - 1, + .flags = IORESOURCE_MEM, + }, +}; + +static struct aemif_abus_data mityomapl138_aemif_abus_data[] = { + { + .cs = 1, + }, +}; + +static struct aemif_platform_data mityomapl138_aemif_pdata = { + .abus_data = mityomapl138_aemif_abus_data, + .num_abus_data = ARRAY_SIZE(mityomapl138_aemif_abus_data), + .sub_devices = mityomapl138_aemif_devices, + .num_sub_devices = ARRAY_SIZE(mityomapl138_aemif_devices), +}; + +static struct platform_device mityomapl138_aemif_device = { + .name = "ti-aemif", + .dev = { + .platform_data = &mityomapl138_aemif_pdata, + }, + .resource = mityomapl138_aemif_resources, + .num_resources = ARRAY_SIZE(mityomapl138_aemif_resources), + .id = -1, }; static void __init mityomapl138_setup_nand(void) { - platform_add_devices(mityomapl138_devices, - ARRAY_SIZE(mityomapl138_devices)); - - if (davinci_aemif_setup(&mityomapl138_nandflash_device)) - pr_warn("%s: Cannot configure AEMIF\n", __func__); + if (platform_device_register(&mityomapl138_aemif_device)) + pr_warn("%s: Cannot register AEMIF device\n", __func__); } static const short mityomap_mii_pins[] = {