aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2013-10-11 12:21:26 -0400
committerTony Lindgren <tony@atomide.com>2013-10-11 12:21:50 -0400
commitf2bf0e72d000e76c4a9904cc8230cb2e659a2db4 (patch)
tree8d6c65924e260ce97184dd7b96534ee8a828503b
parent79b39f7918559da88be9463fc8b6674dd1ca2896 (diff)
ARM: OMAP2+: Add minimal 8250 support for GPMC
Just initialize things using the bootloader timings like we've been doing for the legacy booting too. It should be possible to patch in the GPMC timings for the based on the TL16CP743C/TL16C754C manual at: http://www.ti.com/lit/ds/slls644g/slls644g.pdf Signed-off-by: Tony Lindgren <tony@atomide.com>
-rw-r--r--arch/arm/mach-omap2/gpmc.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index 579697adaae7..51525faa0aec 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -1521,6 +1521,42 @@ err:
1521 return ret; 1521 return ret;
1522} 1522}
1523 1523
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
1524static int gpmc_probe_dt(struct platform_device *pdev) 1560static int gpmc_probe_dt(struct platform_device *pdev)
1525{ 1561{
1526 int ret; 1562 int ret;
@@ -1564,6 +1600,8 @@ static int gpmc_probe_dt(struct platform_device *pdev)
1564 else if (of_node_cmp(child->name, "ethernet") == 0 || 1600 else if (of_node_cmp(child->name, "ethernet") == 0 ||
1565 of_node_cmp(child->name, "nor") == 0) 1601 of_node_cmp(child->name, "nor") == 0)
1566 ret = gpmc_probe_generic_child(pdev, child); 1602 ret = gpmc_probe_generic_child(pdev, child);
1603 else if (of_node_cmp(child->name, "8250") == 0)
1604 ret = gpmc_probe_8250(pdev, child);
1567 1605
1568 if (WARN(ret < 0, "%s: probing gpmc child %s failed\n", 1606 if (WARN(ret < 0, "%s: probing gpmc child %s failed\n",
1569 __func__, child->full_name)) 1607 __func__, child->full_name))