diff options
Diffstat (limited to 'arch/arm/mach-omap2/gpmc.c')
-rw-r--r-- | arch/arm/mach-omap2/gpmc.c | 38 |
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 | */ | ||
1527 | static 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 | |||
1524 | static int gpmc_probe_dt(struct platform_device *pdev) | 1560 | static 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)) |