From patchwork Thu Jun 28 09:57:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10493425 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 0184160230 for ; Thu, 28 Jun 2018 09:58:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E1155298FB for ; Thu, 28 Jun 2018 09:58:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D53102990A; Thu, 28 Jun 2018 09:58:51 +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 7F8B1298FB for ; Thu, 28 Jun 2018 09:58:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935231AbeF1J6O (ORCPT ); Thu, 28 Jun 2018 05:58:14 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:39640 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965102AbeF1J6K (ORCPT ); Thu, 28 Jun 2018 05:58:10 -0400 Received: by mail-wr0-f193.google.com with SMTP id b8-v6so4854207wro.6 for ; Thu, 28 Jun 2018 02:58:09 -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=Ukr4xMMA1fWmLhVPb8CFuGK9UhEbpxrgzz1XtCRg21Jh7pzh0A1+c6Y2JNWA1DegZw FNVioYGy9cHJk00Ov55/DjZHSrfMPgIKmdW/1/gA2jirPRNhSJ33AbDCI8C6rRlWt84I A2Rvy3ISbZqev9tKO6uOvuYsf+9CUn9P0QMCvnyf6gHh+4SjyqmoiEMaHCsTK6iV+QNr VZITRYjcolVLufsWcCZ5pFoWV2+MvIyk2WjFptSlZnjtzleT+86gHaqMN+M1AKa4mSqK qEeyesJ37v4Sfp8osm3LLJ3QrCdTVRS3V9Jrq01Gfiv+FF/NISsYNN2VusSaYeRWgcoP rjIQ== 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=kd0DpwDD2M7+qfeLu+m00qFlq3D3cCk3AOuqKKcMsgAmORpJE0LnUmd8L3royuhrzc OgRZuMNggEPtqsckeJ+DIDeaZVHLUKI6o/WYC9hLK9cwYqxed1VtubJLVyViCMRXP0+A 12cOpyBiwf0z0FZjP+K0DQ0xTAaI00vS7wFpKDokpQtOSglLRhS+fcq1aV+oWcxr0G7i f5ukRr/KwIJsklPc6cVSC6YADK8pFoeUvxOMYGzEi7XUDCavwX6ugfu/pxUkPwLygtRQ DpoQ6rA8QeRivWedZIr8xGdGeHTkJsI43YzhqL9pklUXYkAYMDHmPOxxvYtye+hF9e99 r58A== X-Gm-Message-State: APt69E12qgMhn4A74j5cNyoCuMBwV3XPuv07rNC1ZexckLidAPuLlj9f 4TrxHRbqYQ3lT5OLyZ56w8u9Qw== X-Google-Smtp-Source: AAOMgpcDAw3vivwVxrk4i2AOASNKGtNzQawZB6oQaLW4mC1BElGDvn6cGzzPhfi957Jkc8mA8DSzPQ== X-Received: by 2002:adf:8286:: with SMTP id 6-v6mr8009859wrc.175.1530179888901; Thu, 28 Jun 2018 02:58:08 -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.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jun 2018 02:58:08 -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 12/13] ARM: davinci: mityomapl138: use aemif platform driver Date: Thu, 28 Jun 2018 11:57:47 +0200 Message-Id: <20180628095748.4462-13-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 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[] = {