From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Sekhar Nori <nsekhar@ti.com>, Kevin Hilman <khilman@kernel.org>,
Russell King <linux@armlinux.org.uk>,
David Lechner <david@lechnology.com>,
Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org,
Bartosz Golaszewski <bgolaszewski@baylibre.com>
Subject: [PATCH 8/9] ARM: davinci: mityomapl138: use aemif platform driver
Date: Mon, 25 Jun 2018 17:29:19 +0200 [thread overview]
Message-ID: <20180625152920.11549-9-brgl@bgdev.pl> (raw)
In-Reply-To: <20180625152920.11549-1-brgl@bgdev.pl>
From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
We now support board files in the aemif driver. Register a platform
device instead of using the handcrafted API in mityomapl138.
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
arch/arm/mach-davinci/board-mityomapl138.c | 55 ++++++++++++++++------
1 file changed, 41 insertions(+), 14 deletions(-)
diff --git a/arch/arm/mach-davinci/board-mityomapl138.c b/arch/arm/mach-davinci/board-mityomapl138.c
index 2cce0d7d2f2a..b0fdea355d96 100644
--- a/arch/arm/mach-davinci/board-mityomapl138.c
+++ b/arch/arm/mach-davinci/board-mityomapl138.c
@@ -30,6 +30,7 @@
#include <mach/da8xx.h>
#include <linux/platform_data/mtd-davinci.h>
#include <linux/platform_data/mtd-davinci-aemif.h>
+#include <linux/platform_data/ti-aemif.h>
#include <mach/mux.h>
#include <linux/platform_data/spi-davinci.h>
@@ -422,27 +423,53 @@ static struct resource mityomapl138_nandflash_resource[] = {
},
};
-static struct platform_device mityomapl138_nandflash_device = {
- .name = "davinci_nand",
- .id = 1,
- .dev = {
- .platform_data = &mityomapl138_nandflash_data,
+static struct platform_device mityomapl138_aemif_devices[] = {
+ {
+ .name = "davinci_nand",
+ .id = 1,
+ .dev = {
+ .platform_data = &mityomapl138_nandflash_data,
+ },
+ .num_resources = ARRAY_SIZE(mityomapl138_nandflash_resource),
+ .resource = mityomapl138_nandflash_resource,
},
- .num_resources = ARRAY_SIZE(mityomapl138_nandflash_resource),
- .resource = mityomapl138_nandflash_resource,
};
-static struct platform_device *mityomapl138_devices[] __initdata = {
- &mityomapl138_nandflash_device,
+static struct resource mityomapl138_aemif_resources[] = {
+ {
+ .start = DA8XX_AEMIF_CTL_BASE,
+ .end = DA8XX_AEMIF_CTL_BASE + SZ_32K - 1,
+ .flags = IORESOURCE_MEM,
+ },
+};
+
+static struct aemif_abus_data mityomapl138_aemif_abus_data[] = {
+ {
+ .cs = 1,
+ },
+};
+
+static struct aemif_platform_data mityomapl138_aemif_pdata = {
+ .abus_data = mityomapl138_aemif_abus_data,
+ .num_abus_data = ARRAY_SIZE(mityomapl138_aemif_abus_data),
+ .sub_devices = mityomapl138_aemif_devices,
+ .num_sub_devices = ARRAY_SIZE(mityomapl138_aemif_devices),
+};
+
+static struct platform_device mityomapl138_aemif_device = {
+ .name = "ti-aemif",
+ .dev = {
+ .platform_data = &mityomapl138_aemif_pdata,
+ },
+ .resource = mityomapl138_aemif_resources,
+ .num_resources = ARRAY_SIZE(mityomapl138_aemif_resources),
+ .id = -1,
};
static void __init mityomapl138_setup_nand(void)
{
- platform_add_devices(mityomapl138_devices,
- ARRAY_SIZE(mityomapl138_devices));
-
- if (davinci_aemif_setup(&mityomapl138_nandflash_device))
- pr_warn("%s: Cannot configure AEMIF\n", __func__);
+ if (platform_device_register(&mityomapl138_aemif_device))
+ pr_warn("%s: Cannot register AEMIF device\n", __func__);
}
static const short mityomap_mii_pins[] = {
--
2.17.1
next prev parent reply other threads:[~2018-06-25 15:31 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-25 15:29 [PATCH 0/9] ARM: davinci: deduplicate aemif support Bartosz Golaszewski
2018-06-25 15:29 ` [PATCH 1/9] clk: davinci: psc-dm365: use two lookup entries for the aemif clock Bartosz Golaszewski
2018-06-25 15:53 ` David Lechner
2018-06-25 16:01 ` Bartosz Golaszewski
2018-06-25 16:06 ` David Lechner
2018-06-25 16:09 ` Bartosz Golaszewski
2018-06-26 8:27 ` Bartosz Golaszewski
2018-06-25 15:29 ` [PATCH 2/9] ARM: davinci: omapl138-hawk: add aemif & nand support Bartosz Golaszewski
2018-06-25 16:08 ` David Lechner
2018-06-25 15:29 ` [PATCH 3/9] ARM: davinci: da850-evm: use aemif platform driver in legacy mode Bartosz Golaszewski
2018-06-25 16:00 ` David Lechner
2018-06-25 16:04 ` David Lechner
2018-06-25 15:29 ` [PATCH 4/9] ARM: davinci: dm365-evm: use the ti-aemif soc driver Bartosz Golaszewski
2018-06-25 15:29 ` [PATCH 5/9] ARM: davinci: dm644x-evm: use aemif platform driver Bartosz Golaszewski
2018-06-25 15:29 ` [PATCH 6/9] ARM: davinci: da830-evm: " Bartosz Golaszewski
2018-06-25 16:20 ` David Lechner
2018-06-25 16:23 ` Bartosz Golaszewski
2018-06-25 16:29 ` David Lechner
2018-06-25 15:29 ` [PATCH 7/9] ARM: davinci: dm646x-evm: " Bartosz Golaszewski
2018-06-25 15:29 ` Bartosz Golaszewski [this message]
2018-06-25 15:29 ` [PATCH 9/9] ARM: davinci: kill davinci_aemif_setup() Bartosz Golaszewski
2018-06-25 16:23 ` David Lechner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180625152920.11549-9-brgl@bgdev.pl \
--to=brgl@bgdev.pl \
--cc=bgolaszewski@baylibre.com \
--cc=david@lechnology.com \
--cc=khilman@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=mturquette@baylibre.com \
--cc=nsekhar@ti.com \
--cc=sboyd@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox