aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/common/sa1111.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/common/sa1111.c')
-rw-r--r--arch/arm/common/sa1111.c60
1 files changed, 31 insertions, 29 deletions
diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c
index 9c49a46a2b7a..0569de6acfba 100644
--- a/arch/arm/common/sa1111.c
+++ b/arch/arm/common/sa1111.c
@@ -579,7 +579,36 @@ sa1111_configure_smc(struct sa1111 *sachip, int sdram, unsigned int drac,
579 579
580 sachip->dev->coherent_dma_mask &= sa1111_dma_mask[drac >> 2]; 580 sachip->dev->coherent_dma_mask &= sa1111_dma_mask[drac >> 2];
581} 581}
582#endif
582 583
584#ifdef CONFIG_DMABOUNCE
585/*
586 * According to the "Intel StrongARM SA-1111 Microprocessor Companion
587 * Chip Specification Update" (June 2000), erratum #7, there is a
588 * significant bug in the SA1111 SDRAM shared memory controller. If
589 * an access to a region of memory above 1MB relative to the bank base,
590 * it is important that address bit 10 _NOT_ be asserted. Depending
591 * on the configuration of the RAM, bit 10 may correspond to one
592 * of several different (processor-relative) address bits.
593 *
594 * This routine only identifies whether or not a given DMA address
595 * is susceptible to the bug.
596 *
597 * This should only get called for sa1111_device types due to the
598 * way we configure our device dma_masks.
599 */
600static int sa1111_needs_bounce(struct device *dev, dma_addr_t addr, size_t size)
601{
602 /*
603 * Section 4.6 of the "Intel StrongARM SA-1111 Development Module
604 * User's Guide" mentions that jumpers R51 and R52 control the
605 * target of SA-1111 DMA (either SDRAM bank 0 on Assabet, or
606 * SDRAM bank 1 on Neponset). The default configuration selects
607 * Assabet, so any address in bank 1 is necessarily invalid.
608 */
609 return (machine_is_assabet() || machine_is_pfs168()) &&
610 (addr >= 0xc8000000 || (addr + size) >= 0xc8000000);
611}
583#endif 612#endif
584 613
585static void sa1111_dev_release(struct device *_dev) 614static void sa1111_dev_release(struct device *_dev)
@@ -644,7 +673,8 @@ sa1111_init_one_child(struct sa1111 *sachip, struct resource *parent,
644 dev->dev.dma_mask = &dev->dma_mask; 673 dev->dev.dma_mask = &dev->dma_mask;
645 674
646 if (dev->dma_mask != 0xffffffffUL) { 675 if (dev->dma_mask != 0xffffffffUL) {
647 ret = dmabounce_register_dev(&dev->dev, 1024, 4096); 676 ret = dmabounce_register_dev(&dev->dev, 1024, 4096,
677 sa1111_needs_bounce);
648 if (ret) { 678 if (ret) {
649 dev_err(&dev->dev, "SA1111: Failed to register" 679 dev_err(&dev->dev, "SA1111: Failed to register"
650 " with dmabounce\n"); 680 " with dmabounce\n");
@@ -818,34 +848,6 @@ static void __sa1111_remove(struct sa1111 *sachip)
818 kfree(sachip); 848 kfree(sachip);
819} 849}
820 850
821/*
822 * According to the "Intel StrongARM SA-1111 Microprocessor Companion
823 * Chip Specification Update" (June 2000), erratum #7, there is a
824 * significant bug in the SA1111 SDRAM shared memory controller. If
825 * an access to a region of memory above 1MB relative to the bank base,
826 * it is important that address bit 10 _NOT_ be asserted. Depending
827 * on the configuration of the RAM, bit 10 may correspond to one
828 * of several different (processor-relative) address bits.
829 *
830 * This routine only identifies whether or not a given DMA address
831 * is susceptible to the bug.
832 *
833 * This should only get called for sa1111_device types due to the
834 * way we configure our device dma_masks.
835 */
836int dma_needs_bounce(struct device *dev, dma_addr_t addr, size_t size)
837{
838 /*
839 * Section 4.6 of the "Intel StrongARM SA-1111 Development Module
840 * User's Guide" mentions that jumpers R51 and R52 control the
841 * target of SA-1111 DMA (either SDRAM bank 0 on Assabet, or
842 * SDRAM bank 1 on Neponset). The default configuration selects
843 * Assabet, so any address in bank 1 is necessarily invalid.
844 */
845 return ((machine_is_assabet() || machine_is_pfs168()) &&
846 (addr >= 0xc8000000 || (addr + size) >= 0xc8000000));
847}
848
849struct sa1111_save_data { 851struct sa1111_save_data {
850 unsigned int skcr; 852 unsigned int skcr;
851 unsigned int skpcr; 853 unsigned int skpcr;