diff options
| author | Jon Hunter <jon-hunter@ti.com> | 2013-03-19 13:38:19 -0400 |
|---|---|---|
| committer | Benoit Cousson <benoit.cousson@linaro.org> | 2013-04-08 18:21:32 -0400 |
| commit | d1c6ccfe3dbdd2d393fc5eebe8c5d05aacc2d68c (patch) | |
| tree | 5655840208d06c1c6ccdbb0db0b84735d109230c /arch/arm/plat-omap/dmtimer.c | |
| parent | 002e1ec56d1171e2987c7ce5a865cf21a686a4bf (diff) | |
ARM: OMAP2+: Populate DMTIMER errata when using device-tree
Currently the DMTIMER errata flags are not being populated when using
device-tree. Add static platform data to populate errata flags when
using device-tree.
Please note that DMTIMER erratum i767 is applicable to OMAP3-5 devices
as well as AM335x devices.
Signed-off-by: Jon Hunter <jon-hunter@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Benoit Cousson <benoit.cousson@linaro.org>
Diffstat (limited to 'arch/arm/plat-omap/dmtimer.c')
| -rw-r--r-- | arch/arm/plat-omap/dmtimer.c | 45 |
1 files changed, 37 insertions, 8 deletions
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c index b50d478dfee3..5d0af13adb9b 100644 --- a/arch/arm/plat-omap/dmtimer.c +++ b/arch/arm/plat-omap/dmtimer.c | |||
| @@ -783,6 +783,8 @@ int omap_dm_timers_active(void) | |||
| 783 | } | 783 | } |
| 784 | EXPORT_SYMBOL_GPL(omap_dm_timers_active); | 784 | EXPORT_SYMBOL_GPL(omap_dm_timers_active); |
| 785 | 785 | ||
| 786 | static const struct of_device_id omap_timer_match[]; | ||
| 787 | |||
| 786 | /** | 788 | /** |
| 787 | * omap_dm_timer_probe - probe function called for every registered device | 789 | * omap_dm_timer_probe - probe function called for every registered device |
| 788 | * @pdev: pointer to current timer platform device | 790 | * @pdev: pointer to current timer platform device |
| @@ -796,7 +798,11 @@ static int omap_dm_timer_probe(struct platform_device *pdev) | |||
| 796 | struct omap_dm_timer *timer; | 798 | struct omap_dm_timer *timer; |
| 797 | struct resource *mem, *irq; | 799 | struct resource *mem, *irq; |
| 798 | struct device *dev = &pdev->dev; | 800 | struct device *dev = &pdev->dev; |
| 799 | struct dmtimer_platform_data *pdata = pdev->dev.platform_data; | 801 | const struct of_device_id *match; |
| 802 | const struct dmtimer_platform_data *pdata; | ||
| 803 | |||
| 804 | match = of_match_device(of_match_ptr(omap_timer_match), dev); | ||
| 805 | pdata = match ? match->data : dev->platform_data; | ||
| 800 | 806 | ||
| 801 | if (!pdata && !dev->of_node) { | 807 | if (!pdata && !dev->of_node) { |
| 802 | dev_err(dev, "%s: no platform data.\n", __func__); | 808 | dev_err(dev, "%s: no platform data.\n", __func__); |
| @@ -836,12 +842,14 @@ static int omap_dm_timer_probe(struct platform_device *pdev) | |||
| 836 | timer->capability |= OMAP_TIMER_SECURE; | 842 | timer->capability |= OMAP_TIMER_SECURE; |
| 837 | } else { | 843 | } else { |
| 838 | timer->id = pdev->id; | 844 | timer->id = pdev->id; |
| 839 | timer->errata = pdata->timer_errata; | ||
| 840 | timer->capability = pdata->timer_capability; | 845 | timer->capability = pdata->timer_capability; |
| 841 | timer->reserved = omap_dm_timer_reserved_systimer(timer->id); | 846 | timer->reserved = omap_dm_timer_reserved_systimer(timer->id); |
| 842 | timer->get_context_loss_count = pdata->get_context_loss_count; | 847 | timer->get_context_loss_count = pdata->get_context_loss_count; |
| 843 | } | 848 | } |
| 844 | 849 | ||
| 850 | if (pdata) | ||
| 851 | timer->errata = pdata->timer_errata; | ||
| 852 | |||
| 845 | timer->irq = irq->start; | 853 | timer->irq = irq->start; |
| 846 | timer->pdev = pdev; | 854 | timer->pdev = pdev; |
| 847 | 855 | ||
| @@ -894,13 +902,34 @@ static int omap_dm_timer_remove(struct platform_device *pdev) | |||
| 894 | return ret; | 902 | return ret; |
| 895 | } | 903 | } |
| 896 | 904 | ||
| 905 | static const struct dmtimer_platform_data omap3plus_pdata = { | ||
| 906 | .timer_errata = OMAP_TIMER_ERRATA_I103_I767, | ||
| 907 | }; | ||
| 908 | |||
| 897 | static const struct of_device_id omap_timer_match[] = { | 909 | static const struct of_device_id omap_timer_match[] = { |
| 898 | { .compatible = "ti,omap2420-timer", }, | 910 | { |
| 899 | { .compatible = "ti,omap3430-timer", }, | 911 | .compatible = "ti,omap2420-timer", |
| 900 | { .compatible = "ti,omap4430-timer", }, | 912 | }, |
| 901 | { .compatible = "ti,omap5430-timer", }, | 913 | { |
| 902 | { .compatible = "ti,am335x-timer", }, | 914 | .compatible = "ti,omap3430-timer", |
| 903 | { .compatible = "ti,am335x-timer-1ms", }, | 915 | .data = &omap3plus_pdata, |
| 916 | }, | ||
| 917 | { | ||
| 918 | .compatible = "ti,omap4430-timer", | ||
| 919 | .data = &omap3plus_pdata, | ||
| 920 | }, | ||
| 921 | { | ||
| 922 | .compatible = "ti,omap5430-timer", | ||
| 923 | .data = &omap3plus_pdata, | ||
| 924 | }, | ||
| 925 | { | ||
| 926 | .compatible = "ti,am335x-timer", | ||
| 927 | .data = &omap3plus_pdata, | ||
| 928 | }, | ||
| 929 | { | ||
| 930 | .compatible = "ti,am335x-timer-1ms", | ||
| 931 | .data = &omap3plus_pdata, | ||
| 932 | }, | ||
| 904 | {}, | 933 | {}, |
| 905 | }; | 934 | }; |
| 906 | MODULE_DEVICE_TABLE(of, omap_timer_match); | 935 | MODULE_DEVICE_TABLE(of, omap_timer_match); |
