diff options
Diffstat (limited to 'arch/arm/mach-omap2/gpmc.c')
-rw-r--r-- | arch/arm/mach-omap2/gpmc.c | 58 |
1 files changed, 19 insertions, 39 deletions
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c index 81de56251955..d24926e6340f 100644 --- a/arch/arm/mach-omap2/gpmc.c +++ b/arch/arm/mach-omap2/gpmc.c | |||
@@ -1502,6 +1502,22 @@ static int gpmc_probe_generic_child(struct platform_device *pdev, | |||
1502 | } | 1502 | } |
1503 | 1503 | ||
1504 | /* | 1504 | /* |
1505 | * For some GPMC devices we still need to rely on the bootloader | ||
1506 | * timings because the devices can be connected via FPGA. So far | ||
1507 | * the list is smc91x on the omap2 SDP boards, and 8250 on zooms. | ||
1508 | * REVISIT: Add timing support from slls644g.pdf and from the | ||
1509 | * lan91c96 manual. | ||
1510 | */ | ||
1511 | if (of_device_is_compatible(child, "ns16550a") || | ||
1512 | of_device_is_compatible(child, "smsc,lan91c94") || | ||
1513 | of_device_is_compatible(child, "smsc,lan91c111")) { | ||
1514 | dev_warn(&pdev->dev, | ||
1515 | "%s using bootloader timings on CS%d\n", | ||
1516 | child->name, cs); | ||
1517 | goto no_timings; | ||
1518 | } | ||
1519 | |||
1520 | /* | ||
1505 | * FIXME: gpmc_cs_request() will map the CS to an arbitary | 1521 | * FIXME: gpmc_cs_request() will map the CS to an arbitary |
1506 | * location in the gpmc address space. When booting with | 1522 | * location in the gpmc address space. When booting with |
1507 | * device-tree we want the NOR flash to be mapped to the | 1523 | * device-tree we want the NOR flash to be mapped to the |
@@ -1529,6 +1545,7 @@ static int gpmc_probe_generic_child(struct platform_device *pdev, | |||
1529 | gpmc_read_timings_dt(child, &gpmc_t); | 1545 | gpmc_read_timings_dt(child, &gpmc_t); |
1530 | gpmc_cs_set_timings(cs, &gpmc_t); | 1546 | gpmc_cs_set_timings(cs, &gpmc_t); |
1531 | 1547 | ||
1548 | no_timings: | ||
1532 | if (of_platform_device_create(child, NULL, &pdev->dev)) | 1549 | if (of_platform_device_create(child, NULL, &pdev->dev)) |
1533 | return 0; | 1550 | return 0; |
1534 | 1551 | ||
@@ -1541,42 +1558,6 @@ err: | |||
1541 | return ret; | 1558 | return ret; |
1542 | } | 1559 | } |
1543 | 1560 | ||
1544 | /* | ||
1545 | * REVISIT: Add timing support from slls644g.pdf | ||
1546 | */ | ||
1547 | static int gpmc_probe_8250(struct platform_device *pdev, | ||
1548 | struct device_node *child) | ||
1549 | { | ||
1550 | struct resource res; | ||
1551 | unsigned long base; | ||
1552 | int ret, cs; | ||
1553 | |||
1554 | if (of_property_read_u32(child, "reg", &cs) < 0) { | ||
1555 | dev_err(&pdev->dev, "%s has no 'reg' property\n", | ||
1556 | child->full_name); | ||
1557 | return -ENODEV; | ||
1558 | } | ||
1559 | |||
1560 | if (of_address_to_resource(child, 0, &res) < 0) { | ||
1561 | dev_err(&pdev->dev, "%s has malformed 'reg' property\n", | ||
1562 | child->full_name); | ||
1563 | return -ENODEV; | ||
1564 | } | ||
1565 | |||
1566 | ret = gpmc_cs_request(cs, resource_size(&res), &base); | ||
1567 | if (ret < 0) { | ||
1568 | dev_err(&pdev->dev, "cannot request GPMC CS %d\n", cs); | ||
1569 | return ret; | ||
1570 | } | ||
1571 | |||
1572 | if (of_platform_device_create(child, NULL, &pdev->dev)) | ||
1573 | return 0; | ||
1574 | |||
1575 | dev_err(&pdev->dev, "failed to create gpmc child %s\n", child->name); | ||
1576 | |||
1577 | return -ENODEV; | ||
1578 | } | ||
1579 | |||
1580 | static int gpmc_probe_dt(struct platform_device *pdev) | 1561 | static int gpmc_probe_dt(struct platform_device *pdev) |
1581 | { | 1562 | { |
1582 | int ret; | 1563 | int ret; |
@@ -1618,10 +1599,9 @@ static int gpmc_probe_dt(struct platform_device *pdev) | |||
1618 | else if (of_node_cmp(child->name, "onenand") == 0) | 1599 | else if (of_node_cmp(child->name, "onenand") == 0) |
1619 | ret = gpmc_probe_onenand_child(pdev, child); | 1600 | ret = gpmc_probe_onenand_child(pdev, child); |
1620 | else if (of_node_cmp(child->name, "ethernet") == 0 || | 1601 | else if (of_node_cmp(child->name, "ethernet") == 0 || |
1621 | of_node_cmp(child->name, "nor") == 0) | 1602 | of_node_cmp(child->name, "nor") == 0 || |
1603 | of_node_cmp(child->name, "uart") == 0) | ||
1622 | ret = gpmc_probe_generic_child(pdev, child); | 1604 | ret = gpmc_probe_generic_child(pdev, child); |
1623 | else if (of_node_cmp(child->name, "8250") == 0) | ||
1624 | ret = gpmc_probe_8250(pdev, child); | ||
1625 | 1605 | ||
1626 | if (WARN(ret < 0, "%s: probing gpmc child %s failed\n", | 1606 | if (WARN(ret < 0, "%s: probing gpmc child %s failed\n", |
1627 | __func__, child->full_name)) | 1607 | __func__, child->full_name)) |