From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 7/8] ARM: OMAP2+: Fix GPMC and simplify bootloader timings for 8250 and smc91x
Date: Wed, 13 Nov 2013 18:35:36 -0800 [thread overview]
Message-ID: <1384396537-3486-8-git-send-email-tony@atomide.com> (raw)
In-Reply-To: <1384396537-3486-1-git-send-email-tony@atomide.com>
Commit f2bf0e72d000 (ARM: OMAP2+: Add minimal 8250 support
for GPMC) added support for using bootloader timings for some
devices. Turns out we can do the same by looking at the compatible
flags of the child without adding a new function as smc91x has
a similar issue as 8250 with the bootloader timings.
And let's fix the 8250 naming, we should use the device type as
the name like uart instead of 8250 for zoom dts file.
Cc: "Beno?t Cousson" <bcousson@baylibre.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/boot/dts/omap-zoom-common.dtsi | 2 +-
arch/arm/mach-omap2/gpmc.c | 58 +++++++++++----------------------
2 files changed, 20 insertions(+), 40 deletions(-)
diff --git a/arch/arm/boot/dts/omap-zoom-common.dtsi b/arch/arm/boot/dts/omap-zoom-common.dtsi
index b0ee342..68221fa 100644
--- a/arch/arm/boot/dts/omap-zoom-common.dtsi
+++ b/arch/arm/boot/dts/omap-zoom-common.dtsi
@@ -13,7 +13,7 @@
* they probably share the same GPIO IRQ
* REVISIT: Add timing support from slls644g.pdf
*/
- 8250 at 3,0 {
+ uart at 3,0 {
compatible = "ns16550a";
reg = <3 0 0x100>;
bank-width = <2>;
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index 51525fa..e09e5ba 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -1482,6 +1482,22 @@ static int gpmc_probe_generic_child(struct platform_device *pdev,
}
/*
+ * For some GPMC devices we still need to rely on the bootloader
+ * timings because the devices can be connected via FPGA. So far
+ * the list is smc91x on the omap2 SDP boards, and 8250 on zooms.
+ * REVISIT: Add timing support from slls644g.pdf and from the
+ * lan91c96 manual.
+ */
+ if (of_device_is_compatible(child, "ns16550a") ||
+ of_device_is_compatible(child, "smsc,lan91c94") ||
+ of_device_is_compatible(child, "smsc,lan91c111")) {
+ dev_warn(&pdev->dev,
+ "%s using bootloader timings on CS%d\n",
+ child->name, cs);
+ goto no_timings;
+ }
+
+ /*
* FIXME: gpmc_cs_request() will map the CS to an arbitary
* location in the gpmc address space. When booting with
* device-tree we want the NOR flash to be mapped to the
@@ -1509,6 +1525,7 @@ static int gpmc_probe_generic_child(struct platform_device *pdev,
gpmc_read_timings_dt(child, &gpmc_t);
gpmc_cs_set_timings(cs, &gpmc_t);
+no_timings:
if (of_platform_device_create(child, NULL, &pdev->dev))
return 0;
@@ -1521,42 +1538,6 @@ err:
return ret;
}
-/*
- * REVISIT: Add timing support from slls644g.pdf
- */
-static int gpmc_probe_8250(struct platform_device *pdev,
- struct device_node *child)
-{
- struct resource res;
- unsigned long base;
- int ret, cs;
-
- if (of_property_read_u32(child, "reg", &cs) < 0) {
- dev_err(&pdev->dev, "%s has no 'reg' property\n",
- child->full_name);
- return -ENODEV;
- }
-
- if (of_address_to_resource(child, 0, &res) < 0) {
- dev_err(&pdev->dev, "%s has malformed 'reg' property\n",
- child->full_name);
- return -ENODEV;
- }
-
- ret = gpmc_cs_request(cs, resource_size(&res), &base);
- if (ret < 0) {
- dev_err(&pdev->dev, "cannot request GPMC CS %d\n", cs);
- return ret;
- }
-
- if (of_platform_device_create(child, NULL, &pdev->dev))
- return 0;
-
- dev_err(&pdev->dev, "failed to create gpmc child %s\n", child->name);
-
- return -ENODEV;
-}
-
static int gpmc_probe_dt(struct platform_device *pdev)
{
int ret;
@@ -1598,10 +1579,9 @@ static int gpmc_probe_dt(struct platform_device *pdev)
else if (of_node_cmp(child->name, "onenand") == 0)
ret = gpmc_probe_onenand_child(pdev, child);
else if (of_node_cmp(child->name, "ethernet") == 0 ||
- of_node_cmp(child->name, "nor") == 0)
+ of_node_cmp(child->name, "nor") == 0 ||
+ of_node_cmp(child->name, "uart") == 0)
ret = gpmc_probe_generic_child(pdev, child);
- else if (of_node_cmp(child->name, "8250") == 0)
- ret = gpmc_probe_8250(pdev, child);
if (WARN(ret < 0, "%s: probing gpmc child %s failed\n",
__func__, child->full_name))
--
1.8.1.1
next prev parent reply other threads:[~2013-11-14 2:35 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-14 2:35 [PATCH 0/8] Various omap device tree usability fixes for v3.13 merge window Tony Lindgren
2013-11-14 2:35 ` [PATCH 1/8] net: smc91x: Fix device tree based configuration so it's usable Tony Lindgren
2013-11-14 11:03 ` Mark Rutland
2013-11-14 16:08 ` Tony Lindgren
2013-11-16 15:16 ` Tony Lindgren
2013-11-27 18:36 ` Tony Lindgren
2013-11-14 2:35 ` [PATCH 2/8] mmc: omap: Fix DMA configuration to not rely on device id Tony Lindgren
2013-11-18 18:47 ` Tony Lindgren
2013-11-26 23:33 ` Chris Ball
2013-11-26 23:52 ` Tony Lindgren
2013-11-27 20:57 ` Jarkko Nikula
2013-11-27 21:37 ` Tony Lindgren
2013-11-28 17:02 ` Jarkko Nikula
2013-11-29 16:34 ` Tony Lindgren
2013-11-27 21:47 ` Chris Ball
2013-11-27 21:59 ` Tony Lindgren
2013-11-28 16:13 ` Jarkko Nikula
2013-11-29 17:13 ` Tony Lindgren
2013-11-30 0:38 ` Joel Fernandes
2013-11-30 17:33 ` Tony Lindgren
2013-11-14 2:35 ` [PATCH 3/8] mmc: omap: Fix I2C dependency and make driver usable with device tree Tony Lindgren
2013-11-14 11:05 ` Mark Rutland
2013-11-14 17:25 ` Tony Lindgren
2013-11-26 23:34 ` Chris Ball
2013-11-14 2:35 ` [PATCH 4/8] i2c: omap: Fix missing device tree flags for omap2 Tony Lindgren
2013-11-14 6:58 ` Wolfram Sang
2013-11-14 17:34 ` Tony Lindgren
2013-11-14 17:49 ` Wolfram Sang
2013-11-14 17:53 ` Tony Lindgren
2013-11-14 11:07 ` Mark Rutland
2013-11-14 17:30 ` Tony Lindgren
2013-11-14 2:35 ` [PATCH 5/8] gpio: twl4030: Fix regression for twl gpio output Tony Lindgren
2013-11-14 9:45 ` Peter Ujfalusi
2013-11-14 17:37 ` Tony Lindgren
2013-11-18 22:45 ` Linus Walleij
2013-12-03 13:30 ` Roger Quadros
2013-12-09 13:09 ` Linus Walleij
2013-12-09 17:10 ` Tony Lindgren
2013-12-10 12:17 ` Linus Walleij
2013-12-10 15:20 ` Tony Lindgren
2013-11-14 2:35 ` [PATCH 6/8] gpio: twl4030: Fix passing of pdata in the device tree case Tony Lindgren
2013-11-18 18:27 ` Tony Lindgren
2013-11-18 22:46 ` Linus Walleij
2013-11-14 2:35 ` Tony Lindgren [this message]
2013-11-14 2:35 ` [PATCH 8/8] ARM: dts: Fix omap2 specific dtsi files by adding the missing entries Tony Lindgren
2013-11-14 23:08 ` [PATCH 9/8] i2c: Fix device tree binding for i2c-cbus-gpio Tony Lindgren
2013-11-15 18:49 ` Aaro Koskinen
2013-11-15 22:26 ` Wolfram Sang
2013-11-15 22:30 ` Tony Lindgren
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=1384396537-3486-8-git-send-email-tony@atomide.com \
--to=tony@atomide.com \
--cc=linux-arm-kernel@lists.infradead.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).