Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp4028234imm; Mon, 25 Jun 2018 08:33:16 -0700 (PDT) X-Google-Smtp-Source: ADUXVKI3m+N2426LdcaGatyzq7sgSF1y2BhbxiH8B0tReQHya54qwZPc9AQ43acyvuMs7gV38bQk X-Received: by 2002:a63:541:: with SMTP id 62-v6mr7895492pgf.368.1529940796091; Mon, 25 Jun 2018 08:33:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529940796; cv=none; d=google.com; s=arc-20160816; b=KEZNKmNbaBiWJfUT7ldWO01VF/2PIqM1X8+opDPGPcffV7eN34/dEw/cZCz4eeX6jr 2sHk4Oksa13USFYIdXtmysvZNOugMQLnXm9tv5m208KV+BtgFLrE2460xDHcqCupSz6j Ggx5sBEivNrYAnb+dJpCwBktOqkYtZ37LTCUsheWfiznEZ37LVWRm+j8lLoBqaGobLJm UZGA/TjV5e6mHTecga77hWXB1AP9fjxaseD7+4CULDapuNKo4LpeEsbVgWLWnQZoE0Uf 8U0fX5D5odAkGa5VFizMJ63mc0Z98NgTI2evm4dBtjoTORYoANCAcRfxWgi3J/84kkFA jEGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=4zQ2Ecsff57oPNK/oQrXQHYveS2kALMPGI+zghtR8Pw=; b=X9I7kZ5hEIJ+OgRw2p+CttD3icbia4fotY57JNthVQV+jdG++J3o4iCdHIsKuS6Ie6 ENNyppTtZwVsf7My6px98Ux6ctZJThMWNCloCkvBcgDf1Xqrujj5xjUOrysIarD2fol1 EM7SzKAtvscK3d9rt5RqH/hAyWZnHR0V7HNEtZhQreY5dhTAUFjoAAi1PO/nFS8pGKuZ 396K0rOmKoK3fELvheSwauH928Wwrn8BqiJv464J0ChyGurCPDkPtau6UcTxW3ff2QrE WxbU/tUpH6TuGGw/r4XhQj7yXFviV293pjDTP3QAUgLJoRPu2HCpvhJFjNvedjZJMtrL aF+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=zUmgjcRZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c18-v6si13474633pfn.245.2018.06.25.08.33.01; Mon, 25 Jun 2018 08:33:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=zUmgjcRZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934772AbeFYPbA (ORCPT + 99 others); Mon, 25 Jun 2018 11:31:00 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:32976 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752327AbeFYP37 (ORCPT ); Mon, 25 Jun 2018 11:29:59 -0400 Received: by mail-wm0-f65.google.com with SMTP id z6-v6so12844540wma.0 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=JKkFQaGOEFh7udZ9TRXwy2Sg4KsvQorwfATKqMoa/V0Eqm2KDVoxIOBQYlrpqjhUjl 969/0eMS61rWeUn4G5tFyetPYAr4MIwtdqZ0jsTK0KN3kQYU29dcZVNqm7SsMdQxMVXa 6ho4r8YZGPAhpzy3bduv8HzXwfHEBFVZ/1FigKtJ+W4N/GMMpCx1ByHAw77M2HodFgBk FrdzBz3Lfc5PbZNZu7q1UomAklA3yUCIK2MSfgQy9dXxtLrc7Au/wsY2z1GMh9oWCGF3 X1REVSnKk6HV5sjCTwNH8Iix+QH+s++pZTdBpBN7BjYn8lB4irlpizK3edTGRB37Kg9u RTiw== X-Gm-Message-State: APt69E2JEDmrZ0Bji4pQtFes2Vvv2U4WhhWLSUxrYCy0yadbQhac4WOa CZzD61MA3A0a8S9uRg5BAVSB+A== 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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[] = { -- 2.17.1