From patchwork Mon Jun 25 15:29:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10486759 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 16E166038C for ; Mon, 25 Jun 2018 15:31:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0422B285A4 for ; Mon, 25 Jun 2018 15:31:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ED0B0285EE; Mon, 25 Jun 2018 15:31:33 +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 91ACB285DC for ; Mon, 25 Jun 2018 15:31:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934814AbeFYPbV (ORCPT ); Mon, 25 Jun 2018 11:31:21 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:40820 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752203AbeFYP3z (ORCPT ); Mon, 25 Jun 2018 11:29:55 -0400 Received: by mail-wm0-f68.google.com with SMTP id z13-v6so4325077wma.5 for ; Mon, 25 Jun 2018 08:29:55 -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=ms5Z6SLZQlg5xNASHReMwsM7T1SdKNsJ9oPGqZasbmk=; b=oMn7VjZ3gZtu3aRfQTLmdTiJO7t95bnlY+D0sOIxiATZTIHa7u4IqP09C9kr52PDnD POGpDebZLFolim6ybyxSsWCVDLCV1OXPaWZ7VJpGmge2i5kPcQ+NNjlJ020CjSWb7vDk //9FcUHy9omuwX8+aDruZn31xgUOWVj6eEn5OiiNsLP/Wp+cZIgs7IjSRySvlAPcEqsR cOEI0F/bDvTGlQKcGwEP/7/MmHwPsxYck/OoIv7rUenfNsWmuXtUPc52tOsR3s8T4a2b lShPLHNoRs4gDd0DNdqx2sCPEE33WM6UrweG3RB1uy5zd+8hMgLeqnYZBOlQGcN5T5P9 nOUw== 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=ms5Z6SLZQlg5xNASHReMwsM7T1SdKNsJ9oPGqZasbmk=; b=hxvgNafafzFRVJUy/4fDplr5pvsnPH5zL8yF9kXfHijhBPOR0ZcpvgHKd58XGsBu7r AGw06nQbNc0xHXTwFHh9LpI4cgnRGF6SKybPv1lqXynTiOL4L58s+lZcdLwzwidd9CRa 8Z9fOMm3oxeu5RqbzEn9Q/mTMFMUA5/SJRc9VtKWHceqUAdn1Kb53NCbqBsd7ZQzZfFX GhwdtfYALgzmDeVBCNsOpSohAdm/3cNFr75h0AZP2W0Uegsi2aX3zMG4o8wtQOShc2C4 0Ytxd+Ew1xSQ3Hw9bzUkRzej3Ubu8AhB+/ATJF2oybGc3V11tztOilq1LBGUg/YR51uM up5Q== X-Gm-Message-State: APt69E3PA4m8dtR0F6iX4PP4COTa41ucWxTmlAmRez0eD7IWYMiy47wR 4Wliaw26/ySkXKgVG0Ts8Ol25g== X-Google-Smtp-Source: AAOMgpcQi5GtDVfkmtdszuyBxCevwt8rrVXI6cLYO53oRIiYgimPW4UnATdgCwnctsI2h6mbBrpt/A== X-Received: by 2002:a1c:8b52:: with SMTP id n79-v6mr1391436wmd.148.1529940594421; Mon, 25 Jun 2018 08:29:54 -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.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 08:29:53 -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 4/9] ARM: davinci: dm365-evm: use the ti-aemif soc driver Date: Mon, 25 Jun 2018 17:29:15 +0200 Message-Id: <20180625152920.11549-5-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-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..12b8d7b8c6b8 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", + .dev = { + .platform_data = &davinci_aemif_pdata, }, + .resource = davinci_aemif_resources, + .num_resources = ARRAY_SIZE(davinci_aemif_resources), + .id = -1, }; 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 */ }