From patchwork Mon Jun 25 15:29:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10486801 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 6A02F6023A for ; Mon, 25 Jun 2018 15:42:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 52A64285A5 for ; Mon, 25 Jun 2018 15:42:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 467CF285C3; Mon, 25 Jun 2018 15:42:43 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 488C6285A5 for ; Mon, 25 Jun 2018 15:42:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=RjHpOyv7eBgOvgR1AmkwEVJWhbbxEIUqLf/WSHAh8Kk=; b=j/cM05UjOsfKP6q+FQweQ1Uzg1 IPhLSYIImMZFhlu8hLIjV6EBWESwrtgk5X7dWDWjplWteMT65VbXgmKO/nYUESedawPFbTCBJzqJ2 9gRM3OL2B9ljf6KLplHM3gXEYowB0ni89NNssa2w6995L0cnv18TE2GaUZy6XwLtEZirKNse05fY9 zaD3VZXh5wcR5inmf0GUFswjjgUVxno55m5VZH3Cvdn518HDzj/3nNemQOumLS9gVQ5xDik15zSHb XS4gGnThW+HuG2SQKKr4LqlXJDI4+8PIeqkDArX2MuSpVVsQhhWooMB80f94v/FQNhdYVlmjvB3L4 Crx1MVug==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fXTdN-0002NF-1D; Mon, 25 Jun 2018 15:42:29 +0000 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fXTRM-0008FM-SO for linux-arm-kernel@lists.infradead.org; Mon, 25 Jun 2018 15:30:17 +0000 Received: by mail-wm0-x244.google.com with SMTP id p11-v6so10475955wmc.4 for ; Mon, 25 Jun 2018 08:29:56 -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=WiqV9M76Gh7uIiyGVv/zVGJ/wBPqBjAK4YHV4jg0FP4=; b=M3kqkFCSe6bRY/PbE20zNLP/1xem3I5D+YfzQShygp9W1urnnmrH7V+VudIzwNHvaN 8TZRNM6BesGBKYECkmGq8ctjeIQspnDFmalHE6sk7oUu4gS6wjVB5XaH+nRmBI6OCdKZ NL9QjtmHXsUHjGaVo2iOB5tcamErzT4Xb70aAGJG0VwBxouzYdCDuuzybvsqFSff8cWT ezMRqFL2jdRKkq1Ey0e5rd5xGIwWx8ACBhfrIR6smx+CYIeVJFxarxufRdVlBfryglnC Qqwq6bZGt8JN9d8AWn7rLxci4rDpACjvgjldFHPNnosquaY1HYfppuVdPCINAjsQ760k xR9g== 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=WiqV9M76Gh7uIiyGVv/zVGJ/wBPqBjAK4YHV4jg0FP4=; b=uCcwHBimJJ3HfFSgt5yFAoji9PL/7Bwl6Fyy14VvVubt3X/ENMSo+7jhC8ow0tQA77 wlEqcGwT3D+EL9q8hiTLOOKrTcSHca7VwotrhZGamjLWFpTJp29nW3udhQ/9vecVnxiO xsiJc2VGp+4GQ+Tt492ZNFKlX2y4FiK81AQAuuwN5s1EeILgqA+JH+uK8+qonhraG9Nb 47V/nXxw9YlAvcvgy3v/NgKlIMQ9CWJqqkWOQ9qawRaoxIFsP+NDndfRxsJU+vBsLrRf cCuka6edarXkjLMjNN8zb0d/g4yM34/nGUEq7ILX7v0lOyuNQF7UjZgRPN0BVhKHPrFm L/oQ== X-Gm-Message-State: APt69E04JYMz74Q8g04YECuk9IEfHB+KjH5ECOkWUn1MxvxMp4Tix1x4 +cHuWGQUE8KjU1EmDfo87g2SEg== X-Google-Smtp-Source: ADUXVKL3qVB6a1Dqug/OpVB2233TbYImjl/hMRcczbiqDb171Xs3pXfnddcUT+1UosE8qg48Ya1BKw== X-Received: by 2002:a1c:b80a:: with SMTP id i10-v6mr1442182wmf.123.1529940595526; Mon, 25 Jun 2018 08:29:55 -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.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 08:29:54 -0700 (PDT) From: Bartosz Golaszewski To: Sekhar Nori , Kevin Hilman , Russell King , David Lechner , Michael Turquette , Stephen Boyd Subject: [PATCH 5/9] ARM: davinci: dm644x-evm: use aemif platform driver Date: Mon, 25 Jun 2018 17:29:16 +0200 Message-Id: <20180625152920.11549-6-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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180625_083004_977168_617E39C2 X-CRM114-Status: GOOD ( 15.25 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bartosz Golaszewski , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 dm644x-evm. Signed-off-by: Bartosz Golaszewski --- arch/arm/mach-davinci/board-dm644x-evm.c | 55 ++++++++++++++++++------ 1 file changed, 42 insertions(+), 13 deletions(-) diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c index 738e443ab15f..e3556708c71b 100644 --- a/arch/arm/mach-davinci/board-dm644x-evm.c +++ b/arch/arm/mach-davinci/board-dm644x-evm.c @@ -42,6 +42,7 @@ #include #include #include +#include #include "davinci.h" @@ -174,14 +175,47 @@ static struct resource davinci_evm_nandflash_resource[] = { }, }; -static struct platform_device davinci_evm_nandflash_device = { - .name = "davinci_nand", - .id = 0, - .dev = { - .platform_data = &davinci_evm_nandflash_data, +static struct resource davinci_evm_aemif_resource[] = { + { + .start = DM644X_ASYNC_EMIF_CONTROL_BASE, + .end = DM644X_ASYNC_EMIF_CONTROL_BASE + SZ_4K - 1, + .flags = IORESOURCE_MEM, }, - .num_resources = ARRAY_SIZE(davinci_evm_nandflash_resource), - .resource = davinci_evm_nandflash_resource, +}; + +static struct aemif_abus_data davinci_evm_aemif_abus_data[] = { + { + .cs = 1, + }, +}; + +static struct platform_device davinci_evm_nandflash_devices[] = { + { + .name = "davinci_nand", + .id = 0, + .dev = { + .platform_data = &davinci_evm_nandflash_data, + }, + .num_resources = ARRAY_SIZE(davinci_evm_nandflash_resource), + .resource = davinci_evm_nandflash_resource, + }, +}; + +static struct aemif_platform_data davinci_evm_aemif_pdata = { + .abus_data = davinci_evm_aemif_abus_data, + .num_abus_data = ARRAY_SIZE(davinci_evm_aemif_abus_data), + .sub_devices = davinci_evm_nandflash_devices, + .num_sub_devices = ARRAY_SIZE(davinci_evm_nandflash_devices), +}; + +static struct platform_device davinci_evm_aemif_device = { + .name = "ti-aemif", + .dev = { + .platform_data = &davinci_evm_aemif_pdata, + }, + .resource = davinci_evm_aemif_resource, + .num_resources = ARRAY_SIZE(davinci_evm_aemif_resource), + .id = -1, }; static u64 davinci_fb_dma_mask = DMA_BIT_MASK(32); @@ -795,12 +829,7 @@ static __init void davinci_evm_init(void) /* only one device will be jumpered and detected */ if (HAS_NAND) { - platform_device_register(&davinci_evm_nandflash_device); - - if (davinci_aemif_setup(&davinci_evm_nandflash_device)) - pr_warn("%s: Cannot configure AEMIF\n", - __func__); - + platform_device_register(&davinci_evm_aemif_device); #ifdef CONFIG_I2C evm_leds[7].default_trigger = "nand-disk"; #endif