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 v3 08/13] ARM: davinci: dm365-evm: use the ti-aemif soc driver
Date: Thu, 28 Jun 2018 11:57:43 +0200 [thread overview]
Message-ID: <20180628095748.4462-9-brgl@bgdev.pl> (raw)
In-Reply-To: <20180628095748.4462-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 dm365-evm.
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
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 <linux/spi/spi.h>
#include <linux/spi/eeprom.h>
#include <linux/v4l2-dv-timings.h>
+#include <linux/platform_data/ti-aemif.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -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 */
}
--
2.17.1
next prev parent reply other threads:[~2018-06-28 9:58 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-28 9:57 [PATCH v3 00/13] ARM: davinci: remove duplicate aemif support Bartosz Golaszewski
2018-06-28 9:57 ` [PATCH v3 01/13] clk: davinci: psc-da850: remove the 'davinci_nand.0" lookup Bartosz Golaszewski
2018-07-06 17:40 ` David Lechner
2018-06-28 9:57 ` [PATCH v3 02/13] clk: davinci: psc-dm365: use two lookup entries for the aemif clock Bartosz Golaszewski
2018-07-06 17:40 ` David Lechner
2018-06-28 9:57 ` [PATCH v3 03/13] clk: davinci: psc-dm644x: " Bartosz Golaszewski
2018-07-06 17:40 ` David Lechner
2018-06-28 9:57 ` [PATCH v3 04/13] clk: davinci: psc-dm646x: " Bartosz Golaszewski
2018-07-06 17:41 ` David Lechner
2018-06-28 9:57 ` [PATCH v3 05/13] clk: davinci: psc-da830: add a lookup entry for " Bartosz Golaszewski
2018-07-06 17:41 ` David Lechner
2018-06-28 9:57 ` [PATCH v3 06/13] ARM: davinci: omapl138-hawk: add aemif & nand support Bartosz Golaszewski
2018-06-28 9:57 ` [PATCH v3 07/13] ARM: davinci: da850-evm: use aemif platform driver in legacy mode Bartosz Golaszewski
2018-06-28 9:57 ` Bartosz Golaszewski [this message]
2018-06-28 9:57 ` [PATCH v3 09/13] ARM: davinci: dm644x-evm: use aemif platform driver Bartosz Golaszewski
2018-06-28 9:57 ` [PATCH v3 10/13] ARM: davinci: da830-evm: " Bartosz Golaszewski
2018-06-28 9:57 ` [PATCH v3 11/13] ARM: davinci: dm646x-evm: " Bartosz Golaszewski
2018-06-28 9:57 ` [PATCH v3 12/13] ARM: davinci: mityomapl138: " Bartosz Golaszewski
2018-06-28 9:57 ` [PATCH v3 13/13] ARM: davinci: unduplicate aemif support Bartosz Golaszewski
2018-07-02 12:28 ` [PATCH v3 00/13] ARM: davinci: remove duplicate " Sekhar Nori
2018-07-02 15:32 ` David Lechner
2018-07-04 6:35 ` Sekhar Nori
2018-07-06 17:39 ` David Lechner
2018-07-10 10:19 ` Sekhar Nori
2018-08-06 16:35 ` David Lechner
2018-08-07 6:02 ` Sekhar Nori
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=20180628095748.4462-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;
as well as URLs for NNTP newsgroup(s).