diff options
author | Tony Lindgren <tony@atomide.com> | 2012-10-30 14:03:22 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2012-10-31 18:37:13 -0400 |
commit | 8280960181eae6e4039957044577b6ef7154220f (patch) | |
tree | dd0590ac041d673f1fbc7a491d99997a6d785901 /arch/arm/plat-omap/dma.c | |
parent | 32dee01e67e0d14e86708c4ca6c5a9f4f81d5144 (diff) |
ARM: OMAP: Remove cpu_is_omap usage from plat-omap/dma.c
This code will be eventually in drivers, and for the
code in the drivers we don't want to have any cpu_is_omap
usage. Those macros should be private to arch/arm/mach-omap1
and arch/arm/mach-omap2.
To fix this, let's move the define for dma_omap2plus()
to dma-omap.h, and use the existing dma_attr passed in
the platform_data as the revision registers are what they
are.
Note that we can now also remove the relative includes
introduced by the recent clean-up patches.
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/plat-omap/dma.c')
-rw-r--r-- | arch/arm/plat-omap/dma.c | 108 |
1 files changed, 52 insertions, 56 deletions
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c index 49803cc18787..c288b76f8e6c 100644 --- a/arch/arm/plat-omap/dma.c +++ b/arch/arm/plat-omap/dma.c | |||
@@ -38,9 +38,6 @@ | |||
38 | 38 | ||
39 | #include <plat-omap/dma-omap.h> | 39 | #include <plat-omap/dma-omap.h> |
40 | 40 | ||
41 | #include "../mach-omap1/soc.h" | ||
42 | #include "../mach-omap2/soc.h" | ||
43 | |||
44 | /* | 41 | /* |
45 | * MAX_LOGICAL_DMA_CH_COUNT: the maximum number of logical DMA | 42 | * MAX_LOGICAL_DMA_CH_COUNT: the maximum number of logical DMA |
46 | * channels that an instance of the SDMA IP block can support. Used | 43 | * channels that an instance of the SDMA IP block can support. Used |
@@ -182,7 +179,7 @@ void omap_set_dma_priority(int lch, int dst_port, int priority) | |||
182 | unsigned long reg; | 179 | unsigned long reg; |
183 | u32 l; | 180 | u32 l; |
184 | 181 | ||
185 | if (cpu_class_is_omap1()) { | 182 | if (dma_omap1()) { |
186 | switch (dst_port) { | 183 | switch (dst_port) { |
187 | case OMAP_DMA_PORT_OCP_T1: /* FFFECC00 */ | 184 | case OMAP_DMA_PORT_OCP_T1: /* FFFECC00 */ |
188 | reg = OMAP_TC_OCPT1_PRIOR; | 185 | reg = OMAP_TC_OCPT1_PRIOR; |
@@ -234,7 +231,7 @@ void omap_set_dma_transfer_params(int lch, int data_type, int elem_count, | |||
234 | l |= data_type; | 231 | l |= data_type; |
235 | p->dma_write(l, CSDP, lch); | 232 | p->dma_write(l, CSDP, lch); |
236 | 233 | ||
237 | if (cpu_class_is_omap1()) { | 234 | if (dma_omap1()) { |
238 | u16 ccr; | 235 | u16 ccr; |
239 | 236 | ||
240 | ccr = p->dma_read(CCR, lch); | 237 | ccr = p->dma_read(CCR, lch); |
@@ -250,7 +247,7 @@ void omap_set_dma_transfer_params(int lch, int data_type, int elem_count, | |||
250 | p->dma_write(ccr, CCR2, lch); | 247 | p->dma_write(ccr, CCR2, lch); |
251 | } | 248 | } |
252 | 249 | ||
253 | if (cpu_class_is_omap2() && dma_trigger) { | 250 | if (dma_omap2plus() && dma_trigger) { |
254 | u32 val; | 251 | u32 val; |
255 | 252 | ||
256 | val = p->dma_read(CCR, lch); | 253 | val = p->dma_read(CCR, lch); |
@@ -290,7 +287,7 @@ void omap_set_dma_color_mode(int lch, enum omap_dma_color_mode mode, u32 color) | |||
290 | { | 287 | { |
291 | BUG_ON(omap_dma_in_1510_mode()); | 288 | BUG_ON(omap_dma_in_1510_mode()); |
292 | 289 | ||
293 | if (cpu_class_is_omap1()) { | 290 | if (dma_omap1()) { |
294 | u16 w; | 291 | u16 w; |
295 | 292 | ||
296 | w = p->dma_read(CCR2, lch); | 293 | w = p->dma_read(CCR2, lch); |
@@ -320,7 +317,7 @@ void omap_set_dma_color_mode(int lch, enum omap_dma_color_mode mode, u32 color) | |||
320 | p->dma_write(w, LCH_CTRL, lch); | 317 | p->dma_write(w, LCH_CTRL, lch); |
321 | } | 318 | } |
322 | 319 | ||
323 | if (cpu_class_is_omap2()) { | 320 | if (dma_omap2plus()) { |
324 | u32 val; | 321 | u32 val; |
325 | 322 | ||
326 | val = p->dma_read(CCR, lch); | 323 | val = p->dma_read(CCR, lch); |
@@ -348,7 +345,7 @@ EXPORT_SYMBOL(omap_set_dma_color_mode); | |||
348 | 345 | ||
349 | void omap_set_dma_write_mode(int lch, enum omap_dma_write_mode mode) | 346 | void omap_set_dma_write_mode(int lch, enum omap_dma_write_mode mode) |
350 | { | 347 | { |
351 | if (cpu_class_is_omap2()) { | 348 | if (dma_omap2plus()) { |
352 | u32 csdp; | 349 | u32 csdp; |
353 | 350 | ||
354 | csdp = p->dma_read(CSDP, lch); | 351 | csdp = p->dma_read(CSDP, lch); |
@@ -361,7 +358,7 @@ EXPORT_SYMBOL(omap_set_dma_write_mode); | |||
361 | 358 | ||
362 | void omap_set_dma_channel_mode(int lch, enum omap_dma_channel_mode mode) | 359 | void omap_set_dma_channel_mode(int lch, enum omap_dma_channel_mode mode) |
363 | { | 360 | { |
364 | if (cpu_class_is_omap1() && !cpu_is_omap15xx()) { | 361 | if (dma_omap1() && !dma_omap15xx()) { |
365 | u32 l; | 362 | u32 l; |
366 | 363 | ||
367 | l = p->dma_read(LCH_CTRL, lch); | 364 | l = p->dma_read(LCH_CTRL, lch); |
@@ -379,7 +376,7 @@ void omap_set_dma_src_params(int lch, int src_port, int src_amode, | |||
379 | { | 376 | { |
380 | u32 l; | 377 | u32 l; |
381 | 378 | ||
382 | if (cpu_class_is_omap1()) { | 379 | if (dma_omap1()) { |
383 | u16 w; | 380 | u16 w; |
384 | 381 | ||
385 | w = p->dma_read(CSDP, lch); | 382 | w = p->dma_read(CSDP, lch); |
@@ -421,7 +418,7 @@ EXPORT_SYMBOL(omap_set_dma_params); | |||
421 | 418 | ||
422 | void omap_set_dma_src_index(int lch, int eidx, int fidx) | 419 | void omap_set_dma_src_index(int lch, int eidx, int fidx) |
423 | { | 420 | { |
424 | if (cpu_class_is_omap2()) | 421 | if (dma_omap2plus()) |
425 | return; | 422 | return; |
426 | 423 | ||
427 | p->dma_write(eidx, CSEI, lch); | 424 | p->dma_write(eidx, CSEI, lch); |
@@ -453,13 +450,13 @@ void omap_set_dma_src_burst_mode(int lch, enum omap_dma_burst_mode burst_mode) | |||
453 | case OMAP_DMA_DATA_BURST_DIS: | 450 | case OMAP_DMA_DATA_BURST_DIS: |
454 | break; | 451 | break; |
455 | case OMAP_DMA_DATA_BURST_4: | 452 | case OMAP_DMA_DATA_BURST_4: |
456 | if (cpu_class_is_omap2()) | 453 | if (dma_omap2plus()) |
457 | burst = 0x1; | 454 | burst = 0x1; |
458 | else | 455 | else |
459 | burst = 0x2; | 456 | burst = 0x2; |
460 | break; | 457 | break; |
461 | case OMAP_DMA_DATA_BURST_8: | 458 | case OMAP_DMA_DATA_BURST_8: |
462 | if (cpu_class_is_omap2()) { | 459 | if (dma_omap2plus()) { |
463 | burst = 0x2; | 460 | burst = 0x2; |
464 | break; | 461 | break; |
465 | } | 462 | } |
@@ -469,7 +466,7 @@ void omap_set_dma_src_burst_mode(int lch, enum omap_dma_burst_mode burst_mode) | |||
469 | * fall through | 466 | * fall through |
470 | */ | 467 | */ |
471 | case OMAP_DMA_DATA_BURST_16: | 468 | case OMAP_DMA_DATA_BURST_16: |
472 | if (cpu_class_is_omap2()) { | 469 | if (dma_omap2plus()) { |
473 | burst = 0x3; | 470 | burst = 0x3; |
474 | break; | 471 | break; |
475 | } | 472 | } |
@@ -493,7 +490,7 @@ void omap_set_dma_dest_params(int lch, int dest_port, int dest_amode, | |||
493 | { | 490 | { |
494 | u32 l; | 491 | u32 l; |
495 | 492 | ||
496 | if (cpu_class_is_omap1()) { | 493 | if (dma_omap1()) { |
497 | l = p->dma_read(CSDP, lch); | 494 | l = p->dma_read(CSDP, lch); |
498 | l &= ~(0x1f << 9); | 495 | l &= ~(0x1f << 9); |
499 | l |= dest_port << 9; | 496 | l |= dest_port << 9; |
@@ -514,7 +511,7 @@ EXPORT_SYMBOL(omap_set_dma_dest_params); | |||
514 | 511 | ||
515 | void omap_set_dma_dest_index(int lch, int eidx, int fidx) | 512 | void omap_set_dma_dest_index(int lch, int eidx, int fidx) |
516 | { | 513 | { |
517 | if (cpu_class_is_omap2()) | 514 | if (dma_omap2plus()) |
518 | return; | 515 | return; |
519 | 516 | ||
520 | p->dma_write(eidx, CDEI, lch); | 517 | p->dma_write(eidx, CDEI, lch); |
@@ -546,19 +543,19 @@ void omap_set_dma_dest_burst_mode(int lch, enum omap_dma_burst_mode burst_mode) | |||
546 | case OMAP_DMA_DATA_BURST_DIS: | 543 | case OMAP_DMA_DATA_BURST_DIS: |
547 | break; | 544 | break; |
548 | case OMAP_DMA_DATA_BURST_4: | 545 | case OMAP_DMA_DATA_BURST_4: |
549 | if (cpu_class_is_omap2()) | 546 | if (dma_omap2plus()) |
550 | burst = 0x1; | 547 | burst = 0x1; |
551 | else | 548 | else |
552 | burst = 0x2; | 549 | burst = 0x2; |
553 | break; | 550 | break; |
554 | case OMAP_DMA_DATA_BURST_8: | 551 | case OMAP_DMA_DATA_BURST_8: |
555 | if (cpu_class_is_omap2()) | 552 | if (dma_omap2plus()) |
556 | burst = 0x2; | 553 | burst = 0x2; |
557 | else | 554 | else |
558 | burst = 0x3; | 555 | burst = 0x3; |
559 | break; | 556 | break; |
560 | case OMAP_DMA_DATA_BURST_16: | 557 | case OMAP_DMA_DATA_BURST_16: |
561 | if (cpu_class_is_omap2()) { | 558 | if (dma_omap2plus()) { |
562 | burst = 0x3; | 559 | burst = 0x3; |
563 | break; | 560 | break; |
564 | } | 561 | } |
@@ -579,7 +576,7 @@ EXPORT_SYMBOL(omap_set_dma_dest_burst_mode); | |||
579 | static inline void omap_enable_channel_irq(int lch) | 576 | static inline void omap_enable_channel_irq(int lch) |
580 | { | 577 | { |
581 | /* Clear CSR */ | 578 | /* Clear CSR */ |
582 | if (cpu_class_is_omap1()) | 579 | if (dma_omap1()) |
583 | p->dma_read(CSR, lch); | 580 | p->dma_read(CSR, lch); |
584 | else | 581 | else |
585 | p->dma_write(OMAP2_DMA_CSR_CLEAR_MASK, CSR, lch); | 582 | p->dma_write(OMAP2_DMA_CSR_CLEAR_MASK, CSR, lch); |
@@ -593,7 +590,7 @@ static inline void omap_disable_channel_irq(int lch) | |||
593 | /* disable channel interrupts */ | 590 | /* disable channel interrupts */ |
594 | p->dma_write(0, CICR, lch); | 591 | p->dma_write(0, CICR, lch); |
595 | /* Clear CSR */ | 592 | /* Clear CSR */ |
596 | if (cpu_class_is_omap1()) | 593 | if (dma_omap1()) |
597 | p->dma_read(CSR, lch); | 594 | p->dma_read(CSR, lch); |
598 | else | 595 | else |
599 | p->dma_write(OMAP2_DMA_CSR_CLEAR_MASK, CSR, lch); | 596 | p->dma_write(OMAP2_DMA_CSR_CLEAR_MASK, CSR, lch); |
@@ -617,7 +614,7 @@ static inline void enable_lnk(int lch) | |||
617 | 614 | ||
618 | l = p->dma_read(CLNK_CTRL, lch); | 615 | l = p->dma_read(CLNK_CTRL, lch); |
619 | 616 | ||
620 | if (cpu_class_is_omap1()) | 617 | if (dma_omap1()) |
621 | l &= ~(1 << 14); | 618 | l &= ~(1 << 14); |
622 | 619 | ||
623 | /* Set the ENABLE_LNK bits */ | 620 | /* Set the ENABLE_LNK bits */ |
@@ -625,7 +622,7 @@ static inline void enable_lnk(int lch) | |||
625 | l = dma_chan[lch].next_lch | (1 << 15); | 622 | l = dma_chan[lch].next_lch | (1 << 15); |
626 | 623 | ||
627 | #ifndef CONFIG_ARCH_OMAP1 | 624 | #ifndef CONFIG_ARCH_OMAP1 |
628 | if (cpu_class_is_omap2()) | 625 | if (dma_omap2plus()) |
629 | if (dma_chan[lch].next_linked_ch != -1) | 626 | if (dma_chan[lch].next_linked_ch != -1) |
630 | l = dma_chan[lch].next_linked_ch | (1 << 15); | 627 | l = dma_chan[lch].next_linked_ch | (1 << 15); |
631 | #endif | 628 | #endif |
@@ -642,12 +639,12 @@ static inline void disable_lnk(int lch) | |||
642 | /* Disable interrupts */ | 639 | /* Disable interrupts */ |
643 | omap_disable_channel_irq(lch); | 640 | omap_disable_channel_irq(lch); |
644 | 641 | ||
645 | if (cpu_class_is_omap1()) { | 642 | if (dma_omap1()) { |
646 | /* Set the STOP_LNK bit */ | 643 | /* Set the STOP_LNK bit */ |
647 | l |= 1 << 14; | 644 | l |= 1 << 14; |
648 | } | 645 | } |
649 | 646 | ||
650 | if (cpu_class_is_omap2()) { | 647 | if (dma_omap2plus()) { |
651 | /* Clear the ENABLE_LNK bit */ | 648 | /* Clear the ENABLE_LNK bit */ |
652 | l &= ~(1 << 15); | 649 | l &= ~(1 << 15); |
653 | } | 650 | } |
@@ -661,7 +658,7 @@ static inline void omap2_enable_irq_lch(int lch) | |||
661 | u32 val; | 658 | u32 val; |
662 | unsigned long flags; | 659 | unsigned long flags; |
663 | 660 | ||
664 | if (!cpu_class_is_omap2()) | 661 | if (dma_omap1()) |
665 | return; | 662 | return; |
666 | 663 | ||
667 | spin_lock_irqsave(&dma_chan_lock, flags); | 664 | spin_lock_irqsave(&dma_chan_lock, flags); |
@@ -679,7 +676,7 @@ static inline void omap2_disable_irq_lch(int lch) | |||
679 | u32 val; | 676 | u32 val; |
680 | unsigned long flags; | 677 | unsigned long flags; |
681 | 678 | ||
682 | if (!cpu_class_is_omap2()) | 679 | if (dma_omap1()) |
683 | return; | 680 | return; |
684 | 681 | ||
685 | spin_lock_irqsave(&dma_chan_lock, flags); | 682 | spin_lock_irqsave(&dma_chan_lock, flags); |
@@ -718,7 +715,7 @@ int omap_request_dma(int dev_id, const char *dev_name, | |||
718 | if (p->clear_lch_regs) | 715 | if (p->clear_lch_regs) |
719 | p->clear_lch_regs(free_ch); | 716 | p->clear_lch_regs(free_ch); |
720 | 717 | ||
721 | if (cpu_class_is_omap2()) | 718 | if (dma_omap2plus()) |
722 | omap_clear_dma(free_ch); | 719 | omap_clear_dma(free_ch); |
723 | 720 | ||
724 | spin_unlock_irqrestore(&dma_chan_lock, flags); | 721 | spin_unlock_irqrestore(&dma_chan_lock, flags); |
@@ -729,7 +726,7 @@ int omap_request_dma(int dev_id, const char *dev_name, | |||
729 | chan->flags = 0; | 726 | chan->flags = 0; |
730 | 727 | ||
731 | #ifndef CONFIG_ARCH_OMAP1 | 728 | #ifndef CONFIG_ARCH_OMAP1 |
732 | if (cpu_class_is_omap2()) { | 729 | if (dma_omap2plus()) { |
733 | chan->chain_id = -1; | 730 | chan->chain_id = -1; |
734 | chan->next_linked_ch = -1; | 731 | chan->next_linked_ch = -1; |
735 | } | 732 | } |
@@ -737,13 +734,13 @@ int omap_request_dma(int dev_id, const char *dev_name, | |||
737 | 734 | ||
738 | chan->enabled_irqs = OMAP_DMA_DROP_IRQ | OMAP_DMA_BLOCK_IRQ; | 735 | chan->enabled_irqs = OMAP_DMA_DROP_IRQ | OMAP_DMA_BLOCK_IRQ; |
739 | 736 | ||
740 | if (cpu_class_is_omap1()) | 737 | if (dma_omap1()) |
741 | chan->enabled_irqs |= OMAP1_DMA_TOUT_IRQ; | 738 | chan->enabled_irqs |= OMAP1_DMA_TOUT_IRQ; |
742 | else if (cpu_class_is_omap2()) | 739 | else if (dma_omap2plus()) |
743 | chan->enabled_irqs |= OMAP2_DMA_MISALIGNED_ERR_IRQ | | 740 | chan->enabled_irqs |= OMAP2_DMA_MISALIGNED_ERR_IRQ | |
744 | OMAP2_DMA_TRANS_ERR_IRQ; | 741 | OMAP2_DMA_TRANS_ERR_IRQ; |
745 | 742 | ||
746 | if (cpu_is_omap16xx()) { | 743 | if (dma_omap16xx()) { |
747 | /* If the sync device is set, configure it dynamically. */ | 744 | /* If the sync device is set, configure it dynamically. */ |
748 | if (dev_id != 0) { | 745 | if (dev_id != 0) { |
749 | set_gdma_dev(free_ch + 1, dev_id); | 746 | set_gdma_dev(free_ch + 1, dev_id); |
@@ -754,11 +751,11 @@ int omap_request_dma(int dev_id, const char *dev_name, | |||
754 | * id. | 751 | * id. |
755 | */ | 752 | */ |
756 | p->dma_write(dev_id | (1 << 10), CCR, free_ch); | 753 | p->dma_write(dev_id | (1 << 10), CCR, free_ch); |
757 | } else if (cpu_is_omap7xx() || cpu_is_omap15xx()) { | 754 | } else if (dma_omap1()) { |
758 | p->dma_write(dev_id, CCR, free_ch); | 755 | p->dma_write(dev_id, CCR, free_ch); |
759 | } | 756 | } |
760 | 757 | ||
761 | if (cpu_class_is_omap2()) { | 758 | if (dma_omap2plus()) { |
762 | omap_enable_channel_irq(free_ch); | 759 | omap_enable_channel_irq(free_ch); |
763 | omap2_enable_irq_lch(free_ch); | 760 | omap2_enable_irq_lch(free_ch); |
764 | } | 761 | } |
@@ -780,7 +777,7 @@ void omap_free_dma(int lch) | |||
780 | } | 777 | } |
781 | 778 | ||
782 | /* Disable interrupt for logical channel */ | 779 | /* Disable interrupt for logical channel */ |
783 | if (cpu_class_is_omap2()) | 780 | if (dma_omap2plus()) |
784 | omap2_disable_irq_lch(lch); | 781 | omap2_disable_irq_lch(lch); |
785 | 782 | ||
786 | /* Disable all DMA interrupts for the channel. */ | 783 | /* Disable all DMA interrupts for the channel. */ |
@@ -790,7 +787,7 @@ void omap_free_dma(int lch) | |||
790 | p->dma_write(0, CCR, lch); | 787 | p->dma_write(0, CCR, lch); |
791 | 788 | ||
792 | /* Clear registers */ | 789 | /* Clear registers */ |
793 | if (cpu_class_is_omap2()) | 790 | if (dma_omap2plus()) |
794 | omap_clear_dma(lch); | 791 | omap_clear_dma(lch); |
795 | 792 | ||
796 | spin_lock_irqsave(&dma_chan_lock, flags); | 793 | spin_lock_irqsave(&dma_chan_lock, flags); |
@@ -816,7 +813,7 @@ omap_dma_set_global_params(int arb_rate, int max_fifo_depth, int tparams) | |||
816 | { | 813 | { |
817 | u32 reg; | 814 | u32 reg; |
818 | 815 | ||
819 | if (!cpu_class_is_omap2()) { | 816 | if (dma_omap1()) { |
820 | printk(KERN_ERR "FIXME: no %s on 15xx/16xx\n", __func__); | 817 | printk(KERN_ERR "FIXME: no %s on 15xx/16xx\n", __func__); |
821 | return; | 818 | return; |
822 | } | 819 | } |
@@ -855,7 +852,7 @@ omap_dma_set_prio_lch(int lch, unsigned char read_prio, | |||
855 | } | 852 | } |
856 | l = p->dma_read(CCR, lch); | 853 | l = p->dma_read(CCR, lch); |
857 | l &= ~((1 << 6) | (1 << 26)); | 854 | l &= ~((1 << 6) | (1 << 26)); |
858 | if (cpu_class_is_omap2() && !cpu_is_omap242x()) | 855 | if (d->dev_caps & IS_RW_PRIORITY) |
859 | l |= ((read_prio & 0x1) << 6) | ((write_prio & 0x1) << 26); | 856 | l |= ((read_prio & 0x1) << 6) | ((write_prio & 0x1) << 26); |
860 | else | 857 | else |
861 | l |= ((read_prio & 0x1) << 6); | 858 | l |= ((read_prio & 0x1) << 6); |
@@ -888,7 +885,7 @@ void omap_start_dma(int lch) | |||
888 | * The CPC/CDAC register needs to be initialized to zero | 885 | * The CPC/CDAC register needs to be initialized to zero |
889 | * before starting dma transfer. | 886 | * before starting dma transfer. |
890 | */ | 887 | */ |
891 | if (cpu_is_omap15xx()) | 888 | if (dma_omap15xx()) |
892 | p->dma_write(0, CPC, lch); | 889 | p->dma_write(0, CPC, lch); |
893 | else | 890 | else |
894 | p->dma_write(0, CDAC, lch); | 891 | p->dma_write(0, CDAC, lch); |
@@ -1051,7 +1048,7 @@ dma_addr_t omap_get_dma_src_pos(int lch) | |||
1051 | { | 1048 | { |
1052 | dma_addr_t offset = 0; | 1049 | dma_addr_t offset = 0; |
1053 | 1050 | ||
1054 | if (cpu_is_omap15xx()) | 1051 | if (dma_omap15xx()) |
1055 | offset = p->dma_read(CPC, lch); | 1052 | offset = p->dma_read(CPC, lch); |
1056 | else | 1053 | else |
1057 | offset = p->dma_read(CSAC, lch); | 1054 | offset = p->dma_read(CSAC, lch); |
@@ -1059,7 +1056,7 @@ dma_addr_t omap_get_dma_src_pos(int lch) | |||
1059 | if (IS_DMA_ERRATA(DMA_ERRATA_3_3) && offset == 0) | 1056 | if (IS_DMA_ERRATA(DMA_ERRATA_3_3) && offset == 0) |
1060 | offset = p->dma_read(CSAC, lch); | 1057 | offset = p->dma_read(CSAC, lch); |
1061 | 1058 | ||
1062 | if (!cpu_is_omap15xx()) { | 1059 | if (!dma_omap15xx()) { |
1063 | /* | 1060 | /* |
1064 | * CDAC == 0 indicates that the DMA transfer on the channel has | 1061 | * CDAC == 0 indicates that the DMA transfer on the channel has |
1065 | * not been started (no data has been transferred so far). | 1062 | * not been started (no data has been transferred so far). |
@@ -1071,7 +1068,7 @@ dma_addr_t omap_get_dma_src_pos(int lch) | |||
1071 | offset = p->dma_read(CSSA, lch); | 1068 | offset = p->dma_read(CSSA, lch); |
1072 | } | 1069 | } |
1073 | 1070 | ||
1074 | if (cpu_class_is_omap1()) | 1071 | if (dma_omap1()) |
1075 | offset |= (p->dma_read(CSSA, lch) & 0xFFFF0000); | 1072 | offset |= (p->dma_read(CSSA, lch) & 0xFFFF0000); |
1076 | 1073 | ||
1077 | return offset; | 1074 | return offset; |
@@ -1090,7 +1087,7 @@ dma_addr_t omap_get_dma_dst_pos(int lch) | |||
1090 | { | 1087 | { |
1091 | dma_addr_t offset = 0; | 1088 | dma_addr_t offset = 0; |
1092 | 1089 | ||
1093 | if (cpu_is_omap15xx()) | 1090 | if (dma_omap15xx()) |
1094 | offset = p->dma_read(CPC, lch); | 1091 | offset = p->dma_read(CPC, lch); |
1095 | else | 1092 | else |
1096 | offset = p->dma_read(CDAC, lch); | 1093 | offset = p->dma_read(CDAC, lch); |
@@ -1099,7 +1096,7 @@ dma_addr_t omap_get_dma_dst_pos(int lch) | |||
1099 | * omap 3.2/3.3 erratum: sometimes 0 is returned if CSAC/CDAC is | 1096 | * omap 3.2/3.3 erratum: sometimes 0 is returned if CSAC/CDAC is |
1100 | * read before the DMA controller finished disabling the channel. | 1097 | * read before the DMA controller finished disabling the channel. |
1101 | */ | 1098 | */ |
1102 | if (!cpu_is_omap15xx() && offset == 0) { | 1099 | if (!dma_omap15xx() && offset == 0) { |
1103 | offset = p->dma_read(CDAC, lch); | 1100 | offset = p->dma_read(CDAC, lch); |
1104 | /* | 1101 | /* |
1105 | * CDAC == 0 indicates that the DMA transfer on the channel has | 1102 | * CDAC == 0 indicates that the DMA transfer on the channel has |
@@ -1110,7 +1107,7 @@ dma_addr_t omap_get_dma_dst_pos(int lch) | |||
1110 | offset = p->dma_read(CDSA, lch); | 1107 | offset = p->dma_read(CDSA, lch); |
1111 | } | 1108 | } |
1112 | 1109 | ||
1113 | if (cpu_class_is_omap1()) | 1110 | if (dma_omap1()) |
1114 | offset |= (p->dma_read(CDSA, lch) & 0xFFFF0000); | 1111 | offset |= (p->dma_read(CDSA, lch) & 0xFFFF0000); |
1115 | 1112 | ||
1116 | return offset; | 1113 | return offset; |
@@ -1127,7 +1124,7 @@ int omap_dma_running(void) | |||
1127 | { | 1124 | { |
1128 | int lch; | 1125 | int lch; |
1129 | 1126 | ||
1130 | if (cpu_class_is_omap1()) | 1127 | if (dma_omap1()) |
1131 | if (omap_lcd_dma_running()) | 1128 | if (omap_lcd_dma_running()) |
1132 | return 1; | 1129 | return 1; |
1133 | 1130 | ||
@@ -2030,7 +2027,7 @@ static int __devinit omap_system_dma_probe(struct platform_device *pdev) | |||
2030 | dma_chan = d->chan; | 2027 | dma_chan = d->chan; |
2031 | enable_1510_mode = d->dev_caps & ENABLE_1510_MODE; | 2028 | enable_1510_mode = d->dev_caps & ENABLE_1510_MODE; |
2032 | 2029 | ||
2033 | if (cpu_class_is_omap2()) { | 2030 | if (dma_omap2plus()) { |
2034 | dma_linked_lch = kzalloc(sizeof(struct dma_link_info) * | 2031 | dma_linked_lch = kzalloc(sizeof(struct dma_link_info) * |
2035 | dma_lch_count, GFP_KERNEL); | 2032 | dma_lch_count, GFP_KERNEL); |
2036 | if (!dma_linked_lch) { | 2033 | if (!dma_linked_lch) { |
@@ -2042,7 +2039,7 @@ static int __devinit omap_system_dma_probe(struct platform_device *pdev) | |||
2042 | spin_lock_init(&dma_chan_lock); | 2039 | spin_lock_init(&dma_chan_lock); |
2043 | for (ch = 0; ch < dma_chan_count; ch++) { | 2040 | for (ch = 0; ch < dma_chan_count; ch++) { |
2044 | omap_clear_dma(ch); | 2041 | omap_clear_dma(ch); |
2045 | if (cpu_class_is_omap2()) | 2042 | if (dma_omap2plus()) |
2046 | omap2_disable_irq_lch(ch); | 2043 | omap2_disable_irq_lch(ch); |
2047 | 2044 | ||
2048 | dma_chan[ch].dev_id = -1; | 2045 | dma_chan[ch].dev_id = -1; |
@@ -2051,7 +2048,7 @@ static int __devinit omap_system_dma_probe(struct platform_device *pdev) | |||
2051 | if (ch >= 6 && enable_1510_mode) | 2048 | if (ch >= 6 && enable_1510_mode) |
2052 | continue; | 2049 | continue; |
2053 | 2050 | ||
2054 | if (cpu_class_is_omap1()) { | 2051 | if (dma_omap1()) { |
2055 | /* | 2052 | /* |
2056 | * request_irq() doesn't like dev_id (ie. ch) being | 2053 | * request_irq() doesn't like dev_id (ie. ch) being |
2057 | * zero, so we have to kludge around this. | 2054 | * zero, so we have to kludge around this. |
@@ -2076,11 +2073,11 @@ static int __devinit omap_system_dma_probe(struct platform_device *pdev) | |||
2076 | } | 2073 | } |
2077 | } | 2074 | } |
2078 | 2075 | ||
2079 | if (cpu_class_is_omap2() && !cpu_is_omap242x()) | 2076 | if (d->dev_caps & IS_RW_PRIORITY) |
2080 | omap_dma_set_global_params(DMA_DEFAULT_ARB_RATE, | 2077 | omap_dma_set_global_params(DMA_DEFAULT_ARB_RATE, |
2081 | DMA_DEFAULT_FIFO_DEPTH, 0); | 2078 | DMA_DEFAULT_FIFO_DEPTH, 0); |
2082 | 2079 | ||
2083 | if (cpu_class_is_omap2()) { | 2080 | if (dma_omap2plus()) { |
2084 | strcpy(irq_name, "0"); | 2081 | strcpy(irq_name, "0"); |
2085 | dma_irq = platform_get_irq_byname(pdev, irq_name); | 2082 | dma_irq = platform_get_irq_byname(pdev, irq_name); |
2086 | if (dma_irq < 0) { | 2083 | if (dma_irq < 0) { |
@@ -2095,9 +2092,8 @@ static int __devinit omap_system_dma_probe(struct platform_device *pdev) | |||
2095 | } | 2092 | } |
2096 | } | 2093 | } |
2097 | 2094 | ||
2098 | /* reserve dma channels 0 and 1 in high security devices */ | 2095 | /* reserve dma channels 0 and 1 in high security devices on 34xx */ |
2099 | if (cpu_is_omap34xx() && | 2096 | if (d->dev_caps & HS_CHANNELS_RESERVED) { |
2100 | (omap_type() != OMAP2_DEVICE_TYPE_GP)) { | ||
2101 | pr_info("Reserving DMA channels 0 and 1 for HS ROM code\n"); | 2097 | pr_info("Reserving DMA channels 0 and 1 for HS ROM code\n"); |
2102 | dma_chan[0].dev_id = 0; | 2098 | dma_chan[0].dev_id = 0; |
2103 | dma_chan[1].dev_id = 1; | 2099 | dma_chan[1].dev_id = 1; |
@@ -2124,7 +2120,7 @@ static int __devexit omap_system_dma_remove(struct platform_device *pdev) | |||
2124 | { | 2120 | { |
2125 | int dma_irq; | 2121 | int dma_irq; |
2126 | 2122 | ||
2127 | if (cpu_class_is_omap2()) { | 2123 | if (dma_omap2plus()) { |
2128 | char irq_name[4]; | 2124 | char irq_name[4]; |
2129 | strcpy(irq_name, "0"); | 2125 | strcpy(irq_name, "0"); |
2130 | dma_irq = platform_get_irq_byname(pdev, irq_name); | 2126 | dma_irq = platform_get_irq_byname(pdev, irq_name); |