From patchwork Thu Jun 28 09:57:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10493431 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 A5EE860230 for ; Thu, 28 Jun 2018 09:59:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9020C298FB for ; Thu, 28 Jun 2018 09:59:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8354B2990A; Thu, 28 Jun 2018 09:59:12 +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 289E6298FB for ; Thu, 28 Jun 2018 09:59:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935265AbeF1J6I (ORCPT ); Thu, 28 Jun 2018 05:58:08 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:40744 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935232AbeF1J6F (ORCPT ); Thu, 28 Jun 2018 05:58:05 -0400 Received: by mail-wm0-f68.google.com with SMTP id z13-v6so8365068wma.5 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=TppehOE4GpHOPfTQNwyLKzRJWBbfZjCYxCDI4BV5cCUWJ4wj9AP9rd5zUHSP5iCCee BV0uBxpWwKAb28gEawnO8KJP70zDFTBGq4wJuntqUxu6UNcP/zpVT4u1O4iuGd1wNBmf gpMaXqvSPm1rk1mtM8Jc3xGpaqPSss1WUX4S2hdXg4bKJVRGx0lbsqCjwub8M2GuPwxt vqWb3pys/7wPivO/Jd4alEsQKPS+1NdGQzS5cAGZTLTrpMfXaPI0Y7bv+ldR0wOaUFId H+AqR14HFbSLfp8NWs9GMAtuBFF5pEcsfnzI1oXuwuWH1UPkKeF7GY6jXleiTJnv0PY6 ZkCA== X-Gm-Message-State: APt69E3a30QU+VKrMEG+RL328dDWcOYRHrUUkmfMOnorwIwCvrNxl6YG 6IeNheymwRvjU1Knh/oGw1F32XXJ6/4= X-Google-Smtp-Source: AAOMgpd3F0uvz3Zog5+llb/J48dSD4OPG/weQBBXg88w1Nkbizd7eK+PM1X5RkZgi118BXQNHDckPg== 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-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 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 */ }