diff options
Diffstat (limited to 'arch/arm/common')
| -rw-r--r-- | arch/arm/common/edma.c | 38 | ||||
| -rw-r--r-- | arch/arm/common/mcpm_entry.c | 6 | ||||
| -rw-r--r-- | arch/arm/common/sharpsl_param.c | 5 |
3 files changed, 39 insertions, 10 deletions
diff --git a/arch/arm/common/edma.c b/arch/arm/common/edma.c index 117f955a2a06..8e1a0245907f 100644 --- a/arch/arm/common/edma.c +++ b/arch/arm/common/edma.c | |||
| @@ -269,6 +269,11 @@ static const struct edmacc_param dummy_paramset = { | |||
| 269 | .ccnt = 1, | 269 | .ccnt = 1, |
| 270 | }; | 270 | }; |
| 271 | 271 | ||
| 272 | static const struct of_device_id edma_of_ids[] = { | ||
| 273 | { .compatible = "ti,edma3", }, | ||
| 274 | {} | ||
| 275 | }; | ||
| 276 | |||
| 272 | /*****************************************************************************/ | 277 | /*****************************************************************************/ |
| 273 | 278 | ||
| 274 | static void map_dmach_queue(unsigned ctlr, unsigned ch_no, | 279 | static void map_dmach_queue(unsigned ctlr, unsigned ch_no, |
| @@ -560,14 +565,38 @@ static int reserve_contiguous_slots(int ctlr, unsigned int id, | |||
| 560 | static int prepare_unused_channel_list(struct device *dev, void *data) | 565 | static int prepare_unused_channel_list(struct device *dev, void *data) |
| 561 | { | 566 | { |
| 562 | struct platform_device *pdev = to_platform_device(dev); | 567 | struct platform_device *pdev = to_platform_device(dev); |
| 563 | int i, ctlr; | 568 | int i, count, ctlr; |
| 569 | struct of_phandle_args dma_spec; | ||
| 564 | 570 | ||
| 571 | if (dev->of_node) { | ||
| 572 | count = of_property_count_strings(dev->of_node, "dma-names"); | ||
| 573 | if (count < 0) | ||
| 574 | return 0; | ||
| 575 | for (i = 0; i < count; i++) { | ||
| 576 | if (of_parse_phandle_with_args(dev->of_node, "dmas", | ||
| 577 | "#dma-cells", i, | ||
| 578 | &dma_spec)) | ||
| 579 | continue; | ||
| 580 | |||
| 581 | if (!of_match_node(edma_of_ids, dma_spec.np)) { | ||
| 582 | of_node_put(dma_spec.np); | ||
| 583 | continue; | ||
| 584 | } | ||
| 585 | |||
| 586 | clear_bit(EDMA_CHAN_SLOT(dma_spec.args[0]), | ||
| 587 | edma_cc[0]->edma_unused); | ||
| 588 | of_node_put(dma_spec.np); | ||
| 589 | } | ||
| 590 | return 0; | ||
| 591 | } | ||
| 592 | |||
| 593 | /* For non-OF case */ | ||
| 565 | for (i = 0; i < pdev->num_resources; i++) { | 594 | for (i = 0; i < pdev->num_resources; i++) { |
| 566 | if ((pdev->resource[i].flags & IORESOURCE_DMA) && | 595 | if ((pdev->resource[i].flags & IORESOURCE_DMA) && |
| 567 | (int)pdev->resource[i].start >= 0) { | 596 | (int)pdev->resource[i].start >= 0) { |
| 568 | ctlr = EDMA_CTLR(pdev->resource[i].start); | 597 | ctlr = EDMA_CTLR(pdev->resource[i].start); |
| 569 | clear_bit(EDMA_CHAN_SLOT(pdev->resource[i].start), | 598 | clear_bit(EDMA_CHAN_SLOT(pdev->resource[i].start), |
| 570 | edma_cc[ctlr]->edma_unused); | 599 | edma_cc[ctlr]->edma_unused); |
| 571 | } | 600 | } |
| 572 | } | 601 | } |
| 573 | 602 | ||
| @@ -1762,11 +1791,6 @@ static int edma_probe(struct platform_device *pdev) | |||
| 1762 | return 0; | 1791 | return 0; |
| 1763 | } | 1792 | } |
| 1764 | 1793 | ||
| 1765 | static const struct of_device_id edma_of_ids[] = { | ||
| 1766 | { .compatible = "ti,edma3", }, | ||
| 1767 | {} | ||
| 1768 | }; | ||
| 1769 | |||
| 1770 | static struct platform_driver edma_driver = { | 1794 | static struct platform_driver edma_driver = { |
| 1771 | .driver = { | 1795 | .driver = { |
| 1772 | .name = "edma", | 1796 | .name = "edma", |
diff --git a/arch/arm/common/mcpm_entry.c b/arch/arm/common/mcpm_entry.c index 370236dd1a03..990250965f2c 100644 --- a/arch/arm/common/mcpm_entry.c +++ b/arch/arm/common/mcpm_entry.c | |||
| @@ -51,7 +51,8 @@ void mcpm_cpu_power_down(void) | |||
| 51 | { | 51 | { |
| 52 | phys_reset_t phys_reset; | 52 | phys_reset_t phys_reset; |
| 53 | 53 | ||
| 54 | BUG_ON(!platform_ops); | 54 | if (WARN_ON_ONCE(!platform_ops || !platform_ops->power_down)) |
| 55 | return; | ||
| 55 | BUG_ON(!irqs_disabled()); | 56 | BUG_ON(!irqs_disabled()); |
| 56 | 57 | ||
| 57 | /* | 58 | /* |
| @@ -93,7 +94,8 @@ void mcpm_cpu_suspend(u64 expected_residency) | |||
| 93 | { | 94 | { |
| 94 | phys_reset_t phys_reset; | 95 | phys_reset_t phys_reset; |
| 95 | 96 | ||
| 96 | BUG_ON(!platform_ops); | 97 | if (WARN_ON_ONCE(!platform_ops || !platform_ops->suspend)) |
| 98 | return; | ||
| 97 | BUG_ON(!irqs_disabled()); | 99 | BUG_ON(!irqs_disabled()); |
| 98 | 100 | ||
| 99 | /* Very similar to mcpm_cpu_power_down() */ | 101 | /* Very similar to mcpm_cpu_power_down() */ |
diff --git a/arch/arm/common/sharpsl_param.c b/arch/arm/common/sharpsl_param.c index d56c932580eb..025f6ce38596 100644 --- a/arch/arm/common/sharpsl_param.c +++ b/arch/arm/common/sharpsl_param.c | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | #include <linux/module.h> | 15 | #include <linux/module.h> |
| 16 | #include <linux/string.h> | 16 | #include <linux/string.h> |
| 17 | #include <asm/mach/sharpsl_param.h> | 17 | #include <asm/mach/sharpsl_param.h> |
| 18 | #include <asm/memory.h> | ||
| 18 | 19 | ||
| 19 | /* | 20 | /* |
| 20 | * Certain hardware parameters determined at the time of device manufacture, | 21 | * Certain hardware parameters determined at the time of device manufacture, |
| @@ -25,8 +26,10 @@ | |||
| 25 | */ | 26 | */ |
| 26 | #ifdef CONFIG_ARCH_SA1100 | 27 | #ifdef CONFIG_ARCH_SA1100 |
| 27 | #define PARAM_BASE 0xe8ffc000 | 28 | #define PARAM_BASE 0xe8ffc000 |
| 29 | #define param_start(x) (void *)(x) | ||
| 28 | #else | 30 | #else |
| 29 | #define PARAM_BASE 0xa0000a00 | 31 | #define PARAM_BASE 0xa0000a00 |
| 32 | #define param_start(x) __va(x) | ||
| 30 | #endif | 33 | #endif |
| 31 | #define MAGIC_CHG(a,b,c,d) ( ( d << 24 ) | ( c << 16 ) | ( b << 8 ) | a ) | 34 | #define MAGIC_CHG(a,b,c,d) ( ( d << 24 ) | ( c << 16 ) | ( b << 8 ) | a ) |
| 32 | 35 | ||
| @@ -41,7 +44,7 @@ EXPORT_SYMBOL(sharpsl_param); | |||
| 41 | 44 | ||
| 42 | void sharpsl_save_param(void) | 45 | void sharpsl_save_param(void) |
| 43 | { | 46 | { |
| 44 | memcpy(&sharpsl_param, (void *)PARAM_BASE, sizeof(struct sharpsl_param_info)); | 47 | memcpy(&sharpsl_param, param_start(PARAM_BASE), sizeof(struct sharpsl_param_info)); |
| 45 | 48 | ||
| 46 | if (sharpsl_param.comadj_keyword != COMADJ_MAGIC) | 49 | if (sharpsl_param.comadj_keyword != COMADJ_MAGIC) |
| 47 | sharpsl_param.comadj=-1; | 50 | sharpsl_param.comadj=-1; |
