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: 10493499 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 F1B9B601BE for ; Thu, 28 Jun 2018 10:18:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB47729B00 for ; Thu, 28 Jun 2018 10:18:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CE86229B28; Thu, 28 Jun 2018 10:18:14 +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 7589C29B00 for ; Thu, 28 Jun 2018 10:18:14 +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=TacncS77CIGZ7b40rrUezACj1cGpC4Lqbe9ZNo6T6xA=; b=WLLFOaeLjDzJ1JMMjeXTQLr1z3 TGsHiNagpHf4n3DmRG30oIjnZejsUxtkZxqdpIaM8Q86AWiy7piOxbWIQiN3r1LGn3yNIXnjueSFK Src1sLgj1PdcM2+FzXXCfCLO1pZYy21EJyjxeP8jdFgj9C52gjQk8whH9ygLb2AFnTYMFQRvk+hkd OgaOajyQ6myRRhr84MMXjEYelL1NtvGy41buVamhKiGoOfKceIO3Oh5wbLJNXBDOPumZwGqgIMI2Y PlYTz87Bxbb6s3pJ2yOo2GiUw5yJCT6uJx4i1F/+GQNDRP4BsCP72DM/xmlVmxhFOSlLOepnKKWrq 3QQeQxow==; 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 1fYU0C-0001U4-RH; Thu, 28 Jun 2018 10:18:12 +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 1fYTgu-00055E-77 for linux-arm-kernel@lists.infradead.org; Thu, 28 Jun 2018 09:58:25 +0000 Received: by mail-wm0-x244.google.com with SMTP id 69-v6so8311619wmf.3 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=cGdFAZXqWWvY1176f6ORDVsZ8EFGPG30ohB0tlqMIbPsgjDVzRWVdP2LLxNWc4IgU6 Yb+6IRcPv93FuBz1TVQadvPqXbx1hkOkuF+pGKtIBvTq4d0qOmyXbzJQRC4KuYeJPadW gFhLajKyu3wWu/Tg5n8vsfgF+YsvMCWz/9lOKKD/9UlFRT+6ph5lvCjB6tZyFytdfFDk S635iIMTfdgKyEMP52kA6RKZ+CAfMpvGB0mFkijIggWdTYXYPiNiI0Hotjlnp5jrSbmZ EBrFVByrA6L/p0cGUicQdCfjkUInqxa67V5QLXkZC0LJ0dS2RK2EoGwW5AVF8b0v54z/ LKcw== X-Gm-Message-State: APt69E1dHhqbY3o7bYyW+Ek4g/mo67HZLzXQOMaaPrf7MwCK5LQiGv6z sMK5XnBuEQZgrAl+ieoW6+oyww== 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180628_025816_758661_64DBBAA6 X-CRM114-Status: GOOD ( 17.14 ) 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 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 */ }