From patchwork Thu Jun 28 09:57:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10493467 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 3A21660230 for ; Thu, 28 Jun 2018 10:00:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 217712990F for ; Thu, 28 Jun 2018 10:00:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1586D29936; Thu, 28 Jun 2018 10:00:54 +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 66054298FB for ; Thu, 28 Jun 2018 10:00:53 +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=7Cp//MayR1LGul6oulY+44VgLRX6ZADhGweXYzxaUwc=; b=j84P1JT+mLsNsbSKBMJISy7Fjt k2ZPR58QaiXf72ZTEMTrNaIqomvEwYOoRTwDjhWyA4uOEWIrXdzqaPKFPCtFVq7X5742LI5d8403O HfhMfm/f2OS5iX0kDyAMZP8XQc2wDqSfWLUqt7K7MPak/tStPI8OYC1Y64zXrlI3q/hsEev7gbTRz H3vq3v7X7TKXzO7OHNEyhIP62njFOT2Y9NsCrY6FH2eH6zy6iDRullFfzpT2tPi1PzKRrbKcPSZu1 VbJGU2nsk0VxMjLGtlo+QZCV8TXgp0IkWTFvgtfJ+/ENI9tSucGGO+id/+kEliYnZm0Yw0RsjCwB4 s0Oa5bOA==; 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 1fYTjJ-0007wv-MC; Thu, 28 Jun 2018 10:00:45 +0000 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fYTgt-00055Y-7x for linux-arm-kernel@lists.infradead.org; Thu, 28 Jun 2018 09:58:21 +0000 Received: by mail-wr0-x241.google.com with SMTP id a12-v6so4870302wro.1 for ; Thu, 28 Jun 2018 02:58:07 -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=DD+tegRkL77MXGQNOF6Vh7wMcrPvGgbRls6E01LtcQY=; b=KAUxG9nVhpwOE6npDohIvKeIU9uaX0YQAD3Qnbf9S7LrKUyum7JrLlpZAbZ0FJZBqG LhZEj+cBnLqtFw/byt7jUHcxCcDzY/t8iUDz/Ffkj/GiNTGhEM48CvNwJDHwFi08j/5I /Ujg81yIV8PytUVHyCQ2lnCYRO169vkpHBmF+21fjOv1xJLdECciK0m/fjM75xBC30nX UPlRL1992Oy9BQ6wMoNfqjxjBjGQO68l7SrwMCoe30/RSqaRwdzs3MTbn//AeMnXlZfX SmGvNpN5HH73pW69nMewkqCnKNGj38YiYqjzKexO3VmZwrzRnLAD1Ms0VfQuhqY5Ssch Nbvg== 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=DD+tegRkL77MXGQNOF6Vh7wMcrPvGgbRls6E01LtcQY=; b=TOwJ3QjYB4Nl4aVQrv/VC5R9rGOzjTUdpmsAP4mkdhaM3AZtA7VpiFcF+HNc4+vQiJ nnJP8wV2nrwP/lmlZQLyWdxihQx8r8zFAHi5RcbjOrqFfIDQy5kR3ZKMqENJO6JBCDSe 3w5PznpAM6HQRxBJKWqXYD2t8Yehwfd81c7dEUFuwEnTrkdiOaKZw3Gdx9jzrySMW9pW TrZiVZvu9POg65499IOsLEdBOT2D/xuWZb60nnVb2QBM1ABgxnu6r1qmbp9j4rpiioN7 4kNc167Pfy9sRZOE8p4jh+dMIgBor2kkaIzUqAlZKg6eORSigX/QBtQSHkgGXn4/IHlj M9vA== X-Gm-Message-State: APt69E0Rsc6E1NWVTQWbtQ7fWQz5XpopZfjLIfXE4UU2AQLuR1gbuJXw /dkyMPPIPXsy+AGqoRPf8b/e0w== X-Google-Smtp-Source: AAOMgpd2pe1jtkeStc12SwIE/7ciHo/tbzukxLuHCKk/R+rKXoaTwaFMie3NzFgJfIqMlS/T0dYFnA== X-Received: by 2002:adf:a14a:: with SMTP id r10-v6mr7952775wrr.104.1530179886538; Thu, 28 Jun 2018 02:58:06 -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.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jun 2018 02:58:06 -0700 (PDT) From: Bartosz Golaszewski To: Sekhar Nori , Kevin Hilman , Russell King , David Lechner , Michael Turquette , Stephen Boyd Subject: [PATCH v3 10/13] ARM: davinci: da830-evm: use aemif platform driver Date: Thu, 28 Jun 2018 11:57:45 +0200 Message-Id: <20180628095748.4462-11-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_025815_853409_91E7630A X-CRM114-Status: GOOD ( 15.68 ) 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 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..7d8ab36ff83d 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", + .id = -1, + .dev = { + .platform_data = &da830_evm_aemif_pdata, + }, + .resource = da830_evm_aemif_resource, + .num_resources = ARRAY_SIZE(da830_evm_aemif_resource), }; /* @@ -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); }