Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp7489413imm; Thu, 28 Jun 2018 04:47:40 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeDqxcDe9qGyBYnB9IpoTUo/tHoIRvY4Ol4mvwvqDgZo5wWKPpW7EfNuyeKRTaV+qyfJJ6e X-Received: by 2002:a62:5d18:: with SMTP id r24-v6mr8184446pfb.87.1530186460827; Thu, 28 Jun 2018 04:47:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530186460; cv=none; d=google.com; s=arc-20160816; b=FoEMmFFHar+5TyPidAgAfpssnS84jZ4ODlv2noxhgTMpazjMTuxkyVQoEDU29ROOO9 jIFcNRVhkwghbmyD2Dc+621zBASMHbih/x+QkU/0Qh5gQSwn8t6RVy3GIwejBDeT/WKN sw0SrAhlDPTGruVABz9ME6DqvCFbklj4WVo4rXnwGRGqjGanzvzzgTkxVKqKSmVAQEfy YJsa8HLh/pnmXl/RdBT1+nvx1f8FoAExFmbWWUMJaIxdONxARBhL+Y+vefB8mwaR3hMa pqxPmusRMf5AIKmC5GV8kgYTI7M6oCI2oKMThHMeLm67pZhlUGTeFj2gFhy3wS8gcP6N M/7w== 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=MJvgkDiHW4gPWvPNjt08VsbgJnWIDweim6LTyj60Vb4=; b=YRIxmoB7fBY/u4oU2qK/ORpFJxvP4L3MR7K8ny0KO1u6F4imQjQCxzHdEfTYG6WnIg iEM1aX/gTtzwZySi1VlAyiVPHkDkWmf1tN0ccSsQgbVf2q5XOqRWOwZ3DTtHpZiuLs5n 0omN7fcnQynTZ3SxTxiteA0QQgeHFSXru3MO81BQ1gmK6XCirOoojT2PAR/1m3nxT7zi Zh/D3jrsattC/1qI6Jp5YjUYyYb4awtNnxDZF6AMBZDW7YDGsI0kRNNG9faVDQHGz9lg sLr/V2WO0T3ZUpuvrR0cvU5kefHSQgj2WhAizUAbISPRGHdnyXgv0JSorTefD9Bi8jEh ovvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=dg74wn+N; 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 w17-v6si6731782pfl.215.2018.06.28.04.47.23; Thu, 28 Jun 2018 04:47:40 -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=dg74wn+N; 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 S935295AbeF1J6y (ORCPT + 99 others); Thu, 28 Jun 2018 05:58:54 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:37115 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935264AbeF1J6I (ORCPT ); Thu, 28 Jun 2018 05:58:08 -0400 Received: by mail-wm0-f67.google.com with SMTP id n17-v6so7836030wmh.2 for ; Thu, 28 Jun 2018 02:58:08 -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=MJvgkDiHW4gPWvPNjt08VsbgJnWIDweim6LTyj60Vb4=; b=dg74wn+NYJwlK0qg6jZc6uAt8PlAUshd0nWRa82aP4wfk/Erb6D7ABaPlGmO/+U44U QCBoZQOZSxfvIVQCyOIQZcivCFsqFDW3s3gpM+7Xux6hLBO09z8NdeEse+D3OFoWT3FZ Sxz+Fm1x1cdnJ5wL82x7zFLwXszDkrW9HW2a+lU3GAHPy4/+Wye6LM/JNGYTQUSIysXQ 5dTqMjcTYqJblgfDFhHo7qxXLb5MgznHX6EixTIyNMpa81z50FcIOuSQRIjdSDIVX3z2 KITHLNor6QJjMNNw7iea4uFvsfr4GcKjeVI9eJ90GXTEXNwgaAkmbmLi+Xg37w63OimF uhIw== 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=MJvgkDiHW4gPWvPNjt08VsbgJnWIDweim6LTyj60Vb4=; b=fprLrBGfkJ8KVPidbLw3FTGd5+ep6lNPGV/c0yTpgdt7JYx6TTt5kts9MD9NPFSdXf KE70relyJ6O7F1Rxy/VHlfn3tm5Rd0YfimhlCly2/9E7HB3sVHDUNqx5YAwBwvnRZv+c TWLfeUAVb4bV08NB0ChShEUnTlSyEgjguB/2Fa79+M8T0X20wFhk2pyaE0mkjgeUV9bG OuLFQNHzWXWiOi3+x6OzhFtr+2kFHDOWA/wEXp8MbbcAikOOaOe7L4ywddj9fuk/oNC3 ri+RfSTqBTnUkGTyAxvHSjvh1ptfVS+nW1TMXcGcHVZ7Sv+B9ZKTnzXg0BhEmElGSmSJ ZIuA== X-Gm-Message-State: APt69E2I4kb+Ef1EnuxueLXiUqbz5I71z00SrkxSIcHEDM0tNX/w+ChC s/w+Ys0P2k5QZP4v9b2isZXumw== X-Received: by 2002:a1c:8893:: with SMTP id k141-v6mr7697396wmd.133.1530179887651; Thu, 28 Jun 2018 02:58:07 -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.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jun 2018 02:58:07 -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 11/13] ARM: davinci: dm646x-evm: use aemif platform driver Date: Thu, 28 Jun 2018 11:57:46 +0200 Message-Id: <20180628095748.4462-12-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-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 dm646x-evm. Signed-off-by: Bartosz Golaszewski --- arch/arm/mach-davinci/board-dm646x-evm.c | 52 +++++++++++++++++++----- 1 file changed, 41 insertions(+), 11 deletions(-) diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c index 867ab2fa6cfd..3e5ee09ee717 100644 --- a/arch/arm/mach-davinci/board-dm646x-evm.c +++ b/arch/arm/mach-davinci/board-dm646x-evm.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -106,16 +107,47 @@ static struct resource davinci_nand_resources[] = { }, }; -static struct platform_device davinci_nand_device = { - .name = "davinci_nand", - .id = 0, +static struct platform_device davinci_aemif_devices[] = { + { + .name = "davinci_nand", + .id = 0, + .num_resources = ARRAY_SIZE(davinci_nand_resources), + .resource = davinci_nand_resources, + .dev = { + .platform_data = &davinci_nand_data, + }, + }, +}; + +static struct resource davinci_aemif_resources[] = { + { + .start = DM646X_ASYNC_EMIF_CONTROL_BASE, + .end = DM646X_ASYNC_EMIF_CONTROL_BASE + SZ_4K - 1, + .flags = IORESOURCE_MEM, + }, +}; - .num_resources = ARRAY_SIZE(davinci_nand_resources), - .resource = davinci_nand_resources, +static struct aemif_abus_data davinci_aemif_abus_data[] = { + { + .cs = 1, + }, +}; - .dev = { - .platform_data = &davinci_nand_data, +static struct aemif_platform_data davinci_aemif_pdata = { + .abus_data = davinci_aemif_abus_data, + .num_abus_data = ARRAY_SIZE(davinci_aemif_abus_data), + .sub_devices = davinci_aemif_devices, + .num_sub_devices = ARRAY_SIZE(davinci_aemif_devices), +}; + +static struct platform_device davinci_aemif_device = { + .name = "ti-aemif", + .id = -1, + .dev = { + .platform_data = &davinci_aemif_pdata, }, + .resource = davinci_aemif_resources, + .num_resources = ARRAY_SIZE(davinci_aemif_resources), }; #define HAS_ATA (IS_ENABLED(CONFIG_BLK_DEV_PALMCHIP_BK3710) || \ @@ -793,10 +825,8 @@ static __init void evm_init(void) if (machine_is_davinci_dm6467tevm()) davinci_nand_data.timing = &dm6467tevm_nandflash_timing; - platform_device_register(&davinci_nand_device); - - if (davinci_aemif_setup(&davinci_nand_device)) - pr_warn("%s: Cannot configure AEMIF.\n", __func__); + if (platform_device_register(&davinci_aemif_device)) + pr_warn("%s: Cannot register AEMIF device.\n", __func__); dm646x_init_edma(dm646x_edma_rsv); -- 2.17.1