aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2013-11-14 18:25:09 -0500
committerTony Lindgren <tony@atomide.com>2013-11-15 17:33:26 -0500
commitfd4446f25e402fb186a6b7ec7a374aa8925ed708 (patch)
tree20355323fc4ce7991765157c8ab69c15f38dcba4
parent4c624840ebe2d84b72e4b2ab3e7390dddf74d0a5 (diff)
ARM: OMAP2+: Fix GPMC and simplify bootloader timings for 8250 and smc91x
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>
-rw-r--r--arch/arm/boot/dts/omap-zoom-common.dtsi2
-rw-r--r--arch/arm/mach-omap2/gpmc.c58
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 b0ee342598f0..68221fab978d 100644
--- a/arch/arm/boot/dts/omap-zoom-common.dtsi
+++ b/arch/arm/boot/dts/omap-zoom-common.dtsi
@@ -13,7 +13,7 @@
13 * they probably share the same GPIO IRQ 13 * they probably share the same GPIO IRQ
14 * REVISIT: Add timing support from slls644g.pdf 14 * REVISIT: Add timing support from slls644g.pdf
15 */ 15 */
16 8250@3,0 { 16 uart@3,0 {
17 compatible = "ns16550a"; 17 compatible = "ns16550a";
18 reg = <3 0 0x100>; 18 reg = <3 0 0x100>;
19 bank-width = <2>; 19 bank-width = <2>;
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index 51525faa0aec..e09e5ba76a8b 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,
1482 } 1482 }
1483 1483
1484 /* 1484 /*
1485 * For some GPMC devices we still need to rely on the bootloader
1486 * timings because the devices can be connected via FPGA. So far
1487 * the list is smc91x on the omap2 SDP boards, and 8250 on zooms.
1488 * REVISIT: Add timing support from slls644g.pdf and from the
1489 * lan91c96 manual.
1490 */
1491 if (of_device_is_compatible(child, "ns16550a") ||
1492 of_device_is_compatible(child, "smsc,lan91c94") ||
1493 of_device_is_compatible(child, "smsc,lan91c111")) {
1494 dev_warn(&pdev->dev,
1495 "%s using bootloader timings on CS%d\n",
1496 child->name, cs);
1497 goto no_timings;
1498 }
1499
1500 /*
1485 * FIXME: gpmc_cs_request() will map the CS to an arbitary 1501 * FIXME: gpmc_cs_request() will map the CS to an arbitary
1486 * location in the gpmc address space. When booting with 1502 * location in the gpmc address space. When booting with
1487 * device-tree we want the NOR flash to be mapped to the 1503 * 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,
1509 gpmc_read_timings_dt(child, &gpmc_t); 1525 gpmc_read_timings_dt(child, &gpmc_t);
1510 gpmc_cs_set_timings(cs, &gpmc_t); 1526 gpmc_cs_set_timings(cs, &gpmc_t);
1511 1527
1528no_timings:
1512 if (of_platform_device_create(child, NULL, &pdev->dev)) 1529 if (of_platform_device_create(child, NULL, &pdev->dev))
1513 return 0; 1530 return 0;
1514 1531
@@ -1521,42 +1538,6 @@ err:
1521 return ret; 1538 return ret;
1522} 1539}
1523 1540
1524/*
1525 * REVISIT: Add timing support from slls644g.pdf
1526 */
1527static int gpmc_probe_8250(struct platform_device *pdev,
1528 struct device_node *child)
1529{
1530 struct resource res;
1531 unsigned long base;
1532 int ret, cs;
1533
1534 if (of_property_read_u32(child, "reg", &cs) < 0) {
1535 dev_err(&pdev->dev, "%s has no 'reg' property\n",
1536 child->full_name);
1537 return -ENODEV;
1538 }
1539
1540 if (of_address_to_resource(child, 0, &res) < 0) {
1541 dev_err(&pdev->dev, "%s has malformed 'reg' property\n",
1542 child->full_name);
1543 return -ENODEV;
1544 }
1545
1546 ret = gpmc_cs_request(cs, resource_size(&res), &base);
1547 if (ret < 0) {
1548 dev_err(&pdev->dev, "cannot request GPMC CS %d\n", cs);
1549 return ret;
1550 }
1551
1552 if (of_platform_device_create(child, NULL, &pdev->dev))
1553 return 0;
1554
1555 dev_err(&pdev->dev, "failed to create gpmc child %s\n", child->name);
1556
1557 return -ENODEV;
1558}
1559
1560static int gpmc_probe_dt(struct platform_device *pdev) 1541static int gpmc_probe_dt(struct platform_device *pdev)
1561{ 1542{
1562 int ret; 1543 int ret;
@@ -1598,10 +1579,9 @@ static int gpmc_probe_dt(struct platform_device *pdev)
1598 else if (of_node_cmp(child->name, "onenand") == 0) 1579 else if (of_node_cmp(child->name, "onenand") == 0)
1599 ret = gpmc_probe_onenand_child(pdev, child); 1580 ret = gpmc_probe_onenand_child(pdev, child);
1600 else if (of_node_cmp(child->name, "ethernet") == 0 || 1581 else if (of_node_cmp(child->name, "ethernet") == 0 ||
1601 of_node_cmp(child->name, "nor") == 0) 1582 of_node_cmp(child->name, "nor") == 0 ||
1583 of_node_cmp(child->name, "uart") == 0)
1602 ret = gpmc_probe_generic_child(pdev, child); 1584 ret = gpmc_probe_generic_child(pdev, child);
1603 else if (of_node_cmp(child->name, "8250") == 0)
1604 ret = gpmc_probe_8250(pdev, child);
1605 1585
1606 if (WARN(ret < 0, "%s: probing gpmc child %s failed\n", 1586 if (WARN(ret < 0, "%s: probing gpmc child %s failed\n",
1607 __func__, child->full_name)) 1587 __func__, child->full_name))