Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp7722360imm; Thu, 28 Jun 2018 08:20:37 -0700 (PDT) X-Google-Smtp-Source: ADUXVKI0fOafbL0j+5Rf+HMRkwBuHfTQcYzB1x0SQJo57eXQR3+IWPmyWKt90mJnRzwpkeGhdoWc X-Received: by 2002:a17:902:7d82:: with SMTP id a2-v6mr10939671plm.202.1530199237930; Thu, 28 Jun 2018 08:20:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530199237; cv=none; d=google.com; s=arc-20160816; b=W3y2Z+GozmY6/rif5TbOjwmgvtOSpzKlA4wuTDq7B+/ub57fhCzV7XD742NOTITDG7 o7pjP7wg+ToL+xLhbf9u5DCFL0YmjE3Im0MDl2ce/n2WUrItPOCGF/cvVTUhMitnfPFf tt2Dg/9egyJKtw5cTE+dfuoIvoxS2MMdqfQinKQAttNIULTxI3NGFm7HKf3kMkGfy8qu D7G7trSgmAmVJ9HFj47kL05SGhbx16qcjdFhPgGS/CmNtuUzVIML+iAiSkjyfZktKGMN lOAV3jr+ly6WOejvh8yx6gF1hGSwJXe46CzBqf/kWnsub1T4IdbdFhRufkPKYOtDpgYC VIKQ== 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=aAipzPKBO632NJ0duDUioMPfNkzJ+t1E0zp4HTn+o8Y=; b=OmlyQc9Y6jEMhlpTZRSTe0YEp+LmDBkqurSJ3VydJmpmze0zxrTVZGLxotebEmj8hj vz8/Pbo2N+a8tZVsDddcLshOguKKnHCvRPdM6DnP0axv5VXsH8CutsZsKHlBwBX6SjBP piak6sD/XQffgkLeC4Ozy6OMxnZ3tLrUM6yT6mcbZQLqCO+riLUX/oR+7WJSY7BX/b3u bS/w4eFDRbDeSaxDlZDEk3DEofgDHYWx3cETWaxB08Nq+fN1o9Stty6c7OTLCh085thU ZGYT/C1woexwJZ7TpRrmAiUFJMidbfMiNklMiqDttqc/9Qso2YOBbWV1QPo+UZ73WSp8 m9iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=ifGrXA2V; 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 g18-v6si3558813pgd.137.2018.06.28.08.20.22; Thu, 28 Jun 2018 08:20:37 -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=ifGrXA2V; 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 S964940AbeF1J6J (ORCPT + 99 others); Thu, 28 Jun 2018 05:58:09 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:37105 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935231AbeF1J6F (ORCPT ); Thu, 28 Jun 2018 05:58:05 -0400 Received: by mail-wm0-f68.google.com with SMTP id n17-v6so7835808wmh.2 for ; Thu, 28 Jun 2018 02:58:05 -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=aAipzPKBO632NJ0duDUioMPfNkzJ+t1E0zp4HTn+o8Y=; b=ifGrXA2VbYFKNEGe9Zni0sDlRRi/MDSdUNmrYuAS0ArB9oUXHBLBDDy87o+UgcpBRt f8QLJZ0ii9lDvmA+KCUPNs1i6gMevRqOYHiVPZsEy9EQV6I8lBTBaC2Vh+KhAwFCFgkQ +FxcYPmn6dAdUsw9ERFQCp0IuzWyafMWxfjq0yR6iQ3Fhi4bFoQI5PFC7I33QKQ2qxhx MkIRClIiFeHiInkpv0Qqq2M3m5ETfVUWjoZvOppGxnweO57/PWwlY+PLCVapLT9rfS5A q723sgLYkTFzdCUtDpC+Lg1blg22kVwAHYEGo8e0OSihCWhcna1UrFuxYnrY/2uaHqRB K/4g== 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=aAipzPKBO632NJ0duDUioMPfNkzJ+t1E0zp4HTn+o8Y=; b=sMMZrjXhyQG4WyS9qTa+pxKqDOeSC0ftNToIk++EyLY6ZqUQotXnRkitqtIbMx0ymz jFRnRTAc2lmnaSWkXYhdVy82TMx9kmVMOkOCB9qV4ukOhAYwXnHNIXUQlG4np5bS1xUj bGzFVa1r9nDwumiIKVfILZfN28e0rWxbetZHbiarq5v6dyYxDY0c5alw8ubdZWu24siX ba+59tz7eS5PoaZ2vrYadwPYWiH9GkZlhaP94eb57wFfGUJBtri16aWU29YPCejH6PnN hWukfkCEG4MULEnSknnPoQ8hpsEm+o+cuEoreDZrwX8z6vddlUMgE0GCOA6WkIkqdCx8 8nhQ== X-Gm-Message-State: APt69E2Jl8Dha1ggrMPnxLp56k5qhkzgS0CW66cvtBcrrvc/3aubXcC4 Si6bT+cmaPCSav6IEas5yJyRZA== X-Received: by 2002:a1c:a88a:: with SMTP id r132-v6mr6089606wme.31.1530179884469; Thu, 28 Jun 2018 02:58:04 -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.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jun 2018 02:58:03 -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 08/13] ARM: davinci: dm365-evm: use the ti-aemif soc driver Date: Thu, 28 Jun 2018 11:57:43 +0200 Message-Id: <20180628095748.4462-9-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 dm365-evm. Signed-off-by: Bartosz Golaszewski --- arch/arm/mach-davinci/board-dm365-evm.c | 59 +++++++++++++++++++------ 1 file changed, 46 insertions(+), 13 deletions(-) diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c index 307e88d99dd3..8143756ff38b 100644 --- a/arch/arm/mach-davinci/board-dm365-evm.c +++ b/arch/arm/mach-davinci/board-dm365-evm.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -159,14 +160,47 @@ static struct resource davinci_nand_resources[] = { }, }; -static struct platform_device davinci_nand_device = { - .name = "davinci_nand", - .id = 0, - .num_resources = ARRAY_SIZE(davinci_nand_resources), - .resource = davinci_nand_resources, - .dev = { - .platform_data = &davinci_nand_data, +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 = DM365_ASYNC_EMIF_CONTROL_BASE, + .end = DM365_ASYNC_EMIF_CONTROL_BASE + SZ_4K - 1, + .flags = IORESOURCE_MEM, + }, +}; + +static struct aemif_abus_data da850_evm_aemif_abus_data[] = { + { + .cs = 1, + }, +}; + +static struct aemif_platform_data davinci_aemif_pdata = { + .abus_data = da850_evm_aemif_abus_data, + .num_abus_data = ARRAY_SIZE(da850_evm_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), }; static struct at24_platform_data eeprom_info = { @@ -537,10 +571,6 @@ static void __init evm_init_i2c(void) i2c_register_board_info(1, i2c_info, ARRAY_SIZE(i2c_info)); } -static struct platform_device *dm365_evm_nand_devices[] __initdata = { - &davinci_nand_device, -}; - static inline int have_leds(void) { #ifdef CONFIG_LEDS_CLASS @@ -628,6 +658,7 @@ static void __init evm_init_cpld(void) u8 mux, resets; const char *label; struct clk *aemif_clk; + int rc; /* Make sure we can configure the CPLD through CS1. Then * leave it on for later access to MMC and LED registers. @@ -660,8 +691,10 @@ static void __init evm_init_cpld(void) /* external keypad mux */ mux |= BIT(7); - platform_add_devices(dm365_evm_nand_devices, - ARRAY_SIZE(dm365_evm_nand_devices)); + rc = platform_device_register(&davinci_aemif_device); + if (rc) + pr_warn("%s(): error registering the aemif device: %d\n", + __func__, rc); } else { /* no OneNAND support yet */ } -- 2.17.1