From patchwork Tue Jun 26 09:25:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10488445 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 C34EA602D8 for ; Tue, 26 Jun 2018 09:26:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C0F9428857 for ; Tue, 26 Jun 2018 09:26:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B5C5A2886E; Tue, 26 Jun 2018 09:26:26 +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=ham 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 5777728857 for ; Tue, 26 Jun 2018 09:26:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933998AbeFZJ0Z (ORCPT ); Tue, 26 Jun 2018 05:26:25 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:52559 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934035AbeFZJZ4 (ORCPT ); Tue, 26 Jun 2018 05:25:56 -0400 Received: by mail-wm0-f67.google.com with SMTP id p126-v6so1053324wmb.2 for ; Tue, 26 Jun 2018 02:25:55 -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=xn0TQaIyLWB0HDP/8rvd9dfNDRKBIZ2xXAWWSdTqIuQ=; b=Mg/GUTML7xgHHaFwRyjTiq+9FxusLfdhUJSUavvhg/SiD0DoAAxZL4w1SN3RVfsS49 y79kb4zGgQvgF0mfHpI51mVDkxJ4Em9HN96M5OfWw1l086YyW/tdyGbRQepFb4BRKtqp YOXgp7m1YriQUKhyMUn1baIh/9vjfJ7S6Wbrp/90faebhRFR9nt3n0HZkOzlD1TuRXdC 6491Pf5PhEj0h/GJJ6iV2RmWc1WbtfT1Kqtw8UeT8gdaOYRTfT/LWB0DlAFPSz1UJyrY 6wrSVfAMiQZLa0ezzKGnD5O06yELhcRq3mDqbjnEp/xC6mTS3vJYX184hqyVeGfqkvoZ 372w== 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=xn0TQaIyLWB0HDP/8rvd9dfNDRKBIZ2xXAWWSdTqIuQ=; b=WYIHGGBpj6wVaVEgcnzvhszRben2T9N3klAVcLfmZPBgKjiicqBCfXmYz0JWjiwo2l XdvIe74hFhzxt+Bj1XzlaAdK3rzWvQcb+cAAtLYeL2Q+V+NFe4wGwvxlECtoKNQofw5s Xeubui00S61unywGfUXlF7dKKb5/3BnX9c3t4WK0N2wC4H9p2NP6pxGDz2sYvxnURrud 3tN1DERHCrCjTUuhkUf6wRcRY77a92b9fXdLWiaMik8ednG6kamH7ayksNXBsasiNUDc 7DK21rdm/dZ58yNF0HxoJT5geBLaUrTr6tj5Tj6Q2kC+VFovnYKkRmJvoVb+656sdbDL LjdA== X-Gm-Message-State: APt69E0aPjyQB4DdjiVmYBTbK6HmDgUUnDwWU2RBkIbqgNSiaquawhET gavvHWxqfcpYDjapKiVIqi+PoA== X-Google-Smtp-Source: AAOMgpeG4WHS4olZin+XJTfje4iWXAQnfalfDxbpc/LbzpMjKpwMeYjeN3OZGNJPpxBnrzkq8dyxeg== X-Received: by 2002:a1c:d9d0:: with SMTP id q199-v6mr1000719wmg.78.1530005155070; Tue, 26 Jun 2018 02:25:55 -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.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Jun 2018 02:25:54 -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 12/13] ARM: davinci: mityomapl138: use aemif platform driver Date: Tue, 26 Jun 2018 11:25:36 +0200 Message-Id: <20180626092537.6737-13-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 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..2933e0c87cfa 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", + .id = -1, + .dev = { + .platform_data = &mityomapl138_aemif_pdata, + }, + .resource = mityomapl138_aemif_resources, + .num_resources = ARRAY_SIZE(mityomapl138_aemif_resources), }; 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[] = {