From patchwork Mon Jun 25 15:29:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10486753 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 2B2A76038C for ; Mon, 25 Jun 2018 15:31:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 18D52285EF for ; Mon, 25 Jun 2018 15:31:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0D189285EE; Mon, 25 Jun 2018 15:31: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=-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 ADA9E285F2 for ; Mon, 25 Jun 2018 15:31:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752378AbeFYP37 (ORCPT ); Mon, 25 Jun 2018 11:29:59 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:52903 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752288AbeFYP35 (ORCPT ); Mon, 25 Jun 2018 11:29:57 -0400 Received: by mail-wm0-f68.google.com with SMTP id p126-v6so9799080wmb.2 for ; Mon, 25 Jun 2018 08:29:57 -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=miS79Zl1c9cscJKWDTR+dBLAkOpFyzsZThlhunhRyuQ=; b=woSPazWjAaA2j51R2pj/If+vzahYAgqI0pJvNIZFNxwhbpe0rA/pp20OHKmDdXvUTC WkQxR5XazBRG28xsHMsxF3/AdFpdVhcN/jZjbLI6DsxAZS9tOcyYvy2dhrvapshaMo9B mqy2wA0O/wuQMPEKa9QJXh/eJp9x0aHrSld0HTG+aSPPtgiPMVOpo00H4RlTqut6IfwF yxfnLaGjU3wEv3mqe5z/gIeyHXykgaJeFwjUSDrDsiDPzAZhoWhGu+AM1DJ36PQdknTM zHZN3vBLU3POrwK9iqwG54a12iCjomfGidv/zsceZSIQkUBeMs1w/LpJjZLOr7eXcekr ui4Q== 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=miS79Zl1c9cscJKWDTR+dBLAkOpFyzsZThlhunhRyuQ=; b=Hi0G8EuFuztV9S2a3fSs+Y3F+E+U8mzkIvQdHsF14VApP3BD4xRAJDqpVEa/Dcdhkd i1pfjy95jeD6Tt2dlVcfSNVkJm7dKMbOKCfeDPCQgY2zhbE0p+OqoxDhkwxiVnn7VWKu gRfWLSABfEZvapIVXKcTyRnfy8uutWRJvzG8SCX1w8n+ouFVb/RpGvGAvEdhf9+CupcS nuibDU9AjmIJj5yZ4WbZvmc89UipD4EwsMviNhoR1+oiFiFeAoIHljfmzPsJGr5fSA+w myWh8DwAZkRijYmX0+2ss4OpDhexDTUaerv3EKDUhzwBbk7GP0g0kel/jaXQ/8okf167 b1Ag== X-Gm-Message-State: APt69E1Ch8Y4dQ4XDJY/PQDXlihCG3GFBfhPeAdmwQLhWjzyhhIFahzy odvDK9pIKfHfjf/CRXVXHEEATg== X-Google-Smtp-Source: AAOMgpf5nTVPEaKtxjsylB4jQMEj5m0fHN5r+s1f0/f6FzeZxSoM3vd0+5BDLzJidvSAdF9tsfdw1w== X-Received: by 2002:a1c:5b0d:: with SMTP id p13-v6mr1407560wmb.53.1529940596579; Mon, 25 Jun 2018 08:29:56 -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.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 08:29:56 -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 6/9] ARM: davinci: da830-evm: use aemif platform driver Date: Mon, 25 Jun 2018 17:29:17 +0200 Message-Id: <20180625152920.11549-7-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 da830-evm. Signed-off-by: Bartosz Golaszewski --- arch/arm/mach-davinci/board-da830-evm.c | 56 +++++++++++++++++++------ 1 file changed, 44 insertions(+), 12 deletions(-) diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c index b2470141dba3..666db3cee08a 100644 --- a/arch/arm/mach-davinci/board-da830-evm.c +++ b/arch/arm/mach-davinci/board-da830-evm.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -333,14 +334,48 @@ static struct resource da830_evm_nand_resources[] = { }, }; -static struct platform_device da830_evm_nand_device = { - .name = "davinci_nand", - .id = 1, - .dev = { - .platform_data = &da830_evm_nand_pdata, +static struct platform_device da830_evm_aemif_devices[] = { + { + .name = "davinci_nand", + .id = 1, + .dev = { + .platform_data = &da830_evm_nand_pdata, + }, + .num_resources = ARRAY_SIZE(da830_evm_nand_resources), + .resource = da830_evm_nand_resources, + }, +}; + +static struct resource da830_evm_aemif_resource[] = { + { + .start = DA8XX_AEMIF_CTL_BASE, + .end = DA8XX_AEMIF_CTL_BASE + SZ_32K - 1, + .flags = IORESOURCE_MEM, + }, +}; + +static struct aemif_abus_data da830_evm_aemif_abus_data[] = { + { + .cs = 3, }, - .num_resources = ARRAY_SIZE(da830_evm_nand_resources), - .resource = da830_evm_nand_resources, +}; + +static struct aemif_platform_data da830_evm_aemif_pdata = { + .abus_data = da830_evm_aemif_abus_data, + .num_abus_data = ARRAY_SIZE(da830_evm_aemif_abus_data), + .sub_devices = da830_evm_aemif_devices, + .num_sub_devices = ARRAY_SIZE(da830_evm_aemif_devices), + .cs_offset = 2, +}; + +static struct platform_device da830_evm_aemif_device = { + .name = "ti-aemif", + .dev = { + .platform_data = &da830_evm_aemif_pdata, + }, + .resource = da830_evm_aemif_resource, + .num_resources = ARRAY_SIZE(da830_evm_aemif_resource), + .id = -1, }; /* @@ -371,12 +406,9 @@ static inline void da830_evm_init_nand(int mux_mode) if (ret) pr_warn("%s: emif25 mux setup failed: %d\n", __func__, ret); - ret = platform_device_register(&da830_evm_nand_device); + ret = platform_device_register(&da830_evm_aemif_device); if (ret) - pr_warn("%s: NAND device not registered\n", __func__); - - if (davinci_aemif_setup(&da830_evm_nand_device)) - pr_warn("%s: Cannot configure AEMIF\n", __func__); + pr_warn("%s: AEMIF device not registered\n", __func__); gpio_direction_output(mux_mode, 1); }